(this["webpackJsonpblaze-admin"]=this["webpackJsonpblaze-admin"]||[]).push([[0],{101:function(e,t,n){e.exports={main:"financials_main__1srQU",column:"financials_column__2xOaH",buttons:"financials_buttons__YDYSy",section:"financials_section__-u-IY",summary:"financials_summary__1haJj"}},108:function(e,t,n){e.exports={parentPath:"styles_parentPath__2gMJT",toggleMenu:"styles_toggleMenu__2XgGX",topDivider:"styles_topDivider__ItodY",item:"styles_item__z7Z4E",icon:"styles_icon__2oeoL"}},125:function(e,t,n){e.exports={pagination:"OffsetPagination_pagination__2vG8Q",state:"OffsetPagination_state__1V7K2",page:"OffsetPagination_page__zN2G2",totalPages:"OffsetPagination_totalPages__3Olhc",button:"OffsetPagination_button__33E9g"}},126:function(e,t,n){e.exports={form:"bonus-rounds_form__2hZqp",editRoles:"bonus-rounds_editRoles__2pYrF",actionButton:"bonus-rounds_actionButton__35IBC",closeAccount:"bonus-rounds_closeAccount__2jjur"}},130:function(e,t,n){},133:function(e){e.exports=JSON.parse('{"AFFILIATES_VIEW_LIST":["affiliate_manager","master_affiliate_manager"],"AFFILIATES_VIEW_SYSTEM":["affiliate_manager","master_affiliate_manager"],"AFFILIATES_CREATE_LINK":["influencer_manager","affiliate_manager","master_affiliate_manager"],"AFFILIATES_VIEW_AFFILIATE":["affiliate_manager","master_affiliate_manager"],"AFFILIATES_REFERRAL_VIEW":["affiliate_manager","master_affiliate_manager"],"AFFILIATES_CAMPAIGNS_VIEW":["affiliate_manager","master_affiliate_manager"],"AFFILIATES_CAMPAIGNS_CREATE":["affiliate_manager","master_affiliate_manager"],"AFFILIATES_CAMPAIGNS_UPDATE":["affiliate_manager","master_affiliate_manager"],"AFFILIATES_SET_MANAGER":["affiliate_manager","master_affiliate_manager"],"FLAG_GROUP_CREATE":["product_manager"],"FLAG_GROUP_UPDATE":["product_manager"],"FLAG_GROUP_LIST":["product_manager"],"FLAG_GROUP_LIST_USERS":["product_manager"],"FLAG_GROUP_UPDATE_USER":["product_manager"],"FLAG_GROUP_CREATE_USER":["product_manager"],"ADD_USERS_TO_GROUP":["product_manager"],"SET_USERS_TO_GROUP":["product_manager"],"REMOVE_FEATURE_FLAG_GROUP_FROM_USER":["product_manager"],"REMOVE_FEATURE_FLAG_GROUPS_FROM_USERS":["product_manager"],"SET_GROUPS_TO_USER":["product_manager"],"SET_GROUPS_TO_USERS":["product_manager"],"SET_ENABLED_USER_FROM_GROUP":["product_manager"],"DELETE_BULK_USERS_FROM_GROUP":["product_manager"],"ADD_GROUPS_TO_USER":["product_manager"],"CHAT_BAN_USER":["mod","support"],"CHAT_DELETE_MESSAGE":["mod"],"KYC_VIEW_LIST":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"KYC_UPDATE_VERIFICATION":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"USER_KYC_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"USER_KYC_CREATE_VERIFICATION":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"USER_KYC_UPDATE_VERIFICATION":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","document_approver"],"USER_KYC_SEND_NOTIFICATION":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"USER_DOCUMENTS_VIEW_FILE":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","document_approver"],"USER_DOCUMENTS_VIEW_LIST":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","document_approver"],"DEPOSITS_VIEW_LIST":["support_manager"],"DEPOSITS_CREDIT_DEPOSIT":[],"USER_DEPOSITS_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"WITHDRAWALS_VIEW_LIST":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"WITHDRAWALS_VIEW_PIX_LIST":["payment_agent","payment_agent_tier_1"],"WITHDRAWALS_VIEW_PIX_LIST_OVER_TIER_1":["payment_agent"],"WITHDRAWALS_VIEW_STUCK_LIST":["payment_agent"],"WITHDRAWALS_VIEW_WITHDRAWAL":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"WITHDRAWALS_CREATE_FRAUD_CHECK":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"WITHDRAWALS_UPDATE_WITHDRAWAL":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4"],"WITHDRAWALS_RETRY_WITHDRAWAL":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4"],"WITHDRAWALS_VIEW_REFUNDABLE_DEPOSITS_LIST":["payment_agent"],"WITHDRAWALS_REFUND_DEPOSIT_FOR_WITHDRAWAL":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4"],"WITHDRAWALS_VIEW_LITE":["withdrawal_viewer"],"USER_WITHDRAWALS_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"PAYMENT_PROVIDERS_VIEW_LIST":[],"PAYMENT_PROVIDERS_VIEW_PROVIDER":[],"PAYMENT_PROVIDERS_UPDATE_PROVIDER":[],"PAYMENT_METHODS_VIEW_LIST":[],"PAYMENT_COUNTRY_ORDERING_VIEW_LIST":[],"PAYMENT_COUNTRY_ORDERING_CREATE_ORDERING":[],"PAYMENT_COUNTRY_ORDERING_VIEW_ORDERING":[],"PAYMENT_COUNTRY_ORDERING_UPDATE_ORDERING":[],"PAYMENT_ACCOUNTS_CREATE_INFLUENCER_CARD":[],"USER_PAYMENT_ACCOUNTS_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"GIFT_CARDS_CREATE_BULK":[],"USER_REFERRAL_VIEW":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"REWARDS_VIEW_LIST":["crm_manager"],"REWARDS_VIEW_REWARD":["crm_manager"],"REWARDS_CREATE_REWARD":["crm_manager"],"REWARDS_UPDATE_REWARD":["crm_manager"],"PROCESS_CASHBACK_REWARDS":[],"USER_REWARDS_INVENTORY_VIEW_LIST":["support","fraud_analyst","crm_manager"],"USER_REWARDS_INVENTORY_ADD_REWARD":["reward_grantor"],"USER_REWARDS_INVENTORY_UPDATE_REWARD":["reward_grantor"],"RANKS_VIEW_LIST":[],"RANKS_UPDATE_RANK":[],"LOYALTY_VIEW_LIST":[],"VIEW_CASHBACK_REWARD_DETAILS":["support"],"USER_LOYALTY_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"GLOBAL_XP_VIEW_BONUS":[],"GLOBAL_XP_UPDATE_BONUS":[],"GLOBAL_XP_DISABLE_BONUS":[],"PROMO_CODES_VIEW_LIST":[],"PROMO_CODES_CREATE_CODE":[],"PROMO_CODES_VIEW_LIST_REDEEMS":[],"PROMO_CODES_VIEW_CODE":[],"PROMO_CODES_UPDATE_CODE":[],"MYSTERY_BOXES_VIEW_LIST":[],"MYSTERY_BOXES_CALCULATE_PRICE":[],"MYSTERY_BOXES_CREATE_BOX":[],"MYSTERY_BOXES_VIEW_BOX":[],"MYSTERY_BOXES_REWARD_TIERS_VIEW_LIST":[],"MYSTERY_BOXES_REWARD_TIERS_VIEW_TIER":[],"MYSTERY_BOXES_REWARD_TIERS_CREATE_TIER":[],"MYSTERY_BOXES_REWARD_TIERS_UPDATE_TIER":[],"USER_MYSTERY_BOXES_VIEW_LIST_OPENS":["support","fraud_analyst"],"USER_MYSTERY_BOXES_VIEW_LIST_TRANSACTIONS":["support","fraud_analyst"],"USER_MYSTERY_BOXES_VIEW_LIST_BALANCES":["support","fraud_analyst"],"BONUSES_VIEW_LIST":[],"BONUSES_CREATE_BONUS":[],"BONUSES_UPDATE_BONUS":[],"USER_BONUS_INVENTORY_VIEW":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"USER_BONUS_CONSUMED_BONUSES_VIEW":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"USER_BONUSES_UPDATE_ACTIVATION":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4"],"BONUS_ROUND_WELCOME_PACKAGE_VIEW_LIST":[],"BONUS_ROUND_WELCOME_PACKAGE_CREATE":[],"BONUS_ROUND_WELCOME_PACKAGE_UPDATE":[],"USER_BONUS_ROUNDS_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"USER_BONUS_ROUNDS_TRANSACTIONS_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"USER_VIEW_LIST":["support","support_manager","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver","data_changer","email_changer"],"USER_VIEW_USER":["support","support_manager","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver","data_changer","email_changer"],"USER_UPDATE_SUSPENSION":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4"],"USER_CANCEL_SUSPENSION":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4"],"USER_CLOSE_ACCOUNT":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4"],"USER_UPDATE_WALLET_BALANCE":["financials_credit_requester"],"USER_UPDATE_RANK":[],"USER_UPDATE_ROLES":["role_changer","support_manager"],"USER_UPDATE_LABEL":["role_changer"],"USER_UPDATE_BAN":[],"USER_ADD_ROLE":["role_changer","support_manager"],"USER_REMOVE_ROLE":["role_changer"],"USER_UPDATE_EMAIL":["document_approver","support_manager","payment_agent"],"USER_UPDATE_KYC_INFO":["document_approver"],"USER_KYC_UPLOAD_FILE":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","document_approver"],"USER_UPDATE":[],"USER_TRANSACTIONS_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"USER_FINGERPRINTS_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"USER_NOTES_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"USER_NOTES_CREATE":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"ANNOUNCEMENTS_VIEW_LIST":[],"ANNOUNCEMENTS_CREATE":[],"ANNOUNCEMENTS_DISABLE":[],"SETTINGS_VIEW_LIST":[],"SETTINGS_UPDATE":[],"UPLOADS_CREATE_FILE":["crm_manager"],"REPORTS_VIEW_GLOBAL":[],"REPORTS_VIEW_BALANCES":[],"REPORTS_AFFILIATE_LINK":[],"REPORTS_AFFILIATE_LINKS":[],"REPORTS_USER_FINANCIALS":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"REPORTS_USER_ANTI_FRAUD":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"REPORTS_TOP_REFERRALS":[],"REPORTS_WITHDRAWAL":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4"],"LOYALTY_VIEW_GLOBAL":[],"GAMES_ENABLE_GAME":["casino_coordinator","product_manager"],"GAMES_DISABLE_GAME":["casino_coordinator","product_manager"],"GAME_PROVIDERS_ENABLE_PROVIDER":["casino_coordinator"],"GAME_PROVIDERS_MOVE_GAME_TO_NEW_PROVIDER":["casino_coordinator"],"GAME_PROVIDERS_CHANGE_SLUG":["casino_coordinator"],"GAME_PROVIDERS_CHANGE_GAME_NAME":["casino_coordinator"],"GAME_PROVIDERS_CHANGE_RTP":["casino_coordinator"],"GAME_PROVIDERS_DISABLE_PROVIDER":["casino_coordinator"],"GAME_CATEGORIES_CREATE_CATEGORY":["casino_coordinator"],"GAME_CATEGORIES_ADD_GAME":["casino_coordinator"],"GAME_CATEGORIES_REMOVE_GAME":["casino_coordinator"],"REPORTS_GAME_PROVIDER":["casino_coordinator"],"REPORTS_GAME":["casino_coordinator"],"GAME_PROVIDER_VIEW":["casino_coordinator"],"GAME_VIEW":["casino_coordinator","product_manager"],"GAME_VIEW_LIST":["casino_coordinator","product_manager"],"GAME_PROVIDERS_VIEW":["casino_coordinator"],"GAME_CATEGORY_VIEW":["casino_coordinator"],"VIEW_SEARCH_TERMS":[],"GAMES_VIEW":["casino_coordinator","product_manager"],"GAMES_SEARCH":["casino_coordinator","product_manager"],"REQUEST_USER_UPDATE_EMAIL":["support_manager","email_changer"],"REQUEST_DEPOSITS_CREDIT_DEPOSIT":["support_manager","deposits_credit_requester"],"REQUEST_USER_UPDATE_WALLET_BALANCE":["support_manager"],"REQUEST_USER_UPDATE_KYC_INFO":["support_manager","data_changer"],"REQUEST_REFUND":["financials_refunder"],"USER_GET_FINANCIALS":["document_approver","payment_agent","support"],"BONUSES_VIEW_BONUS":["document_approver","payment_agent","support"],"APPROVE_REFUND":[],"DENY_REFUND":[],"VIEW_REFUNDS":[],"SYSTEM_COMMAND":[],"USER_PAYMENT_ACCOUNTS_UPDATE":[],"USER_UPDATE_CUSTOMER_INFO":["document_approver"],"WITHDRAWALS_BULK_APPROVAL":[],"WITHDRAWALS_BULK_REFUND":[],"WITHDRAWALS_EDIT_PSP_AMOUNT":["payment_agent"],"WITHDRAWALS_COMMANDS":["payment_agent"],"APPROVE_REQUEST":[],"DENY_REQUEST":[],"VIEW_REQUESTS":[],"GAME_CATEGORIES_VIEW_LIST":["casino_coordinator"],"GAME_SEARCH_TERMS_LOCK":[],"GAME_SEARCH_TERMS_UNLOCKED":[],"GAME_SEARCH_TERMS_PUSH_UNLOCKED":[],"GAME_CATEGORIES_CHANGE_NAME":["casino_coordinator"],"SOFTSWISS_FREE_SPINS_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst"],"REWARDS_SOFTSWISS_CREATE_REWARD":[],"USER_VIEW_CRASH_BETS":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"USER_VIEW_ROULETTE_BETS":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"USER_VIEW_GAME_PROVIDER_ROUNDS":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver","casino_coordinator"],"VIEW_DOUBLE_BET":["support","support_manager"],"VIEW_CRASH_BET":["support","support_manager","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"VIEW_ROULETTE_BET":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver"],"VIEW_GAME_PROVIDER_ROUND":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver","casino_coordinator"],"SOFTSWISS_ISSUE_SPINS":[],"SOFTSWISS_CANCEL_SPINS":[],"SOFTSWISS_PROCESS_SPINS":["support"],"GAME_PROVIDERS_DISABLE_DEMO":["casino_coordinator"],"USER_LOYALTY_CREDIT":[],"USER_LOYALTY_CALCULATE":[],"PAYMENT_METHODS_USER_BLACKLISTS_VIEW":["support_manager"],"PAYMENT_METHODS_USER_BLACKLISTS_CREATE":["support_manager"],"PAYMENT_METHODS_USER_BLACKLISTS_DISABLE":["support_manager"],"CREDIT_BONUS_ROUNDS":["support_manager"],"CREDIT_MYSTERY_BOX_SPINS":["support_manager"],"USER_UPDATE_KYC_LEVEL":["payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4"],"WITHDRAWALS_VIEW_AUTOMATED_LIST":["payment_agent"],"MANAGE_USER_PAYMENT_METHODS":["financials_refunder"],"VIEW_BIG_WINS":["casino_coordinator"],"CHALLENGES_VIEW_LIST":["casino_coordinator"],"CHALLENGES_CREATE_RACE":["casino_coordinator"],"RACES_VIEW_LIST":["casino_coordinator"],"RACE_PRIZES_VIEW_LIST":["casino_coordinator"],"RACES_CREATE_RACE":["casino_coordinator"],"RACES_VIEW_RACE":["casino_coordinator"],"OVERDRAFT_ALERTS_USER_LIST_VIEW":["support","payment_agent","fraud_analyst"],"PIX_WITHDRAWALS_TIER_2":["payment_agent_tier_2"],"PIX_WITHDRAWALS_TIER_3":["payment_agent_tier_3"],"PIX_WITHDRAWALS_TIER_4":["payment_agent_tier_4"],"WAITLIST_FEATURE_BULK_GRANT_ACCESS":["product_manager"],"WAITLIST_FEATURE_VIEW_LIST":["product_manager"],"WAITLIST_FEATURE_VIEW":["product_manager"],"CHECK_CPF":["support_manager","email_changer","document_approver","data_changer"],"WAITLIST_FEATURE_UPDATE_STATUS":["product_manager"],"WAITLIST_FEATURE_CHANGE_USER_STATUS":["product_manager"],"USER_OTP_VIEW_LIST":["support","payment_agent","payment_agent_tier_1","payment_agent_tier_2","payment_agent_tier_3","payment_agent_tier_4","fraud_analyst","document_approver","support_manager","data_changer"],"USER_OTP_DELETE_PHONE":["support_manager","fraud_analyst","document_approver","data_changer"]}')},143:function(e,t,n){e.exports={container:"translator_container__1C5p5",contentEntry:"translator_contentEntry__3j73G",textAreaLocale:"translator_textAreaLocale__3j0gV",textAreaContent:"translator_textAreaContent__2D0zW",Select:"translator_Select__3NpMy",translatorWrap:"translator_translatorWrap__1AthY"}},154:function(e,t,n){},165:function(e,t,n){e.exports={container:"styles_container__2u6eA",field:"styles_field__8h_ir"}},167:function(e,t,n){e.exports={ul:"styles_ul__qKaza",icon:"styles_icon__37b8h",burger:"styles_burger__1QHXN",search:"styles_search__30qVb",drawer:"styles_drawer__21R9Y"}},173:function(e,t,n){},209:function(e,t,n){e.exports={tabbedNav:"tabRaces_tabbedNav__1Oglt",selected:"tabRaces_selected__1NKPD",inputs:"tabRaces_inputs__3Ln2l"}},210:function(e,t,n){e.exports={tabbedNav:"tabChallenges_tabbedNav__1sEOz",selected:"tabChallenges_selected__2m7bW",inputs:"tabChallenges_inputs__2ChmW"}},211:function(e,t,n){e.exports={tabbedNav:"tabRaceDetail_tabbedNav__jZjfC",selected:"tabRaceDetail_selected__21Zys",inputs:"tabRaceDetail_inputs__3WjRC"}},227:function(e,t,n){},228:function(e,t,n){},229:function(e,t,n){},231:function(e,t,n){},27:function(e,t,n){e.exports={panel:"styles_panel__2Mov6",titlePanel:"styles_titlePanel__fHDgG",form:"styles_form__jxDhJ",formSelect:"styles_formSelect__3sPJ5 styles_form__jxDhJ",field:"styles_field__16KSJ",message:"styles_message__3LAp7",input:"styles_input__2vkae",buttons:"styles_buttons__1TqBP",stat:"styles_stat__1Z2rN",singleInput:"styles_singleInput__1QchP"}},277:function(e,t){e.exports.permissionsConstants={AFFILIATES_VIEW_LIST:"AFFILIATES_VIEW_LIST",AFFILIATES_VIEW_SYSTEM:"AFFILIATES_VIEW_SYSTEM",AFFILIATES_VIEW_LINK:"AFFILIATES_VIEW_LINK",AFFILIATES_CREATE_LINK:"AFFILIATES_CREATE_LINK",CHAT_BAN_USER:"CHAT_BAN_USER",CHAT_DELETE_MESSAGE:"CHAT_DELETE_MESSAGE",KYC_VIEW_LIST:"KYC_VIEW_LIST",KYC_UPDATE_VERIFICATION:"KYC_UPDATE_VERIFICATION",USER_KYC_VIEW_LIST:"USER_KYC_VIEW_LIST",USER_KYC_CREATE_VERIFICATION:"USER_KYC_CREATE_VERIFICATION",USER_KYC_UPDATE_VERIFICATION:"USER_KYC_UPDATE_VERIFICATION",USER_KYC_SEND_NOTIFICATION:"USER_KYC_SEND_NOTIFICATION",USER_DOCUMENTS_VIEW_FILE:"USER_DOCUMENTS_VIEW_FILE",USER_DOCUMENTS_VIEW_LIST:"USER_DOCUMENTS_VIEW_LIST",DEPOSITS_VIEW_LIST:"DEPOSITS_VIEW_LIST",DEPOSITS_CREDIT_DEPOSIT:"DEPOSITS_CREDIT_DEPOSIT",DEPOSITS_CREDIT_FAKE:"DEPOSITS_CREDIT_FAKE",USER_DEPOSITS_VIEW_LIST:"USER_DEPOSITS_VIEW_LIST",WITHDRAWALS_VIEW_LIST:"WITHDRAWALS_VIEW_LIST",WITHDRAWALS_VIEW_PIX_LIST:"WITHDRAWALS_VIEW_PIX_LIST",WITHDRAWALS_VIEW_PIX_LIST_OVER_TIER_1:"WITHDRAWALS_VIEW_PIX_LIST_OVER_TIER_1",WITHDRAWALS_VIEW_STUCK_LIST:"WITHDRAWALS_VIEW_STUCK_LIST",WITHDRAWALS_VIEW_WITHDRAWAL:"WITHDRAWALS_VIEW_WITHDRAWAL",WITHDRAWALS_CREATE_FRAUD_CHECK:"WITHDRAWALS_CREATE_FRAUD_CHECK",WITHDRAWALS_UPDATE_WITHDRAWAL:"WITHDRAWALS_UPDATE_WITHDRAWAL",WITHDRAWALS_RETRY_WITHDRAWAL:"WITHDRAWALS_RETRY_WITHDRAWAL",WITHDRAWALS_VIEW_REFUNDABLE_DEPOSITS_LIST:"WITHDRAWALS_VIEW_REFUNDABLE_DEPOSITS_LIST",WITHDRAWALS_REFUND_DEPOSIT_FOR_WITHDRAWAL:"WITHDRAWALS_REFUND_DEPOSIT_FOR_WITHDRAWAL",WITHDRAWALS_VIEW_LITE:"WITHDRAWALS_VIEW_LITE",USER_WITHDRAWALS_VIEW_LIST:"USER_WITHDRAWALS_VIEW_LIST",PAYMENT_PROVIDERS_VIEW_LIST:"PAYMENT_PROVIDERS_VIEW_LIST",PAYMENT_PROVIDERS_VIEW_PROVIDER:"PAYMENT_PROVIDERS_VIEW_PROVIDER",PAYMENT_PROVIDERS_UPDATE_PROVIDER:"PAYMENT_PROVIDERS_UPDATE_PROVIDER",PAYMENT_METHODS_VIEW_LIST:"PAYMENT_METHODS_VIEW_LIST",PAYMENT_COUNTRY_ORDERING_VIEW_LIST:"PAYMENT_COUNTRY_ORDERING_VIEW_LIST",PAYMENT_COUNTRY_ORDERING_CREATE_ORDERING:"PAYMENT_COUNTRY_ORDERING_CREATE_ORDERING",PAYMENT_COUNTRY_ORDERING_VIEW_ORDERING:"PAYMENT_COUNTRY_ORDERING_VIEW_ORDERING",PAYMENT_COUNTRY_ORDERING_UPDATE_ORDERING:"PAYMENT_COUNTRY_ORDERING_UPDATE_ORDERING",PAYMENT_ACCOUNTS_CREATE_INFLUENCER_CARD:"PAYMENT_ACCOUNTS_CREATE_INFLUENCER_CARD",USER_REFERRAL_VIEW:"USER_REFERRAL_VIEW",REWARDS_VIEW_LIST:"REWARDS_VIEW_LIST",REWARDS_VIEW_REWARD:"REWARDS_VIEW_REWARD",REWARDS_CREATE_REWARD:"REWARDS_CREATE_REWARD",REWARDS_UPDATE_REWARD:"REWARDS_UPDATE_REWARD",PROCESS_CASHBACK_REWARDS:"PROCESS_CASHBACK_REWARDS",USER_REWARDS_INVENTORY_VIEW_LIST:"USER_REWARDS_INVENTORY_VIEW_LIST",USER_REWARDS_INVENTORY_ADD_REWARD:"USER_REWARDS_INVENTORY_ADD_REWARD",USER_REWARDS_INVENTORY_UPDATE_REWARD:"USER_REWARDS_INVENTORY_UPDATE_REWARD",RANKS_VIEW_LIST:"RANKS_VIEW_LIST",RANKS_UPDATE_RANK:"RANKS_UPDATE_RANK",GLOBAL_XP_VIEW_BONUS:"GLOBAL_XP_VIEW_BONUS",GLOBAL_XP_UPDATE_BONUS:"GLOBAL_XP_UPDATE_BONUS",GLOBAL_XP_DISABLE_BONUS:"GLOBAL_XP_DISABLE_BONUS",PROMO_CODES_VIEW_LIST:"PROMO_CODES_VIEW_LIST",PROMO_CODES_CREATE_CODE:"PROMO_CODES_CREATE_CODE",PROMO_CODES_VIEW_LIST_REDEEMS:"PROMO_CODES_VIEW_LIST_REDEEMS",PROMO_CODES_VIEW_CODE:"PROMO_CODES_VIEW_CODE",PROMO_CODES_UPDATE_CODE:"PROMO_CODES_UPDATE_CODE",MYSTERY_BOXES_VIEW_LIST:"MYSTERY_BOXES_VIEW_LIST",MYSTERY_BOXES_CALCULATE_PRICE:"MYSTERY_BOXES_CALCULATE_PRICE",MYSTERY_BOXES_CREATE_BOX:"MYSTERY_BOXES_CREATE_BOX",MYSTERY_BOXES_VIEW_BOX:"MYSTERY_BOXES_VIEW_BOX",MYSTERY_BOXES_REWARD_TIERS_VIEW_LIST:"MYSTERY_BOXES_REWARD_TIERS_VIEW_LIST",MYSTERY_BOXES_REWARD_TIERS_VIEW_TIER:"MYSTERY_BOXES_REWARD_TIERS_VIEW_TIER",MYSTERY_BOXES_REWARD_TIERS_CREATE_TIER:"MYSTERY_BOXES_REWARD_TIERS_CREATE_TIER",MYSTERY_BOXES_REWARD_TIERS_UPDATE_TIER:"MYSTERY_BOXES_REWARD_TIERS_UPDATE_TIER",USER_MYSTERY_BOXES_VIEW_LIST_OPENS:"USER_MYSTERY_BOXES_VIEW_LIST_OPENS",USER_MYSTERY_BOXES_VIEW_LIST_TRANSACTIONS:"USER_MYSTERY_BOXES_VIEW_LIST_TRANSACTIONS",USER_MYSTERY_BOXES_VIEW_LIST_BALANCES:"USER_MYSTERY_BOXES_VIEW_LIST_BALANCES",BONUSES_VIEW_LIST:"BONUSES_VIEW_LIST",BONUSES_CREATE_BONUS:"BONUSES_CREATE_BONUS",BONUSES_UPDATE_BONUS:"BONUSES_UPDATE_BONUS",USER_BONUS_INVENTORY_VIEW:"USER_BONUS_INVENTORY_VIEW",USER_BONUS_CONSUMED_BONUSES_VIEW:"USER_BONUS_CONSUMED_BONUSES_VIEW",USER_BONUSES_UPDATE_ACTIVATION:"USER_BONUSES_UPDATE_ACTIVATION",BONUS_ROUND_WELCOME_PACKAGE_VIEW_LIST:"BONUS_ROUND_WELCOME_PACKAGE_VIEW_LIST",BONUS_ROUND_WELCOME_PACKAGE_CREATE:"BONUS_ROUND_WELCOME_PACKAGE_CREATE",BONUS_ROUND_WELCOME_PACKAGE_UPDATE:"BONUS_ROUND_WELCOME_PACKAGE_UPDATE",USER_VIEW_LIST:"USER_VIEW_LIST",USER_VIEW_USER:"USER_VIEW_USER",CHECK_CPF:"CHECK_CPF",USER_UPDATE_SUSPENSION:"USER_UPDATE_SUSPENSION",USER_CANCEL_SUSPENSION:"USER_CANCEL_SUSPENSION",USER_CLOSE_ACCOUNT:"USER_CLOSE_ACCOUNT",USER_UPDATE_WALLET_BALANCE:"USER_UPDATE_WALLET_BALANCE",USER_UPDATE_RANK:"USER_UPDATE_RANK",USER_UPDATE_ROLES:"USER_UPDATE_ROLES",USER_UPDATE_LABEL:"USER_UPDATE_LABEL",USER_UPDATE_BAN:"USER_UPDATE_BAN",USER_ADD_ROLE:"USER_ADD_ROLE",USER_REMOVE_ROLE:"USER_REMOVE_ROLE",USER_VIEW_LIST_PERMISSIONS:"USER_VIEW_LIST_PERMISSIONS",USER_UPDATE_PERMISSIONS:"USER_UPDATE_PERMISSIONS",USER_REMOVE_PERMISSIONS:"USER_REMOVE_PERMISSIONS",USER_UPDATE_EMAIL:"USER_UPDATE_EMAIL",USER_UPDATE_KYC_INFO:"USER_UPDATE_KYC_INFO",USER_KYC_UPLOAD_FILE:"USER_KYC_UPLOAD_FILE",USER_UPDATE:"USER_UPDATE",USER_CREATE:"USER_CREATE",USER_ENABLE_TWO_FACTOR:"USER_ENABLE_TWO_FACTOR",USER_ACTIVATE_TWO_FACTOR:"USER_ACTIVATE_TWO_FACTOR",USER_TRANSACTIONS_VIEW_LIST:"USER_TRANSACTIONS_VIEW_LIST",USER_FINGERPRINTS_VIEW_LIST:"USER_FINGERPRINTS_VIEW_LIST",USER_NOTES_VIEW_LIST:"USER_NOTES_VIEW_LIST",USER_NOTES_CREATE:"USER_NOTES_CREATE",ANNOUNCEMENTS_VIEW_LIST:"ANNOUNCEMENTS_VIEW_LIST",ANNOUNCEMENTS_CREATE:"ANNOUNCEMENTS_CREATE",ANNOUNCEMENTS_DISABLE:"ANNOUNCEMENTS_DISABLE",SETTINGS_VIEW_LIST:"SETTINGS_VIEW_LIST",SETTINGS_UPDATE:"SETTINGS_UPDATE",UPLOADS_CREATE_FILE:"UPLOADS_CREATE_FILE",REPORTS_USER_FINANCIALS:"REPORTS_USER_FINANCIALS",REPORTS_USER_ANTI_FRAUD:"REPORTS_USER_ANTI_FRAUD",REPORTS_WITHDRAWAL:"REPORTS_WITHDRAWAL",GAMES_ENABLE_GAME:"GAMES_ENABLE_GAME",GAMES_DISABLE_GAME:"GAMES_DISABLE_GAME",GAMES_CHANGE_IMAGE_URL:"GAMES_CHANGE_IMAGE_URL",GAME_PROVIDERS_ENABLE_PROVIDER:"GAME_PROVIDERS_ENABLE_PROVIDER",GAME_PROVIDERS_MOVE_GAME_TO_NEW_PROVIDER:"GAME_PROVIDERS_MOVE_GAME_TO_NEW_PROVIDER",GAME_PROVIDERS_CHANGE_SLUG:"GAME_PROVIDERS_CHANGE_SLUG",GAME_PROVIDERS_CHANGE_GAME_NAME:"GAME_PROVIDERS_CHANGE_GAME_NAME",GAME_PROVIDERS_CHANGE_RTP:"GAME_PROVIDERS_CHANGE_RTP",GAME_PROVIDERS_DISABLE_PROVIDER:"GAME_PROVIDERS_DISABLE_PROVIDER",GAME_CATEGORIES_CREATE_CATEGORY:"GAME_CATEGORIES_CREATE_CATEGORY",GAME_CATEGORIES_ADD_GAME:"GAME_CATEGORIES_ADD_GAME",GAME_CATEGORIES_REMOVE_GAME:"GAME_CATEGORIES_REMOVE_GAME",GAME_PROVIDER_VIEW:"GAME_PROVIDER_VIEW",GAME_VIEW:"GAME_VIEW",GAME_VIEW_LIST:"GAME_VIEW_LIST",GAME_PROVIDERS_VIEW:"GAME_PROVIDERS_VIEW",GAME_CATEGORY_VIEW:"GAME_CATEGORY_VIEW",VIEW_SEARCH_TERMS:"VIEW_SEARCH_TERMS",GAMES_VIEW:"GAMES_VIEW",GAMES_SEARCH:"GAMES_SEARCH",REQUEST_USER_UPDATE_EMAIL:"REQUEST_USER_UPDATE_EMAIL",REQUEST_DEPOSITS_CREDIT_DEPOSIT:"REQUEST_DEPOSITS_CREDIT_DEPOSIT",REQUEST_USER_UPDATE_WALLET_BALANCE:"REQUEST_USER_UPDATE_WALLET_BALANCE",REQUEST_USER_UPDATE_KYC_INFO:"REQUEST_USER_UPDATE_KYC_INFO",REQUEST_REFUND:"REQUEST_REFUND",APPROVE_REFUND:"APPROVE_REFUND",DENY_REFUND:"DENY_REFUND",VIEW_REFUNDS:"VIEW_REFUNDS",USER_PAYMENT_ACCOUNTS_UPDATE:"USER_PAYMENT_ACCOUNTS_UPDATE",USER_UPDATE_CUSTOMER_INFO:"USER_UPDATE_CUSTOMER_INFO",WITHDRAWALS_BULK_APPROVAL:"WITHDRAWALS_BULK_APPROVAL",WITHDRAWALS_BULK_REFUND:"WITHDRAWALS_BULK_REFUND",WITHDRAWALS_EDIT_PSP_AMOUNT:"WITHDRAWALS_EDIT_PSP_AMOUNT",WITHDRAWALS_COMMANDS:"WITHDRAWALS_COMMANDS",APPROVE_REQUEST:"APPROVE_REQUEST",DENY_REQUEST:"DENY_REQUEST",VIEW_REQUESTS:"VIEW_REQUESTS",GAME_CATEGORIES_VIEW_LIST:"GAME_CATEGORIES_VIEW_LIST",GAME_SEARCH_TERMS_LOCK:"GAME_SEARCH_TERMS_LOCK",GAME_SEARCH_TERMS_UNLOCKED:"GAME_SEARCH_TERMS_UNLOCKED",GAME_SEARCH_TERMS_PUSH_UNLOCKED:"GAME_SEARCH_TERMS_PUSH_UNLOCKED",GAME_CATEGORIES_CHANGE_NAME:"GAME_CATEGORIES_CHANGE_NAME",SOFTSWISS_FREE_SPINS_VIEW_LIST:"SOFTSWISS_FREE_SPINS_VIEW_LIST",REWARDS_SOFTSWISS_CREATE_REWARD:"REWARDS_SOFTSWISS_CREATE_REWARD",USER_VIEW_CRASH_BETS:"USER_VIEW_CRASH_BETS",USER_VIEW_ROULETTE_BETS:"USER_VIEW_ROULETTE_BETS",SOFTSWISS_ISSUE_SPINS:"SOFTSWISS_ISSUE_SPINS",SOFTSWISS_CANCEL_SPINS:"SOFTSWISS_CANCEL_SPINS",SOFTSWISS_PROCESS_SPINS:"SOFTSWISS_PROCESS_SPINS",GAME_PROVIDERS_DISABLE_DEMO:"GAME_PROVIDERS_DISABLE_DEMO",LOYALTY_CREDIT:"LOYALTY_CREDIT",LOYALTY_CALCULATE:"LOYALTY_CALCULATE",CREDIT_BONUS_ROUNDS:"CREDIT_BONUS_ROUNDS",CREDIT_MYSTERY_BOX_SPINS:"CREDIT_MYSTERY_BOX_SPINS",RACE_CREATE:"RACE_CREATE",RACE_PRIZE_CREATE:"RACE_PRIZE_CREATE",RACE_UPDATE:"RACE_UPDATE",RACE_DELETE:"RACE_DELETE",RACE_PRIZE_UPDATE:"RACE_PRIZE_UPDATE",RACE_PRIZES_GET:"RACE_PRIZES_GET",WEEKLY_CASHBACK_RETRY:"WEEKLY_CASHBACK_RETRY",RAFFLE_CALCULATE_TOTAL_TICKETS:"RAFFLE_CALCULATE_TOTAL_TICKETS",RAFFLE_CALCULATE_WINNING_USER:"RAFFLE_CALCULATE_WINNING_USER",RAFFLE_VIEW_LIST:"RAFFLE_VIEW_LIST",USER_GET_FINANCIALS:"USER_GET_FINANCIALS",BONUSES_VIEW_BONUS:"BONUSES_VIEW_BONUS",USER_GET_ANTI_FRAUD:"USER_GET_ANTI_FRAUD",USER_REPAIR_WALLET:"USER_REPAIR_WALLET",USER_ROUTE_PERMISSION:"USER_ROUTE_PERMISSION",UPDATE_USER_ROUTE_PERMISSION:"UPDATE_USER_ROUTE_PERMISSION",USER_ROUTE_MAPPING:"USER_ROUTE_MAPPING",UPDATE_USER_ROUTE_MAPPING:"UPDATE_USER_ROUTE_MAPPING",GET_USER_ROUTE_PERMISSIONS:"GET_USER_ROUTE_PERMISSIONS",GET_USER_ROUTE_MAPPINGS:"GET_USER_ROUTE_MAPPINGS",USER_GET_REPAIRABLE_WALLETS:"USER_GET_REPAIRABLE_WALLETS",USER_UPDATE_KYC_LEVEL:"USER_UPDATE_KYC_LEVEL",WITHDRAWALS_VIEW_AUTOMATED_LIST:"WITHDRAWALS_VIEW_AUTOMATED_LIST",CLOSE_ROUND:"CLOSE_ROUND",REFUND_ROUND:"REFUND_ROUND",VIEW_GAME_PROVIDER_ROUND:"VIEW_GAME_PROVIDER_ROUND",USER_VIEW_GAME_PROVIDER_ROUNDS:"USER_VIEW_GAME_PROVIDER_ROUNDS",VIEW_ROULETTE_BET:"VIEW_ROULETTE_BET",VIEW_CRASH_BET:"VIEW_CRASH_BET",USER_VIEW_MINES_BETS:"USER_VIEW_MINES_BETS",VIEW_MINES_BET:"VIEW_MINES_BET",USER_VIEW_DICE_BETS:"USER_VIEW_DICE_BETS",VIEW_DICE_BET:"VIEW_DICE_BET",LOYALTY_VIEW_LIST:"LOYALTY_VIEW_LIST",USER_LOYALTY_VIEW_LIST:"USER_LOYALTY_VIEW_LIST",VIEW_CASHBACK_REWARD_DETAILS:"VIEW_CASHBACK_REWARD_DETAILS",USER_PAYMENT_ACCOUNTS_VIEW_LIST:"USER_PAYMENT_ACCOUNTS_VIEW_LIST",USER_BONUS_ROUNDS_VIEW_LIST:"USER_BONUS_ROUNDS_VIEW_LIST",USER_BONUS_ROUNDS_TRANSACTIONS_VIEW_LIST:"USER_BONUS_ROUNDS_TRANSACTIONS_VIEW_LIST",PAYMENT_METHODS_USER_BLACKLISTS_VIEW:"PAYMENT_METHODS_USER_BLACKLISTS_VIEW",PAYMENT_METHODS_USER_BLACKLISTS_CREATE:"PAYMENT_METHODS_USER_BLACKLISTS_CREATE",PAYMENT_METHODS_USER_BLACKLISTS_DISABLE:"PAYMENT_METHODS_USER_BLACKLISTS_DISABLE",PAYMENT_PLATFORMS_UPDATE_METHOD:"PAYMENT_PLATFORMS_UPDATE_METHOD",AFFILIATES_VIEW_AFFILIATE:"AFFILIATES_VIEW_AFFILIATE",AFFILIATES_REFERRAL_VIEW:"AFFILIATES_REFERRAL_VIEW",AFFILIATES_CAMPAIGNS_VIEW:"AFFILIATES_CAMPAIGNS_VIEW",AFFILIATES_CAMPAIGNS_CREATE:"AFFILIATES_CAMPAIGNS_CREATE",AFFILIATES_CAMPAIGNS_UPDATE:"AFFILIATES_CAMPAIGNS_UPDATE",AFFILIATES_SET_MANAGER:"AFFILIATES_SET_MANAGER",FLAG_GROUP_CREATE:"FLAG_GROUP_CREATE",FLAG_GROUP_UPDATE:"FLAG_GROUP_UPDATE",FLAG_GROUP_LIST:"FLAG_GROUP_LIST",FLAG_GROUP_LIST_USERS:"FLAG_GROUP_LIST_USERS",FLAG_GROUP_UPDATE_USER:"FLAG_GROUP_UPDATE_USER",FLAG_GROUP_CREATE_USER:"FLAG_GROUP_CREATE_USER",ADD_USERS_TO_GROUP:"ADD_USERS_TO_GROUP",SET_USERS_TO_GROUP:"SET_USERS_TO_GROUP",REMOVE_FEATURE_FLAG_GROUP_FROM_USER:"REMOVE_FEATURE_FLAG_GROUP_FROM_USER",REMOVE_FEATURE_FLAG_GROUPS_FROM_USERS:"REMOVE_FEATURE_FLAG_GROUPS_FROM_USERS",SET_GROUPS_TO_USER:"SET_GROUPS_TO_USER",SET_GROUPS_TO_USERS:"SET_GROUPS_TO_USERS",SET_ENABLED_USER_FROM_GROUP:"SET_ENABLED_USER_FROM_GROUP",DELETE_BULK_USERS_FROM_GROU:"DELETE_BULK_USERS_FROM_GROUP",ADD_GROUPS_TO_USER:"ADD_GROUPS_TO_USER",WAITLIST_FEATURE_BULK_GRANT_ACCESS:"WAITLIST_FEATURE_BULK_GRANT_ACCESS",WAITLIST_FEATURE_VIEW_LIST:"WAITLIST_FEATURE_VIEW_LIST",WAITLIST_FEATURE_VIEW:"WAITLIST_FEATURE_VIEW",WAITLIST_FEATURE_UPDATE_STATUS:"WAITLIST_FEATURE_UPDATE_STATUS",WAITLIST_FEATURE_CHANGE_USER_STATUS:"WAITLIST_FEATURE_CHANGE_USER_STATUS",VIEW_CUSTOM_ANALYTICS:"VIEW_CUSTOM_ANALYTICS",VIEW_CUSTOM_ANALYTICS_ACTION_TYPES:"VIEW_CUSTOM_ANALYTICS_ACTION_TYPES",STATUS_MONITORING:"STATUS_MONITORING",PIX_WITHDRAWALS_TIER_2:"PIX_WITHDRAWALS_TIER_2",PIX_WITHDRAWALS_TIER_3:"PIX_WITHDRAWALS_TIER_3",PIX_WITHDRAWALS_TIER_4:"PIX_WITHDRAWALS_TIER_4",USER_OTP_VIEW_LIST:"USER_OTP_VIEW_LIST",USER_OTP_DELETE_PHONE:"USER_OTP_DELETE_PHONE"}},294:function(e,t,n){},295:function(e,t,n){},34:function(e,t,n){var a=["GAMES_VIEW_GAME","GAMES_VIEW_LIST","GAMES_ENABLE_GAME","GAMES_DISABLE_GAME","GAME_PROVIDERS_ENABLE_PROVIDER","GAME_PROVIDERS_DISABLE_PROVIDER","GAME_PROVIDERS_VIEW_LIST","GAME_PROVIDERS_VIEW_PROVIDER","GAME_CATEGORIES_VIEW_LIST","GAME_CATEGORIES_VIEW_CATEGORY","GAME_CATEGORIES_CREATE_CATEGORY","GAME_CATEGORIES_ADD_GAME","GAME_CATEGORIES_REMOVE_GAME","GAME_CATEGORIES_UPDATE_ORDINALITY"];e.exports={SYSTEM:{SETTINGS:n(430),GAMING_SERVICE_SETTINGS:["GAMING_SERVICE_SETTINGS_VIEW_LIST","GAMING_SERVICE_SETTINGS_UPDATE"],WAITLIST_MANAGEMENT:["WAITLIST_FEATURE_BULK_GRANT_ACCESS","WAITLIST_FEATURE_CHANGE_USER_STATUS","WAITLIST_FEATURE_UPDATE_STATUS","WAITLIST_FEATURE_VIEW","WAITLIST_FEATURE_VIEW_LIST"],GROUPS:["FLAG_GROUP_CREATE","FLAG_GROUP_UPDATE","FLAG_GROUP_LIST","FLAG_GROUP_LIST_USERS","FLAG_GROUP_UPDATE_USER","FLAG_GROUP_CREATE_USER","ADD_USERS_TO_GROUP","SET_USERS_TO_GROUP","REMOVE_FEATURE_FLAG_GROUP_FROM_USER","REMOVE_FEATURE_FLAG_GROUPS_FROM_USERS:","SET_GROUPS_TO_USER","SET_GROUPS_TO_USERS","SET_ENABLED_USER_FROM_GROUP","DELETE_BULK_USERS_FROM_GROU","ADD_GROUPS_TO_USER"],RAFFLE_MANAGER:["RAFFLE_CALCULATE_TOTAL_TICKETS","RAFFLE_CALCULATE_WINNING_USER","RAFFLE_VIEW_LIST"],CUSTOM_ANALYTICS:["VIEW_CUSTOM_ANALYTICS","VIEW_CUSTOM_ANALYTICS_ACTION_TYPES"],STAFF_MANAGER:["APPROVE_REQUEST","DENY_REQUEST","VIEW_REQUESTS"]},MARKETING:{ANNOUNCEMENTS:["ANNOUNCEMENTS_VIEW_LIST","ANNOUNCEMENTS_CREATE","ANNOUNCEMENTS_VIEW"],AFFILIATE_LINKS:["AFFILIATES_VIEW_LIST","AFFILIATES_CREATE_LINK","AFFILIATES_VIEW_LINK"],REFERRAL_CODES:["REPORTS_TOP_REFERRALS"]},REWARDS:{GENERAL:["REWARDS_VIEW_LIST","REWARDS_VIEW_REWARD","REWARDS_CREATE_REWARD","REWARDS_UPDATE_REWARD","PROCESS_CASHBACK_REWARDS"],MYSTERY_BOXES:["MYSTERY_BOXES_VIEW_LIST","MYSTERY_BOXES_CALCULATE_PRICE","MYSTERY_BOXES_CREATE_BOX","MYSTERY_BOXES_VIEW_BOX"],REWARD_TIERS:["MYSTERY_BOXES_REWARD_TIERS_VIEW_LIST","MYSTERY_BOXES_REWARD_TIERS_VIEW_TIER","MYSTERY_BOXES_REWARD_TIERS_CREATE_TIER","MYSTERY_BOXES_REWARD_TIERS_UPDATE_TIER"],USER_RANKS:["RANKS_VIEW_LIST","RANKS_UPDATE_RANK"],GLOBAL_XP:["GLOBAL_XP_VIEW_BONUS","GLOBAL_XP_UPDATE_BONUS","GLOBAL_XP_DISABLE_BONUS"],PROMO_CODES:["PROMO_CODES_VIEW_LIST","PROMO_CODES_CREATE_CODE","PROMO_CODES_VIEW_LIST_REDEEMS","PROMO_CODES_VIEW_CODE","PROMO_CODES_UPDATE_CODE"],BONUSES:["BONUSES_VIEW_LIST","BONUSES_CREATE_BONUS","BONUSES_UPDATE_BONUS","BONUSES_VIEW_BONUS","BONUS_ROUND_WELCOME_PACKAGE_VIEW_LIST","BONUS_ROUND_WELCOME_PACKAGE_CREATE","BONUS_ROUND_WELCOME_PACKAGE_UPDATE"],RACES:["RACES_VIEW_LIST","RACE_PRIZES_VIEW_LIST","RACES_CREATE_RACE","RACES_VIEW_RACE"],SUPPORTED_CURRENCIES:["SUPPORTED_CURRENCIES_VIEW_LIST"],CHALLENGES:["CHALLENGES_VIEW_LIST","CHALLENGES_CREATE_RACE"],BONUS_WELCOME_PACKAGE:["BONUS_ROUND_WELCOME_PACKAGE_VIEW_LIST","BONUS_ROUND_WELCOME_PACKAGE_CREATE","BONUS_ROUND_WELCOME_PACKAGE_UPDATE"],LOYALTY:["LOYALTY_VIEW_LIST"]},USERS:{GENERAL:["USER_VIEW_LIST","USER_VIEW_USER"],INFO:["USER_VIEW_USER","USER_UPDATE_EMAIL","USER_UPDATE_KYC_INFO","USER_UPDATE","USER_UPDATE_SUSPENSION","USER_CANCEL_SUSPENSION","USER_UPDATE_BAN"],KYC:["USER_KYC_VIEW_LIST","USER_KYC_UPLOAD_FILE","USER_KYC_CREATE_VERIFICATION","USER_KYC_UPDATE_VERIFICATION","USER_KYC_SEND_NOTIFICATION","USER_KYC_SEND_NOTIFICATION","USER_DOCUMENTS_VIEW_LIST","USER_DOCUMENTS_VIEW_FILE"],DOCUMENTS:["USER_DOCUMENTS_VIEW_LIST","USER_DOCUMENTS_VIEW_FILE"],UPDATE_EMAIL:["USER_UPDATE_EMAIL","REQUEST_USER_UPDATE_EMAIL"],BALANCES:["USER_VIEW_USER","USER_UPDATE_WALLET_BALANCE"],UPDATE_BALANCES:["REQUEST_USER_UPDATE_WALLET_BALANCE","USER_UPDATE_WALLET_BALANCE","REQUEST_REFUND"],TRANSACTIONS:["USER_TRANSACTIONS_VIEW_LIST"],ROLES:["USER_CLOSE_ACCOUNT","USER_UPDATE_RANK","USER_UPDATE_ROLES","USER_UPDATE_LABEL","USER_ADD_ROLE","USER_REMOVE_ROLE"],PERMISSIONS:["USER_VIEW_LIST_PERMISSIONS","USER_UPDATE_PERMISSIONS","USER_REMOVE_PERMISSIONS"],FINGERPRINTS:["USER_FINGERPRINTS_VIEW_LIST"],MUTUAL:["USER_FINGERPRINTS_VIEW_LIST"],BONUSES:["USER_VIEW_USER","BONUSES_VIEW_LIST","USER_BONUSES_ADD_BONUS","USER_BONUSES_UPDATE_ACTIVATION"],DEPOSITS:["USER_DEPOSITS_VIEW_LIST"],BETS:["USER_VIEW_CRASH_BETS","USER_VIEW_ROULETTE_BETS"],NOTES:["USER_NOTES_VIEW_LIST","USER_NOTES_CREATE"],WITHDRAWALS:["USER_WITHDRAWALS_VIEW_LIST"],BONUS_ROUNDS:["USER_BONUS_ROUNDS_VIEW_LIST","USER_BONUS_ROUNDS_ADD_ROUNDS","USER_BONUS_ROUNDS_TRANSACTIONS_VIEW_LIST"],MYSTERY_BOX_BALANCES:["USER_MYSTERY_BOXES_VIEW_LIST_OPENSUSER_MYSTERY_BOXES_VIEW_LIST_TRANSACTIONS","USER_MYSTERY_BOXES_ADD_SPINS","USER_MYSTERY_BOXES_VIEW_LIST_BALANCES"],MYSTERY_BOX_OPENS:["USER_MYSTERY_BOXES_VIEW_LIST_OPENSUSER_MYSTERY_BOXES_VIEW_LIST_TRANSACTIONS","USER_MYSTERY_BOXES_ADD_SPINS","USER_MYSTERY_BOXES_VIEW_LIST_BALANCES"],REWARDS:["USER_REWARDS_INVENTORY_VIEW_LIST","USER_REWARDS_INVENTORY_ADD_REWARD","USER_REWARDS_INVENTORY_UPDATE_REWARD","VIEW_CASHBACK_REWARD_DETAILS"],REFERRALS:["USER_REFERRAL_VIEW"],LOYALTY:["USER_LOYALTY_VIEW_LIST"],GAMES:["USER_GAME_PROVIDER_ROUNDS_VIEW_LIST"],SOFTSWISS_FREE_SPINS:["SOFTSWISS_FREE_SPINS_VIEW_LIST"],PAYMENT_METHODS:["PAYMENT_METHODS_USER_BLACKLISTS_VIEW","PAYMENT_METHODS_USER_BLACKLISTS_CREATE","PAYMENT_METHODS_USER_BLACKLISTS_DISABLE"],OVERDRAFTS:["OVERDRAFT_ALERTS_USER_LIST_VIEW"],OTP:["USER_OTP_VIEW_LIST","USER_OTP_DELETE_PHONE"],SUSPENSIONS:["USER_UPDATE_SUSPENSION","USER_CANCEL_SUSPENSION"]},BETS:{USER_VIEW_GAME_PROVIDER_ROUNDS:["USER_VIEW_GAME_PROVIDER_ROUNDS"],GAMES:[].concat(a,["AFFILIATES_CREATE_LINK"]),ONLY_GAMES:a},GAMES:{GAME_PROVIDERS:["GAME_PROVIDERS_ENABLE_PROVIDER","GAME_PROVIDERS_DISABLE_PROVIDER","GAME_PROVIDERS_VIEW_LIST","GAME_PROVIDERS_VIEW_PROVIDER","GAME_PROVIDER_VIEW"],GAME_CATEGORIES:["GAME_CATEGORIES_VIEW_LIST","GAME_CATEGORIES_VIEW_CATEGORY","GAME_CATEGORIES_CREATE_CATEGORY","GAME_CATEGORIES_ADD_GAME","GAME_CATEGORIES_REMOVE_GAME","GAME_CATEGORIES_UPDATE_ORDINALITY"]},PAYMENTS:{DEPOSITS:["DEPOSITS_VIEW_LIST","DEPOSITS_CREDIT_DEPOSIT","DEPOSITS_CREDIT_DEPOSIT_BULK"],WITHDRAWALS:["WITHDRAWALS_VIEW_LIST","WITHDRAWALS_VIEW_WITHDRAWAL","WITHDRAWALS_KYC_RISK_VALIDATION","WITHDRAWALS_CREATE_FRAUD_CHECK","WITHDRAWALS_UPDATE_WITHDRAWAL","WITHDRAWALS_RETRY_WITHDRAWAL","WITHDRAWALS_VIEW_REFUNDABLE_DEPOSITS_LIST","WITHDRAWALS_REFUND_DEPOSIT_FOR_WITHDRAWAL","WITHDRAWALS_VIEW_LITE"],WITHDRAWALS_FULL_VIEW:["WITHDRAWALS_VIEW_LIST","WITHDRAWALS_VIEW_WITHDRAWAL","WITHDRAWALS_KYC_RISK_VALIDATION","WITHDRAWALS_CREATE_FRAUD_CHECK","WITHDRAWALS_UPDATE_WITHDRAWAL","WITHDRAWALS_RETRY_WITHDRAWAL","WITHDRAWALS_VIEW_REFUNDABLE_DEPOSITS_LIST","WITHDRAWALS_REFUND_DEPOSIT_FOR_WITHDRAWAL"],PIX_WITHDRAWALS:["WITHDRAWALS_VIEW_PIX_LIST"],STUCK_WITHDRAWALS:["WITHDRAWALS_VIEW_STUCK_LIST"],AUTOMATED_WITHDRAWALS:["WITHDRAWALS_VIEW_AUTOMATED_LIST"],FRAUD_CHECKS:["KYC_VIEW_LIST","KYC_UPDATE_VERIFICATION"],KYC_VERIFICATIONS:["KYC_VIEW_LIST","KYC_UPDATE_VERIFICATION"],METHODS:["PAYMENT_METHODS_VIEW_LIST","PAYMENT_PLATFORMS_UPDATE_METHOD"],PROVIDERS:["PAYMENT_PROVIDERS_VIEW_LIST","PAYMENT_PROVIDERS_VIEW_PROVIDER","PAYMENT_PROVIDERS_UPDATE_PROVIDER","PAYMENT_PROVIDERS_VIEW_PROVIDER_RULES"],COUNTRY_ORDERINGS:["PAYMENT_COUNTRY_ORDERING_VIEW_LIST","PAYMENT_COUNTRY_ORDERING_CREATE_ORDERING","PAYMENT_COUNTRY_ORDERING_VIEW_ORDERING","PAYMENT_COUNTRY_ORDERING_UPDATE_ORDERING"],ACCOUNTS:["PAYMENT_ACCOUNTS_CREATE_INFLUENCER_CARD"],GIFT_CARDS:["GIFT_CARDS_CREATE_BULK"]},STAFF_MANAGER:{REQUESTS:["APPROVE_REQUEST","DENY_REQUEST","VIEW_REQUESTS"]},BLAZE_ORIGINALS:{CRASH:["VIEW_CRASH_BET"],DOUBLE:["VIEW_DOUBLE_BET"]},BIG_WINS:{GENERAL:["VIEW_BIG_WINS"]},SUPPORTED_CURRENCIES:{GENERAL:["VIEW_SUPPORTED_CURRENCIES"]},AFFILIATES:{GENERAL:["AFFILIATES_VIEW_LIST","AFFILIATES_VIEW_AFFILIATE","AFFILIATES_VIEW_SYSTEM","AFFILIATES_SET_MANAGER"],INFO:["AFFILIATES_VIEW_AFFILIATE"],REFERRALS:["AFFILIATES_REFERRAL_VIEW"],CAMPAIGNS:["AFFILIATES_CAMPAIGNS_VIEW","AFFILIATES_CAMPAIGNS_CREATE","AFFILIATES_CAMPAIGNS_UPDATE"],BALANCES:["AFFILIATES_VIEW_AFFILIATE"]},MONITORING:{GENERAL:["STATUS_MONITORING"]}}},345:function(e,t,n){e.exports={info:"anti-fraud_info__1vou9"}},361:function(e){e.exports=JSON.parse('["picpay","pix","mercadopago","eps","ideal","bancontact","paysafecard","uberweisen","skrill","btc","eth","ltc","trx","spei","bank_domestic","xrp","doge","bnb","usdt","usdte","usdtt","ada","bch","eupago","affiliate_transfers","codi","mastercard_credit","pagoefectivo","visa_credit","br_banks","fr_credit_card","credit_card","upi","jp_banks","webpay","cl_banks","mx_credit_card","ec_banks","netbanking","jcb","in_banks","bank_iban","rapidtransfer","neteller","epro","interac","ecopayz","muchbetter","cashtocode","gift_card","wechat","qqpay","alipay","unionpay","passngo","webmoney","qiwi","moneta","astropay","boleto","paypal","multibanco","przelew","blik","sofort","todito_cash","visa","wheel_item_winnings","cartasi","yandex","kwickgo","elo","flash_boleto","lotericas","cash_payments","phonepe","googleplay","paytm","olamoney","jiomoney","freecharge","rupay","mastercard_debit","visa_debit"]')},398:function(e,t,n){},430:function(e,t){e.exports=["SETTINGS_VIEW_LIST","SETTINGS_UPDATE"]},44:function(e,t,n){e.exports={filtersQuery:"transactions_filtersQuery__D1G0H",filterQuery:"transactions_filterQuery__3DxMy",buttonExport:"transactions_buttonExport__eDha_",buttons:"transactions_buttons__3uc0R"}},443:function(e,t,n){},444:function(e,t,n){},472:function(e,t,n){},473:function(e,t,n){},475:function(e,t,n){},476:function(e,t,n){},477:function(e,t,n){},478:function(e,t,n){},479:function(e,t,n){},480:function(e,t,n){},481:function(e,t,n){},482:function(e,t,n){},50:function(e,t,n){"use strict";n.r(t),n.d(t,"CASES_UPDATE",(function(){return a})),n.d(t,"CASE_ITEMS_UPDATE",(function(){return c})),n.d(t,"CASE_UPDATE",(function(){return r})),n.d(t,"CASE_PRICE_UPDATE",(function(){return s})),n.d(t,"USER_RANKS_UPDATE",(function(){return i})),n.d(t,"ADD_CURRENCY_RATE",(function(){return o})),n.d(t,"DELETE_CURRENCY_RATE",(function(){return l})),n.d(t,"UPDATE_CURRENCY_RATE",(function(){return d})),n.d(t,"LOAD_CURRENCY_RATES",(function(){return u}));var a="rewards/UPDATE",c="rewards/ITEMS/UPDATE",r="rewards/CASE/UPDATE",s="rewards/PRICE/UPDATE",i="rewards/USER_RANKS_UPDATE",o="rewards/ADD_CURRENCY_RATE",l="rewards/DELETE_CURRENCY_RATE",d="rewards/UPDATE_CURRENCY_RATE",u="rewards/LOAD_CURRENCY_RATES"},524:function(e,t,n){},525:function(e,t,n){},526:function(e,t,n){},527:function(e,t,n){},528:function(e,t,n){},529:function(e,t,n){},537:function(e,t,n){},539:function(e,t,n){},54:function(e,t,n){e.exports={form:"roles_form__1yOVt",editRoles:"roles_editRoles__2SSGu",actionButton:"roles_actionButton__VxRlV",closeAccount:"roles_closeAccount__1dGOG"}},540:function(e,t,n){},562:function(e,t,n){},570:function(e,t){},572:function(e,t){},624:function(e,t,n){},625:function(e,t,n){},626:function(e,t,n){},627:function(e,t,n){},628:function(e,t,n){},629:function(e,t,n){},630:function(e,t,n){},631:function(e,t,n){},632:function(e,t,n){},633:function(e,t,n){},639:function(e,t,n){"use strict";n.r(t);var a,c=n(2),r=n.n(c),s=n(43),i=n.n(s),o=n(17),l=n(9),d=n(4),u=n(12),j=n(13),b=n(14),h=n(15),p=n(47),O=n(40),_=(n(398),n(10)),m=n(6),x=n(3),f=n(8),v="settings/UPDATE",g=function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.get("/admin/settings",{params:{page:e}});case 2:a=t.sent,n({type:v,payload:a});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},T=n(0),y=function(){var e=Object(c.useState)({}),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(!1),s=Object(m.a)(r,2),i=s[0],l=s[1],u=Object(o.d)((function(e){return e.settings.data})),j=Object(o.d)((function(e){var t,n;return(null===e||void 0===e||null===(t=e.app)||void 0===t||null===(n=t.user)||void 0===n?void 0:n.roles)||null})),b=Object(o.c)();Object(c.useEffect)((function(){b(g())}),[b]),Object(c.useEffect)((function(){var e=Object.keys(n).some((function(e){var t;return n[e]!==(null===(t=u.find((function(t){return t.key===e})))||void 0===t?void 0:t.value)}));l(e)}),[n,u]);var h=function(e,t){a(Object(d.a)(Object(d.a)({},n),{},Object(_.a)({},e,{value:t,reason:""}))),l(!0)},p=function(e,t){var c=Object(d.a)({},n);c[e].reason=t,a(c)},O=function(){a({}),l(!1)};return Object(T.jsxs)("div",{children:[Object(T.jsx)("h3",{children:"Settings"}),u.map((function(e,t){var a,c,r,s=void 0!==(null===(a=n[e.key])||void 0===a?void 0:a.value)?null===(c=n[e.key])||void 0===c?void 0:c.value:e.value,i=(null===(r=n[e.key])||void 0===r?void 0:r.reason)||"";return j.includes("support_manager")&&"chat_enabled"===e.key?Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:e.key}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("input",{style:{width:"100%"},value:s,onChange:function(t){return h(e.key,t.target.value)}}),s!==e.value&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("input",{style:{width:"100%"},placeholder:"Reason for change",value:i,onChange:function(t){return p(e.key,t.target.value)}})]}),Object(T.jsx)("hr",{})]},t):j.includes("support_manager")?null:Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:e.key}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("input",{style:{width:"100%"},value:s,onChange:function(t){return h(e.key,t.target.value)}}),s!==e.value&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("input",{style:{width:"100%"},placeholder:"Reason for change",value:i,onChange:function(t){return p(e.key,t.target.value)}})]}),Object(T.jsx)("hr",{})]},t)})),Object(T.jsx)("button",{onClick:function(){var e=!1;if(Object.keys(n).forEach((function(t){var a,c;(null===(a=n[t])||void 0===a?void 0:a.value)!==(null===(c=u.find((function(e){return e.key===t})))||void 0===c?void 0:c.value)&&""===n[t].reason.trim()&&(e=!0)})),e)alert("Please provide a reason for all changes before saving.");else{var t,a=Object.keys(n).reduce((function(e,t){return""!==n[t].reason.trim()&&(e[t]=n[t]),e}),{});b((t=a,function(){var e=Object(f.a)(Object(x.a)().mark((function e(n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.put("/admin/settings",{settings:t});case 2:n(g());case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),O()}},disabled:!i,children:"Save"})]})},E=n(41),S=n(61),w=n.n(S),R=n(88),A=n.n(R),N="http://127.0.0.1:23001/originals";N="/api/singleplayer-originals/originals";var C=function(){function e(t){Object(u.a)(this,e),this.API_BASE=t;var n={baseURL:this.API_BASE,timeout:3e4,withCredentials:!0,headers:{common:{}}};localStorage.getItem("x-block-bypass")&&(n.headers["X-Block-Bypass"]="1");var a="Bearer ".concat(localStorage.getItem("access_token"));n.headers.Authorization=a,this.instance=w.a.create(n)}return Object(j.a)(e,[{key:"setAuthHeader",value:function(e){var t="Bearer ".concat(e);this.instance.defaults.headers.common.Authorization=t}},{key:"extractData",value:function(e){return e.data}},{key:"handleFailure",value:function(e){if(e.response)throw e.response.data.error}},{key:"get",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,a=this,c=arguments;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:{},e.abrupt("return",this.instance.get(t,{params:n}).then((function(e){return a.extractData(e)})).catch((function(e){a.handleFailure(e)})));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"post",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){var a,c=this,r=arguments;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.length>2&&void 0!==r[2]?r[2]:{},Object.keys(a).length>0&&(t+="?"+A.a.stringify(a)),e.abrupt("return",this.instance.post(t,n).then((function(e){return c.extractData(e)})).catch((function(e){c.handleFailure(e)})));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"put",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){var a,c=this,r=arguments;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.length>2&&void 0!==r[2]?r[2]:{},Object.keys(a).length>0&&(t+="?"+A.a.stringify(a)),e.abrupt("return",this.instance.put(t,n).then((function(e){return c.extractData(e)})).catch((function(e){c.handleFailure(e)})));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"delete",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){var a,c=this,r=arguments;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.length>2&&void 0!==r[2]?r[2]:{},Object.keys(a).length>0&&(t+="?"+A.a.stringify(a)),e.abrupt("return",this.instance.delete(t,n).then((function(e){return c.extractData(e)})).catch((function(e){c.handleFailure(e)})));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()}]),e}(),I=new C(N);null!==(a=window)&&void 0!==a&&a.bettingApi&&(window.bettingApi=I);var k=I;function D(e,t){return L.apply(this,arguments)}function L(){return(L=Object(f.a)(Object(x.a)().mark((function e(t,n){var a,c,r,s,i;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.page,c=void 0===a?1:a,r=n.type,s=void 0===r?"":r,i="/admin/users/".concat(t,"/bets"),e.next=4,k.get(i,{page:c,type:s});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function U(e,t){return P.apply(this,arguments)}function P(){return(P=Object(f.a)(Object(x.a)().mark((function e(t,n){var a,c,r;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.page,c=void 0===a?1:a,r="/admin/users/".concat(t,"/slide-bets"),e.next=4,k.get(r,{page:c});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function W(){return(W=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.get("/admin/users/slide-bets/".concat(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e,t){return B.apply(this,arguments)}function B(){return(B=Object(f.a)(Object(x.a)().mark((function e(t,n){var a,c,r;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.page,c=void 0===a?1:a,r="/admin/users/".concat(t,"/fortune-double-bets"),e.next=4,k.get(r,{page:c});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function F(){return(F=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.get("/admin/users/fortune-double-bets/".concat(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(){return(G=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.get("/admin/users/fruits-bets/".concat(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(e,t){return Y.apply(this,arguments)}function Y(){return(Y=Object(f.a)(Object(x.a)().mark((function e(t,n){var a,c,r;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.page,c=void 0===a?1:a,r="/admin/users/".concat(t,"/fruits-bets"),e.next=4,k.get(r,{page:c});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function H(){return(H=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.get("/admin/bets/".concat(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function q(){return K.apply(this,arguments)}function K(){return(K=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",k.get("/admin/status"));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function z(){return(z=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",k.get("/admin/multiplayer_games/rolls_left/fortune_double"));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function X(){return Z.apply(this,arguments)}function Z(){return(Z=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",k.get("/admin/settings"));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Q(e){return J.apply(this,arguments)}function J(){return(J=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",k.put("/admin/settings",{settings:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $(){return ee.apply(this,arguments)}function ee(){return(ee=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",k.get("/admin/multiplayer_games/rooms"));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function te(e){return ne.apply(this,arguments)}function ne(){return(ne=Object(f.a)(Object(x.a)().mark((function e(t){var n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.roomId,a=t.updatedData,e.abrupt("return",k.put("/admin/multiplayer_games/rooms/".concat(n),a));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ae(e){return ce.apply(this,arguments)}function ce(){return(ce=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",k.put("/admin/bet-slip/fruit-slice/fix_last_game_locked/".concat(t)));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var re=n(11),se=function(){var e=Object(c.useState)({}),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(E.useQuery)("settings",Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X();case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})))),s=r.data,i=r.isLoading,o=r.isError,l=function(){var e=Object(E.useQueryClient)();return Object(E.useMutation)(function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Q(t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),{onSuccess:function(){e.invalidateQueries("settings")},onError:function(e){re.toast.error(e.message)}})}(),u=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.mutateAsync(n);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return o?Object(T.jsx)("div",{children:Object(T.jsx)("p",{children:"Error fetching settings"})}):Object(T.jsxs)("div",{children:[Object(T.jsx)("h3",{children:"Settings"}),i?Object(T.jsx)("p",{children:"Loading..."}):s.map((function(e,t){var c=n[e.key]||e.value;return window.roles.includes("support_manager")?null:Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:e.key}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("input",{style:{width:"100%"},value:c,onChange:function(t){return function(e,t){var c=Object(d.a)(Object(d.a)({},n),{},Object(_.a)({},t,e.target.value));a(c)}(t,e.key)}}),Object(T.jsx)("hr",{})]},t)})),Object(T.jsx)("button",{onClick:u,children:"Save"})]})},ie=n(133),oe="/api",le=w.a.create({baseURL:oe});le.interceptors.request.use((function(e){return e.headers.Authorization="Bearer ".concat(localStorage.getItem("access_token")),e.headers["X-RateLimit-Bypass"]="1",localStorage.getItem("x-block-bypass")&&(e.headers["X-Block-Bypass"]="1"),e}));var de=null,ue=["/admin/mystery_boxes/price"];le.interceptors.response.use((function(e){return e.data}),(function(e){if(e.response){var t=e.response.data.error;throw t&&(1008===t.code&&de&&de(),t.data&&t.data.internal_message&&(t.message+="\n"+t.data.internal_message),ue.find((function(t){return e.response.config.url.includes(t)}))||re.toast.error(t.message)),t}throw e})),le.authenticate=function(e){return localStorage.setItem("access_token",e)},le.isAuthed=function(){return null!==localStorage.getItem("access_token")},le.redirect=function(e){return window.location=oe+e},le.clearAuth=function(){return localStorage.removeItem("access_token")},le.getUrl=function(e){return oe+e},le.upload=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n,a){var c,r,s;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return","");case 2:return(c=new FormData).append("file",t,t.name),c.append("path",n),r="/admin/uploads/"+n,a&&(r=r+"?prefix_discriminator="+a),e.next=9,window.api.post(r,c);case 9:return s=e.sent,e.abrupt("return",s.url);case 11:case"end":return e.stop()}}),e)})));return function(t,n,a){return e.apply(this,arguments)}}(),window.api=le,window.password_prompt=function(){return window.prompt("A password is required for this resource.")};var je=function(e,t,n){var a=Array.from(e),c=a.splice(t,1),r=Object(m.a)(c,1)[0];return a.splice(n,0,r),a},be=function(){return window.roles.includes("admin")},he=function(e){if(be())return!0;var t=window.roles.find((function(t){return function(e){var t;return null!==(t=ie[e])&&void 0!==t?t:[]}(e).includes(t)}));return!!t||!!window.permissions.includes(e)},pe=function(e){if(be())return!0;if(Array.isArray(e)){for(var t=0;t<e.length;t++)if(he(e[t]))return!0;return!1}if(!e)return!1;for(var n=Object.values(e),a=0;a<n.length;a++)for(var c=0;c<n[a].length;c++)if(he(n[a][c]))return!0;return!1},Oe=n(277),_e=n(34),me=n.n(_e);function xe(e){var t=e.group,n=e.children,a=e.fallbackComponent,c=void 0===a?null:a;return pe(t)?n:c}function fe(e){var t=e.feature,n=e.children,a=e.fallbackComponent,c=void 0===a?null:a;return he(t)?n:c}function ve(e){var t=e.feature,n=e.condition,a=e.children;return n?he(t)?a:null:a}function ge(e){var t=e.path,n=e.exact,a=e.component,c=e.group;return Object(T.jsx)(p.Route,{path:t,exact:n,render:function(e){return pe(c)?Object(T.jsx)(a,Object(d.a)({},e)):null}})}function Te(e){var t=e.path,n=e.exact,a=e.component,c=e.feature;return Object(T.jsx)(p.Route,{path:t,exact:n,render:function(e){return he(c)?Object(T.jsx)(a,Object(d.a)({},e)):null}})}var ye=n(33),Ee=n.n(ye);var Se={withSeconds:function(e){return Ee()(e).format("YYYY-MM-DD HH:mm:ss")},withMinutes:function(e){return Ee()(e).format("YYYY-MM-DD HH:mm")},onlyDate:function(e){return Ee()(e).format("YYYY-MM-DD")}},we=n(1),Re=function(e,t){var n=window.URL.createObjectURL(new Blob([e])),a=document.createElement("a");a.href=n,a.setAttribute("download","file.".concat(t)),document.body.appendChild(a),a.click()},Ae=function(e){Object(b.a)(a,e);var t=Object(h.a)(a);function a(e){var n;return Object(u.a)(this,a),(n=t.call(this,e)).state={id:0,page:1,periods:[],details:{},details_loading:0},n}return Object(j.a)(a,[{key:"fetch",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n=this,a=arguments;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=a.length>0&&void 0!==a[0]?a[0]:this.state.page,window.api.get("/admin/weekly-cashback-management/periods?page="+t).then((function(e){n.setState({page:t,periods:e})}));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"showDetails",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({details_loading:t}),window.api.get("/admin/weekly-cashback-management/details/"+t).then((function(e){n.setState({detailsId:t,details:Object(d.a)(Object(d.a)({},n.state.details),{},Object(_.a)({},t,e)),details_loading:0})})).catch((function(){n.setState({details_loading:0})}));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"invalidate",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:window.api.post("/admin/weekly-cashback-management/periods/invalidate",{loyaltyPeriodId:t}).then((function(){n.fetch()}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){var e=this;this.fetch(),this.count=0,this.interval=setInterval((function(){(e.fetch(),e.count++,e.count%6===0)&&Object.keys(e.state.details).forEach((function(t){e.showDetails(t)}))}),1e4)}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsx)("h3",{children:"Cashback"}),Object(T.jsx)("button",{style:{marginRight:15},onClick:function(){window.api.post("/admin/weekly-cashback-management/periods/next").then((function(){e.fetch()}))},children:"Create Next Period"}),Object(T.jsx)("a",{target:"_blank",href:"https://app.datadoghq.eu/apm/traces?query=%40_top_level%3A1%20env%3Aproduction%20service%3Aadmin-api%20operation_name%3Aexpress.request%20resource_name%3A%22POST%20%2Fadmin%2Fweekly-cashback-management%2Fretry%22&cols=core_service%2Ccore_resource_name%2Clog_duration%2Clog_http.method%2Clog_http.status_code&historicalData=false&messageDisplay=inline&sort=desc&start=1661149938848&end=1661150838848&paused=false",children:Object(T.jsx)("button",{children:"Monitor"})}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Starts At"}),Object(T.jsx)(we.Th,{children:"Ends At"}),Object(T.jsx)(we.Th,{children:"Claimable At"}),Object(T.jsx)(we.Th,{children:"Actions"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.periods.map((function(t){var a=e.state.details[t.id];return Object(T.jsxs)(T.Fragment,{children:[Object(T.jsxs)(we.Tr,{children:[Object(T.jsxs)(we.Td,{children:["#",t.id]}),Object(T.jsx)(we.Td,{children:t.status}),Object(T.jsx)(we.Td,{children:Se.withMinutes(t.starts_at)}),Object(T.jsx)(we.Td,{children:Se.withMinutes(t.ends_at)}),Object(T.jsx)(we.Td,{children:t.claimable_at?Se.withMinutes(t.claimable_at):"unset"}),Object(T.jsxs)(we.Td,{children:[["created","failed_to_query_data"].includes(t.status)&&Ee()(t.ends_at).diff(Ee()())<0&&Object(T.jsx)("button",{onClick:function(){window.confirm("Warning! this request can take over 5 minutes to process. Do not spam click this button.")&&window.api.post("/admin/weekly-cashback-management/retry",{loyaltyPeriodId:t.id}).then((function(){e.fetch()}))},children:"Retry calculation"}),["issuing_rewards","credited"].includes(t.status)&&Object(T.jsx)("button",{disabled:e.state.details_loading===t.id,onClick:function(){e.showDetails(t.id)},children:"Show Details"}),"issuing_rewards"===t.status&&Object(T.jsx)("button",{onClick:function(){window.confirm("Are you sure you want to cancel period ".concat(t.id,"? This will set the status to bugged as well as all of its rewards issued so far. Confirm the rewards are no longer being issued before pressing this!"))&&e.invalidate(t.id)},children:"Cancel"}),"credited"===t.status&&Object(T.jsx)("button",{onClick:function(){n(61)({url:"/api/admin/weekly-cashback-management/download_cio_events/"+t.id,method:"GET",responseType:"blob",params:{},headers:{Authorization:"Bearer ".concat(localStorage.getItem("access_token")),"X-RateLimit-Bypass":"1"}}).then((function(e){var n=e.data,a=window.URL.createObjectURL(new Blob([n])),c=document.createElement("a");c.href=a,c.setAttribute("download","weekly-cashback-".concat(t.id,"-cio-events.csv")),document.body.appendChild(c),c.click()}))},children:"Export to Customer IO"})]})]}),a&&Object(T.jsxs)(we.Tr,{children:[Object(T.jsxs)(we.Td,{colSpan:2,children:[Object(T.jsx)("div",{children:"Claimed"}),Object(T.jsxs)("div",{children:["Amount:"," ",(+(a.credited||{}).eur_amount||0).toFixed(2)," ","EUR"]}),Object(T.jsxs)("div",{children:["Distinct Users: ",(a.credited||{}).count||0]})]}),Object(T.jsxs)(we.Td,{colSpan:2,children:[Object(T.jsx)("div",{children:"Available To Claim"}),Object(T.jsxs)("div",{children:["Amount:"," ",(+(a.created||{}).eur_amount||0).toFixed(2)," ","EUR"]}),Object(T.jsxs)("div",{children:["Distinct Users: ",(a.created||{}).count||0]})]}),Object(T.jsxs)(we.Td,{colSpan:2,children:[Object(T.jsx)("div",{children:"Insufficient Amount"}),Object(T.jsxs)("div",{children:["Amount:"," ",(+(a.insufficient_amount||{}).eur_amount||0).toFixed(2)," ","EUR"]}),Object(T.jsxs)("div",{children:["Distinct Users:"," ",(a.insufficient_amount||{}).count||0]})]})]})]})}))})]}),Object(T.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"20px"},children:[Object(T.jsx)("div",{onClick:function(){e.fetch(e.state.page-1)},children:this.state.page>1&&Object(T.jsx)("a",{children:"< Back"})}),Object(T.jsx)("div",{onClick:function(){e.fetch(e.state.page+1)},children:Object(T.jsx)("a",{children:"Next >"})})]})]})}}]),a}(c.Component),Ne=Ae,Ce=n(19),Ie=function(e){return Se.onlyDate(e)},ke=function(){var e=Object(E.useQueryClient)(),t=Object(c.useState)(null),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(null),i=Object(m.a)(s,2),o=i[0],l=i[1],d=Object(E.useQuery)("raffles",Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.api.get("/admin/raffle"));case 1:case"end":return e.stop()}}),e)})))),u=d.isLoading,j=d.data,b=Object(E.useMutation)("raffle-total-tickets",Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.api.post("/admin/raffle/".concat(null===a||void 0===a?void 0:a.value,"/total_tickets")));case 1:case"end":return e.stop()}}),e)}))),{onSuccess:function(){return e.invalidateQueries("raffles")}}).mutate,h=Object(E.useMutation)("raffle-winning-user",(function(){return window.api.post("/admin/raffle/".concat(null===a||void 0===a?void 0:a.value,"/winning_user"),{ticket_number:o})}),{onSuccess:function(){return e.invalidateQueries("raffles")}}),p=h.mutate,O=h.isLoading,_=h.data,v=a&&(null===j||void 0===j?void 0:j.find((function(e){return e.id===a.value})));return Object(T.jsxs)("div",{children:[Object(T.jsx)("h3",{children:"Raffle"}),Object(T.jsx)("label",{children:"Period: "}),Object(T.jsx)(Ce.a,{name:"type",value:a,onChange:function(e){r(e),l(null)},options:null===j||void 0===j?void 0:j.map((function(e){return{value:e.id,label:"ID: ".concat(e.id,", Period: ").concat(Ie(e.starts_at)," - ").concat(Ie(e.ends_at))}}))}),Object(T.jsx)("br",{}),Object(T.jsx)("label",{children:"Total Ticket: "}),u?Object(T.jsx)("label",{children:"Loading..."}):Object(T.jsx)("label",{children:null===v||void 0===v?void 0:v.max_ticket_number}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{disabled:!a,onClick:function(){b()},children:"Calculate Total Tickets"}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("label",{children:"Ticket Number: "}),Object(T.jsx)("input",{style:{width:"100%"},value:o,type:"number",onChange:function(e){return l(e.target.value)}}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("h3",{children:"Winning User "}),Object(T.jsxs)("label",{children:["User ID: ",null===_||void 0===_?void 0:_.winning_user_id]}),Object(T.jsx)("br",{}),Object(T.jsxs)("label",{children:["Name: ",null===_||void 0===_?void 0:_.winning_user_name]}),Object(T.jsx)("br",{}),Object(T.jsxs)("label",{children:["Username: ",null===_||void 0===_?void 0:_.winning_username]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{onClick:function(){p()},disabled:!o||O,children:O?"Loading...":"Calculate Winning User"}),Object(T.jsx)("br",{})]})},De=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={records:[]},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.list()}},{key:"list",value:function(){var e=this;window.api.get("/admin/announcements").then((function(t){return e.setState({records:t})}))}},{key:"disable",value:function(){var e=this;window.api.post("/admin/announcements/disable").then((function(){re.toast.success("Disabled"),e.list()}))}},{key:"render",value:function(){var e=this,t=this.state;t.selected_lang,t.contents,t.action_descriptions,t.selected_desc_lang;return Object(T.jsx)("div",{id:"announcements",children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Content"}),Object(T.jsx)(we.Th,{children:"User Target"}),Object(T.jsx)(we.Th,{children:"Action Active"}),Object(T.jsx)(we.Th,{children:"Action HREF"}),Object(T.jsx)(we.Th,{children:"Action Description"}),Object(T.jsx)(we.Th,{children:"Active"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.records.map((function(t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(t.created_at)}),Object(T.jsx)(we.Td,{children:t.id}),Object(T.jsx)(we.Td,{children:t.type}),Object(T.jsx)(we.Td,{children:JSON.stringify(t.content)}),Object(T.jsx)(we.Td,{children:t.user_target}),Object(T.jsx)(we.Td,{children:t.action_active.toString()}),Object(T.jsx)(we.Td,{children:t.action_href}),Object(T.jsxs)(we.Td,{children:[JSON.stringify(t.action_description)," "]}),Object(T.jsx)(we.Td,{children:t.active.toString()}),Object(T.jsx)(we.Td,{children:t.active&&Object(T.jsx)("button",{className:"small",onClick:function(){return e.disable()},children:"Disable"})})]},t.id)}))})]})})}}]),n}(c.Component),Le=n(143),Ue=n.n(Le),Pe=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){var e;Object(u.a)(this,n);for(var a=arguments.length,c=new Array(a),r=0;r<a;r++)c[r]=arguments[r];return(e=t.call.apply(t,[this].concat(c))).state={},e}return Object(j.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.contents,a=t.onChange,r=t.label,s=t.disabled;return Object(T.jsxs)("div",{className:Ue.a.container,children:[Object(T.jsx)("h3",{children:r}),Object.keys(n).map((function(e,t){return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsxs)("div",{className:Ue.a.contentEntry,children:[Object(T.jsx)("h4",{style:{width:"200px"},children:e}),Object(T.jsx)("textarea",{onChange:function(t){return a(Object(d.a)(Object(d.a)({},n),{},Object(_.a)({},e,t.target.value)))},value:n[e]}),Object(T.jsx)("button",{type:"button",onClick:function(){var t=Object(d.a)({},n);delete t[e],a(t)},children:"Delete"})]},t),Object(T.jsx)("hr",{})]},t)})),Object(T.jsxs)(T.Fragment,{children:[Object(T.jsxs)("div",{className:"".concat(Ue.a.contentEntry," add-translation"),children:[Object(T.jsx)(Ce.a,{className:Ue.a.textAreaLocale,value:this.state.locale,options:[{value:"pt",label:"pt"},{value:"en",label:"en"},{value:"es",label:"es"},{value:"es-cl",label:"es-cl"},{value:"pt-br",label:"pt-br"},{value:"es-pe",label:"es-pe"},{value:"es-ec",label:"es-ec"},{value:"no",label:"no"}],onChange:function(t){return e.setState({locale:t.value})},placeholder:"Enter language (ex. en-US, en-CA, pt-BR, pt, es, no)"}),Object(T.jsx)("br",{}),Object(T.jsx)("textarea",{className:Ue.a.textAreaContent,placeholder:"Content",ref:function(t){return e.content=t}})]}),!s&&Object(T.jsx)("button",{className:"small",type:"button",onClick:function(){a(Object(d.a)(Object(d.a)({},n),{},Object(_.a)({},e.state.locale,e.content.value)))},children:"Add translation"})]})]})}}]),n}(r.a.Component),We=function(e){var t=e.title,n=void 0===t?"":t,a=e.size,c=void 0===a?1:a;return Object(T.jsx)(O.MobileView,{children:Object(T.jsx)("div",{style:{width:"100%",textAlign:"center"},children:r.a.createElement("h".concat(c),{style:{margin:"5px 0"}},n)})})},Me=n(78),Be=n.n(Me),Fe=function(e){var t=e.languages,n=Object(c.useState)({}),a=Object(m.a)(n,2),r=a[0],s=a[1],i=Object(c.useState)({}),o=Object(m.a)(i,2),l=o[0],d=o[1],u=Object(c.useState)(!1),j=Object(m.a)(u,2),b=j[0],h=j[1],p=Object(c.useState)(""),O=Object(m.a)(p,2),_=O[0],x=O[1],f=Object(c.useState)({}),v=Object(m.a)(f,2),g=v[0],y=v[1],E=Object(c.useState)(""),S=Object(m.a)(E,2),w=S[0],R=S[1];return Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)(We,{title:"Create Announcements"}),Object(T.jsx)("h1",{style:{fontSize:"14px"},children:"Remember if you want to create an announcement and show in all languages you must to create with the translation for en, es and pt or pt-br"}),Object(T.jsxs)("div",{className:Be.a.inputGroup,children:[Object(T.jsxs)("div",{className:Be.a.block,children:[Object(T.jsx)(Pe,{languages:t,contents:r,onChange:function(e){return s(e)},label:"Contents"}),Object(T.jsx)("div",{className:Be.a.inputField,children:Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Action Active:"}),Object(T.jsx)("input",{type:"checkbox",checked:b,onChange:function(){return h(!b)}})]})}),Object(T.jsx)("div",{className:Be.a.inputField,children:Object(T.jsx)("input",{style:{width:"100%"},value:_,placeholder:"Action HREF",onChange:function(e){return x(e.target.value)}})})]}),Object(T.jsx)("div",{className:Be.a.block,children:Object(T.jsx)(Pe,{languages:t,contents:l,onChange:function(e){return d(e)},label:"Action Descriptions"})}),Object(T.jsx)("div",{className:Be.a.block,children:Object(T.jsxs)("div",{className:Be.a.targetContainer,children:[Object(T.jsx)("label",{children:"Choose user target"}),Object(T.jsx)(Ce.a,{name:"type",value:g,onChange:function(e){y(e.value)},className:Be.a.announcementsSelect,options:[{value:"signed_out",label:"User logout"},{value:"signed_in",label:"User logged"}]})]})}),Object(T.jsxs)("div",{className:Be.a.block,children:[Object(T.jsx)("label",{children:"Announcement type"}),Object(T.jsx)("div",{className:Be.a.inputField,children:Object(T.jsx)("input",{style:{width:"100%"},value:w,placeholder:"Announcement type",onChange:function(e){return R(e.target.value.toLocaleLowerCase())}})})]}),Object(T.jsx)("div",{className:Be.a.buttonContainer,children:Object(T.jsx)("button",{onClick:function(){return window.api.post("/admin/announcements",{content:r,action_active:b,action_href:_,user_target:g,action_description:l,type:w}).then(re.toast.success("Created")).catch((function(e){return re.toast.error("Error")}))},children:"Submit"})})]})]})},Ge=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/system/announcements",children:"List"})},Ve=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/system/announcements/new",children:"Create"})},Ye=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){return Object(T.jsxs)("div",{children:[Object(T.jsx)(O.BrowserView,{children:Object(T.jsxs)("nav",{children:[Object(T.jsx)(Ge,{}),Object(T.jsx)(Ve,{})]})}),Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(p.Route,{exact:!0,path:"/system/announcements",component:De}),Object(T.jsx)(p.Route,{exact:!0,path:"/system/announcements/new",component:Fe})]})]})}}]),n}(c.Component),He=n(339),qe=n.n(He),Ke=(n(443),function(e){return e.total_pages<=1?null:Object(T.jsx)(qe.a,{pageCount:e.total_pages,onPageChange:function(t){e.update(t.selected+1)},containerClassName:"pagination",activeClassName:"selected"})}),ze=n(165),Xe=n.n(ze),Ze=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){var e;Object(u.a)(this,n);for(var a=arguments.length,c=new Array(a),r=0;r<a;r++)c[r]=arguments[r];return(e=t.call.apply(t,[this].concat(c))).state={page:1,filter:"",records:[],meta:{},loading:!1,fetch:!1},e}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api({method:"GET",url:"/admin/access_management/requests",params:{page:this.state.page,search:this.state.search,type:this.state.type,status:this.state.status}});case 2:t=e.sent,this.setState(Object(d.a)(Object(d.a)({},t),{},{loading:!1}));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"approve",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api({method:"post",url:"/admin/access_management/requests/"+t+"/approve"});case 2:re.toast.success("Request Approved"),this.update();case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"approveAll",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.state.records.length>1&&(this.setState(Object(d.a)(Object(d.a)({},this.state),{},{loading:!0})),this.state.records.map(function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("pending"!==t.status){e.next=3;break}return e.next=3,window.api({method:"post",url:"/admin/access_management/requests/"+t.id+"/approve"});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),this.update();case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"deny",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/access_management/requests/"+t+"/deny");case 2:e.sent,re.toast.success("Request Denied"),this.update();case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{id:"staff-requests",children:[Object(T.jsx)(We,{title:"Staff request"}),Object(T.jsxs)("div",{className:Xe.a.container,children:[Object(T.jsxs)("div",{className:Xe.a.field,children:[Object(T.jsx)("label",{children:"Search"}),Object(T.jsx)("input",{style:{width:"100%"},placeholder:"Search request payload values",onChange:function(t){e.setState({search:t.target.value},(function(){e.update()}))}})]}),Object(T.jsxs)("div",{className:Xe.a.field,children:[Object(T.jsx)("label",{children:"Type"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.type,onChange:function(t){e.setState({type:t.value},(function(){e.update()}))},options:[{value:"",label:"Any"}].concat(["CreditDeposit","WalletEditBalance","CustomerInfoChange","EmailChange"].map((function(e){return{value:e,label:e}})))})]}),Object(T.jsxs)("div",{className:Xe.a.field,children:[Object(T.jsx)("label",{children:"Status"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.status,onChange:function(t){e.setState({status:t.value},(function(){e.update()}))},options:[{value:"",label:"Any"}].concat(["pending","approved","failed","denied"].map((function(e){return{value:e,label:e}})))})]}),Object(T.jsx)("div",{})]}),Object(T.jsx)("button",{style:{marginTop:"20px",height:"30px !important"},disabled:this.state.loading,onClick:function(){return e.approveAll()},children:"Approve all"}),Object(T.jsx)("hr",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Aggregate ID"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Requested By"}),Object(T.jsx)(we.Th,{children:"Data"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Note"}),Object(T.jsx)(we.Th,{children:"Target User"}),Object(T.jsx)(we.Th,{children:"Actions"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.records.map((function(t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:t.id}),Object(T.jsx)(we.Th,{children:t.aggregate_id}),Object(T.jsx)(we.Th,{children:t.type}),Object(T.jsx)(we.Th,{children:t.requester.username}),Object(T.jsx)(we.Th,{children:JSON.stringify(t.data)}),Object(T.jsx)(we.Th,{children:t.status}),Object(T.jsx)(we.Th,{children:t.note}),Object(T.jsx)(we.Th,{children:Object(T.jsx)(l.b,{to:"/users/".concat(t.target.id),children:t.target.username})}),Object(T.jsx)(we.Th,{children:"pending"===t.status&&Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("button",{onClick:function(){t.type,e.approve(t.id)},children:"Approve"}),Object(T.jsx)("button",{onClick:function(){return e.deny(t.id)},children:"Deny"})]})})]},t.id)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.meta.total_pages,update:function(t){e.setState({page:t},(function(){e.update()}))}})]})}}]),n}(c.Component),Qe=Ze,Je=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){var e;Object(u.a)(this,n);for(var a=arguments.length,c=new Array(a),r=0;r<a;r++)c[r]=arguments[r];return(e=t.call.apply(t,[this].concat(c))).state={page:1,filter:"",records:[],meta:{}},e}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api({method:"GET",url:"/admin/refund_requests",params:{page:this.state.page,status:this.state.status}});case 2:t=e.sent,this.setState(Object(d.a)({},t));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"approve",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api({method:"post",url:"/admin/refund_request/"+t+"/approve"});case 3:re.toast.success("Request Approved"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),re.toast.error(e.t0);case 9:this.update();case 10:case"end":return e.stop()}}),e,this,[[0,6]])})));return function(t){return e.apply(this,arguments)}}()},{key:"deny",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/refund_request/"+t+"/deny");case 2:re.toast.success("Request Denied"),this.update();case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{id:"staff-requests",children:[Object(T.jsx)(We,{title:"Refund Request"}),Object(T.jsx)("div",{className:"controller row",children:Object(T.jsx)("div",{style:{width:"50%",textAlign:"left"},children:Object(T.jsxs)("div",{children:["Status",Object(T.jsx)(Ce.a,{name:"type",value:this.state.status,onChange:function(t){e.setState({status:t.value},(function(){e.update()}))},options:[{value:"",label:"Any"}].concat(["pending","approved","failed","denied"].map((function(e){return{value:e,label:e}})))})]})})}),Object(T.jsx)("hr",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Currency"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Requested By"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Target User"}),Object(T.jsx)(we.Th,{children:"Note"}),Object(T.jsx)(we.Th,{children:"Actions"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.records.map((function(t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:t.id}),Object(T.jsx)(we.Th,{children:t.wallet.currency_type}),Object(T.jsx)(we.Th,{children:t.amount}),Object(T.jsx)(we.Th,{children:t.requester.username}),Object(T.jsx)(we.Th,{children:t.status}),Object(T.jsx)(we.Th,{children:Object(T.jsx)(l.b,{to:"/users/".concat(t.target.id),children:t.target.username})}),Object(T.jsx)(we.Th,{children:t.note}),Object(T.jsx)(we.Th,{children:"pending"===t.status&&Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("button",{onClick:function(){e.approve(t.id)},children:"Approve"}),Object(T.jsx)("button",{onClick:function(){return e.deny(t.id)},children:"Deny"})]})})]},t.id)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.meta.total_pages,update:function(t){e.setState({page:t},(function(){e.update()}))}})]})}}]),n}(c.Component),$e=Je,et=function(){return Object(T.jsx)(xe,{group:me.a.STAFF_MANAGER.REQUESTS,children:Object(T.jsx)(l.c,{exact:!0,to:"/system/staff-manager/requests",children:"Requests"})})},tt=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS.WITHDRAWALS,children:Object(T.jsx)(l.c,{exact:!0,to:"/system/staff-manager/refund_requests",children:"Refund Requests"})})},nt=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){var e=this.props.match.url;return Object(T.jsxs)("div",{children:[Object(T.jsx)(O.BrowserView,{children:Object(T.jsxs)("nav",{children:[Object(T.jsx)(et,{}),Object(T.jsx)(tt,{})]})}),Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(ge,{group:me.a.PAYMENTS.WITHDRAWALS.concat(me.a.STAFF_MANAGER.REQUESTS),path:"".concat(e,"/requests"),component:Qe}),Object(T.jsx)(ge,{group:me.a.PAYMENTS.WITHDRAWALS,path:"".concat(e,"/refund_requests"),component:$e}),Object(T.jsx)(p.Redirect,{from:"/staff",to:"/staff/requests"})]})]})}}]),n}(c.Component),at=Object(p.withRouter)(Object(o.b)((function(e){return{}}),(function(e){return{}}))(nt)),ct=n(32),rt=n(142),st=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api({method:"GET",url:"/admin/users/route_mappings"});case 2:return t=e.sent,e.abrupt("return",t.map((function(e){return Object(d.a)(Object(d.a)({},e),{},{method:e.method.toString()})})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),it=function(){var e=["","GET","POST","PUT","DELETE"],t="rdg-text-editor ".concat("t16y9g8l700-beta7");var n=[{key:"id",name:"ID"},{key:"name",name:"Name",editor:rt.a},{key:"url",name:"URL",editor:rt.a},{key:"method",name:"Method",editor:function(n){var a=n.row,c=n.onRowChange;return Object(T.jsx)("select",{className:t,value:a.method,onChange:function(e){return c(Object(d.a)(Object(d.a)({},a),{},{method:e.target.value}),!0)},autoFocus:!0,children:e.map((function(e){return Object(T.jsx)("option",{value:e,children:e},e)}))})}}],a=Object(p.useParams)().id,r=Object(E.useQuery)(["route_mappings"],(function(e){return st()})).data,s=Object(c.useState)([]),i=Object(m.a)(s,2),o=i[0],l=i[1];Object(c.useEffect)((function(){r&&l(r)}),[r]);return Object(T.jsxs)("div",{children:[Object(T.jsx)(We,{title:"Route Mappings"}),Object(T.jsx)("button",{style:{margin:20},onClick:function(){return l([].concat(Object(ct.a)(o),[{race_id:a}]))},children:"Add Route Map"}),r&&Object(T.jsx)(rt.b,{columns:n,rows:o,onRowsChange:function(e,t){var n=t.indexes[0],a=e[n];if(!a.name||!a.url||!a.method||""===a.method)return l(e),re.toast.error("Fill the remaining fields to save");a.id?window.api.put("/admin/users/route_mapping/".concat(a.id),a).then((function(t){t.message?(re.toast.success(t.message),l(e)):re.toast.error(t)})).catch((function(e){re.toast.error(e)})):window.api.post("/admin/users/route_mapping",a).then((function(t){t.message?(re.toast.success(t.message),e[n].id=t.id,l(e)):re.toast.error(t)})).catch((function(e){re.toast.error(e)}))}})]})},ot=n(125),lt=function(e){var t=e.page,n=e.totalPages,a=e.setPage;return Object(T.jsxs)("div",{className:ot.pagination,children:[Object(T.jsxs)("div",{className:ot.state,children:["Page ",Object(T.jsx)("span",{className:ot.page,children:t})," of ",Object(T.jsx)("span",{className:ot.totalPages,children:n})]}),Object(T.jsx)("div",{onClick:function(){return a(Math.max(t-1,1))},className:ot.button,children:Object(T.jsx)("svg",{width:"6",height:"8",viewBox:"0 0 6 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(T.jsx)("path",{d:"M0.600025 4.00001L4.30002 0.300007C4.68662 -0.0865927 5.31342 -0.0865934 5.70002 0.300006C6.08662 0.686606 6.08662 1.31341 5.70002 1.70001L3.40002 4.00001L5.70002 6.30001C6.08662 6.6866 6.08662 7.31341 5.70002 7.70001C5.31342 8.08661 4.68662 8.0866 4.30002 7.70001L0.600025 4.00001Z",fill:"#8C9099"})})}),Object(T.jsx)("div",{onClick:function(){return a(Math.min(t+1,n))},className:ot.button,children:Object(T.jsx)("svg",{width:"6",height:"8",viewBox:"0 0 6 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(T.jsx)("path",{d:"M5.39998 3.99999L1.69998 7.69999C1.31338 8.08659 0.686575 8.08659 0.299976 7.69999C-0.0866238 7.31339 -0.0866237 6.68659 0.299976 6.29999L2.59998 3.99999L0.299976 1.69999C-0.0866235 1.3134 -0.086624 0.686594 0.299976 0.299994C0.686575 -0.0866051 1.31338 -0.0866051 1.69998 0.299994L5.39998 3.99999Z",fill:"#8C9099"})})})]})},dt=n(93),ut=n.n(dt),jt=function(){var e,t=Object(c.useState)(""),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(""),i=Object(m.a)(s,2),o=i[0],l=i[1],d=Object(c.useState)(""),u=Object(m.a)(d,2),j=u[0],b=u[1],h=Object(c.useState)(""),p=Object(m.a)(h,2),O=p[0],_=p[1],v=Object(c.useState)(1),g=Object(m.a)(v,2),y=g[0],S=g[1],w=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.api({method:"GET",url:"/admin/custom-analytics/?".concat(A)}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.api({method:"GET",url:"/admin/custom-analytics/action-types"}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),A=new URLSearchParams({target_id:a,admin_id:o,action_type:j,ip_address:O,page:y.toString(),perPage:50..toString()}).toString(),N=Object(E.useQuery)(["custom-analytics",A],w),C=N.data,I=(C=void 0===C?{}:C).records,k=void 0===I?[]:I,D=C.total,L=N.isLoading,U=N.isError,P=N.error,W=N.isSuccess,M=Object(E.useQuery)(["custom-analytics-action-types"],R),B=M.data,F=M.actionTypesisLoading,G=Math.ceil((D||0)/50);return L?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):U?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:P.message})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsx)(We,{title:"Admin analytics"}),Object(T.jsxs)("div",{className:ut.a.container,children:[Object(T.jsxs)("div",{className:ut.a.box,children:[Object(T.jsx)("input",{style:{margin:10},value:o,onChange:function(e){var t=e.target;return l(t.value||"")},placeholder:"Type a Admin ID"}),Object(T.jsx)("button",{disabled:L,className:"red ".concat(ut.a.button),onClick:w,children:L?"Loading...":"Search"})]}),Object(T.jsxs)("div",{className:ut.a.box,children:[Object(T.jsx)("input",{style:{margin:10},value:a,onChange:function(e){var t=e.target;return r(t.value||"")},placeholder:"Type a Target ID"}),Object(T.jsx)("button",{disabled:L,className:"red ".concat(ut.a.button),onClick:w,children:L?"Loading...":"Search"})]}),Object(T.jsxs)("div",{className:ut.a.box,children:[Object(T.jsx)("input",{style:{margin:10},value:O,onChange:function(e){var t=e.target;return _(t.value||"")},placeholder:"Type a IP address"}),Object(T.jsx)("button",{disabled:L,className:"red ".concat(ut.a.button),onClick:w,children:L?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:ut.a.box,children:Object(T.jsx)(Ce.a,{placeholder:"Select Action Type",style:{width:200,marginRight:10,background:"#3b3f50"},name:"type",value:j,onChange:function(e){return b((null===e||void 0===e?void 0:e.value)||"")},isLoading:F,options:F?[]:null===B||void 0===B||null===(e=B.records)||void 0===e?void 0:e.map((function(e){return{label:e,value:e}}))})})]}),Object(T.jsx)("div",{className:ut.a.pagination,children:Object(T.jsx)(lt,{page:y,setPage:S,totalPages:G})}),W&&Object(T.jsx)("div",{className:"row",children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Admin ID"}),Object(T.jsx)(we.Th,{children:"Target ID"}),Object(T.jsx)(we.Th,{children:"Action"}),Object(T.jsx)(we.Th,{children:"IP Address"}),Object(T.jsx)(we.Th,{children:"Created At"}),Object(T.jsx)(we.Th,{children:"Notes"})]})}),Object(T.jsx)(we.Tbody,{children:k.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.admin_user_id}),Object(T.jsx)(we.Td,{children:e.target_id}),Object(T.jsx)(we.Td,{children:e.action_type}),Object(T.jsx)(we.Td,{children:e.ip_address}),Object(T.jsx)(we.Td,{children:e.created_at}),Object(T.jsx)(we.Td,{children:e.notes})]},e.id)}))})]})})]})};function bt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ht=new Map;ht.set("crash_room_1","Crash (crash_room_1)"),ht.set("crash_room_2","Turbo Crash (crash_room_2)"),ht.set("crash_room_3","Crash Neymar (crash_room_3)"),ht.set("crash_room_4","Crash Rewired (crash_room_4)");var pt=function(e){return ht.get(e)||e},Ot={GLOBALLY_AVAILABLE:"globally_available",RESTRICTED_ACCESS:"restricted_access",WAITLIST_MAINTENANCE:"waitlist_maintenance",GAME_MAINTENANCE:"game_maintenance",GLOBAL_MAINTENANCE:"global_maintenance"},_t=function(){var e=Object(c.useState)([]),t=Object(m.a)(e,2),n=t[0],a=t[1],r=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/waitlist_feature/feature_status");case 2:t=e.sent,n=t.records,a(n||[]);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),s=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.put("/admin/waitlist_feature/feature_status/"+t,{status:n});case 2:r();case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),i=function(e,t){var n=e.includes("crash"),a=bt(t||e),c=n?pt(e):"";return n?c:a},o=function(e,t){return Object(T.jsx)(Ce.a,{value:t,onChange:function(t){return s(e,t.value)},options:Object.keys(Ot).map((function(e){return{label:e,value:Ot[e]}}))})};return Object(c.useEffect)((function(){r()}),[]),Object(T.jsxs)("div",{children:[Object(T.jsx)("h1",{children:"Wait List Management"}),Object(T.jsxs)("div",{children:[Object(T.jsx)("h3",{children:"Statuses"}),Object(T.jsxs)("ul",{children:[Object(T.jsx)("li",{children:"GLOBALLY_AVAILABLE: allows all players to play the game"}),Object(T.jsx)("li",{children:"RESTRICTED_ACCESS: allows only players that have been granted access through the waitlist"}),Object(T.jsx)("li",{children:"WAITLIST_MAINTENANCE: disables access to the waitlist components"}),Object(T.jsx)("li",{children:"GAME_MAINTENANCE: disables playing the game while keeping the joining the waitlist active"}),Object(T.jsx)("li",{children:"GLOBAL_MAINTENANCE: disables both"})]})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Feature"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Actions"})]})}),Object(T.jsx)(we.Tbody,{children:n.map((function(e){var t=e.id,n=e.feature_name,a=e.status,c=e.game_name;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:i(n,c)}),Object(T.jsx)(we.Td,{children:o(n,a)}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("a",{href:"/system/wait-list-management/".concat(n),children:"Details"})})]},t)}))})]})]})},mt=n(68),xt=(n(444),["records","pages"]),ft=function(e){var t=e.match.params.feature,n=Object(c.useState)(""),a=Object(m.a)(n,2),r=a[0],s=a[1],i=Object(c.useState)(""),o=Object(m.a)(i,2),d=o[0],u=o[1],j=Object(c.useState)([]),b=Object(m.a)(j,2),h=b[0],p=b[1],O=Object(c.useState)(0),_=Object(m.a)(O,2),v=_[0],g=_[1],y=Object(c.useState)({status:""}),E=Object(m.a)(y,2),S=E[0],w=E[1],R=Object(c.useState)(!1),N=Object(m.a)(R,2),C=N[0],I=N[1],k=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var n,a,c,s,i,o=arguments;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>0&&void 0!==o[0]?o[0]:1,e.next=3,window.api.get("/admin/waitlist_feature/"+t+"?"+A.a.stringify({approved:C,search:r,page:n}));case 3:a=e.sent,c=a.records,s=a.pages,i=Object(mt.a)(a,xt),p(c),g(s||0),w(i);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(c.useEffect)((function(){k()}),[r,C]);var D=function(){var e=Object(f.a)(Object(x.a)().mark((function e(n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.preventDefault(),!(d<1)){e.next=4;break}return alert("Count is less than 1"),e.abrupt("return");case 4:return e.next=6,window.api.put("/admin/waitlist_feature/".concat(t,"/bulk_grant_access"),{number_of_users:d});case 6:return e.abrupt("return",k());case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),L=function(){var e=Object(f.a)(Object(x.a)().mark((function e(n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,window.api.put("/admin/waitlist_feature/".concat(t,"/change_status/").concat(n));case 4:return e.abrupt("return",k());case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(T.jsxs)("div",{className:"waitlistdetail",children:[Object(T.jsxs)("h1",{children:["Wait List Management - ",pt(t)]}),Object(T.jsxs)("h4",{children:["Status: ",S.status]}),Object(T.jsxs)("h4",{children:["Waiting: ",S.waitlist]}),Object(T.jsxs)("h4",{children:["Approved: ",S.granted]}),Object(T.jsxs)("div",{className:"",children:[Object(T.jsx)("h2",{children:"Bulk Approve Top Users"}),Object(T.jsxs)("form",{onSubmit:D,children:[Object(T.jsx)("input",{type:"number",min:1,onChange:function(e){return u(e.target.value)},value:d,placeholder:"number to approve"}),Object(T.jsx)("button",{type:"submit",children:"Approve"})]})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("br",{}),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{children:[Object(T.jsx)("span",{style:{padding:10,cursor:"pointer",borderBottom:!C&&"2px solid #f9305b"},onClick:function(){I(!1)},children:"Waitlist"}),Object(T.jsx)("span",{style:{padding:10,cursor:"pointer",borderBottom:C&&"2px solid #f9305b"},onClick:function(){I(!0)},children:"Approved"}),Object(T.jsx)("input",{placeholder:"Search by user ID",value:r,onChange:function(e){return s(e.target.value)}})]}),Object(T.jsx)("hr",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Position"}),Object(T.jsx)(we.Th,{children:"User ID"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Actions"})]})}),Object(T.jsx)(we.Tbody,{children:h.map((function(e){var t=e.position,n=e.user_id,a=e.has_access;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:t}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/users/".concat(n),children:n})}),Object(T.jsx)(we.Td,{children:a?"Approved":"Waiting"}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("button",{onClick:function(){return L(n)},children:a?"Disapprove":"Approve"})})]})}))})]})]}),Object(T.jsx)(Ke,{total_pages:v,update:function(e){return k(e)}})]})},vt=n(726);function gt(e){return Tt.apply(this,arguments)}function Tt(){return(Tt=Object(f.a)(Object(x.a)().mark((function e(t){var n,a,c,r,s,i;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.page,a=void 0===n?1:n,c=t.search,s=(r=void 0===c?"":c)?"&search=".concat(r):"",e.prev=2,e.next=5,window.api.get("/admin/feature-flag-group?perPage=10&page=".concat(a).concat(s));case 5:i=e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),i=[];case 11:return e.abrupt("return",i);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function yt(e){return Et.apply(this,arguments)}function Et(){return(Et=Object(f.a)(Object(x.a)().mark((function e(t){var n,a,c,r,s,i,o;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.page,a=void 0===n?1:n,c=t.groupId,r=t.search,i=(s=void 0===r?"":r)?"&search=".concat(s):"",e.prev=2,e.next=5,window.api.get("/feature-flag-group/".concat(c,"?usersPerPage=10&usersPage=").concat(a).concat(i));case 5:o=e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),o=[];case 11:return e.abrupt("return",o);case 12:case"end":return e.stop()}}),e,null,[[2,8]])})))).apply(this,arguments)}function St(e,t,n,a){return wt.apply(this,arguments)}function wt(){return(wt=Object(f.a)(Object(x.a)().mark((function e(t,n,a,c){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.put("/admin/feature-flag-group/".concat(t),{name:n,enabled:"enable"===a});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error({error:e.t0});case 8:return e.abrupt("return",gt({page:c}));case 9:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}function Rt(e,t,n){return At.apply(this,arguments)}function At(){return At=Object(f.a)(Object(x.a)().mark((function e(t,n,a){var c,r=arguments;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=r.length>3&&void 0!==r[3]?r[3]:0,e.prev=1,e.next=4,window.api.put("/admin/feature-flag-group/".concat(t,"/set-enabled-user-from-group"),{user_id:n,enabled:a});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),console.error({error:e.t0});case 9:return e.abrupt("return",yt({groupId:t,page:c}));case 10:case"end":return e.stop()}}),e,null,[[1,6]])}))),At.apply(this,arguments)}function Nt(e,t){return Ct.apply(this,arguments)}function Ct(){return(Ct=Object(f.a)(Object(x.a)().mark((function e(t,n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.put("/admin/feature-flag-group/".concat(t,"/add-users"),n);case 2:re.toast.success("User Added Successfully");case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function It(e){return kt.apply(this,arguments)}function kt(){return(kt=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.post("/admin/feature-flag-group",{name:t});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error({error:e.t0});case 8:return e.abrupt("return",gt({}));case 9:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}function Dt(e){return Lt.apply(this,arguments)}function Lt(){return(Lt=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.put("/admin/feature-flag-group/".concat(t,"/release"),{release:!0});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error({error:e.t0});case 8:return e.abrupt("return",gt({}));case 9:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}function Ut(e){return Pt.apply(this,arguments)}function Pt(){return(Pt=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.put("/admin/feature-flag-group/".concat(t,"/release"),{release:!1});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error({error:e.t0});case 8:return e.abrupt("return",gt({}));case 9:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}function Wt(e,t,n){return Mt.apply(this,arguments)}function Mt(){return Mt=Object(f.a)(Object(x.a)().mark((function e(t,n,a){var c,r=arguments;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.length>3&&void 0!==r[3]?r[3]:1,e.prev=1,(c=new FormData).append("usersFile",t),"disable"!==a){e.next=7;break}return e.next=7,window.api.delete("/admin/feature-flag-group/".concat(n,"/users-bulk"),{data:c});case 7:if("enable"!==a){e.next=10;break}return e.next=10,window.api.post("/admin/feature-flag-group/".concat(n,"/users-bulk"),c,{headers:{"Content-Type":t.type}});case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),console.error({error:e.t0});case 15:case"end":return e.stop()}}),e,null,[[1,12]])}))),Mt.apply(this,arguments)}n(225);function Bt(){var e=Object(c.useState)(""),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(""),s=Object(m.a)(r,2),i=s[0],o=s[1],d=Object(c.useState)(1),u=Object(m.a)(d,2),j=u[0],b=u[1],h=Object(c.useState)(!1),p=Object(m.a)(h,2),O=p[0],_=p[1],v=Object(c.useState)([]),g=Object(m.a)(v,2),y=g[0],E=g[1],S=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return _(!0),e.next=3,gt({page:j,search:i});case 3:t=e.sent,E(t),_(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(c.useEffect)((function(){S()}),[j]);var w=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,c,r;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=n.replace(/\s/g,"_"))){e.next=10;break}return e.next=4,It(t);case 4:c=e.sent,r=c.sort((function(e,t){return e.name.localeCompare(t.name)})),a(""),E(r),e.next=11;break;case 10:re.toast.error("The name of the group can't be empty");case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n,a){var c;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,St(t,n,a?"enable":"disable");case 2:c=e.sent,E(c);case 4:case"end":return e.stop()}}),e)})));return function(t,n,a){return e.apply(this,arguments)}}();return Object(T.jsxs)(T.Fragment,{children:[Object(T.jsxs)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignContent:"center",justifyContent:"space-between",alignItems:"center"},children:[Object(T.jsx)("input",{type:"text",style:{width:"50%"},onChange:function(e){return a(e.target.value)},onKeyDown:function(e){return"Enter"===e.key&&w()},value:n,label:"Create group",placeholder:"Create group and press enter or click the Create button",id:"outlined-size-small",size:"small"}),Object(T.jsx)("button",{size:"small",variant:"contained",onClick:w,children:"Create"})]}),Object(T.jsxs)("div",{style:{width:"50%",margin:"30px 0"},children:[Object(T.jsx)("input",{style:{width:"75%"},type:"text",onChange:function(e){return o(e.target.value)},value:i}),Object(T.jsx)("button",{style:{marginLeft:15},variant:"contained",size:"small",onClick:function(){S()},children:"Search"})]}),O?Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Fetching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}):y.length>0&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Group Name"}),Object(T.jsx)(we.Th,{children:"Status"})]})}),Object(T.jsx)(we.Tbody,{children:y.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"groups/".concat(e.id),children:e.name})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(vt.a,{checked:e.enabled,color:"success",onClick:function(){return R(e.id,e.name,!e.enabled)}})})]},e.id)}))})]}),Object(T.jsxs)("div",{style:{display:"flex",placeContent:"center flex-end",padding:"20px",flexFlow:"row nowrap",alignItems:"center",justifyContent:"flex-end",flexDirection:"row",flexWrap:"nowrap"},children:[j>1&&Object(T.jsx)("div",{onClick:function(){return b((function(e){return e-1}))},children:"Back"}),Object(T.jsx)("div",{onClick:function(){return b((function(e){return e+1}))},children:"Next"})]})]})]})}var Ft=n(727),Gt=["users"],Vt=["users"];function Yt(e){var t=e.groupId,n=Object(c.useState)(1),a=Object(m.a)(n,2),r=a[0],s=a[1],i=Object(c.useState)(!0),o=Object(m.a)(i,2),u=o[0],j=o[1],b=Object(c.useState)(!1),h=Object(m.a)(b,2),p=h[0],O=h[1],v=Object(c.useState)([]),g=Object(m.a)(v,2),y=g[0],E=g[1],S=Object(c.useState)(""),w=Object(m.a)(S,2),R=w[0],A=w[1],N=Object(c.useState)(""),C=Object(m.a)(N,2),I=C[0],k=C[1],D=Object(c.useState)({}),L=Object(m.a)(D,2),U=L[0],P=L[1],W=Object(c.useRef)(null),M=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var n,a,c;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(!0),e.prev=1,e.next=4,yt({page:r,groupId:t,search:R});case 4:n=e.sent,a=n.users,c=Object(mt.a)(n,Gt),P(c),E(a.sort((function(e,t){return e.username.localeCompare(t.username)}))),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),console.error({error:e.t0});case 14:return e.prev=14,O(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=U.released?Ut:Dt,e.next=3,n(t);case 3:P(Object(d.a)(Object(d.a)({},U),{},{released:!U.released}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(c.useEffect)((function(){M()}),[r,t]);var F=function(){var e=Object(f.a)(Object(x.a)().mark((function e(n){var a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.target.files[0],e.prev=1,O(!0),n.target.value="",e.next=6,Wt(a,t,u?"enable":"disable",r);case 6:M(),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),console.log(Object(_.a)({},"Uploading file error: ",e.t0));case 12:return e.prev=12,O(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,9,12,15]])})));return function(t){return e.apply(this,arguments)}}(),G=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Nt(t,[I]);case 2:return e.next=4,M();case 4:k("");case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=function(){var e=Object(f.a)(Object(x.a)().mark((function e(n,a){var c,s,i;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rt(t,n,a,r);case 2:c=e.sent,s=c.users,i=Object(mt.a)(c,Vt),P(i),E(s.sort((function(e,t){return e.username.localeCompare(t.username)})));case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return U?Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("h1",{style:{width:"80%"},children:U.name}),Object(T.jsxs)("div",{style:{margin:"30px 0",display:"flex",flexDirection:"row",flexWrap:"nowrap",alignContent:"center",justifyContent:"space-between",alignItems:"center"},children:[Object(T.jsxs)("div",{style:{width:"50%"},children:[Object(T.jsx)("input",{style:{width:"75%"},type:"text",onChange:function(e){return A(e.target.value)},value:R}),Object(T.jsx)("button",{style:{marginLeft:15},variant:"contained",size:"small",onClick:function(){M()},children:"Search"})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("input",{type:"number",onChange:function(e){k(e.target.value)},placeholder:"insert an user id",value:I}),Object(T.jsx)("button",{variant:"contained",size:"small",onClick:G,disabled:!I,children:"Add user"})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("input",{style:{display:"none"},ref:W,type:"file",onChange:F,name:"filename"}),Object(T.jsx)("button",{variant:"contained",size:"small",onClick:function(){W.current.click()},children:"Upload .CSV"}),Object(T.jsxs)("span",{style:{marginLeft:15},children:[Object(T.jsx)("span",{style:{color:u&&"grey"},children:"Disable"}),Object(T.jsx)(Ft.a,{style:{margin:"0 15px"},value:u?"start":"end",control:Object(T.jsx)(vt.a,{checked:u,color:"success",onClick:function(){return j((function(e){return!e}))}})}),Object(T.jsx)("span",{style:{color:!u&&"grey"},children:"Enable"}),Object(T.jsx)(Ft.a,{style:{margin:"0 15px"},value:U.released?"start":"end",control:Object(T.jsx)(vt.a,{checked:U.released,color:"success",onClick:B})}),Object(T.jsx)("span",{style:{color:!U.released&&"grey"},children:U.released?"Feature released!":"Release feature"})]})]})]}),p?Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Fetching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}):Object(T.jsxs)(T.Fragment,{children:[Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"User Name"}),Object(T.jsx)(we.Th,{children:"Status"})]})}),Object(T.jsx)(we.Tbody,{children:y.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/users/".concat(e.id),children:e.username})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(vt.a,{checked:e.enabled,color:"success",onClick:function(){return V(e.id,!e.enabled)}})})]},e.id)}))})]}),Object(T.jsxs)("div",{style:{display:"flex",placeContent:"center flex-end",padding:"20px",flexFlow:"row nowrap",alignItems:"center",justifyContent:"flex-end",flexDirection:"row",flexWrap:"nowrap"},children:[r>1&&Object(T.jsx)("div",{onClick:function(){return s((function(e){return e-1}))},children:"Back"}),Object(T.jsx)("div",{style:{marginLeft:10},onClick:function(){return s((function(e){return e+1}))},children:"Next"})]})]})]}):Object(T.jsx)("h3",{children:"No group found"})}function Ht(){var e=Object(p.useParams)().groupId;return e?Object(T.jsx)(Yt,{groupId:e}):Object(T.jsx)(Bt,{})}var qt=function(){return Object(T.jsx)(xe,{group:me.a.SYSTEM.SETTINGS,children:Object(T.jsx)(l.c,{to:"/system/settings",children:"Settings"})})},Kt=function(){return Object(T.jsx)(xe,{group:me.a.SYSTEM.GAMING_SERVICE_SETTINGS,children:Object(T.jsx)(l.c,{to:"/system/gaming-service-settings",children:"Gaming Service Settings"})})},zt=function(){return Object(T.jsx)(xe,{group:me.a.SYSTEM.SETTINGS,children:Object(T.jsx)(l.c,{to:"/system/weekly",children:"Weekly Cashback Manager"})})},Xt=function(){return Object(T.jsx)(xe,{group:me.a.SYSTEM.WAITLIST_MANAGEMENT,children:Object(T.jsx)(l.c,{to:"/system/wait-list-management",children:" Wait List management "})})},Zt=function(){return Object(T.jsx)(xe,{group:me.a.SYSTEM.GROUPS,children:Object(T.jsx)(l.c,{to:"/system/groups",children:"Groups"})})},Qt=function(){return Object(T.jsx)(xe,{group:me.a.SYSTEM.RAFFLE_MANAGER,children:Object(T.jsx)(l.c,{to:"/system/raffle",children:"Raffle Manager"})})},Jt=function(){return Object(T.jsx)(xe,{group:me.a.SYSTEM.SETTINGS,children:Object(T.jsx)(l.c,{to:"/system/announcements",children:"Announcements"})})},$t=function(){return Object(T.jsx)(xe,{group:me.a.SYSTEM.SETTINGS,children:Object(T.jsx)(l.c,{to:"/system/routemappings",children:"Route Mappings"})})},en=function(){return Object(T.jsx)(xe,{group:me.a.STAFF_MANAGER.REQUESTS,children:Object(T.jsx)(l.c,{to:"/system/staff-manager",children:"Staff Manager"})})},tn=function(){return Object(T.jsx)(xe,{group:me.a.SYSTEM.CUSTOM_ANALYTICS,children:Object(T.jsx)(l.c,{to:"/system/admin-analytics",children:"Admin Analytics"})})},nn=function(){return Object(T.jsx)(xe,{group:me.a.SYSTEM.SETTINGS,children:Object(T.jsx)(l.c,{to:"/system/ticketia",children:"Ticket JIRA"})})},an=n(253),cn=(n(472),function(){function e(){Object(u.a)(this,e)}return Object(j.a)(e,[{key:"getProjects",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/jira/project");case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"getUsers",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/jira/users");case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"getStatusesForProject",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/jira/project/".concat(t,"/status"));case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"createIssue",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/jira/issue",t);case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),e}()),rn=new cn,sn=new an.Configuration({apiKey:Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_VERSION:"e6fbb940",REACT_APP_API_URL:"http://127.0.0.1:21001",REACT_APP_DEFAULT_IMAGE_URL:"https://d3fwl9ttzumvxe.cloudfront.net/bonuses/fb7a0acf8f3054e258528426cf20fdbc.svg"}).OPEN_AI_API_KEY}),on=new an.OpenAIApi(sn),ln=["10030"],dn=function(e){var t=e.name,n=e.img;return Object(T.jsx)("div",{children:Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",marginBottom:"10px",gap:"10px",backgroundColor:"var(--red)"},children:[Object(T.jsx)("p",{children:t}),Object(T.jsx)("img",{style:{borderRadius:"50%"},width:"48px",height:"48px",src:n,alt:""})]})})},un=function(){var e,t,n,a=Object(c.useState)(""),r=Object(m.a)(a,2),s=r[0],i=r[1],o=Object(c.useState)([]),l=Object(m.a)(o,2),u=l[0],j=l[1],b=Object(c.useState)([]),h=Object(m.a)(b,2),p=h[0],O=h[1],_=Object(c.useState)([]),v=Object(m.a)(_,2),g=v[0],y=v[1],E=Object(c.useState)({project:null,reporter:null,assignee:null}),S=Object(m.a)(E,2),w=S[0],R=S[1],A=Object(c.useState)([]),N=Object(m.a)(A,2),C=(N[0],N[1]),I=Object(c.useState)(!1),k=Object(m.a)(I,2),D=k[0],L=k[1],U=Object(c.useState)(""),P=Object(m.a)(U,2),W=P[0],M=P[1],B=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,a,c,r;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(s.length<100)){e.next=3;break}return alert("Please write more than 100 characters"),e.abrupt("return");case 3:return L(!0),e.prev=4,e.next=7,on.createChatCompletion({model:"gpt-3.5-turbo",messages:[{role:"assistant",content:"Write a jira story for this requirement: ".concat(s," , please use emojis to make the formatting more fancy.")}]});case 7:r=e.sent,L(!1),M((null===(n=r.data)||void 0===n||null===(a=n.choices[0])||void 0===a||null===(c=a.message)||void 0===c?void 0:c.content)||""),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(4),L(!1);case 15:L(!1);case 16:case"end":return e.stop()}}),e,null,[[4,12]])})));return function(t){return e.apply(this,arguments)}}();Object(c.useEffect)((function(){var e=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,rn.getProjects();case 2:return t=e.sent,e.next=5,rn.getUsers();case 5:n=e.sent,j(null===t||void 0===t?void 0:t.values),O(n);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]);var F=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.find((function(e){return e.id===t.target.value})),R(Object(d.a)(Object(d.a)({},w),{},{project:n})),e.next=4,rn.getStatusesForProject(t.target.value);case 4:a=e.sent,y(a);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),G=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=g.find((function(e){return e.id===t.target.value})),C(n.statuses);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),V=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,a,c,r,s;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),a=new FormData(t.target),(c=Object.fromEntries(a.entries())).project&&c.issue&&c.assignee&&c.summary&&c.description){e.next=6;break}return alert("Please fill all fields"),e.abrupt("return");case 6:return r={fields:{project:{id:c.project},summary:c.summary,description:{type:"doc",version:1,content:[{type:"paragraph",content:[{type:"text",text:W}]}]},issuetype:{id:c.issue},assignee:{id:c.assignee}}},ln.includes(null===w||void 0===w||null===(n=w.project)||void 0===n?void 0:n.id)&&(r.fields.reporter={id:c.reporter}),e.next=10,rn.createIssue(r);case 10:if(s=e.sent,!s.error){e.next=15;break}return alert("Something went wrong, please try again"),e.abrupt("return");case 15:alert("Ticket created successfully");case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Y=function(e,t){var n=p.find((function(t){return t.accountId===e.target.value}));"reporter"===e.target.name?R(Object(d.a)(Object(d.a)({},w),{},{reporter:n})):R(Object(d.a)(Object(d.a)({},w),{},{assignee:n}))};return Object(T.jsx)("div",{className:"ticketIA",children:Object(T.jsxs)("div",{className:"ticketIA__container",children:[Object(T.jsx)("h2",{children:"\ud83d\udcdd Create ticket with IA \ud83e\udd16"}),Object(T.jsxs)("div",{className:"ticketIA__container-textarea",children:[Object(T.jsx)("textarea",{placeholder:"Write your requirement",className:"ticketIA__textarea",value:s,onChange:function(e){return i(e.target.value)}}),Object(T.jsx)("button",{type:"button",onClick:B,children:"Get preview ticket"}),D&&Object(T.jsx)("div",{className:"ticketIA__loading",children:"Loading..."})]}),Object(T.jsxs)("form",{onSubmit:V,className:"ticketIA__form",children:[(null===w||void 0===w?void 0:w.project)&&Object(T.jsx)(dn,{img:null===(e=w.project)||void 0===e?void 0:e.avatarUrls["48x48"],name:null===(t=w.project)||void 0===t?void 0:t.name}),Object(T.jsxs)("select",{name:"project",onChange:F,className:"ticketIA__select",children:[Object(T.jsx)("option",{value:"",disabled:!0,selected:!0,children:"Project"}),u.map((function(e){return Object(T.jsx)("option",{value:e.id,children:e.name},e.key)}))]}),Object(T.jsxs)("select",{name:"issue",disabled:!g.length,onChange:G,className:"ticketIA__select",children:[Object(T.jsx)("option",{value:"",disabled:!0,selected:!0,children:"Issue type"}),g.map((function(e){return Object(T.jsx)("option",{value:e.id,children:e.name},e.id)}))]}),ln.includes(null===w||void 0===w||null===(n=w.project)||void 0===n?void 0:n.id)&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("label",{children:"Reporter (you)"}),Object(T.jsxs)("select",{onChange:Y,name:"reporter",className:"ticketIA__select",children:[Object(T.jsx)("option",{value:"",disabled:!0,selected:!0,children:"Account to assign "}),p.filter((function(e){return"atlassian"===e.accountType})).map((function(e){return Object(T.jsx)("option",{value:e.accountId,children:e.displayName},e.accountId)}))]})]}),Object(T.jsx)("label",{children:"Assign to"}),Object(T.jsxs)("select",{onChange:Y,name:"assignee",className:"ticketIA__select",children:[Object(T.jsx)("option",{value:"",disabled:!0,selected:!0,children:"Account to assign "}),p.filter((function(e){return"atlassian"===e.accountType})).map((function(e){return Object(T.jsx)("option",{value:e.accountId,children:e.displayName},e.accountId)}))]}),Object(T.jsx)("input",{name:"summary",placeholder:"Summary",type:"text"}),Object(T.jsx)("textarea",{onChange:function(e){i(e.target.value)},value:W,name:"description",className:"ticketIA__textarea ticketIA__textarea--preview"}),Object(T.jsx)("button",{type:"submit",onClick:function(){},children:"Create ticket on Jira"})]})]})})},jn=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){return Object(T.jsxs)("div",{className:"page",children:[Object(T.jsx)(O.BrowserView,{children:Object(T.jsxs)("nav",{className:"system-nav",children:[Object(T.jsx)(qt,{}),Object(T.jsx)(Kt,{}),Object(T.jsx)(Xt,{}),Object(T.jsx)(Zt,{}),Object(T.jsx)(zt,{}),Object(T.jsx)(Qt,{}),Object(T.jsx)(Jt,{}),Object(T.jsx)($t,{}),Object(T.jsx)(en,{}),Object(T.jsx)(tn,{}),be()&&Object(T.jsx)(nn,{})]})}),Object(T.jsxs)(p.Switch,{children:[be()&&Object(T.jsx)(ge,{group:me.a.SYSTEM.SETTINGS,path:"/system/ticketia",component:un}),Object(T.jsx)(ge,{group:me.a.SYSTEM.SETTINGS,path:"/system/settings",component:y}),Object(T.jsx)(ge,{group:me.a.SYSTEM.GAMING_SERVICE_SETTINGS,path:"/system/gaming-service-settings",component:se}),Object(T.jsx)(ge,{group:me.a.SYSTEM.WAITLIST_MANAGEMENT,exact:!0,path:"/system/wait-list-management",component:_t}),Object(T.jsx)(ge,{group:me.a.SYSTEM.WAITLIST_MANAGEMENT,path:"/system/wait-list-management/:feature",component:ft}),Object(T.jsx)(ge,{group:me.a.SYSTEM.GROUPS,exact:!0,path:"/system/groups",component:Ht}),Object(T.jsx)(ge,{group:me.a.SYSTEM.GROUPS,exact:!0,path:"/system/groups/:groupId",component:Ht}),Object(T.jsx)(ge,{group:me.a.SYSTEM.SETTINGS,path:"/system/weekly",component:Ne}),Object(T.jsx)(ge,{group:me.a.SYSTEM.RAFFLE_MANAGER,path:"/system/raffle",component:ke}),Object(T.jsx)(ge,{group:me.a.MARKETING.ANNOUNCEMENTS,path:"/system/announcements",component:Ye}),Object(T.jsx)(ge,{group:me.a.SYSTEM.SETTINGS,path:"/system/routemappings",component:it}),Object(T.jsx)(ge,{group:me.a.SYSTEM.CUSTOM_ANALYTICS,path:"/system/admin-analytics",component:jt}),Object(T.jsx)(xe,{group:me.a.STAFF_MANAGER,children:Object(T.jsx)(p.Route,{path:"/system/staff-manager",component:at})}),Object(T.jsx)(p.Redirect,{from:"/system",to:"/system/settings"})]})]})}}]),n}(c.Component),bn=(n(473),Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_VERSION:"e6fbb940",REACT_APP_API_URL:"http://127.0.0.1:21001",REACT_APP_DEFAULT_IMAGE_URL:"https://d3fwl9ttzumvxe.cloudfront.net/bonuses/fb7a0acf8f3054e258528426cf20fdbc.svg"}).REACT_APP_ENVIRONMENT||"local"),hn="e6fbb940",pn=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={name:"",page:1,records:[],meta:{},showEnabled:!0,showDisabled:!0,showNewlyReleased:!0,onlyFreeSpinsAllowed:!1,onlyDemoAllowed:!1,categories:[],ordinality:{}},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.search()}},{key:"componentDidUpdate",value:function(e,t,n){t.page!==this.state.page&&this.search()}},{key:"search",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={name:this.state.name,page:this.state.page},this.state.showEnabled&&!this.state.showDisabled?t.enabled=!0:!this.state.showEnabled&&this.state.showDisabled&&(t.enabled=!1),this.state.showNewlyReleased?t.newlyReleased=!0:t.newlyReleased=!1,e.next=5,window.api({method:"GET",url:"/admin/games",params:t});case 5:n=e.sent,this.setState({records:n.records||[],meta:n.meta||{}});case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getItems",value:function(){var e,t,n=this.state.records||[];return null!==(e=this.state)&&void 0!==e&&e.onlyFreeSpinsAllowed&&(n=n.filter((function(e){return null===e||void 0===e?void 0:e.free_spins_allowed}))),null!==(t=this.state)&&void 0!==t&&t.onlyDemoAllowed&&(n=n.filter((function(e){return!1===(null===e||void 0===e?void 0:e.demo_disabled)}))),n}},{key:"enable",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/game_providers/".concat(t,"/games/").concat(n,"/enable"));case 2:this.search();case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"disable",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/game_providers/".concat(t,"/games/").concat(n,"/disable"));case 2:this.search();case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"enableDemo",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/games/".concat(t,"/disable_demo"),{demo_disabled:!1});case 2:this.search();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"disableDemo",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/games/".concat(t,"/disable_demo"),{demo_disabled:!0});case 2:this.search();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsxs)("h2",{children:["Matching Games: ",this.state.meta.total_records]}),Object(T.jsx)("div",{className:"input-row",children:Object(T.jsx)("input",{value:this.state.name,onChange:function(t){e.setState({name:t.target.value},(function(){clearTimeout(e.timeout),e.timeout=setTimeout((function(){e.search()}),400)}))},placeholder:"Search (game name, provider name or category name)"})}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{children:[Object(T.jsxs)("span",{style:{marginRight:15,cursor:"pointer"},onClick:function(){e.setState({showEnabled:!e.state.showEnabled},e.search)},children:["Show Enabled"," ",Object(T.jsx)("input",{checked:this.state.showEnabled,type:"checkbox"})]}),Object(T.jsxs)("span",{style:{marginRight:15,cursor:"pointer"},onClick:function(){e.setState({showDisabled:!e.state.showDisabled},e.search)},children:["Show Disabled"," ",Object(T.jsx)("input",{checked:this.state.showDisabled,type:"checkbox"})]}),Object(T.jsxs)("span",{style:{marginRight:15,cursor:"pointer"},onClick:function(){e.setState({showNewlyReleased:!e.state.showNewlyReleased},e.search)},children:["Newly Released"," ",Object(T.jsx)("input",{checked:this.state.showNewlyReleased,type:"checkbox"})]}),Object(T.jsxs)("span",{style:{marginRight:15,cursor:"pointer"},onClick:function(){e.setState({onlyFreeSpinsAllowed:!e.state.onlyFreeSpinsAllowed})},children:["Show Free Spins Allowed"," ",Object(T.jsx)("input",{checked:this.state.onlyFreeSpinsAllowed,type:"checkbox"})]}),Object(T.jsxs)("span",{style:{marginRight:15,cursor:"pointer"},onClick:function(){e.setState({onlyDemoAllowed:!e.state.onlyDemoAllowed})},children:["Show Demo Allowed"," ",Object(T.jsx)("input",{checked:this.state.onlyDemoAllowed,type:"checkbox"})]})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Name"}),Object(T.jsx)(we.Th,{children:"Provider"}),Object(T.jsx)(we.Th,{children:"Aggregator"}),Object(T.jsx)(we.Th,{children:"Slug"}),Object(T.jsx)(we.Th,{children:"Enabled"})]})}),Object(T.jsx)(we.Tbody,{children:this.getItems().map((function(t,n){var a=t.enabled,c=t.demo_disabled;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/games/".concat(t.slug),children:t.name})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-providers/".concat(t.provider.slug),children:t.provider.name})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/games/".concat(t.slug),children:t.remote_id?t.remote_id.split(":")[0]:""})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/games/".concat(t.slug),children:t.slug})}),Object(T.jsxs)(we.Td,{children:[Object(T.jsx)("button",{onClick:function(){return a?e.disable(t.provider.slug,t.slug):e.enable(t.provider.slug,t.slug)},className:"small",children:a?"Disable":"Enable"}),Object(T.jsx)("button",{onClick:function(){return c?e.enableDemo(t.slug):e.disableDemo(t.slug)},className:"small",children:c?"Enable Demo":"Disable Demo"})]})]},n)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.meta.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),On=pn,_n=n(66),mn=n.n(_n),xn={categories:[],game:{categories:[{name:null,slug:null}],provider:{slug:null},aggregator:{},blocked_countries:[]},reportLoading:!1,gameReport:{data:{provider:{}}},newCategoryName:"",newCategoryNameTranslation:{}},fn=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).countries=mn()(),a.state=xn,a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetchGame()}},{key:"fetchGame",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/games/".concat(this.props.match.params.slug)).then((function(e){return t.setState({game:e})}));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"changeRTP",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=window.prompt("Enter RTP value for this game"))){e.next=4;break}return e.next=4,window.api.post("/admin/games/".concat(this.props.match.params.slug,"/change_rtp"),{rtp:t}).then((function(){re.toast.success("Success"),n.fetchGame()})).catch((function(e){return re.toast.error(e)}));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"changeSlug",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=window.prompt("Enter a new globally unique slug for this game"))){e.next=4;break}return e.next=4,window.api.post("/admin/games/".concat(this.props.match.params.slug,"/change_slug"),{new_slug:t}).then((function(){re.toast.success("Success"),n.props.history.push("/casino/games/".concat(t)),n.fetchGame()})).catch((function(e){return re.toast.error(e)}));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"changeGameName",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=window.prompt("Enter a new globally unique name for this game"))){e.next=4;break}return e.next=4,window.api.post("/admin/games/".concat(this.props.match.params.slug,"/change_game_name"),{new_game_name:t}).then((function(){re.toast.success("Success"),n.fetchGame()})).catch((function(e){return re.toast.error(e)}));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"moveToNewProvider",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=window.prompt("Enter the slug of the provider you would like to move this game to"))){e.next=4;break}return e.next=4,window.api.post("/admin/games/".concat(this.props.match.params.slug,"/move_to_new_provider"),{destination_provider_slug:t}).then((function(){re.toast.success("Success"),n.fetchGame()})).catch((function(e){return re.toast.error(e)}));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"changeImageUrl",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n,a){var c,r=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return re.toast.info("Uploading image..."),e.next=3,window.api.upload(t,"games",a?"".concat(n,"-new"):n);case 3:return c=e.sent,e.next=6,window.api.post("/admin/games/".concat(this.props.match.params.slug,"/change_image"),{image_url:c,is_new_image:a}).then((function(){re.toast.success("Image changed"),r.fetchGame()})).catch((function(e){return re.toast.error(e)}));case 6:case"end":return e.stop()}}),e,this)})));return function(t,n,a){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=this.state.game,n=t.id,a=t.image_url,c=t.name,r=t.slug,s=t.provider,i=t.aggregator,o=t.blocked_countries,d=t.hit_rate,u=t.paylines,j=t.return_to_player,b=t.free_spins_allowed,h=t.desktop_allowed,p=t.mobile_allowed,O=t.volatility_rating,_=t.released_at,m=t.remote_id,v=t.image_url_new,g=t.demo_allowed;return Object(T.jsx)("div",{className:"row game-page",children:Object(T.jsxs)("div",{className:"col-md-12",children:[Object(T.jsxs)("div",{className:"data",style:{lineHeight:"2",display:"flex",alignItems:"flex-start"},children:[Object(T.jsxs)("div",{children:[Object(T.jsx)("img",{src:a,style:{width:"250px",height:"250px",borderRadius:"5px"}}),Object(T.jsx)("br",{}),Object(T.jsxs)("h2",{children:["NEW IMAGE URL ",v?"\ud83d\udc47":"NOT SET"]}),v&&Object(T.jsx)("img",{src:v,style:{width:"250px",height:"250px",borderRadius:"5px"}})]}),Object(T.jsxs)("div",{className:"info",style:{marginLeft:"25px"},children:[Object(T.jsxs)("div",{children:["Name: ",c," ",Object(T.jsx)("button",{onClick:function(){return e.changeGameName()},className:"small",children:"Change"})]}),Object(T.jsxs)("div",{children:["Slug: ",r," ",Object(T.jsx)("button",{onClick:function(){return e.changeSlug()},className:"small",children:"Change"})]}),Object(T.jsxs)("div",{children:["Remote ID: ",m]}),Object(T.jsxs)("div",{children:["Aggregator: ",m?m.split(":")[0]:""]}),Object(T.jsxs)("div",{children:["Provider:"," ",Object(T.jsx)(l.b,{to:"/casino/game-providers/".concat(s.slug),children:s.name})," ",Object(T.jsx)("button",{onClick:function(){return e.moveToNewProvider()},className:"small",children:"Move"})]}),Object(T.jsxs)("div",{children:["Aggregator: ",i.name]}),Object(T.jsxs)("div",{children:["Blocked countries: ",o.toString()]}),Object(T.jsxs)("div",{children:["Hit rate: ",d]}),Object(T.jsxs)("div",{children:["Paylines: ",u]}),Object(T.jsxs)("div",{children:["RTP: ",j,"%"," ",Object(T.jsx)("button",{onClick:function(){return e.changeRTP()},className:"small",children:"Change"})]}),Object(T.jsxs)("div",{children:["Volatility rating: ",O]}),Object(T.jsxs)("div",{children:["Free spins allowed: ",b?"yes":"no"]}),Object(T.jsxs)("div",{children:["Desktop allowed: ",h?"yes":"no"]}),Object(T.jsxs)("div",{children:["Mobile allowed: ",p?"yes":"no"]}),Object(T.jsxs)("div",{children:["Demo allowed: ",g?"yes":"no"]}),Object(T.jsxs)("div",{children:["Release date: ",_]}),Object(T.jsxs)("div",{children:["Id: ",n]}),Object(T.jsx)("h4",{children:"Upload Image"}),Object(T.jsx)("input",{type:"file",onChange:function(){var t=Object(f.a)(Object(x.a)().mark((function t(a){return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.changeImageUrl(a.target.files[0],n);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}),Object(T.jsx)("h4",{children:"Upload Image NEW WITH NEW FORMAT"}),Object(T.jsx)("input",{type:"file",onChange:function(){var t=Object(f.a)(Object(x.a)().mark((function t(a){return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.changeImageUrl(a.target.files[0],n,!0);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})]})]}),Object(T.jsx)("hr",{})]})})}}]),n}(c.Component),vn=Object(o.b)((function(e){return{languages:e.app.languages}}))(fn),gn=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,records:[],meta:{}},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(e,t,n){t.page!==this.state.page&&this.update()}},{key:"update",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/game_providers",{params:{page:this.state.page}});case 2:t=e.sent,this.setState({records:t.records||[],meta:t.meta||{}});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"enable",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/game_providers/".concat(t,"/enable"));case 2:this.update();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"disable",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/game_providers/".concat(t,"/disable"));case 2:this.update();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsxs)("h2",{children:["Total Providers: ",this.state.meta.total_records]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Name"}),Object(T.jsx)(we.Th,{children:"Slug"}),Object(T.jsx)(we.Th,{children:"Enabled"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.records.map((function(t,n){var a=t.enabled;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-providers/".concat(t.slug),children:t.name})}),Object(T.jsx)(we.Td,{children:t.slug}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("button",{onClick:function(){return a?e.disable(t.slug):e.enable(t.slug)},className:"small",children:a?"Disable":"Enable"})})]},n)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.meta.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),Tn=gn,yn=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,records:[]},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(e,t,n){t.page!==this.state.page&&this.update()}},{key:"update",value:function(){var e=this;window.api.get("/admin/loyalty",{params:{page:this.state.page}}).then((function(t){return e.setState({records:t.records,total_pages:t.meta.total_pages})}))}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsx)("h3",{children:"Loyalty"}),Object(T.jsx)("br",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Period"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"User"}),Object(T.jsx)(we.Th,{children:"Level"}),Object(T.jsx)(we.Th,{children:"Percentage"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Calculation variables"})]})}),Object(T.jsx)("tbody",{children:this.state.records.map((function(e,t){return e.loyalty_period=e.loyalty_period||{},e.loyalty_period.starts_at=e.loyalty_period.starts_at||"",e.loyalty_period.ends_at=e.loyalty_period.ends_at||"",e.user=e.user||{},e.transaction=e.transaction||{wallet:{}},Object(T.jsxs)(we.Tr,{children:[Object(T.jsxs)(we.Td,{children:[e.loyalty_period.starts_at.split("T")[0]," - ",e.loyalty_period.ends_at.split("T")[0]]}),Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsx)(we.Td,{className:"user",children:Object(T.jsxs)(l.b,{to:"/users/".concat(e.user_id,"/loyalty"),children:[Object(T.jsx)("img",{src:e.user.avatar_url}),e.user.username]})}),Object(T.jsx)(we.Td,{children:e.level}),Object(T.jsx)(we.Td,{children:e.percentage}),Object(T.jsxs)(we.Td,{children:[e.transaction.amount," ",e.transaction.wallet.currency_type]}),Object(T.jsx)(we.Td,{children:Object.keys(e.calculation_values||{}).map((function(t){return Object(T.jsxs)("span",{style:{marginRight:5},children:[t," = ",e.calculation_values[t]]})}))})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),En="bonuses/UPDATE",Sn="bonus/ACTIVATIONS/UPDATE",wn="bonus/ACTIVATIONS_ON_WITHDRAWAL/UPDATE",Rn=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=0,c=Object.entries(n);a<c.length;a++){var r=Object(m.a)(c[a],2),s=r[0],i=r[1],o=void 0;i.trim("")&&(o="".concat(s,"=").concat(i)),o&&(t?t+="&"+o:t="&"+o)}return t||(t=""),function(n){window.api.get("/admin/bonuses?page="+(e||1)+t).then((function(e){n({type:En,payload:e})}))}},An=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n="https://d3fwl9ttzumvxe.cloudfront.net/bonuses/fb7a0acf8f3054e258528426cf20fdbc.svg"){e.next=5;break}return e.next=4,window.api.upload(t,"bonuses");case 4:case 7:return e.abrupt("return",e.sent);case 5:return e.next=7,n;case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Nn=function(e){for(var t in e)""===e[t]&&(e[t]=null);return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,An(e.file);case 2:e.image_url=t.sent,delete e.file,window.api.post("/admin/bonuses",e).then((function(e){re.toast.success("Bonus created (".concat(e.id,").")),n(Rn())}));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},Cn=function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a,c;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a="/admin/bonuses/bonus_activations?userId=".concat(e,"&status=transferred"),t.next=3,window.api.get(a);case 3:c=t.sent,n({type:wn,payload:c});case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},In=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={category:null,page:1,excluded_countries:[],supported_countries:[],excluded_country:"",supported_country:"",currency_type:"EUR",globally_available:!0,queryFilter:{},hasChange:!1},a.countries=mn()(),a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){this.props.update(this.state.page,this.state.queryFilter)}},{key:"componentDidUpdate",value:function(e,t){t.queryFilter!==this.state.queryFilter&&!0===this.state.hasChange&&(this.update(),this.setState(Object(d.a)(Object(d.a)({},this.state),{},{hasChange:!1})))}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Expires At"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Currency Type"}),Object(T.jsx)(we.Th,{children:"Name"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Maximum Bonus"}),Object(T.jsx)(we.Th,{children:"Deposit Ratio"}),Object(T.jsx)(we.Th,{children:"Wager Ratio"}),Object(T.jsx)(we.Th,{children:"Banner"}),Object(T.jsx)(we.Th,{children:"Globally Available"}),Object(T.jsx)(we.Th,{children:"Excluded Countries"}),Object(T.jsx)(we.Th,{children:"Name translation"}),Object(T.jsx)(we.Th,{children:"Banner translation"}),Object(T.jsx)(we.Th,{children:"Description translation"})]})}),Object(T.jsx)(we.Tbody,{children:this.props.records.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:Se.withMinutes(e.expires_at)})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:Object(T.jsx)(l.b,{to:"/casino/bonuses/".concat(e.id),children:e.id})})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:e.type})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:e.currency_type})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:Object(T.jsx)(l.b,{to:"/casino/bonuses/".concat(e.id),children:e.name})})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:e.amount})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:e.maximum})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:e.deposit_ratio})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:e.wager_ratio})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:e.banner})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:e.globally_available&&Object(T.jsx)("i",{className:"fas fa-check"})})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:(e.countries||[]).map((function(e){return e+","}))})}),Object(T.jsxs)(we.Td,{children:[Object(T.jsx)("span",{children:JSON.stringify(e.name_translation)})," "]}),Object(T.jsxs)(we.Td,{children:[Object(T.jsx)("span",{children:JSON.stringify(e.banner_translation)})," "]}),Object(T.jsxs)(we.Td,{children:[Object(T.jsx)("span",{children:JSON.stringify(e.description_translation)})," "]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.props.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update()}))}})]})}}]),n}(c.Component),kn=Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e.bonuses.search_results),{},{currencies:e.app.currencies})}),(function(e){return{update:function(t,n){return e(Rn(t,n))},createDepositBonus:function(t){return e(Nn(t))}}}))(In),Dn=n(39),Ln=n(50),Un=function(){return function(e){window.api.get("/admin/rewards/mystery_boxes").then((function(t){e({type:Ln.CASES_UPDATE,payload:t})}))}},Pn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(n){window.api.get("/admin/rewards?page=".concat(e,"&all=").concat(t)).then((function(e){n({type:Ln.CASE_ITEMS_UPDATE,payload:e})}))}},Wn=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={category:null,page:1,excluded_countries:[],supported_countries:[],excluded_country:"",supported_country:"",currency_type:"EUR",globally_available:!1,landing_page_type:{},type:{label:"Deposit Bonus",value:"deposit"},name_translation:{},description_translation:{},banner_translation:{},terms_translation:{},reward:{}},a.renderDepositRules=a.renderDepositRules.bind(Object(Dn.a)(a)),a.renderRewardRules=a.renderRewardRules.bind(Object(Dn.a)(a)),a.renderBonusTypeRules=a.renderBonusTypeRules.bind(Object(Dn.a)(a)),a.getDepositRules=a.getDepositRules.bind(Object(Dn.a)(a)),a.getRewardRules=a.getRewardRules.bind(Object(Dn.a)(a)),a.getBonusRules=a.getBonusRules.bind(Object(Dn.a)(a)),a.createBonusHandler=a.createBonusHandler.bind(Object(Dn.a)(a)),a.onClickSubmitHandler=a.onClickSubmitHandler.bind(Object(Dn.a)(a)),a.countries=mn()(),a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update(),he(Oe.permissionsConstants.REWARDS_VIEW_LIST)&&this.props.updateRewards()}},{key:"update",value:function(){this.props.update(this.state.page)}},{key:"getDepositRules",value:function(){return[this.amount.value,this.maximum_bonus.value,this.deposit_ratio.value,this.wager_ratio.value]}},{key:"getRewardRules",value:function(){return[0,this.state.reward.value,this.total_deposited_required.value]}},{key:"getBonusRules",value:function(){var e,t,n,a,c,r;switch(this.state.type.value){case"deposit":case"free_bet":case"welcome_bonus":case"deposit_sports":var s=this.getDepositRules(),i=Object(m.a)(s,4);e=i[0],t=i[1],n=i[2],a=i[3];break;case"deposit_reward":var o=this.getRewardRules(),l=Object(m.a)(o,3);a=l[0],c=l[1],r=l[2]}return{amount:e,maximum:t,deposit_ratio:n,wager_ratio:a,reward_id:c,total_deposited_required:r}}},{key:"getFormattedBonusTerms",value:function(){var e=this.bonus_terms.value;return(e=e.trim())?e.split("\n"):[]}},{key:"getFormattedBonusTermsTranslation",value:function(){var e=this.state.terms_translation;for(var t in e)e[t]=e[t].trim().split("\n");return e}},{key:"createBonusHandler",value:function(){this.props.createDepositBonus(Object(d.a)(Object(d.a)({},this.getBonusRules()),{},{type:this.state.type.value,url_slug:this.url_slug.value,currency_type:this.state.currency_type.value,name:this.name.value,description:this.description.value,file:this.state.file,expires_at:Ee.a.utc().add(this.expires_at.value,"days"),excluded_countries:this.state.excluded_countries,supported_countries:this.state.supported_countries,globally_available:this.state.globally_available,landing_page_type:this.state.landing_page_type.value,inventory_expiry_delay_minutes:this.inventory_expiry_delay_minutes.value,activation_expiry_delay_minutes:this.activation_expiry_delay_minutes.value,banner:this.banner.value,name_translation:this.state.name_translation,banner_translation:this.state.banner_translation,description_translation:this.state.description_translation,terms:this.getFormattedBonusTerms(),terms_translation:this.getFormattedBonusTermsTranslation(),welcome_bonus:!!this.state.type.value&&"welcome_bonus"===this.state.type.value.toLowerCase()}))}},{key:"onClickSubmitHandler",value:function(e){e.preventDefault(),this.createBonusHandler()}},{key:"renderDepositRules",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Amount (flat and free bet only)"}),Object(T.jsx)("input",{placeholder:"Amount to credit (leave blank for deposit bonus)",ref:function(t){return e.amount=t}}),Object(T.jsx)("h4",{children:"Maximum (deposit bonus only)"}),Object(T.jsx)("input",{placeholder:"Maximum Bonus (ex. 100 for $100 USD)",ref:function(t){return e.maximum_bonus=t}}),Object(T.jsx)("h4",{children:"Deposit Ratio (deposit bonus only)"}),Object(T.jsx)("input",{placeholder:"Deposit Ratio (ex. 0.5 will give $50 for a $100 Deposit, leave at 1 for non-deposit type)",ref:function(t){return e.deposit_ratio=t}}),Object(T.jsx)("hr",{}),Object(T.jsx)("h4",{children:"Wager Ratio"}),Object(T.jsx)("input",{placeholder:"Wager Ratio (35 means 35 * the amount credited must be wagered before its transferred)",ref:function(t){return e.wager_ratio=t}})]})}},{key:"renderRewardRules",value:function(){var e=this,t=this.props.rewards,n=void 0===t?[]:t;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Total Deposited Required"}),Object(T.jsx)("input",{placeholder:"Total Deposited Required (ex. 100 for $100 USD)",ref:function(t){return e.total_deposited_required=t}}),Object(T.jsx)("h4",{children:"Reward"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.reward,onChange:function(t){return e.setState({reward:t})},options:n.map((function(e){return{label:Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("img",{style:{width:"30px"},src:e.image_url}),"(ID: $",e.id,") - $",e.name," (\u20ac $",e.eur_value,")"]}),value:e.id}}))})]})}},{key:"renderBonusTypeRules",value:function(){return{deposit:this.renderDepositRules,deposit_reward:this.renderRewardRules,deposit_sports:this.renderDepositRules,free_bet:this.renderDepositRules,welcome_bonus:this.renderDepositRules}[this.state.type.value]()}},{key:"render",value:function(){var e=this,t=this.props.landing_page_types,n=void 0===t?[]:t;return Object(T.jsxs)("div",{children:[Object(T.jsx)("h1",{style:{fontSize:"14px"},children:"Remember if you want to create a bonus and show in all languages you must to create with the translation for en, es and pt or pt-br"}),Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsx)("h4",{children:"Create Bonus"}),Object(T.jsx)("br",{}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.type,onChange:function(t){return e.setState({type:t})},options:[{label:"Deposit Bonus",value:"deposit"},{label:"Deposit Reward Bonus",value:"deposit_reward"},{label:"Deposit Bonus for Sports",value:"deposit_sports"},{label:"Welcome Bonus",value:"welcome_bonus"}]}),Object(T.jsx)("input",{placeholder:"Name (ex. Worlds 500% Bonus)",ref:function(t){return e.name=t}}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.name_translation,onChange:function(t){return e.setState({name_translation:t})},label:"Name Translation"}),Object(T.jsx)("h4",{children:"Landing Page type"}),Object(T.jsx)("br",{}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.landing_page_type,onChange:function(t){return e.setState({landing_page_type:t})},options:n.map((function(e){return{label:e,value:e}}))}),Object(T.jsx)("h4",{children:"Banner (Banner for affiliate page)"}),Object(T.jsx)("input",{placeholder:"Banner",ref:function(t){return e.banner=t}}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.banner_translation,onChange:function(t){return e.setState({banner_translation:t})},label:"Banner Translation"}),Object(T.jsx)("h4",{children:"Upload Image"}),Object(T.jsx)("input",{type:"file",onChange:function(t){e.setState({file:t.target.files[0]})}}),Object(T.jsx)("br",{}),Object(T.jsx)("h4",{children:"Description"}),Object(T.jsx)("textarea",{placeholder:"Description HTML",ref:function(t){return e.description=t}}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.description_translation,onChange:function(t){return e.setState({description_translation:t})},label:"Description Translation"}),Object(T.jsx)("h4",{children:"URL Slug"}),Object(T.jsx)("input",{placeholder:"Ex (weekend-500-eur-bonus will have a landing page at blaze.com/bonuses/weekend-500-bonus/{id}",ref:function(t){return e.url_slug=t}}),Object(T.jsx)("hr",{}),this.renderBonusTypeRules(),Object(T.jsx)("h4",{children:"Expire Days"}),Object(T.jsx)("input",{placeholder:"Expire time in days (ex. 7)",ref:function(t){return e.expires_at=t}}),Object(T.jsx)("h4",{children:"Inventory Expire Minutes (if left blank, defaults to the bonus expire date)"}),Object(T.jsx)("input",{placeholder:"Expire time in minutes for the inventory object after its created (ex. 1440 for 1 day)",ref:function(t){return e.inventory_expiry_delay_minutes=t}}),Object(T.jsx)("h4",{children:"Activation Expire Minutes (if left blank, defaults to the bonus expire date)"}),Object(T.jsx)("input",{placeholder:"Expire time in minutes for the activation object after its created (ex. 1440 for 1 day)",ref:function(t){return e.activation_expiry_delay_minutes=t}}),Object(T.jsx)("div",{className:"input-group",children:Object(T.jsxs)("div",{className:"input-row",children:[Object(T.jsx)("label",{children:"Globally Available (auto added to inventory)"}),Object(T.jsx)("input",{type:"checkbox",checked:this.state.globally_available,onChange:function(){return e.setState({globally_available:!e.state.globally_available})}})]})}),Object(T.jsx)("h4",{children:"Bonus Terms"}),Object(T.jsx)("textarea",{style:{height:"15rem"},placeholder:"Bonus Terms",ref:function(t){return e.bonus_terms=t}}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.terms_translation,onChange:function(t){return e.setState({terms_translation:t})},label:"Terms Translation"}),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"tags-wrapper",children:[Object(T.jsx)("h5",{children:"Supported Countries"}),Object(T.jsx)("div",{className:"draggable-tags",children:Object(T.jsx)("div",{className:"row",style:{width:"100%"},children:this.state.supported_countries.map((function(t){return Object(T.jsx)("div",{className:"col-xs-2",children:Object(T.jsxs)("div",{className:"tag",children:[t,Object(T.jsx)("i",{onClick:function(){e.setState({supported_countries:e.state.supported_countries.filter((function(e){return e!==t}))})},className:"fas fa-times-circle"})]})})}))})}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsx)(Ce.a,{name:"type",value:this.state.supported_country,onChange:function(t){return e.setState({supported_country:t})},options:Object.keys(this.countries.getNameList()).filter((function(t){return-1===e.state.excluded_countries.indexOf(e.countries.getCode(t))})).map((function(t,n){return{label:t,value:e.countries.getCode(t)}}))}),Object(T.jsx)("button",{onClick:function(){return e.setState({supported_countries:e.state.supported_countries.concat([e.state.supported_country.value])})},children:"Add Country"})]})]}),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"tags-wrapper",children:[Object(T.jsx)("h5",{children:"Excluded Countries"}),Object(T.jsx)("div",{className:"draggable-tags",children:Object(T.jsx)("div",{className:"row",style:{width:"100%"},children:this.state.excluded_countries.map((function(t){return Object(T.jsx)("div",{className:"col-xs-2",children:Object(T.jsxs)("div",{className:"tag",children:[t,Object(T.jsx)("i",{onClick:function(){e.setState({excluded_countries:e.state.excluded_countries.filter((function(e){return e!==t}))})},className:"fas fa-times-circle"})]})})}))})}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsx)(Ce.a,{name:"type",value:this.state.excluded_country,onChange:function(t){return e.setState({excluded_country:t})},options:Object.keys(this.countries.getNameList()).filter((function(t){return-1===e.state.supported_countries.indexOf(e.countries.getCode(t))})).map((function(t,n){return{label:t,value:e.countries.getCode(t)}}))}),Object(T.jsx)("button",{onClick:function(){return e.setState({excluded_countries:e.state.excluded_countries.concat([e.state.excluded_country.value])})},children:"Add Country"})]})]}),Object(T.jsx)("button",{onClick:this.onClickSubmitHandler,children:"Submit"})]})]})}}]),n}(c.Component),Mn=Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e.bonuses.search_results),{},{rewards:e.rewards.items.records,currencies:e.app.currencies,landing_page_types:["roulette","gift","guy_hands_down","crash","guy_hands_up","trophy","casino"],languages:e.app.languages})}),(function(e){return{update:function(t){return e(Rn(t))},createDepositBonus:function(t){return e(Nn(t))},updateRewards:function(t){return e(Pn(t))}}}))(Wn),Bn=(n(294),function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).handleFileChange=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,c;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.target.files[0])){e.next=15;break}return e.prev=2,re.toast.info("Uploading image..."),e.next=6,window.api.upload(n,"games","".concat(a.props.match.params.id,"-new"));case 6:c=e.sent,a.imageUrlRef.current.value=c,a.setState({bonus:Object(d.a)(Object(d.a)({},a.state.bonus),{},{image_url:c})}),re.toast.success("Image uploaded successfully."),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),re.toast.error("Cannot upload image to bucket.");case 15:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(t){return e.apply(this,arguments)}}(),a.save=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t={name_translation:a.state.bonus.name_translation,description_translation:a.state.bonus.description_translation,banner_translation:a.state.bonus.banner_translation,terms_translation:a.getFormattedBonusTermsTranslation(),name:a.nameRef.current.value,description:a.descriptionRef.current.value,image_url:a.imageUrlRef.current.value,maximum:a.maximumRef.current.value,deposit_ratio:a.depositRatioRef.current.value,amount:a.amountRef.current.value,expires_at:a.expiresAtRef.current.value,globally_available:a.globallyAvailableRef.current.checked,currency_type:a.currencyTypeRef.current.value,excluded_countries:a.excludedCountriesRef.current.value.split(",").map((function(e){return e.trim()})),supported_countries:a.supportedCountriesRef.current.value.split(",").map((function(e){return e.trim()})),inventory_expiry_delay_minutes:a.inventoryExpiryDelayMinutesRef.current.value,activation_expiry_delay_minutes:a.activationExpiryDelayMinutesRef.current.value,url_slug:a.urlSlugRef.current.value,landing_page_type:a.landingPageTypeRef.current.value,banner:a.bannerRef.current.value},window.api.put("/admin/bonuses/".concat(a.props.match.params.id),t).then((function(){re.toast.success("Bonus saved successfully."),setTimeout((function(){a.props.history.push("/casino/bonuses")}),500)})).catch((function(e){return re.toast.error("Failed to save bonus.")}));case 2:case"end":return e.stop()}}),e)}))),a.toggleEdit=function(){a.setState({isEditing:!a.state.isEditing})},a.state={bonus:{name_translation:{},description_translation:{},banner_translation:{},terms_translation:{},image_url:"",maximum:"",deposit_ratio:"",amount:"",expires_at:"",globally_available:!1,excluded_countries:"",currency_type:"",supported_countries:"",inventory_expiry_delay_minutes:"",activation_expiry_delay_minutes:"",url_slug:"",landing_page_type:"",banner:""},isLoading:!0,isEditing:!1},a.nameRef=Object(c.createRef)(),a.descriptionRef=Object(c.createRef)(),a.imageUrlRef=Object(c.createRef)(),a.maximumRef=Object(c.createRef)(),a.depositRatioRef=Object(c.createRef)(),a.amountRef=Object(c.createRef)(),a.expiresAtRef=Object(c.createRef)(),a.globallyAvailableRef=Object(c.createRef)(),a.excludedCountriesRef=Object(c.createRef)(),a.currencyTypeRef=Object(c.createRef)(),a.supportedCountriesRef=Object(c.createRef)(),a.inventoryExpiryDelayMinutesRef=Object(c.createRef)(),a.activationExpiryDelayMinutesRef=Object(c.createRef)(),a.urlSlugRef=Object(c.createRef)(),a.landingPageTypeRef=Object(c.createRef)(),a.bannerRef=Object(c.createRef)(),a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){var e=this;window.api.get("/admin/bonuses/".concat(this.props.match.params.id)).then((function(t){var n={};for(var a in t.terms_translation)n[a]=t.terms_translation[a].join("\n");e.setState({bonus:Object(d.a)(Object(d.a)({},t),{},{terms_translation:n}),isLoading:!1})}))}},{key:"getFormattedBonusTermsTranslation",value:function(){var e=this.state.bonus.terms_translation;for(var t in e)e[t]=e[t].trim().split("\n");return e}},{key:"render",value:function(){var e=this,t=this.state,n=t.isEditing;return t.isLoading?Object(T.jsx)("h3",{children:"Loading..."}):Object(T.jsxs)("div",{className:"container",children:[Object(T.jsx)("div",{className:"button-container",children:Object(T.jsx)("button",{onClick:this.toggleEdit,children:n?"Cancel":"Edit"})}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.BONUSES_UPDATE_BONUS,children:[Object(T.jsxs)("div",{className:"container",children:[Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Name:"}),Object(T.jsx)("input",{type:"text",ref:this.nameRef,defaultValue:this.state.bonus.name,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Description:"}),Object(T.jsx)("input",{type:"text",ref:this.descriptionRef,defaultValue:this.state.bonus.description,disabled:!n})]}),Object(T.jsxs)("div",{className:"file-container",children:[Object(T.jsx)("div",{children:Object(T.jsx)("label",{children:"Image URL:"})}),Object(T.jsxs)("div",{className:"file-input-container",children:[Object(T.jsx)("input",{type:"text",ref:this.imageUrlRef,defaultValue:this.state.bonus.image_url,disabled:!n}),Object(T.jsx)("input",{type:"file",onChange:this.handleFileChange,disabled:!n})]})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Maximum:"}),Object(T.jsx)("input",{type:"number",ref:this.maximumRef,defaultValue:this.state.bonus.maximum,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Deposit Ratio:"}),Object(T.jsx)("input",{type:"number",ref:this.depositRatioRef,defaultValue:this.state.bonus.deposit_ratio,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Amount:"}),Object(T.jsx)("input",{type:"number",ref:this.amountRef,defaultValue:this.state.bonus.amount,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Expires At:"}),Object(T.jsx)("input",{type:"datetime-local",ref:this.expiresAtRef,defaultValue:this.state.bonus.expires_at,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Globally Available:"}),Object(T.jsx)("input",{type:"checkbox",ref:this.globallyAvailableRef,defaultChecked:this.state.bonus.globally_available,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Excluded Countries:"}),Object(T.jsx)("input",{type:"text",ref:this.excludedCountriesRef,defaultValue:this.state.bonus.excluded_countries,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Currency Type:"}),Object(T.jsx)("input",{type:"text",ref:this.currencyTypeRef,defaultValue:this.state.bonus.currency_type,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Supported Countries:"}),Object(T.jsx)("input",{type:"text",ref:this.supportedCountriesRef,defaultValue:this.state.bonus.supported_countries,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Inventory Expiry Delay (Minutes):"}),Object(T.jsx)("input",{type:"number",ref:this.inventoryExpiryDelayMinutesRef,defaultValue:this.state.bonus.inventory_expiry_delay_minutes,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Activation Expiry Delay (Minutes):"}),Object(T.jsx)("input",{type:"number",ref:this.activationExpiryDelayMinutesRef,defaultValue:this.state.bonus.activation_expiry_delay_minutes,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"URL Slug:"}),Object(T.jsx)("input",{type:"text",ref:this.urlSlugRef,defaultValue:this.state.bonus.url_slug,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Landing Page Type:"}),Object(T.jsx)("input",{type:"text",ref:this.landingPageTypeRef,defaultValue:this.state.bonus.landing_page_type,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Banner:"}),Object(T.jsx)("input",{type:"text",ref:this.bannerRef,defaultValue:this.state.bonus.banner,disabled:!n})]})]}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.bonus.name_translation,onChange:function(t){return e.setState({bonus:Object(d.a)(Object(d.a)({},e.state.bonus),{},{name_translation:t})})},label:"Name Translation"}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.bonus.description_translation,onChange:function(t){return e.setState({bonus:Object(d.a)(Object(d.a)({},e.state.bonus),{},{description_translation:t})})},label:"Description Translation",disabled:!n}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.bonus.banner_translation,onChange:function(t){return e.setState({bonus:Object(d.a)(Object(d.a)({},e.state.bonus),{},{banner_translation:t})})},label:"Banner Translation",disabled:!n}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.bonus.terms_translation,onChange:function(t){return e.setState({bonus:Object(d.a)(Object(d.a)({},e.state.bonus),{},{terms_translation:t})})},label:"Terms Translation",disabled:!n}),n&&Object(T.jsx)("div",{className:"button-container",children:Object(T.jsx)("button",{onClick:this.save,children:"Save"})})]})]})}}]),n}(c.Component)),Fn=n(76),Gn=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={query:"",page:1,results:{pagination:{total_pages:1,records_per_page:50},records:[]},edit_row:{},creating:!1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update(),he(Oe.permissionsConstants.BONUSES_VIEW_LIST)&&this.props.dispatch(Rn())}},{key:"getBase",value:function(){return"/admin/bonus_round_welcome_packages"}},{key:"update",value:function(){var e=this,t={};this.table&&(t={page:this.table.state.page+1,sorting:this.table.state.sorted[0],filters:this.table.state.filtered,show_inactive:this.state.show_inactive?"1":"0"}),window.api.get(this.getBase(),{params:t}).then((function(t){e.setState({results:t})})).catch((function(e){re.toast.error(e)}))}},{key:"save",value:function(){var e=this,t=this.state,n=t.edit_row;t.creating?window.api.post(this.getBase(),n).then((function(t){e.setState({edit_row:{},creating:!1}),e.update(),re.toast.success("Package created successfully")})).catch((function(e){re.toast.error(e)})):window.api.put("".concat(this.getBase(),"/").concat(n.id),n).then((function(t){e.setState({edit_row:{}}),e.update()})).catch((function(e){re.toast.error(e)}))}},{key:"cancel",value:function(){this.state.creating&&this.setState({creating:!1}),this.setState({edit_row:{}})}},{key:"render",value:function(){var e=this,t=this.state,n=t.edit_row,a=t.creating,c=this.state.results,r=c.pagination,s=c.records;return a&&(s=[n].concat(s)),Object(T.jsxs)("div",{children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.BONUS_ROUND_WELCOME_PACKAGE_CREATE,children:Object(T.jsx)("button",{onClick:function(t){return e.setState({creating:!0,edit_row:{id:null,name:"New"}})},children:"New"})}),Object(T.jsx)(Fn.a,{ref:function(t){return e.table=t},manual:!0,showPageJump:!1,pages:r.total_pages,pageSize:r.records_per_page,data:s,multiSort:!1,showPageSizeOptions:!1,onPageChange:function(t){e.update()},onSortedChange:function(t,n,a){e.update()},onFilteredChange:function(t,n,a){e.update()},columns:[{Header:"",Cell:function(t){return Object(T.jsx)(fe,{feature:Oe.permissionsConstants.BONUS_ROUND_WELCOME_PACKAGE_UPDATE,children:n.id===t.original.id?Object(T.jsxs)("div",{children:[Object(T.jsx)("a",{onClick:function(t){return e.cancel()},children:"Cancel"}),Object(T.jsx)("a",{onClick:function(t){return e.save()},children:"Save"})]}):Object(T.jsx)("a",{onClick:function(n){return e.setState({edit_row:t.original})},children:"Edit"})})},maxWidth:100},{id:"id",Header:"ID",accessor:function(e){return Object(T.jsx)(l.b,{to:"/items/".concat(e.id),children:e.id})},maxWidth:50},{id:"created_at",Header:"Created",accessor:function(e){return Se.withMinutes(e.created_at)},maxWidth:200},{id:"bonus_id",Header:"Bonus",accessor:function(t){return n.id===t.id?Object(T.jsx)(Ce.a,{name:"type",value:n.bonus_id,onChange:function(t){t=t||{value:null},e.setState({edit_row:Object(d.a)(Object(d.a)({},n),{},{bonus_id:t.value})})},options:e.props.bonuses.map((function(e){return{label:Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:["(ID: ",e.id,") - ",e.name]}),value:e.id}}))}):Object(T.jsx)("div",{style:{display:"flex",alignItems:"center"},children:Object(T.jsx)(l.b,{to:"/bonuses/".concat(t.id),children:t.bonus.name})})},maxWidth:400},{id:"round_type",Header:"Round Type",accessor:function(t){return n.id===t.id?Object(T.jsx)(Ce.a,{name:"type",value:n.round_type,onChange:function(t){t=t||{value:null},e.setState({edit_row:Object(d.a)(Object(d.a)({},n),{},{round_type:t.value||null})})},options:[{label:"Crash",value:"crash"},{label:"Roulette",value:"roulette"}]}):Object(T.jsx)("span",{children:t.round_type})},maxWidth:200},{id:"rounds_per_day",Header:"Rounds Per Day",accessor:function(t){return n.id===t.id?Object(T.jsx)("input",{value:n.rounds_per_day,onChange:function(t){return e.setState({edit_row:Object(d.a)(Object(d.a)({},n),{},{rounds_per_day:t.target.value})})}}):Object(T.jsx)("span",{children:t.rounds_per_day})},maxWidth:200},{id:"payout_days",Header:"Payout Days",accessor:function(t){return n.id===t.id?Object(T.jsx)("input",{value:n.payout_days,onChange:function(t){return e.setState({edit_row:Object(d.a)(Object(d.a)({},n),{},{payout_days:t.target.value})})}}):Object(T.jsx)("span",{children:t.payout_days})},maxWidth:200}]})]})}}]),n}(c.Component),Vn=Object(o.b)((function(e){return{bonuses:e.bonuses.search_results.records}}))(Gn),Yn=function(){return Object(T.jsx)(fe,{feature:Oe.permissionsConstants.BONUSES_VIEW_LIST,children:Object(T.jsx)(l.c,{exact:!0,to:"/casino/bonuses",children:"View Bonuses"})})},Hn=function(){return Object(T.jsx)(fe,{feature:Oe.permissionsConstants.BONUSES_CREATE_BONUS,children:Object(T.jsx)(l.c,{exact:!0,to:"/casino/bonuses/create",children:"Create Bonus"})})},qn=function(){return Object(T.jsx)(xe,{group:me.a.REWARDS.BONUS_WELCOME_PACKAGE,children:Object(T.jsx)(l.c,{exact:!0,to:"/casino/bonuses/round-welcome-packages",children:"Round Welcome Packages"})})},Kn=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){return Object(T.jsxs)("div",{children:[Object(T.jsx)(O.BrowserView,{children:Object(T.jsxs)("nav",{className:"sub-nav",children:[Object(T.jsx)(Yn,{}),Object(T.jsx)(Hn,{}),Object(T.jsx)(qn,{})]})}),Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(Te,{feature:Oe.permissionsConstants.BONUSES_VIEW_LIST,exact:!0,path:"/casino/bonuses",component:kn}),Object(T.jsx)(Te,{feature:Oe.permissionsConstants.BONUSES_CREATE_BONUS,exact:!0,path:"/casino/bonuses/create",component:Mn}),Object(T.jsx)(ge,{group:me.a.REWARDS.BONUS_WELCOME_PACKAGE,path:"/casino/bonuses/round-welcome-packages",component:Vn}),Object(T.jsx)(Te,{feature:Oe.permissionsConstants.BONUSES_VIEW_LIST,path:"/casino/bonuses/:id",component:Bn})]})]})}}]),n}(c.Component),zn=Object(p.withRouter)(Object(o.b)((function(e){return{}}),(function(e){return{}}))(Kn)),Xn=(n(227),n(209)),Zn=n.n(Xn),Qn=n(37),Jn=n.n(Qn),$n={races:[{id:1,name:"test 1",game_name:"Mines",duration:"day",game_id:null,recurring_frequency:"day",status:"expired",iteration:0,current_iteration_start_date:"2022-12-25T17:44:05.850Z",current_iteration_end_date:"2022-12-26T17:44:05.850Z",created_at:"2022-12-23T17:44:05.851Z",updated_at:"2022-12-23T17:44:05.851Z",eur_prize:"0",starts_at:"2023-04-12T21:27:01.662Z",currency_rates:[],full_count:"12"},{id:2,name:"test 1",duration:"day",game_id:null,recurring_frequency:"day",status:"expired",iteration:0,current_iteration_start_date:"2022-12-25T17:44:06.386Z",current_iteration_end_date:"2022-12-26T17:44:06.386Z",created_at:"2022-12-23T17:44:06.386Z",updated_at:"2022-12-23T17:44:06.386Z",eur_prize:"0",starts_at:"2023-04-12T21:27:01.662Z",currency_rates:[],full_count:"12"},{id:4,name:"test 2",duration:"day",game_id:null,recurring_frequency:"day",status:"expired",iteration:0,current_iteration_start_date:"2022-12-25T17:44:07.460Z",current_iteration_end_date:"2022-12-26T17:44:07.460Z",created_at:"2022-12-23T17:44:07.469Z",updated_at:"2022-12-23T17:44:07.469Z",eur_prize:"0",starts_at:"2023-04-12T21:27:01.662Z",currency_rates:[],full_count:"12"},{id:5,name:"test 1",duration:"day",game_id:null,recurring_frequency:"day",status:"expired",iteration:0,current_iteration_start_date:"2022-12-25T17:44:07.460Z",current_iteration_end_date:"2022-12-26T17:44:07.460Z",created_at:"2022-12-23T17:44:07.468Z",updated_at:"2022-12-23T17:44:07.468Z",eur_prize:"0",starts_at:"2023-04-12T21:27:01.662Z",currency_rates:[],full_count:"12"},{id:6,name:"test 4",duration:"day",game_id:null,recurring_frequency:"day",status:"expired",iteration:0,current_iteration_start_date:"2022-12-25T17:44:07.460Z",current_iteration_end_date:"2022-12-26T17:44:07.460Z",created_at:"2022-12-23T17:44:07.469Z",updated_at:"2022-12-23T17:44:07.469Z",eur_prize:"0",starts_at:"2023-04-12T21:27:01.662Z",currency_rates:[],full_count:"12"},{id:7,name:"test 3",duration:"day",game_id:null,recurring_frequency:"day",status:"expired",iteration:0,current_iteration_start_date:"2022-12-25T17:44:07.460Z",current_iteration_end_date:"2022-12-26T17:44:07.460Z",created_at:"2022-12-23T17:44:07.469Z",updated_at:"2022-12-23T17:44:07.469Z",eur_prize:"0",starts_at:"2023-04-12T21:27:01.662Z",currency_rates:[],full_count:"12"},{id:8,name:"test 2",duration:"day",game_id:null,recurring_frequency:"day",status:"expired",iteration:0,current_iteration_start_date:"2022-12-25T17:44:07.982Z",current_iteration_end_date:"2022-12-26T17:44:07.982Z",created_at:"2022-12-23T17:44:07.982Z",updated_at:"2022-12-23T17:44:07.983Z",eur_prize:"0",starts_at:"2023-04-12T21:27:01.662Z",currency_rates:[],full_count:"12"},{id:11,name:"test 4",duration:"day",game_id:null,recurring_frequency:"day",status:"expired",iteration:0,current_iteration_start_date:"2022-12-25T17:44:08.512Z",current_iteration_end_date:"2022-12-26T17:44:08.512Z",created_at:"2022-12-23T17:44:08.512Z",updated_at:"2022-12-23T17:44:08.512Z",eur_prize:"0",starts_at:"2023-04-12T21:27:01.662Z",currency_rates:[],full_count:"12"},{id:12,name:"test 1",duration:"day",game_id:null,recurring_frequency:"day",status:"expired",iteration:0,current_iteration_start_date:"2022-12-25T17:44:08.512Z",current_iteration_end_date:"2022-12-26T17:44:08.512Z",created_at:"2022-12-23T17:44:08.512Z",updated_at:"2022-12-23T17:44:08.512Z",eur_prize:"0",starts_at:"2023-04-12T21:27:01.662Z",currency_rates:[],full_count:"12"},{id:10,name:"test 3",duration:"day",game_id:null,recurring_frequency:"day",status:"active",iteration:0,current_iteration_start_date:"2022-12-27T17:44:08.512Z",current_iteration_end_date:"2022-12-28T17:44:08.512Z",created_at:"2022-12-23T17:44:08.512Z",updated_at:"2022-12-23T17:44:08.512Z",eur_prize:"0",starts_at:"2023-04-12T21:27:01.662Z",currency_rates:[],full_count:"12"},{id:9,name:"test 2",duration:"day",game_id:null,recurring_frequency:"day",status:"expired",iteration:0,current_iteration_start_date:"2022-12-26T17:44:08.512Z",current_iteration_end_date:"2022-12-27T17:44:08.512Z",created_at:"2022-12-23T17:44:08.512Z",updated_at:"2022-12-23T17:44:08.512Z",eur_prize:"0",starts_at:"2023-04-12T21:27:01.662Z",currency_rates:[],full_count:"12"},{id:14,name:"Racer for game",duration:"day",game_id:"1",recurring_frequency:"day",status:"created",iteration:0,current_iteration_start_date:"2023-04-22T04:50:10.108Z",current_iteration_end_date:"2023-04-23T04:50:10.108Z",created_at:"2023-04-14T19:37:23.641Z",updated_at:"2023-04-14T19:37:23.641Z",eur_prize:"500",starts_at:"2023-04-22T04:50:10.108Z",currency_rates:[{currency:"BRL",rate:1},{currency:"BTC",rate:19967418778886552e-21},{currency:"CAD",rate:1},{currency:"ETH",rate:.0002949126924819308},{currency:"EUR",rate:1},{currency:"LTC",rate:.007478140207860439},{currency:"TRX",rate:13.032070120678268}],full_count:"12"}],total_count:12,total_pages:1},ea=function(){function e(){Object(u.a)(this,e),this.client=null,this.baseURL="/api/admin",this.mocked=$n;var t=w.a.create({baseURL:this.baseURL});t.interceptors.request.use((function(e){return e.headers.Authorization="Bearer ".concat(localStorage.getItem("access_token")),e.headers["X-RateLimit-Bypass"]="1",e})),this.client=t}return Object(j.a)(e,[{key:"getRaceById",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.get("/race/".concat(t));case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRaceIterationsById",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.get("/race/iterations/".concat(t));case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"cancellRaceIterations",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.delete("/race/cancelactiveiterations/".concat(t));case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRaceIterationsWinnerById",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.get("/race/iterations/winners/".concat(t));case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRaceIterationsSaveWinnersById",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.get("/race/iterations/savewinners/".concat(t));case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"payallwinnersIteration",value:function(e){return this.client.put("/race/iterations/payallwinners/".concat(e))}},{key:"deleteRace",value:function(e){return this.client.delete("/race/".concat(e))}},{key:"createRace",value:function(e){return this.client.post("/race",e).then((function(e){return e.data}))}},{key:"getRaceIterationStatsById",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.get("/race/iterations/stats/".concat(t));case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRaces",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a,c,r,s,i=arguments;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:1,n=i.length>1?i[1]:void 0,a=i.length>2?i[2]:void 0,c="/race?",r=!1,n&&(r=!0,c+="status=".concat(n)),t&&(r?c+="&page=".concat(t):(r=!0,c+="page=".concat(t))),a&&(r?c+="&sort_by=".concat(a):(r=!0,c+="sort_by=".concat(a))),e.next=10,this.client.get(c);case 10:return s=e.sent,e.abrupt("return",s.data);case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),ta=new ea,na=(n(475),"deviation_amount_wagered"),aa=[{label:"hour",value:"hour"},{label:"day",value:"day"}],ca=[{label:"hour",value:"hour"},{label:"day",value:"day"},{label:"week",value:"week"},{label:"month",value:"month"},{label:"year",value:"year"}],ra="/admin/games?enabled=true&newlyReleased=false&paginated=false",sa=Object(p.withRouter)(Object(o.b)((function(e){return{rewards:e.rewards.items.records}}),(function(e){return{updateRewards:function(){return e(Pn())}}}))((function(){var e=Object(c.useRef)(null),t=Object(c.useState)(),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],l=i[1],u=Object(c.useState)({}),j=Object(m.a)(u,2),b=j[0],h=j[1],p=Object(c.useState)([]),O=Object(m.a)(p,2),v=O[0],g=O[1],y=Object(c.useState)({name:"",starts_at:"",game_id:0,duration:"day",recurring:0,total_race_prize:0,currency_rates:[],name_translation:b}),E=Object(m.a)(y,2),S=E[0],w=E[1],R=Object(c.useCallback)(Jn.a.debounce(Object(f.a)(Object(x.a)().mark((function e(){var t,n,a,c,r;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(S.total_race_prize>1e6)){e.next=5;break}re.toast.error("The prize needs to be lower than 1.000.000 EUR"),e.next=15;break;case 5:if(""!==S.name){e.next=9;break}re.toast.error("All the fields needs to completed"),e.next=15;break;case 9:return t={name:S.name,eur_prize:S.total_race_prize,starts_at:new Date(S.starts_at).toISOString(),duration:"0"===S.duration?null:S.duration,recurring_frequency:"0"===S.recurring?null:S.recurring,currency_rates:S.currency_rates,name_translation:S.name_translation,games:v},e.next=12,ta.createRace(t);case 12:n=e.sent,re.toast.success(null===n||void 0===n?void 0:n.message),setTimeout((function(){window.location.href="/casino/races"}),1e3);case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(0),re.toast.error(null===e.t0||void 0===e.t0||null===(a=e.t0.response)||void 0===a||null===(c=a.data)||void 0===c||null===(r=c.error)||void 0===r?void 0:r.message);case 20:case"end":return e.stop()}}),e,null,[[0,17]])}))),500),[S]);Object(c.useEffect)((function(){var e=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.get(ra);case 3:return t=e.sent,e.abrupt("return",t.records);case 7:return e.prev=7,e.t0=e.catch(0),console.error("Error fetching games:",e.t0),e.abrupt("return",[]);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),t=function(e){return{label:"".concat(e.name," - ").concat(e.slug),value:e.id,name:e.name}},n=function(){var n=Object(f.a)(Object(x.a)().mark((function n(){var a,c;return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e();case 3:a=n.sent,c=a.map(t),r([{label:"All games",value:0,name:"All games"}].concat(Object(ct.a)(c))),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),console.error("Error processing games:",n.t0);case 11:case"end":return n.stop()}}),n,null,[[0,8]])})));return function(){return n.apply(this,arguments)}}();n()}),[]);var A=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.preventDefault(),R();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),N=function(e){var t=e.target,n=t.name,a=t.value;w(Object(d.a)(Object(d.a)({},S),{},Object(_.a)({},n,a)))},C=S.name,I=S.game_id,k=S.duration,D=S.recurring,L=S.starts_at,U=S.total_race_prize;return Object(T.jsxs)("form",{ref:e,onSubmit:A,className:"create-race",children:[Object(T.jsxs)("div",{className:"race-create__row",children:[Object(T.jsxs)("div",{children:[Object(T.jsx)("h1",{className:"label-race ",children:"Name"}),Object(T.jsx)("input",{placeholder:"Name",value:C,name:"name",onChange:N})]}),Object(T.jsx)(Pe,{contents:b,onChange:function(e){h(e),w(Object(d.a)(Object(d.a)({},S),{},{name_translation:e}))},label:"Name Translation"})]}),Object(T.jsxs)("div",{className:"race-create__row row-challenge",children:[Object(T.jsxs)("div",{children:[Object(T.jsx)("h1",{className:"label-race ",children:"Start Date"}),Object(T.jsx)("input",{value:L,name:"starts_at",type:"datetime-local",onChange:N})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("h1",{className:"label-race ",children:" Duration"}),Object(T.jsx)(Ce.a,{name:"duration",value:k,onChange:function(e){w(Object(d.a)(Object(d.a)({},S),{},{duration:e.value}))},style:{width:"300px"},options:aa})]}),Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{className:"race-create__check",children:[Object(T.jsx)("h1",{className:"label-race ",children:"Recurring"}),Object(T.jsx)("input",{type:"checkbox",checked:o,onChange:function(e){l(e.target.checked)}})]}),o&&Object(T.jsx)(Ce.a,{name:"recurring",disabled:!o,value:D,onChange:function(e){w(Object(d.a)(Object(d.a)({},S),{},{recurring:e.value}))},style:{width:"300px"},options:ca})]})]}),Object(T.jsxs)("div",{className:"race-create__row_no_box row-challenge",children:[Object(T.jsxs)("div",{className:"games-container",children:[Object(T.jsx)("h1",{className:"label-race ",children:"Games"}),Object(T.jsx)(Ce.a,{name:"game_id",value:I,onChange:function(e){w(Object(d.a)(Object(d.a)({},S),{},{game_id:e.value}))},style:{width:"300px"},options:a}),Object(T.jsxs)("div",{children:[Object(T.jsx)("button",{type:"button",onClick:function(){v.includes(S.game_id)||g([].concat(Object(ct.a)(v),[S.game_id]))},children:"Add Game"}),Object(T.jsx)("button",{type:"button",onClick:function(){g(v.filter((function(e){return e!==S.game_id})))},children:"Remove Game"})]}),Object(T.jsxs)("div",{className:"selected-games-container",children:[Object(T.jsx)("h2",{children:"Selected Games"}),v.map((function(e,t){return Object(T.jsx)("div",{children:Object(T.jsxs)("p",{children:[t+1+")"," ",a.find((function(t){return t.value===e})).label]})},t)}))]})]}),Object(T.jsxs)("div",{className:"race-create__prize",children:[Object(T.jsx)("label",{children:"Total Race Prize"}),Object(T.jsx)("input",{value:U,name:"total_race_prize",onChange:N})]})]}),Object(T.jsx)("button",{className:"race-create-button",type:"submit",children:"Create Race"})]})}))),ia=(n(228),n(476),[{id:"",label:"all"},{id:"starts_at",label:"start date"},{id:"prize",label:"prize"}]),oa=function(e){var t=e.select,n=e.setSelect;return Object(T.jsx)("div",{className:"selectsort",children:Object(T.jsx)(Ce.a,{className:"selectsort__select",classNamePrefix:"selectsort__select",options:ia,value:ia.find((function(e){return e.id===t}))||ia[0],onChange:function(e){var t=e.id;n(t)},placeholder:"Sort by"})})},la=(n(477),Object(p.withRouter)((function(e){var t=Object(c.useState)([]),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],l=i[1],d=Object(c.useState)(0),u=Object(m.a)(d,2),j=u[0],b=u[1],h=Object(c.useState)(1),p=Object(m.a)(h,2),O=p[0],_=p[1],v=Object(c.useState)("starts_at"),g=Object(m.a)(v,2),y=g[0],E=g[1],S=Object(c.useState)(""),w=Object(m.a)(S,2),R=w[0];w[1];Object(c.useEffect)((function(){A()}),[O,y,R]),Object(c.useEffect)((function(){_(1)}),[y,R]);var A=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ta.getRaces(O,R,y);case 2:t=e.sent,n=t.races,a=t.total_pages,l(!1),r(n),b(a);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ta.deleteRace(t);case 2:return re.toast.success("The race ".concat(t," was deleted succesfully")),e.next=5,A(O,R,y);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(T.jsxs)("div",{children:[Object(T.jsx)("div",{className:"box-selects",children:Object(T.jsxs)("div",{className:"box-select",children:[Object(T.jsx)("h1",{className:"text-box-select",children:"Sort by"}),Object(T.jsx)(oa,{select:y,setSelect:E})]})}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Race ID"}),Object(T.jsx)(we.Th,{children:"Name"}),Object(T.jsx)(we.Th,{children:"Start Date"}),Object(T.jsx)(we.Th,{children:"Duration"}),Object(T.jsx)(we.Th,{children:"Recurring"}),Object(T.jsx)(we.Th,{children:"Total Prize"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Game Name"}),Object(T.jsx)(we.Th,{children:"Options"})]})}),o&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Fetching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsx)(we.Tbody,{className:"referrals-body",children:null===a||void 0===a?void 0:a.map((function(t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:t.id}),Object(T.jsx)(we.Td,{children:t.name}),Object(T.jsx)(we.Td,{children:new Date(t.starts_at).toLocaleString()}),Object(T.jsx)(we.Td,{children:t.duration}),Object(T.jsx)(we.Td,{children:t.recurring_frequency}),Object(T.jsx)(we.Td,{children:t.eur_prize}),Object(T.jsx)(we.Td,{children:t.status}),Object(T.jsx)(we.Td,{children:null!=t.games&&t.games.length>1?"multiple games":null===t.game_name||void 0===t.game_name?"any game":t.game_name}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("button",{onClick:function(){e.history.push("/casino/race/view/".concat(t.id))},children:"View"})}),Object(T.jsx)(we.Td,{children:("ongoing"===t.status||"created"===t.status)&&Object(T.jsx)("button",{onClick:function(){return N(t.id)},children:"Cancel"})})]},t.id)}))})]}),Object(T.jsxs)("div",{className:"pagination",children:[Object(T.jsx)("button",{className:"btn-pagination",onClick:function(){return _(O-1)},disabled:1===O,children:Object(T.jsx)("span",{children:"<"})}),Object(T.jsxs)("div",{className:"pagination_page",children:["Page ",O," of ",j]}),Object(T.jsx)("button",{className:"btn-pagination",onClick:function(){return _(O+1)},disabled:O>=j,children:Object(T.jsx)("span",{children:">"})})]})]})}))),da=Object(p.withRouter)((function(){var e=Object(c.useState)("ListRaces"),t=Object(m.a)(e,2),n=t[0],a=t[1];return Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{className:Zn.a.tabbedNav,children:[Object(T.jsx)("div",{className:"ListRaces"===n?Zn.a.selected:void 0,onClick:function(){a("ListRaces")},children:"List Races"}),Object(T.jsx)("div",{className:"createRace"===n?Zn.a.selected:void 0,onClick:function(){a("createRace")},children:"Create Race"})]}),"ListRaces"===n&&Object(T.jsx)(la,{}),"createRace"===n&&Object(T.jsx)(sa,{})]})})),ua=(n(173),"promo/UPDATE"),ja="promo/GET",ba="promo/REDEEMS",ha=function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.get("/admin/rewards/promo_codes/"+e);case 2:a=t.sent,n({type:ja,payload:a});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},pa=["any","silver","bronze","gold","platinum","diamond","diamond_2","diamond_3"].map((function(e){return{label:e,value:e}})),Oa=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,order:"id_desc",type:"",status:"",rank:null,specific_rank:null},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update(),this.props.updateRewards(1,1)}},{key:"update",value:function(){this.props.update({page:this.state.page,search:this.state.search,order:this.state.order})}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{id:"promo",children:[Object(T.jsx)("h3",{children:"Promo Codes"}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.PROMO_CODES_CREATE_CODE,children:[Object(T.jsx)("h3",{children:"Create"}),Object(T.jsxs)("div",{className:"create",children:[Object(T.jsx)("label",{children:"Code"}),Object(T.jsx)("input",{value:this.state.code,onChange:function(t){return e.setState({code:t.target.value})}}),Object(T.jsx)("label",{children:"Max uses"}),Object(T.jsx)("input",{type:"number",value:this.state.max,onChange:function(t){return e.setState({max:t.target.value})}}),Object(T.jsx)("label",{children:"Min Rank"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.rank,onChange:function(t){t=t||{value:null},e.setState({rank:t.value})},options:pa}),Object(T.jsx)("label",{children:"Specific Rank"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.specific_rank,onChange:function(t){t=t||{value:null},e.setState({specific_rank:t.value})},options:pa}),Object(T.jsx)("label",{children:"Reward"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.reward_id,onChange:function(t){t=t||{value:null},e.setState({reward_id:t.value})},options:this.props.rewards.map((function(e){return{label:Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("img",{style:{width:"30px"},src:e.image_url}),"(ID: $",e.id,") - $",e.name," (\u20ac $",e.eur_value,")"]}),value:e.id}}))}),Object(T.jsx)("button",{onClick:function(){e.props.create({code:e.state.code,max_uses:e.state.max,reward_id:e.state.reward_id,required_rank:"any"===e.state.rank?null:e.state.rank,specific_rank:"any"===e.state.specific_rank?null:e.state.specific_rank}).then((function(){e.update()}))},children:"Create"})]})]}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.PROMO_CODES_VIEW_LIST,children:[Object(T.jsx)("h4",{children:"Search (id, code)"}),Object(T.jsx)("input",{name:"type",value:this.state.search,onChange:function(t){e.setState({search:t.target.value},(function(){return e.update()}))}}),Object(T.jsx)("br",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Code"}),Object(T.jsx)(we.Th,{children:"Claimed"}),Object(T.jsx)(we.Th,{children:"Remaining Uses"}),Object(T.jsx)(we.Th,{children:"Required Rank"}),Object(T.jsx)(we.Th,{children:"Specific Rank"}),Object(T.jsx)(we.Th,{children:"Reward"})]})}),Object(T.jsx)(we.Tbody,{children:this.props.records.map((function(e,t){var n=e.reward||{};return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/promo-codes/".concat(e.id),children:e.code})}),Object(T.jsx)(we.Td,{children:e.total_uses}),Object(T.jsx)(we.Td,{children:e.remaining_uses}),Object(T.jsx)(we.Td,{children:e.required_rank_type}),Object(T.jsx)(we.Td,{children:e.specific_rank_type}),Object(T.jsx)(we.Td,{children:Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("img",{style:{width:"30px"},src:n.image_url}),"(ID: $",n.id,") - $",n.name," (\u20ac $",n.eur_value,")"]})})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.props.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update()}))}})]})]})}}]),n}(c.Component),_a=Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e.promo.data),{},{rewards:e.rewards.items.records})}),(function(e){return{update:function(t){return e(function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.get("/admin/rewards/promo_codes",{params:e});case 2:a=t.sent,n({type:ua,payload:a});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(t))},updateRewards:function(t,n){return e(Pn(t,n))},create:function(t){return e(function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.post("/admin/rewards/promo_codes",e);case 2:a=t.sent,re.toast.info("Promo code id: ".concat(a.id," created"));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(t))}}}))(Oa),ma=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.props.update(this.props.match.params.id),this.props.updateRewards()}},{key:"render",value:function(){var e=this,t=this.props.promo,n=this.props.match.params.id,a=t.reward||{};return Object(T.jsxs)("div",{id:"promo",children:[Object(T.jsx)("h3",{children:"Promo"}),Object.keys(t).map((function(e){var n=t[e];return"required_rank_type"===e?Object(T.jsxs)("div",{children:[Object(T.jsx)("span",{children:"required_rank_type: "}),Object(T.jsx)("span",{children:n||"any"})]}):"object"===typeof n?null:Object(T.jsxs)("div",{children:[Object(T.jsxs)("span",{children:[e,": "]}),Object(T.jsx)("span",{children:n})]})})),Object(T.jsxs)("div",{children:[Object(T.jsx)("span",{children:"Reward"}),Object(T.jsx)("span",{children:Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("img",{style:{width:"30px"},src:a.image_url}),"(ID: $",a.id,") - $",a.name," (\u20ac $",a.eur_value,")"]})})]}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.PROMO_CODES_UPDATE_CODE,children:[Object(T.jsx)("hr",{}),Object(T.jsx)("label",{children:"Code"}),Object(T.jsx)("input",{value:this.state.code,onChange:function(t){return e.setState({code:t.target.value})}}),Object(T.jsx)("button",{onClick:function(){e.props.edit(n,{code:e.state.code})},children:"Update Code"}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("label",{children:"Set remaining uses"}),Object(T.jsx)("input",{type:"number",value:this.state.max,onChange:function(t){return e.setState({max:t.target.value})}}),Object(T.jsx)("button",{onClick:function(){e.props.edit(n,{remaining_uses:e.state.max})},children:"Update Uses"}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("label",{children:"Set min rank"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.rank,onChange:function(t){t=t||{value:null},e.setState({rank:t.value})},options:["any","silver","bronze","gold","platinum","diamond"].map((function(e){return{label:e,value:e}}))}),Object(T.jsx)("button",{onClick:function(){e.props.edit(n,{required_rank:"any"===e.state.rank?null:e.state.rank})},children:"Update min rank"}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("label",{children:"Reward"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.reward_id,onChange:function(t){t=t||{value:null},e.setState({reward_id:t.value})},options:this.props.rewards.map((function(e){return{label:Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("img",{style:{width:"30px"},src:e.image_url}),"(ID: $",e.id,") - $",e.name," (\u20ac $",e.eur_value,")"]}),value:e.id}}))}),Object(T.jsx)("button",{onClick:function(){e.props.edit(n,{reward_id:e.state.reward_id})},children:"Update reward"})]})]})}}]),n}(c.Component),xa=Object(p.withRouter)(Object(o.b)((function(e){return{promo:e.promo.selected,rewards:e.rewards.items.records}}),(function(e){return{update:function(t){return e(ha(t))},edit:function(t,n){return e(function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.put("/admin/rewards/promo_codes/"+e,t);case 2:a(ha(e));case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,n))},updateRewards:function(){return e(Pn())}}}))(ma)),fa=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,order:"id_desc",type:"",status:""},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){this.props.update({page:this.state.page,search:this.state.search,order:this.state.order})}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{id:"promo",children:[Object(T.jsx)("h3",{children:"Promo Code Redeems"}),Object(T.jsx)("h4",{children:"Search (id, promo_code_id, user_id, reward_manifest_id)"}),Object(T.jsx)("input",{name:"type",value:this.state.search,onChange:function(t){e.setState({search:t.target.value},(function(){return e.update()}))}}),Object(T.jsx)("br",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Code"}),Object(T.jsx)(we.Th,{children:"User"}),Object(T.jsx)(we.Th,{children:"Reward Manifest"})]})}),Object(T.jsx)(we.Tbody,{children:this.props.records.map((function(e,t){e.reward;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/rewards/promo-codes/".concat(e.promo_code.id),children:e.promo_code.code})}),Object(T.jsx)(we.Td,{className:"user",children:Object(T.jsxs)(l.b,{to:"/users/".concat(e.user_id,"/reward-inventory"),children:[Object(T.jsx)("img",{src:e.user.avatar_url}),e.user.username]})}),Object(T.jsx)(we.Td,{children:e.reward_manifest_id})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.props.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update()}))}})]})}}]),n}(c.Component),va=Object(o.b)((function(e){return Object(d.a)({},e.promo.redeem_data)}),(function(e){return{update:function(t){return e(function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.get("/admin/rewards/promo_codes/redeems",{params:e});case 2:a=t.sent,n({type:ba,payload:a});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(t))}}}))(fa),ga=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){return Object(T.jsxs)("div",{children:[Object(T.jsxs)("nav",{className:"sub-nav",children:[Object(T.jsx)(l.c,{exact:!0,to:"/casino/promo-codes",children:"Promo Codes"}),Object(T.jsx)(l.c,{exact:!0,to:"/casino/promo-codes/redeems",children:"Redeems"})]}),Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(p.Route,{exact:!0,path:"/casino/promo-codes",component:_a}),Object(T.jsx)(p.Route,{exact:!0,path:"/casino/promo-codes/redeems",component:va}),Object(T.jsx)(p.Route,{path:"/casino/promo-codes/:id",component:xa})]})]})}}]),n}(c.Component),Ta=Object(o.b)((function(e){return{}}),(function(e){return{}}))(ga),ya=n(107),Ea=Object(ya.a)([function(e){return e.app.currencies}],(function(e){return{currencies:e}})),Sa=Object(ya.a)([function(e){return e.rewards.currency_rates}],(function(e){return{currencyRates:e}})),wa=n(50),Ra=function(){var e=Object(o.d)(Sa).currencyRates,t=Object(o.d)(Ea).currencies,n=e.map((function(e){return e.currency})),a=t.filter((function(e){return-1===n.indexOf(e.type)})).map((function(e){return e.type})),c=Object(o.c)(),r=function(e){return c({type:wa.UPDATE_CURRENCY_RATE,payload:e})};return Object(T.jsxs)("div",{className:"currency-rates-container",children:[Object(T.jsx)("h3",{children:"Currency rates"}),Object(T.jsx)("button",{className:"add-new-reward",disabled:0===a.length,onClick:function(){return c({type:wa.ADD_CURRENCY_RATE,payload:{currency:a[0]}})},children:"Add"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Currency"}),Object(T.jsx)(we.Th,{children:"Rate"})]})}),Object(T.jsx)(we.Tbody,{children:e.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)("select",{onChange:function(t){return r({previous:e.currency,currency:t.target.value})},children:a.concat([e.currency]).sort().map((function(t){return Object(T.jsx)("option",{value:t,selected:e.currency===t,children:t})}))})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("input",{type:"number",onChange:function(t){return r({previous:e.currency,currency:e.currency,rate:+t.target.value})},value:e.rate||0})})]},t+e.rate)}))})]})]})},Aa="^(?!^[\\d\\s]+$)[\\w\\s]{2,254}$",Na=/^[\s\u2000-\u200F\u202F]*$/g,Ca=[{label:"Crash",value:"crash"},{label:"Crash II",value:"crash-v2"},{label:"Crash Rewired",value:"crash-rewired"},{label:"Crash Neymar",value:"neymar-crash"},{label:"Roulette",value:"roulette"},{label:"Mines",value:"mines"},{label:"Plinko",value:"plinko"},{label:"Limbo",value:"limbo"},{label:"Dice",value:"dice"},{label:"Tower",value:"tower"},{label:"Hilo",value:"hilo"},{label:"Coin flip",value:"coin-flip"},{label:"Slide",value:"slide"},{label:"Fruits",value:"fruits"},{label:"Fortune Double",value:"fortune_double"},{label:"Fruit Slice",value:"fruitSlice"}].sort((function(e,t){return e.label.localeCompare(t.label)})),Ia=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).onSubmitReward=function(e){e.preventDefault();var t={name:a.name.value,description:a.description.value,eur_value:a.eur_value.value,type:a.state.type,metadata:a.state.metadata,file:a.state.file,name_translation:a.state.name_translation,description_translation:a.state.description_translation,mystery_manifest_description_translation:a.state.mystery_manifest_description_translation,sellable:a.state.sellable,expiry_minutes:a.expiry_minutes.value,currency_rates:a.props.currencyRates};a.props.create(t)},a.state={query:"",page:1,metadata:{},name_translation:{},description_translation:{},mystery_manifest_description_translation:{},sellable:!1},a.renderBetByBonus=a.renderBetByBonus.bind(Object(Dn.a)(a)),a.renderDepositBonus=a.renderDepositBonus.bind(Object(Dn.a)(a)),a.renderDepositBonusForSports=a.renderDepositBonusForSports.bind(Object(Dn.a)(a)),a.renderFreeBet=a.renderFreeBet.bind(Object(Dn.a)(a)),a.renderXPBonus=a.renderXPBonus.bind(Object(Dn.a)(a)),a.renderCashback=a.renderCashback.bind(Object(Dn.a)(a)),a.renderSoftswissFreeSpins=a.renderSoftswissFreeSpins.bind(Object(Dn.a)(a)),a.renderGameIntegrationFreeSpins=a.renderGameIntegrationFreeSpins.bind(Object(Dn.a)(a)),a.renderRakeback=a.renderRakeback.bind(Object(Dn.a)(a)),a.renderMetadataInputUi=a.renderMetadataInputUi.bind(Object(Dn.a)(a)),a.renderWelcomeBonus=a.renderWelcomeBonus.bind(Object(Dn.a)(a)),a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update(this.state.page),he(Oe.permissionsConstants.BONUSES_VIEW_LIST)&&this.props.updateBonuses(),he(Oe.permissionsConstants.MYSTERY_BOXES_VIEW_LIST)&&this.props.updateBoxes()}},{key:"update",value:function(e){this.props.update(e)}},{key:"updateMetadata",value:function(e){this.setState({metadata:Object(d.a)(Object(d.a)({},this.state.metadata),e)})}},{key:"renderBetByBonus",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Bonus Type"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.metadata.bonus_type,required:!0,onChange:function(t){return e.updateMetadata({bonus_type:null===t||void 0===t?void 0:t.value})},options:[{label:"Freebet",value:"free_bet"},{label:"Comboboost",value:"combo_boost"}]}),this.state.metadata.bonus_type&&"free_bet"===this.state.metadata.bonus_type&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("h4",{children:"Amount"}),Object(T.jsx)("input",{placeholder:"Enter the amount.",required:!0,type:"number",min:1,onChange:function(t){return e.updateMetadata({amount_of_free_bet:t.target.value})}})]}),Object(T.jsx)("h4",{children:"Betby Template ID"}),Object(T.jsx)("input",{placeholder:"Enter Betby Template ID",required:!0,onChange:function(t){return e.updateMetadata({template_id:t.target.value})}})]})}},{key:"renderDepositBonusForSports",value:function(){var e=this;return Object(T.jsx)(T.Fragment,{children:Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Select Deposit Bonus for Sports"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.metadata.bonus_id,required:!0,onChange:function(t){return e.updateMetadata({bonus_id:null===t||void 0===t?void 0:t.value})},options:this.props.bonuses.filter((function(e){return"deposit_sports"===e.type})).map((function(e){return{label:e.name,value:e.id}}))}),Object(T.jsx)("h4",{children:"Bonus Type"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.metadata.bonus_type,required:!0,onChange:function(t){return e.updateMetadata({bonus_type:null===t||void 0===t?void 0:t.value})},options:[{label:"Freebet",value:"free_bet"},{label:"Comboboost",value:"combo_boost"}]}),this.state.metadata.bonus_type&&"free_bet"===this.state.metadata.bonus_type&&Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("h4",{children:"Amount"}),Object(T.jsx)("input",{placeholder:"Enter the amount.",required:!0,onChange:function(t){return e.updateMetadata({amount_of_free_bet:t.target.value})}})]}),Object(T.jsx)("h4",{children:"Betby Template ID"}),Object(T.jsx)("input",{placeholder:"Enter Betby Template ID",required:!0,onChange:function(t){return e.updateMetadata({template_id:t.target.value})}})]})})}},{key:"renderDepositBonus",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Select Deposit Bonus"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.metadata.bonus_id,required:!0,onChange:function(t){return e.updateMetadata({bonus_id:null===t||void 0===t?void 0:t.value})},options:this.props.bonuses.filter((function(e){return"deposit_sports"!==e.type})).map((function(e){return{label:e.name,value:e.id}}))})]})}},{key:"renderWelcomeBonus",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Welcome Bonus"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.metadata.bonus_id,required:!0,onChange:function(t){return e.updateMetadata({bonus_id:null===t||void 0===t?void 0:t.value})},options:this.props.bonuses.filter((function(e){return"welcome_bonus"===e.type})).map((function(e){return{label:e.name,value:e.id}}))})]})}},{key:"renderFreeBet",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Select Free Bet Type"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.metadata.free_bet_type,required:!0,onChange:function(t){return e.updateMetadata({free_bet_type:null===t||void 0===t?void 0:t.value})},options:Ca}),Object(T.jsx)("br",{}),Object(T.jsx)("h4",{children:"Enter Free Bet Rounds"}),Object(T.jsx)("input",{value:this.state.metadata.free_bet_rounds,required:!0,type:"number",min:1,onChange:function(t){return e.updateMetadata({free_bet_rounds:t.target.value})}})]})}},{key:"renderXPBonus",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Enter XP Bonus Multiplier (ex. 1.2 will give 120xp when user gains 100xp)"}),Object(T.jsx)("input",{value:this.state.metadata.xp_bonus_percentage,required:!0,type:"number",min:1,onChange:function(t){return e.updateMetadata({xp_bonus_percentage:t.target.value})}}),Object(T.jsx)("br",{}),Object(T.jsx)("h4",{children:"Enter XP Bonus Expiry Time (minutes)"}),Object(T.jsx)("input",{value:this.state.metadata.expiry_minutes,required:!0,type:"number",min:1,onChange:function(t){return e.updateMetadata({expiry_minutes:t.target.value})}})]})}},{key:"renderCashback",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Enter Minutes before payout (ex. 5 will wait 5 minutes, and give cashback based on losses between start and end time)"}),Object(T.jsx)("input",{value:this.state.metadata.minutes_before_payout,required:!0,onChange:function(t){return e.updateMetadata({minutes_before_payout:t.target.value})}}),Object(T.jsx)("br",{}),Object(T.jsx)("h4",{children:"Enter Cashback % (ex. 0.05 will give a user a 5% cashback at the end of the period)"}),Object(T.jsx)("input",{value:this.state.metadata.percentage,required:!0,onChange:function(t){return e.updateMetadata({percentage:t.target.value})}})]})}},{key:"renderSoftswissFreeSpins",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Game Slug"}),Object(T.jsx)("input",{required:!0,onChange:function(t){return e.updateMetadata({game_slug:t.target.value})}}),Object(T.jsx)("h4",{children:"Number of spins"}),Object(T.jsx)("input",{required:!0,onChange:function(t){return e.updateMetadata({free_spins:t.target.value})},type:"number"}),Object(T.jsx)("h4",{children:"Amount per bet"}),Object(T.jsx)("input",{required:!0,onChange:function(t){return e.updateMetadata({bet_level:t.target.value})},type:"number"}),Object(T.jsx)("h4",{children:"Lifespan (how long the free spins are valid for after claim in minutes)"}),Object(T.jsx)("input",{required:!0,onChange:function(t){return e.updateMetadata({lifespan:t.target.value})},type:"number"})]})}},{key:"renderGameIntegrationFreeSpins",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Game Slug"}),Object(T.jsx)("i",{children:"It only supports games from our custom integrations, at the moment PG-Soft, Pragmatic-Play"}),Object(T.jsx)("input",{required:!0,onChange:function(t){return e.updateMetadata({game_slug:t.target.value})}}),Object(T.jsx)("h4",{children:"Free Spin Name (how the user will see it in the game)"}),Object(T.jsx)("input",{required:!0,onChange:function(t){return e.updateMetadata({label:t.target.value})}}),Object(T.jsx)("h4",{children:"Number of spins"}),Object(T.jsx)("input",{required:!0,onChange:function(t){return e.updateMetadata({free_spins:t.target.value})},type:"number"}),Object(T.jsx)("h4",{children:"Lifespan (how long the free spins are valid for after claim in minutes)"}),Object(T.jsx)("input",{required:!0,onChange:function(t){return e.updateMetadata({lifespan:t.target.value})},type:"number"})]})}},{key:"renderRakeback",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Game Slug (optional)"}),Object(T.jsx)("input",{required:!0,type:"number",min:1,onChange:function(t){return e.updateMetadata({game_slug:t.target.value})}}),Object(T.jsx)("br",{}),Object(T.jsx)("h4",{children:"Enter Minutes before payout (ex. 5 will wait 5 minutes, and give rakeback based on losses/wins between start and end time)"}),Object(T.jsx)("input",{value:this.state.metadata.minutes_before_payout,required:!0,type:"number",min:1,onChange:function(t){return e.updateMetadata({minutes_before_payout:t.target.value})}}),Object(T.jsx)("br",{}),Object(T.jsx)("h4",{children:"Enter Rakeback % (ex. 0.05 will give a user a 5% rakeback at the end of the period)"}),Object(T.jsx)("input",{value:this.state.metadata.percentage,required:!0,type:"number",min:1,onChange:function(t){return e.updateMetadata({percentage:t.target.value})}})]})}},{key:"renderMetadataInputUi",value:function(){var e={betby_bonus:this.renderBetByBonus,deposit_bonus:this.renderDepositBonus,deposit_bonus_sports:this.renderDepositBonusForSports,free_bet:this.renderFreeBet,xp_bonus:this.renderXPBonus,cashback:this.renderCashback,softswiss_free_spins:this.renderSoftswissFreeSpins,game_integration_free_spins:this.renderGameIntegrationFreeSpins,rakeback:this.renderRakeback,welcome_bonus:this.renderWelcomeBonus}[this.state.type];return e?e():null}},{key:"validateInput",value:function(e){var t=e.target,n=t.value.trim(),a=new RegExp("(^\\d+$)"),c=new RegExp(Aa),r=Na.test(n)||0===n.length;c.test(n)&&t.setCustomValidity(""),(n.length<2||n.length>255)&&t.setCustomValidity("The value of this field must be between 2 and 255 characters."),a.test(n)&&t.setCustomValidity("The value must not contain only numbers."),r&&t.setCustomValidity("The value must not be empty."),t.reportValidity()}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.REWARDS_CREATE_REWARD,children:[Object(T.jsx)("form",{onSubmit:this.onSubmitReward,children:Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsx)("h4",{children:"Create Reward"}),Object(T.jsx)("input",{placeholder:"Name (english, internal use)",ref:function(t){return e.name=t},pattern:Aa,onInput:this.validateInput,required:!0}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.name_translation,onChange:function(t){return e.setState({name_translation:t})},label:"Name Translation"}),Object(T.jsx)("hr",{}),Object(T.jsx)("input",{placeholder:"Description (english)",ref:function(t){return e.description=t}}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.description_translation,onChange:function(t){return e.setState({description_translation:t})},label:"Description Translation"}),Object(T.jsx)("hr",{}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.mystery_manifest_description_translation,onChange:function(t){return e.setState({mystery_manifest_description_translation:t})},label:"Mystery Box Translation"}),Object(T.jsx)("hr",{}),Object(T.jsx)("h4",{children:"Upload Image"}),Object(T.jsx)("input",{type:"file",accept:"image/*",onChange:function(t){e.setState({file:t.target.files[0]})}}),Object(T.jsx)("hr",{}),Object(T.jsx)("h4",{children:"Select Item Type"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.type,required:!0,onChange:function(t){return e.setState({type:null===t||void 0===t?void 0:t.value,metadata:{}})},options:[{label:"Betby Bonus",value:"betby_bonus"},{label:"Physical Goods",value:"physical_goods"},{label:"Deposit Bonus",value:"deposit_bonus"},{label:"Welcome Bonus",value:"welcome_bonus"},{label:"Deposit Bonus for Sports",value:"deposit_bonus_sports"},{label:"Free Bet",value:"free_bet"},{label:"XP Bonus",value:"xp_bonus"},{label:"Free Real Money",value:"free_real_money"},{label:"Progress (99% level up)",value:"progress"},{label:"Cashback",value:"cashback"},{label:"Softswiss Free Spins",value:"softswiss_free_spins"},{label:"Game Integration Free Spins",value:"game_integration_free_spins"},{label:"Rakeback",value:"rakeback"}]}),this.renderMetadataInputUi(),Object(T.jsx)("hr",{}),Object(T.jsx)("h4",{children:"Value (\u20ac EUR)"}),Object(T.jsx)("input",{placeholder:"Value (\u20ac EUR)",ref:function(t){return e.eur_value=t},required:!0,type:"number",min:1}),Object(T.jsx)("label",{children:"Sellable for above value?"}),Object(T.jsx)("input",{style:{width:"20px"},type:"checkbox",checked:this.state.sellable,onChange:function(){return e.setState({sellable:!e.state.sellable})}}),Object(T.jsx)("hr",{}),Object(T.jsx)("h4",{children:"Expiry Minutes"}),Object(T.jsx)("input",{placeholder:"Expiry Minutes (time before the item dissapears from users inventory)",ref:function(t){return e.expiry_minutes=t},required:!0,type:"number",min:1}),Object(T.jsx)(Ra,{}),Object(T.jsx)("hr",{}),Object(T.jsx)("button",{children:"Submit"})]})}),Object(T.jsx)("hr",{})]}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.REWARDS_VIEW_LIST,children:[Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Name"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Image"}),Object(T.jsx)(we.Th,{children:"Value"}),Object(T.jsx)(we.Th,{children:"Metadata"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsx)(we.Tbody,{children:this.props.records.map((function(t,n){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/".concat(t.id),children:t.id})}),Object(T.jsx)(we.Td,{children:t.name}),Object(T.jsx)(we.Td,{children:t.type}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("img",{style:{width:"20px"},src:t.image_url,alt:""})}),Object(T.jsxs)(we.Td,{children:["\u20ac ",t.eur_value]}),Object(T.jsx)(we.Td,{children:JSON.stringify(t.metadata,null,4)}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("i",{style:{cursor:"pointer"},onClick:function(n){return e.props.deleteReward(t.id)},className:"fas fa-trash"})})]},n)}))})]}),Object(T.jsx)(Ke,{total_pages:this.props.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update(t)}))}})]})]})}}]),n}(c.Component),ka=Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e.rewards.items),{},{bonuses:e.bonuses.search_results.records,boxes:e.rewards.mystery_boxes,languages:e.app.languages,currencyRates:e.rewards.currency_rates})}),(function(e){return{updateBonuses:function(t){return e(Rn(t))},updateBoxes:function(t){return e(Un())},update:function(t){return e(Pn(t))},create:function(t){return e(function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.upload(e.file,"rewards");case 2:if(e.image_url=t.sent,delete e.file,!["softswiss_free_spins","game_integration_free_spins"].includes(e.type)){t.next=6;break}return t.abrupt("return",window.api.post("/admin/softswiss-free-spins/create-reward",e).then((function(e){return re.toast.success("Reward created (".concat(null===e||void 0===e?void 0:e.id,").")),n(Pn())})));case 6:window.api.post("/admin/rewards",e).then((function(e){re.toast.success("Reward created (".concat(null===e||void 0===e?void 0:e.id,").")),n(Pn())}));case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(t))},deleteReward:function(t){return e(function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.api.delete("/admin/rewards/".concat(e)).then((function(t){re.toast.success("Reward id #".concat(e," deleted.")),n(Pn())}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(t))}}}))(Ia),Da=(n(478),function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={category:null,page:1,mystery_box_manifests:[],name_translation:{}},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){this.props.update(this.state.page),this.props.updateItems()}},{key:"addItem",value:function(e){this.setState({mystery_box_manifests:this.state.mystery_box_manifests.concat({reward_id:e})})}},{key:"editItem",value:function(e,t){var n=this,a=t.chance,c=JSON.parse(JSON.stringify(this.state.mystery_box_manifests)),r=c.find((function(t){return t.reward_id===e}));r.chance=a||r.chance,this.setState({mystery_box_manifests:c},(function(){return n.props.calculatePrice({mystery_box_manifests:n.normalizeManifests()})}))}},{key:"removeItem",value:function(e){this.setState({mystery_box_manifests:this.state.mystery_box_manifests.filter((function(t){return t.reward_id!==e}))})}},{key:"normalizeManifests",value:function(){return JSON.parse(JSON.stringify(this.state.mystery_box_manifests)).map((function(e){return e.chance=(parseFloat(e.chance)/100).toFixed(6),e}))}},{key:"create",value:function(){this.props.create({name:this.name.value,name_translation:this.state.name_translation,mystery_box_manifests:this.normalizeManifests(),file:this.state.file})}},{key:"render",value:function(){var e=this,t=this.state.mystery_box_manifests.reduce((function(e,t){return e+parseFloat(t.chance||0)}),0).toFixed(6);return Object(T.jsxs)("div",{className:"wheels",children:[Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.MYSTERY_BOXES_CREATE_BOX,children:[Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsx)("h4",{children:"Create Mystery Box"}),Object(T.jsx)("input",{placeholder:"Name of box (admin use only, ex. Daily - 3 Box Bronze)",ref:function(t){return e.name=t}}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.name_translation,onChange:function(t){return e.setState({name_translation:t})},label:"Name Translation"}),Object(T.jsx)("hr",{}),Object(T.jsx)("h4",{children:"Upload Image"}),Object(T.jsx)("input",{type:"file",onChange:function(t){e.setState({file:t.target.files[0]})}}),Object(T.jsx)("hr",{}),Object(T.jsx)("h3",{children:"Add Rewards to Box"}),Object(T.jsx)("div",{className:"items-select",children:this.props.items.filter((function(t){return!e.state.mystery_box_manifests.map((function(e){return e.reward_id})).includes(t.id)})).map((function(t){return Object(T.jsxs)("div",{onClick:function(){return e.addItem(t.id)},className:"wheel-item",children:[Object(T.jsx)("img",{src:t.image_url}),Object(T.jsxs)("div",{className:"name",children:[t.name," - ID: ",t.id]}),Object(T.jsx)("div",{className:"name",children:t.description}),Object(T.jsx)("div",{className:"type",children:t.type}),Object(T.jsxs)("div",{className:"value",children:["\u20ac",t.eur_value]})]})}))}),Object(T.jsx)("h3",{children:"Set Odds"}),Object(T.jsxs)(we.Table,{className:"odds",children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Item Name"}),Object(T.jsx)(we.Th,{children:"Chance"}),Object(T.jsx)(we.Th,{children:"EV"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsxs)(we.Tbody,{children:[this.state.mystery_box_manifests.map((function(t){var n=e.props.items.find((function(e){return e.id===t.reward_id})),a=parseFloat(t.chance)/100*parseFloat(n.eur_value);return Object(T.jsxs)(we.Tr,{children:[Object(T.jsxs)(we.Td,{children:[Object(T.jsx)("img",{style:{width:"20px"},src:n.image_url}),n.name," (\u20ac",n.eur_value,")"]}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("input",{value:t.chance,onChange:function(n){return e.editItem(t.reward_id,{chance:n.target.value})}})}),Object(T.jsx)(we.Td,{children:a?a.toFixed(6):0}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("a",{onClick:function(){return e.removeItem(t.reward_id)},children:Object(T.jsx)("i",{className:"fas fa-trash-alt"})})})]})})),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{}),Object(T.jsxs)(we.Td,{children:["Total Odds: ",t||0]}),Object(T.jsxs)(we.Td,{children:["\u20ac EV: ",this.props.price]})]})]})]}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{disabled:100!==+t||this.state.mystery_box_manifests.length<2,onClick:function(){return e.create()},children:"Submit"})]}),Object(T.jsx)("hr",{})]}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.MYSTERY_BOXES_VIEW_LIST,children:[Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Name"}),Object(T.jsx)(we.Th,{children:"Enabled"}),Object(T.jsx)(we.Th,{children:"\u20ac EV"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsx)("tbody",{children:this.props.records.map((function(t,n){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:t.id}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/mystery-boxes/".concat(t.id),children:t.name})}),Object(T.jsx)(we.Td,{children:t.enabled?Object(T.jsx)("i",{className:"fas fa-check"}):null}),Object(T.jsxs)(we.Td,{children:["\u20ac ",t.eur_price]}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("a",{onClick:function(){return e.props.delete(t.id)},children:Object(T.jsx)("i",{className:"fas fa-trash-alt"})})})]},n)}))})]}),Object(T.jsx)(Ke,{total_pages:this.props.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update()}))}})]})]})}}]),n}(c.Component)),La=Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e.rewards.mystery_boxes),{},{price:e.rewards.price,items:e.rewards.items.records,languages:e.app.languages})}),(function(e){return{updateBonuses:function(t){return e(Rn(t))},update:function(t){return e(Un())},calculatePrice:function(t){return e(function(e){return function(t){window.api.post("/admin/rewards/mystery_boxes/price",e).then((function(e){t({type:Ln.CASE_PRICE_UPDATE,payload:e})})).catch((function(e){}))}}(t))},updateItems:function(){return e(Pn())},delete:function(t){return e(function(e){return function(t){window.api.delete("/admin/rewards/mystery_boxes/"+e).then((function(e){t(Un())}))}}(t))},create:function(t){return e(function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.upload(e.file,"mystery-boxes");case 2:e.image_url=t.sent,delete e.file,window.api.post("/admin/rewards/mystery_boxes",e).then((function(e){re.toast.success("Mystery box created (".concat(e.id,").")),n(Un())}));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(t))}}}))(Da),Ua=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={query:"",page:1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.props.update(this.props.match.params.id)}},{key:"render",value:function(){var e=this;return console.log(this.props),Object(T.jsxs)("div",{children:[Object.keys(this.props.mystery_box).map((function(t){var n=e.props.mystery_box[t];return"object"===typeof n?null:Object(T.jsxs)("div",{children:[Object(T.jsxs)("span",{children:[t,": "]}),Object(T.jsx)("span",{children:n})]})})),Object(T.jsx)("hr",{}),Object(T.jsx)("h2",{children:"Win Metrics"}),Object(T.jsx)("pre",{children:JSON.stringify(this.props.mystery_box.win_metrics)}),Object(T.jsx)("hr",{}),Object(T.jsx)("h3",{children:"Items"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Name"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Image"}),Object(T.jsx)(we.Th,{children:"\u20ac Value"}),Object(T.jsx)(we.Th,{children:"Chance"}),Object(T.jsx)(we.Th,{children:"Min Roll (1-1m)"}),Object(T.jsx)(we.Th,{children:"Max Roll (1-1m)"})]})}),Object(T.jsx)("tbody",{children:this.props.mystery_box.rewards.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/rewards/".concat(e.id),children:e.id})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/rewards/".concat(e.id),children:e.name})}),Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("img",{src:e.image_url,alt:""})}),Object(T.jsxs)(we.Td,{children:["\u20ac ",e.eur_value]}),Object(T.jsx)(we.Td,{children:(100*+e.manifest.chance).toFixed(6)}),Object(T.jsx)(we.Td,{children:e.manifest.minimum_roll}),Object(T.jsx)(we.Td,{children:e.manifest.maximum_roll})]},t)}))})]})]})}}]),n}(c.Component),Pa=Object(o.b)((function(e){return{mystery_box:e.rewards.mystery_box}}),(function(e){return{update:function(t){return e(function(e){return function(t){window.api.get("/admin/rewards/mystery_boxes/"+e).then((function(e){t({type:Ln.CASE_UPDATE,payload:e})}))}}(t))}}}))(Ua),Wa="/admin/rewards/reward_tiers",Ma=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={query:"",page:1,results:{pagination:{total_pages:1,records_per_page:50},records:[]},edit_row:{},creating:!1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update(),this.props.dispatch(Un())}},{key:"update",value:function(){var e=this,t={};this.table&&(t={page:this.table.state.page+1,sorting:this.table.state.sorted[0],filters:this.table.state.filtered}),window.api.get(Wa,{params:t}).then((function(t){e.setState({results:t})}))}},{key:"save",value:function(){var e=this,t=this.state,n=t.edit_row;t.creating?window.api.post(Wa,n).then((function(t){e.setState({edit_row:{},creating:!1}),e.update()})):window.api.put("".concat(Wa,"/").concat(n.id),n).then((function(t){e.setState({edit_row:{}}),e.update()}))}},{key:"cancel",value:function(){this.state.creating&&this.setState({creating:!1}),this.setState({edit_row:{}})}},{key:"render",value:function(){var e=this,t=this.state,n=t.edit_row,a=t.creating,c=this.state.results,r=c.pagination,s=c.records;return a&&(s=[n].concat(s)),Object(T.jsxs)("div",{children:[Object(T.jsx)("button",{onClick:function(t){return e.setState({creating:!0,edit_row:{id:null}})},children:"New"}),Object(T.jsx)(Fn.a,{ref:function(t){return e.table=t},manual:!0,showPageJump:!1,pages:r.total_pages,pageSize:r.records_per_page,data:s,multiSort:!1,TbodyComponent:function(e){return Object(T.jsx)(we.Tbody,{children:e.children})},TheadComponent:function(e){return Object(T.jsx)(we.Thead,{children:e.children})},TdComponent:we.Td,getTdProps:function(e,t,n,a){return{style:{whiteSpace:"pre"}}},getTheadProps:function(e,t,n,a){return{style:{minWidth:"100%"}}},TrGroupComponent:function(e){return Object(T.jsx)(T.Fragment,{children:e.children})},TrComponent:we.Tr,ThComponent:we.Th,TableComponent:we.Table,showPageSizeOptions:!1,onPageChange:function(t){e.update()},onSortedChange:function(t,n,a){e.update()},onFilteredChange:function(t,n,a){e.update()},columns:[{Header:"",Cell:function(t){return n.id===t.original.id?Object(T.jsxs)("div",{children:[Object(T.jsx)("a",{onClick:function(t){return e.cancel()},children:"Cancel"}),Object(T.jsx)("a",{onClick:function(t){return e.save()},children:"Save"})]}):Object(T.jsx)("a",{onClick:function(n){return e.setState({edit_row:t.original})},children:"Edit"})}},{id:"id",Header:"ID",accessor:function(e){return Object(T.jsx)(l.b,{to:"/items/".concat(e.id),children:e.id})}},{id:"created_at",Header:"Created",accessor:function(e){return Se.withMinutes(e.created_at)}},{id:"name",Header:"Rule Name",accessor:function(t){return n.id===t.id?Object(T.jsx)("input",{value:n.name,onChange:function(t){return e.setState({edit_row:Object(d.a)(Object(d.a)({},n),{},{name:t.target.value})})}}):Object(T.jsx)("span",{children:t.name})}},{id:"mystery_box_id",Header:"Mystery Box",accessor:function(t){var a=(e.props.boxes||[]).find((function(e){return e.id===t.mystery_box_id}));return n.id===t.id?Object(T.jsx)("select",{name:"type",value:n.mystery_box_id,onChange:function(t){t=t||{value:null},e.setState({edit_row:Object(d.a)(Object(d.a)({},n),{},{mystery_box_id:t.target.value})})},children:e.props.boxes.map((function(e,t){return Object(T.jsx)("option",{value:e.id,children:e.name},t)}))}):a&&Object(T.jsx)(l.b,{to:"/rewards/mystery-boxes/".concat(a.id),children:a.name})}},{id:"min_level",Header:"Min Level",accessor:function(t){return n.id===t.id?Object(T.jsx)("input",{value:n.min_level,type:"number",onChange:function(t){return e.setState({edit_row:Object(d.a)(Object(d.a)({},n),{},{min_level:t.target.value||null})})}}):Object(T.jsx)("span",{children:t.min_level||"N/A"})}},{id:"max_level",Header:"Max Level",accessor:function(t){return n.id===t.id?Object(T.jsx)("input",{value:n.max_level,type:"number",onChange:function(t){return e.setState({edit_row:Object(d.a)(Object(d.a)({},n),{},{max_level:t.target.value||null})})}}):Object(T.jsx)("span",{children:t.max_level||"N/A"})}}]})]})}}]),n}(c.Component),Ba=Object(o.b)((function(e){return{boxes:e.rewards.mystery_boxes.records}}))(Ma),Fa="/admin/rewards/user_ranks",Ga=Object(o.b)((function(e){return{boxes:e.rewards.mystery_boxes.records,user_ranks:e.rewards.user_ranks}}))((function(e){var t=e.dispatch,n=r.a.useState({query:"",page:1,results:{pagination:{total_pages:1,records_per_page:50},records:[]},edit_row:{},creating:!1}),a=Object(m.a)(n,2),s=a[0],i=a[1],o=Object(c.useCallback)((function(){t((function(e){window.api.get("/admin/rewards/user_ranks").then((function(t){e({type:Ln.USER_RANKS_UPDATE,payload:t})}))}))}),[t]);Object(c.useEffect)((function(){t(Un()),o()}),[t,o]);var u=Object(c.useCallback)((function(){var e=s.edit_row;s.creating?window.api.post(Fa,e).then((function(e){i({edit_row:{},creating:!1}),o()})):window.api.put("".concat(Fa,"/").concat(e.id),e).then((function(e){i({edit_row:{}}),o()}))}),[s,o]),j=Object(c.useCallback)((function(){s.creating&&i({creating:!1}),i({edit_row:{}})}),[s.creating]),b=s.edit_row,h=s.creating,p=e.user_ranks;h&&(p=[b].concat(p));var O=r.a.useMemo((function(){return[{Header:"",Cell:function(e){return b.id===e.original.id?Object(T.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:"10px"},children:[Object(T.jsx)("a",{onClick:j,children:"Cancel"}),Object(T.jsx)("a",{onClick:u,children:"Save"})]}):Object(T.jsx)("a",{onClick:function(){return i({edit_row:e.original})},children:"Edit"})}},{id:"type",Header:"Type",accessor:function(e){return e.type},maxWidth:200},{id:"mystery_box_id",Header:"Daily Free Mystery Box",accessor:function(t){var n=(e.boxes||[]).find((function(e){return e.id===t.daily_free_mystery_box_id}));return b.id===t.id?Object(T.jsx)("select",{style:{minWidth:"100px",maxWidth:"100%"},name:"type",value:b.daily_free_mystery_box_id,onChange:function(e){e=e||{value:null},i({edit_row:Object(d.a)(Object(d.a)({},b),{},{daily_free_mystery_box_id:e.target.value})})},children:e.boxes.map((function(e){return Object(T.jsx)("option",{value:e.id,children:e.name},e.id)}))}):n&&Object(T.jsx)(l.b,{to:"/casino/mystery-boxes/".concat(n.id),children:n.name})},maxWidth:500},{id:"min_level",Header:"Min Level",accessor:function(e){return Object(T.jsx)("span",{children:e.min_level})},maxWidth:200},{id:"max_level",Header:"Max Level",accessor:function(e){return Object(T.jsx)("span",{children:e.max_level})},maxWidth:200},{id:"loyalty_rakeback_enabled",Header:"Loyalty Rakeback?",accessor:function(e){return b.id===e.id?Object(T.jsx)("input",{type:"checkbox",checked:b.loyalty_rakeback_enabled,onChange:function(t){return i({edit_row:Object(d.a)(Object(d.a)({},b),{},{loyalty_rakeback_enabled:!e.loyalty_rakeback_enabled})})}}):e.loyalty_rakeback_enabled?Object(T.jsx)("i",{className:"fas fa-check"}):null},maxWidth:200},{id:"loyalty_rakeback_percentage",Header:"Loyalty Rakeback Percentage",accessor:function(e){return b.id===e.id?Object(T.jsx)("input",{type:"text",value:b.loyalty_rakeback_percentage,onChange:function(e){return i({edit_row:Object(d.a)(Object(d.a)({},b),{},{loyalty_rakeback_percentage:e.target.value})})}}):Object(T.jsx)("span",{children:e.loyalty_rakeback_percentage})},maxWidth:300}]}),[j,b,e.boxes,u]);return Object(T.jsxs)("div",{children:[Object(T.jsx)("button",{onClick:function(){i({creating:!0,edit_row:{id:null,name:"New"}})},children:"New"}),Object(T.jsx)(Fn.a,{TbodyComponent:function(e){return Object(T.jsx)(we.Tbody,{children:e.children})},TheadComponent:function(e){return Object(T.jsx)(we.Thead,{children:e.children})},TdComponent:we.Td,getTdProps:function(e,t,n,a){return{style:{whiteSpace:"pre"}}},getTheadProps:function(e,t,n,a){return{style:{minWidth:"100%"}}},TrGroupComponent:function(e){return Object(T.jsx)(T.Fragment,{children:e.children})},getTrProps:function(e,t,n,a){return{style:{paddingBottom:"44px"}}},TrComponent:we.Tr,ThComponent:we.Th,TableComponent:we.Table,manual:!0,data:p,columns:O,multiSort:!1,showPageSizeOptions:!1,showPagination:!1})]})})),Va=n(341),Ya=(n(479),function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={current:null,percentage:null,expiryMinutes:null},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.getBonus()}},{key:"getBonus",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/rewards/global_xp");case 2:t=e.sent,console.log("DATA",t),this.setState({current:t});case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"update",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.put("/admin/rewards/global_xp",{percentage:this.state.percentage,expiry_minutes:this.state.expiryMinutes});case 2:return e.next=4,this.getBonus();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"remove",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.put("/admin/rewards/global_xp/remove");case 2:return e.next=4,this.getBonus();case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=this.state,n=t.current,a=t.percentage,c=t.expiryMinutes;return Object(T.jsxs)("div",{className:"globalXp-container",children:[Object(T.jsx)("h2",{className:"globalXp-title",children:"Current Global xp bonus"}),n?Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{children:["Percentage: ",n.bonus_percentage]}),Object(T.jsxs)("div",{children:["Expires in: ",Object(T.jsx)(Va.a,{date:Ee()(n.created_at)+1e3*n.expiry_minutes*60})]})]}):"none",Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"globalXp-section",children:[Object(T.jsxs)("div",{className:"globalXp-group-inputs",children:[Object(T.jsx)("label",{children:"percentage (ex. 1.2 == 20%)"}),Object(T.jsx)("input",{value:a,onChange:function(t){e.setState({percentage:t.target.value})}})]}),Object(T.jsxs)("div",{className:"globalXp-group-inputs",children:[Object(T.jsx)("label",{children:"minutes until expires"}),Object(T.jsx)("input",{value:c,onChange:function(t){e.setState({expiryMinutes:t.target.value})}})]}),Object(T.jsxs)("div",{className:"globalXp-group-btn",children:[Object(T.jsx)("button",{disabled:!c||+a<=1,onClick:function(){return e.update()},children:"Save"}),Object(T.jsx)("button",{style:{marginLeft:20},disabled:!n,onClick:function(){return e.remove()},children:"Remove"})]})]})]})}}]),n}(c.Component)),Ha=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).handleFileChange=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,c;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.target.files[0])){e.next=15;break}return e.prev=2,re.toast.info("Uploading image..."),e.next=6,window.api.upload(n,"games","".concat(a.props.match.params.id,"-new"));case 6:c=e.sent,a.imageUrlRef.current.value=c,a.setState({reward:Object(d.a)(Object(d.a)({},a.state.reward),{},{image_url:c})}),re.toast.success("Image uploaded successfully."),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(2),re.toast.error("Cannot upload image to bucket.");case 15:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(t){return e.apply(this,arguments)}}(),a.save=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t={name:a.nameRef.current.value,description:a.descriptionRef.current.value,image_url:a.imageUrlRef.current.value,sellable:a.sellableRef.current.checked,eur_value:parseFloat(a.eurValueRef.current.value),expiry_minutes:parseInt(a.expiryMinutesRef.current.value,10),name_translation:a.state.reward.name_translation,description_translation:a.state.reward.description_translation,mystery_manifest_description_translation:a.state.reward.mystery_manifest_description_translation,currency_rates:a.props.currencyRates},window.api.put("/admin/rewards/".concat(a.props.match.params.id),t).then((function(){re.toast.success("Reward saved successfully."),setTimeout((function(){a.props.history.push("/casino/rewards")}),300)})).catch((function(e){return re.toast.error("Failed to save reward.")}));case 2:case"end":return e.stop()}}),e)}))),a.toggleEdit=function(){a.setState({isEditing:!a.state.isEditing})},a.state={reward:{name_translation:{},description_translation:{},mystery_manifest_description_translation:{},image_url:"",sellable:!1,eur_value:0,expiry_minutes:0,currency_rates:{}},isLoading:!0,isEditing:!1},a.nameRef=Object(c.createRef)(),a.descriptionRef=Object(c.createRef)(),a.imageUrlRef=Object(c.createRef)(),a.sellableRef=Object(c.createRef)(),a.eurValueRef=Object(c.createRef)(),a.expiryMinutesRef=Object(c.createRef)(),a.currencyRatesRef=Object(c.createRef)(),a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){var e=this;window.api.get("/admin/rewards/".concat(this.props.match.params.id)).then((function(t){e.setState({reward:t}),e.props.setCurrencyRates(t.currency_rates),e.setState({isLoading:!1})}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.isEditing;return t.isLoading?Object(T.jsx)("h3",{children:"Loading..."}):Object(T.jsxs)("div",{className:"container",children:[Object(T.jsx)("div",{className:"button-container",children:Object(T.jsx)("button",{onClick:this.toggleEdit,children:n?"Cancel":"Edit"})}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.REWARDS_UPDATE_REWARD,children:[Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Name:"}),Object(T.jsx)("input",{type:"text",ref:this.nameRef,defaultValue:this.state.reward.name,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Description:"}),Object(T.jsx)("input",{type:"text",ref:this.descriptionRef,defaultValue:this.state.reward.description,disabled:!n})]}),Object(T.jsxs)("div",{className:"file-container",children:[Object(T.jsx)("div",{children:Object(T.jsx)("label",{children:"Image URL:"})}),Object(T.jsxs)("div",{className:"file-input-container",children:[Object(T.jsx)("input",{type:"text",ref:this.imageUrlRef,defaultValue:this.state.reward.image_url,disabled:!n}),Object(T.jsx)("input",{type:"file",onChange:this.handleFileChange,disabled:!n})]})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Sellable:"}),Object(T.jsx)("input",{type:"checkbox",ref:this.sellableRef,defaultChecked:this.state.reward.sellable,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"EUR Value:"}),Object(T.jsx)("input",{type:"number",ref:this.eurValueRef,defaultValue:this.state.reward.eur_value,disabled:!n})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Expiry Minutes:"}),Object(T.jsx)("input",{type:"number",ref:this.expiryMinutesRef,defaultValue:this.state.reward.expiry_minutes,disabled:!n})]}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.reward.name_translation,onChange:function(t){return e.setState({reward:Object(d.a)(Object(d.a)({},e.state.reward),{},{name_translation:t})})},label:"Name Translation",disabled:!n}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.reward.description_translation,onChange:function(t){return e.setState({reward:Object(d.a)(Object(d.a)({},e.state.reward),{},{description_translation:t})})},label:"Description Translation",disabled:!n}),Object(T.jsx)(Pe,{languages:this.props.languages,contents:this.state.reward.mystery_manifest_description_translation,onChange:function(t){return e.setState({reward:Object(d.a)(Object(d.a)({},e.state.reward),{},{mystery_manifest_description_translation:t})})},label:"Mystery Box Translation",disabled:!n}),Object(T.jsx)(Ra,{}),n&&Object(T.jsx)("div",{className:"button-container",children:Object(T.jsx)("button",{onClick:this.save,children:"Save"})})]})]})}}]),n}(c.Component),qa=Object(o.b)((function(e){return{languages:e.app.languages,currencyRates:e.rewards.currency_rates}}),(function(e){return{setCurrencyRates:function(t){return e({type:Ln.LOAD_CURRENCY_RATES,payload:t})}}}))(Ha),Ka=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={name:"",page:1,records:[],meta:{},ordinality:{},providerGames:[],inputs:{},terms:[],query:""},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetchProviderGames(),this.fetchSearchTerms()}},{key:"componentDidUpdate",value:function(e,t,n){e.providerSlug!==this.props.providerSlug&&this.props.providerSlug&&this.fetchProviderGames(),t.page!==this.state.page&&this.fetchProviderGames()}},{key:"fetchProviderGames",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/games/search?"+A.a.stringify({order:"popular",page:this.state.page,limit:30,game_provider_slugs:this.props.providerSlug,search:this.state.query}));case 2:t=e.sent,this.setState(Object(d.a)({},t));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"fetchSearchTerms",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/search_terms");case 2:t=e.sent,this.setState({terms:t});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"lockAtPosition",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fixed_position,a=t.game_id,e.next=3,window.api.post("/admin/search_terms/lock",{fixed_position:n,game_id:a,slug:this.props.providerSlug,type:"provider"});case 3:this.fetchProviderGames(),this.fetchSearchTerms();case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"unlockTerm",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.search_term_id,e.next=3,window.api.post("/admin/search_terms/unlock",{search_term_id:n});case 3:this.fetchProviderGames(),this.fetchSearchTerms();case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pushUnlockedSlot",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fixed_position,e.next=3,window.api.post("/admin/search_terms/push_unlocked",{fixed_position:n,slug:this.props.providerSlug,type:"provider"});case 3:this.fetchProviderGames(),this.fetchSearchTerms();case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"mergeTermsToGames",value:function(){var e=this,t=this.state,n=t.records,a=t.terms;return n.map((function(t){var n=a.find((function(n){return"provider"===n.type&&n.value.slug===e.props.providerSlug&&+n.value.game_provider_game_id===t.id}));return Object(d.a)(Object(d.a)({},t),{},{fixed_ordinality:n?n.value.fixed_ordinality:null,term_id:n?n.id:null})}))}},{key:"render",value:function(){var e=this,t=this.mergeTermsToGames();return Object(T.jsxs)("div",{style:{width:"60%"},children:[Object(T.jsx)("h2",{children:"Edit game positions in provider"}),Object(T.jsxs)("div",{children:[Object(T.jsx)("button",{onClick:function(){var t=window.prompt("What position do you want an unlocked slot at? (0 = first position)");if(isNaN(+t)||null===t)return null;e.pushUnlockedSlot({fixed_position:t})},children:"Insert unlocked slot"}),Object(T.jsx)("input",{style:{marginLeft:20,width:700},placeholder:"Search",onChange:function(t){e.setState({query:t.target.value},(function(){return e.fetchProviderGames()}))}})]}),Object(T.jsx)("br",{}),Object(T.jsx)("div",{className:"row games",children:t.map((function(t,n){return Object(T.jsx)("div",{className:"col-xs-2",children:Object(T.jsxs)("div",{className:"game-box",children:[null!==t.fixed_ordinality?Object(T.jsxs)("p",{children:["Fixed: ",t.fixed_ordinality]}):"default",Object(T.jsxs)("div",{className:"buttons row",children:[Object(T.jsx)("div",{className:"col-xs-12",children:Object(T.jsx)("button",{onClick:function(){var n=window.prompt("What position do you want this game to be fixed to? (0 = first position)");if(isNaN(+n)||null===n)return null;e.lockAtPosition({fixed_position:n,game_id:t.id,search_term_id:t.term_id})},children:"Lock At"})}),Object(T.jsx)("div",{className:"col-xs-12",children:Object(T.jsx)("button",{disabled:!t.term_id,onClick:function(){e.unlockTerm({search_term_id:t.term_id})},children:"Unlock"})})]}),Object(T.jsx)("img",{src:t.image_url_new||t.image_url}),Object(T.jsx)("p",{children:t.name}),Object(T.jsx)("p",{children:t.provider.name})]})},n)}))}),Object(T.jsx)(Ke,{total_pages:this.state.meta.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),za=Ka,Xa=function(e){var t=e.providerSlug,n=Object(c.useState)(""),a=Object(m.a)(n,2),r=a[0],s=a[1],i=function(){r&&window.api.post("/admin/game_providers/".concat(t,"/rename"),{name:r}).then((function(){s(""),re.toast.info("Updated",{type:"success"})})).catch((function(e){console.log(e)}))};return Object(T.jsxs)("div",{children:[Object(T.jsx)("h2",{children:"Edit game provider name"}),Object(T.jsx)("input",{type:"text",placeholder:"Game Provider Name",value:r,onChange:function(e){return s(e.target.value||"")},onKeyDown:function(e){"Enter"===e.key&&i()}}),Object(T.jsx)("button",{onClick:function(){return i()},disabled:""===r,children:"Update Name"})]})},Za={provider:{aggregator:{},blocked_countries:[]},reportLoading:!1,gameProviderReport:{data:{}}},Qa=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).handleInputChange=function(e){a.setState((function(t){var n;return n=t.provider.blocked_countries.some((function(t){return t.value===e.value}))?t.provider.blocked_countries.filter((function(t){return t.value!==e.value})):[].concat(Object(ct.a)(t.provider.blocked_countries),[e]),{provider:Object(d.a)(Object(d.a)({},t.provider),{},{blocked_countries:n})}}))},a.updateBlockedCountries=Object(f.a)(Object(x.a)().mark((function e(){var t,n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.state.provider.blocked_countries.map((function(e){return e.value.trim()})),n="{".concat(t.join(","),"}"),e.prev=2,e.next=5,window.api.put("/admin/game_providers/".concat(a.props.match.params.slug,"/blocked_countries"),{blocked_countries:n});case 5:re.toast.success("Updated correctly"),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),re.toast.error(e.t0.message);case 11:case"end":return e.stop()}}),e,null,[[2,8]])}))),a.countries=mn()().getData(),a.state=Za,a.baseUrl="/admin/game_providers/"+a.props.match.params.slug,a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetchProvider()}},{key:"fetchProvider",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/game_providers/".concat(this.props.match.params.slug)).then((function(e){return t.setState({provider:e})}));case 2:this.formatBlockedCountries();case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"formatBlockedCountries",value:function(){var e=this,t=this.state.provider.blocked_countries,n=(0===Object.keys(t).length?[]:this.state.provider.blocked_countries.toString().replace(/[{}]/g,"").split(",")).map((function(t){var n=e.countries.find((function(e){return e.code===t}));return{value:n.code,label:n.name}}));return this.setState({provider:{aggregator:{name:this.state.provider.aggregator.name},blocked_countries:n}}),n}},{key:"formatCountries",value:function(e){return e.map((function(e){return{value:e.code,label:e.name}}))}},{key:"render",value:function(){var e=this.props.match.params.slug,t=this.state.provider.blocked_countries;return Object(T.jsxs)("div",{children:[Object(T.jsx)("div",{children:Object(T.jsxs)("div",{className:"col-md-12",children:[Object(T.jsxs)("div",{className:"data",style:{lineHeight:"2"},children:[Object(T.jsxs)("div",{children:["Aggregator: ",this.state.provider.aggregator.name]}),Object(T.jsxs)("div",{className:"blocked-countries",children:[Object(T.jsx)(Ce.a,{isMulti:!0,onChange:this.handleInputChange,options:this.formatCountries(this.countries),placeholder:"Select blocked countries"}),Object(T.jsx)("button",{onClick:this.updateBlockedCountries,className:"small",children:"Update blocked countries"})]})]}),t.length>0&&Object(T.jsxs)("div",{children:[Object(T.jsx)("p",{children:"Blocked Countries:"}),Object(T.jsx)("ul",{children:t.map((function(e){return Object(T.jsx)("li",{children:e.label},e.value)}))})]})]})}),Object(T.jsx)("div",{className:"col-md-12",children:Object(T.jsx)(Xa,{providerSlug:e})}),Object(T.jsx)("div",{className:"col-md-12",children:Object(T.jsx)(za,{providerSlug:e})})]})}}]),n}(c.Component),Ja=Qa,$a=function(e){var t=e.createNewCategory,n=Object(c.useState)(""),a=Object(m.a)(n,2),r=a[0],s=a[1],i=Object(c.useState)(!1),o=Object(m.a)(i,2),l=o[0],d=o[1];return Object(T.jsxs)("div",{children:[Object(T.jsx)("h3",{children:"New Category"}),Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[Object(T.jsx)("input",{placeholder:"Name",onChange:function(e){return s(e.target.value)},value:r}),Object(T.jsx)("input",{type:"checkbox",placeholder:"Is label",onChange:function(e){return d(e.target.checked)},checked:l})," Is label?",Object(T.jsx)("button",{onClick:function(){return t({name:r,isLabel:l})},className:"small",children:"Create"})]})]})},ec=(n(295),function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={name:"",page:1,records:[],meta:{},showEnabled:!0,showDisabled:!0,showInCategory:!0,showNotInCategory:!0,categories:[],ordinality:{},categoryGames:[]},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.search(),this.fetchCategoryGames()}},{key:"componentDidUpdate",value:function(e,t,n){t.page!==this.state.page&&this.search(),e.categorySlug!==this.props.categorySlug&&this.props.categorySlug&&this.fetchCategoryGames()}},{key:"fetchCategoryGames",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/game_categories/"+this.props.categorySlug);case 2:t=e.sent,this.setState({categoryGames:t});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"search",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={name:this.state.name,page:this.state.page},this.state.showEnabled&&!this.state.showDisabled?t.enabled=!0:!this.state.showEnabled&&this.state.showDisabled&&(t.enabled=!1),e.next=4,window.api({method:"GET",url:"/admin/games",params:t});case 4:n=e.sent,this.setState({records:n.records||[],meta:n.meta||{}});case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"addCategory",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/game_categories/".concat(this.props.categorySlug,"/add_game"),{game_id:t});case 2:this.fetchCategoryGames();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"removeCategory",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/game_categories/".concat(this.props.categorySlug,"/remove_game"),{game_id:t});case 2:this.fetchCategoryGames();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=this.state,n=t.showInCategory,a=t.showNotInCategory,c=t.categoryGames,r=this.state.records;return n&&!a&&(r=c),Object(T.jsxs)("div",{children:[Object(T.jsx)("div",{className:"input-row",children:Object(T.jsx)("input",{value:this.state.name,onChange:function(t){e.setState({name:t.target.value,page:1},(function(){clearTimeout(e.timeout),e.timeout=setTimeout((function(){e.search()}),400)}))},placeholder:"Search (game name, provider name)"})}),Object(T.jsxs)("div",{className:"group-checkbox",children:[Object(T.jsxs)("span",{style:{marginRight:15,cursor:"pointer"},onClick:function(){e.setState({showEnabled:!e.state.showEnabled},e.search)},children:["Show Enabled"," ",Object(T.jsx)("input",{checked:this.state.showEnabled,type:"checkbox"})]}),Object(T.jsxs)("span",{style:{marginRight:15,cursor:"pointer"},onClick:function(){e.setState({showDisabled:!e.state.showDisabled},e.search)},children:["Show Disabled"," ",Object(T.jsx)("input",{checked:this.state.showDisabled,type:"checkbox"})]}),Object(T.jsxs)("span",{style:{marginRight:15,cursor:"pointer"},onClick:function(){e.setState({showInCategory:!e.state.showInCategory},e.search)},children:["Show Games in Category"," ",Object(T.jsx)("input",{checked:this.state.showInCategory,type:"checkbox"})]}),Object(T.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){e.setState({showNotInCategory:!e.state.showNotInCategory},e.search)},children:["Show Games not in Category"," ",Object(T.jsx)("input",{checked:this.state.showNotInCategory,type:"checkbox"})]})]}),Object(T.jsx)("div",{className:"games-category-container",children:r.map((function(t,r){console.log(t);var s=c.find((function(e){return e.id===t.id}));return!n&&s?null:a||s?Object(T.jsx)("div",{children:Object(T.jsxs)("div",{className:"game-box ".concat(s?"inCategory":"outCategory"),onClick:function(){s?e.removeCategory(t.id):e.addCategory(t.id)},children:[Object(T.jsx)("img",{alt:"game ".concat(t.provider.name),src:t.image_url_new||t.image_url}),Object(T.jsx)("p",{children:t.name}),Object(T.jsx)("p",{children:t.provider.name}),Object(T.jsx)("p",{children:t.slug})]})},r):null}))}),Object(T.jsx)(Ke,{total_pages:this.state.meta.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component)),tc=ec,nc=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={name:"",page:1,records:[],meta:{},showEnabled:!0,showDisabled:!0,showInCategory:!0,showNotInCategory:!0,categories:[],ordinality:{},categoryGames:[],inputs:{},terms:[],query:""},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetchCategoryGames(),this.fetchSearchTerms()}},{key:"componentDidUpdate",value:function(e,t,n){e.categorySlug!==this.props.categorySlug&&this.props.categorySlug&&this.fetchCategoryGames(),t.page!==this.state.page&&this.fetchCategoryGames()}},{key:"fetchCategoryGames",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/games/search?"+A.a.stringify({order:"popular",page:this.state.page,limit:30,search:this.state.query,game_category_slugs:this.props.categorySlug}));case 2:t=e.sent,this.setState(Object(d.a)({},t));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"fetchSearchTerms",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/search_terms");case 2:t=e.sent,this.setState({terms:t});case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"lockAtPosition",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fixed_position,a=t.game_id,e.next=3,window.api.post("/admin/search_terms/lock",{fixed_position:n,game_id:a,slug:this.props.categorySlug,type:"category"});case 3:this.fetchCategoryGames(),this.fetchSearchTerms();case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"unlockTerm",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.search_term_id,e.next=3,window.api.post("/admin/search_terms/unlock",{search_term_id:n});case 3:this.fetchCategoryGames(),this.fetchSearchTerms();case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"pushUnlockedSlot",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fixed_position,e.next=3,window.api.post("/admin/search_terms/push_unlocked",{fixed_position:n,slug:this.props.categorySlug,type:"category"});case 3:this.fetchCategoryGames(),this.fetchSearchTerms();case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"mergeTermsToGames",value:function(){var e=this,t=this.state,n=t.records,a=t.terms;return n.map((function(t){var n=a.find((function(n){return"category"===n.type&&n.value.slug===e.props.categorySlug&&+n.value.game_provider_game_id===t.id}));return Object(d.a)(Object(d.a)({},t),{},{fixed_ordinality:n?n.value.fixed_ordinality:null,term_id:n?n.id:null})}))}},{key:"render",value:function(){var e=this,t=this.mergeTermsToGames();return Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{className:"group-input",children:[Object(T.jsx)("input",{placeholder:"Search",onChange:function(t){e.setState({query:t.target.value},(function(){return e.fetchCategoryGames()}))}}),Object(T.jsx)("button",{onClick:function(){var t=window.prompt("What position do you want an unlocked slot at? (0 = first position)");if(isNaN(+t)||null===t)return null;e.pushUnlockedSlot({fixed_position:t})},children:"Insert unlocked slot"})]}),Object(T.jsx)("div",{className:"games-category-container",children:t.map((function(t,n){return Object(T.jsx)("div",{children:Object(T.jsxs)("div",{className:"game-box ",children:[null!==t.fixed_ordinality?Object(T.jsxs)("p",{children:["Locked at: ",t.fixed_ordinality]}):"Unlocked",Object(T.jsxs)("div",{className:"buttons row",children:[Object(T.jsx)("div",{className:"col-xs-12",children:Object(T.jsx)("button",{onClick:function(){var n=window.prompt("What position do you want this game to be fixed to? (0 = first position)");if(isNaN(+n)||null===n)return null;e.lockAtPosition({fixed_position:n,game_id:t.id,search_term_id:t.term_id})},children:"Lock at"})}),Object(T.jsx)("div",{className:"col-xs-12",children:Object(T.jsx)("button",{disabled:!t.term_id,onClick:function(){e.unlockTerm({search_term_id:t.term_id})},children:"Unlock"})})]}),Object(T.jsx)("img",{alt:"game ".concat(t.provider.name),src:t.image_url_new||t.image_url}),Object(T.jsx)("p",{children:t.name}),Object(T.jsx)("p",{children:t.provider.name})]})},n)}))}),Object(T.jsx)(Ke,{total_pages:this.state.meta.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),ac=nc,cc=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){var e;Object(u.a)(this,n);for(var a=arguments.length,c=new Array(a),r=0;r<a;r++)c[r]=arguments[r];return(e=t.call.apply(t,[this].concat(c))).state={tab:"add",newName:""},e}return Object(j.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.categorySlug,a=t.categoryName;if(!n)return null;var c=this.state.tab;return Object(T.jsxs)("div",{children:[Object(T.jsx)("h2",{children:a}),Object(T.jsxs)("div",{className:"view-category__new-category",children:[Object(T.jsx)("input",{placeholder:"new category name",value:this.state.newName,onChange:function(t){e.setState({newName:t.target.value})}}),Object(T.jsx)("button",{className:"small",onClick:function(){e.props.changeName(e.props.categorySlug,e.state.newName)},children:"Change Name"})]}),Object(T.jsxs)("nav",{children:[Object(T.jsx)("a",{className:"add"===c&&"active",onClick:function(){e.setState({tab:"add"})},children:"Add / Remove Games"}),Object(T.jsx)("a",{className:"edit"===c&&"active",onClick:function(){e.setState({tab:"edit"})},children:"Edit positions"})]}),Object(T.jsxs)("div",{children:["add"===c&&Object(T.jsx)(tc,{categorySlug:n}),"edit"===c&&Object(T.jsx)(ac,{categorySlug:n})]})]})}}]),n}(c.Component),rc=(n(480),{categories:[],categorySlug:null}),sc=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state=rc,a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetchGame(),this.fetchCategories()}},{key:"runReport",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({reportLoading:!0}),e.prev=1,e.next=4,this.getReportApi().waitUntilNewReportGenerated();case 4:t=e.sent,this.setState({gameReport:t}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),re.toast.error(e.t0.message);case 11:this.setState({reportLoading:!1});case 12:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(){return e.apply(this,arguments)}}()},{key:"fetchGame",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/games/".concat(this.props.match.params.slug)).then((function(e){return t.setState({game:e})}));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"fetchCategories",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get("/admin/game_categories").then((function(e){return t.setState({categories:e,categorySlug:e[0].slug,categoryName:e[0].name})}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"changeCategoryName",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){var a=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/game_categories/change_name",{name:n,slug:t});case 2:return e.next=4,window.api.get("/admin/game_categories").then((function(e){return a.setState({categories:e,categoryName:n})}));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"createNewCategory",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.name,a=t.isLabel,e.next=3,window.api.post("/admin/game_categories",{name:n,isLabel:a});case 3:re.toast.success("Category created"),this.fetchCategories();case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"addCategory",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/game_categories/".concat(t,"/add_game"),{game_id:this.state.game.id});case 2:this.fetchGame();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"removeCategory",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/game_categories/".concat(t,"/remove_game"),{game_id:this.state.game.id});case 2:this.fetchGame();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{className:"category-page",children:[Object(T.jsx)("div",{className:"category-select",children:this.state.categories.map((function(t){return Object(T.jsx)("div",{className:"category-box ".concat(e.state.categorySlug===t.slug&&"selected"),onClick:function(){e.setState({categorySlug:t.slug,categoryName:t.name})},children:t.slug})}))}),Object(T.jsx)("div",{className:"category-page__game",children:Object(T.jsx)($a,{createNewCategory:function(t){return e.createNewCategory(t)}})}),Object(T.jsx)("hr",{}),Object(T.jsx)("section",{children:Object(T.jsx)(cc,{changeName:function(t,n){return e.changeCategoryName(t,n)},categorySlug:this.state.categorySlug,categoryName:this.state.categoryName})})]})}}]),n}(c.Component),ic=Object(o.b)((function(e){return{languages:e.app.languages}}))(sc),oc=["bank_iban","credit_card","credit_card_switch","id","address","proof_of_deposit","source_of_funds"],lc=["bank_iban","credit_card","id","address","proof_of_deposit","source_of_funds"],dc={id:["document_type","incorrect_name","visibility","expired","incorrect_date_of_birth"],address:["document_type","incorrect_name","visibility","expired","incorrect_address"],credit_card:["incorrect_card_number","document_type","incorrect_card_holder","expired","visibility","name_visibility"],bank_iban:["document_type","incorrect_name","visibility","expired","incorrect_bank_account_number"],proof_of_deposit:["document_type","visibility","expired","incorrect_bank_details","payment_proof_mismatch_deposit_details"],source_of_funds:["document_type","visibility","expired","insufficient_information"]},uc=["status","id_type","address_type","card_type","iban_type","proof_of_deposit","source_of_funds"],jc="consumed",bc=["betby"],hc=[{id:1,reason:"Bug/Tech issues"},{id:2,reason:"Fraud/Abuse"},{id:3,reason:"Gambling Addiction"},{id:4,reason:"Minor"},{id:5,reason:"Permanent Request"},{id:6,reason:"User request"},{id:7,reason:"Multiples Account"},{id:8,reason:"Hacker victim"},{id:9,reason:"Third-party"},{id:10,reason:"CNPJ deposits"}],pc=(n(481),function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={loading:!1,data:{game:{name:"Test"},provider:{name:"Test"},aggregator:{name:"Test"},bets:[]},maximizedBetIds:[],betEventsHistory:null},a}return Object(j.a)(n,[{key:"load",value:function(){var e=this;window.api.get("/admin/game_provider_rounds/"+this.props.match.params.id).then((function(t){e.setState({data:t}),e.isLoadableBetHistory(t)&&e.getBetEventsHistory(t.game_state.remote_round_id)})).finally((function(){return e.setState({loading:!1})}))}},{key:"componentDidMount",value:function(){this.setState({loading:!0}),this.load()}},{key:"getBetEventsHistory",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.get("/admin/betby_events/".concat(t));case 3:n=e.sent,this.setState({betEventsHistory:n}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,this,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()},{key:"isLoadableBetHistory",value:function(e){var t,n;return(null===e||void 0===e||null===(t=e.game_state)||void 0===t?void 0:t.remote_round_id)&&bc.includes(null===e||void 0===e||null===(n=e.provider)||void 0===n?void 0:n.slug)}},{key:"closeRound",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.setState({loading:!0}),window.api.put("/admin/users/close_round/"+this.state.data.game_state.game_provider_round_id,{withSideEffects:t}).then((function(){return window.location.reload()})).finally((function(){return e.setState({loading:!1})}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.betEventsHistory,a=t.data,r=t.loading,s=t.maximizedBetIds,i=a.game,o=a.provider,d=a.aggregator,u=a.game_state,j=a.bets,b=void 0===j?[]:j,h=a.user;return r?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-md-6",children:[Object(T.jsx)("h3",{children:"Round Information"}),Object(T.jsxs)("div",{className:"round-id",children:["Round ID: ",this.props.match.params.id]}),Object(T.jsxs)("div",{className:"game",children:["Game Name: ",Object(T.jsx)(l.b,{to:"/casino/games/".concat(null===i||void 0===i?void 0:i.slug),children:null===i||void 0===i?void 0:i.name})]}),Object(T.jsxs)("div",{className:"game",children:["Game Provider: ",Object(T.jsx)(l.b,{to:"/casino/game-providers/".concat(null===o||void 0===o?void 0:o.slug),children:null===o||void 0===o?void 0:o.name})]}),Object(T.jsxs)("div",{className:"game",children:["Game Aggregator: ",null===d||void 0===d?void 0:d.name]}),Object(T.jsxs)("div",{className:"game",children:["User: ",Object(T.jsx)(l.b,{to:"/users/".concat(null===h||void 0===h?void 0:h.userId,"/game-provider-rounds"),children:null===h||void 0===h?void 0:h.username})]}),Object(T.jsx)("br",{}),Object(T.jsx)("pre",{children:JSON.stringify(u,null,4)}),"closed"!==(null===u||void 0===u?void 0:u.status)&&Object(T.jsxs)("div",{children:[Object(T.jsx)("button",{onClick:function(){return e.closeRound(!1)},children:"Mark as closed only"}),Object(T.jsx)("button",{onClick:function(){return e.closeRound(!0)},children:"Mark as closed WITH side effects"})]})]}),Object(T.jsxs)("div",{className:"col-md-6",children:[Object(T.jsx)("h3",{children:"Bets"}),b.map((function(t){var n=s.includes(t.id);return Object(T.jsx)(c.Fragment,{children:Object(T.jsxs)("div",{className:"bet",children:[Object(T.jsxs)("div",{className:"top",onClick:function(){return e.setState({maximizedBetIds:n?s.filter((function(e){return e!==t.id})):[].concat(Object(ct.a)(s),[t.id])})},children:[Object(T.jsxs)("div",{className:"left",children:[Object(T.jsxs)("div",{className:"id",children:["ID: ",t.id]}),Object(T.jsxs)("div",{className:"amount",children:["Wager: ",t.amount," ",t.currency_type]}),Object(T.jsxs)("div",{className:"win-amount",children:["Winnings: ",t.win_amount," ",t.currency_type]})]}),Object(T.jsxs)("div",{className:"right",children:[Object(T.jsxs)("div",{className:"amount status",children:["Status: ",t.status]}),Object(T.jsx)("div",{className:"maximize",children:Object(T.jsx)("i",{className:"fa fa-plus"})})]})]}),n&&Object(T.jsxs)("div",{className:"bet-data",children:[Object(T.jsxs)("div",{className:"stats",children:[Object(T.jsxs)("div",{className:"win-amount",children:["Created at: ",Se.withMinutes(t.created_at)]}),Object(T.jsxs)("div",{className:"win-amount",children:["Last updated: ",Se.withMinutes(t.created_at)]}),Object(T.jsxs)("div",{className:"win-amount",children:["Game Data: ",JSON.stringify(t.game_data,null,4)]})]}),Object(T.jsxs)("div",{className:"bet-journal-entries",children:[Object(T.jsx)("h4",{children:"Journal Entries"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Journal Name"})]})}),Object(T.jsx)(we.Tbody,{children:t.journal_entries.map((function(e){var t=e.id,n=e.amount,a=e.type,c=e.journal_name;return Object(T.jsxs)(we.Tr,{className:"journal-entry",children:[Object(T.jsx)(we.Td,{children:t}),Object(T.jsx)(we.Td,{className:"amount",children:n}),Object(T.jsx)(we.Td,{className:"type",children:a}),Object(T.jsx)(we.Td,{className:"journal",children:c})]},t)}))})]})]})]})]})},t.id)}))]}),this.isLoadableBetHistory(a)&&Object(T.jsx)("div",{className:"col-md-12 bet-data",style:{marginTop:"25px"},children:Object(T.jsxs)("div",{className:"bet-journal-entries",children:[Object(T.jsx)("h3",{children:"Bet Events History"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Created Date"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Tracking ID"}),Object(T.jsx)(we.Th,{children:"Aggregate ID"}),Object(T.jsx)(we.Th,{children:"Event Data"})]})}),Object(T.jsx)(we.Tbody,{children:null===n||void 0===n?void 0:n.map((function(e){var t=e.tracking_id,n=e.aggregate_id,a=e.type,c=e.data,r=e.created_at;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:r}),Object(T.jsx)(we.Td,{children:a}),Object(T.jsx)(we.Td,{children:t}),Object(T.jsx)(we.Td,{children:n}),Object(T.jsx)(we.Td,{children:JSON.stringify(c,null,4)})]},"".concat(t))}))})]})]})})]})})}}]),n}(c.Component)),Oc=Object(p.withRouter)(pc),_c=(n(229),[{label:"Landing-1 with timer and reward",value:"landing1"},{label:"Landing-2 with form and reward",value:"landing2"},{label:"Landing-3 with form and timer",value:"landing3"},{label:"Landing-4 width large text",value:"landing4"}]),mc=["crash","sports","casino","double","mines","tiger","neymar","aviator","fortunerabbit","fortuneox","neymarCasino","fortuneDouble","fortunedragon","fruitSlice","gatesOfOlympus","sweetBonanza","bigBassSplash","bigBassBonanza","sugarRush","gemsBonanza","releaseTheKraken","biggerBassBonanza","wildWildRiches","megaRoulette","super7s","floatingDragon","spaceman","juicyFruits","sweetBonanzaXmas","diamondStrike","fruitParty","biggerBassBlizzardChristmasCatch","madameDestinyMegaways","starlightPrincess","theDogHouseMegaways","fruitParty2","buffaloKingMegaways","mustangGold","crazyTime","roletaRilampago","speedBaccaratQ","ruletaEnVivo","roletaAoVivo","lightningRoulette","bacBo","xxxtremeLightningRoulette","immersiveRoulette","dragonTiger","evolutionCrazyCoinflip","monopolyBigBaller","footballStudio","monopoly","lightningDice","bingoGames"],xc=Object(o.b)((function(e){return{languages:e.app.languages}}),{})((function(e){var t=Object(c.useState)("default"),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)({}),i=Object(m.a)(s,2),o=i[0],l=i[1],u=Object(c.useState)([]),j=Object(m.a)(u,2),b=j[0],h=j[1],p=Object(c.useState)(""),O=Object(m.a)(p,2),x=O[0],f=O[1],v=Object(c.useState)(""),g=Object(m.a)(v,2),y=g[0],E=g[1],S=Object(c.useState)(""),w=Object(m.a)(S,2),R=w[0],A=w[1],N=Object(c.useState)({}),C=Object(m.a)(N,2),I=C[0],k=C[1],D=Object(c.useState)({}),L=Object(m.a)(D,2),U=L[0],P=L[1],W=Object(c.useState)({}),M=Object(m.a)(W,2),B=M[0],F=M[1],G=Object(c.useState)({title:"",banner:"",subTitle:"",code:" ",checked:!1}),V=Object(m.a)(G,2),Y=V[0],H=V[1];Object(c.useEffect)((function(){window.api.get("/admin/bonuses?query=".concat(x)).then((function(e){var t=e.records;return h(t)}))}),[x]);var q=function(e){var t=e.target,n=t.name,a=t.value;H((function(e){return Object(d.a)(Object(d.a)({},e),{},Object(_.a)({},n,a.trim()))}))};return Object(T.jsxs)("div",{className:"affiliate-link-container",children:[Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsxs)("div",{children:[Object(T.jsx)("h4",{children:"Create Link"}),Object(T.jsxs)("div",{className:"wrap-switch-affiliate",children:[Object(T.jsx)("p",{children:"Bonus default"}),Object(T.jsx)(vt.a,{checked:"default"!==a,onChange:function(e){l({}),r(e.target.checked?"custom":"default")},size:"medium"}),Object(T.jsx)("p",{children:"Custom default"})]})]}),Object(T.jsxs)("div",{className:"affiliate-link-flex",children:[Object(T.jsxs)("div",{children:[Object(T.jsx)("h4",{children:"Code (case insensitive , min 3 characters)"}),Object(T.jsx)("input",{placeholder:"Code",name:"code",value:Y.code,onChange:q})]}),"default"===a&&Object(T.jsxs)("div",{children:[Object(T.jsx)("h4",{children:"Add Bonus to Inventory (optional)"}),Object(T.jsx)(Ce.a,{name:"type",value:o,inputValue:x,onInputChange:function(e){return f(e)},onChange:function(e){return l(e)},options:b.map((function(e){return{label:"[".concat(e.id,"] ").concat(e.name),value:e.id}}))})]})]}),Object(T.jsxs)("div",{className:"affiliate-link-flex",children:[Object(T.jsxs)("div",{children:[Object(T.jsx)("h4",{children:"Choose layout landing"}),Object(T.jsx)(Ce.a,{name:"landing_page",value:y,onChange:function(e){var t=e.value;return E(t)},options:_c.map((function(e){return{label:e.label,value:e.value}}))})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("h4",{children:"Choose category"}),Object(T.jsx)(Ce.a,{name:"category",value:R,onChange:function(e){var t=e.value;return A(t)},options:mc.map((function(e){return{label:e,value:e}}))})]})]}),"custom"===a&&Object(T.jsxs)("div",{className:"affiliate-translate",children:[Object(T.jsxs)("div",{className:"container-input-affiliate-link ",children:[Object(T.jsx)("h4",{children:"Title (Header for affiliate page)"}),Object(T.jsx)("input",{placeholder:"Title",name:"title",onChange:q}),Object(T.jsx)(Pe,{languages:e.languages,contents:U,onChange:function(e){return P(e)},label:"Title"})]}),Object(T.jsxs)("div",{className:"container-input-affiliate-link ",children:[Object(T.jsx)("h4",{children:"SubTitle affiliate page "}),Object(T.jsx)("input",{placeholder:"Title",name:"subTitle",onChange:q}),Object(T.jsx)(Pe,{languages:e.languages,contents:I,onChange:function(e){return k(e)},label:"SubTitle"})]}),Object(T.jsxs)("div",{className:"container-input-affiliate-link ",children:[Object(T.jsx)("h4",{children:"Banner (Banner for affiliate page)"}),Object(T.jsx)("input",{placeholder:"Banner",name:"banner",onChange:q}),Object(T.jsx)(Pe,{languages:e.languages,contents:B,onChange:function(e){return F(e)},label:"Banner"})]})]}),Object(T.jsxs)("div",{style:{display:"flex"},children:[Object(T.jsx)("h4",{style:{marginRight:"20px"},children:"Complete Autocode"}),Object(T.jsx)("input",{style:{marginTop:"30px"},type:"checkbox",name:"checked",value:Y.code,onChange:function(){return H((function(e){return Object(d.a)(Object(d.a)({},e),{},{checked:!Y.checked})}))}})]})]}),Object(T.jsx)("button",{onClick:function(){var e=Y.banner,t=Y.code,n=Y.subTitle,a=Y.title,c=Y.checked,r={code:t,bonus_id:o.value,type:"".concat(y,"-").concat(R),title:a,bonus_title:n,banner:e,bonus_translation:I,title_translation:U,banner_translation:B,fill_code:c};window.api.post("/admin/affiliate_links",r).then((function(){return re.toast.success("Created")}))},children:"Submit"})]})})),fc=[{label:"Landing-1 with timer and reward",value:"landing1"},{label:"Landing-2 with form and reward",value:"landing2"},{label:"Landing-3 with form and timer",value:"landing3"},{label:"Landing-4 width large text",value:"landing4"}],vc=["crash","sports","casino","double","mines","tiger","neymar","aviator","fortunerabbit","fortuneox","neymarCasino","fortuneDouble","fortunedragon"],gc=Object(p.withRouter)((function(e){var t=e.match.params.id,n=Object(c.useState)(),a=Object(m.a)(n,2),r=a[0],s=a[1],i=Object(c.useState)(),o=Object(m.a)(i,2),l=o[0],u=o[1],j=Object(c.useState)(),b=Object(m.a)(j,2),h=b[0],p=b[1],O=Object(c.useState)([]),v=Object(m.a)(O,2),g=v[0],y=v[1],E=Object(c.useState)(),S=Object(m.a)(E,2),w=S[0],R=S[1],A=Object(c.useState)(),N=Object(m.a)(A,2),C=N[0],I=N[1],k=Object(c.useState)(),D=Object(m.a)(k,2),L=(D[0],D[1]),U=Object(c.useState)(!0),P=Object(m.a)(U,2),W=P[0],M=P[1],B=Object(c.useState)(),F=Object(m.a)(B,2),G=F[0],V=F[1],Y=Object(c.useState)({}),H=Object(m.a)(Y,2),q=H[0],K=H[1];Object(c.useEffect)((function(){var e=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var n,a,c,r,i;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.get("/admin/affiliate_links/".concat(t));case 3:n=e.sent,a=n.type,c=n.translate,r=n.bonus_id,i=n.title,s(n),u(a.split("-")[0]),p(a.split("-")[1]),V(r?"default":"custom"),K({value:r,label:i}),z(c),M(!1),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),re.toast.error(e.t0.message);case 17:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(){return e.apply(this,arguments)}}();e()}),[t]);var z=function(e){var t,n=0===Object.keys(e).length;n||(t=JSON.parse(e));var a=n?{}:t.title_translation,c=n?{}:t.bonus_translation,r=n?{}:t.banner_translation;R(c),I(a),L(r)};Object(c.useEffect)((function(){var e=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.get("/admin/bonuses");case 3:t=e.sent,n=t.records,y(n),(a=n.find((function(e){return e.id===r.bonus_id})))&&K({label:a.name,value:a.id}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),re.toast.error(e.t0.message);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}();r&&e()}),[r]);var X=function(e){var t=e.target,n=t.value,a=t.name;s(Object(d.a)(Object(d.a)({},r),{},Object(_.a)({},a,n)))};if(!r||W)return null;var Z=function(e){return"https://blaze.com/l/".concat(e)};return Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{children:[Object(T.jsxs)("label",{children:["Code : ",r.code]}),Object(T.jsxs)("div",{onClick:function(){return window.open(Z(r.code),"_blak")},children:["URL : ",Z(r.code)]})]}),Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{className:"wrap-switch-affiliate",children:[Object(T.jsx)("p",{children:"Default bonus "}),Object(T.jsx)(vt.a,{checked:"default"!==G,onChange:function(e){K({}),V(e.target.checked?"custom":"default")},size:"medium"}),Object(T.jsx)("p",{children:"Custom bonus"})]}),Object(T.jsxs)("div",{className:"update-affiliate-groups-select",children:["default"===G&&Object(T.jsxs)("div",{children:[Object(T.jsx)("h4",{children:"Add Bonus to Inventory (optional)"}),Object(T.jsx)(Ce.a,{name:"type",value:q,onChange:function(e){return K(e)},options:g.map((function(e){return{label:e.name,value:e.id}}))})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("h4",{children:"Layout Landing"}),Object(T.jsx)(Ce.a,{name:"landing_page",value:l,onChange:function(e){var t=e.value;return u(t)},options:fc.map((function(e){return{label:e.label,value:e.value}}))})]}),Object(T.jsxs)("div",{children:[Object(T.jsx)("h4",{children:"Category Landing"}),Object(T.jsx)(Ce.a,{name:"category",value:h,onChange:function(e){var t=e.value;return p(t)},options:vc.map((function(e){return{label:e,value:e}}))})]})]}),"custom"===G&&Object(T.jsx)(T.Fragment,{children:Object(T.jsxs)("div",{className:"update-affiliate-groups",children:[Object(T.jsxs)("div",{className:"update-affiliate-group-input",children:[Object(T.jsx)("label",{children:"Title"}),Object(T.jsx)("input",{name:"title",onChange:X,value:r.title})]}),Object(T.jsx)(Pe,{languages:[],contents:C,onChange:function(e){return I(e)},label:"Title"}),Object(T.jsxs)("div",{className:"update-affiliate-group-input",children:[Object(T.jsx)("label",{children:"Bonus title"}),Object(T.jsx)("input",{name:"bonus_title",onChange:X,value:r.bonus_title})]}),Object(T.jsx)(Pe,{languages:[],contents:w,onChange:function(e){return R(e)},label:"SubTitle"})]})})]})]})})),Tc=n(343),yc=n.n(Tc),Ec=n(342),Sc=n.n(Ec),wc={query:"",page:1,reportLoading:!1,total_pages:1,links:[]},Rc=function(){var e=Object(c.useState)(wc),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(wc.page),s=Object(m.a)(r,2),i=s[0],o=s[1];Object(c.useEffect)((function(){var e=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,c;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.get("/admin/affiliate_links?page=".concat(i));case 3:t=e.sent,n=t.records,c=t.meta,a({links:n,total_pages:c.total_pages}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),re.toast.error(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}();e()}),[i]);return Object(T.jsxs)("div",{children:[Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Created"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Code"}),Object(T.jsx)(we.Th,{children:"Options"})]})}),Object(T.jsx)(we.Tbody,{children:n.links.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.code}),Object(T.jsx)(we.Td,{children:Object(T.jsxs)("ul",{className:"affialiate-link-actions",children:[Object(T.jsx)("li",{children:Object(T.jsx)(l.b,{to:"/casino/affiliate-links/detail/".concat(e.code),children:Object(T.jsx)(Sc.a,{})})}),Object(T.jsx)("li",{children:Object(T.jsx)("button",{onClick:function(){return t=e.code,void window.api.delete("/admin/affiliate_links/".concat(t)).then((function(){re.toast.success("Link deleted"),a(Object(d.a)(Object(d.a)({},n),{},{links:n.links.filter((function(e){return e.code!==t}))}))})).catch((function(e){return re.toast.error(e.message)}));var t},className:"small",children:Object(T.jsx)(yc.a,{})})})]})})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:n.total_pages,update:function(e){o(e)}})]})},Ac={codes:[]},Nc=function(){var e=Object(c.useState)(Ac),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(""),s=Object(m.a)(r,2),i=s[0],o=s[1],l=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.get("/admin/cellxpert");case 3:t=e.sent,a({codes:t}),e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}();Object(c.useEffect)((function(){l()}),[]);var d=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n=arguments;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:"",e.prev=1,e.next=4,window.api.post("/admin/cellxpert",{code:t});case 4:e.sent,l(),e.next=10;break;case 8:e.prev=8,e.t0=e.catch(1);case 10:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();return Object(T.jsxs)("div",{children:[Object(T.jsx)("h3",{children:"Cellxpert Promo Codes"}),Object(T.jsxs)("div",{children:[Object(T.jsx)("input",{value:i,onChange:function(e){return o(e.target.value)}}),Object(T.jsx)("button",{onClick:function(){d(i)},disabled:i.length<=0,children:"Create"})]}),Object(T.jsx)("hr",{}),Object(T.jsx)("br",{}),Object(T.jsx)("div",{children:Object(T.jsx)("ul",{children:n.codes.map((function(e){var t=e.code;return Object(T.jsx)("li",{children:t},t)}))})})]})},Cc=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){return Object(T.jsxs)("div",{children:[Object(T.jsxs)("nav",{className:"sub-nav",children:[Object(T.jsx)(l.c,{exact:!0,to:"/casino/affiliate-links",children:"List"}),Object(T.jsx)(l.c,{exact:!0,to:"/casino/affiliate-links/new",children:"Create"}),Object(T.jsx)(l.c,{exact:!0,to:"/casino/affiliate-links/cellxpert",children:"Cellxpert"})]}),Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(p.Route,{exact:!0,path:"/casino/affiliate-links",component:Rc}),Object(T.jsx)(p.Route,{exact:!0,path:"/casino/affiliate-links/new",component:xc}),Object(T.jsx)(p.Route,{exact:!0,path:"/casino/affiliate-links/cellxpert",component:Nc}),Object(T.jsx)(p.Route,{exact:!0,path:"/casino/affiliate-links/detail/:id",component:gc})]})]})}}]),n}(c.Component),Ic=function(){return Object(T.jsx)(xe,{group:me.a.BIG_WINS,children:Object(T.jsx)(l.c,{to:"/casino/big-wins",children:"Big wins"})})},kc=function(){return Object(T.jsx)(xe,{group:me.a.SUPPORTED_CURRENCIES,children:Object(T.jsx)(l.c,{to:"/casino/currencies",children:"Supported currencies"})})},Dc=function(){return Object(T.jsx)(xe,{group:me.a.GAMES.GAME_PROVIDERS,children:Object(T.jsx)(l.c,{exact:!0,to:"/casino/game-providers",children:"Game Providers"})})},Lc=function(){return Object(T.jsx)(xe,{group:me.a.GAMES.GAME_CATEGORIES,children:Object(T.jsx)(l.c,{exact:!0,to:"/casino/game-categories",children:"Game Categories"})})},Uc=function(){return Object(T.jsx)(xe,{group:me.a.BETS.ONLY_GAMES,children:Object(T.jsx)(l.c,{exact:!0,to:"/casino/games",children:"Games"})})},Pc=function(){return Object(T.jsx)(xe,{group:me.a.REWARDS.GENERAL,children:Object(T.jsx)(l.c,{exact:!0,to:"/casino/rewards",children:"Rewards"})})},Wc=function(){return Object(T.jsx)(xe,{group:me.a.REWARDS.MYSTERY_BOXES,children:Object(T.jsx)(l.c,{to:"/casino/mystery-boxes",children:"Mystery Boxes"})})},Mc=function(){return Object(T.jsx)(xe,{group:me.a.REWARDS.REWARD_TIERS,children:Object(T.jsx)(l.c,{to:"/casino/reward-tiers",children:"Reward Tiers"})})},Bc=function(){return Object(T.jsx)(xe,{group:me.a.REWARDS.USER_RANKS,children:Object(T.jsx)(l.c,{to:"/casino/user-ranks",children:"User Ranks"})})},Fc=function(){return Object(T.jsx)(xe,{group:me.a.REWARDS.GLOBAL_XP,children:Object(T.jsx)(l.c,{to:"/casino/global-xp",children:"Global Xp"})})},Gc=function(){return Object(T.jsx)(xe,{group:me.a.REWARDS.PROMO_CODES,children:Object(T.jsx)(l.c,{to:"/casino/promo-codes",children:"Promo Codes"})})},Vc=function(){return Object(T.jsx)(xe,{group:me.a.REWARDS.BONUSES,children:Object(T.jsx)(l.c,{to:"/casino/bonuses",children:"Bonuses"})})},Yc=function(){return Object(T.jsx)(xe,{group:me.a.REWARDS.RACES,children:Object(T.jsx)(l.c,{to:"/casino/races",children:"Races"})})},Hc=function(){return Object(T.jsx)(xe,{group:me.a.REWARDS.CHALLENGES,children:Object(T.jsx)(l.c,{to:"/casino/challenges",children:"Challenges"})})},qc=function(){return Object(T.jsx)(xe,{group:me.a.REWARDS.LOYALTY,children:Object(T.jsx)(l.c,{to:"/casino/loyalty",children:"Loyalty"})})},Kc=function(){return Object(T.jsx)(xe,{group:me.a.MARKETING.AFFILIATE_LINKS,children:Object(T.jsx)(l.c,{to:"/casino/affiliate-links",children:"Affiliate Links"})})},zc=Object(ya.a)([function(e){return e.bigWins}],(function(e){return{bigWins:e.bigWins,loading:e.loading}})),Xc="BIG_WINS/LOADING_BIG_WINS",Zc="BIG_WINS/BIG_WINS_LOADED",Qc=function(e){var t=e.page,n=void 0===t?1:t,a=e.limit,c=void 0===a?50:a,r=e.userId,s=e.startDate,i=e.endDate,o=e.gameId,l=e.gameSlug;return function(e){e({type:Xc}),window.api.get("/big_wins",{params:{page:n,limit:c,userId:r,startDate:s,endDate:i,gameId:o,gameSlug:l}}).then((function(t){e({type:Zc,payload:t})})).catch((function(){return e({type:Zc,payload:[]})}))}},Jc=Object(c.forwardRef)((function(e,t){var n=e.value,a=e.onClick,c=n.split("-");return Object(T.jsxs)("div",{className:"input-calendar",onClick:a,ref:t,children:[Object(T.jsxs)("p",{children:[Object(T.jsx)("span",{children:"From"})," ",c[0].replaceAll("/","-")," ",Object(T.jsx)("span",{children:"To"})," ",c[1]?c[1].replaceAll("/","-"):"-"]}),Object(T.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Object(T.jsx)("path",{d:"M7.99998 11.4L4.29998 7.69998C3.91338 7.31338 3.91338 6.68658 4.29998 6.29998C4.68658 5.91338 5.31338 5.91338 5.69998 6.29998L7.99998 8.59998L10.3 6.29998C10.6866 5.91338 11.3134 5.91338 11.7 6.29998C12.0866 6.68658 12.0866 7.31338 11.7 7.69998L7.99998 11.4Z",fill:"#8C9099"})})]})})),$c=n(161),er=n.n($c),tr=(n(230),n(482),"Last24Hours"),nr="Last7Days",ar="Last30Days",cr="Last90Days",rr="FromJoinDate",sr="FromLastDeposit";function ir(e){var t,n=e.startDate,a=e.endDate,r=e.setStartDate,s=e.setEndDate,i=e.disableOPtionFromJoinDate,l=e.disableOPtionFromLastDeposit,d=Object(c.useState)(nr),u=Object(m.a)(d,2),j=u[0],b=u[1],h={background:"rgba(37, 47, 56, 0.5)",border:"1px solid #323b45"},p=function(e){return j===e?h:{}},O=Object(o.d)((function(e){return e.users.user})),x=O.created_at,f=O.last_deposit_occurred_at,v=(t={},Object(_.a)(t,tr,(function(){return Object(ye.utc)().subtract(1,"day").toDate()})),Object(_.a)(t,nr,(function(){return Object(ye.utc)().subtract(7,"day").toDate()})),Object(_.a)(t,ar,(function(){return Object(ye.utc)().subtract(30,"day").toDate()})),Object(_.a)(t,cr,(function(){return Object(ye.utc)().subtract(90,"day").toDate()})),Object(_.a)(t,sr,(function(){return Object(ye.utc)(f).toDate()})),Object(_.a)(t,rr,(function(){return Object(ye.utc)(x).toDate()})),t);Object(c.useEffect)((function(){r(v[j]),s(Object(ye.utc)().toDate())}),[j]);return Object(T.jsx)(er.a,{renderCustomHeader:function(e){var t=e.monthDate,n=e.customHeaderCount,a=e.decreaseMonth,c=e.increaseMonth;return Object(T.jsxs)("div",{children:[Object(T.jsx)("button",{"aria-label":"Previous Month",className:"react-datepicker__navigation react-datepicker__navigation--previous",style:1===n?{visibility:"hidden"}:{borderRadius:"50%",border:"1px solid #323B45",display:"flex",alignItems:"center",justifyContent:"center",left:"10px",top:"-2px"},onClick:a,children:Object(T.jsx)("span",{style:{left:"0px",top:"1px"},className:"react-datepicker__navigation-icon react-datepicker__navigation-icon--previous",children:"<"})}),Object(T.jsx)("span",{className:"react-datepicker__current-month",children:t.toLocaleString("en-US",{month:"long",year:"numeric"})}),Object(T.jsx)("button",{"aria-label":"Next Month",className:"react-datepicker__navigation react-datepicker__navigation--next",style:0===n?{visibility:"hidden"}:{borderRadius:"50%",border:"1px solid #323B45",display:"flex",alignItems:"center",justifyContent:"center",right:"10px",top:"-2px"},onClick:c,children:Object(T.jsx)("span",{style:{left:"0px",top:"1px"},className:"react-datepicker__navigation-icon react-datepicker__navigation-icon--next",children:">"})})]})},selected:n,onChange:function(e){var t=Object(m.a)(e,2),n=t[0],a=t[1];r(n),s(a)},calendarClassName:"calendar",monthsShown:2,startDate:n,endDate:a,selectsRange:!0,calendarContainer:function(e){var t=e.className,n=e.children;return Object(T.jsx)("div",{children:Object(T.jsx)($c.CalendarContainer,{className:t,children:Object(T.jsxs)("div",{className:"calendar-container",children:[Object(T.jsx)("div",{style:{position:"relative"},children:n}),Object(T.jsxs)("ul",{className:"calendar-presets",children:[Object(T.jsx)("li",{children:"Date Presets"}),Object(T.jsx)("li",{style:p(tr),onClick:function(){b(tr)},children:"Last 24 Hours"}),Object(T.jsx)("li",{style:p(nr),onClick:function(){b(nr)},children:"Last 7 Days"}),Object(T.jsx)("li",{style:p(ar),onClick:function(){b(ar)},children:"Last 30 Days"}),Object(T.jsx)("li",{style:p(cr),onClick:function(){b(cr)},children:"Last 90 Days"}),!i&&Object(T.jsx)("li",{style:p(rr),onClick:function(){b(rr)},children:"From Join Date"}),!l&&Object(T.jsx)("li",{style:p(sr),onClick:function(){b(sr)},children:"From Last Deposit"})]})]})})})},customInput:Object(T.jsx)(Jc,{}),dayClassName:function(e){var t=new Date(e),c=new Date(n),r=new Date(a),s=t.getDate(),i=c.getDate(),o=r.getDate(),l=t.getMonth(),d=c.getMonth(),u=r.getMonth();return s===i&&l===d?"start-range":s===o&&l===u?"end-range":void 0}})}var or=function(e){return/^[0-9.]+$/.test(e)},lr=function(){var e,t=Object(o.d)(zc),n=t.bigWins,a=t.loading,r=Object(o.c)(),s=Object(c.useState)(Ee()().subtract(7,"days").toDate()),i=Object(m.a)(s,2),d=i[0],u=i[1],j=Object(c.useState)(new Date),b=Object(m.a)(j,2),h=b[0],p=b[1],O=Object(c.useState)(null),_=Object(m.a)(O,2),x=_[0],f=_[1],v=Object(c.useState)(null),g=Object(m.a)(v,2),y=g[0],E=g[1],S=Object(c.useState)(null),w=Object(m.a)(S,2),R=w[0],A=w[1];Object(c.useEffect)((function(){N()}),[d,h]);var N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.page,n=void 0===t?1:t;r(Qc({page:n,limit:50,userId:x&&x||null,startDate:d,endDate:h,gameId:y,gameSlug:R}))};return Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{className:"filters-query",style:{display:"flex",flex:1,margin:"0 -10px 25px"},children:[Object(T.jsxs)("div",{className:"filter-query",children:[Object(T.jsx)("h5",{children:"Search by Time"}),Object(T.jsx)(ir,{startDate:d,setStartDate:u,endDate:h,setEndDate:p})]}),Object(T.jsxs)("div",{className:"filter-query",children:[Object(T.jsx)("h5",{children:"Search by user ID"}),Object(T.jsx)("input",{type:"text",id:"id",name:"id",onChange:function(e){return f(e.target.value)},onBlur:N,onKeyUp:function(e){if("Enter"===e.key&&N(),(t=e.target.value)&&!isNaN(t)&&t>0)var t;else e.preventDefault()}})]}),Object(T.jsxs)("div",{className:"filter-query",children:[Object(T.jsx)("h5",{children:"Search by game ID"}),Object(T.jsx)("input",{type:"text",id:"game_id",name:"game_id",onChange:function(e){return E(e.target.value)},onBlur:N,onKeyUp:function(e){"Enter"===e.key&&N()}})]}),Object(T.jsxs)("div",{className:"filter-query",children:[Object(T.jsx)("h5",{children:"Search by game slug"}),Object(T.jsx)("input",{type:"text",id:"game_slug",name:"game_slug",onChange:function(e){return A(e.target.value)},onBlur:N,onKeyUp:function(e){"Enter"===e.key&&N()}})]})]}),a&&Object(T.jsx)(T.Fragment,{children:"Loading..."}),!a&&Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Created at"}),Object(T.jsx)(we.Th,{children:"Game Slug"}),Object(T.jsx)(we.Th,{children:"Game provider round id"}),Object(T.jsx)(we.Th,{children:"User"}),Object(T.jsx)(we.Th,{children:"Wager amount"}),Object(T.jsx)(we.Th,{children:"Win amount"}),Object(T.jsx)(we.Th,{children:"Multiplier"})]})}),Object(T.jsx)(we.Tbody,{children:null===n||void 0===n||null===(e=n.records)||void 0===e?void 0:e.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:Se.withMinutes(e.created_at)})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:e.game_slug})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.game_provider_round_id),children:e.game_provider_round_id})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:Object(T.jsx)(l.b,{to:"/users/".concat(e.user_id,"/info"),children:e.username})})}),Object(T.jsx)(we.Td,{children:Object(T.jsxs)("span",{children:[e.wager_amount," ",e.currency_type]})}),Object(T.jsx)(we.Td,{children:Object(T.jsxs)("span",{children:[e.win_amount," ",e.currency_type]})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("span",{children:e.multiplier})})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:n.count/50,update:function(e){r(Qc({page:e}))}})]})},dr=(n(231),n(210)),ur=n.n(dr),jr={challenges:[{id:1,starts_at:"2023-05-16T13:10:00.000Z",game_id:null,name_preset:"\u20ac1000 Diamond Rank Reward",reward_id:"53",reward_manifest_id:null,min_multiplier:"23.00",eur_min_wagered:"13.0000",currency_rates:[{currency:"BRL",rate:1},{currency:"BTC",rate:19967418778886552e-21},{currency:"CAD",rate:1},{currency:"ETH",rate:.0002949126924819308},{currency:"EUR",rate:1},{currency:"LTC",rate:.007478140207860439},{currency:"TRX",rate:13.032070120678268},{currency:"GBP",rate:1}],status:"ongoing",signup_code:null,is_featured:!0,winning_user_id:null,created_at:"2023-05-16T13:08:56.671Z",expires_at:"2023-05-17T13:12:00.000Z",updated_at:"2023-05-16T13:08:56.671Z",deleted_at:null,reward_name:"\u20ac1000 Diamond Rank Reward",reward_type:"free_real_money",prize:"1000.0000",slug:null,image_url:null,game_name:null,full_count:"2"},{id:2,starts_at:"2023-05-16T13:15:00.000Z",game_id:"8000",name_preset:"\u20ac1000 Diamond Rank Reward",reward_id:"52",reward_manifest_id:null,min_multiplier:"3.00",eur_min_wagered:"1.0000",currency_rates:[{currency:"BRL",rate:1},{currency:"BTC",rate:19967418778886552e-21},{currency:"CAD",rate:1},{currency:"ETH",rate:.0002949126924819308},{currency:"EUR",rate:1},{currency:"LTC",rate:.007478140207860439},{currency:"TRX",rate:13.032070120678268},{currency:"GBP",rate:1}],status:"created",signup_code:null,is_featured:!1,winning_user_id:null,created_at:"2023-05-16T13:14:18.144Z",expires_at:"2023-05-26T13:14:00.000Z",updated_at:"2023-05-16T13:14:18.144Z",deleted_at:null,reward_name:"\u20ac250 Platinum Rank Reward",reward_type:"free_real_money",prize:"250.0000",slug:"mines",image_url:"/images/casino/mines.svg",game_name:"Mines",full_count:"2"}],total_count:2,total_pages:1},br=function(){function e(){Object(u.a)(this,e),this.client=null,this.baseURL="/api",this.mocked=jr;var t=w.a.create({baseURL:this.baseURL});t.interceptors.request.use((function(e){return e.headers.Authorization="Bearer ".concat(localStorage.getItem("access_token")),e.headers["X-RateLimit-Bypass"]="1",e})),this.client=t}return Object(j.a)(e,[{key:"getChallengeById",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.get("/admin/challenge/".concat(t));case 2:return n=e.sent,e.abrupt("return",n.data);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"deleteChallenge",value:function(e){return this.client.delete("/admin/challenge/".concat(e))}},{key:"createChallenge",value:function(e){return this.client.post("/admin/challenge",e).then((function(e){return e.data}))}},{key:"getPresets",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.client.get("/admin/challenges/preset").then((function(e){return e.data})));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getChallenges",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a,c,r,s,i=arguments;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:1,n=i.length>1?i[1]:void 0,a=i.length>2?i[2]:void 0,c="/admin/challenges?",r=!1,n&&(r=!0,c+="status=".concat(n)),t&&(r?c+="&page=".concat(t):(r=!0,c+="page=".concat(t))),a&&(r?c+="&sort_by=".concat(a):(r=!0,c+="sort_by=".concat(a))),e.next=10,this.client.get(c);case 10:return s=e.sent,e.abrupt("return",s.data);case 12:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),hr=new br,pr=function(e){var t=e.setCurrencyRates,n=e.currencyRates,a=e.disabled,r=Object(o.d)(Ea).currencies,s=Object(c.useState)(1),i=Object(m.a)(s,2),l=i[0],d=i[1],u=r.filter((function(e){return-1===n.indexOf(e.type)})).map((function(e){return e.type}));return Object(T.jsxs)("div",{className:"currency-rates-container",children:[Object(T.jsx)("h3",{children:"Currency rates"}),!a&&Object(T.jsx)("button",{type:"button",onClick:function(){t([].concat(Object(ct.a)(n),[{currency:u[0],rate:1}]))},className:"add-new-reward",disabled:0===u.length,children:"Add"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Currency"}),Object(T.jsx)(we.Th,{children:"Rate"}),!a&&Object(T.jsx)(we.Th,{children:"Delete"})]})}),Object(T.jsx)(we.Tbody,{children:n.map((function(e,c){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)("select",{disabled:a,onChange:function(e){var a=e.target.value,r=n.map((function(e,t){return t===c?{currency:a,rate:l}:e}));t(r)},children:u.concat([e.currency]).sort().map((function(t,n){return Object(T.jsx)("option",{value:t,selected:e.currency===t,children:t},n)}))})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("input",{disabled:a,onChange:function(e){var a=e.target.value,r=n.map((function(e,t){return t===c?{currency:e.currency,rate:a}:e}));d(a),t(r)},type:"number",value:e.rate||0})}),!a&&Object(T.jsx)(we.Td,{onClick:function(){console.log(c,n);var e=n.filter((function(e,t){return t!==c}));t(e)},children:"X"})]},e.currency+e.rate)}))})]})]})},Or=(n(524),function(e){var t=e.setFormData,n=e.setIsFeatured,a=Object(c.useState)([]),r=Object(m.a)(a,2),s=r[0],i=r[1],o=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,hr.getPresets();case 3:t=e.sent,n=t.challenge_presets,i(n),e.next=10;break;case 8:e.prev=8,e.t0=e.catch(0);case 10:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}();Object(c.useEffect)((function(){o()}),[]);var l=function(){var e=Object(f.a)(Object(x.a)().mark((function e(a){var c,r,s;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,hr.getChallengeById(a);case 3:c=e.sent,r=c.challenge,s={starts_at:r[0].created_at,expires_at:r[0].expires_at,min_multiplier:r[0].min_multiplier,reward_id:r[0].reward_id,game_id:r[0].game_id,eur_min_wagered:r[0].eur_min_wagered,currency_rates:r[0].currency_rates,name:r[0].name},n(r[0].is_featured),t(s),e.next=12;break;case 10:e.prev=10,e.t0=e.catch(0);case 12:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t){return e.apply(this,arguments)}}();return Object(T.jsxs)("div",{className:"column presetLoad",children:[Object(T.jsxs)("div",{className:"presetLoad__info",children:[Object(T.jsx)("p",{children:"You can load a preset challenge."}),Object(T.jsx)("p",{children:"This will load the challenge with the default values."})]}),Object(T.jsxs)("div",{className:"presetLoad__btn",children:[Object(T.jsxs)("select",{className:"presetLoad__select",onChange:function(e){return l(e.target.value)},children:[Object(T.jsx)("option",{value:"",disabled:!0,selected:!0,children:"Select a preset"}),s.map((function(e){return Object(T.jsx)("option",{value:e.id,children:e.name},e.id)}))]}),Object(T.jsx)("button",{onClick:function(){t({starts_at:"",expires_at:"",min_multiplier:"",reward_id:"",game_id:0,eur_min_wagered:1,currency_rates:[]})},children:"Clear preset"})]})]})}),_r=function(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"2-digit",hour12:!1,hourCycle:"h23"}).replace(" ","T").replace(",","").replace(/(\d+)\/(\d+)\/(\d+)/,"$3-$1-$2")},mr=Object(p.withRouter)(Object(o.b)((function(e){return{rewards:e.rewards.items.records}}),(function(e){return{updateRewards:function(){return e(Pn())}}}))((function(e){var t=e.rewards,n=e.updateRewards,a=Object(c.useState)(),r=Object(m.a)(a,2),s=r[0],i=r[1],o=Object(c.useState)(!1),l=Object(m.a)(o,2),u=l[0],j=l[1],b=Object(c.useState)([]),h=Object(m.a)(b,2),p=h[0],O=h[1],v=Object(c.useState)(!1),g=Object(m.a)(v,2),y=g[0],E=g[1],S=Object(c.useState)({starts_at:"",expires_at:"",min_multiplier:"",reward_id:"",game_id:0,eur_min_wagered:1,currency_rates:[],name:""}),w=Object(m.a)(S,2),R=w[0],A=w[1],N=Object(c.useRef)(null),C=Object(c.useCallback)(Jn.a.debounce(function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){var a,c,r,s,i;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,""!==t.get("reward_id")&&""!==t.get("min_multiplier")){e.next=5;break}re.toast.error("All the fields needs to completed"),e.next=12;break;case 5:return a=Object(d.a)(Object(d.a)({},t),{},{min_multiplier:t.get("min_multiplier"),reward_id:t.get("reward_id"),game_id:"0"===t.get("game_id")?null:t.get("game_id"),eur_min_wagered:t.get("eur_min_wagered"),starts_at:new Date(t.get("starts_at")).toISOString(),expires_at:new Date(t.get("expires_at")).toISOString(),currency_rates:n,is_featured:u,name:t.get("name"),isPreset:y}),y&&(a.name=t.get("name")),e.next=9,hr.createChallenge(a);case 9:c=e.sent,re.toast.success(null===c||void 0===c?void 0:c.message),setTimeout((function(){window.location.href="/casino/challenges"}),1e3);case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),re.toast.error(null===e.t0||void 0===e.t0||null===(r=e.t0.response)||void 0===r||null===(s=r.data)||void 0===s||null===(i=s.error)||void 0===i?void 0:i.message);case 17:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(t,n){return e.apply(this,arguments)}}(),500),[p,u,y]);var I=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.preventDefault(),n=new FormData(N.current),C(n,p);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),k=function(e){var t=e.target,n=t.name,a=t.value;A(Object(d.a)(Object(d.a)({},R),{},Object(_.a)({},n,a)))},D=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a,c;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get(ra);case 2:for(t=e.sent,n=[{label:"All games",value:0}],a=0;a<t.records.length;a++)c=t.records[a],n.push({label:c.name+" - "+c.slug,value:c.id});i(n);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(c.useEffect)((function(){n(),D()}),[n]);var L=R.game_id,U=R.expires_at,P=R.starts_at,W=R.min_multiplier,M=R.reward_id,B=R.eur_min_wagered;return Object(T.jsxs)("div",{className:"margin-left-form-challenge",children:[Object(T.jsx)(Or,{setFormData:A,setIsFeatured:j}),Object(T.jsxs)("form",{ref:N,onSubmit:I,className:"form-challenge",children:[Object(T.jsx)("div",{className:"row-challenge",children:Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("label",{htmlFor:"preset-save",children:" Save as preset (Optional)"}),Object(T.jsx)("input",{id:"preset-save",type:"checkbox",onChange:function(e){E(e.target.checked)}}),Object(T.jsxs)("div",{children:[Object(T.jsx)("h1",{className:"label-challenge",children:"Name ( This only for admin)"}),Object(T.jsx)("input",{type:"text",name:"name",value:R.name,placeholder:"Name",onChange:k})]})]})}),Object(T.jsxs)("div",{className:"row-challenge",children:[Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge ",children:"Start Date"}),Object(T.jsx)("input",{value:_r(P),name:"starts_at",type:"datetime-local",onChange:k})]}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge ",children:"Expires Date"}),Object(T.jsx)("input",{value:_r(U),name:"expires_at",type:"datetime-local",onChange:k})]}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge padding-left-challenge",children:"Multiplier"}),Object(T.jsx)("input",{type:"number",min:"0,1",name:"min_multiplier",value:W,placeholder:"Multiplier",onChange:k})]}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge padding-left-challenge",children:"Minimum Wagered (EUR)"}),Object(T.jsx)("input",{type:"number",name:"eur_min_wagered",value:B,onChange:k})]})]}),Object(T.jsx)("span",{className:"time-challenges"}),Object(T.jsxs)("div",{className:"row-challenge",children:[Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("label",{children:"Games"}),Object(T.jsx)(Ce.a,{name:"game_id",value:L,onChange:function(e){A(Object(d.a)(Object(d.a)({},R),{},{game_id:e.value}))},style:{width:"300px"},options:s})]}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("label",{children:"Reward"}),Object(T.jsx)(Ce.a,{name:"reward_id",value:M,onChange:function(e){A(Object(d.a)(Object(d.a)({},R),{},{reward_id:e.value}))},className:"rewardSelect",options:t.map((function(e){return{label:Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("img",{alt:"",style:{width:"30px"},src:e.image_url}),"(ID: $",e.id,") - $",e.name," (\u20ac $",e.eur_value,")"]}),value:e.id}}))})]}),Object(T.jsxs)("div",{className:"column featured-column",children:[Object(T.jsx)("label",{children:"Is featured?"}),Object(T.jsx)("input",{className:"featured-input",type:"checkbox",checked:u,onChange:function(e){j(e.target.checked)}})]})]}),Object(T.jsx)("div",{className:"row-challenge",children:Object(T.jsx)("div",{className:"column",children:Object(T.jsx)(pr,{currencyRates:p,setCurrencyRates:O,disabled:!1})})}),Object(T.jsx)("button",{type:"submit",className:"create-challenge-button",children:"Create Challenge"})]})]})}))),xr=(n(525),n(526),[{id:"",label:"all"},{id:"starts_at",label:"start date"},{id:"prize",label:"prize"},{id:"eur_min_wagered",label:"min wager"},{id:"min_multiplier",label:"min multiplier"}]),fr=function(e){var t=e.select,n=e.setSelect;return Object(T.jsx)("div",{className:"selectsort",children:Object(T.jsx)(Ce.a,{className:"selectsort__select",classNamePrefix:"selectsort__select",options:xr,value:xr.find((function(e){return e.id===t}))||xr[0],onChange:function(e){var t=e.id;n(t)},placeholder:"Sort by"})})},vr=(n(527),[{id:"",label:"all"},{id:"created",label:"created"},{id:"completed",label:"completed"},{id:"expired",label:"expired"},{id:"ongoing",label:"ongoing"},{id:"cancelled",label:"cancelled"}]),gr=function(e){var t=e.select,n=e.setSelect;return Object(T.jsx)("div",{className:"selectsort",children:Object(T.jsx)(Ce.a,{className:"selectsort__select",classNamePrefix:"selectsort__select",options:vr,value:vr.find((function(e){return e.id===t}))||vr[0],onChange:function(e){var t=e.id;n(t)},placeholder:"filter by status"})})},Tr=Object(p.withRouter)((function(e){var t=Object(c.useState)([]),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!0),i=Object(m.a)(s,2),o=i[0],d=i[1],u=Object(c.useState)(0),j=Object(m.a)(u,2),b=j[0],h=j[1],p=Object(c.useState)(1),O=Object(m.a)(p,2),_=O[0],v=O[1],g=Object(c.useState)(""),y=Object(m.a)(g,2),E=y[0],S=y[1],w=Object(c.useState)(""),R=Object(m.a)(w,2),A=R[0],N=R[1];Object(c.useEffect)((function(){C()}),[_,E,A]),Object(c.useEffect)((function(){v(1)}),[E,A]);var C=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hr.getChallenges(_,A,E);case 2:t=e.sent,n=t.challenges,a=t.total_pages,d(!1),r(n),h(a);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hr.deleteChallenge(t);case 2:return re.toast.success("The challenge ".concat(t," was deleted succesfully")),e.next=5,C(_);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{className:"box-selects",children:[Object(T.jsxs)("div",{className:"box-select",children:[Object(T.jsx)("h1",{className:"text-box-select",children:"Filter Status"}),Object(T.jsx)(gr,{select:A,setSelect:N})]}),Object(T.jsxs)("div",{className:"box-select",children:[Object(T.jsx)("h1",{className:"text-box-select",children:"Sort by"}),Object(T.jsx)(fr,{select:E,setSelect:S})]})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Challenge ID"}),Object(T.jsx)(we.Th,{children:"Start Date"}),Object(T.jsx)(we.Th,{children:"Expires Date"}),Object(T.jsx)(we.Th,{children:"Multiplier"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Winning user id"}),Object(T.jsx)(we.Th,{children:"Reward Name"}),Object(T.jsx)(we.Th,{children:"Game Name"}),Object(T.jsx)(we.Th,{children:"Eur Minimum Wager"}),Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Options"})]})}),o&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Fetching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsx)(we.Tbody,{className:"referrals-body",children:null===a||void 0===a?void 0:a.map((function(t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:t.id}),Object(T.jsx)(we.Td,{children:new Date(t.starts_at).toLocaleString()}),Object(T.jsx)(we.Td,{children:new Date(t.expires_at).toLocaleString()}),Object(T.jsx)(we.Td,{children:t.min_multiplier}),Object(T.jsx)(we.Td,{children:t.status}),Object(T.jsx)(we.Td,{onClick:function(){},children:Object(T.jsx)(l.b,{to:"/users/".concat(t.winning_user_id,"/info"),children:t.winning_user_id||"-"})}),Object(T.jsx)(we.Td,{children:t.reward_name}),Object(T.jsx)(we.Td,{children:null===t.game_name?"any game":t.game_name}),Object(T.jsx)(we.Td,{children:t.eur_min_wagered}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(t.round_id),children:t.round_id||"-"})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("button",{onClick:function(){e.history.push("/casino/challenge/view/".concat(t.id))},children:"View"})}),Object(T.jsx)(we.Td,{children:("ongoing"===t.status||"created"===t.status)&&Object(T.jsx)("button",{onClick:function(){return I(t.id)},children:"Cancel"})})]},t.id)}))})]}),Object(T.jsxs)("div",{className:"pagination",children:[Object(T.jsx)("button",{className:"btn-pagination",onClick:function(){return v(_-1)},disabled:1===_,children:Object(T.jsx)("span",{children:"<"})}),Object(T.jsxs)("div",{className:"pagination_page",children:["Page ",_," of ",b]}),Object(T.jsx)("button",{className:"btn-pagination",onClick:function(){return v(_+1)},disabled:_>=b,children:Object(T.jsx)("span",{children:">"})})]})]})})),yr=Object(p.withRouter)((function(){var e=Object(c.useState)("ListChallenges"),t=Object(m.a)(e,2),n=t[0],a=t[1];return Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{className:ur.a.tabbedNav,children:[Object(T.jsx)("div",{className:"ListChallenges"===n?ur.a.selected:void 0,onClick:function(){a("ListChallenges")},children:"List Challenges"}),Object(T.jsx)("div",{className:"createChallenge"===n?ur.a.selected:void 0,onClick:function(){a("createChallenge")},children:"Create Challenge"})]}),"ListChallenges"===n&&Object(T.jsx)(Tr,{}),"createChallenge"===n&&Object(T.jsx)(mr,{})]})})),Er=function(){var e=Object(c.useState)(),t=Object(m.a)(e,2),n=t[0],a=t[1],r=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,c,r;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.get(ra);case 2:for(t=e.sent,n=[],c=0;c<t.records.length;c++)r=t.records[c],n.push({label:r.name,value:r.id});a(n);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(c.useEffect)((function(){r()}),[]),[n,a]},Sr=function(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"2-digit",hour12:!1,hourCycle:"h23"}).replace(" ","T").replace(",","").replace(/(\d+)\/(\d+)\/(\d+)/,"$3-$1-$2")},wr=Object(p.withRouter)(Object(o.b)((function(e){return{rewards:e.rewards.items.records}}),(function(e){return{updateRewards:function(){return e(Pn())}}}))((function(e){var t=e.rewards,n=e.history,a=e.updateRewards,r=Object(c.useState)(),s=Object(m.a)(r,2),i=s[0],o=s[1],l=Object(c.useState)(),u=Object(m.a)(l,2),j=u[0],b=u[1],h=Object(c.useState)(!0),O=Object(m.a)(h,2),v=O[0],g=O[1],y=Object(p.useParams)().id,E=Er(),S=Object(m.a)(E,1)[0],w=Object(c.useCallback)(Object(f.a)(Object(x.a)().mark((function e(){var t,n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hr.getChallengeById(y);case 2:t=e.sent,n=t.challenge,b(Object(d.a)({},n[0])),o(n[0].currency_rates),g(!1);case 7:case"end":return e.stop()}}),e)}))),[y]);Object(c.useEffect)((function(){w()}),[w]),Object(c.useEffect)((function(){a()}),[a]);var R=function(e){var t=e.target,n=t.name,a=t.value;b(Object(d.a)(Object(d.a)({},j),{},Object(_.a)({},n,a)))};if(v)return Object(T.jsx)("h1",{children:"... Loading"});var A=j.game_id,N=j.expires_at,C=j.starts_at,I=j.min_multiplier,k=j.reward_id,D=j.eur_min_wagered,L=j.is_featured;return Object(T.jsxs)("div",{className:"margin-left-form-challenge",children:[Object(T.jsx)("h1",{children:"Challenge Details"}),Object(T.jsxs)("form",{className:"form-challenge",children:[Object(T.jsxs)("div",{className:"row-challenge",children:[Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge ",children:"Start Date"}),Object(T.jsx)("input",{value:Sr(C),name:"starts_at",type:"datetime-local",disabled:!0,onChange:R})]}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge ",children:"Expires Date"}),Object(T.jsx)("input",{value:Sr(N),name:"expires_at",disabled:!0,type:"datetime-local",onChange:R})]}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge padding-left-challenge",children:"Multiplier"}),Object(T.jsx)("input",{name:"min_multiplier",value:I,disabled:!0,placeholder:"Multiplier",onChange:R})]}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge padding-left-challenge",children:"Minimum Wagered (EUR)"}),Object(T.jsx)("input",{type:"number",disabled:!0,name:"eur_min_wagered",value:D,onChange:R})]})]}),Object(T.jsx)("span",{className:"time-challenges"}),Object(T.jsxs)("div",{className:"row-challenge",children:[Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("label",{children:"Games"}),Object(T.jsx)(Ce.a,{name:"game_id",disabled:!0,value:A,style:{width:"300px"},onChange:function(e){b(Object(d.a)(Object(d.a)({},j),{},{game_id:e.value}))},options:S})]}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("label",{children:"Reward"}),Object(T.jsx)(Ce.a,{name:"reward_id",disabled:!0,value:k,onChange:function(e){b(Object(d.a)(Object(d.a)({},j),{},{reward_id:e.value}))},className:"rewardSelect",options:t.map((function(e){return{label:Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("img",{style:{width:"30px"},src:e.image_url}),"(ID: $",e.id,") - $",e.name," (\u20ac $",e.eur_value,")"]}),value:e.id}}))})]}),Object(T.jsxs)("div",{className:"column featured-column",children:[Object(T.jsx)("label",{children:"Is featured?"}),Object(T.jsx)("input",{className:"featured-input",type:"checkbox",disabled:!0,checked:L})]})]}),Object(T.jsx)("div",{className:"row-challenge",children:Object(T.jsx)("div",{className:"column",children:Object(T.jsx)(pr,{currencyRates:i,setCurrencyRates:o,disabled:!0})})}),Object(T.jsx)("button",{onClick:function(){n.push("/casino/challenges")},className:"create-challenge-button",children:"Back"})]})]})}))),Rr=n(211),Ar=n.n(Rr),Nr=Object(p.withRouter)(Object(o.b)((function(e){return{rewards:e.rewards.items.records}}),(function(e){return{updateRewards:function(){return e(Pn())}}}))((function(e){var t=Object(c.useRef)(null),n=e.match.params.id,a=Object(c.useState)(),r=Object(m.a)(a,2),s=r[0],i=r[1],o=Object(c.useState)(!1),l=Object(m.a)(o,2),u=l[0],j=l[1],b=Object(c.useState)({name:"",starts_at:"",game_id:0,duration:0,total_race_prize:0,currency_rates:[],name_translation:{},recurring:0,games:[]}),h=Object(m.a)(b,2),p=h[0],O=h[1];var v=function(e){var t=e.target,n=t.name,a=t.value;O(Object(d.a)(Object(d.a)({},p),{},Object(_.a)({},n,a)))},g=Object(c.useCallback)(Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ta.getRaceById(n);case 3:t=e.sent,O(Object(d.a)(Object(d.a)({},t),{},{recurring:null===t||void 0===t?void 0:t.recurring_frequency})),j("0"!==(null===t||void 0===t?void 0:t.recurring_frequency)&&!0),e.next=10;break;case 8:e.prev=8,e.t0=e.catch(0);case 10:case"end":return e.stop()}}),e,null,[[0,8]])}))),[n]);Object(c.useEffect)((function(){var e=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.get(ra);case 3:return t=e.sent,e.abrupt("return",t.records);case 7:return e.prev=7,e.t0=e.catch(0),console.error("Error fetching games:",e.t0),e.abrupt("return",[]);case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),t=function(e){return{label:"".concat(e.name," - ").concat(e.slug),value:e.id}},n=function(){var n=Object(f.a)(Object(x.a)().mark((function n(){var a,c;return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e();case 3:a=n.sent,c=[{label:"All games",value:0}].concat(Object(ct.a)(a.map(t))),i(c),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),console.error("Error processing games:",n.t0);case 11:case"end":return n.stop()}}),n,null,[[0,8]])})));return function(){return n.apply(this,arguments)}}();n(),g()}),[g]);var y,E=p.name,S=p.game_id,w=p.duration,R=p.recurring,A=p.starts_at,N=p.eur_prize,C=(p.currency_rates,p.name_translation),I=p.games;return Object(T.jsx)("div",{className:"margin-left-form-challenge",children:Object(T.jsxs)("form",{ref:t,className:"form-challenge",children:[Object(T.jsxs)("div",{className:"row-challenge",children:[Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge ",children:"Name"}),Object(T.jsx)("input",{value:E,name:"name",onChange:v,disabled:!0})]})]}),Object(T.jsxs)("div",{className:"row-challenge",children:[Object(T.jsx)("hr",{}),Object(T.jsx)("div",{className:"column",children:Object(T.jsx)("h1",{className:"label-challenge ",children:"Translations"})})]}),C&&Object.entries(C).map((function(e){var t=Object(m.a)(e,2),n=t[0],a=t[1];return Object(T.jsxs)("div",{className:"row-challenge",children:[Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge",children:n}),Object(T.jsx)("input",{value:a,name:"name",onChange:v,disabled:!0})]})]},n)})),Object(T.jsxs)("div",{className:"row-challenge",children:[Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge ",children:"Start Date"}),Object(T.jsx)("input",{disabled:!0,value:(y=A,new Date(y).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"numeric",minute:"2-digit",hour12:!1,hourCycle:"h23"}).replace(" ","T").replace(",","").replace(/(\d+)\/(\d+)\/(\d+)/,"$3-$1-$2")),name:"starts_at",type:"datetime-local",onChange:v})]}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("h1",{className:"label-challenge ",children:"Duration"}),Object(T.jsx)(Ce.a,{disabled:!0,name:"duration",value:w,onChange:function(e){O(Object(d.a)(Object(d.a)({},p),{},{duration:e.value}))},style:{width:"300px"},options:aa})]}),Object(T.jsxs)("div",{className:"column",children:[Object(T.jsxs)("div",{className:"recurring-check-label",children:[Object(T.jsx)("h1",{className:"label-challenge ",children:"Recurring"}),Object(T.jsx)("input",{disabled:!0,className:"featured-input",type:"checkbox",checked:u,onChange:function(e){j(e.target.checked)}})]}),u&&Object(T.jsx)(Ce.a,{disabled:!0,name:"recurring",value:R,onChange:function(e){O(Object(d.a)(Object(d.a)({},p),{},{recurring:e.value}))},style:{width:"300px"},options:ca})]})]}),Object(T.jsx)("span",{className:"time-challenges"}),Object(T.jsxs)("div",{className:"row-challenge",children:[Object(T.jsxs)("div",{className:"column",children:[Object(T.jsx)("label",{children:"Games"}),Object(T.jsx)(Ce.a,{disabled:!0,name:"game_id",value:S,onChange:function(e){O(Object(d.a)(Object(d.a)({},p),{},{game_id:e.value}))},style:{width:"300px"},options:s})]}),Object(T.jsxs)("div",{className:"column totalprize-box",children:[Object(T.jsx)("label",{children:"Total Race Prize"}),Object(T.jsx)("input",{disabled:!0,value:N,name:"total_race_prize",onChange:v})]})]}),Object(T.jsxs)("div",{className:"selected-games-container",children:[Object(T.jsx)("h2",{children:"Selected Games"}),s&&I.map((function(e,t){return Object(T.jsx)("div",{children:Object(T.jsxs)("p",{children:[t+1+")"," ",e.name," - ",e.slug]})},t)}))]})]})})}))),Cr=Object(p.withRouter)((function(e){var t=e.match.params.id,n=Object(c.useState)(),a=Object(m.a)(n,2),s=a[0],i=a[1],o=Object(c.useCallback)(Object(f.a)(Object(x.a)().mark((function e(){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ta.getRaceIterationsById(t);case 3:n=e.sent,i(n),e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])}))),[t]);return Object(c.useEffect)((function(){o()}),[o]),Object(T.jsxs)(r.a.Fragment,{children:[Object(T.jsx)("div",{className:"box-selects"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Current Iteration"}),Object(T.jsx)(we.Th,{children:"Start Date"}),Object(T.jsx)(we.Th,{children:"End Date"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Options"})]})}),Object(T.jsx)(we.Tbody,{className:"referrals-body",children:null===s||void 0===s?void 0:s.map((function(t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:t.iteration}),Object(T.jsxs)(we.Td,{children:[" ",new Date(t.current_iteration_start_date).toLocaleString()]}),Object(T.jsx)(we.Td,{children:new Date(t.current_iteration_end_date).toLocaleString()}),Object(T.jsx)(we.Td,{children:t.status}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("div",{style:{display:"flex"},children:Object(T.jsx)("div",{children:Object(T.jsx)("button",{onClick:function(){e.history.push("/casino/race/iterations/winners/".concat(t.id))},children:"winners"})})})})]},t.id)}))})]})]})})),Ir=Object(p.withRouter)((function(e){var t=Object(c.useState)("detail"),n=Object(m.a)(t,2),a=n[0],r=n[1],s=e.match.params.id,i=e.history,o=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ta.cancellRaceIterations(s);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(T.jsxs)(T.Fragment,{children:[Object(T.jsxs)("div",{children:[Object(T.jsxs)("h1",{style:{fontSize:"22px",marginLeft:"20px"},children:["Race #",s]}),Object(T.jsxs)("div",{className:Ar.a.tabbedNav,children:[Object(T.jsx)("div",{className:"detail"===a?Ar.a.selected:void 0,onClick:function(){r("detail")},children:"Detail"}),Object(T.jsx)("div",{className:"iteration"===a?Ar.a.selected:void 0,onClick:function(){r("iteration")},children:"Iteration"})]}),"detail"===a&&Object(T.jsx)(Nr,{}),"iteration"===a&&Object(T.jsx)(Cr,{})]}),Object(T.jsx)("button",{onClick:function(){i.push("/casino/races")},style:{marginTop:"20px",marginLeft:"50px"},children:"back"}),Object(T.jsx)("button",{onClick:function(){o()},style:{marginTop:"20px",marginLeft:"50px"},children:"Cancell Active Iterations"})]})})),kr=Object(p.withRouter)((function(e){var t=e.match.params.iteration,n=Object(c.useState)(),a=Object(m.a)(n,2),r=a[0],s=a[1],i=Object(c.useState)([]),o=Object(m.a)(i,2),l=o[0],d=o[1],u=Object(c.useCallback)(Object(f.a)(Object(x.a)().mark((function e(){var n,a,c,r;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all([ta.getRaceIterationsWinnerById(t),ta.getRaceIterationStatsById(t)]);case 3:n=e.sent,a=Object(m.a)(n,2),c=a[0],r=a[1],s(c),d(r),e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,null,[[0,11]])}))),[t]);Object(c.useEffect)((function(){u()}),[u]);var j=Object(c.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null===l||void 0===l?void 0:l.find((function(t){return t.key===e}));return null!==n&&void 0!==n&&n.value?Number(n.value).toFixed(2):t}),[t]);return Object(T.jsxs)("div",{children:[Object(T.jsx)("div",{className:"row-challenge between",children:Object(T.jsxs)("div",{className:"amount-deviation-container",children:[Object(T.jsx)("span",{children:"Deviation Amount Wagered"}),Object(T.jsxs)("span",{className:"amount-deviation",children:[j(na),"%"]})]})}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Position"}),Object(T.jsx)(we.Th,{children:"Username"}),Object(T.jsx)(we.Th,{children:"Prize"}),Object(T.jsx)(we.Th,{children:"Paid"}),Object(T.jsx)(we.Th,{children:"Pos. by wagered"}),Object(T.jsx)(we.Th,{children:"Refunds"}),Object(T.jsx)(we.Th,{children:"Amount Refund"})]})}),Object(T.jsx)(we.Tbody,{className:"referrals-body",children:null===r||void 0===r?void 0:r.map((function(e){var t,n;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.position}),Object(T.jsx)(we.Td,{children:e.username}),Object(T.jsx)(we.Td,{children:e.eur_prize}),Object(T.jsx)(we.Td,{children:e.paid?"true":"false"}),Object(T.jsx)(we.Td,{className:"text-center pr-30",children:null!==(t=e.position_by_race_wagered)&&void 0!==t?t:"-"}),Object(T.jsx)(we.Td,{className:"text-center pr-30",children:null!==(n=e.quantity_bets_refunded)&&void 0!==n?n:"-"}),Object(T.jsx)(we.Td,{className:"text-center pr-30",children:e.amount_bets_refunded?Number(e.amount_bets_refunded).toFixed(2):"-"})]},e.id)}))})]}),Object(T.jsx)("button",{onClick:function(){return window.history.back()},children:"Back"})]})})),Dr=[{code:"GBP",name:"British Pound"},{code:"NOK",name:"Norwegian Krone"},{code:"SEK",name:"Swedish Krona"},{code:"CAD",name:"Canadian Dollar"},{code:"NZD",name:"New Zealand Dollar"},{code:"AUD",name:"Australian Dollar"},{code:"JPY",name:"Japanese Yen"},{code:"CNY",name:"Chinese Yuan"},{code:"RUB",name:"Russian Ruble"},{code:"USD",name:"United States Dollar"},{code:"TRY",name:"Turkish Lira"},{code:"EUR",name:"Euro"},{code:"mBTC",name:"MilliBitcoin"},{code:"BTC",name:"Bitcoin"},{code:"IDR",name:"Indonesian Rupiah"},{code:"MYR",name:"Malaysian Ringgit"},{code:"THB",name:"Thai Baht"},{code:"VND",name:"Vietnamese Dong"},{code:"BRL",name:"Brazilian Real"},{code:"ARS",name:"Argentine Peso"},{code:"UYU",name:"Uruguayan Peso"},{code:"MXN",name:"Mexican Peso"},{code:"PEN",name:"Peruvian Sol"},{code:"CLP",name:"Chilean Peso"},{code:"COP",name:"Colombian Peso"},{code:"PLN",name:"Polish Z\u0142oty"},{code:"UAH",name:"Ukrainian Hryvnia"}],Lr=Object(p.withRouter)((function(){return Object(T.jsxs)("div",{children:[Object(T.jsx)("div",{className:"box-selects",children:Object(T.jsx)("h1",{className:"text-box-select",children:"Currencies Supported"})}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Symbol"}),Object(T.jsx)(we.Th,{children:"Description"})]})}),Object(T.jsx)(we.Tbody,{className:"referrals-body",children:null===Dr||void 0===Dr?void 0:Dr.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.code}),Object(T.jsx)(we.Td,{children:e.name})]},e.code)}))})]})]})})),Ur=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){return Object(T.jsxs)("div",{className:"page",style:{padding:0},children:[Object(T.jsx)(O.BrowserView,{children:Object(T.jsxs)("nav",{children:[Object(T.jsx)(Kc,{}),Object(T.jsx)(Vc,{}),Object(T.jsx)(Lc,{}),Object(T.jsx)(Dc,{}),Object(T.jsx)(Uc,{}),Object(T.jsx)(Fc,{}),Object(T.jsx)(qc,{}),Object(T.jsx)(Wc,{}),Object(T.jsx)(Gc,{}),Object(T.jsx)(Yc,{}),Object(T.jsx)(Hc,{}),Object(T.jsx)(Pc,{}),Object(T.jsx)(Mc,{}),Object(T.jsx)(Bc,{}),Object(T.jsx)(Ic,{}),Object(T.jsx)(kc,{})]})}),Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(ge,{group:me.a.BETS,path:"/casino/game-provider-rounds/:id",component:Oc}),Object(T.jsx)(ge,{group:me.a.BETS.GAMES,path:"/casino/games/:slug",component:vn}),Object(T.jsx)(ge,{group:me.a.BETS.GAMES,path:"/casino/games",component:On}),Object(T.jsx)(ge,{group:me.a.BETS.GAMES,path:"/casino/game-providers/:slug",component:Ja}),Object(T.jsx)(ge,{group:me.a.GAMES.GAME_PROVIDERS,path:"/casino/game-providers",component:Tn}),Object(T.jsx)(ge,{group:me.a.BETS.GAMES,path:"/casino/game-categories",component:ic}),Object(T.jsx)(ge,{group:me.a.REWARDS.GENERAL,exact:!0,path:"/casino/rewards",component:ka}),Object(T.jsx)(ge,{group:me.a.REWARDS.LOYALTY,path:"/casino/loyalty",component:yn}),Object(T.jsx)(ge,{group:me.a.REWARDS.BONUSES,path:"/casino/bonuses",component:zn}),Object(T.jsx)(ge,{group:me.a.REWARDS.RACES,path:"/casino/races",component:da}),Object(T.jsx)(ge,{group:me.a.REWARDS.RACES,path:"/casino/race/view/:id",component:Ir}),Object(T.jsx)(ge,{group:me.a.REWARDS.RACES,path:"/casino/race/iterations/winners/:iteration",component:kr}),Object(T.jsx)(ge,{group:me.a.REWARDS.CHALLENGES,path:"/casino/challenges",component:yr}),Object(T.jsx)(ge,{group:me.a.REWARDS.CHALLENGES,path:"/casino/challenge/view/:id",component:wr}),Object(T.jsx)(ge,{group:me.a.REWARDS.PROMO_CODES,path:"/casino/promo-codes",component:Ta}),Object(T.jsx)(ge,{group:me.a.REWARDS.MYSTERY_BOXES,exact:!0,path:"/casino/mystery-boxes",component:La}),Object(T.jsx)(ge,{group:me.a.REWARDS.MYSTERY_BOXES,path:"/casino/mystery-boxes/:id",component:Pa}),Object(T.jsx)(ge,{group:me.a.REWARDS.REWARD_TIERS,path:"/casino/reward-tiers",component:Ba}),Object(T.jsx)(ge,{group:me.a.REWARDS.USER_RANKS,path:"/casino/user-ranks",component:Ga}),Object(T.jsx)(ge,{group:me.a.REWARDS.GLOBAL_XP,path:"/casino/global-xp",component:Ya}),Object(T.jsx)(ge,{group:me.a.MARKETING.AFFILIATE_LINKS,path:"/casino/affiliate-links",component:Cc}),Object(T.jsx)(ge,{group:me.a.BIG_WINS,path:"/casino/big-wins",component:lr}),Object(T.jsx)(ge,{group:me.a.SUPPORTED_CURRENCIES,path:"/casino/currencies",component:Lr}),Object(T.jsx)(ge,{group:me.a.REWARDS,path:"/casino/:id",component:qa})]})]})}}]),n}(c.Component),Pr="users/SEARCH_UPDATE",Wr="users/USER_UPDATE",Mr="users/USER_OFFERS_UPDATE",Br="users/USER_FINGERPRINTS_UPDATE",Fr="users/USER_DEPOSITS_UPDATE",Gr="users/USER_WITHDRAWALS_DOWNLOADING_REPORT",Vr="users/USER_WITHDRAWALS_DOWNLOADED_REPORT",Yr="users/USER_WITHDRAWALS_UPDATE",Hr="users/USER_DOCUMENTS_UPDATE",qr="users/USER_DOCUMENT_UPDATE",Kr="users/ANTI_FRAUD/UPDATE",zr="users/NOTES/UPDATE",Xr="user/PAYMENT/ACCOUNTS/UPDATE",Zr="users/USER_VERIFICATION_DOCUMENT_UPDATE",Qr="users/BONUS_ROUNDS/UPDATE",Jr="user/REFERRALS/UPDATE",$r="user/UPDATE/LOADING",es="users/USER_OTP_FINGERPRINTS_UPDATE",ts="user/SELECT_CURRENCY",ns=function(e){return{type:ts,payload:e}},as=function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){var c,r,s,i,o,l,u,j,b;return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a({type:$r,payload:!0}),c="",t&&(c+="?email_request_confirmed=1"),r=[],s=window.api.get("/admin/users/"+e+c),r.push(s),(window.permissions.includes("USER_DEPOSITS_VIEW_LIST")||ie.USER_DEPOSITS_VIEW_LIST.find((function(e){return window.roles.includes(e)})))&&(i=window.api.get("/admin/users/"+e+"/deposits?page=1").then((function(e){return e.records.filter((function(e){return"complete"===e.status}))})).then((function(e){return e.length>0?e[0].created_at:Object(ye.utc)(0).toISOString()})),r.push(i)),n.next=9,Promise.all(r);case 9:o=n.sent,l=Object(m.a)(o,2),u=l[0],j=l[1],b=u.wallets.find((function(e){return e.primary})),a(ns(b.currency_type)),a({type:Wr,payload:Object(d.a)(Object(d.a)({},u),{},{currency_types:u.wallets.reduce((function(e,t){return-1===e.findIndex((function(e){return e===t.currency_type}))?[].concat(Object(ct.a)(e),[t.currency_type]):e}),[]).sort((function(e,t){return t.primary-e.primary})),wallets:u.wallets.map((function(e){return Object(d.a)(Object(d.a)({},e),{},{deposit_currency_type:e.deposit_currency_type||e.currency_type})})),last_deposit_occurred_at:j})});case 16:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()},cs=function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a,c,r,s,i;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([window.api.get("/admin/users/"+e+"/bonus_inventory"),window.api.get("/admin/users/"+e+"/consumed_bonuses")]);case 2:a=t.sent,c=Object(m.a)(a,2),r=c[0],s=void 0===r?[]:r,i=c[1],n({type:Wr,payload:{bonus_inventory:s,consumed_bonuses:void 0===i?[]:i}});case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},rs=function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){var c;return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.get("/admin/users/"+e+"/notes",{params:{page:t}});case 2:c=n.sent,a({type:zr,payload:c});case 4:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()},ss=function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.get("/admin/users/"+e+"/documents");case 2:a=t.sent,n({type:Hr,payload:a});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},is=function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){var c,r,s,i,o;return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return c=t.original_name,r=c.slice(c.lastIndexOf(".")+1).toLowerCase(),n.next=4,window.api.get("/admin/users/"+e+"/documents/"+t.id,{responseType:"blob"});case 4:t=n.sent,"pdf"===r?(s=new Blob([t],{type:"application/pdf"}),i=window.URL.createObjectURL(s),a({type:qr,payload:{data:i,type:"pdf"}})):((o=new window.FileReader).readAsDataURL(t),o.onload=function(){a({type:qr,payload:{data:o.result,type:"image"}})});case 6:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()},os=function(e){var t=e.user_id,n=e.duration,a=e.reason,c=e.note,r=e.cancel;return function(){var e=Object(f.a)(Object(x.a)().mark((function e(s){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=5;break}return e.next=3,window.api.put("/admin/users/"+t+"/suspension/cancel");case 3:e.next=7;break;case 5:return e.next=7,window.api.post("/admin/users/"+t+"/suspension",{duration:n,note:c,reason:a});case 7:return e.abrupt("return",s(as(t)));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},ls=function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.get("/admin/users/"+e+"/payment_accounts");case 2:return a=t.sent,t.abrupt("return",n({type:Xr,payload:a}));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},ds=function(e,t,n,a){return function(){var c=Object(f.a)(Object(x.a)().mark((function c(r){return Object(x.a)().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,window.api.post("/admin/users/"+e+"/kyc_verifications/create",{type:t,masked_account:n,deposit_id:a});case 2:return c.abrupt("return",r(as(e)));case 3:case"end":return c.stop()}}),c)})));return function(e){return c.apply(this,arguments)}}()},us=function(e,t,n){return function(){var a=Object(f.a)(Object(x.a)().mark((function a(c){return Object(x.a)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,window.api.post("/admin/kyc_verifications/update",{verification_id:e,status:t});case 2:if(!n){a.next=4;break}return a.abrupt("return",c(as(n)));case 4:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()},js=function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.post("/admin/users/".concat(e,"/kyc_verifications/notify"),t);case 2:if(!e){n.next=4;break}return n.abrupt("return",a(as(e)));case 4:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()},bs=function(e,t,n){return function(){var a=Object(f.a)(Object(x.a)().mark((function a(c){return Object(x.a)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,window.api.put("/admin/users/".concat(e,"/close_account"),{remove:t,reason:n});case 2:a.sent,c(as(e));case 4:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()};var hs=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.delete("/admin/users/"+t+"/otp_fingerprints",{data:{phone_number:n,user_id:t}});case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),ps=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/users/"+t+"/resend_email");case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Os=(n(528),function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={query:"",users:[],isLoading:!1},a}return Object(j.a)(n,[{key:"fetchUsers",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.prev=1,e.next=4,window.api.get("/admin/users",{params:{query:this.state.query}}).then((function(e){return t.setState({users:e})}));case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),re.toast.error(e.t0.message);case 9:this.setState({isLoading:!1});case 10:case"end":return e.stop()}}),e,this,[[1,6]])})));return function(){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){var e,t,n=this,a=null===(e=this.props.location)||void 0===e||null===(t=e.search)||void 0===t?void 0:t.split("?search=")[1];if(this.props.location.search){try{window.api.get("/admin/users",{params:{query:a}}).then((function(e){return n.setState({users:e})}))}catch(c){re.toast.error(c.message)}this.setState({isLoading:!1})}}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{className:"user-finder",children:[Object(T.jsx)(We,{title:"Find User"}),Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:this.state.query,onChange:function(t){e.setState({query:t.target.value})},onKeyDown:function(t){"Enter"===t.key&&e.fetchUsers()},placeholder:"Search by ID, email, cpf, or phone number. Press Enter to search."}),Object(T.jsx)("button",{disabled:this.state.isLoading,className:"red",onClick:function(){return e.fetchUsers()},children:this.state.isLoading?"Loading...":"Search"})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Searching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Username"}),Object(T.jsx)(we.Th,{children:"Email"}),Object(T.jsx)(we.Th,{children:"Verified Number"}),Object(T.jsx)(we.Th,{children:"Created At"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.users.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{className:"user",children:Object(T.jsxs)(l.b,{to:"/users/".concat(e.id),children:[Object(T.jsx)("img",{alt:"",src:e.avatar_url}),e.username]})}),Object(T.jsx)(we.Td,{children:e.email}),Object(T.jsx)(we.Td,{children:"pending"===e.status_detail?e.number+" (pending)":e.number||"-"}),Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)})]},t)}))})]})]})}}]),n}(c.Component)),_s=(n(529),n(711)),ms=n(717),xs=n(734),fs=n(735),vs=n(712),gs=n(736),Ts=me.a.USERS,ys=[{to:"/info",props:{group:Ts.INFO},label:"User Info",component:xe},{to:"/documents",props:{group:Ts.KYC},label:"Documents",component:xe},{to:"/anti-fraud",props:{group:Ts.MUTUAL},label:"Anti-Fraud",component:xe},{to:"/roles",props:{group:Ts.ROLES},label:"Roles",component:xe},{to:"/fingerprints",props:{group:Ts.FINGERPRINTS},label:"Fingerprints",component:xe},{to:"/notes",props:{group:Ts.NOTES},label:"Notes",component:xe},{to:"/route-permissions",props:{group:Ts.ROLES.filter((function(e){return"USER_UPDATE_ROLES"!==e}))},label:"Route Permissions",component:xe},{to:"/overdraft-alerts",props:{group:Ts.OVERDRAFTS},label:"Overdraft Alerts",component:xe},{to:"/permissions",props:{group:Ts.PERMISSIONS},label:"Permissions",component:xe},{to:"/suspensions",props:{group:Ts.SUSPENSIONS},label:"Suspensions",component:xe}],Es=[{to:"/transactions",props:{group:Ts.TRANSACTIONS},label:"Transactions",component:xe},{to:"/financials",props:{feature:Oe.permissionsConstants.USER_GET_FINANCIALS},label:"Financials",component:fe},{to:"/deposits",props:{group:Ts.DEPOSITS},label:"Deposits",component:xe},{to:"/withdrawals",props:{group:Ts.WITHDRAWALS},label:"Withdrawals",component:xe},{to:"/payment-methods",props:{group:Ts.PAYMENT_METHODS},label:"Payment Methods",component:xe},{to:"/otp",props:{group:Ts.OTP},label:"OTP",component:xe}],Ss=[{to:"/game-provider-rounds",props:{group:Ts.BETS},label:"Game History",component:xe},{to:"/bets-pending",props:{group:Ts.BETS},label:"Pending Bets",component:xe},{to:"/crash-bets",props:{group:Ts.BETS},label:"Crash Bets",component:xe},{to:"/crash-II-bets",props:{group:Ts.BETS},label:"Crash II",component:xe},{to:"/neymar-crash-bets",props:{group:Ts.BETS},label:"Neymar Crash Bets",component:xe},{to:"/crash-rewired-bets",props:{group:Ts.BETS},label:"Crash Rewired Bets",component:xe},{to:"/double-bets",props:{group:Ts.BETS},label:"Double Bets",component:xe},{to:"/double-v2-bets",props:{group:Ts.BETS},label:"Double V2 Bets",component:xe},{to:"/mines-bets",props:{group:Ts.BETS},label:"Mines Bets",component:xe},{to:"/mines-bets-v2",props:{group:Ts.BETS},label:"Mines Bets V2",component:xe},{to:"/tower-bets",props:{group:Ts.BETS},label:"Tower Bets",component:xe},{to:"/coin-flip-bets",props:{group:Ts.BETS},label:"CoinFlip Bets",component:xe},{to:"/dice-bets",props:{group:Ts.BETS},label:"Dice Bets",component:xe},{to:"/plinko-bets",props:{group:Ts.BETS},label:"Plinko Bets",component:xe},{to:"/limbo-bets",props:{group:Ts.BETS},label:"Limbo Bets",component:xe},{to:"/limbo-rewired-bets",props:{group:Ts.BETS},label:"Limbo rewired Bets",component:xe},{to:"/slide-bets",props:{group:Ts.BETS},label:"Slide Bets",component:xe},{to:"/fortune-double-bets",props:{group:Ts.BETS},label:"Fortune Double Bets",component:xe},{to:"/fruits-slice-bets",props:{group:Ts.BETS},label:"Fruits Slice Bets",component:xe},{to:"/fruits-bets",props:{group:Ts.BETS},label:"Fruits Bets",component:xe}],ws=[{to:"/bonuses",props:{feature:Oe.permissionsConstants.BONUSES_VIEW_BONUS},label:"Bonuses",component:fe},{to:"/bonus-rounds",props:{group:Ts.BONUS_ROUNDS},label:"Bonus Rounds",component:xe},{to:"/softswiss-free-spins",props:{group:Ts.SOFTSWISS_FREE_SPINS},label:"Softswiss Free Spins",component:xe},{to:"/mystery-boxes",props:{group:Ts.MYSTERY_BOX_BALANCES},label:"Mystery Box Balances",component:xe},{to:"/mystery-box-opens",props:{group:Ts.MYSTERY_BOX_OPENS},label:"Mystery Box Opens",component:xe},{to:"/reward-inventory",props:{group:Ts.REWARDS},label:"Reward Inventory",component:xe},{to:"/cashback-reward-periods",props:{group:Ts.REWARDS},label:"Cashback Rewards",component:xe},{to:"/referrals",props:{group:Ts.REFERRALS},label:"Referrals",component:xe},{to:"/loyalty",props:{group:Ts.LOYALTY},label:"Loyalty",component:xe}],Rs={general:ys.concat(Es),gameBets:Ss,prizeFreeMoney:ws,mobileView:ys.concat(Es,Ss,ws)},As=n(54),Ns=n.n(As),Cs=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this)).state={page:1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){this.props.updateNotes(this.props.match.params.id,this.state.page)}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_NOTES_CREATE,children:Object(T.jsxs)("div",{className:Ns.a.form,children:[Object(T.jsx)("h4",{children:"Add Note"}),Object(T.jsxs)("div",{className:Ns.a.editRoles,children:[Object(T.jsx)("input",{placeholder:"User Note",ref:function(t){return e.note=t}}),Object(T.jsx)("button",{onClick:function(){e.props.addNote(e.props.match.params.id,e.note.value)},children:"Add Note"})]})]})}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Note"})]})}),Object(T.jsx)("tbody",{children:this.props.records.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.note})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.props.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update()}))}})]})}}]),n}(c.Component),Is=Object(o.b)((function(e){return Object(d.a)({},e.users.notes)}),(function(e){return{updateNotes:function(t,n){return e(rs(t,n))},addNote:function(t,n){e(function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.post("/admin/users/"+e+"/notes",{note:t});case 2:n.sent,a(rs(e,1));case 4:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,n))}}}))(Cs),ks=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api({method:"GET",url:"/admin/users/".concat(t,"/route_permissions")});case 2:return n=e.sent,e.abrupt("return",n.map((function(e){return Object(d.a)(Object(d.a)({},e),{},{is_allowed:e.is_allowed.toString()})})));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ds=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api({method:"GET",url:"/admin/users/route_mappings"});case 2:return t=e.sent,e.abrupt("return",t.map((function(e){return Object(d.a)(Object(d.a)({},e),{},{method:e.method.toString()})})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ls=function(){var e=["","true","false"],t="rdg-text-editor ".concat("t16y9g8l700-beta7"),n=Object(p.useParams)().id,a=Object(E.useQuery)(["route_permissions",n],(function(e){return ks(e.queryKey[1])})).data,r=Object(E.useQuery)(["route_mappings"],(function(e){return Ds()})).data;var s=[{key:"id",name:"ID"},{key:"name",name:"Route Mapping",editor:function(e){var n=e.row,a=e.onRowChange;return Object(T.jsxs)("select",{className:t,value:n.name,onChange:function(e){return a(Object(d.a)(Object(d.a)({},n),{},{name:e.target.value,routemapping_id:e.target.value.split(":")[0]}),!0)},autoFocus:!0,children:[Object(T.jsx)("option",{value:""},""),r.map((function(e){return Object(T.jsx)("option",{value:"".concat(e.id,":").concat(e.name),children:e.name},e.id)}))]})}},{key:"is_allowed",name:"Allowed",editor:function(n){var a=n.row,c=n.onRowChange;return Object(T.jsx)("select",{className:t,value:a.is_allowed,onChange:function(e){return c(Object(d.a)(Object(d.a)({},a),{},{is_allowed:e.target.value}),!0)},autoFocus:!0,children:e.map((function(e){return Object(T.jsx)("option",{value:e,children:e},e)}))})}}],i=Object(c.useState)([]),o=Object(m.a)(i,2),l=o[0],u=o[1];Object(c.useEffect)((function(){a&&u(a)}),[a]);return Object(T.jsxs)("div",{children:[Object(T.jsx)("button",{onClick:function(){return u([].concat(Object(ct.a)(l),[{race_id:n}]))},children:"Add Route Permission"}),a&&Object(T.jsx)(rt.b,{columns:s,rows:l,onRowsChange:function(e,t){var a=t.indexes[0],c=e[a];if(!c.routemapping_id||!c.is_allowed||""===c.is_allowed)return u(e),re.toast.error("Fill the remaining fields to save");c.id?window.api.put("/admin/users/".concat(n,"/route_permission/").concat(c.id),c).then((function(t){t.message?(re.toast.success(t.message),u(e)):re.toast.error(t)})).catch((function(e){re.toast.error(e)})):window.api.post("/admin/users/".concat(n,"/route_permission"),c).then((function(t){t.message?(re.toast.success(t.message),e[a].id=t.id,u(e)):re.toast.error(t)})).catch((function(e){re.toast.error(e)}))}})]})},Us=n(345),Ps=n.n(Us),Ws={isLoading:!1,report:{mutual_ips:[],mutual_payment_accounts:[],mutual_tax_ids:[],bonus_into_real_transactions:[],bonus_bets_over_limit_count:0}},Ms=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state=Ws,a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.match.params.id,n=this.props.selected_currency;window.api.get("/admin/users/".concat(t,"/anti_fraud?currency_type=").concat(n)).then((function(t){return e.setState({report:t})}))}},{key:"render",value:function(){var e=this.state.report,t=e.referral,n=e.mutual_ips,a=e.mutual_payment_accounts,r=e.mutual_tax_ids,s=e.bonus_into_real_transactions,i=void 0===s?[]:s;e.bonus_bets_over_limit_count;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Anti Fraud"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Key"}),Object(T.jsx)(we.Th,{children:"Value"})]})}),Object(T.jsx)(we.Tbody,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Referral"}),Object(T.jsx)(we.Td,{children:t&&Object(T.jsx)(l.b,{to:"/users/".concat(t.user_id),children:t.username})})]})})]}),Object(T.jsx)("br",{}),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-xs-4",children:[Object(T.jsx)("h4",{children:"Mutual IPs"}),n.map((function(e){return Object(T.jsxs)("div",{className:"fingerprints-entry",children:[Object(T.jsx)(l.b,{to:"/users/".concat(e.user_id),children:Object(T.jsxs)("span",{children:[Object(T.jsx)("img",{src:e.avatar_url,height:20}),Object(T.jsxs)("span",{style:{color:e.has_bonus_transfer?"red":""},children:[e.username," - ",e.full_name," (",e.country,")"]})]})}),Object(T.jsx)("ul",{children:e.colliding_ips.map((function(e){return Object(T.jsx)("li",{children:e})}))})]},e.id)}))]}),Object(T.jsxs)("div",{className:"col-xs-4",children:[Object(T.jsx)("h4",{children:"Mutual payment accounts"}),a.map((function(e,t){return Object(T.jsxs)("div",{className:"fingerprints-entry",children:[Object(T.jsx)(l.b,{to:"/users/".concat(e.user_id),children:Object(T.jsxs)("span",{children:[Object(T.jsx)("img",{src:e.avatar_url,height:20}),Object(T.jsxs)("span",{style:{color:e.has_bonus_transfer?"red":""},children:[e.username," - ",e.full_name," (",e.country,")"]})]})}),Object(T.jsx)("ul",{children:e.colliding_accounts.map((function(e){return Object(T.jsx)("li",{children:e})}))})]},t)}))]}),Object(T.jsxs)("div",{className:"col-xs-4",children:[Object(T.jsx)("h4",{children:"Mutual Tax IDs"}),r.map((function(e){return Object(T.jsxs)("div",{className:"fingerprints-entry",children:[Object(T.jsx)(l.b,{to:"/users/".concat(e.user_id),children:Object(T.jsxs)("span",{children:[Object(T.jsx)("img",{src:e.avatar_url,height:20}),Object(T.jsxs)("span",{style:{color:e.has_bonus_transfer?"red":""},children:[e.username," - ",e.full_name," (",e.country,")"]})]})}),Object(T.jsx)("ul",{children:e.colliding_accounts.map((function(e){return Object(T.jsx)("li",{children:e})}))})]},e.id)}))]}),Object(T.jsxs)("div",{className:Ps.a.info,children:[Object(T.jsx)("h2",{children:"Flagged Bonus Transactions"}),Object(T.jsxs)("h4",{children:["Total Amount transferred to real:"," ",i.reduce((function(e,t){return e+ +t.amount}),0).toFixed(4)]}),Object(T.jsx)("hr",{})]}),Object(T.jsx)("div",{className:"col-xs-6",children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Wallet"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Closing Balance"})]})}),Object(T.jsx)(we.Tbody,{children:i.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.currency_type}),Object(T.jsx)(we.Td,{children:e.amount}),Object(T.jsx)(we.Td,{children:e.closing_balance})]},t)}))})]})})]})]})}}]),n}(c.Component),Bs=Object(o.b)((function(e){return{selected_currency:e.users.user.selected_currency}}))(Ms),Fs=n(44),Gs=n.n(Fs),Vs=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={transactions:[],page:1,total_pages:1,queryFilter:{},hasChange:!1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){he(Oe.permissionsConstants.USER_BONUSES_ADD_BONUS)&&this.props.updateBonuses(),this.props.updateUserBonuses(this.props.match.params.id)}},{key:"componentDidUpdate",value:function(e,t){t.queryFilter!==this.state.queryFilter&&!0===this.state.hasChange&&(this.setState(Object(d.a)(Object(d.a)({},this.state),{},{hasChange:!1})),this.props.updateBonuses(this.state.page,this.state.queryFilter))}},{key:"getBonusState",value:function(e){var t=this.props.consumed_bonuses||[];return t.length&&t.includes(e.id)?"consumed":e.status}},{key:"render",value:function(){var e=this,t=this.props.match.params.id;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsxs)("div",{className:Gs.a.filtersQuery,children:[Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by Bonus Name"}),Object(T.jsx)("input",{type:"text",id:"bonusName",name:"bonusName",onChange:function(t){e.setState(Object(d.a)(Object(d.a)({},e.state),{},{queryFilter:Object(d.a)(Object(d.a)({},e.state.queryFilter),{},{bonusName:t.target.value}),hasChange:!0}))}})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by Status"}),Object(T.jsx)("input",{type:"text",id:"status",name:"status",onChange:function(t){e.setState(Object(d.a)(Object(d.a)({},e.state),{},{queryFilter:Object(d.a)(Object(d.a)({},e.state.queryFilter),{},{status:t.target.value}),hasChange:!0}))}})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by Activation Status"}),Object(T.jsx)("input",{type:"text",id:"activationStatus",name:"activationStatus",onChange:function(t){e.setState(Object(d.a)(Object(d.a)({},e.state),{},{queryFilter:Object(d.a)(Object(d.a)({},e.state.queryFilter),{},{activationStatus:t.target.value}),hasChange:!0}))}})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by Activation Wager Requirement"}),Object(T.jsx)("input",{type:"text",id:"activationWagerRequirement",name:"activationWagerRequirement",onChange:function(t){e.setState(Object(d.a)(Object(d.a)({},e.state),{},{queryFilter:Object(d.a)(Object(d.a)({},e.state.queryFilter),{},{activationWagerRequirement:t.target.value}),hasChange:!0}))}})]})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Bonus Name"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Activation Status"}),Object(T.jsx)(we.Th,{children:"Activation Wager Requirement"}),Object(T.jsx)(we.Th,{children:"Activation Wagered"}),Object(T.jsx)(we.Th,{children:"Activation EUR transfer amount"}),Object(T.jsx)(we.Th,{children:"Activation Created"}),Object(T.jsx)(we.Th,{children:"Activation Last Update"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsx)(we.Tbody,{children:(this.props.bonus_inventory||[]).map((function(n,a){var r=n.bonus,s=n.bonus_activation,i=e.getBonusState(n);return Object(T.jsx)(c.Fragment,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/rewards/bonuses/".concat(r.id),children:r.name})}),Object(T.jsx)(we.Td,{children:i}),Object(T.jsx)(we.Td,{children:s&&s.status}),Object(T.jsx)(we.Td,{children:s&&s.wager_requirement}),Object(T.jsx)(we.Td,{children:s&&s.wagered}),Object(T.jsx)(we.Td,{children:s&&s.eur_transfer_amount}),Object(T.jsx)(we.Td,{children:s&&Se.withMinutes(s.created_at)}),Object(T.jsx)(we.Td,{children:s&&Se.withMinutes(s.updated_at)}),Object(T.jsx)(we.Td,{children:s&&s.active&&Object(T.jsx)("button",{onClick:function(){e.props.forceExpireBonusActivation(t,s.id)},children:"Force Expire Activation"})})]},a)})}))})]}),Object(T.jsx)("br",{})]})}}]),n}(c.Component),Ys=Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e.users.user),{},{bonuses:e.bonuses.search_results.records})}),(function(e){return{updateBonuses:function(t,n){return e(Rn(t,n))},addBonusToInventory:function(t,n){e(function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.post("/admin/users/"+e+"/add_bonus",{bonus_id:t});case 2:return n.abrupt("return",a(cs(e)));case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,n))},forceExpireBonusActivation:function(t,n){e(function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.put("/admin/users/"+e+"/bonus_activations/"+t,{status:"expired"});case 2:return n.abrupt("return",a(as(e)));case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,n))},updateUserBonuses:function(t){e(cs(t))}}}))(Vs),Hs=n(126),qs=n.n(Hs),Ks=Object(o.b)((function(e){return Object(d.a)({},e.users.user)}),(function(e){return{updateBonusRounds:function(t,n){return e(function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.get("/admin/users/"+e+"/bonus_rounds");case 2:a=t.sent,n({type:Qr,payload:a});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(t))}}}))((function(e){var t=e.bonus_rounds,n=e.updateBonusRounds,a=Object(p.useParams)().id,r=Object(c.useState)("all"),s=Object(m.a)(r,2),i=s[0],o=s[1],l=Object(c.useState)(""),d=Object(m.a)(l,2),u=d[0],j=d[1],b=Object(c.useState)([]),h=Object(m.a)(b,2),O=h[0],_=h[1],x=Object(c.useState)(1),f=Object(m.a)(x,2),v=f[0],g=f[1],y=Object(c.useState)(0),E=Object(m.a)(y,2),S=E[0],w=E[1],R=Object(c.useState)(""),A=Object(m.a)(R,2),N=A[0],C=A[1],I=Object(c.useState)(""),D=Object(m.a)(I,2),L=D[0],U=D[1],P=Object(c.useState)({pagination:{total_pages:1,records_per_page:50},records:[]}),W=Object(m.a)(P,2),M=W[0],B=W[1],F=function(){var e={page:v,limit:25,bonus_round_type_filter:i};window.api.get("/admin/users/".concat(a),{params:e}).then((function(e){return B(M)}))},G=function(){var e="/admin/free-bets/".concat(a);k.get(e).then((function(e){return _(e||[])})).catch((function(e){console.log(e)}))};return Object(c.useEffect)((function(){he(Oe.permissionsConstants.USER_BONUS_ROUNDS_VIEW_LIST)&&n(a),he(Oe.permissionsConstants.USER_BONUS_ROUNDS_TRANSACTIONS_VIEW_LIST)&&F()}),[v,n,i]),Object(c.useEffect)((function(){he(Oe.permissionsConstants.USER_BONUS_ROUNDS_VIEW_LIST)&&G()}),[]),Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("h4",{children:"Bonus Rounds - Monolith"}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_BONUS_ROUNDS_VIEW_LIST,children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Rounds"}),Object(T.jsx)(we.Th,{children:"Balance"})]})}),Object(T.jsx)(we.Tbody,{children:t.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.rounds}),Object(T.jsx)(we.Td,{children:e.balance})]})}))})]})}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.CREDIT_BONUS_ROUNDS,children:Object(T.jsxs)("div",{className:qs.a.form,children:[Object(T.jsx)("h4",{children:"Modify spins"}),Object(T.jsxs)("div",{className:qs.a.editRoles,children:[Object(T.jsx)(Ce.a,{placeholder:"Select a bonus round type",name:"type",value:u,onChange:function(e){return j(e.value)},options:[{value:"crash",label:"Crash"},{value:"roulette",label:"Double"},{value:"mines",label:"Mines"},{value:"plinko",label:"Plinko"},{value:"limbo",label:"Limbo"},{value:"dice",label:"Dice"}]}),Object(T.jsx)("input",{placeholder:"ex. 4",onChange:function(e){return w(e.target.value)}}),Object(T.jsx)("button",{onClick:function(){var e=S;isNaN(+e)||u&&window.api.post("/admin/credit_bonus_rounds",{user_id:a,rounds:e,type:u,note:"admin"}).then((function(e){n(a,1),F()}))},disabled:isNaN(+S)||!u,children:"Add Rounds"})]})]})}),Object(T.jsx)("h4",{children:"Bonus Rounds - Gaming Service"}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_BONUS_ROUNDS_VIEW_LIST,children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Rounds"}),Object(T.jsx)(we.Th,{children:"Balance"})]})}),Object(T.jsx)(we.Tbody,{children:O.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.rounds}),Object(T.jsx)(we.Td,{children:e.balance})]})}))})]})}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.CREDIT_BONUS_ROUNDS,children:Object(T.jsxs)("div",{className:qs.a.form,children:[Object(T.jsx)("h4",{children:"Modify Bonus Rounds"}),Object(T.jsxs)("div",{className:qs.a.editRoles,children:[Object(T.jsx)(Ce.a,{placeholder:"Select a bonus round type",name:"type",value:L,onChange:function(e){return U(e.value)},options:[{value:"coin-flip",label:"Coin Flip"},{value:"neymar-crash",label:"Crash Neymar"},{value:"crash-v2",label:"Crash II"},{value:"crash",label:"Crash"},{value:"fruits",label:"Fruits"},{value:"hilo",label:"Hilo"},{value:"slide",label:"Slide"},{value:"tower",label:"Tower"},{value:"fruitSlice",label:"Fruit Slice"},{value:"fortune_double",label:"Fortune Double"},{value:"mines",label:"Mines"},{value:"roulette",label:"Double"},{value:"limbo",label:"Limbo"}]}),Object(T.jsx)("input",{placeholder:"ex. 4",value:N,onChange:function(e){return C(e.target.value||"")}}),Object(T.jsx)("button",{disabled:isNaN(+N)||+N<=0||!L,onClick:function(){if(!isNaN(+N)&&L){var e={user_id:a,rounds:N,type:L,note:"admin"};k.post("/admin/free-bets/credit",e).then((function(){G(),C("")}))}},children:"Add Rounds"})]})]})}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.USER_BONUS_ROUNDS_TRANSACTIONS_VIEW_LIST,children:[Object(T.jsxs)("div",{className:qs.a.form,children:[Object(T.jsx)("h4",{children:"Transaction Ledger"}),Object(T.jsx)("div",{className:qs.a.editRoles,children:Object(T.jsx)(Ce.a,{placeholder:"Filter for bonus round type",name:"type",value:i,onChange:function(e){o(e&&e.value),F()},options:t.map((function(e){return{label:"ID: ".concat(e.id," - ").concat(e.type),value:e.type}}))})})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Created"}),Object(T.jsx)(we.Th,{children:"Bonus round Type"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Closing Balance"}),Object(T.jsx)(we.Th,{children:"Note"})]})}),Object(T.jsx)(we.Tbody,{children:M.records.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.amount}),Object(T.jsx)(we.Td,{children:e.closing_balance}),Object(T.jsx)(we.Td,{children:e.note})]},e.created_at)}))})]}),Object(T.jsx)(Ke,{total_pages:M.pagination.total_pages,update:function(e){g(e),F()}})]})]})})),zs=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,total_pages:0,bets:[],queryFilter:{},hasChange:!1,gameStartedAtStart:null,gameStartedAtEnd:null,gameSettledAtStart:null,gameSettledAtEnd:null,joinDateStarted:null,lastDepositStarted:null,joinDateSettled:null,lastDepositSettled:null},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetch()}},{key:"componentDidUpdate",value:function(e,t,n){t.page!==this.state.page&&this.fetch()}},{key:"fetch",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.prev=1,e.next=4,window.api.get("/admin/users/".concat(this.props.match.params.id,"/crash_bets?page=").concat(this.state.page));case 4:t=e.sent,n=t.total_pages,a=t.records,this.setState({total_pages:n,bets:a}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),re.toast.error(e.t0.message);case 13:this.setState({isLoading:!1});case 14:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Game Settled At"}),Object(T.jsx)(we.Th,{children:"Game Crash Point"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Bet Settled At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Autocashout At"}),Object(T.jsx)(we.Th,{children:"Cashed Out At"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.bets.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.free_bet?Object(T.jsx)("span",{children:e.round_id}):Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.round_id),children:e.round_id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_started_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_settled_at)}),Object(T.jsx)(we.Td,{children:e.game_crash_point}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_placed_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_settled_at)}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.amount," ",e.currency_type]}),Object(T.jsxs)(we.Td,{children:[e.auto_cashout_at,"x"]}),Object(T.jsxs)(we.Td,{children:[e.cashed_out_at,"x"]}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.win_amount," ",e.currency_type]}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.profit," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.status})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),Xs=function(e){var t=Object(c.useState)({bets:[],total_pages:0}),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],d=i[1],u=Object(c.useState)(1),j=Object(m.a)(u,2),b=j[0],h=j[1];Object(c.useEffect)((function(){p(b)}),[b]);var p=function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a,c,s;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d(!0),t.prev=1,t.next=4,k.get("/admin/user/".concat(e.match.params.id,"/crash_bets?page=").concat(n,"&room_id=").concat(1));case 4:a=t.sent,c=a.total_pages,s=a.records,r({total_pages:c,bets:s}),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),re.toast.error(t.t0.message);case 13:d(!1);case 14:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e){return t.apply(this,arguments)}}();return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[o&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Game Settled At"}),Object(T.jsx)(we.Th,{children:"Game Crash Point"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Bet Settled At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Autocashout At"}),Object(T.jsx)(we.Th,{children:"Cashed Out At"}),Object(T.jsx)(we.Th,{children:"Free"}),Object(T.jsx)(we.Th,{children:"Is bonus round"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:a.bets.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.free_bet?Object(T.jsx)("span",{children:e.round_id}):Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.remote_round_id),children:e.remote_round_id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_started_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_settled_at)}),Object(T.jsx)(we.Td,{children:e.game_crash_point}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_placed_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_settled_at)}),Object(T.jsxs)(we.Td,{children:[e.amount," ",e.currency_type]}),Object(T.jsxs)(we.Td,{children:[e.auto_cashout_at,"x"]}),Object(T.jsxs)(we.Td,{children:[e.cashed_out_at,"x"]}),Object(T.jsx)(we.Td,{children:e.free_bet?"yes":"no"}),Object(T.jsx)(we.Td,{children:e.is_bonus_round?"yes":"no"}),Object(T.jsxs)(we.Td,{className:e.win_amount>0?"good":"bad",children:[e.win_amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.profit," ",e.currency_type]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:a.total_pages,update:function(e){return h(e)}})]})},Zs=n(721),Qs=n(729),Js=n(99),$s=n.n(Js);n(537);$s.a.setAppElement("#root");var ei=["pdf","xls","csv"],ti={content:{top:"50%",left:"50%",right:"50%",marginRight:"-50%",transform:"translate(-50%, -50%)",backgroundColor:"#131521"}},ni=function(e){var t=e.startDate,n=void 0===t?Ee()().subtract(1,"day").toDate():t,a=e.endDate,r=void 0===a?Ee()().toDate():a,s=e.onClose,i=e.onExport,o=e.isOpen,l=void 0!==o&&o,d=e.downloadingReport,u=void 0!==d&&d,j=Object(c.useState)(n),b=Object(m.a)(j,2),h=b[0],p=b[1],O=Object(c.useState)(r),_=Object(m.a)(O,2),x=_[0],f=_[1],v=Object(c.useState)("pdf"),g=Object(m.a)(v,2),y=g[0],E=g[1];return Object(T.jsxs)($s.a,{isOpen:l,style:ti,onRequestClose:s,children:[Object(T.jsx)(ir,{startDate:h,setStartDate:p,endDate:x,setEndDate:f}),Object(T.jsxs)("div",{className:"export-modal-container",children:[Object(T.jsx)(Zs.a,{color:"info",exclusive:!0,value:y,onChange:function(e,t){t&&E(t)},style:{background:"white"},children:ei.map((function(e){return Object(T.jsx)(Qs.a,{value:e,"aria-label":"bold",children:e.toUpperCase()},e)}))}),u?"Downloading report...":Object(T.jsx)("button",{onClick:function(){return i({startDate:h,endDate:x,format:y})},children:"Export"})]})]})},ai={float:"right",marginTop:"20px",marginRight:"30px"},ci=function(e){var t=e.onClick,n=e.styles,a=void 0===n?ai:n;return Object(T.jsx)("button",{style:a,onClick:t,children:"Export"})},ri=function(e){var t=Object(c.useState)(1),a=Object(m.a)(t,2),r=a[0],s=a[1],i=Object(c.useState)(1),o=Object(m.a)(i,2),l=o[0],d=o[1],u=Object(c.useState)([]),j=Object(m.a)(u,2),b=j[0],h=j[1],p=Object(c.useState)(!1),O=Object(m.a)(p,2),_=O[0],x=O[1],f=Object(c.useState)(!1),v=Object(m.a)(f,2),g=v[0],y=v[1],E=Object(c.useState)(!1),S=Object(m.a)(E,2),w=S[0],R=S[1],A=function(){x(!0),window.api.get("/admin/users/".concat(e.match.params.id,"/deposits"),{params:{page:r}}).then((function(e){var t=e.meta,n=e.records;h(n),d(t.total_pages)})).finally((function(){return x(!1)}))};Object(c.useEffect)(A,[r]);return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[_&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Searching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Action"}),Object(T.jsx)(we.Th,{children:"Transaction ID"}),Object(T.jsx)(we.Th,{children:"Note"})]})}),Object(T.jsx)(we.Tbody,{children:b.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsxs)(we.Td,{className:"good",children:[e.currency_type," ",e.amount]}),Object(T.jsx)(we.Td,{className:"complete"===e.status?"good":"",children:e.status}),Object(T.jsxs)(we.Td,{children:["complete"!==e.status&&Object(T.jsx)(fe,{feature:Oe.permissionsConstants.DEPOSITS_CREDIT_DEPOSIT,children:Object(T.jsx)("button",{className:"small",onClick:function(){var t;t=e.id,window.api.put("/admin/payments/deposits/".concat(t,"/credit")).then((function(){re.toast.success("Deposit credited"),A()}))},children:"Credit"})}),"complete"!==e.status&&Object(T.jsx)(fe,{feature:Oe.permissionsConstants.REQUEST_DEPOSITS_CREDIT_DEPOSIT,children:Object(T.jsx)("button",{className:"small",onClick:function(){!function(e){var t=window.prompt("Please enter a note for this credit.");window.api.put("/admin/payments/deposits/".concat(e,"/request_credit"),{staff_note:t}).then((function(){re.toast.success("Deposit Credit Requested"),A()}))}(e.id)},children:"Request Credit"})})]}),Object(T.jsx)(we.Td,{children:e.transaction_id}),Object(T.jsx)(we.Td,{children:e.note})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:l,update:function(e){s(e)}}),Object(T.jsx)(ci,{onClick:function(){return y(!0)}}),Object(T.jsx)(ni,{isOpen:g,onClose:function(){return y(!1)},downloadingReport:w,onExport:function(t){var a,c,s;a=t.format,c=t.startDate,s=t.endDate,R(!0),n(61)({url:"/api/admin/users/".concat(e.match.params.id,"/deposits/export/").concat(a),method:"GET",responseType:"blob",params:{page:r,startDate:c,endDate:s},headers:{Authorization:"Bearer ".concat(localStorage.getItem("access_token")),"X-RateLimit-Bypass":"1"}}).then((function(e){var t="xls"===a?"xlsx":a;Re(e.data,t)})).finally((function(){return R(!1)}))}})]})},si=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return isNaN(e)||null===e?"":(+e).toFixed(t)},ii=function(e){var t=Object(c.useState)({bets:[],total_pages:0}),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],d=i[1],u=Object(c.useState)(1),j=Object(m.a)(u,2),b=j[0],h=j[1];Object(c.useEffect)((function(){p(b)}),[b]);var p=function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a,c,s;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d(!0),t.prev=1,t.next=4,window.api.get("/admin/users/".concat(e.match.params.id,"/dice_bets?page=").concat(n));case 4:a=t.sent,c=a.total_pages,s=a.records,r({total_pages:c,bets:s}),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),re.toast.error(t.t0.message);case 13:d(!1);case 14:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e){return t.apply(this,arguments)}}();return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[o&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Roll Status"}),Object(T.jsx)(we.Th,{children:"Multiplier"}),Object(T.jsx)(we.Th,{children:"Threshold"}),Object(T.jsx)(we.Th,{children:"Roll"}),Object(T.jsx)(we.Th,{children:"Profit"}),Object(T.jsx)(we.Th,{children:"Total Bets"}),Object(T.jsx)(we.Th,{children:"On Win %"}),Object(T.jsx)(we.Th,{children:"On Loss %"}),Object(T.jsx)(we.Th,{children:"Stop on Profit Amount"}),Object(T.jsx)(we.Th,{children:"Stop on Loss Amount"})]})}),Object(T.jsx)(we.Tbody,{children:a.bets.map((function(e,t){var n,a=e.win_amount>0?e.profit:-1*e.amount,c=e.rollover?100-e.threshold:e.threshold,r=function(e,t,n){return e?t:n}(e.rollover,e.threshold,c),s=function(e,t){var n=1.0416*(100-(t?e:100-e));return n?99.99/n:0}(e.threshold,e.rollover),i=(n=e.rollover,"ROLL ".concat(n?"OVER":"UNDER")),o=si(e.total_bets,0),d=si(e.on_win),u=si(e.on_loss),j=si(e.stop_on_profit),b=si(e.stop_on_loss);return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.round_id),children:e.round_id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.created_at)}),Object(T.jsxs)(we.Td,{children:[e.amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:i}),Object(T.jsx)(we.Td,{children:(+s).toFixed(2)}),Object(T.jsx)(we.Td,{children:(+r).toFixed(2)}),Object(T.jsx)(we.Td,{children:e.roll}),Object(T.jsxs)(we.Td,{className:a>=0?"good":"bad",children:[(+a).toFixed(2)," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:o}),Object(T.jsx)(we.Td,{children:d}),Object(T.jsx)(we.Td,{children:u}),Object(T.jsx)(we.Td,{children:j}),Object(T.jsx)(we.Td,{children:b})]},e.round_id)}))})]}),Object(T.jsx)(Ke,{total_pages:a.total_pages,update:function(e){return h(e)}})]})},oi=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,total_pages:0,bets:[],queryFilter:{},hasChange:!1,gameStartedAtStart:null,gameStartedAtEnd:null,gameSettledAtStart:null,gameSettledAtEnd:null,joinDateStarted:null,lastDepositStarted:null,joinDateSettled:null,lastDepositSettled:null},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetch()}},{key:"componentDidUpdate",value:function(e,t,n){t.page!==this.state.page&&this.fetch()}},{key:"fetch",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.prev=1,e.next=4,window.api.get("/admin/users/".concat(this.props.match.params.id,"/roulette_bets?page=").concat(this.state.page));case 4:t=e.sent,n=t.total_pages,a=t.records,this.setState({total_pages:n,bets:a}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),re.toast.error(e.t0.message);case 13:this.setState({isLoading:!1});case 14:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"rollback",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.post("/admin/roulette_bets/".concat(t));case 3:re.toast.success("Bet rolled back"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),re.toast.error("Bet already rolled back.");case 9:this.fetch();case 10:case"end":return e.stop()}}),e,this,[[0,6]])})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Bet ID"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Game Settled At"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Bet Settled At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Bet Color"}),Object(T.jsx)(we.Th,{children:"Winning Color"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.bets.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.free_bet?Object(T.jsx)("span",{children:e.round_id}):Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.round_id),children:e.round_id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_started_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_settled_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_placed_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_settled_at)}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.bet_color}),Object(T.jsx)(we.Td,{children:e.winning_color}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.win_amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.profit," ",e.currency_type]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),li=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,total_pages:0,bets:[],queryFilter:{},hasChange:!1,gameStartedAtStart:null,gameStartedAtEnd:null,gameSettledAtStart:null,gameSettledAtEnd:null,joinDateStarted:null,lastDepositStarted:null,joinDateSettled:null,lastDepositSettled:null},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetch()}},{key:"componentDidUpdate",value:function(e,t,n){t.page!==this.state.page&&this.fetch()}},{key:"fetch",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.prev=1,e.next=4,k.get("/admin/users/".concat(this.props.match.params.id,"/double-bets?page=").concat(this.state.page));case 4:t=e.sent,n=t.total_pages,a=t.records,this.setState({total_pages:n,bets:a}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),re.toast.error(e.t0.message);case 13:this.setState({isLoading:!1});case 14:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"rollback",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.post("/admin/roulette_bets/".concat(t));case 3:re.toast.success("Bet rolled back"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),re.toast.error("Bet already rolled back.");case 9:this.fetch();case 10:case"end":return e.stop()}}),e,this,[[0,6]])})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Bet ID"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Game Settled At"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Bet Settled At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Bet Color"}),Object(T.jsx)(we.Th,{children:"Winning Color"}),Object(T.jsx)(we.Th,{children:"Free"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.bets.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.free_bet?Object(T.jsx)("span",{children:e.round_id}):Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.remote_round_id),children:e.remote_round_id})}),Object(T.jsx)(we.Td,{children:e.round_id}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_started_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_settled_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_placed_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_settled_at)}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.bet_color}),Object(T.jsx)(we.Td,{children:e.winning_color}),Object(T.jsx)(we.Td,{children:e.free_bet?"Yes":"No"}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.win_amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsxs)(we.Td,{className:e.profit>=0?"good":"bad",children:[e.profit," ",e.currency_type]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),di=n(49),ui=n(101),ji=n.n(ui),bi=function(e){var t=e.periods,n=void 0===t?[]:t,a=e.setPeriod,r=Object(c.useState)(0),s=Object(m.a)(r,2),i=s[0],o=s[1],l=function(e){return new Date(e).toISOString().replace("T"," ").replace("Z","").split(".")[0]};return Object(T.jsx)("div",{className:"date-range",children:Object(T.jsx)("select",{value:i,onChange:function(e){a(Number(e.target.value)),o(e.target.value)},children:n.map((function(e){return Object(T.jsx)("option",{value:e.id,children:"".concat(l(e.period_started_at)," / ").concat(l(e.period_ended_at))},e.period_started_at)}))})})},hi={id:1,status:"created",level:1,rank:"bronze",percentage:"0",calculation_values:{amount:0,real_bet:0,real_won:0,sell_amount:0,currency_type:"BRL",transfer_amount:0,last_week_cashback:0,withdrawals_amount:0,daily_rakeback_amount:0,cashback_reward_amount:0,rakeback_reward_amount:0,softswiss_free_spins_amount:0},created_at:"2024-02-05T04:41:35.459Z",updated_at:"2024-02-05T04:41:35.459Z",loyalty_period_id:300,user_id:1,transaction_id:null,loyalty_period:{id:300,starts_at:"2024-01-29T00:00:00.000Z",ends_at:"2024-02-04T23:59:59.000Z",status:"credited",created_at:"2024-02-05T04:24:41.714Z",updated_at:"2024-02-05T04:24:41.714Z"},periods:[]},pi=function(e){var t,n,a,r,s,i,o=e.id,l=Object(c.useState)(0),d=Object(m.a)(l,2),u=d[0],j=d[1],b=Object(c.useState)([]),h=Object(m.a)(b,2),p=h[0],O=h[1],_=Object(c.useState)(hi),x=Object(m.a)(_,2),f=x[0],v=x[1],g=function(e){return Math.floor(100*+e)/100};return Object(c.useEffect)((function(){0===u?window.api.get("/admin/users/".concat(o,"/loyalty-cashback")).then((function(e){e&&v(e)})):window.api.get("/admin/users/".concat(o,"/loyalty-cashback/").concat(u)).then((function(e){e&&v(e)}))}),[u]),Object(c.useEffect)((function(){window.api.get("/admin/users/".concat(o,"/cashback-periods")).then((function(e){e&&O(e)}))}),[]),Object(T.jsxs)("div",{className:"weekly-summary",children:[Object(T.jsxs)("div",{className:"header",children:[Object(T.jsx)("h2",{children:"Cashback summary"}),p.length>0&&Object(T.jsx)(bi,{setPeriod:j,periods:p})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Wagered"}),Object(T.jsx)(we.Th,{children:"Withdrawals"}),Object(T.jsx)(we.Th,{children:"Cashback percentage"}),Object(T.jsx)(we.Th,{children:"Real Won"}),Object(T.jsx)(we.Th,{children:"Rewards Received"}),Object(T.jsx)(we.Th,{children:"Bonuses Transfered"}),Object(T.jsx)(we.Th,{children:"Current week cashback"}),Object(T.jsx)(we.Th,{children:"Last Week Cashback"})]})}),Object(T.jsx)(we.Tbody,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:g((null===f||void 0===f||null===(t=f.calculation_values)||void 0===t?void 0:t.real_bet)||0)}),Object(T.jsx)(we.Td,{children:g((null===f||void 0===f||null===(n=f.calculation_values)||void 0===n?void 0:n.withdrawals_amount)||0)}),Object(T.jsx)(we.Td,{children:f.percentage}),Object(T.jsx)(we.Td,{children:g((null===f||void 0===f||null===(a=f.calculation_values)||void 0===a?void 0:a.real_won)||0)}),Object(T.jsx)(we.Td,{children:g((null===f||void 0===f||null===(r=f.calculation_values)||void 0===r?void 0:r.rewards_received)||0)}),Object(T.jsx)(we.Td,{children:g((null===f||void 0===f||null===(s=f.calculation_values)||void 0===s?void 0:s.bonuses_transferred)||0)}),Object(T.jsx)(we.Td,{children:g(f.amount||0)}),Object(T.jsx)(we.Td,{children:g((null===f||void 0===f||null===(i=f.calculation_values)||void 0===i?void 0:i.last_week_cashback)||0)})]})})]})]})},Oi=function(e){return Object(T.jsx)("div",{className:"accounting-section",children:Object.keys(e).map((function(t){return Object(T.jsxs)("div",{className:"accounting-section-row",children:[Object(T.jsx)("span",{className:"name",children:t.replace(/_/g," ").split(" ").reduce((function(e,t){return[].concat(Object(ct.a)(e),[t[0].toUpperCase()+t.slice(1)])}),[]).join(" ")}),Object(T.jsx)("span",{className:"value",children:e[t]})]})}))})},_i=function(e){var t=e.chartOfAccounts;return Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Sum"})]})}),Object(T.jsx)(we.Tbody,{children:t.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.sum})]},t)}))})]})},mi={page:1,isLoading:!1,repairable_wallets:[],report:{real_wagering_report:{wagered:"0.0000",refunded:"0.0000",in_play:"0.0000",winnings:"0.0000",return_to_player:"0.0000",net_profit:"0.0000"},bonus_wagering_report:{wagered:"0.0000",refunded:"0.0000",in_play:"0.0000",winnings:"0.0000",return_to_player:"0.0000",net_profit:"0.0000"},real_credits_report:{referral_conversion_payouts:"0.0000",bonuses_transferred:"0.0000",cashback_rewards_payed_out:"0.0000",weekly_loyalty_payouts:"0.0000",admin_credits:"0.0000",inventory_rewards_sold:"0.0000",softswiss_free_spins_winnings:"0.0000",net_real_credits:"0.0000"},bonus_money_report:{bonuses_credited:"0.0000",bonuses_forfeit_or_transferred:"0.0000",net_bonus_money_credited:"0.0000",net_bonus_money:"0.0000"},payments_report:{completed_deposits:"0.0000",withdrawals_completed:"0.0000",withdrawals_pending:"0.0000",withdrawals_refunded:"0.0000",withdrawals_debited:"0.0000",net_withdrawals:"0.0000",net_payments:"0.0000"},summary_report:{gross_gaming_revenue:"0.0000",net_real_credits:"0.0000",net_bonus_money_credited:"0.0000",net_gaming_revenue:"0.0000",net_payments:"0.0000",expected_balance:"0.0000",current_balance:"0.0000",deficiency:"0.0000",accuracy:"0.0000"},real_chart_of_accounts:[],bonus_chart_of_accounts:[]}},xi=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state=mi,a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.match.params.id,n=this.props.selected_currency;window.api.get("/admin/users/".concat(t,"/financials?currency_type=").concat(n)).then((function(t){return e.setState({report:t})}))}},{key:"getRepairableWallets",value:function(){var e=this,t=this.props.match.params.id;this.setState({repairable_loading:!0}),window.api.get("/admin/users/".concat(t,"/repairable_wallets")).then((function(t){return e.setState({repairable_wallets:t,repairable_loaded:!0,repairable_loading:!1})})).catch((function(t){e.setState({repairable_loaded:!0,repairable_loading:!1})}))}},{key:"repairWallet",value:function(e){var t=this,n=this.props.match.params.id;window.api.post("/admin/users/".concat(n,"/repair_wallet"),{wallet_id:e}).then(Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:re.toast.success("Wallet balance repaired successfully"),t.getRepairableWallets();case 2:case"end":return e.stop()}}),e)}))))}},{key:"render",value:function(){var e=this,t=this.props.match.params.id,n=this.state.report,a=n.real_wagering_report,c=n.bonus_wagering_report,r=n.real_credits_report,s=n.bonus_money_report,i=n.payments_report,o=n.summary_report,l=n.real_chart_of_accounts,u=n.bonus_chart_of_accounts;return Object(T.jsxs)("div",{id:"user-info-financials",className:ji.a.main,children:[Object(T.jsx)(pi,{id:t}),Object(T.jsx)("h4",{children:"Balances"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Primary?"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Currency"}),Object(T.jsx)(we.Th,{children:"Deposit Currency"}),Object(T.jsx)(we.Th,{children:"Balance"}),Object(T.jsx)(we.Th,{children:"Real Balance"}),Object(T.jsx)(we.Th,{children:"Bonus Balance"})]})}),Object(T.jsx)(we.Tbody,{children:this.props.wallets.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.is_primary?Object(T.jsx)("i",{className:"fa fa-check"}):""}),Object(T.jsx)(we.Td,{children:e.currency_type}),Object(T.jsx)(we.Td,{children:e.deposit_currency_type||"N/A"}),Object(T.jsx)(we.Td,{children:e.balance}),Object(T.jsx)(we.Td,{children:e.real_balance}),Object(T.jsx)(we.Td,{children:e.bonus_balance})]},t)}))})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("h4",{children:"Reconcile"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Primary?"}),Object(T.jsx)(we.Th,{children:"Currency"}),Object(T.jsx)(we.Th,{children:"Deposit Currency"}),Object(T.jsx)(we.Th,{children:"Current Balance"}),Object(T.jsx)(we.Th,{children:"Replayed Balance"}),Object(T.jsx)(we.Th,{children:"Current Real Balance"}),Object(T.jsx)(we.Th,{children:"Replayed Real Balance"}),Object(T.jsx)(we.Th,{children:"Current Bonus Balance"}),Object(T.jsx)(we.Th,{children:"Replayed Bonus Balance"}),Object(T.jsx)(we.Th,{}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsxs)(we.Tbody,{children:[0===this.state.repairable_wallets.length&&!this.state.repairable_loaded&&Object(T.jsx)(we.Tr,{children:Object(T.jsx)(we.Td,{colSpan:13,children:Object(T.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:Object(T.jsx)("button",{disabled:this.state.repairable_loading,onClick:function(){return e.getRepairableWallets()},children:"Load repairable wallets"})})})}),this.state.repairable_wallets.map((function(t,n){var a=e.state.expanded_wallet_id===t.wallet_id,c=[Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:t.wallet_id}),Object(T.jsx)(we.Td,{children:t.is_primary?Object(T.jsx)("i",{className:"fa fa-check"}):""}),Object(T.jsx)(we.Td,{children:t.currency_type}),Object(T.jsx)(we.Td,{children:t.deposit_currency_type}),Object(T.jsx)(we.Td,{children:t.current_balance}),Object(T.jsx)(we.Td,{children:t.replayed_balance}),Object(T.jsx)(we.Td,{children:t.current_real_balance}),Object(T.jsx)(we.Td,{children:t.replayed_real_balance}),Object(T.jsx)(we.Td,{children:t.current_bonus_balance}),Object(T.jsx)(we.Td,{children:t.replayed_bonus_balance}),Object(T.jsx)(we.Td,{onClick:function(){if(a)return e.setState({expanded_wallet_id:null});e.setState({expanded_wallet_id:t.wallet_id})},children:"+"}),Object(T.jsx)(we.Td,{children:t.status}),Object(T.jsx)(we.Td,{children:"corrupted"===t.status&&Object(T.jsx)("button",{onClick:function(){return e.repairWallet(t.wallet_id)},children:"Repair"})})]},n)];if(a){var r,s=Object(di.a)(t.journals);try{for(s.s();!(r=s.n()).done;){var i=r.value;c.push(Object(T.jsxs)(we.Tr,{children:[Object(T.jsxs)(we.Td,{children:["Journal #",i.journal_id," (",i.journal_type,")"]}),Object(T.jsx)(we.Td,{children:i.current_journal_balance}),Object(T.jsx)(we.Td,{children:i.replayed_journal_balance})]}))}}catch(o){s.e(o)}finally{s.f()}}return Object(T.jsx)(T.Fragment,{children:c.map((function(e){return e}))})}))]})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-md-6 col-xs-12",children:[Object(T.jsx)("h4",{children:"Real Chart of Accounts"}),Object(T.jsx)(_i,{chartOfAccounts:l})]}),Object(T.jsxs)("div",{className:"col-md-6 col-xs-12",children:[Object(T.jsx)("h4",{children:"Bonus Chart of Accounts"}),Object(T.jsx)(_i,{chartOfAccounts:u})]})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-md-3 col-xs-12",children:[Object(T.jsx)("h4",{children:"Real Wagering Report"}),Object(T.jsx)(Oi,Object(d.a)({},a))]}),Object(T.jsxs)("div",{className:"col-md-3 col-xs-12",children:[Object(T.jsx)("h4",{children:"Payments"}),Object(T.jsx)(Oi,Object(d.a)({},i))]}),Object(T.jsxs)("div",{className:"col-md-3 col-xs-12",children:[Object(T.jsx)("h4",{children:"Real Credits"}),Object(T.jsx)(Oi,Object(d.a)({},r))]}),Object(T.jsxs)("div",{className:"col-md-3 col-xs-12",children:[Object(T.jsx)("h4",{children:"Bonus Money Report"}),Object(T.jsx)(Oi,Object(d.a)({},s))]}),Object(T.jsxs)("div",{className:"col-md-3 col-xs-12",children:[Object(T.jsx)("h4",{children:"Bonus Wagering Report"}),Object(T.jsx)(Oi,Object(d.a)({},c))]}),Object(T.jsxs)("div",{className:ji.a.summary,children:[Object(T.jsx)("h4",{children:"Summary"}),Object(T.jsx)("div",{className:"accounting-section",children:Object(T.jsxs)("div",{className:"row",children:[Object(T.jsx)("div",{className:ji.a.column,children:Object(T.jsxs)("div",{className:"summary-row",children:[Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"+ Real Wager Profit"}),Object(T.jsx)("div",{className:"value",children:a.net_profit})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"+ Bonus Wager Profit"}),Object(T.jsx)("div",{className:"value",children:c.net_profit})]}),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"GGR"}),Object(T.jsx)("div",{className:"value",children:o.gross_gaming_revenue})]})]})}),Object(T.jsx)("div",{className:ji.a.column,children:Object(T.jsxs)("div",{className:"summary-row",children:[Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"+ GGR"}),Object(T.jsx)("div",{className:"value",children:o.gross_gaming_revenue})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"- Net Real Credits"}),Object(T.jsx)("div",{className:"value",children:r.net_real_credits})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"- Net Bonus Money"}),Object(T.jsx)("div",{className:"value",children:s.net_bonus_money})]}),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"NGR"}),Object(T.jsx)("div",{className:"value",children:o.net_gaming_revenue})]})]})}),Object(T.jsx)("div",{className:ji.a.column,children:Object(T.jsxs)("div",{className:"summary-row",children:[Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"+ Net Payments"}),Object(T.jsx)("div",{className:"value",children:i.net_payments})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"- NGR"}),Object(T.jsx)("div",{className:"value",children:o.net_gaming_revenue})]}),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"Expected Balance"}),Object(T.jsx)("div",{className:"value",children:o.expected_balance})]})]})}),Object(T.jsx)("div",{className:ji.a.column,children:Object(T.jsxs)("div",{className:"summary-row",children:[Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"+ Expected Balance"}),Object(T.jsx)("div",{className:"value",children:o.expected_balance})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"- Current Balance"}),Object(T.jsx)("div",{className:"value",children:o.current_balance})]}),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"description",children:"Deficiency"}),Object(T.jsxs)("div",{className:"value",children:[o.deficiency," (",o.accuracy,"%)"]})]})]})})]})})]})]})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)(xe,{group:me.a.USERS.UPDATE_BALANCES,feature:Oe.permissionsConstants.USER_UPDATE_WALLET_BALANCE,children:[Object(T.jsx)("h4",{children:"Add Balance"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.wallet,onChange:function(t){return e.setState({wallet:t})},options:this.props.wallets.filter((function(e){return!e.free_winnings})).map((function(e){return e.value=e.id,e.label=e.currency_type,e}))}),Object(T.jsx)("br",{}),Object(T.jsx)("input",{value:this.state.amount,onChange:function(t){return e.setState({amount:t.target.value})},placeholder:"ex. 4.20"}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:ji.a.buttons,children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_UPDATE_WALLET_BALANCE,children:Object(T.jsx)("button",{onClick:function(){return e.props.updateBalance(t,e.state.wallet.value,"real",e.state.amount)},children:"Submit"})}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.REQUEST_USER_UPDATE_WALLET_BALANCE,children:Object(T.jsx)("button",{onClick:function(){return e.props.updateBalance(t,e.state.wallet.value,"real",e.state.amount,!0)},children:"Submit Request"})})]})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)(xe,{group:me.a.USERS.UPDATE_BALANCES,feature:Oe.permissionsConstants.USER_UPDATE_WALLET_BALANCE,children:[Object(T.jsx)("h4",{children:"Request Refund"}),Object(T.jsx)(Ce.a,{name:"refund_currency",value:this.state.refund_currency,onChange:function(t){return e.setState({refund_currency:t})},options:this.props.wallets.filter((function(e){return!e.free_winnings})).map((function(e){return e.value=e.id,e.label=e.currency_type,e}))}),Object(T.jsx)("br",{}),Object(T.jsx)("input",{value:this.state.refund_amount,onChange:function(t){return e.setState({refund_amount:t.target.value})},placeholder:"ex. 4.20",type:"number"}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("input",{value:this.state.refund_note,onChange:function(t){return e.setState({refund_note:t.target.value})},placeholder:"note"}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.REQUEST_USER_UPDATE_WALLET_BALANCE,children:Object(T.jsx)("div",{className:ji.a.buttons,children:Object(T.jsx)("button",{onClick:function(){return e.props.requestRefund(t,e.state.refund_currency.value,e.state.refund_amount,e.state.refund_note,!0)},children:"Submit Request"})})})]})]})}}]),n}(c.Component),fi=Object(o.b)((function(e){return{selected_currency:e.users.user.selected_currency,wallets:e.users.user.wallets}}),(function(e){return{updateBalance:function(t,n,a,c,r){return e(function(e,t,n,a,c){return function(){var r=Object(f.a)(Object(x.a)().mark((function r(s){var i,o,l;return Object(x.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,i=null,c){r.next=6;break}if(null!==(i=window.password_prompt())){r.next=6;break}return r.abrupt("return");case 6:if(null!==(o=window.prompt("(For User) Please enter a note for this transaction (ex. crash issue refund)"))){r.next=9;break}return r.abrupt("return");case 9:if(!c){r.next=13;break}if(null!==(l=window.prompt("(For Admin) Please enter a reason for this request"))){r.next=13;break}return r.abrupt("return");case 13:return r.next=15,window.api({method:"post",url:c?"/admin/users/"+e+"/request_edit_wallet_balance":"/admin/users/"+e+"/edit_wallet_balance",data:{id:t,sub_wallet_type:n,amount:Math.abs(a),debit:a<0,note:o,staff_note:l},headers:{"x-admin-password":i}});case 15:r.next=20;break;case 17:r.prev=17,r.t0=r.catch(0),re.toast.error(r.t0.message);case 20:s(as(e));case 21:case"end":return r.stop()}}),r,null,[[0,17]])})));return function(e){return r.apply(this,arguments)}}()}(t,n,a,c,r))},requestRefund:function(t,n,a,c,r){return e(function(e,t,n,a,c){return function(){var r=Object(f.a)(Object(x.a)().mark((function r(s){var i;return Object(x.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,i=null,c){r.next=6;break}if(null!==(i=window.password_prompt())){r.next=6;break}return r.abrupt("return");case 6:if(n===Math.abs(n).toFixed(2)){r.next=8;break}return r.abrupt("return",window.alert("Enter amount in valid format, like 3.34"));case 8:return r.next=10,window.api({method:"post",url:"/admin/users/"+e+"/request_refund",data:{wallet_id:t,amount:Math.abs(n).toFixed(2),note:a},headers:{"x-admin-password":i}});case 10:re.toast.success("Refund created. Waiting for approval"),r.next=16;break;case 13:r.prev=13,r.t0=r.catch(0),re.toast.error(r.t0.message);case 16:s(as(e));case 17:case"end":return r.stop()}}),r,null,[[0,13]])})));return function(e){return r.apply(this,arguments)}}()}(t,n,a,c,r))}}}))(xi),vi=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this)).state={page:1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){this.props.updateFingerprints(this.props.match.params.id,this.state.page)}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"Country"}),Object(T.jsx)(we.Th,{children:"IP"}),Object(T.jsx)(we.Th,{children:"IPIntel Score"}),Object(T.jsx)(we.Th,{children:"Mobile IP"}),Object(T.jsx)(we.Th,{children:"User Agent"}),Object(T.jsx)(we.Th,{children:"Hash"}),Object(T.jsx)(we.Th,{children:"Client Version"})]})}),Object(T.jsx)(we.Tbody,{children:this.props.records.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:e.country}),Object(T.jsx)(we.Td,{children:e.ip}),Object(T.jsx)(we.Td,{children:e.ipintel_score}),Object(T.jsx)(we.Td,{children:e.mobile?"true":"false"}),Object(T.jsx)(we.Td,{children:e.user_agent}),Object(T.jsx)(we.Td,{children:e.hash}),Object(T.jsx)(we.Td,{children:e.client_version})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.props.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update()}))}})]})}}]),n}(c.Component),gi=Object(o.b)((function(e){return Object(d.a)({},e.users.fingerprints)}),(function(e){return{updateFingerprints:function(t,n){return e(function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){var c;return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.get("/admin/users/"+e+"/fingerprints",{params:{page:t}});case 2:c=n.sent,a({type:Br,payload:c});case 4:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,n))}}}))(vi),Ti=[{label:"Date - Newest first",value:"created_at_desc"},{label:"Date - Oldest first",value:"created_at_asc"},{label:"Winnings - Highest to lowest",value:"amount_desc"},{label:"Winnings - Lowest to highest",value:"amount_asc"},{label:"Profit - Highest to lowest",value:"profit_desc"},{label:"Profit - Lowest to highest",value:"profit_asc"}],yi="CHANGE_DATE_BIRTH",Ei="CHANGE_EMAIL",Si="CHANGE_PHONE",wi="CHANGE_FIRSTNAME",Ri="CHANGE_LASTNAME",Ai="CHANGE_ADDRESS",Ni="CHANGE_COUNTRY",Ci="CHANGE_KYC_COUNTRY",Ii="CHANGE_CITY",ki="CHANGE_STATE",Di="CHANGE_POSTAL_CODE",Li="CHANGE_TAX_ID",Ui="CHANGE_KYC_LEVEL",Pi=function(e){return{info:{date_of_birth:e.date_of_birth,email:e.email,phone_number:e.phone_number,first_name:e.first_name,last_name:e.last_name,address:e.address,country:e.country,kyc_country:e.kyc_country,city:e.city,state:e.state,postal_code:e.postal_code,tax_id:e.tax_id,otp_phone_number:e.otp_phone_number,otp_phone_number_confirmed:e.otp_phone_number_confirmed},customer:{tax_id:e.tax_id||""},page:1,kyc_level:void 0}},Wi=n(124),Mi=function(e,t){var n=Object(Wi.a)(e);switch(t.type){case yi:n.info.date_of_birth=t.payload;break;case Ei:n.info.email=t.payload;break;case Si:n.info.phone_number=t.payload;break;case wi:n.info.first_name=t.payload;break;case Ri:n.info.last_name=t.payload;break;case Ai:n.info.address=t.payload;break;case Ni:n.info.country=t.payload;break;case Ci:n.info.kyc_country=t.payload;break;case Ii:n.info.city=t.payload;break;case ki:n.info.state=t.payload;break;case Di:n.info.postal_code=t.payload;break;case Li:n.info.tax_id=t.payload,n.customer.tax_id=t.payload;break;case"CHANGE_CUSTOMER":n.customer=t.payload;break;case"CHANGE_PAGE":n.page=t.payload;break;case Ui:var a;n.kyc_level=null!==(a=t.payload)&&void 0!==a?a:{value:1};break;default:return n}return n},Bi=n(27),Fi=n.n(Bi),Gi=function(e){return Object(T.jsxs)("div",{className:Fi.a.panel,id:"stats",children:[Object(T.jsx)("h2",{className:Fi.a.titlePanel,children:"Stats"}),Object(T.jsxs)("div",{className:Fi.a.stat,children:[Object(T.jsx)("h3",{children:"Registered"}),Object(T.jsx)("span",{children:Se.withMinutes(e.created_at)})]}),Object(T.jsxs)("div",{className:Fi.a.stat,children:[Object(T.jsx)("h3",{children:"Accepted tos & privacy policy"}),Object(T.jsx)("span",{children:Se.withMinutes(e.created_at)})]}),Object(T.jsxs)("div",{className:Fi.a.stat,children:[Object(T.jsx)("h3",{children:"Last login"}),Object(T.jsx)("span",{children:Se.withMinutes(e.last_seen)})]}),Object(T.jsxs)("div",{className:Fi.a.stat,children:[Object(T.jsx)("h3",{children:"Signup channel"}),Object(T.jsxs)("span",{children:[e.signup_channel.type," (",e.signup_channel.code,")"]})]}),Object(T.jsxs)("div",{className:Fi.a.stat,children:[Object(T.jsx)("h3",{children:"Level"}),Object(T.jsx)("span",{children:e.level})]})]})},Vi={DOB:"dob",FULLNAME:"fullname",CPF:"cpf",LEGAL_SITUATION:"legal_situation",ANTERIOR_1990:"anterior_1990",OBITO:"obito",EMITTED:"emitted",ORIGIN:"origin",LAST_UPDATED:"date",PEP:"pep",DEPOSIT_ID:"deposit_id",EMAIL_CPF:"email_cpf"},Yi=function(e){var t=e.cpfInfo,n=e.userInfo,a="Not available",c={},r=!1,s=function(e){if(!Object.values(Vi).includes(e))return a;if(!0===r)return c[e];var n=Jn.a.get(t,"response",{});if(!n)return c[Vi.DOB]=a,c[Vi.CPF]=a,c[Vi.ANTERIOR_1990]=a,c[Vi.EMITTED]=a,c[Vi.FULLNAME]=a,c[Vi.LEGAL_SITUATION]=a,c[Vi.OBITO]=a,c[Vi.ORIGIN]=a,c[Vi.PEP]=a,c[Vi.DEPOSIT_ID]=a,c[Vi.EMAIL_CPF]=a,a;if(c={},"exato"===t.provider){var s=Jn.a.get(n,"Result.Obito",a);!0===s?s="Yes":!1===s&&(s="No");var i=Jn.a.get(n,"Result.DataInscricaoAnterior1990",a);!0===i?i="Yes":!1===i&&(i="No"),c[Vi.DOB]=Jn.a.get(n,"Result.DataNascimento",a),c[Vi.CPF]=Jn.a.get(n,"Result.NumeroCpf",a),c[Vi.ANTERIOR_1990]=i,c[Vi.EMITTED]=Jn.a.get(n,"Result.DataEmissao",a),c[Vi.FULLNAME]=Jn.a.get(n,"Result.NomePessoaFisica",a),c[Vi.LEGAL_SITUATION]=Jn.a.get(n,"Result.SituacaoCadastral",a),c[Vi.OBITO]=s,c[Vi.ORIGIN]=Jn.a.get(n,"Result.Origem",a),c[Vi.LAST_UPDATED]=Jn.a.get(n,"Date",a),c[Vi.PEP]=a,c[Vi.DEPOSIT_ID]=a,c[Vi.EMAIL_CPF]=a}else if("serpo"===t.provider)c[Vi.DOB]=Jn.a.get(n,"nascimento",a),c[Vi.CPF]=Jn.a.get(n,"ni",a),c[Vi.ANTERIOR_1990]=a,c[Vi.EMITTED]=a,c[Vi.FULLNAME]=Jn.a.get(n,"nome",a),c[Vi.LEGAL_SITUATION]=Jn.a.get(n,"situacao.descricao",a),c[Vi.OBITO]=a,c[Vi.ORIGIN]=a,c[Vi.LAST_UPDATED]=a,c[Vi.PEP]=a,c[Vi.DEPOSIT_ID]=a,c[Vi.EMAIL_CPF]=a;else if("directa24"===t.provider){var o=Jn.a.get(n,"pep",a);!0===o?o="Yes":!1===o&&(o="No"),c[Vi.DOB]=Jn.a.get(n,"dateOfBirth",a),c[Vi.CPF]=Jn.a.get(n,"document",a),c[Vi.ANTERIOR_1990]=a,c[Vi.EMITTED]=a,c[Vi.FULLNAME]=Jn.a.get(n,"fullName",a),c[Vi.LEGAL_SITUATION]=Jn.a.get(n,"cadastralSituation",a),c[Vi.OBITO]=a,c[Vi.ORIGIN]=a,c[Vi.LAST_UPDATED]=a,c[Vi.PEP]=o,c[Vi.DEPOSIT_ID]=Jn.a.get(n,"depositId",a),c[Vi.EMAIL_CPF]=Jn.a.get(n,"email",a)}else c[Vi.DOB]=a,c[Vi.CPF]=a,c[Vi.ANTERIOR_1990]=a,c[Vi.EMITTED]=a,c[Vi.FULLNAME]=a,c[Vi.LEGAL_SITUATION]=a,c[Vi.OBITO]=a,c[Vi.ORIGIN]=a,c[Vi.LAST_UPDATED]=a,c[Vi.PEP]=a,c[Vi.DEPOSIT_ID]=a,c[Vi.EMAIL_CPF]=a;return r=!0,c[e]};return Object(T.jsxs)("div",{className:Fi.a.panel,id:"cpfinfo",children:[Object(T.jsx)("h2",{className:Fi.a.titlePanel,children:"CPF Info"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Field"}),Object(T.jsx)(we.Th,{children:"Value"})]})}),Object(T.jsxs)(we.Tbody,{children:[Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Provider"}),Object(T.jsx)(we.Td,{children:Jn.a.get(t,"provider","not available")})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Validated?"}),Object(T.jsx)(we.Td,{children:!0===Jn.a.get(t,"is_valid","not available")?"Validated":"Not validated"})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"DOB"}),Object(T.jsx)(we.Td,{children:s(Vi.DOB)})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Full name"}),Object(T.jsx)(we.Td,{children:s(Vi.FULLNAME)})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"CPF"}),Object(T.jsx)(we.Td,{children:s(Vi.CPF)})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Legal situation"}),Object(T.jsx)(we.Td,{children:s(Vi.LEGAL_SITUATION)})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Address"}),Object(T.jsx)(we.Td,{children:Jn.a.get(n,"address","not available")})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Email"}),Object(T.jsx)(we.Td,{children:Jn.a.get(n,"email","not available")})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Emitted"}),Object(T.jsx)(we.Td,{children:s(Vi.EMITTED)})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Before 1990"}),Object(T.jsx)(we.Td,{children:s(Vi.ANTERIOR_1990)})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Deceased"}),Object(T.jsx)(we.Td,{children:s(Vi.OBITO)})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Origen"}),Object(T.jsx)(we.Td,{children:s(Vi.ORIGIN)})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"PEP"}),Object(T.jsx)(we.Td,{children:s(Vi.PEP)})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Deposit id"}),Object(T.jsx)(we.Td,{children:s(Vi.DEPOSIT_ID)})]}),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Email CPF"}),Object(T.jsx)(we.Td,{children:s(Vi.EMAIL_CPF)})]})]})]})]})},Hi=Object(p.withRouter)(Object(o.b)((function(e){return{appUserRole:e.app.user.roles}}),null)((function(e){var t,n=Object(c.useState)(""),a=Object(m.a)(n,2),r=a[0],s=a[1],i=Object(c.useReducer)(Mi,e,Pi),o=Object(m.a)(i,2),l=o[0],u=o[1],j=e.match.params.id;if(e.appUserRole.includes("admin")||e.appUserRole.includes("support_manager")||e.roles.includes("influencer")&&(re.toast.error("Access Denied"),e.history.push("/users/find/")),e.roles)return Object(T.jsxs)("div",{className:Fi.a.main,children:[Object(T.jsx)(Gi,Object(d.a)({},e)),Object(T.jsxs)("div",{className:Fi.a.panel,id:"information-compliance",children:[Object(T.jsx)("h2",{className:Fi.a.titlePanel,children:"Information/Compliance"}),Object(T.jsxs)("div",{className:Fi.a.form,children:[Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"Email"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)("input",{value:l.info.email,onChange:function(e){return u({type:Ei,payload:e.target.value})}})}),Object(T.jsx)("div",{className:Fi.a.button,children:(null===(t=l.info.email)||void 0===t?void 0:t.includes("*"))&&Object(T.jsx)("button",{className:"red small",onClick:function(){window.confirm("Are you sure you wish to request this email?")&&e.updateUser(j,!0)},children:"Request"})}),Object(T.jsx)("div",{className:Fi.a.message,children:e.email_confirmed?"confirmed":"not confirmed"})]}),Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"Phone Number"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)("input",{className:l.info.phone_number!==e.phone_number?"changed":"",value:l.info.phone_number,onChange:function(e){return u({type:Si,payload:e.target.value})}})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message,children:e.phone_number_confirmed?"confirmed":"not confirmed"})]}),Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"OTP Phone Number"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)("input",{value:l.info.otp_phone_number,readOnly:!0})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message,style:{color:e.otp_phone_number_confirmed?"green":"red"},children:e.otp_phone_number_confirmed?"confirmed with SMS code":"not confirmed"})]}),Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"First name"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)("input",{className:l.info.first_name!==e.first_name?"changed":"",value:l.info.first_name,onChange:function(e){return u({type:wi,payload:e.target.value})}})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message})]}),Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"Last name"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)("input",{className:l.info.last_name!==e.last_name?"changed":"",value:l.info.last_name,onChange:function(e){return u({type:Ri,payload:e.target.value})}})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message})]}),Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"Date of birth (YYYY-MM-DD)"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)(er.a,{dateFormat:"yyyy-MM-dd",selected:l.info.date_of_birth?Ee()(l.info.date_of_birth).toDate():"",onChange:function(e){return u({type:yi,payload:Ee.a.utc(e).format("yyyy-MM-DD")})}})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message})]}),Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"Address"}),Object(T.jsxs)("div",{className:Fi.a.input,children:[" ",Object(T.jsx)("input",{className:l.info.address!==e.address?"changed":"",value:l.info.address,onChange:function(e){return u({type:Ai,payload:e.target.value})}})]}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message})]}),Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"ISO Country"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)("input",{className:l.info.country!==e.country?"changed":"",value:l.info.country,onChange:function(e){return u({type:Ni,payload:e.target.value})}})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message})]}),Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"KYC Country"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)("input",{className:l.info.kyc_country!==e.kyc_country?"changed":"",value:l.info.kyc_country,onChange:function(e){return u({type:Ci,ayload:e.target.value})}})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message})]}),Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"City"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)("input",{className:l.info.city!==e.city?"changed":"",value:l.info.city,onChange:function(e){return u({type:Ii,ayload:e.target.value})}})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message})]}),Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"State"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)("input",{className:l.info.state!==e.state?"changed":"",value:l.info.state,onChange:function(e){return u({type:ki,payload:e.target.value})}})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message})]}),Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"Postal code"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)("input",{className:l.info.postal_code!==e.postal_code?"changed":"",value:l.info.postal_code,onChange:function(e){return u({type:Di,payload:e.target.value})}})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message})]})]}),Object(T.jsxs)("div",{className:Fi.a.buttons,children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_UPDATE_KYC_INFO,children:Object(T.jsx)("button",{onClick:function(){var t=Object(Wi.a)(l.info),n="Are you sure you want to make these changes?\n";for(var a in t)t.hasOwnProperty(a)&&(t[a]!==e[a]?n+="".concat(a,": ").concat(e[a]," ==> ").concat(t[a],"\n"):delete t[a]);window.confirm(n)&&e.updateUserInfo(j,t)},children:"Save changes"})}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.REQUEST_USER_UPDATE_KYC_INFO,children:Object(T.jsx)("button",{onClick:function(){var t=Object(Wi.a)(l.info),n="Are you sure you want to make these changes?\n";for(var a in t)t.hasOwnProperty(a)&&(t[a]!==e[a]?n+="".concat(a,": ").concat(e[a]," ==> ").concat(t[a],"\n"):delete t[a]);var c=window.prompt("Please enter a note for this change.");window.confirm(n)&&e.updateCustomerInfo(j,t,!0,c)},children:"Request changes"})})]})]}),Object(T.jsxs)("div",{className:Fi.a.panel,id:"customer-info",style:{flexDirection:"column",alignItems:"flex-start"},children:[Object(T.jsx)("h2",{className:Fi.a.titlePanel,children:"Customer info"}),Object(T.jsxs)("div",{className:Fi.a.form,children:[Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"Tax ID"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)("input",{className:l.customer.tax_id!==e.tax_id?"changed":"",value:l.customer.tax_id,onChange:function(e){return u({type:Li,payload:e.target.value})}})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message})]}),Object(T.jsxs)("div",{className:Fi.a.buttons,children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_UPDATE_KYC_INFO,children:Object(T.jsx)("button",{onClick:function(){var t=Object(Wi.a)(l.customer),n="Are you sure you want to make these changes?\n";for(var a in t)t.hasOwnProperty(a)&&(t[a]!==e[a]?n+="".concat(a,": ").concat(e[a]," ==> ").concat(t[a],"\n"):delete t[a]);window.confirm(n)&&e.updateCustomerInfo(j,t)},children:"Save changes"})}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.REQUEST_USER_UPDATE_KYC_INFO,children:Object(T.jsx)("button",{onClick:function(){var t=Object(Wi.a)(l.customer),n="Are you sure you want to make these changes?\n";for(var a in t)t.hasOwnProperty(a)&&(t[a]!==e[a]?n+="".concat(a,": ").concat(e[a]," ==> ").concat(t[a],"\n"):delete t[a]);var c=window.prompt("Please enter a note for this change.");window.confirm(n)&&e.updateCustomerInfo(j,t,!0,c)},children:"Request changes"})})]})]}),Object(T.jsxs)("div",{className:Fi.a.formSelect,children:[Object(T.jsxs)("div",{className:Fi.a.field,children:[Object(T.jsx)("label",{children:"KYC Level"}),Object(T.jsx)("div",{className:Fi.a.input,children:Object(T.jsx)(Ce.a,{name:"type",value:void 0!==l.kyc_level?l.kyc_level:e.kyc_level||1,onChange:function(e){return u({type:Ui,payload:e.value})},options:[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4},{label:"5",value:5}]})}),Object(T.jsx)("div",{className:Fi.a.button}),Object(T.jsx)("div",{className:Fi.a.message})]}),Object(T.jsx)("div",{className:Fi.a.buttons,children:Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_UPDATE_KYC_LEVEL,children:Object(T.jsx)("button",{disabled:(e.kyc_level||1)===l.kyc_level||!l.kyc_level,onClick:function(){var t="Are you sure you want to make these changes?\n";t+="kyc_level: ".concat(e.kyc_level||"0"," ==> ").concat(l.kyc_level,"\n"),window.confirm(t)&&window.api.post("/admin/users/"+j+"/customer/kyc_level",{kyc_level:l.kyc_level}).then((function(){e.updateUser(j)}))},children:"Save changes"})})})]})]}),Object(T.jsx)(Yi,{cpfInfo:e.cpf_info||{},userInfo:{email:e.email,address:e.address}}),Object(T.jsxs)("div",{className:Fi.a.panel,id:"preferences",children:[Object(T.jsx)("h2",{className:Fi.a.titlePanel,children:"Preferences"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Payment Emails"}),Object(T.jsx)(we.Th,{children:"Marketing Emails"}),Object(T.jsx)(we.Th,{children:"General Emails"})]})}),Object(T.jsx)(we.Tbody,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.payment_emails.toString()}),Object(T.jsx)(we.Td,{children:e.marketing_emails.toString()}),Object(T.jsx)(we.Td,{children:e.general_emails.toString()})]})})]})]}),Object(T.jsxs)("div",{className:Fi.a.panel,id:"auth-methods",children:[Object(T.jsx)("h2",{className:Fi.a.titlePanel,children:"Authentication Methods"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Remote ID"})]})}),Object(T.jsx)(we.Tbody,{children:e.authentication_methods.map((function(t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:t.type}),Object(T.jsxs)(we.Td,{children:[t.remote_id," (","password"===t.type?"Login username: ".concat(e.password_account.username):null,")"]})]},t.remote_id)}))})]})]}),Object(T.jsx)("div",{className:Fi.a.panel,id:"update-email",children:Object(T.jsxs)(xe,{group:me.a.USERS.UPDATE_EMAIL,children:[Object(T.jsx)("h2",{className:Fi.a.titlePanel,children:"Update Email"}),Object(T.jsx)("input",{className:Fi.a.singleInput,placeholder:"new email",value:r,onChange:function(e){return s(e.target.value)}}),Object(T.jsxs)("div",{className:Fi.a.buttons,children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_UPDATE_EMAIL,children:Object(T.jsx)("button",{onClick:function(){/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)&&e.updateEmail(j,r)},children:"Update"})}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.REQUEST_USER_UPDATE_EMAIL,children:Object(T.jsx)("button",{onClick:function(){if(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)){var t=window.prompt("Please enter a note for this change.");e.updateEmail(j,r,!0,t)}},children:"Request Update"})})]})]})})]})}))),qi=Object(o.b)((function(e){return Object(d.a)({},e.users.user)}),(function(e){return{updateUser:function(t,n){e(as(t,n))},saveUser:function(t,n){e(function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.put("/admin/users/"+e,t);case 2:n.sent,a(as(e));case 4:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,n))},updateUserInfo:function(t,n,a){e(function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.post("/admin/users/"+e+"/info",{info:t});case 2:return n.abrupt("return",a(as(e)));case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,n))},updateEmail:function(t,n,a,c){e(function(e,t,n,a){return function(){var c=Object(f.a)(Object(x.a)().mark((function c(r){return Object(x.a)().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,window.api.post(n?"/admin/users/"+e+"/email_request":"/admin/users/"+e+"/email",{email:t,staff_note:a});case 2:return c.abrupt("return",r(as(e)));case 3:case"end":return c.stop()}}),c)})));return function(e){return c.apply(this,arguments)}}()}(t,n,a,c))},updateCustomerInfo:function(t,n,a,c){e(function(e,t,n,a){return function(){var c=Object(f.a)(Object(x.a)().mark((function c(r){return Object(x.a)().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,window.api.post(n?"/admin/users/"+e+"/customer/info_request":"/admin/users/"+e+"/customer/info",{info:t,staff_note:a});case 2:return c.abrupt("return",r(as(e)));case 3:case"end":return c.stop()}}),c)})));return function(e){return c.apply(this,arguments)}}()}(t,n,a,c))}}}))(Hi),Ki=n(94),zi=n.n(Ki),Xi=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={tab:"created",reasons:{}},a}return Object(j.a)(n,[{key:"render",value:function(){var e=this,t=this.props.user_id,n=this.state.tab;return Object(T.jsxs)("div",{id:"kyc-emails",children:[Object(T.jsx)("h3",{children:"Kyc Emails"}),Object(T.jsxs)("div",{className:zi.a.tabbedNav,children:[Object(T.jsx)("div",{className:"created"===n?zi.a.selected:void 0,onClick:function(){e.setState({tab:"created"})},children:"Created"}),Object(T.jsx)("div",{className:"approved"===n?zi.a.selected:void 0,onClick:function(){e.setState({tab:"approved"})},children:"Approved"}),Object(T.jsx)("div",{className:"declined"===n?zi.a.selected:void 0,onClick:function(){e.setState({tab:"declined"})},children:"Declined"}),Object(T.jsx)("div",{className:"email_confirmation"===n?zi.a.selected:"",onClick:function(){e.setState({tab:"email_confirmation"})},children:"Email Confirmation"})]}),"created"===n&&Object(T.jsxs)("div",{className:zi.a.kycCreatedEmail,children:[Object(T.jsxs)("div",{className:zi.a.inputs,children:[Object(T.jsxs)("div",{onClick:function(){e.setState({id_email:!e.state.id_email})},children:[Object(T.jsx)("label",{children:"Id:"}),Object(T.jsx)("input",{checked:this.state.id_email,type:"checkbox"})]}),Object(T.jsxs)("div",{onClick:function(){e.setState({address_email:!e.state.address_email})},children:[Object(T.jsx)("label",{children:"Address:"}),Object(T.jsx)("input",{checked:this.state.address_email,type:"checkbox"})]}),Object(T.jsxs)("div",{onClick:function(){e.setState({card_email:!e.state.card_email})},children:[Object(T.jsx)("label",{children:"Credit card:"}),Object(T.jsx)("input",{checked:this.state.card_email,type:"checkbox"})]}),Object(T.jsxs)("div",{onClick:function(){e.setState({bank_email:!e.state.bank_email})},children:[Object(T.jsx)("label",{children:"Bank IBAN:"}),Object(T.jsx)("input",{checked:this.state.bank_email,type:"checkbox"})]}),Object(T.jsxs)("div",{onClick:function(){e.setState({proof_of_deposit:!e.state.proof_of_deposit})},children:[Object(T.jsx)("label",{children:"Proof of deposit"}),Object(T.jsx)("input",{checked:this.state.proof_of_deposit,type:"checkbox"})]}),Object(T.jsxs)("div",{onClick:function(){e.setState({source_of_funds:!e.state.source_of_funds})},children:[Object(T.jsx)("label",{children:"Source of Funds"}),Object(T.jsx)("input",{checked:this.state.source_of_funds,type:"checkbox"})]})]}),Object(T.jsx)("button",{onClick:function(){if(window.confirm("Are you sure you want to email this user?")){var n={status:"created",id_type:e.state.id_email,address_type:e.state.address_email,card_type:e.state.card_email,iban_type:e.state.bank_email,proof_of_deposit:e.state.proof_of_deposit,source_of_funds:e.state.source_of_funds};Object.keys(n).forEach((function(e){n[e]&&uc.includes(e)||delete n[e]})),e.props.notifyKYCVerification(t,n)}},children:"Send created email"})]}),"approved"===n&&Object(T.jsxs)("div",{className:zi.a.kycCreatedEmail,children:[Object(T.jsxs)("div",{className:zi.a.inputs,children:[Object(T.jsxs)("div",{onClick:function(){e.setState({approved_id_email:!e.state.approved_id_email})},children:[Object(T.jsx)("label",{children:"Id:"}),Object(T.jsx)("input",{checked:this.state.approved_id_email,type:"checkbox"})]}),Object(T.jsxs)("div",{onClick:function(){e.setState({approved_address_email:!e.state.approved_address_email})},children:[Object(T.jsx)("label",{children:"Address:"}),Object(T.jsx)("input",{checked:this.state.approved_address_email,type:"checkbox"})]}),Object(T.jsxs)("div",{onClick:function(){e.setState({approved_card_email:!e.state.approved_card_email})},children:[Object(T.jsx)("label",{children:"Credit card:"}),Object(T.jsx)("input",{checked:this.state.approved_card_email,type:"checkbox"})]}),Object(T.jsxs)("div",{onClick:function(){e.setState({approved_bank_email:!e.state.approved_bank_email})},children:[Object(T.jsx)("label",{children:"Bank IBAN:"}),Object(T.jsx)("input",{checked:this.state.approved_bank_email,type:"checkbox"})]}),Object(T.jsxs)("div",{onClick:function(){e.setState({approved_proof_of_deposit:!e.state.approved_proof_of_deposit})},children:[Object(T.jsx)("label",{children:"Proof of deposit"}),Object(T.jsx)("input",{checked:this.state.approved_proof_of_deposit,type:"checkbox"})]}),Object(T.jsxs)("div",{onClick:function(){e.setState({approved_source_of_funds:!e.state.approved_source_of_funds})},children:[Object(T.jsx)("label",{children:"Source of Funds"}),Object(T.jsx)("input",{checked:this.state.approved_source_of_funds,type:"checkbox"})]})]}),Object(T.jsx)("button",{onClick:function(){if(window.confirm("Are you sure you want to email this user?")){var n={status:"approved",id_type:e.state.approved_id_email,address_type:e.state.approved_address_email,card_type:e.state.approved_card_email,iban_type:e.state.approved_bank_email,proof_of_deposit:e.state.approved_proof_of_deposit,source_of_funds:e.state.approved_source_of_funds};Object.keys(n).forEach((function(e){n[e]&&uc.includes(e)||delete n[e]})),e.props.notifyKYCVerification(t,n)}},children:"Send approved email"})]}),"declined"===n&&Object(T.jsxs)("div",{className:"kyc-status-notice",children:[Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Type:"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.type,onChange:function(t){return e.setState({type:t,reasons:{}})},options:lc.map((function(e){return{value:e,label:e}}))})]}),this.state.type&&Object(T.jsxs)("div",{children:[Object(T.jsx)("label",{children:"Reasons"}),Object(T.jsx)("div",{style:{display:"flex"},children:dc[this.state.type.value].map((function(t){var n=t.split("_").join(" ");return Object(T.jsxs)("div",{style:{marginRight:15},onClick:function(){e.setState({reasons:Object(d.a)(Object(d.a)({},e.state.reasons||{}),{},Object(_.a)({},t,!e.state.reasons[t]))})},children:[Object(T.jsxs)("label",{style:{marginRight:10},children:[n,":"]}),Object(T.jsx)("input",{checked:e.state.reasons[t],type:"checkbox"})]})}))})]}),Object(T.jsx)("button",{disabled:Object.keys(this.state.reasons).filter((function(t){return e.state.reasons[t]})).length<=0||!this.state.type,onClick:function(){if(window.confirm("Are you sure you want to email this user?")){var n={status:"declined",reasons:e.state.reasons,type:e.state.type.value};Object.keys(n.reasons).forEach((function(e){n.reasons[e]&&dc[n.type].includes(e)||delete n.reasons[e]})),e.props.notifyKYCVerification(t,n)}},children:"Send declined email"})]}),"email_confirmation"===n&&Object(T.jsx)("div",{className:"kyc-status-notice",children:Object(T.jsx)("button",{onClick:function(){window.confirm("Are you sure you want to email this user?")&&e.props.resendEmailConfirmation(t)},children:"Send email"})}),Object(T.jsx)("br",{})]})}}]),n}(c.Component),Zi=Object(o.b)((function(e){return Object(d.a)({},e.users.user)}),(function(e){return{notifyKYCVerification:function(t,n){e(js(t,n))},resendEmailConfirmation:function(e){ps(e)}}}))(Xi),Qi=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this)).state={},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.props.getDocuments(this.props.match.params.id)}},{key:"render",value:function(){var e=this,t=this.props.match.params.id;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("hr",{}),Object(T.jsx)("h4",{children:"User Documents"}),Object(T.jsx)("br",{}),Object(T.jsx)("div",{className:"documents",children:(this.props.documents||[]).map((function(n,a){return Object(T.jsxs)("div",{className:"document",children:[n.original_name,Object(T.jsx)("br",{}),n.type,Object(T.jsx)("br",{}),Object(T.jsx)("button",{className:"small",onClick:function(){e.props.getDocument(t,n),e.props.openDocumentModal()},children:"View"})]},a)}))}),Object(T.jsx)("br",{})]})}}]),n}(c.Component),Ji=Object(o.b)((function(e){return Object(d.a)({},e.users.user)}),(function(e){return{getDocuments:function(t){return e(ss(t))},getDocument:function(t,n){return e(is(t,n))}}}))(Qi),$i=function(e){var t=e.condition,n=e.children,a=e.defaultComponent;return t?n:a||null},eo=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this)).state={page:1,id_email:!1,address_email:!1,card_email:!1,bank_email:!1,proof_of_deposit:!1,kyc_verifications:[],accountChanges:{},isLoading:!1,deposits:[]},a}return Object(j.a)(n,[{key:"fetchDeposits",value:function(){var e=this;this.setState({isLoading:!0}),window.api.get("/admin/users/".concat(this.props.match.params.id,"/deposits"),{params:{page:1}}).then((function(t){var n=t.meta,a=t.records;e.setState({deposits:a,total_pages:n.total_pages})})).finally((function(){return e.setState({isLoading:!1})}))}},{key:"componentDidMount",value:function(){var e=this,t=this.props.match.params.id;this.props.updatePaymentAccounts(t),window.api.get("/admin/users/"+t+"/kyc_verifications").then((function(t){return e.setState({kyc_verifications:t})})),this.fetchDeposits()}},{key:"renderDocument",value:function(){var e=this.props.document;return"image"===e.type?Object(T.jsx)("img",{src:e.data,alt:""}):"pdf"===e.type?Object(T.jsx)("iframe",{src:e.data,type:"application/pdf",style:{width:"100%",height:"100%",overflow:"auto"}}):void 0}},{key:"render",value:function(){var e,t=this,n=this.props.match.params.id,a=Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("span",{children:"Masked account: "}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.kyc_masked_account,onChange:function(e){return t.setState({kyc_masked_account:e})},options:Object(ct.a)((this.props.payment_methods||[]).map((function(e){return t.state.kyc_type&&e.type===t.state.kyc_type.value?e.accounts.map((function(t){return{value:t.masked_account,label:e.type+": "+t.masked_account}})):[]})).flat())})]});return Object(T.jsxs)("div",{className:"documents-page",children:[Object(T.jsxs)($s.a,{overlayClassName:"document-modal",isOpen:this.state.document_modal_open,onRequestClose:function(e){return t.setState({document_modal_open:!1})},children:[Object(T.jsx)("div",{onClick:function(e){return t.setState({document_modal_open:!1})},className:"close",style:{fontSize:"20px"},children:"Close"}),this.renderDocument()]}),Object(T.jsxs)($s.a,{overlayClassName:"document-modal upload-modal",isOpen:this.state.upload_modal_open,onRequestClose:function(e){return t.setState({upload_modal_open:!1})},children:[Object(T.jsx)("div",{onClick:function(e){return t.setState({upload_modal_open:!1})},className:"close",style:{fontSize:"20px"},children:"Close"}),Object(T.jsx)("h3",{children:"Sub type"}),Object(T.jsx)(Ce.a,{name:"subtype",value:this.state.sub_type,onChange:function(e){return t.setState({sub_type:e})},options:["passport","drivers_license","national_id_card","bank_credit_statement","utility_bill","letter_from_government","credit_card","iban"].map((function(e){return{value:e,label:e}}))}),Object(T.jsx)("input",{type:"file",id:"document-upload-select",name:"filename"}),Object(T.jsx)("button",{onClick:function(){var e=document.getElementById("document-upload-select");t.props.upload(e.files,t.state.upload_modal_open.verification_id,t.state.sub_type.value,n,t.state.upload_modal_open.back).then((function(){t.setState({upload_modal_open:!1})}))},children:"Upload"})]}),Object(T.jsxs)($s.a,{overlayClassName:"document-modal",isOpen:this.state.document_modal_open,onRequestClose:function(e){return t.setState({document_modal_open:!1})},children:[Object(T.jsx)("div",{onClick:function(e){return t.setState({document_modal_open:!1})},className:"close",style:{fontSize:"20px"},children:"Close"}),this.renderDocument()]}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_KYC_SEND_NOTIFICATION,children:Object(T.jsx)(Zi,{user_id:n})}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.USER_KYC_CREATE_VERIFICATION,children:[Object(T.jsx)("h5",{children:"Create"}),Object(T.jsx)("span",{children:"Type: "}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.kyc_type,onChange:function(e){return t.setState({kyc_type:e})},options:oc.map((function(e){return{value:e,label:e}}))}),Object(T.jsxs)($i,{condition:["proof_of_deposit"].includes(null===(e=this.state.kyc_type)||void 0===e?void 0:e.value),defaultComponent:a,children:[Object(T.jsx)("span",{children:"Deposit: "}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.deposit_selected,onChange:function(e){return t.setState({deposit_selected:e})},options:(this.state.deposits||[]).map((function(e){return{value:e.id,label:"Deposit ID: ".concat(e.id)}}))})]}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{className:"small",onClick:function(){var e,a=null===(e=t.state.deposit_selected)||void 0===e?void 0:e.value,c=null,r=null;t.state.kyc_type&&(r=t.state.kyc_type.value,["bank_iban","credit_card","credit_card_switch"].includes(r)&&t.state.kyc_masked_account&&(c=t.state.kyc_masked_account.value),t.props.createKYCVerification(n,r,c,a))},children:"Create"})]}),Object(T.jsx)("hr",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Masked Account"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Sub type"}),Object(T.jsx)(we.Th,{children:"Related to"}),Object(T.jsx)(we.Th,{children:"Requested at"}),Object(T.jsx)(we.Th,{children:"Updated at"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.USER_KYC_UPDATE_VERIFICATION,children:[Object(T.jsx)(we.Th,{children:"Reference"}),Object(T.jsx)(we.Th,{children:"Front image"}),Object(T.jsx)(we.Th,{children:"Back image"}),Object(T.jsx)(we.Th,{children:"Note"})]})]})}),Object(T.jsx)(we.Tbody,{children:(this.state.kyc_verifications||[]).map((function(e,a){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.masked_account}),Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.sub_type}),Object(T.jsx)(we.Td,{children:e.deposit_id?"Deposit #".concat(e.deposit_id):""}),Object(T.jsx)(we.Td,{children:Se.onlyDate(e.created_at)}),Object(T.jsx)(we.Td,{children:Se.onlyDate(e.updated_at)}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.USER_KYC_UPDATE_VERIFICATION,children:[Object(T.jsx)(we.Td,{children:e.reference_id}),Object(T.jsxs)(we.Td,{children:[e.user_document_id&&Object(T.jsx)("div",{style:{cursor:"pointer"},children:Object(T.jsx)("span",{onClick:function(){t.props.getDocument(n,t.props.documents.find((function(t){return t.id===e.user_document_id}))),t.setState({document_modal_open:!0})},children:"View Front"})}),Object(T.jsx)("button",{className:"small",onClick:function(){t.setState({upload_modal_open:{verification_id:e.id}})},children:"Upload Front"})]}),Object(T.jsxs)(we.Td,{children:[e.back_document_id&&Object(T.jsx)("div",{style:{cursor:"pointer"},children:Object(T.jsx)("span",{onClick:function(){t.props.getDocument(n,t.props.documents.find((function(t){return t.id===e.back_document_id}))),t.setState({document_modal_open:!0})},children:"View Back"})}),Object(T.jsx)("button",{className:"small",onClick:function(){t.setState({upload_modal_open:{verification_id:e.id,back:!0}})},children:"Upload Back"})]}),Object(T.jsxs)(we.Td,{children:[Object(T.jsx)("button",{className:"small",onClick:function(){t.props.updateKYCVerification(e.id,"invalid",n).then((function(e){window.api.get("/admin/users/"+n+"/kyc_verifications").then((function(e){return t.setState({kyc_verifications:e})}))}))},children:"Set Invalid"}),Object(T.jsx)("button",{className:"small",onClick:function(){t.props.updateKYCVerification(e.id,"complete",n).then((function(e){window.api.get("/admin/users/"+n+"/kyc_verifications").then((function(e){return t.setState({kyc_verifications:e})}))}))},children:"Mark as complete"}),Object(T.jsx)("button",{className:"small",onClick:function(){t.props.updateKYCVerification(e.id,"deleted",n).then((function(e){window.api.get("/admin/users/"+n+"/kyc_verifications").then((function(e){return t.setState({kyc_verifications:e})}))}))},children:"Delete"})]}),Object(T.jsx)(we.Td,{children:e.note})]})]},a)}))})]}),Object(T.jsx)("h4",{children:"Payment Accounts"}),Object(T.jsx)("br",{}),Object(T.jsx)("div",{className:"accounts",children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_KYC_UPDATE_VERIFICATION,children:Object(T.jsx)(we.Th,{children:"Update"})}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Masked Account"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Data"}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_DOCUMENTS_VIEW_FILE,children:Object(T.jsx)(we.Th,{children:"View Document"})}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_KYC_UPDATE_VERIFICATION,children:Object(T.jsx)(we.Th,{children:"Action"})})]})}),Object(T.jsx)(we.Tbody,{children:(this.props.payment_methods||[]).map((function(e,a){return e.accounts.map((function(a){var r=t.state.accountChanges[a.id]||{},s=r.masked_account&&r.masked_account!==a.masked_account,i=r.status&&r.status!==a.status;return Object(T.jsxs)(we.Tr,{className:"account",children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_KYC_UPDATE_VERIFICATION,children:Object(T.jsx)(we.Td,{children:Object(T.jsx)("button",{disabled:!s&&!i,onClick:function(){var e="Are you sure you want to update payment account ".concat(a.id,"? \nChanges: "),c={};s&&(e+="".concat(a.masked_account," => ").concat(r.masked_account," \n"),c.masked_account=r.masked_account),i&&(e+="".concat(a.status," => ").concat(r.status," \n"),c.status=r.status),window.confirm(e)&&window.api.post("/admin/users/".concat(n,"/payment_accounts/").concat(a.id),c).then((function(e){re.toast.info("Updated."),t.props.updatePaymentAccounts(n)}))},children:"Update"})})}),Object(T.jsx)(we.Td,{children:a.id}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("input",{onChange:function(e){t.setState({accountChanges:Object(d.a)(Object(d.a)({},t.state.accountChanges),{},Object(_.a)({},a.id,Object(d.a)(Object(d.a)({},r),{},{masked_account:e.target.value})))})},value:r.masked_account||a.masked_account})}),Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(Ce.a,{style:{width:200},name:"type",value:r.status||a.status,onChange:function(e){return t.setState({accountChanges:Object(d.a)(Object(d.a)({},t.state.accountChanges),{},Object(_.a)({},a.id,Object(d.a)(Object(d.a)({},r),{},{status:e.value})))})},options:["created","deleted","active"].map((function(e){return{value:e,label:e}}))})}),Object(T.jsx)(we.Td,{children:JSON.stringify(a.data,null,4)}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_DOCUMENTS_VIEW_FILE,children:Object(T.jsx)(we.Td,{children:(a.verification||{}).user_document_id&&Object(T.jsxs)("div",{children:[Object(T.jsx)("span",{onClick:function(){t.props.getDocument(n,a.verification.user_document),t.setState({document_modal_open:!0})},children:"View Document"}),Object(T.jsx)("span",{style:{marginLeft:"10px"},onClick:function(){t.setState({document_modal_open:!1})},children:"Hide Document"})]})})}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_KYC_UPDATE_VERIFICATION,children:Object(T.jsx)(we.Td,{children:a.verification?"pending_review"===a.verification.status?Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("button",{className:"small",onClick:function(){return t.props.approvePaymentVerification(n,a.verification.id)},children:"Accept"}),Object(T.jsx)("button",{className:"small",onClick:function(){var e=window.prompt("Enter reason for rejecting document to be displayed to user.");t.props.rejectPaymentVerification(n,a.verification.id,e)},children:"Decline"})]}):void 0:null})})]},a.id)}))}))})]})}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)(xe,{group:me.a.USERS.DOCUMENTS,children:Object(T.jsx)(Ji,Object(d.a)(Object(d.a)({},this.props),{},{openDocumentModal:function(){t.setState({document_modal_open:!0})}}))})]})}}]),n}(c.Component),to=Object(o.b)((function(e){return Object(d.a)({},e.users.user)}),(function(e){return{updatePaymentAccounts:function(t){e(ls(t))},getDocuments:function(t){return e(ss(t))},getDocument:function(t,n){return e(is(t,n))},createKYCVerification:function(t,n,a,c){e(ds(t,n,a,c))},updateKYCVerification:function(t,n,a){return e(us(t,n,a))},notifyKYCVerification:function(t,n){e(js(t,n))},approvePaymentVerification:function(t,n){e(function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.post("/admin/users/"+e+"/payment_accounts/approve",{payment_account_verification_id:t});case 2:return n.abrupt("return",a(ls(e)));case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,n))},rejectPaymentVerification:function(t,n,a){e(function(e,t,n){return function(){var a=Object(f.a)(Object(x.a)().mark((function a(c){return Object(x.a)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,window.api.post("/admin/users/"+e+"/payment_accounts/reject",{payment_account_verification_id:t,note:n});case 2:return a.abrupt("return",c(ls(e)));case 3:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()}(t,n,a))},upload:function(t,n,a,c,r){return e(function(e,t,n,a,c){return function(){var r=Object(f.a)(Object(x.a)().mark((function r(s){var i;return Object(x.a)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((i=new FormData).append("file",e[0]),r.prev=2,!c){r.next=8;break}return r.next=6,window.api.put("/admin/users/".concat(a,"/kyc_verifications/upload?verification_id=").concat(t,"&sub_type=").concat(n,"&back=true"),i);case 6:r.next=10;break;case 8:return r.next=10,window.api.put("/admin/users/".concat(a,"/kyc_verifications/upload?verification_id=").concat(t,"&sub_type=").concat(n),i);case 10:s(as(a)),s(ss(a)),re.toast.info("uploaded"),r.next=18;break;case 15:r.prev=15,r.t0=r.catch(2),re.toast.error(r.t0.message);case 18:case"end":return r.stop()}}),r,null,[[2,15]])})));return function(e){return r.apply(this,arguments)}}()}(t,n,a,c,r))}}}))(eo),no=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this)).state={page:1,records:[],meta:{},calculate:null},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){var e=this;window.api.get("/admin/users/".concat(this.props.match.params.id,"/loyalty?page=").concat(this.state.page)).then((function(t){e.setState(Object(d.a)({},t))}))}},{key:"calculate",value:function(){var e=this;window.api.post("/admin/users/".concat(this.props.match.params.id,"/loyalty/calculate")).then((function(t){e.setState({calculate:t})}))}},{key:"credit",value:function(){var e=this;window.api.post("/admin/users/".concat(this.props.match.params.id,"/loyalty/credit")).then((function(t){re.toast.success("Credited"),e.setState({calculate:null}),e.update()}))}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsx)("div",{children:Object(T.jsx)("button",{onClick:function(){return e.calculate()},children:"Calculate current"})}),this.state.calculate&&Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-xs-3",children:[Object(T.jsx)("h4",{children:"Calculation Values"}),Object.keys(this.state.calculate.calculationValues).map((function(t){return Object(T.jsxs)("div",{children:[t,": ",e.state.calculate.calculationValues[t]]})}))]}),Object(T.jsxs)("div",{className:"col-xs-3",children:[Object(T.jsx)("h4",{children:"Property Values"}),Object(T.jsxs)("div",{children:["rank: ",this.state.calculate.rank]}),Object(T.jsxs)("div",{children:["level: ",this.state.calculate.level]}),Object(T.jsxs)("div",{children:["percentage: ",this.state.calculate.percentage]}),Object(T.jsxs)("div",{children:["period: ",this.state.calculate.period_start_time," - ",this.state.calculate.period_end_time]})]}),Object(T.jsxs)("div",{className:"col-xs-3",children:[Object(T.jsx)("h4",{children:"Credit"}),Object(T.jsxs)("div",{children:["Status: ",this.state.calculate.type]}),Object(T.jsxs)("div",{children:["Amount: ",this.state.calculate.calculationValues.amount," ",this.state.calculate.calculationValues.currency_type]}),Object(T.jsx)("button",{onClick:function(){return e.credit()},children:"Credit cashback"})]})]}),Object(T.jsx)("hr",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Period"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Level"}),Object(T.jsx)(we.Th,{children:"Percentage"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Calculation variables"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.records.map((function(e,t){return e.loyalty_period=e.loyalty_period||{},e.loyalty_period.starts_at=e.loyalty_period.starts_at||"",e.loyalty_period.ends_at=e.loyalty_period.ends_at||"",e.user=e.user||{},e.transaction=e.transaction||{wallet:{}},Object(T.jsxs)(we.Tr,{children:[Object(T.jsxs)(we.Td,{children:[e.loyalty_period.starts_at.split("T")[0]," - ",e.loyalty_period.ends_at.split("T")[0]]}),Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsx)(we.Td,{children:e.level}),Object(T.jsx)(we.Td,{children:e.percentage}),Object(T.jsxs)(we.Td,{children:[e.transaction.amount||0," ",e.transaction.wallet.currency_type]}),Object(T.jsx)(we.Td,{children:Object.keys(e.calculation_values||{}).map((function(t){return Object(T.jsxs)("span",{style:{marginRight:5},children:[t," = ",e.calculation_values[t]]})}))})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update()}))}})]})}}]),n}(c.Component),ao=Object(p.withRouter)(no),co=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,total_pages:0,bets:[],queryFilter:{},hasChange:!1,gameStartedAtStart:null,gameStartedAtEnd:null,gameSettledAtStart:null,gameSettledAtEnd:null,joinDateStarted:null,lastDepositStarted:null,joinDateSettled:null,lastDepositSettled:null},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetch()}},{key:"componentDidUpdate",value:function(e,t,n){t.page!==this.state.page&&this.fetch()}},{key:"fetch",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.prev=1,e.next=4,window.api.get("/admin/users/".concat(this.props.match.params.id,"/mines_bets?page=").concat(this.state.page));case 4:t=e.sent,n=t.total_pages,a=t.records,this.setState({total_pages:n,bets:a}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),re.toast.error(e.t0.message);case 13:this.setState({isLoading:!1});case 14:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"rollback",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.post("/admin/mines_bets/".concat(t));case 3:re.toast.success("Bet rolled back"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),re.toast.error("Bet already rolled back.");case 9:this.fetch();case 10:case"end":return e.stop()}}),e,this,[[0,6]])})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Game Created At"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Bet Settled At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Number of mines"}),Object(T.jsx)(we.Th,{children:"Tiles shown"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.bets.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.round_id),children:e.round_id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.created_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_placed_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_settled_at)}),Object(T.jsxs)(we.Td,{children:[e.amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.number_of_mines}),Object(T.jsx)(we.Td,{children:e.tiles_shown}),Object(T.jsxs)(we.Td,{className:"good",children:[e.win_amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsxs)(we.Td,{className:e.profit>=0?"good":"bad",children:[e.profit," ",e.currency_type]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),ro=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,total_pages:0,bets:[],queryFilter:{},hasChange:!1,gameStartedAtStart:null,gameStartedAtEnd:null,gameSettledAtStart:null,gameSettledAtEnd:null,joinDateStarted:null,lastDepositStarted:null,joinDateSettled:null,lastDepositSettled:null},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetch()}},{key:"componentDidUpdate",value:function(e,t,n){t.page!==this.state.page&&this.fetch()}},{key:"fetch",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.prev=1,e.next=4,D(this.props.match.params.id,{page:this.state.page,type:"mines"});case 4:t=e.sent,this.setState({total_pages:t.pages,bets:t.records}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),re.toast.error(e.t0.message);case 11:this.setState({isLoading:!1});case 12:case"end":return e.stop()}}),e,this,[[1,8]])})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Bet ID"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Number of mines"}),Object(T.jsx)(we.Th,{children:"Tiles shown"}),Object(T.jsx)(we.Th,{children:"Free"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.bets.map((function(e,t){var n,a;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:null!==(n=e.wallet_params)&&void 0!==n&&n.free_bet?e.id:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.remoteRoundId),children:e.id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.created_at)}),Object(T.jsxs)(we.Td,{children:[e.amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.number_of_mines}),Object(T.jsx)(we.Td,{children:e.tiles_shown}),Object(T.jsx)(we.Td,{children:null!==(a=e.wallet_params)&&void 0!==a&&a.free_bet?"Yes":"No"}),Object(T.jsxs)(we.Td,{className:"good",children:[e.winnings," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsxs)(we.Td,{className:e.profit>=0?"good":"bad",children:[e.profit," ",e.currency_type]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),so=function(){var e=Object(c.useState)({total_pages:0,bets:[]}),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(!1),s=Object(m.a)(r,2),i=s[0],o=s[1],d=Object(c.useState)(1),u=Object(m.a)(d,2),j=u[0],b=u[1],h=Object(p.useParams)().id,O=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o(!0),e.prev=1,e.next=4,D(h,{page:j,type:"tower"});case 4:t=e.sent,a({total_pages:t.pages,bets:t.records}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),re.toast.error(e.t0.message);case 11:o(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();return Object(c.useEffect)((function(){O()}),[j]),Object(T.jsxs)("div",{style:{position:"relative",minHeight:500},children:[i&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Bet ID"}),Object(T.jsx)(we.Th,{children:"Game ID"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Free"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:n.bets.map((function(e,t){var n=e.remoteRoundId,a=e.created_at,c=e.id,r=e.amount,s=e.currency_type,i=e.winnings,o=e.status,d=e.profit,u=e.wallet_params,j=e.roundId;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:null!==u&&void 0!==u&&u.free_bet?Object(T.jsx)("span",{children:c}):Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(n),children:c})}),Object(T.jsx)(we.Td,{children:j}),Object(T.jsx)(we.Td,{children:Se.withSeconds(a)}),Object(T.jsxs)(we.Td,{children:[r," ",s]}),Object(T.jsx)(we.Td,{children:null!==u&&void 0!==u&&u.free_bet?"Yes":"No"}),Object(T.jsx)(we.Td,{className:"good",children:i>0?"".concat(parseFloat(i).toFixed(4)," ").concat(s):"-"}),Object(T.jsx)(we.Td,{children:o}),Object(T.jsxs)(we.Td,{className:d>=0?"good":"bad",children:[d," ",s]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:n.total_pages,update:function(e){return b(e)}})]})},io=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={balances:[],transactions:{pagination:{total_pages:1,records_per_page:50},records:[]}},a.base="/admin/users/".concat(e.match.params.id,"/mystery_box_balances"),a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){he(Oe.permissionsConstants.USER_MYSTERY_BOXES_VIEW_LIST_BALANCES)&&this.getSpins(),he(Oe.permissionsConstants.USER_MYSTERY_BOXES_ADD_SPINS)&&this.props.updateBoxes(),he(Oe.permissionsConstants.USER_MYSTERY_BOXES_VIEW_LIST_TRANSACTIONS)&&this.updateLedger()}},{key:"getSpins",value:function(){var e=this;window.api.get(this.base).then((function(t){return e.setState({balances:t})}))}},{key:"addSpins",value:function(e,t){var n=this;window.api.post("/admin/credit_mystery_box_spins",{mystery_box_id:e,spins:t,user_id:this.props.match.params.id,note:"admin"}).then((function(){n.getSpins(),n.updateLedger()}))}},{key:"updateLedger",value:function(){var e=this,t={};this.table&&(t={page:this.table.state.page+1,sorting:this.table.state.sorted[0],filters:this.table.state.filtered,mystery_box_balance_id:this.state.mystery_box_balance_id_filter}),window.api.get("/admin/users/".concat(this.props.match.params.id,"/mystery_box_transactions"),{params:t}).then((function(t){e.setState({transactions:t})}))}},{key:"render",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Mystery Box Balances"}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_MYSTERY_BOXES_VIEW_LIST_BALANCES,children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Mystery Box"}),Object(T.jsx)(we.Th,{children:"Spins Available"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.balances.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/rewards/mystery-boxes/".concat(e.mystery_box.id),children:e.mystery_box.name})}),Object(T.jsx)(we.Td,{children:e.spins})]})}))})]})}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.CREDIT_MYSTERY_BOX_SPINS,children:[Object(T.jsx)("br",{}),Object(T.jsx)("hr",{}),Object(T.jsx)("h4",{children:"Modify spins"}),Object(T.jsx)(Ce.a,{placeholder:"Select a mystery box",name:"type",value:this.state.mystery_box_id,onChange:function(t){return e.setState({mystery_box_id:t.value})},options:this.props.boxes.map((function(e){return{label:"ID: ".concat(e.id," - ").concat(e.name),value:e.id}}))}),Object(T.jsx)("br",{}),Object(T.jsx)("input",{placeholder:"ex. 4",ref:function(t){return e.spins_amount=t}}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{onClick:function(){var t=e.spins_amount.value;isNaN(+t)||e.addSpins(e.state.mystery_box_id,t)},children:"Add Rounds"}),Object(T.jsx)("br",{}),Object(T.jsx)("hr",{})]}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.USER_MYSTERY_BOXES_VIEW_LIST_TRANSACTIONS,children:[Object(T.jsx)("h4",{children:"Transaction Ledger"}),Object(T.jsx)(Ce.a,{placeholder:"Filter for box specific balance",name:"type",value:this.state.mystery_box_balance_id_filter,onChange:function(t){e.setState({mystery_box_balance_id_filter:t.value},(function(){return e.updateLedger()}))},options:this.state.balances.map((function(e){return{label:"ID: ".concat(e.id," - ").concat(e.mystery_box.name),value:e.id}}))}),Object(T.jsx)(Fn.a,{ref:function(t){return e.table=t},manual:!0,showPageJump:!1,pages:this.state.transactions.pagination.total_pages,pageSize:this.state.transactions.pagination.records_per_page,data:this.state.transactions.records,multiSort:!1,showPageSizeOptions:!1,onPageChange:function(t){e.updateLedger()},onSortedChange:function(t,n,a){e.updateLedger()},columns:[{id:"id",Header:"ID",accessor:function(e){return e.id},maxWidth:50},{id:"created_at",Header:"Created",accessor:function(e){return Se.withMinutes(e.created_at)},maxWidth:200},{id:"bonus_round_type",Header:"Mystery Box Name",accessor:function(e){return Object(T.jsx)(l.b,{to:"/rewards/mystery-boxes/".concat(e.mystery_box_balance.mystery_box.id),children:e.mystery_box_balance.mystery_box.name})}},{id:"amount",Header:"Amount",accessor:"amount"},{id:"closing_balance",Header:"Closing Balance",accessor:"closing_balance"},{id:"note",Header:"Note",accessor:"note"}]})]})]})}}]),n}(c.Component),oo=Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e.users.user),{},{boxes:e.rewards.mystery_boxes.records})}),(function(e){return{updateBoxes:function(){return e(Un())}}}))(io),lo=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={query:"",page:1,results:{pagination:{total_pages:1,records_per_page:50},records:[]},edit_row:{},creating:!1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update(),he(Oe.permissionsConstants.REWARDS_VIEW_LIST)&&this.props.dispatch(Pn())}},{key:"getBase",value:function(){return"/admin/users/".concat(this.props.match.params.id,"/mystery_box_opens")}},{key:"update",value:function(){var e=this,t={};this.table&&(t={page:this.table.state.page+1,sorting:this.table.state.sorted[0],filters:this.table.state.filtered,show_inactive:this.state.show_inactive?"1":"0"}),window.api.get(this.getBase(),{params:t}).then((function(t){e.setState({results:t})}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.edit_row,a=t.creating,c=this.state.results,r=c.pagination,s=c.records;return a&&(s=[n].concat(s)),Object(T.jsx)("div",{children:Object(T.jsx)(Fn.a,{ref:function(t){return e.table=t},manual:!0,showPageJump:!1,pages:r.total_pages,pageSize:r.records_per_page,data:s,multiSort:!1,showPageSizeOptions:!1,onPageChange:function(t){e.update()},onSortedChange:function(t,n,a){e.update()},onFilteredChange:function(t,n,a){e.update()},columns:[{id:"id",Header:"ID",accessor:function(e){return e.id},maxWidth:50},{id:"created_at",Header:"Created",accessor:function(e){return Se.withMinutes(e.created_at)},maxWidth:200},{id:"mystery_box_id",Header:"Mystery Box",accessor:function(e){return Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("img",{style:{width:"30px"},src:e.mystery_box.image_url}),Object(T.jsx)(l.b,{to:"/rewards/mystery-boxes/".concat(e.mystery_box_id),children:e.mystery_box.name})]})},maxWidth:400},{id:"reward_id",Header:"Winnings",accessor:function(e){return Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("img",{style:{width:"30px"},src:e.reward.image_url}),Object(T.jsx)(l.b,{to:"/rewards/".concat(e.reward.id),children:e.reward.name})]})},maxWidth:400},{id:"roll",Header:"Roll (1-1m)",accessor:function(e){return Object(T.jsx)("span",{children:e.roll})},maxWidth:200}]})})}}]),n}(c.Component),uo=Object(o.b)((function(e){return{rewards:e.rewards.items.records,user_ranks:e.app.user_ranks,user:e.users.user}}))(lo),jo=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={records:[],methods:[],method:null,type:"blacklist"},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",window.api.get("/admin/users/".concat(this.props.match.params.id,"/payment_method_blacklists")).then((function(e){t.setState(e)})));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"create",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/payments/user-blacklists",{user_id:this.props.match.params.id,payment_method_id:this.state.method,type:this.state.type});case 2:this.update();case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"disable",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.put("/admin/users/".concat(this.props.match.params.id,"/payment_method_blacklists"),{payment_method_id:t});case 2:this.update();case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Payment Method Settings"}),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{style:{display:"flex"},children:[Object(T.jsx)(Ce.a,{placeholder:"Payment Method",style:{width:400,marginRight:30},name:"type",value:this.state.method,onChange:function(t){e.setState({method:t&&t.value})},options:this.state.methods.map((function(e){return{label:e.type,value:e.id}}))}),Object(T.jsx)(Ce.a,{placeholder:"",name:"type",style:{width:300},value:this.state.type,onChange:function(t){e.setState({type:t&&t.value})},options:["blacklist","whitelist"].map((function(e){return{label:e,value:e}}))})]}),Object(T.jsx)("button",{disabled:!this.state.method,onClick:function(){e.create()},children:"Create"}),Object(T.jsx)("hr",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"MeThod"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Actions"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.records.map((function(t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:t.type}),Object(T.jsx)(we.Td,{children:t.status}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("button",{onClick:function(){e.disable(t.payment_method_id)},children:"Disable"})})]})}))})]})]})}}]),n}(c.Component),bo=jo,ho=n(199),po=function(e){Object(ho.a)(e);var t=Object(p.useParams)().id,n=Object(o.d)((function(e){return e.users.user.permissions})),a=Object(c.useState)(null),r=Object(m.a)(a,2),s=r[0],i=r[1],l=Object(o.c)();return Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_UPDATE_PERMISSIONS,children:Object(T.jsxs)("div",{className:Ns.a.form,children:[Object(T.jsx)("h4",{children:"Edit Permissions"}),Object(T.jsxs)("div",{className:Ns.a.editRoles,children:[Object(T.jsx)(Ce.a,{name:"type",value:s,onChange:function(e){i(null===e||void 0===e?void 0:e.value)},options:Object.keys(Oe.permissionsConstants).filter((function(e){return!n.includes(e)})).map((function(e){return{value:e,label:e}}))}),Object(T.jsx)("button",{onClick:function(){l(function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.put("/admin/users/"+e+"/permissions/add",{permission:t});case 2:a(as(e));case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,s))},disabled:!s,children:"Add"})]})]})}),n.length>0&&Object(T.jsxs)("div",{className:Ns.a.form,children:[Object(T.jsx)("h4",{children:"Current Permissions"}),Object(T.jsxs)(we.Table,{className:Ns.a.currentRoles,children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Role"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsx)(we.Tbody,{children:n.map((function(e,n){return Object(T.jsxs)(we.Tr,{className:"user-permission",children:[Object(T.jsx)(we.Td,{children:e}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_REMOVE_PERMISSIONS,children:Object(T.jsx)("button",{className:Ns.a.actionButton,onClick:function(){l(function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.put("/admin/users/"+e+"/permissions/remove",{permission:t});case 2:a(as(e));case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,e))},children:"Remove"})})})]},e)}))})]})]})]})},Oo=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this)).state={page:1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){this.props.getReferralData(this.props.match.params.id)}},{key:"render",value:function(){var e=this.props.referral_data;return Object(T.jsx)("div",{children:Object.keys(e).map((function(t){return Object(T.jsxs)("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"center"},children:[Object(T.jsxs)("h3",{style:{marginBottom:0,marginRight:10},children:[t,":"]})," ",e[t]]})}))})}}]),n}(c.Component),_o=Object(o.b)((function(e){return{referral_data:e.users.referrals}}),(function(e){return{getReferralData:function(t){return e(function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.get("/admin/users/".concat(e,"/referral_code"));case 2:a=t.sent,n({type:Jr,payload:a});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(t))}}}))(Oo),mo=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={query:"",page:1,results:{pagination:{total_pages:1,records_per_page:50},records:[]},edit_row:{},creating:!1,cashbackDetailsLoading:!1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update(),he(Oe.permissionsConstants.REWARDS_VIEW_LIST)&&this.props.dispatch(Pn())}},{key:"getBase",value:function(){return"/admin/users/".concat(this.props.match.params.id,"/reward_manifests")}},{key:"update",value:function(){var e=this,t={};this.table&&(t={page:this.table.state.page+1,sorting:this.table.state.sorted[0],filters:this.table.state.filtered,show_inactive:this.state.show_inactive?"1":"0"}),window.api.get(this.getBase(),{params:t}).then((function(t){e.setState({results:t})})).catch((function(e){re.toast.error(e)}))}},{key:"save",value:function(){var e=this,t=this.state,n=t.edit_row;t.creating?window.api.post(this.getBase(),n).then((function(t){e.setState({edit_row:{},creating:!1}),e.update(),t.status===jc?re.toast.success("Reward added (+instant consumed)"):re.toast.success("Reward added successfully")})).catch((function(e){re.toast.error(e)})):window.api.put("".concat(this.getBase(),"/").concat(n.id),n).then((function(t){e.setState({edit_row:{}}),e.update()})).catch((function(e){re.toast.error(e)}))}},{key:"cancel",value:function(){this.state.creating&&this.setState({creating:!1}),this.setState({edit_row:{}})}},{key:"getCashbackDetails",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({cashbackDetailsLoading:!0}),e.next=3,window.api.get("/admin/users/".concat(this.props.match.params.id,"/cashback_reward/").concat(t,"/details"));case 3:n=e.sent,alert("\n      Period started: ".concat(n.period_data.created_at,"\n      Period expired: ").concat(n.period_data.expires_at,"\n      Period rakeback percentage: ").concat(n.period_data.rakeback_percentage,"\n      \n      Real bet in period (normalized into EUR): ").concat(n.real_eur_bet_in_period," EUR\n      Real won in period (normalized into EUR): ").concat(n.real_eur_won_in_period," EUR\n      \n      Amount credited: ").concat(n.period_data.amount_credited," ").concat(n.period_data.amount_credited_currency,"\n    ")),this.setState({cashbackDetailsLoading:!1});case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=this.state,n=t.edit_row,a=t.creating,c=this.state.results,r=c.pagination,s=c.records;return a&&(s=[n].concat(s)),Object(T.jsxs)("div",{children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_REWARDS_INVENTORY_ADD_REWARD,children:Object(T.jsx)("button",{onClick:function(t){return e.setState({creating:!0,edit_row:{id:null,name:"New"}})},children:"New"})}),Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("h4",{children:"Show consumed/sold?"}),Object(T.jsx)("input",{style:{width:"20px"},type:"checkbox",checked:this.state.show_inactive,onChange:function(){e.setState({show_inactive:!e.state.show_inactive},e.update)}})]}),Object(T.jsx)(Fn.a,{ref:function(t){return e.table=t},manual:!0,showPageJump:!1,pages:r.total_pages,pageSize:r.records_per_page,data:s,multiSort:!1,showPageSizeOptions:!1,onPageChange:function(t){e.update()},onSortedChange:function(t,n,a){e.update()},onFilteredChange:function(t,n,a){e.update()},columns:[{Header:"",Cell:function(t){return Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_REWARDS_INVENTORY_UPDATE_REWARD,children:n.id===t.original.id?Object(T.jsxs)("div",{children:[Object(T.jsx)("a",{onClick:function(t){return e.cancel()},children:"Cancel"}),Object(T.jsx)("a",{onClick:function(t){return e.save()},children:"Save"})]}):Object(T.jsx)("a",{onClick:function(n){return e.setState({edit_row:t.original})},children:"Edit"})})},maxWidth:100},{id:"id",Header:"ID",accessor:function(e){return Object(T.jsx)(l.b,{to:"/items/".concat(e.id),children:e.id})},minWidth:70},{id:"created_at",Header:"Created",accessor:function(e){return Se.withMinutes(e.created_at)},maxWidth:200,minWidth:130},{id:"reward_id",Header:"Reward",accessor:function(t){return n.id===t.id?Object(T.jsx)(Ce.a,{name:"type",value:n.reward_id,onChange:function(t){t=t||{value:null},e.setState({edit_row:Object(d.a)(Object(d.a)({},n),{},{reward_id:t.value})})},options:e.props.rewards.map((function(e){return{label:Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("img",{style:{width:"30px"},src:e.image_url}),"(ID: $",e.id,") - $",e.name," (\u20ac $",e.eur_value,")"]}),value:e.id}}))}):Object(T.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[Object(T.jsx)("img",{style:{width:"30px"},src:t.reward.image_url}),Object(T.jsx)(l.b,{to:"/casino/".concat(t.reward.id),children:t.reward.name})]})},maxWidth:400,minWidth:260},{id:"status",Header:"Status",accessor:function(t){return n.id===t.id?Object(T.jsx)(Ce.a,{name:"type",value:n.status,onChange:function(t){t=t||{value:null},e.setState({edit_row:Object(d.a)(Object(d.a)({},n),{},{status:t.value||null})})},options:[{label:"Created",value:"created"},{label:"Consumed",value:jc},{label:"Sold",value:"sold"},{label:"Removed",value:"removed"}]}):Object(T.jsx)("span",{children:t.status})},maxWidth:200},{id:"consumed",Header:"Consumed",accessor:function(e){return e.status===jc&&Se.withMinutes(e.updated_at)},minWidth:130},{id:"expiration",Header:"Expiration",accessor:function(e){return e.expires_at&&Se.withMinutes(e.expires_at)},minWidth:130},{id:"details",Header:"Details",accessor:function(t){return t.reward&&"cashback"===t.reward.type&&Object(T.jsx)("button",{disabled:e.state.cashbackDetailsLoading,onClick:function(){return e.getCashbackDetails(t.id)},className:"small",children:"View details"})}},{id:"note",Header:"Note",accessor:"note"}]})]})}}]),n}(c.Component),xo=Object(o.b)((function(e){return{rewards:e.rewards.items.records,user_ranks:e.app.user_ranks,user:e.users.user}}))(mo),fo=function(e){var t=Object(c.useState)(1),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(1),i=Object(m.a)(s,2),o=i[0],l=i[1],d=Object(c.useState)([]),u=Object(m.a)(d,2),j=u[0],b=u[1],h=Object(c.useState)(!1),p=Object(m.a)(h,2),O=p[0],_=p[1],x=function(){_(!0),window.api.get("/admin/users/".concat(e.match.params.id,"/cashback_rewards"),{params:{page:a}}).then((function(e){var t=e.total_pages,n=e.records;b(n),l(t)})).finally((function(){return _(!1)}))};Object(c.useEffect)(x,[a]);var f=function(e){return"created"===e.cashback_reward_status&&new Date(e.expires_at)<new Date};return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[O&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Searching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Reward Manifest ID"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Reward Credited"}),Object(T.jsx)(we.Th,{children:"Rakeback"}),Object(T.jsx)(we.Th,{children:"Action"}),Object(T.jsx)(we.Th,{children:"Created"}),Object(T.jsx)(we.Th,{children:"Expiry"}),Object(T.jsx)(we.Th,{children:"Note"})]})}),Object(T.jsx)(we.Tbody,{children:j.map((function(t,n){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:t.id}),Object(T.jsx)(we.Td,{children:t.reward_id}),Object(T.jsx)(we.Td,{children:t.cashback_reward_status}),Object(T.jsx)(we.Td,{className:"good",children:t.amount_credited?"".concat(t.amount_credited_currency," ").concat(t.amount_credited):"insuffient amount"}),Object(T.jsxs)(we.Td,{className:"good",children:[t.rakeback_percentage||0," %"]}),Object(T.jsxs)(we.Td,{children:[f(t)&&Object(T.jsx)(fe,{feature:Oe.permissionsConstants.PROCESS_CASHBACK_REWARDS,children:Object(T.jsx)("button",{className:"small",onClick:function(){var n;n=t.id,window.api.get("/admin/users/".concat(e.match.params.id,"/cashback_rewards/").concat(n)).then((function(){re.toast.success("Cashback credited"),x()}))},children:"Credit"})}),!f(t)&&"N/A"]}),Object(T.jsx)(we.Td,{children:t.created_at}),Object(T.jsx)(we.Td,{children:t.expires_at}),Object(T.jsx)(we.Td,{children:t.note})]},n)}))})]}),Object(T.jsx)(Ke,{total_pages:o,update:function(e){r(e)}})]})},vo=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this)).state={page:1},a}return Object(j.a)(n,[{key:"getAvailableRoles",value:function(){var e=this,t=[];return t=["influencer","vip","beta_tester","sports_tester","influencer_not_allowed_bet","withdrawal_only_state","fortune_games_enabled"],Object.values(ie).flat().forEach((function(e){t.includes(e)||t.push(e)})),be()||(window.roles.includes("role_changer")?t=["influencer","support","mod","influencer_not_allowed_bet","withdrawal_only_state"]:window.roles.includes("support_manager")&&(t=["withdrawal_only_state"])),t.filter((function(t){return-1===(e.props.roles||[]).indexOf(t)}))}},{key:"render",value:function(){var e=this,t=this.props.match.params.id,n=((this.props.roles||[]).includes("closed"),this.getAvailableRoles().sort());return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_ADD_ROLE,children:Object(T.jsxs)("div",{className:Ns.a.form,children:[Object(T.jsx)("h4",{children:"Edit Roles"}),Object(T.jsxs)("div",{className:Ns.a.editRoles,children:[Object(T.jsx)(Ce.a,{name:"type",value:this.state.role,onChange:function(t){return e.setState({role:t})},options:n.map((function(e,t){return{label:e,value:t}}))}),Object(T.jsx)("button",{onClick:function(){return e.props.editRoles(t,n[e.state.role.value])},children:"Add"})]})]})}),Object(T.jsxs)("div",{className:Ns.a.form,children:[Object(T.jsx)("h4",{children:"Current Roles"}),Object(T.jsxs)(we.Table,{className:Ns.a.currentRoles,children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Role"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsx)(we.Tbody,{children:(this.props.roles||[]).map((function(n,a){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:n}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_REMOVE_ROLE,children:"closed"!==n&&Object(T.jsx)("button",{className:Ns.a.actionButton,onClick:function(){return e.props.editRoles(t,n,!0)},children:"Remove"})})})]},n)}))})]})]}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_UPDATE_LABEL,children:Object(T.jsxs)("div",{className:Ns.a.form,children:[Object(T.jsx)("h4",{children:"Edit Label"}),Object(T.jsx)("div",{className:Ns.a.editRoles,children:Object(T.jsx)(Ce.a,{name:"type",value:this.props.label,onChange:function(n){return e.props.editLabel(t,n.value)},options:this.props.user_labels.filter((function(t){return t!==e.state.label})).map((function(e){return{label:e,value:e}}))})})]})})]})}}]),n}(c.Component),go=Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e.users.user),{},{user_labels:["mod","support","influencer","vip","affiliate_manager","master_affiliate_manager"]})}),(function(e){return{editLabel:function(t,n){return e(function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.put("/admin/users/"+e,{label:t});case 2:a(as(e));case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,n))},editRoles:function(t,n,a){return e(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){var a=Object(f.a)(Object(x.a)().mark((function a(c){return Object(x.a)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,window.api.put("/admin/users/"+e+"/edit_roles/",{role:t,remove:n});case 2:c(as(e));case 3:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()}(t,n,a))}}}))(vo),To=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={records:[],filter:"all"},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){var e=this;window.api.get("/admin/users/".concat(this.props.match.params.id,"/softswiss/freespins")).then((function(t){e.setState({records:t})}))}},{key:"render",value:function(){var e=this;return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("h4",{children:"Softswiss Free Spins"}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.SOFTSWISS_ISSUE_SPINS,children:Object(T.jsxs)("div",{children:["Game Slug: ",Object(T.jsx)("input",{placeholder:"game slug",onChange:function(t){return e.setState({game_slug:t.target.value})}}),Object(T.jsx)("br",{}),"Amount: ",Object(T.jsx)("input",{placeholder:"number of spins",type:"number",onChange:function(t){return e.setState({amount:t.target.value})}}),Object(T.jsx)("br",{}),"Bet Level: ",Object(T.jsx)("input",{placeholder:"bet level",type:"number",max:5,onChange:function(t){return e.setState({bet_level:t.target.value})}}),Object(T.jsx)("br",{}),"Lifespan: ",Object(T.jsx)("input",{placeholder:"lifespan (minutes)",type:"number",max:43200,onChange:function(t){return e.setState({lifespan:t.target.value})}}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{disabled:!this.state.game_slug||!(this.state.amount>0)||!this.state.bet_level||!this.state.lifespan,onClick:function(){window.api.post("/admin/users/".concat(e.props.match.params.id,"/softswiss/freespins"),{game_slug:e.state.game_slug,amount:e.state.amount,bet_level:e.state.bet_level,lifespan:e.state.lifespan}).then((function(){re.toast.info("credited"),e.update()}))},children:"Credit"}),Object(T.jsx)("br",{}),Object(T.jsx)("hr",{})]})}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.SOFTSWISS_FREE_SPINS_VIEW_LIST,children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Game"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"Lifespan"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Note"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.records.filter((function(t){var n=t.status;return"all"===e.state.filter||n===e.state.filter})).map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/games/"+e.slug,children:e.game_name})}),Object(T.jsx)(we.Td,{children:e.amount}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.created_at)}),Object(T.jsx)(we.Td,{children:e.lifespan_minutes}),Object(T.jsx)(we.Td,{children:e.winnings_transaction_id?"".concat(e.winnings," ").concat(e.currency_type):"null"}),Object(T.jsx)(we.Td,{children:e.note||"null"})]})}))})]})}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{})]})}}]),n}(c.Component),yo=Object(o.b)((function(e){return Object(d.a)({},e.users.user)}))(To),Eo="all except game_provider_*",So=["game_provider_bet","game_provider_win","game_provider_refund","withdrawal","withdrawal_refund","deposit","loyalty_reward","bonus","cashback_reward_payout","free_winnings_transfer","bonus_transfer","admin","referral_conversion",Eo],wo=["both","real","bonus"],Ro=[{label:"Date - Newest first",value:"created_at_desc"},{label:"Date - Oldest first",value:"created_at_asc"},{label:"Amount - Highest to lowest",value:"amount_desc"},{label:"Amount - Lowest to highest",value:"amount_asc"}],Ao=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this)).state={page:1,openExportDataModal:!1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(e,t,n){this.props.updateWithdrawals(this.props.match.params.id,this.state.page,t,n,e)}},{key:"getEvaluationTypes",value:function(e){var t;return null===e||void 0===e||null===(t=e.map((function(e){return e.type})))||void 0===t?void 0:t.join(", ")}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Note"}),Object(T.jsx)(we.Th,{children:"Wallet Id"}),Object(T.jsx)(we.Th,{children:"Transaction id"}),Object(T.jsx)(we.Th,{children:"Evaluation"})]})}),Object(T.jsx)(we.Tbody,{children:this.props.records.map((function(t,n){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(t.created_at)}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/payments/withdrawals/".concat(t.id),children:t.id})}),Object(T.jsx)(we.Td,{children:t.type}),Object(T.jsxs)(we.Td,{children:[t.currency_type," ",Math.abs(t.amount)]}),Object(T.jsx)(we.Td,{children:t.status}),Object(T.jsx)(we.Td,{children:t.note}),Object(T.jsx)(we.Td,{children:t.wallet_id}),Object(T.jsx)(we.Td,{children:t.transaction_id}),Object(T.jsx)(we.Td,{children:e.getEvaluationTypes(t.evaluation)})]},n)}))})]}),Object(T.jsx)(Ke,{total_pages:this.props.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update()}))}}),Object(T.jsx)(ci,{onClick:function(){return e.setState(Object(d.a)(Object(d.a)({},e.state),{},{openExportDataModal:!0}))}}),Object(T.jsx)(ni,{isOpen:this.state.openExportDataModal,onClose:function(){return e.setState(Object(d.a)(Object(d.a)({},e.state),{},{openExportDataModal:!1}))},downloadingReport:this.props.downloadingReport,onExport:function(t){e.update(t.format,t.startDate,t.endDate)}})]})}}]),n}(c.Component),No=Object(o.b)((function(e){return Object(d.a)({},e.users.withdrawals)}),(function(e){return{updateWithdrawals:function(t,a,c,r,s){return e(function(e,t,a,c,r){return r?function(){var s=Object(f.a)(Object(x.a)().mark((function s(i){return Object(x.a)().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:i({type:Gr}),n(61)({url:"/api/admin/users/".concat(e,"/withdrawals/export/").concat(r),method:"GET",responseType:"blob",params:{page:t,start:a,end:c,exportTo:r},headers:{Authorization:"Bearer ".concat(localStorage.getItem("access_token")),"X-RateLimit-Bypass":"1"}}).then((function(e){var t="xls"===r?"xlsx":r;Re(e.data,t)})).finally((function(){return i({type:Vr})}));case 2:case"end":return s.stop()}}),s)})));return function(e){return s.apply(this,arguments)}}():function(){var n=Object(f.a)(Object(x.a)().mark((function n(r){var s;return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.get("/admin/users/".concat(e,"/withdrawals"),{params:{page:t,start:a,end:c}});case 2:s=n.sent,r({type:Yr,payload:s});case 4:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}(t,a,c,r,s))}}}))(Ao),Co=function(e){var t=Object(c.useState)({bets:[],total_pages:0}),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],d=i[1],u=Object(c.useState)(1),j=Object(m.a)(u,2),b=j[0],h=j[1];Object(c.useEffect)((function(){p(b)}),[b]);var p=function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a,c,s;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d(!0),t.prev=1,t.next=4,window.api.get("/admin/users/".concat(e.match.params.id,"/plinko_bets?page=").concat(n));case 4:a=t.sent,c=a.total_pages,s=a.records,r({total_pages:c,bets:s}),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),re.toast.error(t.t0.message);case 13:d(!1);case 14:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e){return t.apply(this,arguments)}}();return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[o&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Bet Settled At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Multiplier"}),Object(T.jsx)(we.Th,{children:"Risk"}),Object(T.jsx)(we.Th,{children:"Rows"}),Object(T.jsx)(we.Th,{children:"Roll"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:a.bets.map((function(e,t){var n=e.win_amount>0?e.profit:-1*e.amount;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.round_id),children:e.round_id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_placed_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_settled_at)}),Object(T.jsxs)(we.Td,{children:[e.amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:(+e.multiplier).toFixed(2)}),Object(T.jsx)(we.Td,{children:e.risk}),Object(T.jsx)(we.Td,{children:e.rows}),Object(T.jsx)(we.Td,{children:e.roll}),Object(T.jsxs)(we.Td,{className:n>=0?"good":"bad",children:[(+n).toFixed(2)," ",e.currency_type]})]},e.round_id)}))})]}),Object(T.jsx)(Ke,{total_pages:a.total_pages,update:function(e){return h(e)}})]})},Io=function(e){var t=Object(c.useState)({bets:[],total_pages:0}),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],d=i[1],u=Object(c.useState)(1),j=Object(m.a)(u,2),b=j[0],h=j[1];Object(c.useEffect)((function(){p(b)}),[b]);var p=function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a,c,s,i;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d(!0),t.prev=1,a="/admin/users/".concat(e.match.params.id,"/limbo_bets?page=").concat(n),t.next=5,window.api.get(a);case 5:c=t.sent,s=c.total_pages,i=c.records,r({total_pages:s,bets:i}),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),re.toast.error(t.t0.message);case 14:d(!1);case 15:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return t.apply(this,arguments)}}();return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[o&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Bet Settled At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Target Multiplier"}),Object(T.jsx)(we.Th,{children:"Crash Point"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:a.bets.map((function(e,t){var n=e.win_amount>0?e.profit:-1*e.amount;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.round_id),children:e.round_id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_placed_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_settled_at)}),Object(T.jsxs)(we.Td,{children:[e.amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.target}),Object(T.jsx)(we.Td,{children:(+e.multiplier).toFixed(2)}),Object(T.jsxs)(we.Td,{className:n>=0?"good":"bad",children:[(+n).toFixed(2)," ",e.currency_type]})]},e.round_id)}))})]}),Object(T.jsx)(Ke,{total_pages:a.total_pages,update:function(e){return h(e)}})]})},ko=function(){var e=Object(c.useState)({total_pages:0,bets:[]}),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(!1),s=Object(m.a)(r,2),i=s[0],o=s[1],d=Object(c.useState)(1),u=Object(m.a)(d,2),j=u[0],b=u[1],h=Object(p.useParams)().id,O=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o(!0),e.prev=1,e.next=4,U(h,{page:j});case 4:t=e.sent,a({total_pages:t.total_pages,bets:t.records}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),re.toast.error(e.t0.message);case 11:o(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();return Object(c.useEffect)((function(){O()}),[j]),Object(T.jsxs)("div",{style:{position:"relative",minHeight:500},children:[i&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Bet ID"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Target"}),Object(T.jsx)(we.Th,{children:"Free bet"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Slide Point"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:n.bets.map((function(e,t){var n=e.remote_round_id,a=e.created_at,c=e.remote_bet_id,r=e.multiplier,s=void 0===r?0:r,i=e.free_bet,o=e.slide_point,d=e.status,u=e.target,j=e.currency_type,b=e.amount,h=+s>0?parseFloat(+b*+s).toFixed(4):-b,p=h>0?h-b:h;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(n),children:c})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(a)}),Object(T.jsxs)(we.Td,{children:[b," ",j]}),Object(T.jsx)(we.Td,{children:u}),Object(T.jsx)(we.Td,{children:i?"yes":"no"}),Object(T.jsx)(we.Td,{className:p>=0?"good":"",children:h>0?"".concat(h," ").concat(j):"-"}),Object(T.jsx)(we.Td,{children:o}),Object(T.jsx)(we.Td,{children:d}),Object(T.jsxs)(we.Td,{className:h>=0?"good":"bad",children:[parseFloat(p).toFixed(4)," ",j]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:n.total_pages,update:function(e){return b(e)}})]})},Do=function(){var e=Object(c.useState)({total_pages:0,bets:[]}),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(!1),s=Object(m.a)(r,2),i=s[0],o=s[1],d=Object(c.useState)(1),u=Object(m.a)(d,2),j=u[0],b=u[1],h=Object(p.useParams)().id,O=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o(!0),e.prev=1,e.next=4,V(h,{page:j});case 4:t=e.sent,a({total_pages:t.total_pages,bets:t.records}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),re.toast.error(e.t0.message);case 11:o(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();return Object(c.useEffect)((function(){O()}),[j]),Object(T.jsxs)("div",{style:{position:"relative",minHeight:500},children:[i&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Bet ID"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Target Fruit"}),Object(T.jsx)(we.Th,{children:"Multiplier"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Fruit"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:n.bets.map((function(e,t){var n=e.amount,a=e.profit,c=e.multiplier,r=e.currency_type,s=e.win_amount;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.remote_round_id),children:e.remote_round_id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.created_at)}),Object(T.jsxs)(we.Td,{children:[n," ",r]}),Object(T.jsx)(we.Td,{children:e.target_fruit}),Object(T.jsx)(we.Td,{children:c}),Object(T.jsx)(we.Td,{className:a>=0?"good":"",children:s>0?"".concat(parseFloat(s).toFixed(4)," ").concat(r):"-"}),Object(T.jsx)(we.Td,{children:e.fruit}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsxs)(we.Td,{className:a>=0?"good":"bad",children:[a," ",r]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:n.total_pages,update:function(e){return b(e)}})]})},Lo=n(731),Uo=n(701),Po=n(730),Wo=function(e){var t=e.title,n=e.children;return Object(T.jsx)(Po.a,{title:t,children:Object(T.jsxs)("span",{children:[n," ",Object(T.jsx)(Uo.a,{fontSize:"string",sx:{verticalAlign:"middle"}})]})})},Mo=(n(539),n(702)),Bo=function(){var e=Object(c.useState)({total_pages:0,bets:[]}),t=Object(m.a)(e,2),n=t[0],a=t[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],d=i[1],u=Object(c.useState)(1),j=Object(m.a)(u,2),b=j[0],h=j[1],O=Object(p.useParams)().id,_=Object(c.useState)(!1),v=Object(m.a)(_,2),g=v[0],y=v[1],E=Object(c.useState)(!0),S=Object(m.a)(E,2),w=S[0],R=S[1],A=Object(c.useMemo)((function(){var e,t;if(null===n||void 0===n||null===(e=n.bets)||void 0===e||!e.length)return!1;var a=null===n||void 0===n||null===(t=n.bets)||void 0===t?void 0:t[0],c=a.status,r=a.game;return r.bombCut&&"created"===c&&!r.roundOpen?a:void 0}),[n.bets]),N=Object(c.useCallback)(Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d(!0),e.prev=1,e.next=4,D(O,{page:b,type:"fruitSlice"});case 4:t=e.sent,a({total_pages:t.pages,bets:t.records}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),re.toast.error(e.t0.message);case 11:d(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])}))),[O,b]),C=Object(c.useCallback)(Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ae(O);case 3:re.toast.success("Game unlocked successfully"),N(),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),re.toast.error(e.t0.message);case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),[N,O]);return Object(c.useEffect)((function(){N()}),[N]),o?Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}):Object(T.jsxs)("div",{style:{position:"relative",minHeight:500},children:[A&&Object(T.jsxs)("article",{className:"user_stuck".concat(w?"":" user_stuck_open"),children:[Object(T.jsxs)("div",{className:"user_stuck_header",onClick:function(){R((function(e){return!e}))},children:[Object(T.jsx)(Wo,{title:"User has a locked round. This means that the user has a game that is on a status that doesn't allow it cashout or start a new game. This happens when user cuts a bomb and status was not updated properly to lost.",children:Object(T.jsx)("h4",{className:"user_stuck_title",children:"Locked Game"})}),Object(T.jsx)(Mo.a,{className:"user_stuck_collapse_icon"})]}),!w&&Object(T.jsxs)("div",{className:"user_stuck_container",children:[Object(T.jsxs)("div",{className:"user_stuck_info_box",children:[Object(T.jsx)("h5",{children:"Game info"}),Object(T.jsxs)("span",{children:["Bet ID:"," "]}),Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(A.id),children:A.id}),Object(T.jsx)("br",{}),"Bet Slip ID: ",A.betSlipId,Object(T.jsx)("br",{}),"Remote Round ID: ",A.remoteRoundId,Object(T.jsx)("br",{}),"Round ID: ",A.roundId,Object(T.jsx)("br",{}),"Multiplier: ",A.multiplier,Object(T.jsx)("br",{}),"Status: ",A.status,Object(T.jsx)("br",{}),"RoundOpen: ",A.game.roundOpen?"true":"false",Object(T.jsx)("br",{}),"Can cashout: ",A.game.canCashout?"true":"false",Object(T.jsx)("br",{}),"Bomb Cut: ",A.game.bombCut?"true":"false",Object(T.jsx)("br",{}),"Number of bombs cut: ",A.game.history.filter((function(e){return e.isBomb})).length,Object(T.jsx)("br",{}),"Total slices: ",A.game.history.length,Object(T.jsx)("br",{}),"Created At: ",Se.withSeconds(A.created_at),Object(T.jsx)("br",{}),"Updated At: ",Se.withSeconds(A.updated_at),Object(T.jsx)("br",{})]}),Object(T.jsxs)("div",{className:"user_stuck_info_box",children:[Object(T.jsx)("h5",{children:"Slices history"}),Object(T.jsx)("div",{children:A.game.history.map((function(e,t){var n=e.type,a=e.multiplier,c=e.isBomb;return Object(T.jsx)(r.a.Fragment,{children:Object(T.jsxs)("p",{style:{margin:0},children:[Object(T.jsx)("span",{className:"bad",children:c&&"bomb"})," ",n," - x",a," "]})},t+n)}))})]}),Object(T.jsxs)("div",{className:"user_stuck_info_box",children:[Object(T.jsx)("h5",{children:"Game actions"}),Object(T.jsxs)("div",{children:[Object(T.jsx)("div",{children:"Updates game status to lost. This will allows user to start a new game."}),Object(T.jsx)("button",{className:"user_stuck_action_button",onClick:C,children:"Unlock manually"})]})]})]})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Bet ID"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Multiplier"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsxs)(we.Th,{children:["Fruits ",Object(T.jsxs)("button",{style:{height:"fit-content",width:"fit-content",padding:"0 2px",fontSize:"12px"},onClick:function(){return y((function(e){return!e}))},children:[g?"Hidden ":"Show "," All Fruits Slides"]})]}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"}),Object(T.jsx)(we.Th,{children:"Type Round"})]})}),Object(T.jsx)(we.Tbody,{children:n.bets.map((function(e,t){var n=e.amount,a=e.profit,c=e.multiplier,s=e.currency_type,i=e.winnings,o=e.game;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.id),children:e.id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.created_at)}),Object(T.jsxs)(we.Td,{children:[Number(n).toFixed(4)," ",s]}),Object(T.jsx)(we.Td,{children:c.toFixed(4)}),Object(T.jsx)(we.Td,{className:a>=0?"good":"",children:Number(i)>0?"".concat(Number(i).toFixed(4)," ").concat(s):"-"}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(Lo.a,{in:g,collapsedSize:30,children:e.game.history.sort((function(e){return e.isBomb?1:-1})).map((function(e,t){var n=e.type,a=e.multiplier,c=e.isBomb;return Object(T.jsx)(r.a.Fragment,{children:Object(T.jsxs)("p",{style:{margin:0},children:[Object(T.jsx)("span",{className:"bad",children:c&&"bomb"})," ",n," - x",a," "]})},t+n)}))})}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsx)(we.Td,{className:a>=0?"good":o.bombCut?"bad":"",children:o.bombCut||a>0?"".concat(Number(a).toFixed(4)," ").concat(s):"-"}),Object(T.jsx)(we.Td,{className:e.wallet_params.free_bet?"bad":"good",children:e.wallet_params.free_bet?"Free":"Real"})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:n.total_pages,update:function(e){return h(e)}})]})},Fo={head:"gold",tail:"silver"},Go=function(){var e=Object(c.useState)({total_pages:0,bets:[]}),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(!1),s=Object(m.a)(r,2),i=s[0],o=s[1],d=Object(c.useState)(1),u=Object(m.a)(d,2),j=u[0],b=u[1],h=Object(p.useParams)().id,O=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o(!0),e.prev=1,e.next=4,D(h,{page:j,type:"coin-flip"});case 4:t=e.sent,a({total_pages:t.pages,bets:t.records}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),re.toast.error(e.t0.message);case 11:o(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();return Object(c.useEffect)((function(){O()}),[j]),Object(T.jsxs)("div",{style:{position:"relative",minHeight:500},children:[i&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Bet ID"}),Object(T.jsx)(we.Th,{children:"Game ID"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Selected Coin"}),Object(T.jsx)(we.Th,{children:"Num Of Coins"}),Object(T.jsx)(we.Th,{children:"Min Gold/Silver"}),Object(T.jsx)(we.Th,{children:"Golds"}),Object(T.jsx)(we.Th,{children:"Silvers"}),Object(T.jsx)(we.Th,{children:"Free"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:n.bets.map((function(e,t){var n,a,c,r,s,i,o,d=e.remoteRoundId,u=e.created_at,j=e.id,b=e.amount,h=e.currency_type,p=e.multiplier,O=e.status,_=e.wallet_params,m=e.roundId,x=+p>0?b*p:0,f=x>0?(x-b).toFixed(4):-b;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:null!==_&&void 0!==_&&_.free_bet?Object(T.jsx)("span",{children:j}):Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(d),children:d})}),Object(T.jsx)(we.Td,{children:m}),Object(T.jsx)(we.Td,{children:Se.withSeconds(u)}),Object(T.jsxs)(we.Td,{children:[b," ",h]}),Object(T.jsx)(we.Td,{children:Fo[null===e||void 0===e||null===(n=e.payload)||void 0===n?void 0:n.coinSide]}),Object(T.jsx)(we.Td,{children:null===e||void 0===e||null===(a=e.payload)||void 0===a?void 0:a.numCoins}),Object(T.jsx)(we.Td,{children:null===e||void 0===e||null===(c=e.payload)||void 0===c?void 0:c.minHeadOrTail}),Object(T.jsx)(we.Td,{children:null===e||void 0===e||null===(r=e.coins)||void 0===r||null===(s=r.filter((function(e){return"head"===e})))||void 0===s?void 0:s.length}),Object(T.jsx)(we.Td,{children:null===e||void 0===e||null===(i=e.coins)||void 0===i||null===(o=i.filter((function(e){return"tail"===e})))||void 0===o?void 0:o.length}),Object(T.jsx)(we.Td,{children:null!==_&&void 0!==_&&_.free_bet?"Yes":"No"}),Object(T.jsx)(we.Td,{className:"good",children:x>0?"".concat(parseFloat(x).toFixed(4)," ").concat(h):"-"}),Object(T.jsx)(we.Td,{children:O}),Object(T.jsxs)(we.Td,{className:f>=0?"good":"bad",children:[f," ",h]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:n.total_pages,update:function(e){return b(e)}})]})},Vo=function(e){var t=e.children;return Object(T.jsx)(Wo,{title:"Server Round ID is not available since it is free round. We are displaying Gaming Services Round ID",children:t})},Yo=function(e){var t=e.children;return Object(T.jsx)(Wo,{title:"The unique identifier of the round bet. Could vary depending of the case. If is free round, then will display Gaming Services Round ID, if not then will display the Server Round ID.",children:t})},Ho=function(){var e=Object(c.useState)({total_pages:0,bets:[]}),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(!1),s=Object(m.a)(r,2),i=s[0],o=s[1],d=Object(c.useState)(1),u=Object(m.a)(d,2),j=u[0],b=u[1],h=Object(p.useParams)().id,O=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o(!0),e.prev=1,e.next=4,M(h,{page:j});case 4:t=e.sent,a({total_pages:t.total_pages,bets:t.records}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),re.toast.error(e.t0.message);case 11:o(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();return Object(c.useEffect)((function(){O()}),[j]),Object(T.jsxs)("div",{style:{position:"relative",minHeight:500},children:[i&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:Object(T.jsx)(Yo,{children:"Round ID"})}),Object(T.jsx)(we.Th,{children:"Room Number"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Game Settled At"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Bet Settled At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Free bet"}),Object(T.jsx)(we.Th,{children:"Bet Color"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Winning Color"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Multiplier"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:n.bets.map((function(e,t){var n=e.remote_round_id,a=e.game_started_at,c=e.game_settled_at,r=e.bet_placed_at,s=e.bet_settled_at,i=e.multiplier,o=void 0===i?0:i,d=e.free_bet,u=e.winning_color,j=e.status,b=e.bet_color,h=e.currency_type,p=e.amount,O=e.round_id,_=e.fortune_double_room,m=+o>0?parseFloat(+p*+o).toFixed(4):-p,x=m>0?m-p:m,f="black";switch(b){case"white":f="yellow";break;case"red":f="red";break;default:f="purple"}var v="black";switch(u){case"white":v="yellow";break;case"red":v="red";break;default:v="purple"}return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:d?Object(T.jsx)(Vo,{children:O}):Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(n),children:n})}),Object(T.jsx)(we.Td,{children:_}),Object(T.jsx)(we.Td,{children:Se.withSeconds(a)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(c)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(r)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(s)}),Object(T.jsxs)(we.Td,{children:[p," ",h]}),Object(T.jsx)(we.Td,{children:d?"Yes":"No"}),Object(T.jsx)(we.Td,{children:f}),Object(T.jsx)(we.Td,{className:x>=0?"good":"",children:m>0?"".concat(m," ").concat(h):"-"}),Object(T.jsx)(we.Td,{children:v}),Object(T.jsx)(we.Td,{children:j}),Object(T.jsx)(we.Td,{children:o}),Object(T.jsxs)(we.Td,{className:m>=0?"good":"bad",children:[parseFloat(x).toFixed(4)," ",h]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:n.total_pages,update:function(e){return b(e)}})]})},qo=function(e){var t=Object(c.useState)([]),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],l=i[1];Object(c.useEffect)((function(){l(!0),window.api.get("/admin/users/".concat(e.match.params.id,"/overdraft-alerts")).then((function(e){r(e)})).catch((function(e){return re.toast.error(e.message)})).finally((function(){return l(!1)})),l(!1)}),[e.match.params.id]);var d=function(e){return Number(e)?Number(e).toFixed(2):0};return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[o&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Searching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{className:"overflow-x-scroll",children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"Currency"}),Object(T.jsx)(we.Th,{children:"Overdraft Amount"}),Object(T.jsx)(we.Th,{children:"Eur Overdraft"}),Object(T.jsx)(we.Th,{children:"Target Rollback Amount"}),Object(T.jsx)(we.Th,{children:"Bet ID"}),Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Transaction ID"}),Object(T.jsx)(we.Th,{children:"Remote Command ID"}),Object(T.jsx)(we.Th,{children:"Target Remote Command ID"})]})}),Object(T.jsx)(we.Tbody,{children:a.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:e.currency_type}),Object(T.jsx)(we.Td,{className:"bad",children:d(e.overdraft)}),Object(T.jsx)(we.Td,{className:"bad",children:d(e.eur_overdraft)}),Object(T.jsx)(we.Td,{children:d(e.target_rollback_amount)}),Object(T.jsx)(we.Td,{children:e.bet_id}),Object(T.jsx)(we.Td,{children:e.round_id}),Object(T.jsx)(we.Td,{children:e.transaction_id}),Object(T.jsx)(we.Td,{children:e.remote_command_id}),Object(T.jsx)(we.Td,{children:e.target_remote_command_id})]},t)}))})]})]})},Ko=function(e){var t=Object(c.useState)({bets:[],total_pages:0}),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],d=i[1],u=Object(c.useState)(1),j=Object(m.a)(u,2),b=j[0],h=j[1],p=Object(c.useCallback)(function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a,c,s;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d(!0),t.prev=1,t.next=4,k.get("/admin/user/".concat(e.match.params.id,"/crash_bets?page=").concat(n,"&room_id=").concat(3));case 4:a=t.sent,c=a.total_pages,s=a.records,r({total_pages:c,bets:s}),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),re.toast.error(t.t0.message);case 13:d(!1);case 14:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e){return t.apply(this,arguments)}}(),[e.match.params.id]);return Object(c.useEffect)((function(){p(b)}),[b]),Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[o&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Game Settled At"}),Object(T.jsx)(we.Th,{children:"Game Crash Point"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Bet Settled At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Autocashout At"}),Object(T.jsx)(we.Th,{children:"Cashed Out At"}),Object(T.jsx)(we.Th,{children:"Free Bet"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:a.bets.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.free_bet?Object(T.jsx)("span",{children:e.round_id}):Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.remote_round_id),children:e.remote_round_id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_started_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_settled_at)}),Object(T.jsx)(we.Td,{children:e.game_crash_point}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_placed_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_settled_at)}),Object(T.jsxs)(we.Td,{children:[e.amount," ",e.currency_type]}),Object(T.jsxs)(we.Td,{children:[e.auto_cashout_at,"x"]}),Object(T.jsxs)(we.Td,{children:[e.cashed_out_at,"x"]}),Object(T.jsx)(we.Td,{children:e.free_bet?"yes":"no"}),Object(T.jsxs)(we.Td,{className:e.win_amount>0?"good":"bad",children:[e.win_amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.profit," ",e.currency_type]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:a.total_pages,update:function(e){return h(e)}})]})},zo=(n(540),function(e){var t=Object(c.useState)({bets:[],total_pages:0}),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],d=i[1],u=Object(c.useState)(1),j=Object(m.a)(u,2),b=j[0],h=j[1],p=Object(c.useCallback)(function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a,c,s;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return d(!0),t.prev=1,t.next=4,k.get("/admin/user/".concat(e.match.params.id,"/crash_bets?page=").concat(n,"&room_id=").concat(4));case 4:a=t.sent,c=a.total_pages,s=a.records,r({total_pages:c,bets:s}),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),re.toast.error(t.t0.message);case 13:d(!1);case 14:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e){return t.apply(this,arguments)}}(),[e.match.params.id]);return Object(c.useEffect)((function(){p(b)}),[b]),Object(T.jsxs)("div",{className:"bets-section",children:[o&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:Object(T.jsx)(Yo,{children:"Round ID"})}),Object(T.jsx)(we.Th,{children:"Game Started At"}),Object(T.jsx)(we.Th,{children:"Game Settled At"}),Object(T.jsx)(we.Th,{children:"Game Crash Point"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Bet Settled At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Autocashout At"}),Object(T.jsx)(we.Th,{children:"Cashed Out At"}),Object(T.jsx)(we.Th,{children:"Free Bet"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:a.bets.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.free_bet?Object(T.jsx)(Vo,{children:e.round_id}):Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.remote_round_id),children:e.remote_round_id})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_started_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.game_settled_at)}),Object(T.jsx)(we.Td,{children:e.game_crash_point}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_placed_at)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.bet_settled_at)}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.amount," ",e.currency_type]}),Object(T.jsxs)(we.Td,{children:[e.auto_cashout_at,"x"]}),Object(T.jsxs)(we.Td,{children:[e.cashed_out_at,"x"]}),Object(T.jsx)(we.Td,{children:e.free_bet?"yes":"no"}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.win_amount," ",e.currency_type]}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsxs)(we.Td,{className:e.profit>0?"good":"bad",children:[e.profit," ",e.currency_type]})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:a.total_pages,update:function(e){return h(e)}})]})}),Xo=function(e){var t=Object(c.useState)([]),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(),i=Object(m.a)(s,2),o=i[0],d=i[1],u=Object(c.useState)(!1),j=Object(m.a)(u,2),b=j[0],h=j[1],p=Object(c.useState)(1),O=Object(m.a)(p,2),_=O[0],v=O[1],g=Object(c.useState)(!1),y=Object(m.a)(g,2),E=y[0],S=y[1],w=function(){var t=Object(f.a)(Object(x.a)().mark((function t(){var n,a,c;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return h(!0),t.prev=1,t.next=4,window.api.get("/admin/users/".concat(e.match.params.id,"/game_provider_rounds_open"),{params:{page:_,fullSearch:E}});case 4:n=t.sent,a=n.records,c=n.total_pages,r(a),d(c),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),re.toast.error(t.t0.message);case 14:h(!1);case 15:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(){return t.apply(this,arguments)}}();return Object(c.useEffect)((function(){w()}),[_,E]),Object(c.useEffect)((function(){v(1)}),[]),Object(T.jsxs)("div",{style:{position:"relative",minHeight:"500px"},children:[b&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)("label",{children:[Object(T.jsx)("input",{style:{marginLeft:"200px",marginBottom:"20px"},type:"checkbox",checked:E,onChange:function(){S(!E)}}),"Full search with the amount wagered in the last 60 days. If not, it will return data since the origin of time"]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Game"}),Object(T.jsx)(we.Th,{children:"Game Created At"}),Object(T.jsx)(we.Th,{children:"Amount"})]})}),Object(T.jsx)(we.Tbody,{children:a.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.id),children:e.id})}),Object(T.jsx)(we.Td,{children:e.slug}),Object(T.jsx)(we.Td,{children:Se.withSeconds(e.created_at)}),Object(T.jsx)(we.Td,{children:e.real_eur_wagered})]},t)}))})]}),Object(T.jsx)(lt,{page:_,setPage:v,totalPages:o})]})},Zo=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this)).state={page:1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){this.props.updateFingerprints(this.props.match.params.id)}},{key:"deletePhone",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hs(t,n);case 2:this.props.updateFingerprints(this.props.match.params.id);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e,t,n,a,c=this;return Object(T.jsxs)("div",{children:[Object(T.jsx)("h1",{children:"Phones"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Updated at"}),Object(T.jsx)(we.Th,{children:"Created at"}),Object(T.jsx)(we.Th,{children:"Deleted at"}),Object(T.jsx)(we.Th,{children:"Number"}),Object(T.jsx)(we.Th,{children:"Country"}),Object(T.jsx)(we.Th,{children:"Enabled"}),Object(T.jsx)(we.Th,{children:"Status Detail"}),Object(T.jsx)(we.Th,{children:"Validated"}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_OTP_DELETE_PHONE,children:Object(T.jsx)(we.Th,{children:"Delete"})})]})}),Object(T.jsx)(we.Tbody,{children:null===(e=this.props)||void 0===e||null===(t=e.userPhones)||void 0===t?void 0:t.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:Se.withMinutes(e.updated_at)}),Object(T.jsx)(we.Td,{children:"Invalid date"===Se.withMinutes(e.deleted_at)?"-":Se.withMinutes(e.deleted_at)}),Object(T.jsx)(we.Td,{children:e.number}),Object(T.jsx)(we.Td,{children:e.country}),Object(T.jsx)(we.Td,{children:e.enabled?"true":"false"}),Object(T.jsx)(we.Td,{children:e.status_detail}),Object(T.jsx)(we.Td,{children:e.validated?"true":"false"}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_OTP_DELETE_PHONE,children:"Invalid date"===Se.withMinutes(e.deleted_at)&&Object(T.jsx)(we.Td,{children:Object(T.jsx)("button",{onClick:function(){window.confirm("Are you sure you want to delete this phone number?")&&c.deletePhone(c.props.match.params.id,e.number)},children:"Delete"})})})]},t)}))})]}),Object(T.jsx)("h1",{children:"Audit"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Updated at"}),Object(T.jsx)(we.Th,{children:"Created at"}),Object(T.jsx)(we.Th,{children:"Expires at"}),Object(T.jsx)(we.Th,{children:"Number"}),Object(T.jsx)(we.Th,{children:"Country"}),Object(T.jsx)(we.Th,{children:"Provider"}),Object(T.jsx)(we.Th,{children:"Provider Tracking"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Status Detail"})]})}),Object(T.jsx)(we.Tbody,{children:null===(n=this.props)||void 0===n||null===(a=n.smsDelivery)||void 0===a?void 0:a.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:Se.withMinutes(e.updated_at)}),Object(T.jsx)(we.Td,{children:Se.withMinutes(e.expirated_at)}),Object(T.jsx)(we.Td,{children:e.number}),Object(T.jsx)(we.Td,{children:e.country}),Object(T.jsx)(we.Td,{children:e.name}),Object(T.jsx)(we.Td,{children:e.external_tracking_id}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsx)(we.Td,{children:e.status_detail})]},t)}))})]})]})}}]),n}(c.Component),Qo=Object(o.b)((function(e){return Object(d.a)({},e.users.otp_fingerprints)}),(function(e){return{updateFingerprints:function(t){return e(function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){var a;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.get("/admin/users/"+e+"/otp_fingerprints");case 2:a=t.sent,n({type:es,payload:a});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(t))}}}))(Zo),Jo=["match"],$o=function(e){var t=e.match,n=(Object(mt.a)(e,Jo),Object(c.useState)({bets:[],total_pages:0})),a=Object(m.a)(n,2),r=a[0],s=a[1],i=Object(c.useState)(!1),o=Object(m.a)(i,2),d=o[0],u=o[1],j=Object(c.useState)(1),b=Object(m.a)(j,2),h=b[0],p=b[1];return Object(c.useEffect)((function(){var e=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),e.prev=1,e.next=4,D(t.params.id,{page:h,type:"limbo"});case 4:n=e.sent,s({total_pages:n.pages,bets:n.records}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),re.toast.error(e.t0.message);case 11:u(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();e()}),[h,t.params.id]),Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[d&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Round ID"}),Object(T.jsx)(we.Th,{children:"Bet Placed At"}),Object(T.jsx)(we.Th,{children:"Bet Settled At"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Target Multiplier"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Multiplier Point"}),Object(T.jsx)(we.Th,{children:"Free Bet"}),Object(T.jsx)(we.Th,{children:"Profit"})]})}),Object(T.jsx)(we.Tbody,{children:r.bets.map((function(e){var t=e.game,n=e.wallet_params,a=e.remoteRoundId,c=e.winnings,r=e.profit,s=e.amount,i=e.currency_type,o=e.bet_placed_at,d=e.bet_settled_at,u=+c>0?+r:-1*+s,j=parseFloat(+c>0?+c:-s).toFixed(2);return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:null!==n&&void 0!==n&&n.free_bet?a:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(a),children:a})}),Object(T.jsx)(we.Td,{children:Se.withSeconds(o)}),Object(T.jsx)(we.Td,{children:Se.withSeconds(d)}),Object(T.jsxs)(we.Td,{children:[s," ",i]}),Object(T.jsx)(we.Td,{children:null===t||void 0===t?void 0:t.target}),Object(T.jsxs)(we.Td,{className:+r>=0?"good":"",children:[j," ",null===n||void 0===n?void 0:n.currency]}),Object(T.jsx)(we.Td,{children:(+(null===t||void 0===t?void 0:t.multiplier)).toFixed(2)}),Object(T.jsx)(we.Td,{children:null!==n&&void 0!==n&&n.free_bet?"yes":"no"}),Object(T.jsxs)(we.Td,{className:+r>=0?"good":"bad",children:[(+u).toFixed(2)," ",i]})]},a)}))})]}),Object(T.jsx)(Ke,{total_pages:r.total_pages,update:function(e){return p(e)}})]})},el=n(703),tl=n(728),nl=n(723),al=n(707),cl=n(732),rl=n(718),sl=n(710),il=n(719);function ol(e){var t=e.form,n=e.formErrors,a=e.onChange,c=e.suspendAccountReasonOptions,r=e.children,s=function(e){a(e.target.name,e.target.value)};return Object(T.jsxs)(el.a,{direction:"row",gap:2,autoComplete:"off",children:[Object(T.jsx)(cl.a,{children:Object(T.jsx)(ms.a,{name:"duration",label:"Duration (days)",type:"number",value:t.duration,onChange:s,InputProps:{inputProps:{min:0,pattern:"[0-9]*"}},autoComplete:"off",error:!(null===n||void 0===n||!n.duration),helperText:null===n||void 0===n?void 0:n.duration})}),Object(T.jsxs)(cl.a,{sx:{minWidth:120},children:[Object(T.jsx)(rl.a,{htmlFor:"reason",children:"Reason"}),Object(T.jsx)(sl.a,{id:"reason",name:"reason",value:t.reason,label:"Reason",onChange:s,children:c.map((function(e){return Object(T.jsx)(il.a,{value:e.id,children:e.reason},e.id)}))})]}),Object(T.jsx)(cl.a,{sx:{flex:1},children:Object(T.jsx)(ms.a,{name:"note",label:"Note",value:t.note,onChange:s,autoComplete:"off"})}),r]})}var ll=function(e,t){var n,a;return null!==(n=null===(a=t.find((function(t){return t.id===e})))||void 0===a?void 0:a.reason)&&void 0!==n?n:"-"};function dl(e){var t=e.userSuspension,n=e.suspendAccountReasonOptions,a=e.children;return t?Object(T.jsxs)("table",{children:[Object(T.jsx)("thead",{children:Object(T.jsxs)("tr",{children:[Object(T.jsx)("th",{children:"Start Date"}),Object(T.jsx)("th",{children:"End Date"}),Object(T.jsx)("th",{children:"Reason"}),Object(T.jsx)("th",{children:"Staft Id"}),Object(T.jsx)("th",{children:"Note"}),Object(T.jsx)("th",{children:"Action"})]})}),Object(T.jsx)("tbody",{children:Object(T.jsxs)("tr",{children:[Object(T.jsx)("td",{children:Se.withSeconds(t.created_at)}),Object(T.jsx)("td",{children:Se.withSeconds(t.expires_at)}),Object(T.jsx)("td",{children:ll(t.reason,n)}),Object(T.jsx)("td",{children:t.staff_user_id}),Object(T.jsx)("td",{children:t.note}),Object(T.jsx)("td",{children:a})]})})]}):Object(T.jsx)(tl.a,{variant:"body2",component:"p",children:"No suspension to show"})}var ul=Object(o.b)((function(e){return e}),(function(e){return{closeAccount:function(t,n,a){e(bs(t,n,a))}}}))((function(e){var t=e.user_id,n=e.closeAccount,a=Object(c.useState)(""),r=Object(m.a)(a,2),s=r[0],i=r[1],o=Object(c.useState)(""),l=Object(m.a)(o,2),d=l[0],u=l[1];return Object(T.jsxs)(el.a,{direction:"column",gap:2,children:[Object(T.jsx)(tl.a,{variant:"h4",component:"h1",children:"Close Account"}),Object(T.jsxs)(el.a,{direction:"row",gap:2,children:[Object(T.jsxs)(cl.a,{sx:{minWidth:200},children:[Object(T.jsx)(rl.a,{htmlFor:"reason",children:"Select a reason"}),Object(T.jsx)(sl.a,{id:"reason",name:"reason",value:s,label:"Select a reason",onChange:function(e){return i(e.target.value)},children:hc.map((function(e){return Object(T.jsx)(il.a,{value:e.reason,children:e.reason},e.id)}))})]}),Object(T.jsx)(cl.a,{fullWidth:!0,children:Object(T.jsx)(ms.a,{name:"comment",label:"Comment",value:d,onChange:function(e){return u(e.target.value)},autoComplete:"off"})}),Object(T.jsx)(nl.a,{variant:"contained",color:"secondary",size:"small",onClick:function(e){e.preventDefault(),s?n(t,!1,"".concat(s,". ").concat(d).trim()):alert("Must select a reson!")},children:"Close Account"})]})]})})),jl=Object(o.b)((function(e){return e}),(function(e){return{closeAccount:function(t,n,a){e(bs(t,n,a))}}}))((function(e){var t=e.user_id,n=e.closeAccount,a=Object(c.useState)(""),r=Object(m.a)(a,2),s=r[0],i=r[1];return Object(T.jsxs)(el.a,{direction:"column",gap:2,children:[Object(T.jsx)(tl.a,{variant:"h4",component:"h1",children:"Reopen Account"}),Object(T.jsxs)(el.a,{direction:"row",gap:2,children:[Object(T.jsx)(cl.a,{fullWidth:!0,children:Object(T.jsx)(ms.a,{name:"reason",label:"Reason",value:s,onChange:function(e){return i(e.target.value)},autoComplete:"off",required:!0})}),Object(T.jsx)(nl.a,{variant:"contained",color:"secondary",size:"small",onClick:function(e){e.preventDefault(),s?n(t,!0,s.trim()):alert("The reson field is required!")},children:"Reopen Account"})]})]})})),bl={form:{duration:"",reason:"",note:""},formErrors:{}},hl="CHANGE_SUSPENSION_FORM",pl="UPDATE_FORM_ERRORS",Ol=function(e,t){var n,a=(n={},Object(_.a)(n,hl,(function(e,t){return Object(d.a)(Object(d.a)({},e),{},{form:Object(d.a)(Object(d.a)({},e.form),t)})})),Object(_.a)(n,pl,(function(e,t){return Object(d.a)(Object(d.a)({},e),{},{formErrors:t})})),n);return a[t.type]?a[t.type](e,t.payload):e},_l=hc.concat({id:9,reason:"Other"}).map((function(e){return Object(d.a)(Object(d.a)({},e),{},{id:e.id.toString()})}));var ml=Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e),{},{user:Object(d.a)({},e.users.user)})}),(function(e){return{suspend:function(t){var n=t.user_id,a=t.duration,c=t.reason,r=t.note;return e(os({user_id:n,duration:a,reason:c,note:r,cancel:!1}))},cancelSuspend:function(t){var n=t.user_id;return e(os({user_id:n,cancel:!0}))}}}))((function(e){var t=(e.user.roles||[]).includes("closed"),n=Object(c.useReducer)(Ol,bl),a=Object(m.a)(n,2),r=a[0],s=a[1];return Object(T.jsxs)(el.a,{direction:"column",gap:2,px:2,pb:2,children:[Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.USER_UPDATE_SUSPENSION,children:[Object(T.jsx)(tl.a,{variant:"h4",component:"h1",children:"Suspend User"}),Object(T.jsx)(tl.a,{variant:"body2",component:"p",children:"After the suspension, the user will not be able to access the platform"}),Object(T.jsx)(ol,{form:r.form,formErrors:r.formErrors,onChange:function(e,t){return s({type:hl,payload:Object(_.a)({},e,t)})},suspendAccountReasonOptions:_l,children:Object(T.jsx)(nl.a,{variant:"contained",color:"secondary",size:"small",onClick:function(){var t=function(e){var t={};return Number(e.duration)&&0!==Number(e.duration)||(t.duration="Duration must be greather than 0"),t}(r.form);if(Object.keys(t).length>0)s({type:pl,payload:t});else{var n=r.form,a=n.duration,c=n.reason,i=n.note;e.suspend({user_id:e.user.id,duration:a,reason:c,note:i})}},disabled:!!e.user.user_suspension,children:"Suspend"})})]}),Object(T.jsx)(tl.a,{variant:"h6",component:"h2",children:"Last Suspension"}),Object(T.jsx)(dl,{userSuspension:e.user.user_suspension,suspendAccountReasonOptions:_l,children:Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_CANCEL_SUSPENSION,children:Object(T.jsx)(nl.a,{variant:"contained",color:"secondary",size:"small",onClick:function(){e.cancelSuspend({user_id:e.user.id})},children:"Unsuspend"})})}),Object(T.jsx)(al.a,{}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_CLOSE_ACCOUNT,children:t?Object(T.jsx)(jl,{user_id:e.user.id}):Object(T.jsx)(ul,{user_id:e.user.id})})]})})),xl=me.a.USERS,fl=[{props:{group:xl.INFO,exact:!0},path:"/users/:id/info",component:qi},{props:{group:xl.KYC},path:"/users/:id/documents",component:to},{props:{group:xl.ROLES},path:"/users/:id/route-permissions",component:Ls},{props:{group:xl.BALANCES},path:"/users/:id/financials",component:fi},{props:{group:xl.ROLES},path:"/users/:id/permissions",component:po},{props:{group:xl.MUTUAL},path:"/users/:id/anti-fraud",component:Bs},{props:{group:xl.BONUSES},path:"/users/:id/bonus-rounds",component:Ks},{props:{group:xl.TRANSACTIONS},path:"/users/:id/transactions",component:function(){var e=Object(p.useParams)().id,t=Object(c.useState)(1),a=Object(m.a)(t,2),r=a[0],s=a[1],i=Object(c.useState)(null),d=Object(m.a)(i,2),u=d[0],j=d[1],b=Object(c.useState)(null),h=Object(m.a)(b,2),O=h[0],_=h[1],x=Object(c.useState)(null),f=Object(m.a)(x,2),v=f[0],g=f[1],y=Object(c.useState)("both"),S=Object(m.a)(y,2),w=S[0],R=S[1],A=Object(c.useState)(null),N=Object(m.a)(A,2),C=N[0],I=N[1],k=Object(c.useState)(Object(ye.utc)().subtract(45,"days").toDate()),D=Object(m.a)(k,2),L=D[0],U=D[1],P=Object(c.useState)(Object(ye.utc)().toDate()),W=Object(m.a)(P,2),M=W[0],B=W[1],F=Object(c.useState)(Ro[0].value),G=Object(m.a)(F,2),V=G[0],Y=G[1],H=Object(c.useState)(null),q=Object(m.a)(H,2),K=q[0],z=q[1],X=Object(c.useState)(null),Z=Object(m.a)(X,2),Q=Z[0],J=Z[1],$=Object(c.useState)(!1),ee=Object(m.a)($,2),te=ee[0],ne=ee[1],ae=Object(c.useState)(!1),ce=Object(m.a)(ae,2),re=ce[0],se=ce[1],ie=Object(o.d)((function(e){return e.users.user.wallets}));Object(c.useEffect)((function(){I(ie.find((function(e){return e.primary})).id)}),[ie]),Object(c.useEffect)((function(){s(1)}),[u,O,C,L,M,V,v]);var oe=Object(E.useQuery)(["txs",r,u,O,C,L,M,V,v,w,K,Q],(function(){var t=O;return O===Eo&&(t="all_except_game_provider_etc"),window.api.get("/admin/users/".concat(e,"/transactions"),{params:{page:r,startDate:L,endDate:M,transactionId:u,type:t,walletId:C,note:v,order:V,subWalletType:"both"===w?null:w,minAmount:K||0,maxAmount:Q||null}})}),{keepPreviousData:!0,initialData:{transactions:[],total_pages:1}}),le=oe.data,de=le.transactions,ue=le.total_pages,je=oe.isLoading;return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[je&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)("div",{className:Gs.a.filtersQuery,children:[Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by Time"}),Object(T.jsx)(ir,{startDate:L,setStartDate:U,endDate:M,setEndDate:B})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by ID"}),Object(T.jsx)("input",{type:"text",id:"id",name:"id",onChange:function(e){j(e.target.value)}})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"},children:[Object(T.jsx)("h5",{children:"Search by Note"}),Object(T.jsx)("button",{className:Gs.a.buttonExport,onClick:function(){g("Unable to locate bonus journal, payed to real instead")},children:"Bonus Into Real"})]}),Object(T.jsx)("input",{type:"text",id:"note",name:"note",value:v,onChange:function(e){g(e.target.value)}})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Min amount"}),Object(T.jsx)("input",{type:"text",id:"minAmount",name:"minAmount",value:K,onKeyDown:function(e){or(e.key)||"Backspace"===e.key||e.preventDefault()},onChange:function(e){z(e.target.value)}})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Max amount"}),Object(T.jsx)("input",{type:"text",id:"maxAmount",name:"maxAmount",value:Q,onKeyDown:function(e){or(e.key)||"Backspace"===e.key||e.preventDefault()},onChange:function(e){J(e.target.value)}})]})]}),Object(T.jsxs)("div",{className:Gs.a.filtersQuery,children:[Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by sub wallet"}),Object(T.jsx)(Ce.a,{clearable:!1,name:"subWalletType",value:w,onChange:function(e){return R(e.value)},options:wo.map((function(e){return{label:e,value:e}}))})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by Tx Type"}),Object(T.jsx)(Ce.a,{clearable:!1,name:"type",value:O,onChange:function(e){return _(e.value)},options:So.map((function(e){return{label:e,value:e}}))})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by Wallet Currency"}),Object(T.jsx)(Ce.a,{clearable:!1,name:"type",value:C,onChange:function(e){return I(e.value)},options:ie.map((function(e){return{label:e.deposit_currency_type,value:e.id}}))})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Order"}),Object(T.jsx)(Ce.a,{clearable:!1,name:"type",value:V,onChange:function(e){return Y(e.value)},options:Ro})]})]}),Object(T.jsx)("div",{style:{minHeight:400},children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Note"}),Object(T.jsx)(we.Th,{children:"Wallet"}),Object(T.jsx)(we.Th,{children:"Sub Wallet"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Closing Balance"}),Object(T.jsx)(we.Th,{children:"Closing Real Balance"}),Object(T.jsx)(we.Th,{children:"Closing Bonus Balance"})]})}),Object(T.jsx)(we.Tbody,{children:de.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(ye.utc)(e.created_at).format("YYYY-MM-DD HH:mm")}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(e.game_provider_round_id),children:e.id})}),Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.note}),Object(T.jsx)(we.Td,{children:e.currency_type}),Object(T.jsx)(we.Td,{children:e.sub_wallet_type}),Object(T.jsx)(we.Td,{children:e.amount}),Object(T.jsxs)(we.Td,{children:[e.currency_symbol,e.closing_balance]}),Object(T.jsxs)(we.Td,{children:[e.currency_symbol,e.closing_real_balance]}),Object(T.jsxs)(we.Td,{children:[e.currency_symbol,e.closing_bonus_balance]})]},t)}))})]})}),Object(T.jsx)(lt,{page:r,setPage:s,totalPages:ue}),Object(T.jsxs)("div",{className:Gs.a.buttons,children:[Object(T.jsx)(ci,{styles:{},onClick:function(){return ne(!0)}}),Object(T.jsx)(ni,{isOpen:te,onClose:function(){return ne(!1)},downloadingReport:re,startDate:L,endDate:M,onExport:function(t){!function(t,a,c){se(!0),n(61)({url:"/api/admin/users/".concat(e,"/transactions/export/").concat(t),method:"GET",responseType:"blob",params:{startDate:a,endDate:c},headers:{Authorization:"Bearer ".concat(localStorage.getItem("access_token")),"X-RateLimit-Bypass":"1"}}).then((function(e){var n="xls"===t?"xlsx":t;Re(e.data,n)})).finally((function(){return se(!1)}))}(t.format,t.startDate,t.endDate)}})]})]})}},{props:{group:xl.DEPOSITS},path:"/users/:id/deposits",component:ri},{props:{group:xl.BETS},path:"/users/:id/crash-bets",component:zs},{props:{group:xl.BETS},path:"/users/:id/crash-II-bets",component:Xs},{props:{group:xl.BETS},path:"/users/:id/neymar-crash-bets",component:Ko},{props:{group:xl.BETS},path:"/users/:id/crash-rewired-bets",component:zo},{props:{group:xl.BETS},path:"/users/:id/double-bets",component:oi},{props:{group:xl.BETS},path:"/users/:id/double-v2-bets",component:li},{props:{group:xl.BETS},path:"/users/:id/mines-bets",component:co},{props:{group:xl.BETS},path:"/users/:id/bets-pending",component:Xo},{props:{group:xl.BETS},path:"/users/:id/mines-bets-v2",component:ro},{props:{group:xl.BETS},path:"/users/:id/tower-bets",component:so},{props:{group:xl.BETS},path:"/users/:id/coin-flip-bets",component:Go},{props:{group:xl.BETS},path:"/users/:id/slide-bets",component:ko},{props:{group:xl.BETS},path:"/users/:id/fortune-double-bets",component:Ho},{props:{group:xl.BETS},path:"/users/:id/fruits-bets",component:Do},{props:{group:xl.BETS},path:"/users/:id/fruits-slice-bets",component:Bo},{props:{group:xl.BETS},path:"/users/:id/dice-bets",component:ii},{props:{group:xl.BETS},path:"/users/:id/plinko-bets",component:Co},{props:{group:xl.BETS},path:"/users/:id/limbo-bets",component:Io},{props:{group:xl.BETS},path:"/users/:id/limbo-rewired-bets",component:$o},{props:{group:xl.BETS},path:"/users/:id/game-provider-rounds",component:function(){var e=Object(p.useParams)().id,t=Object(c.useState)(1),a=Object(m.a)(t,2),r=a[0],s=a[1],i=Object(c.useState)(""),d=Object(m.a)(i,2),u=(d[0],d[1],Object(c.useState)(null)),j=Object(m.a)(u,2),b=j[0],h=(j[1],Object(c.useState)(null)),O=Object(m.a)(h,2),_=O[0],v=O[1],g=Object(c.useState)(null),y=Object(m.a)(g,2),S=y[0],w=y[1],R=Object(c.useState)(Ee()().subtract(45,"days").toDate()),A=Object(m.a)(R,2),N=A[0],C=A[1],I=Object(c.useState)(Ee()().toDate()),k=Object(m.a)(I,2),D=k[0],L=k[1],U=Object(c.useState)(Ti[0].value),P=Object(m.a)(U,2),W=P[0],M=P[1],B=Object(o.d)((function(e){return e.users.user.wallets})),F=Object(c.useState)(!1),G=Object(m.a)(F,2),V=G[0],Y=G[1],H=Object(c.useState)(!1),q=Object(m.a)(H,2),K=q[0],z=q[1];Object(c.useEffect)((function(){w(B.find((function(e){return e.primary})).id)}),[B]),Object(c.useEffect)((function(){s(1)}),[b,N,D,W,_,S]);var X=Object(E.useQuery)(["game-history",r,b,N,D,W,_,S],Object(f.a)(Object(x.a)().mark((function t(){var n;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(Ee()(D).diff(Ee()(N),"days")>60)){t.next=3;break}return re.toast.error("The difference between end Date and Start date must be at most 60 days"),t.abrupt("return",{records:[],total_pages:0});case 3:return t.next=5,window.api.get("/admin/users/".concat(e,"/game_provider_rounds"),{params:{page:r,startDate:N,endDate:D,gameId:b,walletId:S,idSearch:_,order:W}});case 5:return n=t.sent,t.abrupt("return",n);case 7:case"end":return t.stop()}}),t)}))),{keepPreviousData:!0,initialData:{records:[],total_pages:1}}),Z=X.data,Q=Z.records,J=Z.total_pages,$=X.isLoading,ee=X.refetch;return Object(T.jsxs)("div",{style:{position:"relative"},children:[$&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)("div",{className:Gs.a.filtersQuery,style:{display:"flex"},children:[Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by Time"}),Object(T.jsx)(ir,{startDate:N,setStartDate:C,endDate:D,setEndDate:L})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by Provider External Id"}),Object(T.jsx)("input",{type:"text",id:"id",name:"id",onChange:function(e){v(e.target.value)}})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Search by Wallet Currency"}),Object(T.jsx)(Ce.a,{clearable:!1,name:"type",value:S,onChange:function(e){return w(e.value)},options:B.map((function(e){return{label:e.deposit_currency_type,value:e.id}}))})]})]}),Object(T.jsxs)("div",{className:Gs.a.filterQuery,children:[Object(T.jsx)("h5",{children:"Order"}),Object(T.jsx)(Ce.a,{clearable:!1,name:"type",value:W,onChange:function(e){return M(e.value)},options:Ti})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Game"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Wager"}),Object(T.jsx)(we.Th,{children:"Winnings"}),Object(T.jsx)(we.Th,{children:"Profit"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsx)(we.Tbody,{children:Q.map((function(t,n){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(t.created_at)}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/casino/game-provider-rounds/".concat(t.id),children:t.id})}),Object(T.jsx)(we.Td,{children:t.game.name}),Object(T.jsxs)(we.Td,{children:[t.bets," bet",t.bets>1?"s":""," ",t.wins," win",t.wins>1?"s":""," ",+t.rollbacks>0?"".concat(t.rollbacks," refunds"):""]}),Object(T.jsxs)(we.Td,{children:[t.amount," ",t.currency_type]}),Object(T.jsxs)(we.Td,{className:"good",children:[t.win_amount," ",t.currency_type]}),Object(T.jsxs)(we.Td,{className:t.profit>=0?"good":"bad",children:[t.profit," ",t.currency_type]}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(fe,{feature:"REFUND_ROUND",children:0===+t.rollbacks&&Object(T.jsx)("button",{onClick:function(){window.api.post("/admin/users/".concat(e,"/game_provider_rounds/").concat(t.id,"/refund")).then((function(){return re.toast.success("refunded."),ee()}))},children:"Refund"})})})]},n)}))})]}),Object(T.jsx)(lt,{page:r,setPage:s,totalPages:J}),Object(T.jsxs)("div",{className:Gs.a.buttons,children:[Object(T.jsx)(ci,{onClick:function(){return Y(!0)}}),Object(T.jsx)(ni,{isOpen:V,onClose:function(){return Y(!1)},downloadingReport:K,startDate:N,endDate:D,onExport:function(t){!function(t,a,c){z(!0),n(61)({url:"/api/admin/users/".concat(e,"/game_provider_rounds/export/").concat(t),method:"GET",responseType:"blob",params:{startDate:a,endDate:c},headers:{Authorization:"Bearer ".concat(localStorage.getItem("access_token")),"X-RateLimit-Bypass":"1"}}).then((function(e){var n="xls"===t?"xlsx":t;Re(e.data,n)})).finally((function(){return z(!1)}))}(t.format,t.startDate,t.endDate)}})]})]})}},{props:{group:xl.SOFTSWISS_FREE_SPINS},path:"/users/:id/softswiss-free-spins",component:yo},{props:{group:xl.FINGERPRINTS},path:"/users/:id/fingerprints",component:gi},{props:{group:xl.NOTES},path:"/users/:id/notes",component:Is},{props:{group:xl.WITHDRAWALS},path:"/users/:id/withdrawals",component:No},{props:{group:xl.REWARDS},path:"/users/:id/reward-inventory",component:xo},{props:{group:xl.REWARDS},path:"/users/:id/cashback-reward-periods",component:fo},{props:{group:xl.MYSTERY_BOX_BALANCES},path:"/users/:id/mystery-boxes",component:oo},{props:{group:xl.MYSTERY_BOX_OPENS},path:"/users/:id/mystery-box-opens",component:uo},{props:{group:xl.REFERRALS},path:"/users/:id/referrals",component:_o},{props:{group:xl.LOYALTY},path:"/users/:id/loyalty",component:ao},{props:{group:xl.PAYMENT_METHODS},path:"/users/:id/payment-methods",component:bo},{props:{group:xl.BONUSES},path:"/users/:id/BONUSES",component:Ys},{props:{group:xl.ROLES},path:"/users/:id/roles",component:go},{props:{group:xl.OVERDRAFTS},path:"/users/:id/overdraft-alerts",component:qo},{props:{group:xl.FINGERPRINTS},path:"/users/:id/otp",component:Qo},{props:{group:xl.SUSPENSIONS},path:"/users/:id/suspensions",component:ml}],vl=fl,gl=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.value,a=e.index;return Object(T.jsx)("div",{role:"tabpanel",hidden:n!==a,id:"simple-tabpanel-".concat(a),"aria-labelledby":"simple-tab-".concat(a),children:n===a&&Object(T.jsx)("div",{children:t})})}}]),n}(c.Component),Tl=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={amount:"",wallet:"",show_payment_document:!1,info:{},mounted:!0,selectedMenu:"",selectedTab:"General",sections:[{title:"General",links:Rs.general},{title:"Game bets",links:Rs.gameBets},{title:"Prize Free Money",links:Rs.prizeFreeMoney}]},a.handleTabChange=a.handleTabChange.bind(Object(Dn.a)(a)),a.remountChildren=a.remountChildren.bind(Object(Dn.a)(a)),a}return Object(j.a)(n,[{key:"handleTabChange",value:function(e,t){this.setState({selectedTab:t})}},{key:"componentDidMount",value:function(){this.props.updateUser(this.props.match.params.id)}},{key:"componentWillReceiveProps",value:function(e){this.props.match.params.id!==e.match.params.id&&this.props.updateUser(e.match.params.id)}},{key:"remountChildren",value:function(){var e=this;this.setState({mounted:!1},(function(){e.setState({mounted:!0})}))}},{key:"render",value:function(){var e=this,t=this.state.selectedTab,n=this.props.appUserRole.includes("influencer")||this.props.appUserRole.includes("support");return Object(T.jsxs)("div",{className:"user-page",children:[Object(T.jsx)("div",{className:"header",children:Object(T.jsxs)("div",{className:"user-header-left",children:[Object(T.jsx)("img",{src:this.props.avatar_url||"/images/icons/avatar_default.svg"}),Object(T.jsxs)("div",{children:[Object(T.jsx)("h3",{children:this.props.username}),!n&&this.props.roles.map((function(e){return Object(T.jsx)("span",{class:"badge",style:{backgroundColor:"#602c2c",color:"#fff",padding:"4px 8px",textAlign:"center",borderRadius:5,marginRight:5},children:e})}))]})]})}),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"page-wrapper",children:[Object(T.jsx)(O.MobileView,{children:Object(T.jsx)(_s.a,{disablePortal:!0,id:"combo-box-demo",options:Rs.mobileView,renderInput:function(e){return Object(T.jsx)(ms.a,Object(d.a)(Object(d.a)({},e),{},{label:"User info Pages"}))},renderOption:function(t,n){return r.a.createElement(n.component,Object(d.a)(Object(d.a)({},n.props),{},{key:n.to}),Object(T.jsx)(l.c,{to:"".concat(e.props.match.url).concat(n.to),children:Object(T.jsx)(xs.a,Object(d.a)(Object(d.a)({component:"li"},t),{},{children:n.label}))}))}})}),Object(T.jsxs)(O.BrowserView,{children:[Object(T.jsx)(fs.a,{position:"static",children:Object(T.jsx)(vs.a,{indicatorColor:"secondary",value:t,onChange:this.handleTabChange,"aria-label":"simple tabs example",children:this.state.sections.map((function(e){return Object(T.jsx)(gs.a,{label:e.title,value:e.title},e.title)}))})}),this.state.sections.map((function(n){return Object(T.jsx)(gl,{value:t,index:n.title,children:Object(T.jsx)("nav",{className:"user-nav",children:n.links.map((function(t){var n=t.component,a=t.props,c=t.to,s=t.label;return r.a.createElement(n,Object(d.a)(Object(d.a)({},a),{},{key:c}),Object(T.jsx)(l.c,{to:"".concat(e.props.match.url).concat(c),children:s}))}))})},"panel_"+n.title)}))]}),Object(T.jsx)("div",{className:"nav-output",children:!this.props.loading&&this.state.mounted&&Object(T.jsx)(c.Fragment,{children:Object(T.jsxs)(p.Switch,{children:[vl.map((function(e){var t=e.component,n=e.props,a=e.path;return Object(c.createElement)(ge,Object(d.a)(Object(d.a)({},n),{},{key:a,path:a,component:t}))})),Object(T.jsx)(p.Redirect,{from:"*",to:"/users/".concat(this.props.match.params.id,"/info")})]})})})]})]})}}]),n}(c.Component),yl=Object(p.withRouter)(Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e.users.user),{},{appUserRole:e.app.user.roles})}),(function(e){return{updateUser:function(t){return e(as(t))},selectCurrency:function(t){return e(ns(t))}}}))(Tl)),El=n(350),Sl=n.n(El),wl={base32:"",url:"",code:""},Rl=function(e){var t=e.userId,n=e.onActivate,a=Object(c.useState)(wl),r=Object(m.a)(a,2),s=r[0],i=s.code,o=s.base32,l=s.url,u=r[1],j=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/users/".concat(t,"/two_factor/generate_secret"),{});case 2:n=e.sent,Sl.a.toDataURL(n.otpauth_url,(function(e,t){u((function(e){return Object(d.a)(Object(d.a)({},e),{},{url:t})}))})),u((function(e){return Object(d.a)(Object(d.a)({},e),{},{base32:n.base32})}));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(c.useEffect)((function(){t&&j()}),[]);var b=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n(i);case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(T.jsxs)("div",{id:"two-factor",className:"two-factor-activation",children:[Object(T.jsx)("div",{children:o}),Object(T.jsx)("img",{src:l}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{children:[Object(T.jsx)("div",{children:"Enter authentication code"}),Object(T.jsx)("input",{placeholder:"Eg. 123 456",value:i,onChange:function(e){var t,n,a=null===e||void 0===e||null===(t=e.target)||void 0===t||null===(n=t.value)||void 0===n?void 0:n.replace(" ","");u((function(e){return Object(d.a)(Object(d.a)({},e),{},{code:a})}))}})]}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{className:"red",disabled:!/^\d{6}$/.test(i),onClick:b,children:"Activate"})]})},Al={email:"",password:"",dateOfBirth:"",enableTwoFactor:!1},Nl=function(e){var t=e.onCreate,n=Object(c.useState)(Al),a=Object(m.a)(n,2),r=a[0],s=r.email,i=r.password,o=r.dateOfBirth,l=r.enableTwoFactor,u=a[1],j=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t({email:s,password:i,dateOfBirth:o,enableTwoFactor:l}),u(Al);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(T.jsxs)("div",{children:["Email:",Object(T.jsx)("input",{value:s,onChange:function(e){!function(e){u((function(t){return Object(d.a)(Object(d.a)({},t),{},{email:e})}))}(e.target.value)}}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),"Password:",Object(T.jsx)("input",{placeholder:"Password",type:"password",value:i,onChange:function(e){!function(e){u((function(t){return Object(d.a)(Object(d.a)({},t),{},{password:e})}))}(e.target.value)}}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),"Date of birth (YYYY-MM-DD):",Object(T.jsx)("input",{value:o,onChange:function(e){!function(e){u((function(t){return Object(d.a)(Object(d.a)({},t),{},{dateOfBirth:e})}))}(e.target.value)}}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{onClick:function(){u((function(e){return Object(d.a)(Object(d.a)({},e),{},{enableTwoFactor:!l})}))},children:[Object(T.jsx)("label",{children:"Enable two-factor: "}),Object(T.jsx)("input",{checked:l,onChange:function(){},type:"checkbox"})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{onClick:j,children:"Create User"})]})},Cl=function(e){Object(ho.a)(e);var t=Object(c.useState)("creation"),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(null),i=Object(m.a)(s,2),o=i[0],l=i[1],d=function(e){var t=e.enableTwoFactor;switch(a){case"creation":return void(t&&r("twoFactorActivation"));case"twoFactorActivation":return void r("creation");default:return}},u=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,a,c,r,s,i,o;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=t.email,r=t.password,s=t.dateOfBirth,i=t.enableTwoFactor,e.next=3,window.api.post("/admin/users",{email:c,password:r,date_of_birth:s});case 3:o=e.sent,l(null===o||void 0===o||null===(n=o.user)||void 0===n?void 0:n.userId),re.toast.success("User with ID: ".concat(null===o||void 0===o||null===(a=o.user)||void 0===a?void 0:a.userId," was createad")),d({enableTwoFactor:i});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),j=function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.api.post("/admin/users/".concat(o,"/two_factor/activate"),{code:t});case 2:re.toast.success("Two Factor enabled successfully for user with ID: ".concat(o)),d({});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();switch(a){case"creation":return Object(T.jsx)(Nl,{onCreate:u});case"twoFactorActivation":return Object(T.jsx)(Rl,{userId:o,onActivate:j});default:return Object(T.jsx)("div",{children:"Unexciting step"})}},Il=(n(562),n(351)),kl=function(e){return!1===function(e){return function(e){return/[0-9]{3}\.[0-9]{3}\.[0-9]{3}-[0-9]{2}/.test(e)}(e)&&Il.a.isValid(e)}(e)};var Dl=["exato","serpro"],Ll=function(){var e=Object(c.useState)({}),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(!1),s=Object(m.a)(r,2),i=s[0],o=s[1],l=Object(c.useState)(""),d=Object(m.a)(l,2),u=d[0],j=d[1],b=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o(!0),e.next=4,window.api.get("/admin/users/check-cpf?cpf=".concat(u));case 4:t=e.sent,a(t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0);case 11:return e.prev=11,o(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,8,11,14]])})));return function(){return e.apply(this,arguments)}}();return Object(T.jsxs)("div",{className:"check-cpf-container",children:[Object(T.jsxs)("div",{className:"cpf-input",children:[Object(T.jsx)("label",{htmlFor:"cpf",children:"CPF:"}),Object(T.jsx)("input",{name:"cpf",id:"cpf",onChange:function(e){return j(e.currentTarget.value)}}),Object(T.jsx)("button",{disabled:i||kl(u),onClick:b,children:kl(u)?"Invalid CPF Format":"CHECK"})]}),Object(T.jsx)("div",{className:"cpf-providers-response",children:i?"Checking":Dl.map((function(e){var t=n[e];if(t){var a=Object.keys(t);return Object(T.jsxs)("div",{children:[Object(T.jsx)("h2",{children:e.toUpperCase()}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:"Key"}),Object(T.jsx)(we.Td,{children:"Value"})]})}),Object(T.jsx)(we.Tbody,{children:a.map((function(e){var n,a=(n=t[e],{is:{anArray:Jn.a.isArray(n),aPlainObject:Jn.a.isPlainObject(n),present:!Jn.a.isNil(n),aBoolean:"boolean"===typeof n},returnSelf:n});return Object(T.jsxs)(we.Tr,{children:[Object(T.jsxs)(we.Td,{children:[e.toUpperCase(),":"]}),Object(T.jsx)(we.Td,{children:a.is.aBoolean?!0===a.returnSelf?"YES":"NO":a.returnSelf})]})}))})]})]},e)}}))})]})},Ul=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){var e=this.props.match.url,t=this.props.location.search;return Object(T.jsxs)("div",{className:"page",children:[Object(T.jsxs)("nav",{children:[Object(T.jsx)(l.c,{exact:!0,to:"".concat(e,"/find"),children:"Find users"}),Object(T.jsx)(l.c,{exact:!0,to:"".concat(e,"/create"),children:"Create users"}),Object(T.jsx)(l.c,{exact:!0,to:"".concat(e,"/check-cpf"),children:"Check CPF"})]}),Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(Te,{feature:Oe.permissionsConstants.USER_CREATE,exact:!0,path:"/users/create",component:Cl}),Object(T.jsx)(Te,{feature:Oe.permissionsConstants.USER_VIEW_LIST,exact:!0,path:"/users/find",component:Os}),Object(T.jsx)(Te,{feature:Oe.permissionsConstants.CHECK_CPF,path:"/users/check-cpf",component:Ll}),Object(T.jsx)(Te,{feature:Oe.permissionsConstants.USER_VIEW_USER,path:"/users/:id",component:yl}),Object(T.jsx)(p.Redirect,{from:"/users",to:"/users/find/"+t})]})]})}}]),n}(c.Component),Pl=Object(p.withRouter)(Object(o.b)((function(e){return{}}),(function(e){return{broadcast:function(t){e(function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.api.post("/admin/broadcast",{message:e});case 2:n({type:"users/BROADCAST_UPDATE"});case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(t))}}}))(Ul)),Wl="payments/METHODS/UPDATE",Ml="payments/COUNTRY_ORDERINGS/UPDATE",Bl="payments/METHOD/UPDATE",Fl="payments/PROVIDERS/UPDATE",Gl="payments/PROVIDER/UPDATE",Vl="payments/ACCOUNTS/UPDATE",Yl="payments/COUNTRY_ORDERING/UPDATE",Hl=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(n){window.api.get("/admin/payments/methods?limit=".concat(e,"&page=").concat(t)).then((function(e){n({type:Wl,payload:e})}))}},ql=function(e){return function(t){window.api.get("/admin/payments/providers/"+e).then((function(e){t({type:Gl,payload:e})}))}},Kl=function(){return function(e){window.api.get("/admin/payments/country_orderings").then((function(t){e({type:Ml,payload:t})}))}},zl=function(e){return function(t){window.api.get("/admin/payments/country_orderings/"+e).then((function(e){t({type:Yl,payload:e})}))}},Xl=function(e,t){return function(n){window.api.put("/admin/payments/country_orderings/"+e,t).then((function(t){n(zl(e))}))}},Zl=function(e,t){return function(n){return window.api.put("/admin/payments/providers/"+e,t).then((function(t){n(ql(e))}))}},Ql=n(563),Jl=function(e){var t=function(e){return Ql.parse(e)}(e),n=new Blob([t],{type:"text/plain"}),a=URL.createObjectURL(n),c=document.createElement("a");c.download="".concat((new Date).toISOString(),"-export.csv"),c.href=a,c.click(),URL.revokeObjectURL(a)};var $l=function(e){var t=e.style,n=e.records;return Object(T.jsx)("button",{style:t,onClick:function(){return Jl(n)},children:"Export to CSV"})},ed=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,processing:{},records:[]},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){this.props.update(this.state.page)}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsx)("div",{style:{display:"flex",justifyContent:"center",paddingBottom:"1rem"},children:Object(T.jsx)($l,{records:this.state.records})}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Created"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Icon URL"}),Object(T.jsx)(we.Th,{children:"Currency Type"}),Object(T.jsx)(we.Th,{children:"Enabled"})]})}),Object(T.jsx)(we.Tbody,{children:this.props.records.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.icon_url}),Object(T.jsx)(we.Td,{children:e.currency_type}),Object(T.jsx)(we.Td,{children:e.enabled?Object(T.jsx)("i",{className:"fas fa-check"}):null})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.props.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update()}))}})]})}}]),n}(c.Component),td=Object(o.b)((function(e){return Object(d.a)({},e.payments.method_search_results)}),(function(e){return{update:function(t){return e(Hl(100,t))},edit:function(t,n){return e(function(e,t){return function(n){window.api.put("/admin/payments/methods/"+e,t).then((function(e){n(Hl())}))}}(t,n))}}}))(ed),nd=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,processing:{},id:null,type:null,records:null},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){var e=this;this.update();var t=[],n=0;window.api.get("/admin/payments/providers").then((function(a){if(t=a.records,(n=a.meta.total_pages)>1){for(var c=[],r=2;r<n+1;r++)c.push(window.api.get("/admin/payments/providers?page="+r));Promise.all(c).then((function(n){n.forEach((function(e){t=t.concat(e.records)})),t.map((function(e){return delete e.total_count,e})),e.setState(Object(d.a)(Object(d.a)({},e.state),{},{records:t}))}))}else e.setState(Object(d.a)(Object(d.a)({},e.state),{},{records:t}))}))}},{key:"componentDidUpdate",value:function(e,t){t.id===this.state.id&&t.type===this.state.type||this.update()}},{key:"update",value:function(){this.props.update(this.state.page,this.state.id,this.state.type)}},{key:"handleEditProvider",value:function(e,t){var n=this;this.props.edit(e.id,t).then((function(){n.update(),re.toast.success("".concat(e.type," updated"))})).catch((function(e){return re.toast.error(e.message)}))}},{key:"handleChangePaymentPlatform",value:function(e,t){var n=e.target.value;return pe(me.a.PAYMENTS.METHODS)?n&&t.payment_method.platform!==n?this.props.editPaymentMethodPlatform(t.payment_method.id,n).then((function(){re.toast.success("".concat(t.payment_method.type," updated"))})).catch((function(e){return re.toast.error(e.message)})):re.toast.error("Something went wrong updating ".concat(t.payment_method.type)):re.toast.error("You don't have permissions to edit payment method platforms")}},{key:"render",value:function(){var e,t=this,n=this.props.match.url;return Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{className:"row",style:{"margin-bottom":"50px"},children:[Object(T.jsxs)("div",{className:"col-md-4",children:[Object(T.jsx)("h4",{children:"ID"}),Object(T.jsx)("input",{style:{width:"100%"},onChange:function(e){return t.setState({id:e.target.value,page:1})},value:this.state.id,type:"number"})]}),Object(T.jsxs)("div",{className:"col-md-4",children:[Object(T.jsx)("h4",{children:"Type"}),Object(T.jsx)("input",{style:{width:"100%"},onChange:function(e){return t.setState({type:e.target.value,page:1})},value:this.state.type})]}),Object(T.jsx)("div",{className:"col-md-4",style:{display:"flex"},children:Object(T.jsx)($l,{style:{alignSelf:"flex-end"},records:this.state.records})})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Created"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Method Type"}),Object(T.jsx)(we.Th,{children:"Provider Type"}),Object(T.jsx)(we.Th,{children:"Payment Platform"}),Object(T.jsx)(we.Th,{children:"Processing Time"}),Object(T.jsx)(we.Th,{children:"Method"}),Object(T.jsx)(we.Th,{children:"Service"}),Object(T.jsx)(we.Th,{children:"Enabled"}),Object(T.jsx)(we.Th,{children:"Globally Available"}),Object(T.jsx)(we.Th,{children:"Supported Countries"}),Object(T.jsx)(we.Th,{children:"Excluded Countries"}),Object(T.jsx)(we.Th,{children:"Requires Deposit Account"}),Object(T.jsx)(we.Th,{children:"Requires Complete Deposit With Method"}),Object(T.jsx)(we.Th,{children:"KYC Requirement"})]})}),Object(T.jsx)(we.Tbody,{children:this.props.records.map((function(e,a){var c;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"".concat(n,"/")+e.id,children:e.id})}),Object(T.jsx)(we.Td,{children:e.payment_method.type}),Object(T.jsx)(we.Td,{children:"method_redirect"===e.type?"".concat(e.type," (").concat(e.method_redirect_type,")"):e.type}),Object(T.jsx)(we.Td,{children:Object(T.jsxs)("select",{disabled:!pe(me.a.PAYMENTS.METHODS),onChange:function(n){return t.handleChangePaymentPlatform(n,e)},defaultValue:e.payment_method.platform,children:[Object(T.jsx)("option",{selected:!e.payment_method.platform,disabled:!0}),t.props.platforms.map((function(e){return Object(T.jsx)("option",{value:e,children:e})}))]})}),Object(T.jsxs)(we.Td,{children:[Object(T.jsx)("input",{value:void 0===t.state.processing[e.id]?e.processing_time:t.state.processing[e.id],onChange:function(n){t.setState({processing:Object(d.a)(Object(d.a)({},t.state.processing),{},Object(_.a)({},e.id,""===n.target.value?null:n.target.value))})}}),e.processing_time!==t.state.processing[e.id]&&void 0!==t.state.processing[e.id]&&Object(T.jsx)("button",{onClick:function(){return t.handleEditProvider(e,{processing_time:t.state.processing[e.id]})},children:"Save"})]}),Object(T.jsx)(we.Td,{children:e.method}),Object(T.jsx)(we.Td,{children:e.service}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("a",{onClick:function(){return t.handleEditProvider(e,{enabled:!e.enabled})},children:e.enabled?"Disable":"Enable"})}),Object(T.jsx)(we.Td,{children:e.globally_available?Object(T.jsx)("i",{className:"fas fa-check"}):null}),Object(T.jsx)(we.Td,{children:e.supported_countries.toString()}),Object(T.jsx)(we.Td,{children:e.excluded_countries.toString()}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(Po.a,{title:"The user will need to have at least one payment_account saved for ".concat(e.payment_method.type," to be able to withdraw with it. When the user deposits using this method, should be saved the user account to be used here, if there are not saved accounts doesn't matter how many deposits the user has."),children:Object(T.jsx)("button",{className:"small ".concat(e.requires_deposit_account?"":"outlined"),onClick:function(){return t.handleEditProvider(e,{requires_deposit_account:!e.requires_deposit_account})},children:e.requires_deposit_account?Object(T.jsx)("i",{className:"fas fa-check"}):Object(T.jsx)("span",{children:"\xa0\xa0\xa0\xa0"})})})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(Po.a,{title:"User will need to perform one deposit using ".concat(null!==(c=e.payment_method)&&void 0!==c&&c.platform?e.payment_method.platform+" platform or":""," ").concat(e.payment_method.type," method before of be able to withdraw with this method. Any deposit will count if meets with the above condition."),children:Object(T.jsx)("button",{className:"small ".concat(e.requires_complete_deposit?"":"outlined"),onClick:function(){return t.handleEditProvider(e,{requires_complete_deposit:!e.requires_complete_deposit})},children:e.requires_complete_deposit?Object(T.jsx)("i",{className:"fas fa-check"}):Object(T.jsx)("span",{children:"\xa0\xa0\xa0\xa0"})})})}),Object(T.jsx)(we.Td,{children:e.kyc_requirement})]},a)}))})]}),Object(T.jsx)(Ke,{total_pages:(null===(e=this.props.meta)||void 0===e?void 0:e.total_pages)||0,update:function(e){t.setState({page:e},(function(){return t.update()}))}})]})}}]),n}(c.Component),ad=Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e.payments.provider_search_results),{},{platforms:e.payments.platforms})}),(function(e){return{editPaymentMethodPlatform:function(t,n){return e(function(e,t){return function(n){return window.api.put("/admin/payments/methods/".concat(e,"/platform"),{platform:t}).then((function(){n(Hl)}))}}(t,n))},update:function(t,n,a){return e(function(e,t,n){console.log(t,n);var a=t,c=n,r="page=".concat(e)+(a?"&id=".concat(a):"")+(c?"&type=".concat(c):"");return function(e){window.api.get("/admin/payments/providers?"+r).then((function(t){e({type:Fl,payload:t})}))}}(t,n,a))},edit:function(t,n){return e(Zl(t,n))}}}))(nd),cd="currency_limits/UPDATE",rd="currency_limits/LIMIT/UPDATE",sd=function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=n,t.t1=rd,t.next=4,window.api.get("/admin/payments/providers/"+e);case 4:t.t2=t.sent,t.t3={type:t.t1,payload:t.t2},(0,t.t0)(t.t3);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},id=function(e,t){return function(){var n=Object(f.a)(Object(x.a)().mark((function n(a){return Object(x.a)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,window.api.put("/admin/payments/providers/"+e,{currency_limit_mutation:t});case 2:a(sd(e));case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()},od=function(e){return function(){var t=Object(f.a)(Object(x.a)().mark((function t(n){return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=n,t.t1="display_name/UPDATE",t.next=4,window.api.get("/admin/payments/providers/"+e);case 4:t.t2=t.sent,t.t3={type:t.t1,payload:t.t2},(0,t.t0)(t.t3);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},ld=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.props.update()}},{key:"render",value:function(){var e=this.props.limits,t=void 0===e?[]:e;return Object(T.jsx)("div",{children:Object(T.jsxs)("div",{children:[Object(T.jsx)("hr",{}),Object(T.jsx)("h4",{children:"Currencies"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Provider"}),Object(T.jsx)(we.Th,{children:"Method"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsx)(we.Tbody,{children:t.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.method}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/currency_limits/".concat(e.id),children:"Edit"})})]},t)}))})]})]})})}}]),n}(c.Component),dd=(Object(o.b)((function(e){return Object(d.a)({},e.currencies)}),(function(e){return{update:function(){e(function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=t,e.t1=cd,e.next=4,window.api.get("/admin/payments/providers");case 4:e.t2=e.sent,e.t3={type:e.t1,payload:e.t2},(0,e.t0)(e.t3);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},updateLimit:function(t,n){e(id(t,n))}}}))(ld),function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={limits:[],minimum:"",maximum:"",currency:""},a}return Object(j.a)(n,[{key:"componentWillReceiveProps",value:function(e){var t=e.provider.currency_limits,n=void 0===t?{}:t,a=[];for(var c in n)n.hasOwnProperty(c)&&a.push(Object(d.a)(Object(d.a)({currency:c},n[c]),{},{original:n[c]}));console.log(a),this.setState({limits:a})}},{key:"componentDidMount",value:function(){this.props.update(this.props.id)}},{key:"render",value:function(){var e=this,t=this.state.limits,n=this.props.provider,a=n.id;n.type,n.method;return Object(T.jsxs)("div",{children:[Object(T.jsx)("hr",{}),Object(T.jsx)("h4",{children:"Currency Limits"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Currency"}),Object(T.jsx)(we.Th,{children:"Minimum"}),Object(T.jsx)(we.Th,{children:"Maximum"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{colSpan:2,children:"Action"})]})}),Object(T.jsx)(we.Tbody,{children:t.map((function(n,c){var r=n.currency,s=n.minimum,i=n.maximum,o=n.original,l=!(s===o.minimum&&i===o.maximum);return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:r}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("input",{value:s,onChange:function(n){var a=n.target.value;a=(a=(a=a.toString()).replace(",",".")).replace(" ",""),isNaN(+a)&&""!==a||(+a>i&&(a=i),e.setState({limits:[].concat(Object(ct.a)(t.slice(0,c)),[Object(d.a)(Object(d.a)({},t[c]),{},{minimum:""===a?"":+a})],Object(ct.a)(t.slice(c+1)))}))}})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("input",{value:i,onChange:function(n){var a=n.target.value;a=(a=(a=a.toString()).replace(",",".")).replace(" ",""),isNaN(+a)&&""!==a||(+a<s&&(a=s),e.setState({limits:[].concat(Object(ct.a)(t.slice(0,c)),[Object(d.a)(Object(d.a)({},t[c]),{},{maximum:a})],Object(ct.a)(t.slice(c+1)))}))}})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("div",{style:{width:100},children:l?"Changed":"Unchanged"})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("button",{disabled:!l,onClick:function(){e.props.updateLimit(a,{currency:r,minimum:s,maximum:i})},children:"Update"})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("button",{onClick:function(){e.props.updateLimit(a,{currency:r,delete:!0})},children:"Delete"})})]},c)}))})]}),Object(T.jsx)("br",{}),Object(T.jsx)("h4",{children:"Add Currency Limit"}),Object(T.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",paddingRight:200},children:[Object(T.jsx)(Ce.a,{style:{minWidth:"300px"},name:"type",value:this.state.currency,onChange:function(t){return e.setState({currency:t})},options:this.props.currencies.filter((function(t){return t.fiat&&!e.state.limits.find((function(e){return e.currency===t}))})).map((function(e){return{label:e.type,value:e.type}}))}),Object(T.jsxs)("div",{children:["Minimum ",Object(T.jsx)("input",{value:this.state.minimum,onChange:function(t){return e.setState({minimum:t.target.value})}})]}),Object(T.jsxs)("div",{children:["Maximum ",Object(T.jsx)("input",{value:this.state.maximum,onChange:function(t){return e.setState({maximum:t.target.value})}})]}),Object(T.jsx)("button",{onClick:function(){e.props.updateLimit(a,{currency:e.state.currency.value,minimum:e.state.minimum,maximum:e.state.maximum})},children:"Add Limit"})]}),Object(T.jsx)("br",{})]})}}]),n}(c.Component)),ud=Object(o.b)((function(e){return{provider:e.currencies.provider,currencies:e.app.currencies}}),(function(e){return{update:function(t){e(sd(t))},updateLimit:function(t,n){e(id(t,n))}}}))(dd),jd=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={displayName:"",displayNameTranslations:{}},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.props.update(this.props.id)}},{key:"componentWillReceiveProps",value:function(e){this.setState({displayName:e.displayName,displayNameTranslations:e.displayNameTranslations||{}})}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsx)("h2",{children:"Display Name Translation"}),Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{children:[Object(T.jsx)("h3",{children:"Default Display Name"}),Object(T.jsx)("input",{placeholder:"DisplayName",value:this.state.displayName,onChange:function(t){return e.updateState({displayName:t.target.value})}})]}),Object(T.jsx)("br",{}),Object(T.jsx)(Pe,{languages:[],contents:this.state.displayNameTranslations,onChange:function(t){return e.updateState({displayNameTranslations:t})},label:"Name Translation"}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{onClick:function(){return e.props.updateDisplayNameTranslations(e.props.id,e.state.displayName,e.state.displayNameTranslations)},children:"Update Display Name"})]})]})}},{key:"updateState",value:function(e){this.setState(Object(d.a)(Object(d.a)({},this.state),e))}}]),n}(c.Component),bd=Object(o.b)((function(e){return{displayName:e.payments.provider.display_name,displayNameTranslations:e.payments.provider.display_name_translations}}),(function(e){return{update:function(t){e(od(t))},updateDisplayNameTranslations:function(t,n,a){e(function(e,t,n){return function(){var a=Object(f.a)(Object(x.a)().mark((function a(c){return Object(x.a)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,window.api.put("/admin/payments/providers/"+e,{display_name:t,display_name_translations:n});case 2:c(od(e));case 3:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()}(t,n,a))}}}))(jd),hd=n(737),pd=n(738),Od=n(708),_d=n(714),md=n(658),xd=n(715),fd=n(739),vd="disableForFTD",gd="disableForNonFTD",Td="hasVipRole",yd="hasNoVipRole",Ed="depositCountEqGreaterThan",Sd="signUpCode",wd="signUpChannel",Rd="enableIfSignUpCodeIsNotIncluded",Ad="enableIfUserChannelNotInList",Nd="ORGANIC",Cd="CELLXPERT",Id="AFFILIATE",kd=function(e){var t,n,a,r,s,i=e.values,o=e.onSetRules,l=Object(c.useState)({}),u=Object(m.a)(l,2),j=u[0],b=u[1],h=Object(c.useState)("AND"),p=Object(m.a)(h,2),O=p[0],x=p[1];Object(c.useEffect)((function(){var e,t;i&&(b(null!==(e=null===i||void 0===i?void 0:i.rules)&&void 0!==e?e:{}),x(null!==(t=i.condition)&&void 0!==t?t:"AND"))}),[i]);var f=function(e,t){b(Object(d.a)(Object(d.a)({},j),{},Object(_.a)({},e,t)))};return Object(T.jsxs)(hd.a,{children:[Object(T.jsxs)(pd.a,{children:[Object(T.jsx)(tl.a,{gutterBottom:!0,variant:"h5",component:"div",children:"Depositor filter rules"}),Object(T.jsxs)(Od.a,{sx:{mb:3},name:"condition",value:O,onChange:function(e){return x(e.target.value)},children:[Object(T.jsx)(Ft.a,{value:"AND",control:Object(T.jsx)(_d.a,{}),label:"Condition AND"}),Object(T.jsx)(Ft.a,{value:"OR",control:Object(T.jsx)(_d.a,{}),label:"Condition OR"})]}),Object(T.jsxs)(md.a,{sx:{mb:3},children:[Object(T.jsx)(Ft.a,{label:"Disable for First Time Deposit",control:Object(T.jsx)(xd.a,{checked:!!j[vd],onChange:function(e){return f(vd,e.target.checked)}})}),Object(T.jsx)(Ft.a,{label:"Disable for non First Time Deposit",control:Object(T.jsx)(xd.a,{checked:!!j[gd],onChange:function(e){return f(gd,e.target.checked)}})}),Object(T.jsx)(Ft.a,{label:"Enable when user has VIP role",control:Object(T.jsx)(xd.a,{checked:!!j[Td],onChange:function(e){return f(Td,e.target.checked)}})}),Object(T.jsx)(Ft.a,{label:"Enable when user has no VIP role",control:Object(T.jsx)(xd.a,{checked:!!j[yd],onChange:function(e){return f(yd,e.target.checked)}})})]}),Object(T.jsxs)(md.a,{sx:{mb:3},children:[Object(T.jsx)(rl.a,{children:"Enable when deposits are more than count"}),Object(T.jsx)("input",{type:"number",value:null!==(t=j[Ed])&&void 0!==t?t:"",onChange:function(e){return f(Ed,e.target.value)}})]}),Object(T.jsxs)(md.a,{sx:{mb:3},children:[Object(T.jsx)(rl.a,{children:"Enable for signed up code"}),Object(T.jsx)("input",{value:null!==(n=j[Sd])&&void 0!==n?n:"",onChange:function(e){return f(Sd,e.target.value)}})]}),Object(T.jsxs)(md.a,{sx:{mb:3},children:[Object(T.jsx)(rl.a,{children:"Enable for users without these signed up codes"}),Object(T.jsx)("input",{placeholder:"code1,code2,code2",value:null!==(a=j[Rd])&&void 0!==a?a:"",onChange:function(e){return f(Rd,e.target.value)}})]}),Object(T.jsxs)(md.a,{sx:{mb:3},children:[Object(T.jsx)(rl.a,{children:"Enable for users without these signed up channels [ORGANIC, AFFILIATE, CELLXPERT]"}),Object(T.jsx)("input",{placeholder:"AFFILIATE,CELLXPERT,ORGANIC",value:null!==(r=j[Ad])&&void 0!==r?r:"",onChange:function(e){return f(Ad,e.target.value)}})]}),Object(T.jsxs)(md.a,{sx:{mb:3},children:[Object(T.jsx)(rl.a,{children:"Enable for signed up method"}),Object(T.jsxs)(sl.a,{value:null!==(s=j[wd])&&void 0!==s?s:"",onChange:function(e){return f(wd,e.target.value)},children:[Object(T.jsx)(il.a,{value:"",children:" "},"empty"),Object(T.jsx)(il.a,{value:Nd,children:Nd}),Object(T.jsx)(il.a,{value:Cd,children:Cd}),Object(T.jsx)(il.a,{value:Id,children:Id})]})]}),Object(T.jsx)("br",{})]}),Object(T.jsxs)(fd.a,{children:[Object(T.jsx)("button",{onClick:function(){b({}),x("AND")},children:"Clear Rules"}),Object(T.jsx)("button",{onClick:function(){Object.keys(j).forEach((function(e){j[e]||delete j[e]})),o({rules:j,condition:O,version:1})},children:"Save Rules"})]})]})},Dd=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).countries=mn()(),a.state={},a}return Object(j.a)(n,[{key:"handleSetDepositorRule",value:function(e){0===Object.keys(e.rules).length&&(e={}),this.props.edit(this.props.provider.id,{disable_depositor_rule:e})}},{key:"componentDidMount",value:function(){this.props.update(this.props.match.params.id)}},{key:"render",value:function(){var e=this,t=this.props.provider;return Object(T.jsxs)("div",{children:[Object.keys(t).map((function(e,n){var a=t[e];return"disable_depositor_rule"===e&&(a=JSON.stringify(a,null,2)),"object"===typeof a?null:Object(T.jsxs)("div",{children:[Object(T.jsxs)("span",{children:[e,": "]}),Object(T.jsx)("span",{children:"boolean"===typeof a?a.toString():a})]},n)})),Object(T.jsx)("hr",{}),Object(T.jsx)(kd,{values:t.disable_depositor_rule,onSetRules:function(t){return e.handleSetDepositorRule(t)}}),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-lg-6 col-xs-12",children:[Object(T.jsx)("h4",{children:"Countries Allowed"}),Object(T.jsx)("div",{className:"draggable-tags",children:Object(T.jsx)("div",{className:"row",style:{width:"100%"},children:(t.supported_countries||[]).map((function(n,a){return Object(T.jsx)("div",{className:"col-xs-2",children:Object(T.jsxs)("div",{className:"tag",children:[n,Object(T.jsx)("i",{onClick:function(){e.props.edit(t.id,{supported_countries:t.supported_countries.filter((function(e){return e!==n}))})},className:"fas fa-times-circle"})]})},a)}))})}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsx)(Ce.a,{name:"type",value:this.state.supported_country,onChange:function(t){return e.setState({supported_country:t})},options:Object.keys(this.countries.getNameList()).filter((function(n){return-1===(t.excluded_countries||[]).indexOf(e.countries.getCode(n))})).map((function(t,n){return{label:t,value:e.countries.getCode(t)}}))}),Object(T.jsx)("button",{onClick:function(){return e.props.edit(t.id,{supported_countries:t.supported_countries.concat([e.state.supported_country.value])})},children:"Add Supported Country"})]})]}),Object(T.jsxs)("div",{className:"col-lg-6 col-xs-12",children:[Object(T.jsx)("h4",{children:"Excluded Countries"}),Object(T.jsx)("div",{className:"draggable-tags",children:Object(T.jsx)("div",{className:"row",style:{width:"100%"},children:(t.excluded_countries||[]).map((function(n,a){return Object(T.jsx)("div",{className:"col-xs-2",children:Object(T.jsxs)("div",{className:"tag",children:[n,Object(T.jsx)("i",{onClick:function(){e.props.edit(t.id,{excluded_countries:t.excluded_countries.filter((function(e){return e!==n}))})},className:"fas fa-times-circle"})]})},a)}))})}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsx)(Ce.a,{name:"type",value:this.state.excluded_country,onChange:function(t){return e.setState({excluded_country:t})},options:Object.keys(this.countries.getNameList()).filter((function(n){return-1===(t.supported_countries||[]).indexOf(e.countries.getCode(n))})).map((function(t,n){return{label:t,value:e.countries.getCode(t)}}))}),Object(T.jsx)("button",{onClick:function(){return e.props.edit(t.id,{excluded_countries:t.excluded_countries.concat([e.state.excluded_country.value])})},children:"Add Excluded Country"})]})]})]}),Object(T.jsx)("hr",{}),Object(T.jsx)(ud,{id:this.props.match.params.id}),Object(T.jsx)("hr",{}),Object(T.jsx)(bd,{id:this.props.match.params.id})]})}}]),n}(c.Component),Ld=Object(p.withRouter)(Object(o.b)((function(e){return{provider:e.payments.provider}}),(function(e){return{update:function(t){return e(ql(t))},edit:function(t,n){return e(Zl(t,n))}}}))(Dd)),Ud=n(109),Pd=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,countries:[],country:"",methods:[],method:""},a.countries=mn()(),a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){this.props.update(this.state.page),this.props.updateMethods()}},{key:"render",value:function(){var e=this,t=this.props.match.url;return Object(T.jsxs)("div",{children:[Object(T.jsx)("h4",{children:"Create New"}),Object(T.jsxs)("div",{className:"tags-wrapper",children:[Object(T.jsx)("h5",{children:"Countries"}),Object(T.jsx)("div",{className:"draggable-tags",children:Object(T.jsx)("div",{className:"row",style:{width:"100%"},children:this.state.countries.map((function(t){return Object(T.jsx)("div",{className:"col-xs-2",children:Object(T.jsxs)("div",{className:"tag",children:[t,Object(T.jsx)("i",{onClick:function(){e.setState({countries:e.state.countries.filter((function(e){return e!==t}))})},className:"fas fa-times-circle"})]})})}))})}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsx)(Ce.a,{name:"type",value:this.state.country,onChange:function(t){return e.setState({country:t})},options:Object.keys(this.countries.getNameList()).filter((function(t){return-1===e.state.countries.indexOf(e.countries.getCode(t))})).map((function(t,n){return{label:t,value:e.countries.getCode(t)}}))}),Object(T.jsx)("button",{onClick:function(){return e.setState({countries:e.state.countries.concat([e.state.country.value])})},children:"Add Country"})]})]}),Object(T.jsxs)("div",{className:"tags-wrapper",children:[Object(T.jsx)("h5",{children:"Method Types"}),Object(T.jsx)("div",{className:"draggable-tags",children:Object(T.jsx)(Ud.a,{onBeforeDragStart:function(){},onDragStart:function(){return console.log("start")},onDragUpdate:function(){},onDragEnd:function(t){e.setState({methods:je(e.state.methods,t.source.index,t.destination.index)})},children:Object(T.jsx)(Ud.c,{style:{width:"100%"},droppableId:"droppable",children:function(t,n){return Object(T.jsx)("div",{ref:t.innerRef,children:e.state.methods.map((function(t,n){return Object(T.jsx)(Ud.b,{draggableId:t,index:n,children:function(n,a){return Object(T.jsxs)("div",Object(d.a)(Object(d.a)(Object(d.a)({ref:n.innerRef},n.draggableProps),n.dragHandleProps),{},{className:"tag",children:[t,Object(T.jsx)("i",{onClick:function(){e.setState({methods:e.state.methods.filter((function(e){return e!==t}))})},className:"fas fa-times-circle"})]}))}},t)}))})}})})}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsx)(Ce.a,{name:"type",value:this.state.method,onChange:function(t){return e.setState({method:t})},options:this.props.methods.map((function(e){return e.type})).filter((function(t){return-1===e.state.methods.indexOf(t)})).map((function(e){return{label:e,value:e}}))}),Object(T.jsx)("button",{onClick:function(){return e.setState({methods:e.state.methods.concat([e.state.method.value])})},children:"Add Method"})]})]}),Object(T.jsx)("button",{onClick:function(){return e.props.create({countries:e.state.countries,methods:e.state.methods})},children:"Create"}),Object(T.jsx)("hr",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Created"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Countries"}),Object(T.jsx)(we.Th,{children:"Method Types"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsx)(we.Tbody,{children:this.props.records.map((function(n,a){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(n.created_at)}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"".concat(t,"/")+n.id,children:n.id})}),Object(T.jsx)(we.Td,{children:n.countries.toString()}),Object(T.jsx)(we.Td,{children:n.methods.toString()}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("a",{children:Object(T.jsx)("i",{onClick:function(){return e.props.delete(n.id)},className:"far fa-trash-alt"})})})]},a)}))})]}),Object(T.jsx)(Ke,{total_pages:this.props.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update()}))}})]})}}]),n}(c.Component),Wd=Object(o.b)((function(e){return Object(d.a)(Object(d.a)({},e.payments.country_ordering_search_results),{},{methods:e.payments.method_search_results.records})}),(function(e){return{update:function(t){return e(Kl())},create:function(t){return e(function(e){return function(t){window.api.post("/admin/payments/country_orderings",e).then((function(e){t(Kl())}))}}(t))},edit:function(t,n){return e(Xl(t,n))},delete:function(t){return e(function(e){return function(t){window.api.delete("/admin/payments/country_orderings/"+e).then((function(e){t(Kl())}))}}(t))},updateMethods:function(){return e(Hl())}}}))(Pd),Md=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).countries=mn()(),a.state={countries:[],country:"",methods:[],method:""},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"update",value:function(){this.props.update(this.props.match.params.id),this.props.updateMethods()}},{key:"render",value:function(){var e=this,t=this.props.country_order;return t.id?Object(T.jsxs)("div",{children:[Object.keys(t).map((function(e){var n=t[e];return"object"===typeof n?null:Object(T.jsxs)("div",{children:[Object(T.jsxs)("span",{children:[e,": "]}),Object(T.jsx)("span",{children:n})]})})),Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"tags-wrapper",children:[Object(T.jsx)("h5",{children:"Countries"}),Object(T.jsx)("div",{className:"draggable-tags",children:Object(T.jsx)("div",{className:"row",style:{width:"100%"},children:t.countries.map((function(n){return Object(T.jsx)("div",{className:"col-xs-2",children:Object(T.jsxs)("div",{className:"tag",children:[n,Object(T.jsx)("i",{onClick:function(){e.props.edit(t.id,{countries:t.countries.filter((function(e){return e!==n}))})},className:"fas fa-times-circle"})]})})}))})}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsx)(Ce.a,{name:"type",value:this.state.country,onChange:function(t){return e.setState({country:t})},options:Object.keys(this.countries.getNameList()).filter((function(n){return-1===t.countries.indexOf(e.countries.getCode(n))})).map((function(t,n){return{label:t,value:e.countries.getCode(t)}}))}),Object(T.jsx)("button",{onClick:function(){return e.props.edit(t.id,{countries:t.countries.concat([e.state.country.value])})},children:"Add Country"})]})]}),Object(T.jsxs)("div",{className:"tags-wrapper",children:[Object(T.jsx)("h5",{children:"Method Types"}),Object(T.jsx)("div",{className:"draggable-tags",children:Object(T.jsx)(Ud.a,{onBeforeDragStart:function(){},onDragStart:function(){},onDragUpdate:function(){},onDragEnd:function(n){e.props.edit(t.id,{methods:je(t.methods,n.source.index,n.destination.index)})},children:Object(T.jsx)(Ud.c,{style:{width:"100%"},droppableId:"droppable",children:function(n,a){return Object(T.jsx)("div",{ref:n.innerRef,children:t.methods.map((function(n,a){return Object(T.jsx)(Ud.b,{draggableId:n,index:a,children:function(a,c){return Object(T.jsxs)("div",Object(d.a)(Object(d.a)(Object(d.a)({ref:a.innerRef},a.draggableProps),a.dragHandleProps),{},{className:"tag",children:[n,Object(T.jsx)("i",{onClick:function(){e.props.edit(t.id,{methods:t.methods.filter((function(e){return e!==n}))})},className:"fas fa-times-circle"})]}))}},n)}))})}})})}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:"input-group",children:[Object(T.jsx)(Ce.a,{name:"type",value:this.state.method,onChange:function(t){return e.setState({method:t})},options:this.props.methods.map((function(e){return e.type})).filter((function(e){return-1===t.methods.indexOf(e)})).map((function(e){return{label:e,value:e}}))}),Object(T.jsx)("button",{onClick:function(){return e.props.edit(t.id,{methods:t.methods.concat([e.state.method.value])})},children:"Add Method"})]})]})]}):null}}]),n}(c.Component),Bd=Object(p.withRouter)(Object(o.b)((function(e){return{country_order:e.payments.country_ordering,methods:e.payments.method_search_results.records}}),(function(e){return{update:function(t){return e(zl(t))},edit:function(t,n){return e(Xl(t,n))},updateMethods:function(){return e(Hl())}}}))(Md)),Fd=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={user_id:"",masked_account:"",card_payment_method_type:"credit_card"},a}return Object(j.a)(n,[{key:"renderCreate",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsx)(Ce.a,{name:"type",value:this.state.card_payment_method_type,onChange:function(t){e.setState({card_payment_method_type:t.value})},options:[{value:"credit_card",label:"Credit Card (PIQ)"},{value:"credit_card_switch",label:"Credit Card (Switch)"}]}),Object(T.jsx)("h5",{children:"User ID (must be an influencer)"}),Object(T.jsx)("input",{value:this.state.user_id,onChange:function(t){return e.setState({user_id:t.target.value})}}),Object(T.jsx)("h5",{children:"Masked Account (first 6, stars, last 4)"}),Object(T.jsx)("input",{maxLength:16,value:this.state.masked_account,onChange:function(t){return e.setState({masked_account:t.target.value})}}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{disabled:16!==this.state.masked_account.length||!this.state.user_id,onClick:function(){return window.api.post("/admin/payments/accounts/create_influencer_card",{influencer_user_id:e.state.user_id,payment_method_type:e.state.card_payment_method_type,masked_account:e.state.masked_account}).then((function(){return re.toast.success("Created")}))},children:"Create"})]})}},{key:"render",value:function(){return Object(T.jsxs)("div",{children:[Object(T.jsx)("h4",{children:"Create New Influencer Card"}),this.renderCreate()]})}}]),n}(c.Component),Gd=(n(154),n(356)),Vd=n.n(Gd),Yd=n(355),Hd=n.n(Yd),qd={types:[{type:"mbtc"},{type:"skrill"},{type:"credit_card"},{type:"neteller"},{type:"interac_etransfer"},{type:"ecopayz"},{type:"muchbetter"},{type:"bank_iban"},{type:"bank_domestic"},{type:"qiwi"},{type:"visa"},{type:"yandex"},{type:"bank_domestic_switch"}],statuses:[{status:"created"},{status:"processing"},{status:"pending_review"},{status:"waiting_input"},{status:"complete"},{status:"cancelled"},{status:"refunded"}]},Kd=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,hasNextPage:!1,hasPrevPage:!1,order:"id_desc",type:"",status:"pending_review",withdrawals:[]},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetchWithdrawals()}},{key:"componentDidUpdate",value:function(e,t,n){var a=this.state.page!==t.page,c=this.state.type!==t.type,r=this.state.status!==t.status;(a||c||r)&&this.fetchWithdrawals()}},{key:"nextPage",value:function(){this.state.hasNextPage&&this.setState({page:this.state.page+1})}},{key:"prevPage",value:function(){0!=this.state.page&&this.state.hasPrevPage&&this.setState({page:this.state.page-1})}},{key:"fetchWithdrawals",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a,c;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.prev=1,e.next=4,window.api.get("/admin/payments/withdrawals",{params:{page:this.state.page,type:this.state.type,status:this.state.status}});case 4:t=e.sent,n=t.records,t.meta,a=t.hasNextPage,c=t.hasPrevPage,this.setState({hasNextPage:a,hasPrevPage:c,withdrawals:n}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),re.toast.error(e.t0.message);case 15:this.setState({isLoading:!1});case 16:case"end":return e.stop()}}),e,this,[[1,12]])})));return function(){return e.apply(this,arguments)}}()},{key:"editWithdrawal",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.setState({actionLoading:!0}),e.next=4,window.api.put("/admin/payments/withdrawals/".concat(t),n);case 4:return e.next=6,this.fetchWithdrawals();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),re.toast.error(e.t0.message);case 11:this.setState({actionLoading:!1});case 12:case"end":return e.stop()}}),e,this,[[0,8]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=!1;return Object(T.jsxs)("div",{className:"withdrawals",style:{position:"relative","min-height":"500px"},children:[this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Searching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-md-6",children:[Object(T.jsx)("h4",{children:"Type"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.type,onChange:function(t){e.setState({type:t.value})},options:[{value:"",label:"Any"}].concat(qd.types.map((function(e){return{value:e.type,label:e.type}})))})]}),Object(T.jsxs)("div",{className:"col-md-6",children:[Object(T.jsx)("h4",{children:"Status"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.status,onChange:function(t){e.setState({status:t.value})},options:qd.statuses.map((function(e){return{value:e.status,label:e.status}}))})]})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)("div",{className:"row",children:[Object(T.jsx)("div",{className:"col-xs-6",children:Object(T.jsxs)("button",{className:"small",disabled:!this.state.hasPrevPage,onClick:function(){return e.prevPage()},children:[Object(T.jsx)(Hd.a,{}),Object(T.jsx)("br",{}),"Previous page"]})}),Object(T.jsx)("div",{className:"col-xs-6  end-xs",children:Object(T.jsxs)("button",{className:"small",disabled:!this.state.hasNextPage,onClick:function(){return e.nextPage()},children:[Object(T.jsx)(Vd.a,{}),Object(T.jsx)("br",{}),"Next page"]})}),Object(T.jsxs)(we.Table,{style:{"margin-top":"10px"},children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"User"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Actions"}),Object(T.jsx)(we.Th,{children:"Note"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.withdrawals.map((function(n,a){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(n.created_at)}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/payments/withdrawals/".concat(n.id),children:n.id})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/users/".concat(n.user.id),children:n.user.username})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/payments/withdrawals/".concat(n.id),children:n.type})}),Object(T.jsxs)(we.Td,{children:[Math.abs(n.amount)," ",n.currency_type]}),Object(T.jsx)(we.Td,{children:n.status}),Object(T.jsx)(we.Td,{children:["pending_review"].includes(n.status)&&Object(T.jsxs)("div",{children:["pending_review"===n.status&&Object(T.jsx)("button",{className:"small approve-button",disabled:t,onClick:function(){return e.editWithdrawal(n.id,{status:"processing",type:n.type}).then((function(){return e.fetchWithdrawals()}))},children:"Approve"}),["pending_review","created"].includes(n.status)&&Object(T.jsx)("button",{className:"small",disabled:t,onClick:function(){return e.editWithdrawal(n.id,{status:"refunded"}).then((function(){return e.fetchWithdrawals()}))},children:"Refund"})]})}),Object(T.jsx)(we.Td,{children:n.note})]},a)}))})]}),Object(T.jsxs)("div",{className:"col-xs-12 text-center",children:["Current page: ",this.state.page]})]})]})}}]),n}(c.Component),zd=function(e){var t=e.setStart,n=e.setEnd,a=Object(c.useState)(Ee()().subtract(7,"days").toDate()),r=Object(m.a)(a,2),s=r[0],i=r[1],o=Object(c.useState)(new Date),l=Object(m.a)(o,2),d=l[0],u=l[1];return Object(c.useEffect)((function(){var e;e=s,Ee.a.isDate(e)&&t(e)}),[s]),Object(c.useEffect)((function(){var e;e=d,Ee.a.isDate(e)&&n(e)}),[d]),Object(T.jsx)("div",{children:Object(T.jsx)(ir,{startDate:s,setStartDate:i,endDate:d,setEndDate:u,disableOPtionFromJoinDate:!0,disableOPtionFromLastDeposit:!0})})};function Xd(e){return window.roles.includes(e)}var Zd={types:[{type:"mbtc"},{type:"skrill"},{type:"credit_card"},{type:"neteller"},{type:"interac_etransfer"},{type:"ecopayz"},{type:"muchbetter"},{type:"bank_iban"},{type:"bank_domestic"},{type:"qiwi"},{type:"visa"},{type:"yandex"},{type:"bank_domestic_switch"}],statuses:[{status:"created"},{status:"processing"},{status:"pending_review"},{status:"waiting_input"},{status:"complete"},{status:"cancelled"},{status:"refunded"}]},Qd=["gold","platinum","diamond","diamond_2"],Jd=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).handleActiveTab=function(e){if("string"===typeof e)return a.setState({rank:e}),void a.setState({tierSelected:null});a.setState({rank:null}),e!==a.state.tierSelected?(a.setState({page:1}),a.setState({tierSelected:e})):a.setState({tierSelected:null})},a.state={page:1,total_pages:1,order:"id_desc",type:"",status:"",withdrawals:[],selected:{},tierSelected:null,startDate:Ee()().subtract(7,"days").toDate(),endDate:new Date},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetchWithdrawals(),this.handleActiveTab(window.roles.includes("payment_agent")||window.roles.includes("payment_agent_tier_1")?1:window.roles.includes("payment_agent_tier_2")?2:window.roles.includes("payment_agent_tier_3")?3:window.roles.includes("payment_agent_tier_4")?4:void 0)}},{key:"componentDidUpdate",value:function(e,t,n){var a=this.state.page!==t.page,c=this.state.type!==t.type,r=this.state.status!==t.status,s=this.state.tierSelected!==t.tierSelected,i=this.state.rank!==t.rank,o=this.state.startDate!==t.startDate,l=this.state.endDate!==t.endDate;(a||c||r||s||i||o||l)&&this.fetchWithdrawals()}},{key:"fetchWithdrawals",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a,c,r;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.setState({isLoading:!0}),e.prev=1,t=this.state.startDate.toISOString(),n=this.state.endDate.toISOString(),!this.state.tierSelected&&!this.state.rank){e.next=11;break}return e.next=7,window.api.get("/admin/payments/withdrawals/pix",{params:{page:this.state.page,type:this.state.type,status:this.state.status,tier:this.state.tierSelected,rank:this.state.rank,dateStart:t,dateEnd:n}});case 7:a=e.sent,c=a.records,r=a.meta,this.setState({total_pages:r.total_pages,withdrawals:c});case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),re.toast.error(e.t0.message);case 16:this.setState({isLoading:!1});case 17:case"end":return e.stop()}}),e,this,[[1,13]])})));return function(){return e.apply(this,arguments)}}()},{key:"editWithdrawal",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n,a){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.setState({actionLoading:!0}),e.next=4,window.api({method:"put",url:"/admin/payments/withdrawals/".concat(t),data:n,headers:{"x-admin-password":a}});case 4:return e.next=6,this.fetchWithdrawals();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),re.toast.error(e.t0.message);case 11:this.setState({actionLoading:!1});case 12:case"end":return e.stop()}}),e,this,[[0,8]])})));return function(t,n,a){return e.apply(this,arguments)}}()},{key:"approveAll",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!((t=Object.keys(this.state.selected).filter((function(e){return a.state.selected[e]}))).length<=0)){e.next=4;break}return e.abrupt("return");case 4:return"",this.setState({actionLoading:!0}),e.next=8,window.api({method:"post",url:"/admin/payments/withdrawals/approve_all",data:{ids:t},headers:{"x-admin-password":""}});case 8:return n=e.sent,console.log("PIX_WITHDRAWALS_BULK_APPROVE_REPORT",n),re.toast.info("Request completed with ".concat(n.approved.length," approved and ").concat(n.failed.length," failed. Check console log for more info.")),e.next=13,this.fetchWithdrawals();case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),re.toast.error(e.t0.message);case 18:this.setState({actionLoading:!1});case 19:case"end":return e.stop()}}),e,this,[[0,15]])})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=!1,n=Xd("payment_agent")||Xd("payment_agent_tier_1")||Xd("admin");return Object(T.jsxs)("div",{className:"withdrawals",style:{position:"relative","min-height":"500px"},children:[this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Searching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsxs)("div",{className:"tabs-tier",children:[n&&Object(T.jsx)("button",{onClick:function(){return e.handleActiveTab(1)},className:"tier-button ".concat(1===this.state.tierSelected?"tier-button--active":""),children:"Tier 1"}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.WITHDRAWALS_VIEW_PIX_LIST_OVER_TIER_1,fallbackComponent:[2,3,4].map((function(t){return Object(T.jsx)(fe,{feature:Oe.permissionsConstants["PIX_WITHDRAWALS_TIER_".concat(t)],children:Object(T.jsxs)("button",{onClick:function(){return e.handleActiveTab(t)},className:"tier-button ".concat(e.state.tierSelected===t?"tier-button--active":""),children:["Tier ",t]})},t)})),children:[2,3,4].map((function(t){return Object(T.jsxs)("button",{onClick:function(){return e.handleActiveTab(t)},className:"tier-button ".concat(e.state.tierSelected===t?"tier-button--active":""),children:["Tier ",t]})}))}),Qd.map((function(t){return Object(T.jsx)("button",{onClick:function(){return e.handleActiveTab(t)},className:"tier-button ".concat(e.state.rank===t?"tier-button--active":""),children:bt(t)})}))]})}),Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-md-6",children:[Object(T.jsx)("h4",{children:"Status"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.status,onChange:function(t){e.setState({status:t.value})},options:Zd.statuses.map((function(e){return{value:e.status,label:e.status}}))})]}),Object(T.jsx)("div",{style:{width:"250px",marginTop:"60px",marginLeft:"40px"},children:Object(T.jsx)(zd,{setStart:function(t){return e.setState({startDate:t})},setEnd:function(t){return e.setState({endDate:t})}})})]}),Object(T.jsxs)("div",{className:"pix-controller",children:[Object(T.jsx)("button",{onClick:function(){var t={};e.state.withdrawals.forEach((function(e){t[e.id]=!0})),e.setState({selected:t})},children:"Select All"}),Object(T.jsx)("button",{onClick:function(){var t={};e.state.withdrawals.forEach((function(e){t[e.id]=!1})),e.setState({selected:t})},children:"Deselect All"}),Object(T.jsx)("button",{onClick:function(){e.approveAll()},children:"Approve Selected"})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Select"}),Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"User"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Actions"}),Object(T.jsx)(we.Th,{children:"Note"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.withdrawals.map((function(n,a){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)("input",{type:"checkbox",checked:e.state.selected[n.id],onClick:function(t){e.setState({selected:Object(d.a)(Object(d.a)({},e.state.selected),{},Object(_.a)({},n.id,t.target.checked))})}})}),Object(T.jsx)(we.Td,{children:Se.withMinutes(n.created_at)}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/payments/withdrawals/".concat(n.id),children:n.id})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/users/".concat(n.user.id),children:n.user.username})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/payments/withdrawals/".concat(n.id),children:n.type})}),Object(T.jsxs)(we.Td,{children:[Math.abs(n.amount)," ",n.currency_type]}),Object(T.jsx)(we.Td,{children:n.status}),Object(T.jsx)(we.Td,{children:["pending_review"].includes(n.status)&&Object(T.jsxs)("div",{children:["pending_review"===n.status&&Object(T.jsx)("button",{className:"small approve-button",disabled:t,onClick:function(){e.editWithdrawal(n.id,{status:"processing",type:n.type}).then((function(){return e.fetchWithdrawals()}))},children:"Approve"}),["pending_review","created"].includes(n.status)&&Object(T.jsx)("button",{className:"small",disabled:t,onClick:function(){return e.editWithdrawal(n.id,{status:"refunded"}).then((function(){return e.fetchWithdrawals()}))},children:"Refund"})]})}),Object(T.jsx)(we.Td,{children:n.note})]},a)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),$d={types:[{type:"pix_pagsmile"},{type:"mbtc"},{type:"skrill"},{type:"credit_card"},{type:"neteller"},{type:"interac_etransfer"},{type:"ecopayz"},{type:"muchbetter"},{type:"bank_iban"},{type:"bank_domestic"},{type:"qiwi"},{type:"visa"},{type:"yandex"},{type:"bank_domestic_switch"}],statuses:[{status:"created"},{status:"processing"},{status:"pending_review"},{status:"waiting_input"},{status:"complete"},{status:"cancelled"},{status:"refunded"}]},eu=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,total_pages:1,order:"id_desc",type:"",status:"",withdrawals:[],details:null,approved:null,kyc_level:null,userId:null,withdrawalId:null},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetchWithdrawals()}},{key:"componentDidUpdate",value:function(e,t,n){var a=this.state.page!==t.page,c=this.state.type!==t.type,r=this.state.status!==t.status,s=this.state.approved!==t.approved,i=this.state.kyc_level!==t.kyc_level,o=this.state.userId!==t.userId,l=this.state.withdrawalId!==t.withdrawalId;(a||c||r||s||i||o||l)&&this.fetchWithdrawals()}},{key:"fetchWithdrawals",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.prev=1,e.next=4,window.api.get("/admin/payments/withdrawals/automated",{params:{page:this.state.page,type:this.state.type,status:this.state.status,approved:this.state.approved,kyc_level:this.state.kyc_level,userId:this.state.userId,withdrawalId:this.state.withdrawalId}});case 4:t=e.sent,n=t.records,a=t.meta,this.setState({total_pages:a.total_pages,withdrawals:n}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),re.toast.error(e.t0.message);case 13:this.setState({isLoading:!1});case 14:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"editWithdrawal",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.setState({actionLoading:!0}),e.next=4,window.api.put("/admin/payments/withdrawals/".concat(t),n);case 4:return e.next=6,this.fetchWithdrawals();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),re.toast.error(e.t0.message);case 11:this.setState({actionLoading:!1});case 12:case"end":return e.stop()}}),e,this,[[0,8]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=!1;return Object(T.jsxs)("div",{className:"withdrawals automated-withdrawals",style:{position:"relative","min-height":"500px"},children:[this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Searching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-md-2",children:[Object(T.jsx)("h4",{children:"Type"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.type,onChange:function(t){e.setState({type:t?t.value:null})},options:[{value:"",label:"Any"}].concat($d.types.map((function(e){return{value:e.type,label:e.type}})))})]}),Object(T.jsxs)("div",{className:"col-md-2",children:[Object(T.jsx)("h4",{children:"Status"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.status,onChange:function(t){e.setState({status:t?t.value:null})},options:$d.statuses.map((function(e){return{value:e.status,label:e.status}}))})]}),Object(T.jsxs)("div",{className:"col-md-2",children:[Object(T.jsx)("h4",{children:"Approved"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.approved,onChange:function(t){e.setState({approved:t?t.value:null})},options:[{value:!0,label:"Approved"},{value:!1,label:"Flagged"}]})]}),Object(T.jsxs)("div",{className:"col-md-2",children:[Object(T.jsx)("h4",{children:"KYC Level"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.kyc_level,onChange:function(t){e.setState({kyc_level:t?t.value:null})},options:[{value:1,label:"Level 1"},{value:2,label:"Level 2"},{value:3,label:"Level 3"}]})]}),Object(T.jsxs)("div",{className:"col-md-2",children:[Object(T.jsx)("h4",{children:"User ID"}),Object(T.jsx)("input",{name:"userId",type:"number",className:"automated-input",onChange:function(t){e.setState({userId:t.target.value?t.target.value:null})}})]}),Object(T.jsxs)("div",{className:"col-md-2",children:[Object(T.jsx)("h4",{children:"Withdrawal ID"}),Object(T.jsx)("input",{name:"withdrawalId",type:"number",className:"automated-input",onChange:function(t){e.setState({withdrawalId:t.target.value?t.target.value:null})}})]})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Requested At"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"User"}),Object(T.jsx)(we.Th,{children:"KYC Level"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Evaluation"}),Object(T.jsx)(we.Th,{children:"View Details"}),Object(T.jsx)(we.Th,{children:"Last Scanned"}),Object(T.jsx)(we.Th,{children:"Actions"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.withdrawals.map((function(n,a){return Object(T.jsxs)(c.Fragment,{children:[Object(T.jsxs)(we.Tr,{style:{borderBottom:e.state.details===n.id?"none":""},children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(n.created_at)}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/payments/withdrawals/".concat(n.id),children:n.id})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/users/".concat(n.user.id),children:n.user.username})}),Object(T.jsx)(we.Td,{children:n.fraud_checks.kycLevel}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/payments/withdrawals/".concat(n.id),children:n.type})}),Object(T.jsxs)(we.Td,{children:[Math.abs(n.amount)," ",n.currency_type]}),Object(T.jsx)(we.Td,{children:n.status}),Object(T.jsx)(we.Td,{children:n.approved?"Approved":"Flagged"}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("button",{className:"small",onClick:function(){e.setState({details:n.id})},children:"View Details"})}),Object(T.jsx)(we.Td,{children:Se.withMinutes(n.last_scanned)}),Object(T.jsx)(we.Td,{children:["pending_review"].includes(n.status)&&Object(T.jsxs)("div",{children:["pending_review"===n.status&&Object(T.jsx)("button",{className:"small approve-button",disabled:t,onClick:function(){return e.editWithdrawal(n.id,{status:"processing",type:n.type}).then((function(){return e.fetchWithdrawals()}))},children:"Approve"}),["pending_review","created"].includes(n.status)&&Object(T.jsx)("button",{className:"small",disabled:t,onClick:function(){return e.editWithdrawal(n.id,{status:"refunded"}).then((function(){return e.fetchWithdrawals()}))},children:"Refund"})]})})]},n.id+"first"),e.state.details===n.id&&!n.evaluation&&Object(T.jsx)(we.Tr,{children:Object(T.jsxs)(we.Td,{colSpan:11,children:["Total Withdrawn: ",n.fraud_checks.totalWithdrawn,Object(T.jsx)("span",{className:"separator"})," Total Wagered VS Deposited: ",n.fraud_checks.totalWageredVsDeposited,Object(T.jsx)("span",{className:"separator"})," Wagered vs Last Deposit: ",(+n.fraud_checks.wageredSinceLasTdeposit/+n.fraud_checks.lasTdeposit).toFixed(2),1===n.fraud_checks.kycLevel?Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("span",{className:"separator"})," Has Card Deposit: ",n.fraud_checks.hasCardDeposit?"true":"false"]}):Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("span",{className:"separator"})," Percentage Of Card Deposits: ",n.fraud_checks.percentageCardDeposit,"%"]}),1===n.fraud_checks.kycLevel?Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("span",{className:"separator"})," Total Bonuses Transferred: ",n.fraud_checks.totalTransferredBonus]}):Object(T.jsx)(T.Fragment,{children:Ee()(n.last_scanned).diff(n.fraud_checks.lastBonusTransferAt,"days",!0)>30?Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("span",{className:"separator"})," SKIPPED OLD Total Bonuses Transferred: ",n.fraud_checks.totalTransferredBonus]}):Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("span",{className:"separator"})," Total Bonuses Transferred: ",n.fraud_checks.totalTransferredBonus]})})]})},n.id+"second"),e.state.details===n.id&&n.evaluation&&Object(T.jsxs)(we.Tr,{children:[Object(T.jsxs)(we.Td,{colSpan:6,style:{verticalAlign:"top"},children:[Object(T.jsx)("h3",{style:{margin:0},children:"Flags"}),n.flags.map((function(e){return Object(T.jsx)("div",{className:"flag",style:{color:e.eval?"green":"red"},children:e.title})})),Object(T.jsx)("h3",{style:{marginTop:"16px",marginBottom:0},children:"Evaluation"}),n.evaluation.map((function(e){switch(e.type){case"APPROVE":return Object(T.jsx)("div",{className:"eval",children:"Approve"});case"REFUND":return Object(T.jsxs)("div",{className:"eval",children:["Refund",Object(T.jsx)("br",{}),"set note: ",e.payload.note]});case"CREATE_ID_CHECK":return Object(T.jsx)("div",{className:"eval",children:"Create ID KYC verification"})}return Object(T.jsx)("div",{className:"eval",children:e.type})}))]}),Object(T.jsxs)(we.Td,{colSpan:5,style:{verticalAlign:"top"},children:[Object(T.jsx)("h3",{style:{margin:0},children:"Calculation Values"}),Object.keys(n.fraud_checks).map((function(e){return"requestedAt"===e?Object(T.jsxs)("div",{children:[e,": ",Se.withMinutes(n.fraud_checks[e])]}):Object(T.jsxs)("div",{children:[e,": ",n.fraud_checks[e]]})}))]})]},n.id+"second")]})}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),tu=[{label:"Skrill",value:"skrill"},{label:"Bank (IBAN)",value:"bank_iban"},{label:"Neteller",value:"neteller"},{label:"VISA",value:"visa"},{label:"Debit / Creditcard",value:"credit_card"},{label:"Transfer\xeancia Banc\xe1ria",value:"pt_bank_transfer"},{label:"Transferencia Bancaria",value:"es_bank_transfer"}],nu=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={correct_method:{},incorrect_method:{},documents_required:{},refund_type:""},a}return Object(j.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.loading,a=t.edit;return Object(T.jsx)(xe,{group:me.a.USERS.UPDATE_BALANCES,children:Object(T.jsxs)("div",{className:"refund",children:[Object(T.jsx)(Ce.a,{name:"type",value:this.state.refund_type,onChange:function(t){return e.setState({refund_type:t?t.value:null})},options:[{label:"Incorrect Method",value:"incorrect_method"},{label:"Incorrect Documents",value:"incorrect_documents"},{label:"Other (add note)",value:"custom_message"}]}),"incorrect_method"===this.state.refund_type&&Object(T.jsxs)("div",{children:[Object(T.jsx)("h5",{children:"Correct Method Type"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.correct_method,onChange:function(t){return e.setState({correct_method:t})},options:tu}),Object(T.jsx)("br",{}),Object(T.jsx)("h5",{children:"Incorrect Method Type"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.incorrect_method,onChange:function(t){return e.setState({incorrect_method:t})},options:tu})]}),"incorrect_documents"===this.state.refund_type&&Object(T.jsxs)("div",{children:[Object(T.jsx)("h5",{children:"Documents Required"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.documents_required,onChange:function(t){return e.setState({documents_required:t})},options:[{label:"ID/Passport",value:"proof_of_identification"},{label:"Proof of Address",value:"proof_of_address"},{label:"ID/Passport + Proof of Address",value:"all"}]})]}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{className:"small",disabled:n,onClick:function(){var t;"custom_message"===e.state.refund_type&&(t=window.prompt("Enter a note for why this withdrawal was force refunded (user visible):")),a({status:"refunded",note:t,refund_type:e.state.refund_type,correct_method:e.state.correct_method.label,incorrect_method:e.state.incorrect_method.label,documents_required:e.state.documents_required.label})},children:n?"Loading...":"Refund"}),Object(T.jsx)("button",{className:"small",disabled:n,onClick:Object(f.a)(Object(x.a)().mark((function t(){var n,a,c,r,s,i,o,l;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=e.props.withdrawal,r=null===(n=c.user)||void 0===n?void 0:n.full_name,s=c.id,null!==c&&void 0!==c&&null!==(a=c.payload)&&void 0!==a&&a.iban&&(i=c.payload.iban),o="".concat(s,",").concat(r,",").concat(i,",,"),c.amount&&(l=Number(c.amount).toFixed(2)),o+=l+","+s,!("clipboard"in navigator)){t.next=13;break}return t.next=10,navigator.clipboard.writeText(o);case 10:return t.abrupt("return",t.sent);case 13:return t.abrupt("return",document.execCommand("copy",!0,o));case 14:case"end":return t.stop()}}),t)}))),children:"Copy for payout"})]})})}}]),n}(r.a.Component),au=function(e){var t=e.withdrawal,n=e.loading,a=e.edit,r=e.editPspAmount,s=e.fetchWithdrawal,i=["complete","refunded"].includes(t.status),o="bank_iban"===t.type,l="waiting_input"===t.status,u="pending_review"===t.status,j=Object(c.useState)(t.user.kyc_level),b=Object(m.a)(j,2),h=b[0],p=b[1],O=Object(d.a)({},t.payload);return t.psp_amount&&(O.psp_amount=t.psp_amount),Object(T.jsxs)(c.Fragment,{children:[Object(T.jsxs)("div",{className:"line-item kyc-level",children:[Object(T.jsx)("div",{className:"label",children:"KYC Level"}),Object(T.jsx)(Ce.a,{name:"type",value:void 0!==h?h:t.user.kyc_level||1,onChange:function(e){e=e||{value:t.user.kyc_level},p(e.value)},options:[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4},{label:"5",value:5}]}),Object(T.jsx)("br",{}),Object(T.jsx)(fe,{feature:Oe.permissionsConstants.USER_UPDATE_KYC_LEVEL,children:Object(T.jsx)("button",{className:"small",disabled:(t.user.kyc_level||1)===h||!h,onClick:function(){window.api.post("/admin/users/"+t.user.id+"/customer/kyc_level",{kyc_level:h}).then((function(){s()}))},children:"Save changes"})})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Current status"}),Object(T.jsx)("div",{className:"value",children:t.status})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsxs)(ve,{feature:Oe.permissionsConstants.WITHDRAWALS_COMMANDS,condition:!u,children:[o&&l&&Object(T.jsx)("button",{disabled:n,onClick:function(){window.confirm("Are you sure you have sent this IBAN withdrawal?")&&a({status:"complete"})},children:n?"Loading...":"Complete IBAN Withdrawal"}),u&&Object(T.jsx)("button",{className:"small approve-button",disabled:n,onClick:function(){a({status:"processing",type:t.type})},children:n?"Loading...":"Approve"})]}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.WITHDRAWALS_EDIT_PSP_AMOUNT,children:[Object(T.jsx)("button",{className:"small",disabled:n,onClick:function(){var e=window.prompt("Enter amount to set withdrawal amount to:");e&&a({amount:e})},children:n?"Loading...":"Edit Amount"}),Object(T.jsx)("button",{className:"small",disabled:n,onClick:function(){var e=window.prompt("Enter amount to set withdrawal psp_amount to: (leave blank to remove psp_amount)");r(e?{psp_amount:e}:{psp_amount:"unset"})},children:n?"Loading...":"Edit psp_amount"})]}),Object(T.jsxs)(ve,{feature:Oe.permissionsConstants.WITHDRAWALS_COMMANDS,condition:!u,children:[!u&&Object(T.jsx)("button",{className:"small",disabled:n,onClick:function(){a({status:"pending_review"})},children:n?"Loading...":"Set Pending"}),!i&&Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("button",{className:"small",disabled:n,onClick:function(){var e=window.prompt("Enter a note for why this withdrawal was cancelled (user visible):");e&&a({status:"cancelled",note:e})},children:n?"Loading...":"Cancel"}),Object(T.jsx)("button",{className:"small",disabled:n,onClick:function(){var e=window.prompt("Enter a note for why this withdrawal was completed (ex. refunded 1123823,1123919 (paymentiq ids):");e&&a({status:"complete",note:e})},children:n?"Loading...":"Complete"})]})]})]}),Object(T.jsx)(ve,{feature:Oe.permissionsConstants.WITHDRAWALS_COMMANDS,condition:!u,children:Object(T.jsx)("div",{className:"line-item",children:Object(T.jsx)(nu,{withdrawal:t,loading:n,edit:a})})})]})},cu=function(e){var t,n,a=e.withdrawal,r=e.loading,s=e.edit,i=e.editPspAmount,o=e.fetchWithdrawal,d=a.kyc_verification_statuses.payment_accounts,u={"flex-direction":"column","align-items":"flex-start"},j=(a.bonus_into_real_transactions||[]).reduce((function(e,t){return e+ +t.amount}),0),b=Object(c.useState)(!0),h=Object(m.a)(b,2),p=h[0],O=h[1],_=Object(c.useState)(null),x=Object(m.a)(_,2),f=x[0],v=x[1];return Object(T.jsx)("section",{className:"overview",children:Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-md-4",children:[Object(T.jsx)("h2",{children:"Information"}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Name"}),Object(T.jsx)("div",{className:"value",children:Object(T.jsx)(l.b,{target:"_blank",to:"/users/".concat(a.user.id),children:a.user.full_name})})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Age"}),Object(T.jsx)("div",{className:"value",children:a.user.age})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Tax ID"}),Object(T.jsx)("div",{className:"value",children:a.tax_id})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Withdrawal Status"}),Object(T.jsx)("div",{className:"value",children:a.status})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Withdrawal Amount"}),Object(T.jsxs)("div",{className:"value",children:[a.type," - ",a.amount," ",a.currency_type]})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Last Deposit"}),Object(T.jsxs)("div",{className:"value",children:[a.last_deposit_method," - ",a.last_deposit_amount," ",a.currency_type]})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Total Completed Deposits"}),Object(T.jsxs)("div",{className:"value",children:[a.total_deposited," ",a.currency_type]})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Total Completed Withdrawals"}),Object(T.jsxs)("div",{className:"value",children:[a.total_withdrawn," ",a.currency_type]})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Real Wagered"}),Object(T.jsxs)("div",{className:"value",children:[a.real_wagered," ",a.currency_type]})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Real Wagered Since Last Deposit"}),Object(T.jsxs)("div",{className:"value",children:[a.real_wagered_since_last_deposit," ",a.currency_type]})]}),Object(T.jsxs)("div",{className:"line-item ".concat(Math.abs(a.real_net_profit)>=10*+a.total_deposited&&"red"),children:[Object(T.jsx)("div",{className:"label",children:"Real Net Profit (NGR)"}),Object(T.jsxs)("div",{className:"value",children:[a.real_net_profit," ",a.currency_type]})]})]}),Object(T.jsx)(xe,{group:me.a.PAYMENTS.WITHDRAWALS_FULL_VIEW,fallbackComponent:Object(T.jsx)("div",{className:"col-md-4"}),children:Object(T.jsxs)("div",{className:"col-md-4",children:[Object(T.jsx)("h2",{children:"Fraud Checks"}),Object(T.jsxs)("div",{className:"line-item ".concat(+a.last_deposit_vs_wagered<=3&&"red"),children:[Object(T.jsx)("div",{className:"label",children:"Last Deposit Vs Wagered Since Last Deposit"}),Object(T.jsxs)("div",{className:"value",children:[a.last_deposit_vs_wagered,"x"]})]}),Object(T.jsxs)("div",{className:"line-item ".concat(+a.total_deposit_vs_wagered<=3&&"red"),children:[Object(T.jsx)("div",{className:"label",children:"Total Deposit Vs Total Wagered"}),Object(T.jsxs)("div",{className:"value",children:[a.total_deposit_vs_wagered,"x"]})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Amount Deposited With Card"}),Object(T.jsxs)("div",{className:"value",children:[a.amount_deposited_with_card," ",a.currency_type]})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Percent Card Deposits"}),Object(T.jsxs)("div",{className:"value",children:[a.percent_card_deposits,"%"]})]}),Object(T.jsxs)("div",{className:"line-item ".concat(j>0&&"red"),children:[Object(T.jsx)("div",{className:"label",children:"Total Flagged Bonus Money Paid To Real"}),Object(T.jsx)("div",{className:"value",children:j.toFixed(4)})]}),Object(T.jsxs)("div",{className:"line-item ".concat(a.has_transferred_bonus&&"red"),children:[Object(T.jsx)("div",{className:"label",children:"Bonus Transferred"}),Object(T.jsx)("div",{className:"value",children:a.has_transferred_bonus.toString()})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Total Bonus Transferred"}),Object(T.jsx)("div",{className:"value",children:a.total_transferred_bonus})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Total Bonus Transferred after last completed withdrawal"}),Object(T.jsx)("div",{className:"value",children:a.total_bonuses_transferred_after_last_withdrawal})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Current Balance"}),Object(T.jsxs)("div",{className:"value",children:[a.current_balance," ",a.currency_type]})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Expected Balance"}),Object(T.jsxs)("div",{className:"value",children:[a.expected_balance," ",a.currency_type]})]}),Object(T.jsxs)("div",{className:"line-item ".concat(a.has_pending_withdrawals&&"red"),children:[Object(T.jsx)("div",{className:"label",children:"Additional Pending Withdrawals"}),Object(T.jsx)("div",{className:"value",children:a.has_pending_withdrawals?"true":"false"})]}),Object(T.jsxs)("div",{className:"line-item ".concat(a.bets_refunded_to_placed_ratio>.2&&"red"),children:[Object(T.jsx)("div",{className:"label",children:"Bets refunded to placed ratio"}),Object(T.jsx)("div",{className:"value",children:a.bets_refunded_to_placed_ratio})]}),Object(T.jsxs)("div",{className:"line-item ".concat(a.email_changed_last_30_days&&"red"),children:[Object(T.jsx)("div",{className:"label",children:"Email changed last 30 days"}),Object(T.jsx)("div",{className:"value",children:a.email_changed_last_30_days?"true":"false"})]}),Object(T.jsxs)("div",{className:"line-item ".concat(a.tax_id_changed_last_30_days&&"red"),children:[Object(T.jsx)("div",{className:"label",children:"Tax Id changed last 30 days"}),Object(T.jsx)("div",{className:"value",children:a.tax_id_changed_last_30_days?"true":"false"})]}),Object(T.jsxs)("div",{className:"line-item ".concat(a.has_zero_amount_bet&&"red"),children:[Object(T.jsx)("div",{className:"label",children:"Has zero amount bets"}),Object(T.jsx)("div",{className:"value",children:a.has_zero_amount_bet?"true":"false"})]}),Object(T.jsxs)("div",{className:"line-item ".concat(a.has_long_running_bets&&"red"),children:[Object(T.jsx)("div",{className:"label",children:"Has long running bets"}),Object(T.jsx)("div",{className:"value",children:a.has_long_running_bets?"true":"false"})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Eur Weekly cashback received"}),Object(T.jsx)("div",{className:"value",children:null===a||void 0===a?void 0:a.eur_weekly_cashback_received})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Real Eur Wagered in last weekly cashback period"}),Object(T.jsx)("div",{className:"value",children:null===a||void 0===a?void 0:a.real_wagered_in_last_weekly_cashback_period})]})]})}),Object(T.jsx)(xe,{group:me.a.PAYMENTS.WITHDRAWALS_FULL_VIEW,fallbackComponent:Object(T.jsx)("div",{className:"col-md-4"}),children:Object(T.jsxs)("div",{className:"col-md-4",children:[Object(T.jsx)("h2",{children:"Compliance"}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Amount Withdrawn"}),Object(T.jsxs)("div",{className:"value",children:[a.total_withdrawn," ",a.currency_type]})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Amount Deposited"}),Object(T.jsxs)("div",{className:"value",children:[a.total_deposited," ",a.currency_type]})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"ID"}),Object(T.jsx)("div",{className:"value",children:a.kyc_verification_statuses.id.requested?a.kyc_verification_statuses.id.status:"Not requested"})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"Address"}),Object(T.jsx)("div",{className:"value",children:a.kyc_verification_statuses.address.requested?a.kyc_verification_statuses.address.status:"Not requested"})]}),Object(T.jsxs)("div",{className:"line-item",style:u,children:[Object(T.jsx)("div",{className:"label",children:"Payment Methods"}),Object(T.jsx)("div",{className:"value",children:Object(T.jsx)("ul",{children:d.length>0?d.map((function(e){var t=e.type,n=e.masked_account,a=e.status;return Object(T.jsxs)("li",{children:[t," - ",n," - ",a]})})):"None requested"})})]}),Object(T.jsxs)("div",{className:"line-item",style:u,children:[Object(T.jsx)("div",{className:"label",children:"Tax Ids"}),Object(T.jsx)("div",{className:"value",children:Object(T.jsx)("ul",{children:a.tax_ids.map((function(e){return Object(T.jsxs)("li",{children:[e,Object(T.jsx)("br",{})]})}))})})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"PEP matches"}),Object(T.jsx)("div",{className:"value",children:null===(t=a.pep_sip_check)||void 0===t?void 0:t.number_of_pep_matches})]}),Object(T.jsxs)("div",{className:"line-item",children:[Object(T.jsx)("div",{className:"label",children:"SIP matches"}),Object(T.jsx)("div",{className:"value",children:null===(n=a.pep_sip_check)||void 0===n?void 0:n.number_of_sip_matches})]}),Object(T.jsx)(au,{withdrawal:a,loading:r,fetchWithdrawal:o,edit:s,editPspAmount:i}),Object(T.jsxs)("div",{children:[Object(T.jsx)("h5",{className:"label",children:"CPF KYC VALIDATION"}),p&&Object(T.jsx)("button",{className:"small",onClick:function(){window.api.get("/admin/payments/withdrawals/".concat(a.id,"/kyc_risk_validation")).then((function(e){v(e)})).catch((function(e){console.error("Error fetching KYC risk validation:",e)})).finally((function(){O(!1)}))},disabled:!p,children:"Validate"}),!p&&Object(T.jsx)("pre",{style:{overflow:"auto"},children:f?"Valid":"Not valid"})]})]})})]})})},ru=function(e){var t=e.withdrawal;return Object(T.jsx)("section",{className:"mutuals",children:Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-md-4",children:[Object(T.jsx)("h2",{children:"Mutual IPs"}),t.mutual_ips.map((function(e){return Object(T.jsxs)("div",{className:"fingerprints-entry",children:[Object(T.jsx)(l.b,{to:"/users/".concat(e.user_id),children:Object(T.jsxs)("span",{children:[Object(T.jsx)("img",{src:e.avatar_url,height:20}),Object(T.jsxs)("span",{style:{color:e.has_bonus_transfer?"red":""},children:[e.username," - ",e.full_name," (",e.country,")"]})]})}),Object(T.jsx)("ul",{children:e.colliding_ips.map((function(e){return Object(T.jsx)("li",{children:e})}))})]},e.id)}))]}),Object(T.jsxs)("div",{className:"col-md-4",children:[Object(T.jsx)("h2",{children:"Mutual Payment Accounts"}),t.mutual_payment_accounts.map((function(e,t){return Object(T.jsxs)("div",{className:"fingerprints-entry",children:[Object(T.jsx)(l.b,{to:"/users/".concat(e.user_id),children:Object(T.jsxs)("span",{children:[Object(T.jsx)("img",{src:e.avatar_url,height:20}),Object(T.jsxs)("span",{style:{color:e.has_bonus_transfer?"red":""},children:[e.username," - ",e.full_name," (",e.country,")"]})]})}),Object(T.jsx)("ul",{children:e.colliding_accounts.map((function(e){return Object(T.jsx)("li",{children:e})}))})]},t)}))]}),Object(T.jsxs)("div",{className:"col-md-4",children:[Object(T.jsx)("h2",{children:"Mutual Tax IDs"}),t.mutual_tax_ids.map((function(e){return Object(T.jsxs)("div",{className:"fingerprints-entry",children:[Object(T.jsx)(l.b,{to:"/users/".concat(e.user_id),children:Object(T.jsxs)("span",{children:[Object(T.jsx)("img",{src:e.avatar_url,height:20}),Object(T.jsxs)("span",{style:{color:e.has_bonus_transfer?"red":""},children:[e.username," - ",e.full_name," (",e.country,")"]})]})}),Object(T.jsx)("ul",{children:e.colliding_accounts.map((function(e){return Object(T.jsx)("li",{children:e})}))})]},e.id)}))]}),Object(T.jsxs)("div",{className:"col-xs-6",style:{borderTop:"3px solid #222"},children:[Object(T.jsx)("h2",{children:"Flagged Bonus Transactions"}),Object(T.jsxs)("h4",{children:["Total Amount transferred to real: ",(t.bonus_into_real_transactions||[]).reduce((function(e,t){return e+ +t.amount}),0).toFixed(4)]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Wallet"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Closing Balance"})]})}),Object(T.jsx)(we.Tbody,{children:(t.bonus_into_real_transactions||[]).map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.currency_type}),Object(T.jsx)(we.Td,{children:e.amount}),Object(T.jsx)(we.Td,{children:e.closing_balance})]},t)}))})]})]})]})})},su=function(e){var t=e.withdrawal,n=e.loading,a=e.refundDeposit;return Object(T.jsx)("section",{className:"refundable-deposits",children:Object(T.jsx)("div",{className:"row",children:Object(T.jsxs)("div",{className:"col-md-12",children:[Object(T.jsx)("h2",{children:"Refundable deposits"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Deposit ID"}),Object(T.jsx)(we.Th,{children:"Provider TX ID"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Refundable Amount"}),Object(T.jsx)(we.Th,{children:"Currency Type"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsx)(we.Tbody,{children:t.refundable_deposits.map((function(e){var c=+e.amount;return e.deposit_refunds.length>0&&(c-=e.deposit_refunds.reduce((function(e,t){return e+t.amount}),0)),Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.provider_transaction_id}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsx)(we.Td,{children:e.amount}),Object(T.jsx)(we.Td,{children:(c||0).toFixed(4)}),Object(T.jsx)(we.Td,{children:e.currency_type}),Object(T.jsxs)(we.Td,{children:[c<t.amount&&Object(T.jsx)("button",{onClick:function(){window.confirm("Refunding this deposit will subtract ".concat(e.amount," ").concat(t.currency_type," from the remaining withdrawal amount. withdrawal psp_amount will set to ").concat(((t.psp_amount||t.amount)-e.amount).toFixed(4)," ").concat(t.currency_type,". continue?"))&&a({depositId:e.id})},children:n?"Loading...":"Refund"}),Object(T.jsx)("button",{onClick:function(){var n=window.prompt("Enter partial refund amount (Max amount = ".concat(Math.min(c,t.psp_amount?t.psp_amount:t.amount),"): "));n<=c&&!isNaN(+n)&&null!==n&&a({depositId:e.id,amount:+n})},children:n?"Loading...":"Partial Refund"})]})]},e.id)}))})]})]})})})},iu=function(e){var t=e.withdrawal,n=e.loading,a=e.edit,r=e.editPspAmount,s=["complete","refunded"].includes(t.status),i="bank_iban"===t.type,o="waiting_input"===t.status,l="pending_review"===t.status,u=Object(d.a)({},t.payload);return t.psp_amount&&(u.psp_amount=t.psp_amount),Object(T.jsx)("section",{className:"withdrawal-controls",children:Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-md-6",children:[Object(T.jsxs)("div",{children:[Object(T.jsx)("h2",{children:"Commands"}),Object(T.jsx)("h5",{children:"PSP Payload"}),Object(T.jsx)("pre",{children:JSON.stringify(u,null,4)}),Object(T.jsx)(xe,{group:me.a.PAYMENTS.WITHDRAWALS_FULL_VIEW,children:Object(T.jsxs)("h5",{children:["Current status: ",t.status]})})]}),Object(T.jsxs)(xe,{group:me.a.PAYMENTS.WITHDRAWALS_FULL_VIEW,children:[Object(T.jsxs)(ve,{feature:Oe.permissionsConstants.WITHDRAWALS_COMMANDS,condition:!l,children:[i&&o&&Object(T.jsx)("button",{disabled:n,onClick:function(){window.confirm("Are you sure you have sent this IBAN withdrawal?")&&a({status:"complete"})},children:n?"Loading...":"Complete IBAN Withdrawal"}),l&&Object(T.jsx)("button",{className:"small approve-button",disabled:n,onClick:function(){a({status:"processing",type:t.type})},children:n?"Loading...":"Approve"})]}),Object(T.jsxs)(fe,{feature:Oe.permissionsConstants.WITHDRAWALS_EDIT_PSP_AMOUNT,children:[Object(T.jsx)("button",{className:"small",disabled:n,onClick:function(){var e=window.prompt("Enter amount to set withdrawal amount to:");e&&a({amount:e})},children:n?"Loading...":"Edit Amount"}),Object(T.jsx)("button",{className:"small",disabled:n,onClick:function(){var e=window.prompt("Enter amount to set withdrawal psp_amount to: (leave blank to remove psp_amount)");r(e?{psp_amount:e}:{psp_amount:"unset"})},children:n?"Loading...":"Edit psp_amount"})]}),Object(T.jsxs)(ve,{feature:Oe.permissionsConstants.WITHDRAWALS_COMMANDS,condition:!l,children:[!l&&Object(T.jsx)("button",{className:"small",disabled:n,onClick:function(){a({status:"pending_review"})},children:n?"Loading...":"Set Pending"}),!s&&Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)("button",{className:"small",disabled:n,onClick:function(){var e=window.prompt("Enter a note for why this withdrawal was cancelled (user visible):");e&&a({status:"cancelled",note:e})},children:n?"Loading...":"Cancel"}),Object(T.jsx)("button",{className:"small",disabled:n,onClick:function(){var e=window.prompt("Enter a note for why this withdrawal was completed (ex. refunded 1123823,1123919 (paymentiq ids):");e&&a({status:"complete",note:e})},children:n?"Loading...":"Complete"})]}),Object(T.jsx)("hr",{}),Object(T.jsx)(nu,{withdrawal:t,loading:n,edit:a})]})]})]}),Object(T.jsx)(xe,{group:me.a.PAYMENTS.WITHDRAWALS_FULL_VIEW,children:Object(T.jsxs)("div",{className:"col-md-6",children:[Object(T.jsx)("h2",{children:"Real Chart of Accounts"}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Sum"})]})}),Object(T.jsx)(we.Tbody,{children:t.real_chart_of_accounts.map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.sum})]},t)}))})]})]})})]})})},ou=(n(624),Object(o.b)((function(e){return{bonusActivations:e.bonuses.bonus_activations_on_withdrawal}}),(function(e){return{getBonusActivations:function(t){return e(Cn(t))},setActivationReviewStatus:function(t,n,a){return e(function(e,t,n){return function(){var a=Object(f.a)(Object(x.a)().mark((function a(c){var r;return Object(x.a)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return r="/admin/bonuses/bonus_activations/".concat(t,"/review_status"),a.next=3,window.api.put(r,{status:n});case 3:c(Cn(e));case 4:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()}(t,n,a))}}}))((function(e){var t=e.userId,n=e.bonusActivations,a=e.getBonusActivations,r=e.setActivationReviewStatus;return Object(c.useEffect)((function(){a(t)}),[]),Object(T.jsxs)("section",{className:"mutuals",children:[Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-12",children:Object(T.jsx)("h2",{children:"Bonus activations"})})}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-12",children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Bonus Name"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Activation Status"}),Object(T.jsx)(we.Th,{children:"Activation Wager Requirement"}),Object(T.jsx)(we.Th,{children:"Activation Wagered"}),Object(T.jsx)(we.Th,{children:"Activation EUR transfer amount"}),Object(T.jsx)(we.Th,{children:"Activation Created"}),Object(T.jsx)(we.Th,{children:"Activation Last Update"}),Object(T.jsx)(we.Th,{children:"Action"}),Object(T.jsx)(we.Th,{children:"Bonus approval status"})]})}),Object(T.jsx)(we.Tbody,{children:n.map((function(e,n){return Object(T.jsx)(c.Fragment,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/rewards/bonuses/".concat(e.bonus_id),children:e.bonus_name})}),Object(T.jsx)(we.Td,{children:e.bonus_status}),Object(T.jsx)(we.Td,{children:e.activation_status}),Object(T.jsx)(we.Td,{children:e.wager_requirement}),Object(T.jsx)(we.Td,{children:e.wagered}),Object(T.jsx)(we.Td,{children:e.eur_transfer_amount}),Object(T.jsx)(we.Td,{children:Se.withMinutes(e.created_at)}),Object(T.jsx)(we.Td,{children:Se.withMinutes(e.updated_at)}),Object(T.jsx)(we.Td,{children:Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("button",{onClick:function(){r(t,e.id,"valid")},children:"Valid"}),Object(T.jsx)("button",{onClick:function(){r(t,e.id,"invalid")},children:"Invalid"})]})}),Object(T.jsx)(we.Td,{children:e.review_status||"UNKNOWN"})]},n)})}))})]})})})]})}))),lu={report:{user:{},refundable_deposits:[],mutual_ips:[],mutual_payment_accounts:[],mutual_tax_ids:[],real_chart_of_accounts:[],kyc_verification_statuses:{id:{requested:!1,status:null},address:{requested:!1,status:null},payment_accounts:[]},pep_sip_check:{},has_card_deposit:!1,has_transferred_bonus:!1,tax_ids:[],has_bonuses_transferred_after_last_withdrawal:!1,automated:{}},actionLoading:!1,isLoading:!1},du=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state=lu,a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetchWithdrawal()}},{key:"fetchWithdrawal",value:function(){var e=this;window.api.get("/admin/payments/withdrawals/".concat(this.getId(),"/basic")).then((function(t){return e.setState({report:Object(d.a)(Object(d.a)({},e.state.report),t)})})),window.api.get("/admin/payments/withdrawals/".concat(this.getId(),"/financials")).then((function(t){return e.setState({report:Object(d.a)(Object(d.a)({},e.state.report),t)})})),window.api.get("/admin/payments/withdrawals/".concat(this.getId(),"/antifraud")).then((function(t){return e.setState({report:Object(d.a)(Object(d.a)({},e.state.report),t)})}))}},{key:"getId",value:function(){return this.props.match.params.id}},{key:"edit",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.setState({actionLoading:!0}),e.next=4,window.api({method:"put",url:"/admin/payments/withdrawals/".concat(this.getId()),data:t,headers:{"x-admin-password":n}});case 4:return e.next=6,this.fetchWithdrawal();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),re.toast.error(e.t0.message);case 11:this.setState({actionLoading:!1});case 12:case"end":return e.stop()}}),e,this,[[0,8]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"editPspAmount",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=window.password_prompt())){e.next=3;break}return e.abrupt("return");case 3:return e.prev=3,this.setState({actionLoading:!0}),e.next=7,window.api({method:"put",url:"/admin/payments/withdrawals/".concat(this.getId(),"/psp_amount"),data:t,headers:{"x-admin-password":n}});case 7:return e.next=9,this.fetchWithdrawal();case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),re.toast.error(e.t0.message);case 14:this.setState({actionLoading:!1});case 15:case"end":return e.stop()}}),e,this,[[3,11]])})));return function(t){return e.apply(this,arguments)}}()},{key:"refundDeposit",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.depositId,a=t.amount,e.prev=1,this.setState({actionLoading:!0}),e.next=5,window.api.put("/admin/payments/withdrawals/".concat(this.getId(),"/refund_deposit"),{deposit_id:n,user_id:this.state.report.user.id,amount:a});case 5:e.next=9;break;case 7:e.prev=7,e.t0=e.catch(1);case 9:this.setState({actionLoading:!1});case 10:case"end":return e.stop()}}),e,this,[[1,7]])})));return function(t){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e,t=this.state.report,n=this.state.actionLoading,a=this.state.report.automated||{};return Object(T.jsxs)("div",{className:"withdrawal-page",children:[this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Loading, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsx)(cu,{withdrawal:t,loading:n,fetchWithdrawal:this.fetchWithdrawal.bind(this),edit:this.edit.bind(this),editPspAmount:this.editPspAmount.bind(this)}),Object(T.jsxs)(xe,{group:me.a.PAYMENTS.WITHDRAWALS_FULL_VIEW,children:[Object(T.jsx)("section",{className:"mutuals",children:Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-md-4",children:[Object(T.jsx)("h3",{style:{margin:0},children:"Flags"}),(a.flags||[]).map((function(e){return Object(T.jsx)("div",{className:"flag",style:{color:e.eval?"green":"red"},children:e.title})}))]}),Object(T.jsxs)("div",{className:"col-md-4",children:[Object(T.jsx)("h3",{style:{margin:0},children:"Calculation Values"}),Object.keys(a.fraud_checks||{}).map((function(e){return"requestedAt"===e?Object(T.jsxs)("div",{children:[e,": ",Se.withMinutes(a.fraud_checks[e])]}):Object(T.jsxs)("div",{children:[e,": ",a.fraud_checks[e]]})}))]}),Object(T.jsxs)("div",{className:"col-md-4",children:[Object(T.jsx)("h3",{style:{marginTop:"16px",marginBottom:0},children:"Evaluation"}),(a.evaluation||[]).map((function(e){switch(e.type){case"APPROVE":return Object(T.jsx)("div",{className:"eval",children:"Approve"});case"REFUND":return Object(T.jsxs)("div",{className:"eval",children:["Refund",Object(T.jsx)("br",{}),"set note: ",e.payload.note]});case"CREATE_ID_CHECK":return Object(T.jsx)("div",{className:"eval",children:"Create ID KYC verification"})}return Object(T.jsx)("div",{className:"eval",children:e.type})}))]})]})}),(null===(e=this.state.report.user)||void 0===e?void 0:e.id)&&Object(T.jsx)(ou,{userId:this.state.report.user.id}),Object(T.jsx)(ru,{withdrawal:t,loading:n})]}),Object(T.jsx)(iu,{withdrawal:t,loading:n,edit:this.edit.bind(this),editPspAmount:this.editPspAmount.bind(this)}),Object(T.jsxs)(xe,{group:me.a.PAYMENTS.WITHDRAWALS_FULL_VIEW,children:[Object(T.jsx)(fe,{feature:Oe.permissionsConstants.WITHDRAWALS_VIEW_REFUNDABLE_DEPOSITS_LIST,children:Object(T.jsx)(su,{withdrawal:t,loading:n,refundDeposit:this.refundDeposit.bind(this)})}),!n&&t.user.id&&Object(T.jsx)("section",{className:"user-page",children:Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-xs-12",children:Object(T.jsx)(to,{match:{params:{id:t.user.id}}})})})})]})]})}}]),n}(c.Component),uu=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,total_pages:1,order:"id_desc",type:"",status:"",withdrawals:[],selected:{}},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetchWithdrawals()}},{key:"componentDidUpdate",value:function(e,t,n){this.state.page!==t.page&&this.fetchWithdrawals()}},{key:"fetchWithdrawals",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return 0===this.state.withdrawals.length&&this.setState({isLoading:!0}),e.prev=1,e.next=4,window.api.get("/admin/payments/withdrawals/stuck",{params:{page:this.state.page}});case 4:t=e.sent,n=t.records,a=t.meta,this.setState({total_pages:a.total_pages,withdrawals:n}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),re.toast.error(e.t0.message);case 13:this.setState({isLoading:!1});case 14:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(){return e.apply(this,arguments)}}()},{key:"editWithdrawal",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t,n,a){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.setState({actionLoading:!0}),e.next=4,window.api({method:"put",url:"/admin/payments/withdrawals/".concat(t),data:n,headers:{"x-admin-password":a}});case 4:return e.next=6,this.fetchWithdrawals();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),re.toast.error(e.t0.message);case 11:this.setState({actionLoading:!1});case 12:case"end":return e.stop()}}),e,this,[[0,8]])})));return function(t,n,a){return e.apply(this,arguments)}}()},{key:"retryWithdrawal",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.setState({actionLoading:!0}),e.next=4,window.api({method:"put",url:"/admin/payments/withdrawals/retry/withdrawal/".concat(t)});case 4:return e.next=6,this.fetchWithdrawals();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),re.toast.error(e.t0.message);case 11:this.setState({actionLoading:!1});case 12:case"end":return e.stop()}}),e,this,[[0,8]])})));return function(t){return e.apply(this,arguments)}}()},{key:"refundAll",value:function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a=this;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!((t=Object.keys(this.state.selected).filter((function(e){return a.state.selected[e]}))).length<=0)){e.next=4;break}return e.abrupt("return");case 4:return"",this.setState({actionLoading:!0}),e.next=8,window.api({method:"post",url:"/admin/payments/withdrawals/refund_all",data:{ids:t},headers:{"x-admin-password":""}});case 8:return n=e.sent,console.log("PIX_WITHDRAWALS_BULK_REFUND_REPORT",n),re.toast.info("Request completed with ".concat(n.refunded.length," refunded and ").concat(n.failed.length," failed. Check console log for more info.")),e.next=13,this.fetchWithdrawals();case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),re.toast.error(e.t0.message);case 18:this.setState({actionLoading:!1});case 19:case"end":return e.stop()}}),e,this,[[0,15]])})));return function(){return e.apply(this,arguments)}}()},{key:"render",value:function(){var e=this,t=!1;return Object(T.jsxs)("div",{className:"withdrawals",style:{position:"relative","min-height":"500px"},children:[this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Searching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)("div",{className:"pix-controller",children:[Object(T.jsx)("button",{onClick:function(){var t={};e.state.withdrawals.forEach((function(e){t[e.id]=!0})),e.setState({selected:t})},children:"Select All"}),Object(T.jsx)("button",{onClick:function(){var t={};e.state.withdrawals.forEach((function(e){t[e.id]=!1})),e.setState({selected:t})},children:"Deselect All"}),Object(T.jsx)("button",{onClick:function(){e.refundAll()},children:"Refund Selected"})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Select"}),Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"User"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Actions"}),Object(T.jsx)(we.Th,{children:"Note"}),Object(T.jsx)(we.Th,{children:"Copy ID"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.withdrawals.map((function(n,a){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)("input",{type:"checkbox",checked:e.state.selected[n.id],onClick:function(t){e.setState({selected:Object(d.a)(Object(d.a)({},e.state.selected),{},Object(_.a)({},n.id,t.target.checked))})}})}),Object(T.jsx)(we.Td,{children:Se.withMinutes(n.created_at)}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/payments/withdrawals/".concat(n.id),children:n.id})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/users/".concat(n.user.id),children:n.user.username})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/payments/withdrawals/".concat(n.id),children:n.type})}),Object(T.jsxs)(we.Td,{children:[Math.abs(n.amount)," ",n.currency_type]}),Object(T.jsx)(we.Td,{children:n.status}),Object(T.jsx)(we.Td,{children:Object(T.jsxs)("div",{children:[Object(T.jsx)("button",{className:"small",disabled:t,onClick:function(){return e.editWithdrawal(n.id,{status:"refunded"}).then((function(){return e.fetchWithdrawals()}))},children:"Refund"}),Object(T.jsx)("button",{className:"small",disabled:t,onClick:function(){e.retryWithdrawal(n.id).then((function(){return e.fetchWithdrawals()}))},children:"Retry"})]})}),Object(T.jsx)(we.Td,{children:n.note}),Object(T.jsx)(we.Td,{children:"Blaze Withdrawal ".concat(n.id)})]},a)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),ju=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){return Object(T.jsx)("div",{children:Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(p.Route,{exact:!0,path:"/payments/withdrawals",component:Kd}),Object(T.jsx)(p.Route,{exact:!0,path:"/payments/withdrawals/pix/tier1",component:Jd}),Object(T.jsx)(p.Route,{exact:!0,path:"/payments/withdrawals/pix/tier2",component:Jd}),Object(T.jsx)(p.Route,{exact:!0,path:"/payments/withdrawals/pix/tier3",component:Jd}),Object(T.jsx)(p.Route,{exact:!0,path:"/payments/withdrawals/pix/tier4",component:Jd}),Object(T.jsx)(p.Route,{exact:!0,path:"/payments/withdrawals/pix",component:Jd}),Object(T.jsx)(p.Route,{exact:!0,path:"/payments/withdrawals/stuck",component:uu}),Object(T.jsx)(p.Route,{exact:!0,path:"/payments/withdrawals/automated",component:eu}),Object(T.jsx)(p.Route,{exact:!0,path:"/payments/withdrawals/:id",component:du}),Object(T.jsx)(p.Route,{exact:!0,path:"/payments/stuck",component:uu})]})})}}]),n}(c.Component),bu={statuses:[{status:"created"},{status:"complete"},{status:"cancelled"},{status:"pending"}]},hu=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,type:"",status:"",id_filter:"",payload_search:null,total_pages:0,deposits:[],isLoading:!1,startDate:Ee()().subtract(7,"days").toDate(),endDate:new Date,paymentMethods:[],clear:!1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.fetchPaymentMethods()}},{key:"componentDidUpdate",value:function(e,t,n){t.page===this.state.page||this.state.clear||this.fetchDeposits()}},{key:"update",value:function(){this.fetchDeposits()}},{key:"fetchPaymentMethods",value:function(){var e=this,t=[];window.api.get("/admin/payments/methods").then((function(e){var n=e.meta,a=e.records,c=n.total_pages;t.push.apply(t,Object(ct.a)(a));for(var r=[],s=2;s<=c;s++)r.push(window.api.get("/admin/payments/methods",{params:{page:s}}));return Promise.all(r)})).then((function(n){n.forEach((function(e){var n=e.records;t.push.apply(t,Object(ct.a)(n))})),t.sort((function(e,t){return e.type<t.type?-1:e.type>t.type?1:0})),e.setState({paymentMethods:t})}))}},{key:"fetchDeposits",value:function(){var e=this;this.setState({isLoading:!0});var t=this.state.startDate.toISOString(),n=this.state.endDate.toISOString();window.api.get("/admin/payments/deposits",{params:{deposit_id:this.state.id_filter,status:this.state.status,type:this.state.type,page:this.state.page,payload_search:this.state.payload_search,dateStart:t,dateEnd:n}}).then((function(t){var n=t.meta,a=t.records;e.setState({deposits:a,total_pages:n.total_pages})})).finally((function(){return e.setState({isLoading:!1})}))}},{key:"creditDeposit",value:function(e){var t=this;window.api.put("/admin/payments/deposits/".concat(e,"/credit")).then((function(){re.toast.success("Deposit credited"),t.fetchDeposits()}))}},{key:"requestCreditDeposit",value:function(e){var t=this,n=window.prompt("Please enter a note for this credit.");window.api.put("/admin/payments/deposits/".concat(e,"/request_credit"),{staff_note:n}).then((function(){re.toast.success("Deposit Credit Requested"),t.fetchDeposits()}))}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{style:{position:"relative","min-height":"500px"},children:[this.state.isLoading&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Searching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)("div",{className:"row",children:[Object(T.jsxs)("div",{className:"col-md-6 col-xs-12",children:[Object(T.jsx)("h4",{children:"ID filter (ex. 666445)"}),Object(T.jsx)("input",{style:{width:"100%"},onChange:function(t){return e.setState({id_filter:t.target.value})},value:this.state.id_filter})]}),Object(T.jsxs)("div",{className:"col-md-3 col-xs-12",children:[Object(T.jsx)("h4",{children:"Type"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.type,onChange:function(t){e.setState({type:t.value})},options:[{value:"",label:"Any"}].concat(this.state.paymentMethods.map((function(e){return{value:e.type,label:e.type}}))),clearable:!1})]}),Object(T.jsxs)("div",{className:"col-md-3 col-xs-12",children:[Object(T.jsx)("h4",{children:"Status"}),Object(T.jsx)(Ce.a,{name:"type",value:this.state.status,onChange:function(t){e.setState({status:t.value})},options:bu.statuses.map((function(e){return{value:e.status,label:e.status}})),clearable:!1})]}),Object(T.jsxs)("div",{className:"col-md-12 col-xs-12",children:[Object(T.jsx)("h4",{children:"Payload search"}),Object(T.jsx)("textarea",{style:{width:"100%",height:"100px"},onChange:function(t){return e.setState({payload_search:t.target.value})},defaultValue:JSON.stringify({qr_code_text:""},null,4),value:this.state.payload_search})]}),Object(T.jsx)("div",{style:{marginTop:"20px"},className:"col-md-3 col-xs-12",children:Object(T.jsx)(zd,{setStart:function(t){return e.setState({startDate:t})},setEnd:function(t){return e.setState({endDate:t})}})})]}),Object(T.jsxs)("div",{className:"row",children:[Object(T.jsx)("div",{className:"col-md-3 col-xs-12",style:{marginTop:"20px"},children:Object(T.jsx)("button",{style:{width:"100%"},onClick:function(){e.setState({clear:!1}),1!==e.state.page?e.setState({page:1,total_pages:0}):e.fetchDeposits()},children:"Search"})}),Object(T.jsx)("div",{className:"col-md-3 col-xs-12",style:{marginTop:"20px"},children:Object(T.jsx)("button",{style:{width:"100%"},onClick:function(){e.setState({page:1,type:"",status:"",id_filter:"",payload_search:null,total_pages:0,deposits:[],isLoading:!1,clear:!0})},children:"Clear"})})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Date"}),Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"User"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Note"}),Object(T.jsx)(we.Th,{children:"Action"})]})}),Object(T.jsx)(we.Tbody,{children:this.state.deposits.map((function(t,n){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Se.withMinutes(t.created_at)}),Object(T.jsx)(we.Td,{children:t.id}),Object(T.jsx)(we.Td,{className:"user",children:Object(T.jsx)(l.b,{to:"/users/".concat(t.user.id),children:t.user.username})}),Object(T.jsx)(we.Td,{children:t.type}),Object(T.jsxs)(we.Td,{children:[Math.abs(t.amount)," ",t.currency_type]}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("a",{onClick:function(){return window.prompt("Statuses:",JSON.stringify(t.status_log))},children:t.status})}),Object(T.jsx)(we.Td,{children:t.note}),Object(T.jsxs)(we.Td,{children:["complete"!==t.status&&Object(T.jsx)(fe,{feature:Oe.permissionsConstants.DEPOSITS_CREDIT_DEPOSIT,children:Object(T.jsx)("button",{className:"small",onClick:function(){e.creditDeposit(t.id)},children:"Credit"})}),"complete"!==t.status&&Object(T.jsx)(fe,{feature:Oe.permissionsConstants.REQUEST_DEPOSITS_CREDIT_DEPOSIT,children:Object(T.jsx)("button",{className:"small",onClick:function(){e.requestCreditDeposit(t.id)},children:"Request Credit"})})]})]},n)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.total_pages,update:function(t){e.setState({page:t})}})]})}}]),n}(c.Component),pu=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={page:1,order:"id_desc",type:"",status:"",records:[],meta:{}},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){this.update()}},{key:"renderDocument",value:function(){var e=this.props.document;return"image"===e.type?Object(T.jsx)("img",{src:e.data,alt:""}):"pdf"===e.type?Object(T.jsx)("iframe",{src:e.data,type:"application/pdf",style:{width:"100%",height:"100%",overflow:"auto"}}):void 0}},{key:"update",value:function(){var e=this;window.api.get("/admin/kyc_verifications?page=".concat(this.state.page)).then((function(t){e.setState(Object(d.a)({},t))}))}},{key:"updateKYCVerification",value:function(e,t){var n=this;window.api.post("/admin/kyc_verifications/update",{verification_id:e,status:t}).then((function(){n.update()}))}},{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{className:"",children:[Object(T.jsxs)($s.a,{overlayClassName:"document-modal",isOpen:this.state.document_modal_open,onRequestClose:function(t){return e.setState({document_modal_open:!1})},children:[Object(T.jsx)("div",{onClick:function(t){return e.setState({document_modal_open:!1})},className:"close",style:{fontSize:"20px"},children:"Close"}),this.renderDocument()]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"User"}),Object(T.jsx)(we.Th,{children:"Masked Account"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"SubType"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Note"}),Object(T.jsx)(we.Th,{children:"Date of document"})]})}),Object(T.jsx)(we.Tbody,{children:(this.state.records||[]).sort((function(e,t){return new Date(e.updated_at)-new Date(t.updated_at)})).map((function(e,t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{className:"user",children:Object(T.jsx)(l.b,{to:"/users/".concat(e.user.id,"/documents"),children:e.user.username})}),Object(T.jsx)(we.Td,{children:e.masked_account}),Object(T.jsx)(we.Td,{children:e.type}),Object(T.jsx)(we.Td,{children:e.sub_type}),Object(T.jsx)(we.Td,{children:e.status}),Object(T.jsx)(we.Td,{children:e.note}),Object(T.jsx)(we.Td,{children:Se.withMinutes(e.updated_at)})]},t)}))})]}),Object(T.jsx)(Ke,{total_pages:this.state.meta.total_pages,update:function(t){e.setState({page:t},(function(){return e.update()}))}})]})}}]),n}(c.Component),Ou=Object(p.withRouter)(Object(o.b)((function(e){return Object(d.a)({},e.users.user)}),(function(e){return{getDocument:function(t,n){return e(is(t,n))},createKYCVerification:function(t,n,a){e(ds(t,n,a))},updateKYCVerification:function(t,n,a){e(us(t,n,a))}}}))(pu)),_u=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS.WITHDRAWALS,children:Object(T.jsx)(l.c,{exact:!0,to:"/payments/withdrawals",children:"Withdrawals"})})},mu=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS.PIX_WITHDRAWALS,children:Object(T.jsx)(l.c,{exact:!0,to:"/payments/withdrawals/pix",children:"Pix Withdrawals"})})},xu=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS.STUCK_WITHDRAWALS,children:Object(T.jsx)(l.c,{exact:!0,to:"/payments/withdrawals/stuck",children:"Stuck Withdrawals"})})},fu=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS.AUTOMATED_WITHDRAWALS,children:Object(T.jsx)(l.c,{exact:!0,to:"/payments/withdrawals/automated",children:"Automated Withdrawals"})})},vu=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS.KYC_VERIFICATIONS,children:Object(T.jsx)(l.c,{to:"/payments/kyc-verifications",children:"KYC Verifications"})})},gu=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS.DEPOSITS,children:Object(T.jsx)(l.c,{exact:!0,to:"/payments/deposits",children:"Deposits"})})},Tu=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS.METHODS,children:Object(T.jsx)(l.c,{exact:!0,to:"/payments/methods",children:"Methods"})})},yu=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS.PROVIDERS,children:Object(T.jsx)(l.c,{exact:!0,to:"/payments/providers",children:"Providers"})})},Eu=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS.COUNTRY_ORDERINGS,children:Object(T.jsx)(l.c,{exact:!0,to:"/payments/country-orderings",children:"Country Orderings"})})},Su=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS.ACCOUNTS,children:Object(T.jsx)(l.c,{exact:!0,to:"/payments/influencer-card",children:"Influencer Card"})})},wu=function(){var e=Object(c.useState)([]),t=Object(m.a)(e,2),n=t[0],a=t[1];return Object(c.useEffect)((function(){window.api.get("/admin/payments/providers/depositor-rules").then(a)}),[]),Object(T.jsxs)(c.Fragment,{children:[Object(T.jsx)(tl.a,{variant:"h5",component:"div",children:"All Depositor rules"}),Object(T.jsx)("br",{}),n.map((function(e,t){return Object(T.jsx)(hd.a,{sx:{mb:5},children:Object(T.jsxs)(pd.a,{children:[Object(T.jsx)(tl.a,{variant:"h6",component:"div",children:Object(T.jsx)(l.b,{to:"/payments/providers/".concat(e.id),children:e.type})}),Object(T.jsx)("pre",{children:JSON.stringify(e.disable_depositor_rule,null,4)})]})},t)}))]})},Ru=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){var e=this.props.match.url;return Object(T.jsxs)("div",{className:"page",children:[Object(T.jsx)(O.BrowserView,{children:Object(T.jsxs)("nav",{"data-testid":"tab-payments-links",children:[Object(T.jsx)(_u,{}),Object(T.jsx)(mu,{}),Object(T.jsx)(xu,{}),Object(T.jsx)(fu,{}),Object(T.jsx)(vu,{}),Object(T.jsx)(gu,{}),Object(T.jsx)(Tu,{}),Object(T.jsx)(yu,{}),Object(T.jsx)(Eu,{}),Object(T.jsx)(Su,{})]})}),Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(ge,{group:me.a.PAYMENTS.WITHDRAWALS,path:"".concat(e,"/withdrawals"),component:ju}),Object(T.jsx)(ge,{group:me.a.PAYMENTS.DEPOSITS,path:"".concat(e,"/deposits"),component:hu}),Object(T.jsx)(ge,{group:me.a.PAYMENTS.KYC_VERIFICATIONS,path:"/payments/kyc-verifications",component:Ou}),Object(T.jsx)(ge,{group:me.a.PAYMENTS.METHODS,exact:!0,path:"".concat(e,"/methods"),component:td}),Object(T.jsx)(ge,{group:me.a.PAYMENTS.PROVIDERS,exact:!0,path:"".concat(e,"/providers"),component:ad}),Object(T.jsx)(ge,{group:me.a.PAYMENTS.PROVIDERS,exact:!0,path:"".concat(e,"/providers/rules"),component:wu}),Object(T.jsx)(ge,{group:me.a.PAYMENTS.PROVIDERS,exact:!0,path:"".concat(e,"/providers/:id"),component:Ld}),Object(T.jsx)(ge,{group:me.a.PAYMENTS.COUNTRY_ORDERINGS,exact:!0,path:"".concat(e,"/country-orderings"),component:Wd}),Object(T.jsx)(ge,{group:me.a.PAYMENTS.COUNTRY_ORDERINGS,exact:!0,path:"".concat(e,"/country-orderings/:id"),component:Bd}),Object(T.jsx)(ge,{group:me.a.PAYMENTS.ACCOUNTS,exact:!0,path:"".concat(e,"/influencer-card"),component:Fd}),Object(T.jsx)(p.Redirect,{from:"/payments",to:"/payments/withdrawals"})]})]})}}]),n}(c.Component),Au=Object(p.withRouter)(Object(o.b)((function(e){return{}}),(function(e){return{}}))(Ru)),Nu=w.a.create({baseURL:"https://affiliates-api.blaze.com/api",withCredentials:!0,headers:{common:{}}});function Cu(e){return Iu.apply(this,arguments)}function Iu(){return(Iu=Object(f.a)(Object(x.a)().mark((function e(t){var n,a,c,r;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object.entries(t),a=new URLSearchParams(n),e.next=4,Nu.get("/admin/affiliates?".concat(a.toString()));case 4:return c=e.sent,r=c.data,e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ku(e){return Du.apply(this,arguments)}function Du(){return(Du=Object(f.a)(Object(x.a)().mark((function e(t){var n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Nu.get("/admin/referrals?affiliate_id=".concat(t,"&per_page=30&page=1"));case 2:return n=e.sent,a=n.data,e.abrupt("return",a);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Lu(e){return Uu.apply(this,arguments)}function Uu(){return(Uu=Object(f.a)(Object(x.a)().mark((function e(t){var n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Nu.get("/admin/campaigns?affiliate_id=".concat(t,"&per_page=30&page=1"));case 2:return n=e.sent,a=n.data,e.abrupt("return",a);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pu(e){return Wu.apply(this,arguments)}function Wu(){return(Wu=Object(f.a)(Object(x.a)().mark((function e(t){var n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Nu.get("/admin/balance?affiliate_id=".concat(t));case 2:return n=e.sent,a=n.data,e.abrupt("return",a);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Mu(e){var t=e.affiliate_id,n=e.blaze_user_id,a=e.full_name,c=e.skype,r=e.whatsapp,s=e.telegram,i=e.email;return Nu.put("/admin/set-manager",{affiliate_id:t,blaze_user_id:n,full_name:a,skype:c,whatsapp:r,telegram:s,email:i})}Nu.interceptors.request.use((function(e){return e.headers.Authorization="Bearer ".concat(localStorage.getItem("access_token")),e}));n(625);var Bu="affiliates/SET_SELECTED_AFFILIATE",Fu="affiliates/SET_SELECTED_CAMPAIGN";var Gu=Object(o.b)((function(){return{}}),(function(e){return{setSelectedAffiliate:function(t){return e((n=t,function(e){e({type:Bu,payload:n})}));var n}}}))((function(e){var t=e.setSelectedAffiliate,n=Object(c.useState)(1),a=Object(m.a)(n,2),r=a[0],s=a[1],i=Object(c.useState)(""),o=Object(m.a)(i,2),d=o[0],u=o[1],j=Object(c.useState)(""),b=Object(m.a)(j,2),h=b[0],p=b[1],O=Object(c.useState)(!1),_=Object(m.a)(O,2),v=_[0],g=_[1],y=Object(c.useState)([]),E=Object(m.a)(y,2),S=E[0],w=E[1],R=Object(c.useState)(!1),A=Object(m.a)(R,2),N=A[0],C=A[1],I=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,g(!0),e.next=4,Cu({page:r,affiliate_id:d,blaze_user_id:h,with_affiliate_manager:N});case 4:t=e.sent,w(t.affiliates),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),re.toast.error(e.t0.message);case 11:return e.prev=11,g(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[0,8,11,14]])})));return function(){return e.apply(this,arguments)}}();return Object(c.useEffect)((function(){I()}),[r,N]),Object(T.jsxs)("div",{className:"affiliates-finder",children:[Object(T.jsx)("input",{type:"checkbox",name:"with_affiliate_manager",id:"with_affiliate_manager",onChange:function(){return C((function(e){return!e}))}}),Object(T.jsx)("label",{for:"with_affiliate_manager",children:"Filter affiliates with affiliate manager assigned"}),Object(T.jsxs)("div",{className:"affiliates-search-row",children:[Object(T.jsx)("input",{value:d,onChange:function(e){var t=e.target;return u(t.value)},placeholder:"Type affiliate code"}),Object(T.jsx)("input",{value:h,onChange:function(e){var t=e.target;return p(t.value)},placeholder:"Type Blaze user id"}),Object(T.jsx)("button",{className:"red",disabled:v,onClick:function(){return I()},children:v?"Loading...":"Search"})]}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),v&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Searching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Full name"}),Object(T.jsx)(we.Th,{children:"Payment Schedule"}),Object(T.jsx)(we.Th,{children:"Fiat Preference"}),Object(T.jsx)(we.Th,{children:"Created At"}),Object(T.jsx)(we.Th,{children:"Updated At"}),Object(T.jsx)(we.Th,{children:"website"}),Object(T.jsx)(we.Th,{children:"Social Media Profile"}),Object(T.jsx)(we.Th,{children:"Skype / WhatsApp / Telegram"}),Object(T.jsx)(we.Th,{children:"Currency to Paid"})]})}),Object(T.jsx)(we.Tbody,{children:null===S||void 0===S?void 0:S.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/affiliates/".concat(e.blaze_user_id),onClick:function(){return t(e)},children:e.blaze_user_id})}),Object(T.jsx)(we.Td,{children:e.full_name}),Object(T.jsx)(we.Td,{children:e.payment_schedule}),Object(T.jsx)(we.Td,{children:e.fiat_preference}),Object(T.jsx)(we.Td,{children:Se.onlyDate(e.created_at)}),Object(T.jsx)(we.Td,{children:Se.onlyDate(e.updated_at)}),Object(T.jsx)(we.Td,{children:e.website}),Object(T.jsx)(we.Td,{children:e.social_media_profile}),Object(T.jsx)(we.Td,{children:e.skype_whatsapp_telegram}),Object(T.jsx)(we.Td,{children:e.currency_to_paid})]},e.blaze_user_id)}))})]}),Object(T.jsx)(Ke,{total_pages:100,update:s})]})}));n(130);var Vu=function(e){var t=Object(c.useState)([]),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],l=i[1];return Object(c.useEffect)((function(){var t=function(){var t=Object(f.a)(Object(x.a)().mark((function t(){var n,a,c,s;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l(!0),c=null===(n=e.match)||void 0===n||null===(a=n.params)||void 0===a?void 0:a.id){t.next=4;break}throw new Error("No id provided");case 4:return t.prev=4,t.next=7,new Promise((function(e){return setTimeout(e,2e3)}));case 7:return t.next=9,ku(c);case 9:s=t.sent,r(s.referrals),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(4),re.toast.error(t.t0.message);case 16:return t.prev=16,l(!1),t.finish(16);case 19:case"end":return t.stop()}}),t,null,[[4,13,16,19]])})));return function(){return t.apply(this,arguments)}}();t()}),[]),Object(T.jsx)("div",{className:"affiliate-page",children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Referred ID"}),Object(T.jsx)(we.Th,{children:"Campaign ID"}),Object(T.jsx)(we.Th,{children:"Country"}),Object(T.jsx)(we.Th,{children:"Registration At"}),Object(T.jsx)(we.Th,{children:"Deposit"}),Object(T.jsx)(we.Th,{children:"Total Deposited"}),Object(T.jsx)(we.Th,{children:"Currency"}),Object(T.jsx)(we.Th,{children:"Last Deposit At"}),Object(T.jsx)(we.Th,{children:"Commission Paid"}),Object(T.jsx)(we.Th,{children:"Campaign Code"}),Object(T.jsx)(we.Th,{children:"Commission Type"})]})}),o&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Fetching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsx)(we.Tbody,{className:"referrals-body",children:null===a||void 0===a?void 0:a.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.referred_blaze_user_id}),Object(T.jsx)(we.Td,{children:e.campaign_id}),Object(T.jsx)(we.Td,{children:e.referred_country}),Object(T.jsx)(we.Td,{children:Se.onlyDate(e.registration_date)}),Object(T.jsx)(we.Td,{children:e.deposit_count}),Object(T.jsx)(we.Td,{children:e.total_deposited}),Object(T.jsx)(we.Td,{children:e.total_deposited_currency}),Object(T.jsx)(we.Td,{children:e.last_deposit_date}),Object(T.jsx)(we.Td,{children:e.commission_for_cpa_paid?"Yes":"No"}),Object(T.jsx)(we.Td,{children:e.campaign_code}),Object(T.jsx)(we.Td,{children:e.commission_rate_type})]},e.referred_blaze_user_id)}))})]})})};var Yu=Object(o.b)((function(){return{}}),(function(e){return{setSelectedCampaign:function(t){return e(function(e){return function(t){t({type:Fu,payload:e})}}(t))}}}))((function(e){var t=Object(c.useState)([]),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),o=i[0],d=i[1];return Object(c.useEffect)((function(){var t=function(){var t=Object(f.a)(Object(x.a)().mark((function t(){var n,a,c,s;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(d(!0),c=null===(n=e.match)||void 0===n||null===(a=n.params)||void 0===a?void 0:a.id){t.next=4;break}throw new Error("No id provided");case 4:return t.prev=4,t.next=7,new Promise((function(e){return setTimeout(e,2e3)}));case 7:return t.next=9,Lu(c);case 9:s=t.sent,r(s.campaigns),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(4),re.toast.error(t.t0.message);case 16:return t.prev=16,d(!1),t.finish(16);case 19:case"end":return t.stop()}}),t,null,[[4,13,16,19]])})));return function(){return t.apply(this,arguments)}}();t()}),[]),Object(T.jsx)("div",{className:"affiliate-page",children:Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"ID"}),Object(T.jsx)(we.Th,{children:"Code"}),Object(T.jsx)(we.Th,{children:"Link"}),Object(T.jsx)(we.Th,{children:"Commission Type"}),Object(T.jsx)(we.Th,{children:"Commission"}),Object(T.jsx)(we.Th,{children:"Created At"}),Object(T.jsx)(we.Th,{children:"Updated At"}),Object(T.jsx)(we.Th,{children:"Affiliate ID"}),Object(T.jsx)(we.Th,{children:"Click Count"}),Object(T.jsx)(we.Th,{children:"Actions"})]})}),o&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Fetching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsx)(we.Tbody,{children:null===a||void 0===a?void 0:a.map((function(t){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:t.id}),Object(T.jsx)(we.Td,{children:t.code}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("a",{href:t.link,children:t.link})}),Object(T.jsx)(we.Td,{children:t.commission_rate_type}),Object(T.jsx)(we.Td,{children:t.commission_rate_value}),Object(T.jsx)(we.Td,{children:Se.onlyDate(t.created_at)}),Object(T.jsx)(we.Td,{children:Se.onlyDate(t.updated_at)}),Object(T.jsx)(we.Td,{children:t.affiliate_id}),Object(T.jsx)(we.Td,{children:t.click_count}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(l.b,{to:"/affiliates/system/update-campaign",onClick:function(){return e.setSelectedCampaign(t)},children:"Edit"})})]},t.id)}))})]})})}));var Hu=function(e){var t,n,a,r=Object(c.useState)({}),s=Object(m.a)(r,2),i=s[0],o=s[1],l=Object(c.useState)(!1),d=Object(m.a)(l,2),u=d[0],j=d[1];return Object(c.useEffect)((function(){var t=function(){var t=Object(f.a)(Object(x.a)().mark((function t(){var n,a,c,r;return Object(x.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(j(!0),c=null===(n=e.match)||void 0===n||null===(a=n.params)||void 0===a?void 0:a.id){t.next=4;break}throw new Error("No id provided");case 4:return t.prev=4,t.next=7,new Promise((function(e){return setTimeout(e,2e3)}));case 7:return t.next=9,Pu(c);case 9:r=t.sent,o(r),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(4),re.toast.error(t.t0.message);case 16:return t.prev=16,j(!1),t.finish(16);case 19:case"end":return t.stop()}}),t,null,[[4,13,16,19]])})));return function(){return t.apply(this,arguments)}}();t()}),[]),Object(T.jsxs)("div",{className:"affiliate-page",children:[Object(T.jsxs)("div",{className:"balances",children:[Object(T.jsx)("div",{children:Object(T.jsxs)("h3",{children:["Available Balance: $",null===(t=i.balance)||void 0===t?void 0:t.availableBalance]})}),Object(T.jsx)("div",{children:Object(T.jsxs)("h3",{children:["Pending Balance: $",null===(n=i.balance)||void 0===n?void 0:n.pendingBalance]})})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Status"}),Object(T.jsx)(we.Th,{children:"Withdrawal ID"}),Object(T.jsx)(we.Th,{children:"Closing Balance"})]})}),u&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Fetching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsx)(we.Tbody,{children:null===(a=i.transactions)||void 0===a?void 0:a.map((function(e){var t,n;return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.amount}),Object(T.jsx)(we.Td,{children:null===(t=(n=e.status).toUpperCase)||void 0===t?void 0:t.call(n)}),Object(T.jsx)(we.Td,{children:e.blaze_withdrawal_id}),Object(T.jsx)(we.Td,{children:e.closing_balance})]},e.id)}))})]})]})};var qu=Object(p.withRouter)((function(e){return Object(T.jsxs)("div",{className:"affiliate-page",children:[Object(T.jsx)("hr",{}),Object(T.jsxs)("div",{className:"page-wrapper",children:[Object(T.jsxs)("nav",{className:"user-nav",children:[Object(T.jsx)(xe,{group:me.a.AFFILIATES.INFO,children:Object(T.jsx)(l.c,{to:e.match.url+"/info",children:"Affiliate Info"})}),Object(T.jsx)(xe,{group:me.a.AFFILIATES.CAMPAIGNS,children:Object(T.jsx)(l.c,{to:e.match.url+"/campaigns",children:"Campaigns"})}),Object(T.jsx)(xe,{group:me.a.AFFILIATES.BALANCES,children:Object(T.jsx)(l.c,{to:e.match.url+"/balance",children:"Balance & Transactions"})}),Object(T.jsx)(xe,{group:me.a.AFFILIATES.REFERRALS,children:Object(T.jsx)(l.c,{to:e.match.url+"/referrals",children:"Referred users"})})]}),Object(T.jsx)("div",{className:"nav-output",children:!e.loading&&Object(T.jsx)(c.Fragment,{children:Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(ge,{exact:!0,group:me.a.AFFILIATES.INFO,path:"/affiliates/:id/info",component:function(){return"Info"}}),Object(T.jsx)(ge,{group:me.a.AFFILIATES.CAMPAIGNS,path:"/affiliates/:id/campaigns",component:Yu}),Object(T.jsx)(ge,{group:me.a.AFFILIATES.BALANCES,path:"/affiliates/:id/balance",component:Hu}),Object(T.jsx)(ge,{group:me.a.AFFILIATES.REFERRALS,path:"/affiliates/:id/referrals",component:Vu}),Object(T.jsx)(p.Redirect,{from:"*",to:"/affiliates/".concat(e.match.params.id,"/info")})]})})})]})]})})),Ku=Object(ya.a)([function(e){return e.affiliates.selectedAffiliate},function(e){return e.affiliates.selectedCampaign}],(function(e,t){return{selectedAffiliate:e,selectedCampaign:t}}));function zu(e,t){return"set_value"===t.type?Object(d.a)(Object(d.a)({},e),{},Object(_.a)({},t.name,t.value)):e}var Xu={affiliate_id:"",blaze_user_id:"",full_name:"",skype:"",whatsapp:"",telegram:"",email:""};var Zu=function(e){var t,n,a,r,s,i,l=Object(o.d)(Ku).selectedAffiliate;if(!l)return Object(T.jsx)("span",{children:"Please, select an affiliate first"});var u=Object(c.useState)(!1),j=Object(m.a)(u,2),b=j[0],h=j[1],p=Object(c.useReducer)(zu,Object(d.a)(Object(d.a)({},Xu),{},{affiliate_id:l.blaze_user_id,blaze_user_id:null===(t=l.affiliateManager)||void 0===t?void 0:t.blaze_user_id,full_name:null===(n=l.affiliateManager)||void 0===n?void 0:n.full_name,skype:null===(a=l.affiliateManager)||void 0===a?void 0:a.skype,whatsapp:null===(r=l.affiliateManager)||void 0===r?void 0:r.whatsapp,telegram:null===(s=l.affiliateManager)||void 0===s?void 0:s.telegram,email:null===(i=l.affiliateManager)||void 0===i?void 0:i.email})),O=Object(m.a)(p,2),_=O[0],v=O[1],g=function(e){var t=e.target,n=t.name,a=t.value;n&&v({type:"set_value",name:n,value:a})},y=function(e){return!(e.blaze_user_id&&e.full_name)},E=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!y(_)){e.next=3;break}throw new Error("Some fields are empty.");case 3:return h(!0),e.next=6,Mu(_);case 6:re.toast.success("Affiliate Manager set for affiliate: ".concat(_.affiliate_id,".")),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),re.toast.error(e.t0.message);case 12:return e.prev=12,h(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[0,9,12,15]])})));return function(){return e.apply(this,arguments)}}();return Object(T.jsx)("div",{className:"affiliate-page",children:Object(T.jsxs)("div",{className:"affiliate-page__container",children:[Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Affiliate ID:"}),Object(T.jsx)("input",{name:"affiliate_id",value:_.affiliate_id,disabled:!0,onChange:g})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Affiliate Manager ID (a valid blaze user id with affiliate_manager role):"}),Object(T.jsx)("input",{name:"blaze_user_id",value:_.blaze_user_id,onChange:g})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Full Name:"}),Object(T.jsx)("input",{name:"full_name",value:_.full_name,onChange:g})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Skype:"}),Object(T.jsx)("input",{name:"skype",value:_.skype,onChange:g})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Telegram:"}),Object(T.jsx)("input",{name:"telegram",value:_.telegram,onChange:g})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Whatsapp:"}),Object(T.jsx)("input",{name:"whatsapp",value:_.whatsapp,onChange:g})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Email:"}),Object(T.jsx)("input",{type:"email",name:"email",value:_.email,onChange:g})]}),Object(T.jsx)("button",{disabled:b,onClick:E,children:"Set Affiliate Manager"})]})})},Qu="CPA",Ju="WS",$u="RS",ej="HY";function tj(e,t){switch(t.type){case"set_value":return Object(d.a)(Object(d.a)({},e),{},Object(_.a)({},t.name,t.value));case"clear":return nj;default:return e}}var nj={affiliate_id:"",code:"",commission_rate_type:"",commission_rate_value:"",cpa_for_hybrid_model:""};var aj=function(e){var t=Object(o.d)(Ku).selectedAffiliate;if(!t)return Object(T.jsx)("span",{children:"Please, select an affiliate first"});var n=Object(c.useReducer)(tj,nj),a=Object(m.a)(n,2),r=a[0],s=a[1],i=function(e){var t=e.target,n=t.name,a=t.value;n&&s({type:"set_value",name:n,value:a})},l=function(e){return Object.values(e).some((function(e){return!e}))},d=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!l(r)){e.next=3;break}throw new Error("Some fields are empty.");case 3:return e.next=5,t=r,Nu.post("/admin/campaigns",t);case 5:re.toast.success("Campaign created for affiliate: ".concat(r.affiliate_id,".")),s({type:"clear"}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),re.toast.error(e.t0.message);case 12:case"end":return e.stop()}var t}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}();return Object(T.jsx)("div",{className:"affiliate-page",children:Object(T.jsxs)("div",{className:"affiliate-page__container",children:[Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Affiliate ID:"}),Object(T.jsx)("input",{name:"affiliate_id",value:t.blaze_user_id,disabled:!0,onChange:i})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Code:"}),Object(T.jsx)("input",{name:"code",value:r.code,onChange:i})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Commision Rate Type:"}),Object(T.jsxs)("select",{name:"commission_rate_type",onChange:i,children:[Object(T.jsx)("option",{disabled:!0,selected:!0,value:!0,children:"Select"}),Object(T.jsx)("option",{value:Qu,children:Qu}),Object(T.jsx)("option",{value:Ju,children:Ju}),Object(T.jsx)("option",{value:$u,children:$u}),Object(T.jsx)("option",{value:ej,children:ej})]})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Commision Rate value:"}),Object(T.jsx)("input",{name:"commission_rate_value",value:r.commission_rate_value,onChange:i})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"CPA for Hybrid Model:"}),Object(T.jsx)("input",{name:"cpa_for_hybrid_model",value:r.cpa_for_hybrid_model,onChange:i})]}),Object(T.jsx)("button",{onClick:d,children:"Create Campaign"})]})})};function cj(e,t){return"set_value"===t.type?Object(d.a)(Object(d.a)({},e),{},Object(_.a)({},t.name,t.value)):e}var rj={campaign_id:"",commission_model:"",commission_model_value:"",cpa_for_hybrid_model:""};var sj=function(e){var t=Object(o.d)(Ku).selectedCampaign;if(!t)return Object(T.jsx)("span",{children:"Please, select a campaign first"});var n=Object(c.useState)(!1),a=Object(m.a)(n,2),r=a[0],s=a[1],i=Object(c.useReducer)(cj,Object(d.a)(Object(d.a)({},rj),{},{campaign_id:t.id,commission_model:t.commission_rate_type,commission_model_value:t.commission_rate_value,cpa_for_hybrid_model:t.cpa_for_hybrid_model})),l=Object(m.a)(i,2),u=l[0],j=l[1],b=function(e){var t=e.target,n=t.name,a=t.value;n&&a&&j({type:"set_value",name:n,value:a})},h=function(e){return Object.values(e).some((function(e){return!e}))},p=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!h(u)){e.next=3;break}throw new Error("Some fields are empty.");case 3:return s(!0),e.next=6,t=u,Nu.put("/admin/campaigns",t);case 6:re.toast.success("Campaign updated for: ".concat(u.campaign_id,".")),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),re.toast.error(e.t0.message);case 12:return e.prev=12,s(!1),e.finish(12);case 15:case"end":return e.stop()}var t}),e,null,[[0,9,12,15]])})));return function(){return e.apply(this,arguments)}}();return Object(T.jsx)("div",{className:"affiliate-page",children:Object(T.jsxs)("div",{className:"affiliate-page__container",children:[Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Campaign ID:"}),Object(T.jsx)("input",{name:"campaign_id",value:u.campaign_id,disabled:!0,onChange:b})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Commision Rate Type:"}),Object(T.jsxs)("select",{name:"commission_model",onChange:b,value:u.commission_model,children:[Object(T.jsx)("option",{value:Qu,children:Qu}),Object(T.jsx)("option",{value:Ju,children:Ju}),Object(T.jsx)("option",{value:$u,children:$u}),Object(T.jsx)("option",{value:ej,children:ej})]})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Commision Rate value:"}),Object(T.jsx)("input",{name:"commission_model_value",value:u.commission_model_value,onChange:b})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"CPA for Hybrid Model:"}),Object(T.jsx)("input",{name:"cpa_for_hybrid_model",value:u.cpa_for_hybrid_model,onChange:b})]}),Object(T.jsx)("button",{disabled:r,onClick:p,children:"Update Campaign"})]})})};var ij=function(){var e=Object(o.d)(Ku).selectedAffiliate;if(!e)return Object(T.jsx)("span",{children:"Please, select an affiliate first"});var t=Object(c.useState)({affiliateId:e.blaze_user_id,postbackUrl:e.postback_url}),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(!1),i=Object(m.a)(s,2),l=i[0],u=i[1],j=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),e.next=3,t=a.affiliateId,n=a.postbackUrl,Nu.put("/admin/set-postback",{affiliate_id:t,postback_url:n});case 3:u(!1),re.toast.success("postback url updated");case 5:case"end":return e.stop()}var t,n}),e)})));return function(){return e.apply(this,arguments)}}();return Object(T.jsx)("div",{className:"affiliate-page",children:Object(T.jsxs)("div",{className:"affiliate-page__container",children:[Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Affiliate ID:"}),Object(T.jsx)("input",{name:"affiliate-id",value:e.blaze_user_id,disabled:!0})]}),Object(T.jsxs)("div",{className:"affiliate-page__group-input",children:[Object(T.jsx)("label",{children:"Postback URL:"}),Object(T.jsx)("input",{name:"postback_url",value:a.postbackUrl,onChange:function(e){return r(Object(d.a)(Object(d.a)({},a),{},{postbackUrl:e.target.value}))}})]}),Object(T.jsx)("button",{disabled:l||!function(){return a.affiliateId&&(null===(e=a.postbackUrl)||void 0===e?void 0:e.match(/^(https?):\/\/[^\s$.?#].[^\s]*$/));var e}(),onClick:j,children:"Update postback URL"})]})})},oj=function(){return Object(T.jsx)(xe,{group:me.a.AFFILIATES.CAMPAIGNS,children:Object(T.jsx)(l.c,{to:"/affiliates/system/create-campaign",children:"Create Campaign"})})},lj=function(){return Object(T.jsx)(xe,{group:me.a.AFFILIATES.CAMPAIGNS,children:Object(T.jsx)(l.c,{to:"/affiliates/system/update-campaign",children:"Update Campaign"})})},dj=function(){return Object(T.jsx)(xe,{group:me.a.AFFILIATES.GENERAL,children:Object(T.jsx)(l.c,{to:"/affiliates/system/affiliate-manager",children:"Affiliate Manager"})})},uj=function(){return Object(T.jsx)(xe,{group:me.a.AFFILIATES.GENERAL,children:Object(T.jsx)(l.c,{to:"/affiliates/system/set-postback",children:"Update Postback URL"})})};var jj=Object(p.withRouter)((function(e){return Object(T.jsx)("div",{className:"affiliate-page",children:Object(T.jsxs)("div",{className:"page-wrapper",children:[Object(T.jsx)(O.BrowserView,{children:Object(T.jsxs)("nav",{className:"user-nav",children:[Object(T.jsx)(oj,{}),Object(T.jsx)(lj,{}),Object(T.jsx)(dj,{}),Object(T.jsx)(uj,{})]})}),Object(T.jsx)("div",{className:"nav-output",children:!e.loading&&Object(T.jsx)(c.Fragment,{children:Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(ge,{exact:!0,group:me.a.AFFILIATES.INFO,path:"/affiliates/system/create-campaign",component:aj}),Object(T.jsx)(ge,{exact:!0,group:me.a.AFFILIATES.INFO,path:"/affiliates/system/update-campaign",component:sj}),Object(T.jsx)(ge,{group:me.a.AFFILIATES.CAMPAIGNS,path:"/affiliates/system/affiliate-manager",component:Zu}),Object(T.jsx)(ge,{group:me.a.AFFILIATES.INFO,path:"/affiliates/system/set-postback",component:ij}),Object(T.jsx)(p.Redirect,{from:"*",to:"/affiliates/system"})]})})})]})})})),bj=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/affiliates/find",children:"Find users"})},hj=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/affiliates/system",children:"System"})};var pj=function(e){var t=e.location.search;return Object(T.jsxs)("div",{className:"page",children:[Object(T.jsx)(O.BrowserView,{children:Object(T.jsxs)("nav",{children:[Object(T.jsx)(bj,{}),Object(T.jsx)(hj,{})]})}),Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(Te,{feature:Oe.permissionsConstants.AFFILIATES_VIEW_LIST,exact:!0,path:"/affiliates/find",component:Gu}),Object(T.jsx)(Te,{feature:Oe.permissionsConstants.AFFILIATES_VIEW_SYSTEM,path:"/affiliates/system",component:jj}),Object(T.jsx)(Te,{feature:Oe.permissionsConstants.AFFILIATES_VIEW_AFFILIATE,path:"/affiliates/:id",component:qu}),Object(T.jsx)(p.Redirect,{from:"/affiliates",to:"/affiliates/find/"+t})]})]})},Oj=function(){return Object(c.useEffect)((function(){window.api.clearAuth()}),[]),Object(T.jsxs)("div",{children:[Object(T.jsx)("h1",{children:"You are logged out"}),Object(T.jsx)(l.b,{to:"/",children:"Go to login"})]})},_j=n(357),mj=n(358),xj=(n(626),function(){return Object(T.jsx)(l.c,{exact:!0,to:"/blaze-originals/crash-bets",children:"Lookup Crash Bet"})}),fj=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/blaze-originals/double-bets",children:"Lookup Double Bet"})},vj=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/blaze-originals/mines-bets",children:"Lookup Mines Bet"})},gj=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/blaze-originals/new-originals-games",children:"Lookup New OGs Bet"})},Tj=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/blaze-originals/dice-bets",children:"Lookup Dice Bet"})},yj=function(){return Object(T.jsx)(l.c,{to:"/blaze-originals/crash-II-bets",children:"Lookup Crash II Bet"})},Ej=function(){return Object(T.jsx)(l.c,{to:"/blaze-originals/plinko-bets",children:"Plinko"})},Sj=function(){return Object(T.jsx)(l.c,{to:"/blaze-originals/limbo-bets",children:"Limbo"})},wj=function(){return Object(T.jsx)(l.c,{to:"/blaze-originals/slide-bet",children:"Slide"})},Rj=function(){return Object(T.jsx)(l.c,{to:"/blaze-originals/fruits-bet",children:"Fruits"})},Aj=function(){return Object(T.jsx)(l.c,{to:"/blaze-originals/fortune-double-bet",children:"Fortune Double Bet"})},Nj=function(){return Object(T.jsx)(l.c,{to:"/blaze-originals/fortune-double-rooms",children:"Fortune Double Rooms"})},Cj=function(){return Object(T.jsx)(l.c,{to:"/blaze-originals/multiplayer-games-rooms",children:"Multiplayer games rooms"})},Ij=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/users/find",children:"Find users"})},kj=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/users/create",children:"Create users"})},Dj={casinoNodes:{key:"casino",label:"Casino",icon:"",component:function(){return Object(T.jsx)(Nb,{})},nodes:[{key:"affiliate-links",label:"Affiliate Links",icon:"",component:function(){return Object(T.jsx)(Kc,{})},nodes:[]},{key:"bonuses",label:"Bonuses",icon:"",component:function(){return Object(T.jsx)(Vc,{})},nodes:[{key:"view-bonuses",label:"View Bonuses",icon:"",component:function(){return Object(T.jsx)(Yn,{})},nodes:[]},{key:"create-bonus",label:"Create Bonus",icon:"",component:function(){return Object(T.jsx)(Hn,{})},nodes:[]},{key:"round-welcome-packages",label:"Round Welcome Packages",icon:"",component:function(){return Object(T.jsx)(qn,{})},nodes:[]}]},{key:"game-categories",label:"Game Categories",icon:"",component:function(){return Object(T.jsx)(Lc,{})},nodes:[]},{key:"game-providers",label:"Game Providers",icon:"",component:function(){return Object(T.jsx)(Dc,{})},nodes:[]},{key:"games",label:"Games",icon:"",component:function(){return Object(T.jsx)(Uc,{})},nodes:[]},{key:"global-xp",label:"Global Xp",icon:"",component:function(){return Object(T.jsx)(Fc,{})},nodes:[]},{key:"loyalty",label:"Loyalty",icon:"",component:function(){return Object(T.jsx)(qc,{})},nodes:[]},{key:"mystery-boxes",label:"Mystery Boxes",icon:"",component:function(){return Object(T.jsx)(Wc,{})},nodes:[]},{key:"promo-codes",label:"Promo Codes",icon:"",component:function(){return Object(T.jsx)(Gc,{})},nodes:[]},{key:"races",label:"Races",icon:"",component:function(){return be()&&Object(T.jsx)(Yc,{})},nodes:[]},{key:"challenges",label:"Challenges",icon:"",component:function(){return Object(T.jsx)(Hc,{})},nodes:[]},{key:"rewards",label:"Rewards",icon:"",component:function(){return Object(T.jsx)(Pc,{})},nodes:[]},{key:"reward-tiers",label:"Reward Tiers",icon:"",component:function(){return Object(T.jsx)(Mc,{})},nodes:[]},{key:"user-ranks",label:"User Ranks",icon:"",component:function(){return Object(T.jsx)(Bc,{})},nodes:[]}]},systemNodes:{key:"system",label:"System",icon:"",component:function(){return Object(T.jsx)(Ab,{})},nodes:[{key:"settings",label:"Settings",icon:"",component:function(){return Object(T.jsx)(qt,{})},nodes:[]},{key:"weekly-cashback-manager",label:"Weekly Cashback Manager",icon:"",component:function(){return Object(T.jsx)(zt,{})},nodes:[]},{key:"wait-list-management",label:"Wait List Management",icon:"",component:function(){return Object(T.jsx)(Xt,{})},nodes:[]},{key:"groups",label:"Groups",icon:"",component:function(){return Object(T.jsx)(Zt,{})},nodes:[]},{key:"raffle-manager",label:"Raffle Manager",icon:"",component:function(){return Object(T.jsx)(Qt,{})},nodes:[]},{key:"announcements",label:"Announcements",icon:"",component:function(){return Object(T.jsx)(Jt,{})},nodes:[{key:"list-announcements",label:"List",icon:"",component:function(){return Object(T.jsx)(Ge,{})},nodes:[]},{key:"create-announcements",label:"Create",icon:"",component:function(){return Object(T.jsx)(Ve,{})},nodes:[]}]},{key:"route-mappings",label:"Route Mappings",icon:"",component:function(){return Object(T.jsx)($t,{})},nodes:[]},{key:"staff-manager",label:"Staff Manager",icon:"",component:function(){return Object(T.jsx)(en,{})},nodes:[{key:"requests",label:"Requests",icon:"",component:function(){return Object(T.jsx)(et,{})},nodes:[]},{key:"refund-request",label:"Refund Request",icon:"",component:function(){return Object(T.jsx)(tt,{})},nodes:[]}]},{key:"admin-analytics",label:"Admin Analytics",icon:"",component:function(){return Object(T.jsx)(tn,{})},nodes:[]}]},paymentNodes:{key:"payments",label:"Payments",icon:"",component:function(){return Object(T.jsx)(Cb,{})},nodes:[{key:"automated-withdrawals",label:"Automated Withdrawals",icon:"",component:function(){return Object(T.jsx)(fu,{})},nodes:[]},{key:"country-orderings",label:"Country Orderings",icon:"",component:function(){return Object(T.jsx)(Eu,{})},nodes:[]},{key:"deposits",label:"Deposits",icon:"",component:function(){return Object(T.jsx)(gu,{})},nodes:[]},{key:"influencer-card",label:"Influencer Card",icon:"",component:function(){return Object(T.jsx)(Su,{})},nodes:[]},{key:"kyc-verifications",label:"KYC Verifications",icon:"",component:function(){return Object(T.jsx)(vu,{})},nodes:[]},{key:"methods",label:"Methods",icon:"",component:function(){return Object(T.jsx)(Tu,{})},nodes:[]},{key:"pix-withdrawals",label:"Pix Withdrawals",icon:"",component:function(){return Object(T.jsx)(mu,{})},nodes:[]},{key:"providers",label:"Providers",icon:"",component:function(){return Object(T.jsx)(yu,{})},nodes:[]},{key:"stuck-withdrawals",label:"Stuck Withdrawals",icon:"",component:function(){return Object(T.jsx)(xu,{})},nodes:[]},{key:"withdrawals",label:"Withdrawals",icon:"",component:function(){return Object(T.jsx)(_u,{})},nodes:[]}]},originalsNodes:{key:"blaze-originals",label:"Originals",icon:"",component:function(){return Object(T.jsx)(Ib,{})},nodes:[{key:"lookup-crash-bet",label:"Lookup Crash Bet",icon:"",component:function(){return Object(T.jsx)(xj,{})},nodes:[]},{key:"lookup-double-bet",label:"Lookup Double Bet",icon:"",component:function(){return Object(T.jsx)(fj,{})},nodes:[]},{key:"lookup-mines-bet",label:"Lookup Mines Bet",icon:"",component:function(){return Object(T.jsx)(vj,{})},nodes:[]},{key:"lookup-mines-bet-v2",label:"Lookup Mines Bet V2",icon:"",component:function(){return Object(T.jsx)(gj,{})},nodes:[]},{key:"lookup-dice-bet",label:"Lookup Dice Bet",icon:"",component:function(){return Object(T.jsx)(Tj,{})},nodes:[]},{key:"room-bet",label:"Room Bet",icon:"",component:function(){return Object(T.jsx)(yj,{})},nodes:[]}]},usersNodes:{key:"users",label:"Users",icon:"",component:function(){return Object(T.jsx)(kb,{})},nodes:[{key:"find-users",label:"Find users",icon:"",component:function(){return Object(T.jsx)(Ij,{})},nodes:[]},{key:"create-users",label:"Create users",icon:"",component:function(){return Object(T.jsx)(kj,{})},nodes:[]}]},affiliatesNodes:{key:"affiliates",label:"Affiliates",icon:"",component:function(){return Object(T.jsx)(Db,{})},nodes:[{key:"find-users",label:"Find users",icon:"",component:function(){return Object(T.jsx)(bj,{})},nodes:[]},{key:"affiliates-system",label:"System",icon:"",component:function(){return Object(T.jsx)(hj,{})},nodes:[{key:"create-campaign",label:"Create Campaign",icon:"",component:function(){return Object(T.jsx)(oj,{})},nodes:[]},{key:"update-campaign",label:"Update Campaign",icon:"",component:function(){return Object(T.jsx)(lj,{})},nodes:[]},{key:"affiliate-manager",label:"Affiliate Manager",icon:"",component:function(){return Object(T.jsx)(dj,{})},nodes:[]},{key:"update-postback-url",label:"Update Postback URL",icon:"",component:function(){return Object(T.jsx)(uj,{})},nodes:[]}]}]},statusNodes:{key:"status",label:"Status",icon:"",component:function(){return Object(T.jsx)(Lb,{})}}},Lj=[{key:"home",label:"Home",icon:"",component:function(){return Object(T.jsx)(l.b,{to:"/",children:"Home"})},nodes:[]},Dj.systemNodes,Dj.casinoNodes,Dj.paymentNodes,Dj.originalsNodes,Dj.usersNodes,Dj.affiliatesNodes,Dj.statusNodes,{key:"logout",label:"Logout",icon:"",component:function(){return Object(T.jsx)(l.b,{to:"/logout",children:"Logout"})},nodes:[],divider:"top"}],Uj=n(108),Pj=n.n(Uj),Wj=function(e){var t=e.parent,n="".concat(t," > ").replace("/"," > ");return Object(T.jsx)("span",{className:Pj.a.parentPath,children:n})},Mj=n(35),Bj=n.n(Mj),Fj=function(e){var t=e.hasNodes,n=void 0!==t&&t,a=e.isOpen,c=void 0!==a&&a,s=e.level,i=void 0===s?0:s,o=e.onClick,l=e.toggleNode,u=e.active,j=e.focused,b=e.openedIcon,h=void 0===b?"less":b,p=e.closedIcon,O=void 0===p?"more":p,m=e.style,x=void 0===m?{}:m,f=e.parent,v=e.searchTerm,g=e.divider,y=void 0===g?void 0:g;return Object(T.jsxs)("li",{className:Bj()("rstm-tree-item","rstm-tree-item-level".concat(i),Pj.a.item,{"rstm-tree-item--active":u},{"rstm-tree-item--focused":j},Object(_.a)({},Pj.a["".concat(y,"Divider")],y)),style:Object(d.a)({paddingLeft:"".concat(.75*i,"rem")},x),role:"button","aria-pressed":u,onClick:o,children:[v&&f&&Object(T.jsx)(Wj,{parent:f}),r.a.createElement(e.component),n&&Object(T.jsx)("img",{src:"/images/icons/expand_".concat(c?h:O,".svg"),alt:"",className:Pj.a.icon,onClick:function(e){n&&l&&l(),e.stopPropagation()}})]})},Gj=function(e){var t=e.path.split("/").reduce((function(e,t,n,a){var c=0===n?t:"".concat(e.at(-1).path,"/").concat(t);return e.concat([{label:t,path:c}])}),[]);return Object(T.jsx)("div",{children:t.map((function(e){return Object(T.jsx)(l.c,{to:e.path,className:Pj.a.parentPath,children:e.label},e.path)}))})},Vj=n(167),Yj=n.n(Vj),Hj=["search","searchTerm","items"],qj=function(){var e=Object(p.useLocation)(),t=r.a.useState(!1),n=Object(m.a)(t,2),a=n[0],c=n[1],s=r.a.useState(e.pathname),i=Object(m.a)(s,2),o=i[0],l=i[1],u=function(e){c((function(e){return!e})),e.key&&l(e.key)};return null!==localStorage.getItem("access_token")?Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)("span",{onClick:u,className:Yj.a.burger,children:Object(T.jsx)("img",{src:"/images/icons/burger.svg",alt:""})}),Object(T.jsx)(Gj,{path:o}),Object(T.jsx)(mj.a,{open:a,onClose:u,direction:"left",className:Yj.a.drawer,size:.85*window.innerWidth,children:Object(T.jsx)(_j.a,{data:Lj,onClickItem:u,children:function(e){var t=e.search,n=e.searchTerm,a=e.items;Object(mt.a)(e,Hj);return Object(T.jsxs)(T.Fragment,{children:[Object(T.jsxs)("div",{className:Yj.a.search,children:[Object(T.jsx)("input",{onChange:function(e){return t(e.target.value)},placeholder:"Go to",value:n}),n&&Object(T.jsx)("span",{onClick:function(){return t("")},children:"x"})]}),Object(T.jsx)("ul",{className:Yj.a.ul,children:a.map((function(e,t){return Object(T.jsx)(Fj,Object(d.a)({},e),e.key)}))})]})}})})]}):null},Kj=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={loading:!1,data:{},query:""},a}return Object(j.a)(n,[{key:"fetch",value:function(){var e=this;this.setState({loading:!0}),window.api.get("/admin/crash_bets/"+this.state.query).then((function(t){return e.setState({data:t})})).finally((function(){return e.setState({loading:!1})}))}},{key:"render",value:function(){var e=this,t=this.state.data;return this.state.loading?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:this.state.query,onChange:function(t){e.setState({query:t.target.value})},placeholder:"Type a Bet ID or Round ID"}),Object(T.jsx)("button",{disabled:this.state.isLoading,className:"red",onClick:function(){return e.fetch()},children:this.state.isLoading?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-6",children:Object(T.jsx)("pre",{children:JSON.stringify(t,null,4)})})})]})}}]),n}(c.Component),zj=Object(p.withRouter)(Kj),Xj=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={loading:!1,data:{},query:""},a}return Object(j.a)(n,[{key:"fetch",value:function(){var e=this;this.setState({loading:!0}),window.api.get("/admin/roulette_bets/"+this.state.query).then((function(t){return e.setState({data:t})})).finally((function(){return e.setState({loading:!1})}))}},{key:"render",value:function(){var e=this,t=this.state.data;return this.state.loading?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:this.state.query,onChange:function(t){e.setState({query:t.target.value})},placeholder:"Type a Bet ID or Round ID"}),Object(T.jsx)("button",{disabled:this.state.isLoading,className:"red",onClick:function(){return e.fetch()},children:this.state.isLoading?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-6",children:Object(T.jsx)("pre",{children:JSON.stringify(t,null,4)})})})]})}}]),n}(c.Component),Zj=Object(p.withRouter)(Xj),Qj=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={loading:!1,data:{},query:""},a}return Object(j.a)(n,[{key:"fetch",value:function(){var e=this;this.setState({loading:!0}),window.api.get("/admin/mines_bets/"+this.state.query).then((function(t){return e.setState({data:t})})).finally((function(){return e.setState({loading:!1})}))}},{key:"render",value:function(){var e=this,t=this.state.data;return this.state.loading?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:this.state.query,onChange:function(t){e.setState({query:t.target.value})},placeholder:"Type a Bet ID or Round ID"}),Object(T.jsx)("button",{disabled:this.state.isLoading,className:"red",onClick:function(){return e.fetch()},children:this.state.isLoading?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-6",children:Object(T.jsx)("pre",{children:JSON.stringify(t,null,4)})})})]})}}]),n}(c.Component),Jj=Object(p.withRouter)(Qj),$j=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={loading:!1,data:{},query:""},a}return Object(j.a)(n,[{key:"fetch",value:function(){var e=this;this.setState({loading:!0}),window.api.get("/admin/plinko_bets/"+this.state.query).then((function(t){return e.setState({data:t})})).finally((function(){return e.setState({loading:!1})}))}},{key:"render",value:function(){var e=this,t=this.state.data;return this.state.loading?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:this.state.query,onChange:function(t){e.setState({query:t.target.value})},placeholder:"Type a Bet ID or Round ID"}),Object(T.jsx)("button",{disabled:this.state.isLoading,className:"red",onClick:function(){return e.fetch()},children:this.state.isLoading?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-6",children:Object(T.jsx)("pre",{children:JSON.stringify(t,null,4)})})})]})}}]),n}(c.Component),eb=Object(p.withRouter)($j),tb=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={loading:!1,data:{},query:""},a}return Object(j.a)(n,[{key:"fetch",value:function(){var e=this;this.setState({loading:!0}),function(e){return H.apply(this,arguments)}(this.state.query).then((function(t){return e.setState({data:t})})).finally((function(){return e.setState({loading:!1})}))}},{key:"render",value:function(){var e=this,t=this.state.data;return this.state.loading?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:this.state.query,onChange:function(t){e.setState({query:t.target.value})},placeholder:"Type a Game ID (not a Bet Id) "}),Object(T.jsx)("button",{disabled:this.state.isLoading,className:"red",onClick:function(){return e.fetch()},children:this.state.isLoading?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-6",children:Object(T.jsx)("pre",{children:JSON.stringify(t,null,4)})})})]})}}]),n}(c.Component),nb=Object(p.withRouter)(tb),ab=function(){var e=Object(c.useState)({}),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(!1),s=Object(m.a)(r,2),i=s[0],o=s[1],l=Object(c.useState)(""),d=Object(m.a)(l,2),u=d[0],j=d[1];return i?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:u,onChange:function(e){var t=e.target;return j(t.value||"")},placeholder:"Type a Round ID"}),Object(T.jsx)("button",{disabled:i,className:"red",onClick:function(){o(!0),window.api.get("/admin/dice_bets/"+u).then((function(e){return a(e||{})})).finally((function(){return o(!1)}))},children:i?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-6",children:Object(T.jsx)("pre",{children:JSON.stringify(n,null,4)})})})]})},cb=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={loading:!1,data:{},query:""},a}return Object(j.a)(n,[{key:"fetch",value:function(){var e=this;this.setState({loading:!0}),window.api.get("/admin/limbo_bets/"+this.state.query).then((function(t){return e.setState({data:t})})).finally((function(){return e.setState({loading:!1})}))}},{key:"render",value:function(){var e=this,t=this.state.data;return this.state.loading?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:this.state.query,onChange:function(t){e.setState({query:t.target.value})},placeholder:"Type a Bet ID or Round ID"}),Object(T.jsx)("button",{disabled:this.state.isLoading,className:"red",onClick:function(){return e.fetch()},children:this.state.isLoading?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-6",children:Object(T.jsx)("pre",{children:JSON.stringify(t,null,4)})})})]})}}]),n}(c.Component),rb=Object(p.withRouter)(cb),sb=function(){var e=Object(c.useState)({}),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(!1),s=Object(m.a)(r,2),i=s[0],o=s[1],l=Object(c.useState)(""),d=Object(m.a)(l,2),u=d[0],j=d[1];return i?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:u,onChange:function(e){var t=e.target;return j(t.value||"")},placeholder:"Type a Round ID"}),Object(T.jsx)("button",{disabled:i,className:"red",onClick:function(){o(!0),k.get("/admin/user/crash_bet/"+u).then((function(e){return a(e||{})})).finally((function(){return o(!1)}))},children:i?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-6",children:Object(T.jsx)("pre",{children:JSON.stringify(n,null,4)})})})]})},ib=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={loading:!1,data:{},query:""},a}return Object(j.a)(n,[{key:"fetch",value:function(){var e=this;this.setState({loading:!0}),function(e){return W.apply(this,arguments)}(this.state.query).then((function(t){return e.setState({data:t})})).finally((function(){return e.setState({loading:!1})}))}},{key:"render",value:function(){var e=this,t=this.state.data;return this.state.loading?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:this.state.query,onChange:function(t){e.setState({query:t.target.value})},placeholder:"Type a Bet (hash) ID "}),Object(T.jsx)("button",{disabled:this.state.isLoading,className:"red",onClick:function(){return e.fetch()},children:this.state.isLoading?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-6",children:Object(T.jsx)("pre",{children:JSON.stringify(t,null,4)})})})]})}}]),n}(c.Component),ob=Object(p.withRouter)(ib),lb=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={loading:!1,data:{},query:""},a}return Object(j.a)(n,[{key:"fetch",value:function(){var e=this;this.setState({loading:!0}),function(e){return G.apply(this,arguments)}(this.state.query).then((function(t){return e.setState({data:t[0]||{}})})).finally((function(){return e.setState({loading:!1})}))}},{key:"render",value:function(){var e=this,t=this.state.data;return this.state.loading?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:this.state.query,onChange:function(t){e.setState({query:t.target.value})},placeholder:"Type a Bet (hash) ID "}),Object(T.jsx)("button",{disabled:this.state.isLoading,className:"red",onClick:function(){return e.fetch()},children:this.state.isLoading?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-6",children:Object(T.jsx)("pre",{children:JSON.stringify(t,null,4)})})})]})}}]),n}(c.Component),db=Object(p.withRouter)(lb),ub=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).state={loading:!1,data:{},query:""},a}return Object(j.a)(n,[{key:"fetch",value:function(){var e=this;this.setState({loading:!0}),function(e){return F.apply(this,arguments)}(this.state.query).then((function(t){return e.setState({data:t})})).finally((function(){return e.setState({loading:!1})}))}},{key:"render",value:function(){var e=this,t=this.state.data;return this.state.loading?Object(T.jsx)("div",{className:"bet-page",children:Object(T.jsx)("h2",{children:"Loading..."})}):Object(T.jsxs)("div",{className:"bet-page",children:[Object(T.jsxs)("div",{className:"user-search-row",children:[Object(T.jsx)("input",{value:this.state.query,onChange:function(t){e.setState({query:t.target.value})},placeholder:"Type a Bet (hash) ID "}),Object(T.jsx)("button",{disabled:this.state.isLoading,className:"red",onClick:function(){return e.fetch()},children:this.state.isLoading?"Loading...":"Search"})]}),Object(T.jsx)("div",{className:"row",children:Object(T.jsx)("div",{className:"col-md-6",children:Object(T.jsx)("pre",{children:JSON.stringify(t,null,4)})})})]})}}]),n}(c.Component),jb=Object(p.withRouter)(ub),bb=n(724),hb=function(){var e=Object(c.useState)([]),t=Object(m.a)(e,2),n=t[0],a=t[1],r=Object(c.useState)(!0),s=Object(m.a)(r,2),i=s[0],o=s[1],l=Object(c.useState)(!1),d=Object(m.a)(l,2),u=d[0],j=d[1];return Object(c.useEffect)((function(){o(!0),function(){return z.apply(this,arguments)}().then((function(e){a(e)})).catch((function(e){j(!0),re.toast.error(e.message)})).finally((function(){o(!1)}))}),[]),u?Object(T.jsx)("div",{children:Object(T.jsx)("h1",{children:"Something went wrong while fetching data"})}):i?Object(T.jsx)("div",{children:Object(T.jsx)("h1",{children:"Loading..."})}):Object(T.jsxs)(bb.a,{className:"responsiveTable",children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Room ID"}),Object(T.jsx)(we.Th,{children:"Name"}),Object(T.jsx)(we.Th,{children:"Rolls left"})]})}),Object(T.jsx)(we.Tbody,{children:(null===n||void 0===n?void 0:n.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.game_room}),Object(T.jsx)(we.Td,{children:e.rolls_left})]},e.id)})))||Object(T.jsx)(we.Tr,{children:Object(T.jsx)(we.Td,{colSpan:3,children:"No rooms found"})})})]})},pb=function(){var e=Object(E.useQueryClient)(),t=Object(E.useQuery)("multiplayerGamesRooms",$),n=t.data,a=t.isLoading,c=t.isError,r=Object(E.useMutation)(te,{onSuccess:function(){e.invalidateQueries("multiplayerGamesRooms")},onError:function(e){re.toast.error(e)}});return c?Object(T.jsx)("div",{children:Object(T.jsx)("h1",{children:"Something went wrong while fetching data"})}):a?Object(T.jsx)("div",{children:Object(T.jsx)("h1",{children:"Loading..."})}):Object(T.jsxs)(bb.a,{className:"responsiveTable",children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Room ID"}),Object(T.jsx)(we.Th,{children:"Name"}),Object(T.jsx)(we.Th,{children:"Active"}),Object(T.jsx)(we.Th,{children:"Actions"})]})}),Object(T.jsx)(we.Tbody,{children:(null===n||void 0===n?void 0:n.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:e.id}),Object(T.jsx)(we.Td,{children:e.game}),Object(T.jsx)(we.Td,{children:e.active?Object(T.jsx)("i",{className:"fas fa-check",style:{color:"green"}}):Object(T.jsx)("i",{className:"fas fa-times",style:{color:"lightgray"}})}),Object(T.jsx)(we.Td,{children:Object(T.jsx)("button",{onClick:function(){return function(e){var t=e.active,n=t?"activate":"deactivate";if(window.confirm("Warning! Are you sure to ".concat(n," the room ?"))){var a={active:!t};r.mutate({roomId:e.id,updatedData:a})}}(e)},children:e.active?"Deactivate":"Activate"})})]},e.id)})))||Object(T.jsx)(we.Tr,{children:Object(T.jsx)(we.Td,{colSpan:4,children:"No rooms found"})})})]})},Ob=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){return Object(u.a)(this,n),t.apply(this,arguments)}return Object(j.a)(n,[{key:"render",value:function(){var e=this.props.match.url;return Object(T.jsx)(fe,{feature:"BLAZE_ORIGINALS",children:Object(T.jsxs)("div",{className:"page",children:[Object(T.jsx)(O.BrowserView,{children:Object(T.jsxs)("nav",{children:[Object(T.jsx)(xj,{}),Object(T.jsx)(fj,{}),Object(T.jsx)(vj,{}),Object(T.jsx)(gj,{}),Object(T.jsx)(Tj,{}),Object(T.jsx)(yj,{}),Object(T.jsx)(Ej,{}),Object(T.jsx)(Sj,{}),Object(T.jsx)(wj,{}),Object(T.jsx)(Rj,{}),Object(T.jsx)(Aj,{}),Object(T.jsx)(Nj,{}),Object(T.jsx)(Cj,{})]})}),Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(p.Route,{path:"".concat(e,"/crash-II-bets"),component:sb}),Object(T.jsx)(p.Route,{path:"".concat(e,"/crash-bets"),component:zj}),Object(T.jsx)(p.Route,{path:"".concat(e,"/double-bets"),component:Zj}),Object(T.jsx)(p.Route,{path:"".concat(e,"/mines-bets"),component:Jj}),Object(T.jsx)(p.Route,{path:"".concat(e,"/bets-pending"),component:Jj}),Object(T.jsx)(p.Route,{path:"".concat(e,"/plinko-bets"),component:eb}),Object(T.jsx)(p.Route,{path:"".concat(e,"/limbo-bets"),component:rb}),Object(T.jsx)(p.Route,{path:"".concat(e,"/new-originals-games"),component:nb}),Object(T.jsx)(p.Route,{path:"".concat(e,"/slide-bet"),component:ob}),Object(T.jsx)(p.Route,{path:"".concat(e,"/fortune-double-bet"),component:jb}),Object(T.jsx)(p.Route,{path:"".concat(e,"/fortune-double-rooms"),component:hb}),Object(T.jsx)(p.Route,{path:"".concat(e,"/multiplayer-games-rooms"),component:pb}),Object(T.jsx)(p.Route,{path:"".concat(e,"/fruits-bet"),component:db}),Object(T.jsx)(p.Route,{path:"".concat(e,"/dice-bets"),component:ab})]})]})})}}]),n}(c.Component),_b=Object(p.withRouter)(Object(o.b)((function(e){return{}}),(function(e){return{}}))(Ob)),mb=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/status/current",children:"Current Status"})},xb=function(){return Object(T.jsx)(l.c,{exact:!0,to:"/status/balance",children:"Balance"})},fb=(n(627),n(628),"Originals"),vb=function(e){var t=e.select,n=e.setSelect,a=Object(c.useState)([]),r=Object(m.a)(a,2),s=r[0],i=r[1];return Object(c.useEffect)((function(){window.api.get("/admin/monitoring/categories").then((function(e){var t=e.map((function(e){return{id:e,label:e}})),n=[{id:"",label:"All"}].concat(t).concat([{id:fb,label:fb}]);i(n)}))}),[]),Object(T.jsx)("div",{className:"selectcategory",children:Object(T.jsx)(Ce.a,{className:"selectsort__select",classNamePrefix:"selectsort__select",options:s,value:s.find((function(e){return e.id===t}))||s[0],onChange:function(e){var t=e.id;n(t)},placeholder:"Select category",clearable:!1})})},gb=(n(629),[{id:"",label:"all"},{id:"external",label:"external"},{id:"internal",label:"internal"}]),Tb=function(e){var t=e.select,n=e.setSelect;return Object(T.jsx)("div",{className:"selecttype",children:Object(T.jsx)(Ce.a,{className:"selectsort__select",classNamePrefix:"selectsort__select",options:gb,value:gb.find((function(e){return e.id===t}))||gb[0],onChange:function(e){var t=e.id;n(t)},placeholder:"filter by service",clearable:!1})})},yb=Object(p.withRouter)((function(){var e=Object(c.useRef)(null),t=Object(c.useState)(!0),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)(0),i=Object(m.a)(s,2),o=i[0],l=(i[1],Object(c.useState)(1)),d=Object(m.a)(l,2),u=d[0],j=d[1],b=Object(c.useState)(""),h=Object(m.a)(b,2),p=h[0],O=h[1],_=Object(c.useState)(""),v=Object(m.a)(_,2),g=v[0],y=v[1],E=Object(c.useState)([]),S=Object(m.a)(E,2),w=S[0],R=S[1],A=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n,a,c;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,g!==fb){e.next=8;break}return e.next=4,q();case 4:t=e.sent,R(t||[]),e.next=22;break;case 8:return n="/admin/monitoring?",p&&(n="".concat(n,"type=").concat(p,"&")),g&&(n="".concat(n,"category=").concat(g,"&")),e.next=13,window.api.get(n);case 13:if(a=e.sent,!g){e.next=18;break}R(a),e.next=22;break;case 18:return e.next=20,q();case 20:c=e.sent,R([].concat(Object(ct.a)(a),Object(ct.a)(c)));case 22:e.next=27;break;case 24:e.prev=24,e.t0=e.catch(0),R([]);case 27:return e.prev=27,r(!1),e.finish(27);case 30:case"end":return e.stop()}}),e,null,[[0,24,27,30]])})));return function(){return e.apply(this,arguments)}}();return Object(c.useEffect)((function(){return A(),e.current=setInterval(A,5e3),function(){e.current&&clearInterval(e.current)}}),[u,p,g]),Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{className:"box-selects box-selects-status",children:[Object(T.jsxs)("div",{className:"box-select",children:[Object(T.jsx)("h1",{className:"text-box-select",children:"Category"}),Object(T.jsx)(vb,{select:g,setSelect:y})]}),Object(T.jsxs)("div",{className:"box-select",children:[Object(T.jsx)("h1",{className:"text-box-select",children:"Type"}),Object(T.jsx)(Tb,{select:p,setSelect:O})]})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Service"}),Object(T.jsx)(we.Th,{children:"Type"}),Object(T.jsx)(we.Th,{children:"Last Transaction"}),Object(T.jsx)(we.Th,{children:"Status"})]})}),a&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Fetching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsx)(we.Tbody,{className:"referrals-body",children:w.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:null===e||void 0===e?void 0:e.service}),Object(T.jsx)(we.Td,{children:null!==e&&void 0!==e&&e.external?"External":"Internal"}),Object(T.jsx)(we.Td,{children:null===e||void 0===e?void 0:e.last_transaction_seen_at}),Object(T.jsx)(we.Td,{children:Object(T.jsx)(Po.a,{title:null===e||void 0===e?void 0:e.status,placement:"top-start",children:Object(T.jsx)("div",{className:"status-indicator ".concat(null===e||void 0===e?void 0:e.status)})})})]},null===e||void 0===e?void 0:e.service)}))})]}),Object(T.jsxs)("div",{className:"pagination",children:[Object(T.jsx)("button",{className:"btn-pagination",onClick:function(){return j(u-1)},disabled:1===u,children:Object(T.jsx)("span",{children:"<"})}),Object(T.jsxs)("div",{className:"pagination_page",children:["Page ",u," of ",o]}),Object(T.jsx)("button",{className:"btn-pagination",onClick:function(){return j(u+1)},disabled:u>=o,children:Object(T.jsx)("span",{children:">"})})]})]})})),Eb=(n(630),n(631),function(e){var t=e.select,n=e.setSelect,a=e.type,r=e.placeholder,s=Object(c.useState)([]),i=Object(m.a)(s,2),o=i[0],l=i[1];return Object(c.useEffect)((function(){window.api.get("/admin/monitoring/balance/".concat(a)).then((function(e){var t=e.map((function(e){return{id:e,label:e}}));l([{id:"",label:"All"}].concat(Object(ct.a)(t)))}))}),[]),Object(T.jsx)("div",{className:"selectCurrency",children:Object(T.jsx)(Ce.a,{className:"selectsort__select",classNamePrefix:"selectsort__select",options:o,value:o.find((function(e){return e.id===t}))||o[0],onChange:function(e){var t=e.id;n(t)},placeholder:r,clearable:!1})})}),Sb=Object(p.withRouter)((function(){var e=Object(c.useRef)(null),t=Object(c.useState)(!0),n=Object(m.a)(t,2),a=n[0],r=n[1],s=Object(c.useState)([]),i=Object(m.a)(s,2),o=i[0],l=i[1],d=Object(c.useState)(""),u=Object(m.a)(d,2),j=u[0],b=u[1],h=Object(c.useState)(""),p=Object(m.a)(h,2),O=p[0],_=p[1],v=function(){var e=Object(f.a)(Object(x.a)().mark((function e(){var t,n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t="/admin/monitoring/balance?",t=j?"".concat(t,"provider=").concat(j,"&"):t,t=O?"".concat(t,"currency=").concat(O,"&"):t,e.next=6,window.api.get(t);case 6:n=e.sent,l(n||[]),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),l([]);case 13:return e.prev=13,r(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[0,10,13,16]])})));return function(){return e.apply(this,arguments)}}();return Object(c.useEffect)((function(){return v(),e.current=setInterval(v,5e3),function(){e.current&&clearInterval(e.current)}}),[j,O]),Object(T.jsxs)("div",{children:[Object(T.jsxs)("div",{className:"box-selects box-selects-status",children:[Object(T.jsxs)("div",{className:"box-select",children:[Object(T.jsx)("h1",{className:"text-box-select",children:"Provider"}),Object(T.jsx)(Eb,{select:j,setSelect:b,type:"providers",placeholder:"Select provider"})]}),Object(T.jsxs)("div",{className:"box-select",children:[Object(T.jsx)("h1",{className:"text-box-select",children:"Currency"}),Object(T.jsx)(Eb,{select:O,setSelect:_,type:"currencies",placeholder:"Select currency"})]})]}),Object(T.jsxs)(we.Table,{children:[Object(T.jsx)(we.Thead,{children:Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Th,{children:"Provider"}),Object(T.jsx)(we.Th,{children:"Merchant"}),Object(T.jsx)(we.Th,{children:"Currency"}),Object(T.jsx)(we.Th,{children:"Amount"}),Object(T.jsx)(we.Th,{children:"Last Updated"})]})}),a&&Object(T.jsxs)("div",{className:"loading-overlay",children:[Object(T.jsx)("h2",{children:"Fetching, please wait ..."}),Object(T.jsx)("div",{className:"loader"})]}),Object(T.jsx)(we.Tbody,{className:"referrals-body",children:o.map((function(e){return Object(T.jsxs)(we.Tr,{children:[Object(T.jsx)(we.Td,{children:null===e||void 0===e?void 0:e.provider}),Object(T.jsx)(we.Td,{children:null===e||void 0===e?void 0:e.merchant}),Object(T.jsx)(we.Td,{children:null===e||void 0===e?void 0:e.currency_type}),Object(T.jsx)(we.Td,{children:null===e||void 0===e?void 0:e.amount}),Object(T.jsx)(we.Td,{children:null===e||void 0===e?void 0:e.updated_at})]},(null===e||void 0===e?void 0:e.provider)+(null===e||void 0===e?void 0:e.currency_type))}))})]})]})})),wb=n(359);var Rb=function(e){return e.location.search,e.match.url,Object(T.jsxs)("div",{className:"page",children:[Object(T.jsx)(O.BrowserView,{children:Object(T.jsxs)("nav",{children:[Object(T.jsx)(mb,{}),Object(T.jsx)(xb,{})]})}),Object(T.jsxs)(p.Switch,{children:[Object(T.jsx)(ge,{group:me.a.MONITORING.GENERAL,exact:!0,path:"/status/current",component:yb}),Object(T.jsx)(ge,{group:me.a.MONITORING.GENERAL,exact:!0,path:"/status/balance",component:Sb}),Object(T.jsx)(wb.Redirect,{from:"/status",to:"/status/current"})]})]})},Ab=function(){return Object(T.jsx)(xe,{group:me.a.SYSTEM,children:Object(T.jsx)(l.c,{to:"/system",children:"System"})})},Nb=function(){return Object(T.jsx)(xe,{group:me.a.BETS.GAMES,children:Object(T.jsx)(l.c,{to:"/casino",children:"Casino"})})},Cb=function(){return Object(T.jsx)(xe,{group:me.a.PAYMENTS,children:Object(T.jsx)(l.c,{to:"/payments",children:"Payments"})})},Ib=function(){return Object(T.jsx)(fe,{permission:"BLAZE_ORIGINALS",children:Object(T.jsx)(l.c,{to:"/blaze-originals",children:"Originals"})})},kb=function(){return Object(T.jsx)(xe,{group:me.a.USERS,children:Object(T.jsx)(l.c,{to:"/users",children:"Users"})})},Db=function(){return Object(T.jsx)(xe,{group:me.a.AFFILIATES,children:Object(T.jsx)(l.c,{to:"/affiliates",children:"Affiliates"})})},Lb=function(){return Object(T.jsx)(xe,{group:me.a.MONITORING.GENERAL,children:Object(T.jsx)(l.c,{to:"/status",children:"Status"})})},Ub=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(){var e;Object(u.a)(this,n);for(var a=arguments.length,c=new Array(a),r=0;r<a;r++)c[r]=arguments[r];return(e=t.call.apply(t,[this].concat(c))).state={refresh:!1,toggle:!1},e.toggleDrawer=function(){var t=e.state.toggle;e.setState({toggle:!t})},e}return Object(j.a)(n,[{key:"render",value:function(){var e=this;return Object(T.jsxs)("div",{children:[Object(T.jsx)(O.MobileView,{children:Object(T.jsx)(qj,{})}),Object(T.jsx)(O.BrowserView,{children:Object(T.jsxs)("div",{className:"navigation-show",children:[Object(T.jsxs)("nav",{className:"main-nav",children:[Object(T.jsx)(Ab,{}),Object(T.jsx)(Nb,{}),Object(T.jsx)(Cb,{}),Object(T.jsx)(Ib,{}),Object(T.jsx)(kb,{}),Object(T.jsx)(Db,{}),Object(T.jsx)(Lb,{})]}),Object(T.jsxs)("div",{className:"navigation-rightside",children:[Object(T.jsxs)("div",{className:"user-navigation",children:[this.props.user," "]}),Object(T.jsx)("button",{className:"button-logout",onClick:function(){localStorage.removeItem("access_token"),e.props.history.push("/")},children:"Logout"})]})]})}),Object(T.jsx)(xe,{group:me.a.SYSTEM,children:Object(T.jsx)(p.Route,{path:"/system",component:jn})}),Object(T.jsx)(xe,{group:me.a.USERS,children:Object(T.jsx)(p.Route,{path:"/users",component:Pl})}),Object(T.jsx)(xe,{group:me.a.BETS,children:Object(T.jsx)(p.Route,{path:"/casino",component:Ur})}),Object(T.jsx)(xe,{group:me.a.PAYMENTS,children:Object(T.jsx)(p.Route,{path:"/payments",component:Au})}),Object(T.jsx)(xe,{group:me.a.STAFF_MANAGER,children:Object(T.jsx)(p.Route,{path:"/staff",component:at})}),Object(T.jsx)(fe,{permission:"BLAZE_ORIGINALS",children:Object(T.jsx)(p.Route,{path:"/blaze-originals",component:_b})}),Object(T.jsx)(xe,{group:me.a.AFFILIATES,children:Object(T.jsx)(p.Route,{path:"/affiliates",component:pj})}),Object(T.jsx)(xe,{group:me.a.MONITORING,children:Object(T.jsx)(p.Route,{path:"/status",component:Rb})}),Object(T.jsx)(p.Route,{path:"/logout",component:Oj})]})}}]),n}(c.Component),Pb=Object(p.withRouter)(Object(o.b)((function(e){return{roles:e.app.user.roles,user:e.app.user.email}}),(function(e){return{}}))(Ub)),Wb="app/USER/UPDATE",Mb="app/CURRENCIES/UPDATE",Bb=(n(632),n(633),n(634),n(635),n(636),n(637),function(){return!1}),Fb=function(e){Object(b.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(u.a)(this,n),(a=t.call(this,e)).handleLogin=function(){a.props.login(a.username.value,a.password.value,a.state.code)},a.state={code:"",sessionExpired:!1},a}return Object(j.a)(n,[{key:"componentDidMount",value:function(){var e=this;this.props.updateUser(),this.props.updateMeta(),this.props.updateCurrencies(),window.api.get("/version").then((function(e){var t=e.version;console._log("[Blaze.com] Admin version: ".concat(hn,", Server version: ").concat(t))})),de=function(){console.log("session expired"),e.setState({sessionExpired:!0})}}},{key:"renderContent",value:function(){var e=this;if(window.api.isAuthed()){if(this.state.sessionExpired)return Object(T.jsxs)("div",{className:"session-expired",children:[Object(T.jsx)("h1",{children:"Your session has expired"}),Object(T.jsx)("a",{children:Object(T.jsx)("button",{onClick:function(){localStorage.clear("access_token"),window.location.reload()},children:"Sign in"})})]});if(!this.props.app.user.id)return Object(T.jsx)("h1",{children:"Loading..."})}return window.api.isAuthed()?Object(T.jsx)(Pb,{}):Object(T.jsxs)("div",{children:[Object(T.jsx)("h1",{children:"Please Login"}),Object(T.jsx)("input",{placeholder:"Username",ref:function(t){return e.username=t},onKeyDown:function(t){"Enter"===t.key&&e.handleLogin()}}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("input",{placeholder:"Password",type:"password",ref:function(t){return e.password=t},onKeyDown:function(t){"Enter"===t.key&&e.handleLogin()}}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("input",{placeholder:"Two factor code",value:this.state.code,onChange:function(t){e.setState({code:t.target.value.replace(" ","")})},onKeyDown:function(t){"Enter"===t.key&&e.handleLogin()}}),Object(T.jsx)("br",{}),Object(T.jsx)("br",{}),Object(T.jsx)("button",{onClick:this.handleLogin,children:"Login"})]})}},{key:"render",value:function(){var e=O.isMobile?"mobileVersion":"";return Object(T.jsxs)("div",{id:"container",className:"tk-proxima-nova",children:[Object(T.jsxs)("div",{className:"content ".concat(e),children:[Object(T.jsx)(Bb,{}),this.renderContent()]}),Object(T.jsx)(re.ToastContainer,{})]})}}]),n}(c.Component),Gb=Object(p.withRouter)(Object(o.b)((function(e){return Object(d.a)({},e)}),(function(e){return{updateUser:function(){return e(function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,a;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.get("/users/me");case 3:a=e.sent,window.roles=a.roles,window.permissions=null!==(n=a.permissions)&&void 0!==n?n:[],t({type:Wb,payload:a}),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(0);case 11:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}())},updateMeta:function(){return e(function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n,a,c,r;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all([window.api.get("/settings"),window.api.get("/languages")]);case 3:n=e.sent,a=Object(m.a)(n,2),c=a[0],r=a[1],t({type:"app/META/UPDATE",payload:Object(d.a)(Object(d.a)({},c),{},{languages:r})}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),e.t0&&1008===e.t0.code&&window.api.clearAuth();case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t){return e.apply(this,arguments)}}())},login:function(t,n,a){return e(function(e,t,n){return function(){var a=Object(f.a)(Object(x.a)().mark((function a(c){var r;return Object(x.a)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,window.api.put("/auth/password/admin",{username:e,password:t,code:n});case 2:r=a.sent,window.api.authenticate(r.access_token),window.location=window.location.origin;case 5:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}()}(t,n,a))},updateCurrencies:function(){return e(function(){var e=Object(f.a)(Object(x.a)().mark((function e(t){var n;return Object(x.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,window.api.get("/currencies");case 3:n=e.sent,t({type:Mb,payload:n}),e.next=9;break;case 7:e.prev=7,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}())}}}))(Fb)),Vb=n(63),Yb=n(360),Hb=(n(638),n(362)),qb={user:{permissions:[]},currencies:[],languages:[]},Kb={user:{selected_currency:null,wallets:[],documents:[],roles:[],authentication_methods:[],document:{type:null,data:null},real_sums:{},bonus_sums:{},cashier_sums:{},user_suspension:{},payment_methods:[],verification_document:{type:null,data:null},payment_emails:!1,marketing_emails:!1,general_emails:!1,marketing_campaign_eligible:!0,signup_channel:{type:"N/A",code:"N/A"},bonus_rounds:[],loading:!0,currency_types:[]},fingerprints:{meta:{total_pages:1},records:[]},notes:{meta:{total_pages:1},records:[]},deposits:{meta:{total_pages:1},records:[]},withdrawals:{meta:{total_pages:1},records:[],downloadingReport:!1},otp_fingerprints:{smsDelivery:[],userPhones:[]},referrals:{}},zb={data:[]},Xb={search_results:{meta:{total_pages:1},records:[]},categories:[],bonus_activations:{meta:{total_pages:1},records:[]},bonus_activations_on_withdrawal:[]},Zb={country_ordering_search_results:{meta:{total_pages:1},records:[]},method_search_results:{meta:{total_pages:1},records:[]},provider_search_results:{meta:{total_pages:1},records:[]},provider:{},method:{},country_ordering:{},platforms:n(361)},Qb={limits:[],provider:{}};var Jb={mystery_boxes:{meta:{total_pages:1},records:[]},items:{meta:{total_pages:1},records:[]},price:null,mystery_box:{win_metrics:{},rewards:[]},user_ranks:[],currency_rates:[]},$b={data:{meta:{total_pages:1},records:[],schema:{types:[],statuses:[]}},redeem_data:{meta:{total_pages:1},records:[],schema:{types:[],statuses:[]}},selected:{}},eh={selectedAffiliate:null,selectedCampaign:null},th={loading:!1,bigWins:{count:0,records:[]}},nh=Object(Vb.combineReducers)({app:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Wb:return Object(d.a)(Object(d.a)({},e),{},{user:t.payload});case Mb:return Object(d.a)(Object(d.a)({},e),{},{currencies:t.payload})}return e},users:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Kb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Pr:return Object(d.a)(Object(d.a)({},e),{},{search_results:t.payload});case Wr:return Object(d.a)(Object(d.a)({},e),{},{user:Object(d.a)(Object(d.a)(Object(d.a)({},e.user),t.payload),{},{loading:!1})});case $r:return Object(d.a)(Object(d.a)({},e),{},{user:Object(d.a)(Object(d.a)({},e.user),{},{loading:t.payload})});case Mr:return Object(d.a)(Object(d.a)({},e),{},{offers:t.payload});case Br:return Object(d.a)(Object(d.a)({},e),{},{fingerprints:t.payload});case Fr:return Object(d.a)(Object(d.a)({},e),{},{deposits:t.payload});case Gr:return Object(d.a)(Object(d.a)({},e),{},{withdrawals:Object(d.a)(Object(d.a)({},e.withdrawals),{},{downloadingReport:!0})});case Vr:return Object(d.a)(Object(d.a)({},e),{},{withdrawals:Object(d.a)(Object(d.a)({},e.withdrawals),{},{downloadingReport:!1})});case Yr:return Object(d.a)(Object(d.a)({},e),{},{withdrawals:t.payload});case zr:return Object(d.a)(Object(d.a)({},e),{},{notes:t.payload});case Hr:return Object(d.a)(Object(d.a)({},e),{},{user:Object(d.a)(Object(d.a)({},e.user),{},{documents:t.payload})});case qr:return Object(d.a)(Object(d.a)({},e),{},{user:Object(d.a)(Object(d.a)({},e.user),{},{document:t.payload})});case Zr:return Object(d.a)(Object(d.a)({},e),{},{user:Object(d.a)(Object(d.a)({},e.user),{},{verification_document:t.payload})});case Kr:return Object(d.a)(Object(d.a)({},e),{},{user_anti_fraud:t.payload});case Xr:return Object(d.a)(Object(d.a)({},e),{},{user:Object(d.a)(Object(d.a)({},e.user),{},{payment_methods:t.payload})});case Qr:return Object(d.a)(Object(d.a)({},e),{},{user:Object(d.a)(Object(d.a)({},e.user),{},{bonus_rounds:t.payload})});case Jr:return Object(d.a)(Object(d.a)({},e),{},{referrals:t.payload});case ts:return Object(d.a)(Object(d.a)({},e),{},{user:Object(d.a)(Object(d.a)({},e.user),{},{selected_currency:t.payload})});case es:return Object(d.a)(Object(d.a)({},e),{},{otp_fingerprints:t.payload})}return e},settings:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zb,t=arguments.length>1?arguments[1]:void 0;return t.type===v?Object(d.a)(Object(d.a)({},e),{},{data:t.payload}):e},bonuses:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case En:return Object(d.a)(Object(d.a)({},e),{},{search_results:t.payload});case Sn:return Object(d.a)(Object(d.a)({},e),{},{bonus_activations:t.payload});case wn:return Object(d.a)(Object(d.a)({},e),{},{bonus_activations_on_withdrawal:t.payload})}return e},payments:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Wl:return Object(d.a)(Object(d.a)({},e),{},{method_search_results:t.payload});case Fl:return Object(d.a)(Object(d.a)({},e),{},{provider_search_results:t.payload});case Ml:return Object(d.a)(Object(d.a)({},e),{},{country_ordering_search_results:t.payload});case Vl:return Object(d.a)(Object(d.a)({},e),{},{account_search_results:t.payload});case Bl:return Object(d.a)(Object(d.a)({},e),{},{method:t.payload});case Gl:return Object(d.a)(Object(d.a)({},e),{},{provider:t.payload});case Yl:return Object(d.a)(Object(d.a)({},e),{},{country_ordering:t.payload})}return e},currencies:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qb,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t.type){case cd:return Object(d.a)(Object(d.a)({},e),{},{limits:t.payload});case rd:return Object(d.a)(Object(d.a)({},e),{},{provider:t.payload});default:return e}},rewards:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jb,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ln.CASES_UPDATE:return Object(d.a)(Object(d.a)({},e),{},{mystery_boxes:t.payload});case Ln.CASE_ITEMS_UPDATE:return Object(d.a)(Object(d.a)({},e),{},{items:t.payload});case Ln.CASE_PRICE_UPDATE:return Object(d.a)(Object(d.a)({},e),{},{price:t.payload});case Ln.CASE_UPDATE:return Object(d.a)(Object(d.a)({},e),{},{mystery_box:t.payload});case Ln.ADD_CURRENCY_RATE:return Object(d.a)(Object(d.a)({},e),{},{currency_rates:[].concat(Object(ct.a)(e.currency_rates),[{currency:t.payload.currency}])});case Ln.DELETE_CURRENCY_RATE:return Object(d.a)(Object(d.a)({},e),{},{currency_rates:e.currency_rates.filter((function(e){return e.currency!==t.payload.currency}))});case Ln.UPDATE_CURRENCY_RATE:var n=e.currency_rates.findIndex((function(e){return e.currency===t.payload.previous})),a=Object(ct.a)(e.currency_rates);return a.splice(n,1,{currency:t.payload.currency,rate:t.payload.rate}),Object(d.a)(Object(d.a)({},e),{},{currency_rates:a});case Ln.LOAD_CURRENCY_RATES:return Object(d.a)(Object(d.a)({},e),{},{currency_rates:t.payload});case Ln.USER_RANKS_UPDATE:return Object(d.a)(Object(d.a)({},e),{},{user_ranks:t.payload.map((function(e){return Object(d.a)({id:e.type},e)}))})}return e},promo:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$b,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ua:return Object(d.a)(Object(d.a)({},e),{},{data:t.payload});case ja:return Object(d.a)(Object(d.a)({},e),{},{selected:t.payload});case ba:return Object(d.a)(Object(d.a)({},e),{},{redeem_data:t.payload})}return e},affiliates:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eh,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Bu:return Object(d.a)(Object(d.a)({},e),{},{selectedAffiliate:t.payload});case Fu:return Object(d.a)(Object(d.a)({},e),{},{selectedCampaign:t.payload})}return e},bigWins:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:th,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Xc:return Object(d.a)(Object(d.a)({},e),{},{loading:!0});case Zc:return{loading:!1,bigWins:t.payload}}return e}}),ah=(Object(Yb.createLogger)({collapsed:!0}),n(363)),ch=n(364),rh=n(720),sh=Object(ch.a)({palette:{mode:"dark",primary:{main:"#64687c"},secondary:{main:"#f50057"},background:{default:"#1d1e25",paper:"#1d1e25"}}}),ih=new E.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});console._log=console.log,"production"===bn&&(console.log=function(){}),i.a.render(Object(T.jsx)(o.a,{store:function(e){var t=[Hb.a];var n=[Vb.applyMiddleware.apply(void 0,t)];return Object(Vb.createStore)(nh,Vb.compose.apply(void 0,n))}(),children:Object(T.jsx)(l.a,{children:Object(T.jsxs)(E.QueryClientProvider,{client:ih,children:[Object(T.jsx)(ah.ReactQueryDevtools,{}),Object(T.jsx)(rh.a,{theme:sh,children:Object(T.jsx)(Gb,{})})]})})}),document.getElementById("root"))},78:function(e,t,n){e.exports={inputGroup:"create-announcement_inputGroup__1S3oc",inputField:"create-announcement_inputField__3Pvp0",block:"create-announcement_block__yTWO7",targetContainer:"create-announcement_targetContainer__1LPzK",buttonContainer:"create-announcement_buttonContainer__2WQ6k",announcementsSelect:"create-announcement_announcementsSelect__PTuFn"}},93:function(e,t,n){e.exports={container:"tab-admin-analytics_container__2oaZL",box:"tab-admin-analytics_box__3_M-m",pagination:"tab-admin-analytics_pagination__10XG3",button:"tab-admin-analytics_button__376YB"}},94:function(e,t,n){e.exports={tabbedNav:"DocumentNotices_tabbedNav__3g9TP",selected:"DocumentNotices_selected__2Mh-_",inputs:"DocumentNotices_inputs__2w00L"}}},[[639,1,2]]]);
//# sourceMappingURL=main.ef860161.chunk.js.map