{"version":3,"file":"index.modern.mjs","sources":["../src/Base/ClassId.ts","../src/IntUtils.ts","../src/MiniGames/SAWBuyInType.ts","../src/MiniGames/SAWUtils.ts","../src/MiniGames/SAWAcknowledgeType.ts","../src/MiniGames/SAWAskForUsername.ts","../src/MiniGames/SAWGameType.ts","../src/MiniGames/SAWExposeUserSpinId.ts","../src/MiniGames/SAWGameLayout.ts","../src/MiniGames/SAWPrizeType.ts","../src/MiniGames/SAWGetTemplatesResponse.ts","../src/MiniGames/SAWSpinErrorCode.ts","../src/MiniGames/SAWWinSoundType.ts","../src/MiniGames/SAWWinningHistoryResponse.ts","../src/MiniGames/PrizeModifiers.ts","../src/MiniGames/SAWWheelLayout.ts","../src/MiniGames/SAWGameDifficulty.ts","../src/MiniGames/AttemptPeriodType.ts","../src/NodeCache.ts","../src/OCache.ts","../src/Core/ActivityTypeLimited.ts","../src/Core/CoreUtils.ts","../src/Core/PublicLabelSettings.ts","../src/Core/TranslationArea.ts","../src/Inbox/GetInboxMessagesResponse.ts","../src/Inbox/InboxMessage.ts","../src/Inbox/InboxMessageType.ts","../src/Inbox/OpenLinksType.ts","../src/Inbox/InboxCategories.ts","../src/Inbox/InboxReadStatus.ts","../src/Store/BuyStoreItemErrorCode.ts","../src/Store/StoreCategory.ts","../src/Store/StoreItemPurchaseType.ts","../src/Store/StoreItemType.ts","../src/Store/StoreItem.ts","../src/Store/StoreItemPurchased.ts","../src/Missions/AchievementStatus.ts","../src/Missions/AchievementTaskType.ts","../src/Missions/AchievementType.ts","../src/Missions/AchievementAvailabilityStatus.ts","../src/Missions/BadgesTimeLimitStates.ts","../src/Missions/MissionsUtils.ts","../src/Missions/UserAchievement.ts","../src/Missions/ScheduledMissionType.ts","../src/Missions/AchievementCategory.ts","../src/Missions/MissionCategory.ts","../src/Missions/AchievementClaimTypeId.ts","../src/Tournaments/GetClanTournamentPlayersResponse.ts","../src/Tournaments/TournamentRegistrationType.ts","../src/Tournaments/TournamentRegistrationStatus.ts","../src/Tournaments/TournamentInstanceStatus.ts","../src/Tournaments/TournamentUtils.ts","../src/Tournaments/Tournament.ts","../src/Tournaments/GetTournamentInfoResponse.ts","../src/Tournaments/TournamentRegistrationError.ts","../src/Tournaments/TournamentType.ts","../src/Leaderboard/LeaderBoardPeriodType.ts","../src/Leaderboard/LeaderBoards.ts","../src/Level/GetLevelMapResponse.ts","../src/WSAPI/WSAPIBase.ts","../src/Raffle/GetRafflesResponse.ts","../src/Raffle/GetDrawRunResponse.ts","../src/Raffle/Raffle.ts","../src/Raffle/RaffleDraw.ts","../src/Raffle/GetRaffleDrawRunsHistoryResponse.ts","../src/Raffle/RaffleClaimPrizeResponse.ts","../src/WSAPI/WSAPIUser.ts","../src/WSAPI/WSAPIGeneral.ts","../src/WSAPI/WSAPIMissions.ts","../src/WSAPI/WSAPIBonuses.ts","../src/WSAPI/WSAPIStore.ts","../src/WSAPI/WSAPITournaments.ts","../src/WSAPI/WSAPIClans.ts","../src/WSAPI/WSAPIJackpots.ts","../src/WSAPI/WSAPIRaffles.ts","../src/WSAPI/WSAPIMiniGames.ts","../src/WSAPI/WSAPIAvatars.ts","../src/WSAPI/WSAPIGamePick.ts","../src/WSAPI/WSAPILeaderBoard.ts","../src/WSAPI/WSAPIInbox.ts","../src/WSAPI/WSAPI.ts","../src/CustomSections/AchCustomSection.ts","../src/CustomSections/UICustomSection.ts","../src/Bonuses/Bonus.ts","../src/Bonuses/BonusStatus.ts","../src/ActivityLog/ActivityLogActivities.ts","../src/ActivityLog/UserBalanceType.ts","../src/ActivityLog/GetActivityLogResponse.ts","../src/ActivityLog/PointChangeSourceType.ts","../src/Avatars/GetAvatarsListResponse.ts","../src/Avatars/GetAvatarsCustomizedResponse.ts","../src/Avatars/GetAvatarPromptsResponse.ts","../src/Jackpots/GetJackpotWinnersResponse.ts","../src/Jackpots/GetJackpotEligibleGamesResponse.ts","../src/SmarticoAPI.ts","../src/CookieStore.ts","../src/Analytics/AnalyticStoreData.ts","../src/GamePick/SportTypes.ts","../src/GamePick/MarketsType.ts","../src/GamePick/MarketsAnswers.ts","../src/GamePick/MarketsInfo.ts","../src/GamePick/MarketsPerSport.ts","../src/GamePick/GamePickTypes.ts","../src/Jackpots/JackpotContributionType.ts","../src/Jackpots/JackpotPot.ts","../src/Jackpots/JackpotType.ts","../src/Avatars/AvatarCustomizeErrorCode.ts","../src/Clans/JoinClanErrorCode.ts"],"sourcesContent":["export enum ClassId {\n\tPING = 1,\n\tPONG = 2,\n\n\tINIT = 3,\n\tINIT_RESPONSE = 4,\n\tIDENTIFY = 5,\n\tIDENTIFY_RESPONSE = 6,\n\tLOGIN = 7,\n\tLOGOUT = 8,\n\tEVENT = 9,\n\tEVENT_RESPONSE = 10,\n\n\tLOGIN_RESPONSE = 11,\n\tLOGOUT_RESPONSE = 12,\n\n\tGET_TRANSLATIONS_REQUEST = 13,\n\tGET_TRANSLATIONS_RESPONSE = 14,\n\n\t/*\n        !Important, if adding new messages that are 'acting' on behalf of the client,\n        you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n    */\n\n\tCLIENT_ENGAGEMENT_IMPRESSION_REQUEST = 103,\n\tCLIENT_ENGAGEMENT_ACTION_REQUEST = 104,\n\tCLIENT_EXECUTE_DEEPLINK_EVENT = 105,\n\tCLIENT_ENGAGEMENT_FAILED_REQUEST = 106,\n\tCLIENT_EXECUTE_JS_EVENT = 107,\n\tCLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT = 108,\n\tCLIENT_ENGAGEMENT_EVENT_NEW = 110,\n\n\tCLIENT_TRACK_ACTIVITY_REQUEST = 155,\n\tCLIENT_SET_AVATAR_REQUEST = 157,\n\tCLIENT_SET_AVATAR_RESPONSE = 158,\n\n\tCLIENT_SET_CUSTOM_USERNAME_REQUEST = 159,\n\tCLIENT_SET_CUSTOM_USERNAME_RESPONSE = 160,\n\n\tCHECK_SEGMENT_MATCH_REQUEST = 161,\n\tCHECK_SEGMENT_MATCH_RESPONSE = 162,\n\n\t/*\n        !Important, if adding new messages that are 'acting' on behalf of the client,\n        you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n    */\n\n\t// 500-1000 - Achievements\n\tGET_LEVEL_MAP_REQUEST = 500,\n\tGET_LEVEL_MAP_RESPONSE = 501,\n\tGET_ACHIEVEMENT_MAP_REQUEST = 502,\n\tGET_ACHIEVEMENT_MAP_RESPONSE = 503,\n\tRELOAD_ACHIEVEMENTS_EVENT = 504,\n\tGET_LEADERS_BOARD_REQUEST = 505,\n\tGET_LEADERS_BOARD_RESPONSE = 506,\n\tGET_SHOP_ITEMS_REQUEST = 509,\n\tGET_SHOP_ITEMS_RESPONSE = 510,\n\tBUY_SHOP_ITEM_REQUEST = 511,\n\tBUY_SHOP_ITEM_RESPONSE = 512,\n\tGET_INBOX_MESSAGES_REQUEST = 513,\n\tGET_INBOX_MESSAGES_RESPONSE = 514,\n\tGET_SHOP_CATEGORIES_REQUEST = 515,\n\tGET_SHOP_CATEGORIES_RESPONSE = 516,\n\tGET_TOURNAMENT_LOBBY_REQUEST = 517,\n\tGET_TOURNAMENT_LOBBY_RESPONSE = 518,\n\tGET_TOURNAMENT_INFO_REQUEST = 519,\n\tGET_TOURNAMENT_INFO_RESPONSE = 520,\n\tTOURNAMENT_REGISTER_REQUEST = 521,\n\tTOURNAMENT_REGISTER_RESPONSE = 522,\n\tGET_CUSTOM_SECTIONS_REQUEST = 523,\n\tGET_CUSTOM_SECTIONS_RESPONSE = 524,\n\tMISSION_OPTIN_REQUEST = 525,\n\tMISSION_OPTIN_RESPONSE = 526,\n\n\t/*\n        !Important, if adding new messages that are 'acting' on behalf of the client,\n        you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n    */\n\n\tGET_ACHIEVEMENT_USER_REQUEST = 527,\n\tGET_ACHIEVEMENT_USER_RESPONSE = 528,\n\n\tMARK_INBOX_READ_REQUEST = 529,\n\tMARK_INBOX_READ_RESPONSE = 530,\n\tMARK_INBOX_STARRED_REQUEST = 531,\n\tMARK_INBOX_STARRED_RESPONSE = 532,\n\tMARK_INBOX_DELETED_REQUEST = 535,\n\tMARK_INBOX_DELETED_RESPONSE = 536,\n\n\tGET_ACH_CATEGORIES_REQUEST = 537,\n\tGET_ACH_CATEGORIES_RESPONSE = 538,\n\n\tACHIEVEMENT_CLAIM_PRIZE_REQUEST = 539,\n\tACHIEVEMENT_CLAIM_PRIZE_RESPONSE = 540,\n\n\tACH_SHOP_ITEM_HISTORY_REQUEST = 541,\n\tACH_SHOP_ITEM_HISTORY_RESPONSE = 542,\n\n\tGET_RELATED_ACH_N_TOURNAMENTS_REQUEST = 543,\n\tGET_RELATED_ACH_N_TOURNAMENTS_RESPONSE = 544,\n\n\tGET_POINT_HISTORY_REQUEST = 545,\n\tGET_POINT_HISTORY_RESPONSE = 546,\n\n\tGET_AVATARS_LIST_REQUEST = 560,\n\tGET_AVATARS_LIST_RESPONSE = 561,\n\tGET_AVATARS_CUSTOMIZED_REQUEST = 562,\n\tGET_AVATARS_CUSTOMIZED_RESPONSE = 563,\n\tGET_AVATAR_PROMPTS_REQUEST = 564,\n\tGET_AVATAR_PROMPTS_RESPONSE = 565,\n\n\tGET_CLAN_LIST_REQUEST = 570,\n\tGET_CLAN_LIST_RESPONSE = 571,\n\n\tGET_CLAN_INFO_REQUEST = 572,\n\tGET_CLAN_INFO_RESPONSE = 573,\n\n\tJOIN_CLAN_REQUEST = 574,\n\tJOIN_CLAN_RESPONSE = 575,\n\n\tGET_CLAN_TOURNAMENT_PLAYERS_REQUEST = 576,\n\tGET_CLAN_TOURNAMENT_PLAYERS_RESPONSE = 577,\n\n\t/*\n        !Important, if adding new messages that are 'acting' on behalf of the client,\n        you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n    */\n\n\tGET_BONUSES_REQUEST = 600,\n\tGET_BONUSES_RESPONSE = 601,\n\tCLAIM_BONUS_REQUEST = 602,\n\tCLAIM_BONUS_RESPONSE = 603,\n\n\tSAW_GET_SPINS_REQUEST = 700,\n\tSAW_GET_SPINS_RESPONSE = 701,\n\tSAW_DO_SPIN_REQUEST = 702,\n\tSAW_DO_SPIN_RESPONSE = 703,\n\tSAW_AKNOWLEDGE_REQUEST = 704,\n\tSAW_AKNOWLEDGE_RESPONSE = 705,\n\tSAW_SPINS_COUNT_PUSH = 706,\n\tSAW_SHOW_SPIN_PUSH = 707,\n\tSAW_PRIZE_DROP_WIN_PUSH = 708,\n\tSAW_PRIZE_DROP_WIN_AKNOWLEDGE_REQUEST = 709,\n\tSAW_PRIZE_DROP_WIN_AKNOWLEDGE_RESPONSE = 710,\n\tSAW_PRIZE_DROP_WIN_AKNOWLEDGE_CANCEL_REQUEST = 718,\n\tSAW_PRIZE_DROP_WIN_AKNOWLEDGE_CANCEL_RESPONSE = 719,\n\tSAW_AKNOWLEDGE_SPIN_PUSH = 711,\n\tSAW_DO_SPIN_BATCH_REQUEST = 712,\n\tSAW_DO_SPIN_BATCH_RESPONSE = 713,\n\tSAW_AKNOWLEDGE_BATCH_REQUEST = 714,\n\tSAW_AKNOWLEDGE_BATCH_RESPONSE = 715,\n\n\tGET_SAW_HISTORY_REQUEST = 716,\n\tGET_SAW_HISTORY_RESPONSE = 717,\n\n\t/*\n        !Important, if adding new messages that are 'acting' on behalf of the client,\n        you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n    */\n\n\tJP_GET_JACKPOTS_REQUEST = 800,\n\tJP_GET_JACKPOTS_RESPONSE = 801,\n\n\tJP_GET_LATEST_POTS_REQUEST = 802,\n\tJP_GET_LATEST_POTS_RESPONSE = 803,\n\n\tJP_OPTIN_REQUEST = 804,\n\tJP_OPTIN_RESPONSE = 805,\n\n\tJP_OPTOUT_REQUEST = 806,\n\tJP_OPTOUT_RESPONSE = 807,\n\n\tJP_WIN_PUSH = 808,\n\tJP_GET_WINNERS_REQUEST = 809,\n\tJP_GET_WINNERS_RESPONSE = 810,\n\n\tJP_GET_ELIGIBLE_GAMES_REQUEST = 811,\n\tJP_GET_ELIGIBLE_GAMES_RESPONSE = 812,\n\n\tRAF_GET_RAFFLES_REQUEST = 902,\n\tRAF_GET_RAFFLES_RESPONSE = 903,\n\tRAF_GET_DRAW_RUN_REQUEST = 904,\n\tRAF_GET_DRAW_RUN_RESPONSE = 905,\n\tRAF_GET_DRAW_HISTORY_REQUEST = 906,\n\tRAF_GET_DRAW_HISTORY_RESPONSE = 907,\n\tRAF_CLAIM_PRIZE_REQUEST = 908,\n\tRAF_CLAIM_PRIZE_RESPONSE = 909,\n\tRAF_OPTIN_REQUEST = 916,\n\tRAF_OPTIN_RESPONSE = 917,\n\tRAF_GET_WON_PRIZES_REQUEST = 920,\n\tRAF_GET_WON_PRIZES_RESPONSE = 921,\n\t/*\n\tRAF_GET_TICKETS_REQUEST = 902,\n\tRAF_GET_TICKETS_RESPONSE = 903,\n\n\tRAF_CLAIM_PRIZE_REQUEST = 906,\n\t*/\n\n\tBNR_GET_BANNER_PLACEMENTS_REQUEST = 950,\n\tBNR_GET_BANNER_PLACEMENTS_RESPONSE = 951,\n\tBNR_GET_BANNER_CONTENT_REQUEST = 952,\n\tBNR_GET_BANNER_CONTENT_RESPONSE = 953,\n\n\t/*\n        !Important, if adding new messages that are 'acting' on behalf of the client,\n        you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n    */\n\n\tREGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,\n\tREGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,\n\n\tFORM_SHOW_PUSH = 1050,\n\n\tCLIENT_DEBUG_REQUEST = 77777,\n\n\t/*\n        !Important, if adding new messages that are 'acting' on behalf of the client,\n        you need to include them in the CLASS_ID_IGNORE_FOR_SIMULATION\n    */\n\n\tUNSUPPORTED_COMMAND = 99999,\n}\n","class IntUtils {\n\tpublic static uuid(): string {\n\t\tlet a: any;\n\t\tlet b: any;\n\t\tfor (\n\t\t\tb = a = '';\n\t\t\ta++ < 36;\n\t\t\tb += (a * 51) & 52 ? (a ^ 15 ? 8 ^ (Math.random() * (a ^ 20 ? 16 : 4)) : 4).toString(16) : '-'\n\t\t) {}\n\t\treturn b;\n\t}\n\n\tpublic static isNotNull(val: any): boolean {\n\t\treturn typeof val !== 'undefined' && val !== null;\n\t}\n\n\tpublic static isNotEmpty(val: string): boolean {\n\t\treturn typeof val !== 'undefined' && val !== null && val.length > 0;\n\t}\n\n\tpublic static replaceAll(value: string, regex: string, replacement: string | number): string {\n\t\tif (IntUtils.isNotNull(value)) {\n\t\t\treturn value.replace(new RegExp(IntUtils.escapeRegExp(regex), 'g'), replacement?.toString());\n\t\t}\n\t\treturn value;\n\t}\n\n\tpublic static escapeRegExp(v: string): string {\n\t\tif (IntUtils.isNotEmpty(v)) {\n\t\t\treturn v.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\t\t}\n\t\treturn v;\n\t}\n\n\tpublic static JsonOrText = (str: string): any => {\n\t\tif (str && str.includes && (str.includes('{') || str.includes('['))) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(str);\n\t\t\t} catch (e) {\n\t\t\t\treturn str;\n\t\t\t}\n\t\t}\n\t\treturn str || {};\n\t};\n\n\t// public static wsTimeToEpoch = (time: string): number => {\n\t//     if (time) {\n\t//         return moment.utc(time, \"DD/MM/YYYY HH:mm:ss\").valueOf()\n\t//     } else {\n\t//         return null\n\t//     }\n\t// }\n\n\tpublic static isWithinPeriod = (timestamp: number, period: 'today' | 'thisWeek' | 'thisMonth'): boolean => {\n\t\tconst now = new Date();\n\t\tconst completedDate = new Date(timestamp);\n\n\t\tswitch (period) {\n\t\t\tcase 'today':\n\t\t\t\treturn (\n\t\t\t\t\tnow.getFullYear() === completedDate.getFullYear() &&\n\t\t\t\t\tnow.getMonth() === completedDate.getMonth() &&\n\t\t\t\t\tnow.getDate() === completedDate.getDate()\n\t\t\t\t);\n\t\t\tcase 'thisWeek':\n\t\t\t\tconst startOfWeek = new Date(now);\n\t\t\t\tstartOfWeek.setDate(now.getDate() - now.getDay());\n\t\t\t\tstartOfWeek.setHours(0, 0, 0, 0);\n\n\t\t\t\tconst endOfWeek = new Date(startOfWeek);\n\t\t\t\tendOfWeek.setDate(startOfWeek.getDate() + 6);\n\t\t\t\tendOfWeek.setHours(23, 59, 59, 999);\n\n\t\t\t\treturn completedDate >= startOfWeek && completedDate <= endOfWeek;\n\t\t\tcase 'thisMonth':\n\t\t\t\treturn now.getFullYear() === completedDate.getFullYear() && now.getMonth() === completedDate.getMonth();\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t};\n}\n\nexport { IntUtils };\n","export enum SAWBuyInType {\n\tFree = 1,\n\tPoints = 2,\n\tSpins = 3,\n\tGems = 4,\n\tDiamonds = 5,\n}\n\nexport enum SAWBuyInTypeName {\n\tFree = 'free',\n\tPoints = 'points',\n\tSpins = 'spins',\n\tUnknown = 'unknown',\n\tGems = 'gems',\n\tDiamonds = 'diamonds',\n}\n\n/** @hidden */\nexport const SAWBuyInTypeNamed = (type: SAWBuyInType): SAWBuyInTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWBuyInType.Free]: SAWBuyInTypeName.Free,\n\t\t\t[SAWBuyInType.Points]: SAWBuyInTypeName.Points,\n\t\t\t[SAWBuyInType.Spins]: SAWBuyInTypeName.Spins,\n\t\t\t[SAWBuyInType.Gems]: SAWBuyInTypeName.Gems,\n\t\t\t[SAWBuyInType.Diamonds]: SAWBuyInTypeName.Diamonds,\n\t\t}[type] || SAWBuyInTypeName.Unknown\n\t);\n};\n","import { SAWBuyInType } from './SAWBuyInType';\nimport { SAWTemplate } from './SAWTemplate';\n\nclass SAWUtils {\n\tpublic static canPlay = (t: SAWTemplate, user_balances: {ach_points_balance: number, ach_gems_balance: number, ach_diamonds_balance: number}): boolean => {\n\t\tif (t === null || t === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch (t.saw_buyin_type_id) {\n\t\t\tcase SAWBuyInType.Free: {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcase SAWBuyInType.Spins: {\n\t\t\t\treturn t.spin_count !== null && t.spin_count > 0;\n\t\t\t}\n\t\t\tcase SAWBuyInType.Points:\n\t\t\tcase SAWBuyInType.Gems:\n\t\t\tcase SAWBuyInType.Diamonds: {\n\t\t\t\tlet balance = user_balances.ach_points_balance;\n\t\t\t\tif (t.saw_buyin_type_id === SAWBuyInType.Gems) {\n\t\t\t\t\tbalance = user_balances.ach_gems_balance;\n\t\t\t\t} else if (t.saw_buyin_type_id === SAWBuyInType.Diamonds) {\n\t\t\t\t\tbalance = user_balances.ach_diamonds_balance;\n\t\t\t\t}\n\t\t\t\treturn t.buyin_cost_points <= balance;\n\t\t\t}\n\t\t\t\n\t\t\tdefault: {\n\t\t\t\tconsole.error('MiniGamesUtils.canPlay: Unknwon SAW buyin type ' + t.saw_buyin_type_id);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport { SAWUtils };\n","export enum SAWAcknowledgeType {\n\tSilent = 1,\n\tQuickMessage = 2,\n\tFullMessage = 3,\n\tExplicityAcknowledge = 4\n}\n\nexport enum SAWAcknowledgeTypeName {\n\tSilent = 'silent',\n\tQuickMessage = 'quick-message',\n\tFullMessage = 'full-message',\n\tExplicityAcknowledge = 'explicity-acknowledge'\n}\n\n/** @hidden */\nexport const SAWAcknowledgeTypeNamed = (type: SAWAcknowledgeType): SAWAcknowledgeTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWAcknowledgeType.Silent]: SAWAcknowledgeTypeName.Silent,\n\t\t\t[SAWAcknowledgeType.QuickMessage]: SAWAcknowledgeTypeName.QuickMessage,\n\t\t\t[SAWAcknowledgeType.FullMessage]: SAWAcknowledgeTypeName.FullMessage,\n\t\t\t[SAWAcknowledgeType.ExplicityAcknowledge]: SAWAcknowledgeTypeName.ExplicityAcknowledge\n\t\t}[type]\n\t);\n};\n","export enum SAWAskForUsername {\n\tNOASK = 'no-ask',\n\tONSUMBIT = 'on-submit',\n}\n","export enum SAWGameType {\n\tSpinAWheel = 1,\n\tScratchCard = 2,\n\tMatchX = 3,\n\tGiftBox = 4,\n\tPrizeDrop = 5,\n\tQuiz = 6,\n\tLootboxWeekdays = 7,\n\tLootboxCalendarDays = 8,\n\tTreasureHunt = 9,\n\tVoyager = 10,\n\tPlinko = 11,\n\tCoinFlip = 12,\n\tCustomMinigame = 13,\n}\n\nexport enum SAWGameTypeName {\n\tSpinAWheel = 'wheel',\n\tScratchCard = 'scratch',\n\tMatchX = 'matchx',\n\tGiftBox = 'giftbox',\n\tPrizeDrop = 'prizedrop',\n\tQuiz = 'quiz',\n\tLootboxWeekdays = 'lootbox_weekdays',\n\tLootboxCalendarDays = 'lootbox_calendar_days',\n\tTreasureHunt = 'treasure_hunt',\n\tVoyager = 'voyager',\n\tPlinko = 'plinko',\n\tCoinFlip = 'coin_flip',\n\tCustomMinigame = 'custom_minigame',\n\tUnknown = 'unknown',\n}\n\n/** @hidden */\nexport const SAWGameTypeNamed = (type: SAWGameType): SAWGameTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWGameType.SpinAWheel]: SAWGameTypeName.SpinAWheel,\n\t\t\t[SAWGameType.ScratchCard]: SAWGameTypeName.ScratchCard,\n\t\t\t[SAWGameType.MatchX]: SAWGameTypeName.MatchX,\n\t\t\t[SAWGameType.GiftBox]: SAWGameTypeName.GiftBox,\n\t\t\t[SAWGameType.PrizeDrop]: SAWGameTypeName.PrizeDrop,\n\t\t\t[SAWGameType.Quiz]: SAWGameTypeName.Quiz,\n\t\t\t[SAWGameType.LootboxWeekdays]: SAWGameTypeName.LootboxWeekdays,\n\t\t\t[SAWGameType.LootboxCalendarDays]: SAWGameTypeName.LootboxCalendarDays,\n\t\t\t[SAWGameType.TreasureHunt]: SAWGameTypeName.TreasureHunt,\n\t\t\t[SAWGameType.Voyager]: SAWGameTypeName.Voyager,\n\t\t\t[SAWGameType.Plinko]: SAWGameTypeName.Plinko,\n\t\t\t[SAWGameType.CoinFlip]: SAWGameTypeName.CoinFlip,\n\t\t\t[SAWGameType.CustomMinigame]: SAWGameTypeName.CustomMinigame,\n\t\t}[type] || SAWGameTypeName.Unknown\n\t);\n};\n","export enum SAWExposeUserSpinId {\n    UserId = 1,\n    SpinId = 2,\n}\n\nexport enum SAWExposeUserSpinIdName {\n    UserId = 'userId',\n    SpinId = 'spinId',\n}\n\n/** @hidden */\nexport const SAWExposeUserSpinIdNamed = (id: SAWExposeUserSpinId): SAWExposeUserSpinIdName => {\n    return (\n        {\n            [SAWExposeUserSpinId.UserId]: SAWExposeUserSpinIdName.UserId,\n            [SAWExposeUserSpinId.SpinId]: SAWExposeUserSpinIdName.SpinId,\n        }[id]\n    );\n};","export enum SAWGameLayout {\n    Horizontal = 1,\n    VerticalMap = 2,\n}\n\nexport enum SAWGameLayoutName {\n    Horizontal = 'horizontal',\n    VerticalMap = 'vertical-map',\n}\n\n/** @hidden */\nexport const SAWGameLayoutNamed = (layout: SAWGameLayout): SAWGameLayoutName => {\n    return (\n        {\n            [SAWGameLayout.Horizontal]: SAWGameLayoutName.Horizontal,\n            [SAWGameLayout.VerticalMap]: SAWGameLayoutName.VerticalMap,\n        }[layout]\n    );\n};","export enum SAWPrizeType {\n\tNO_PRIZE = 1,\n\tPOINTS = 2,\n\tBONUS = 3,\n\tMANUAL = 4,\n\tSPIN = 5,\n\tJACKPOT = 6,\n\tCHANGE_LEVEL = 7,\n\tMISSION = 8,\n\tRAFFLE_TICKET = 9,\n\tGEMS_AND_DIAMONDS = 10,\n}\n\nexport enum MiniGamePrizeTypeName {\n\tNO_PRIZE = 'no-prize',\n\tPOINTS = 'points',\n\tBONUS = 'bonus',\n\tMANUAL = 'manual',\n\tSPIN = 'spin',\n\tJACKPOT = 'jackpot',\n\tCHANGE_LEVEL = 'change-level',\n\tMISSION = 'mission',\n\tRAFFLE_TICKET = 'raffle-ticket',\n\tGEMS_AND_DIAMONDS = 'gems-and-diamonds',\n\tUNKNOWN = 'unknown',\n}\n\n/** @hidden */\nexport const MiniGamePrizeTypeNamed = (type: SAWPrizeType): MiniGamePrizeTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWPrizeType.NO_PRIZE]: MiniGamePrizeTypeName.NO_PRIZE,\n\t\t\t[SAWPrizeType.POINTS]: MiniGamePrizeTypeName.POINTS,\n\t\t\t[SAWPrizeType.BONUS]: MiniGamePrizeTypeName.BONUS,\n\t\t\t[SAWPrizeType.MANUAL]: MiniGamePrizeTypeName.MANUAL,\n\t\t\t[SAWPrizeType.SPIN]: MiniGamePrizeTypeName.SPIN,\n\t\t\t[SAWPrizeType.JACKPOT]: MiniGamePrizeTypeName.JACKPOT,\n\t\t\t[SAWPrizeType.CHANGE_LEVEL]: MiniGamePrizeTypeName.CHANGE_LEVEL,\n\t\t\t[SAWPrizeType.MISSION]: MiniGamePrizeTypeName.MISSION,\n\t\t\t[SAWPrizeType.RAFFLE_TICKET]: MiniGamePrizeTypeName.RAFFLE_TICKET,\n\t\t\t[SAWPrizeType.GEMS_AND_DIAMONDS]: MiniGamePrizeTypeName.GEMS_AND_DIAMONDS,\n\t\t}[type] || MiniGamePrizeTypeName.UNKNOWN\n\t);\n};\n","import { IntUtils } from '../IntUtils';\nimport { TMiniGamePrize, TMiniGameTemplate } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from './../Base/ProtocolResponse';\nimport { SAWAcknowledgeTypeNamed } from './SAWAcknowledgeType';\nimport { SAWBuyInType, SAWBuyInTypeNamed } from './SAWBuyInType';\nimport { SAWExposeUserSpinIdNamed } from './SAWExposeUserSpinId';\nimport { SAWGameLayoutNamed } from './SAWGameLayout';\nimport { SAWGameType, SAWGameTypeNamed } from './SAWGameType';\nimport { MiniGamePrizeTypeNamed } from './SAWPrizeType';\nimport { SAWTemplate } from './SAWTemplate';\n\nexport interface SAWGetTemplatesResponse extends ProtocolResponse {\n\ttemplates: SAWTemplate[];\n}\n\nexport const SAWTemplatesTransform = (items: SAWTemplate[]): TMiniGameTemplate[] => {\n\treturn items.map((r) => {\n\t\tconst x: TMiniGameTemplate = {\n\t\t\tid: r.saw_template_id,\n\t\t\tname: r.saw_template_ui_definition.name,\n\t\t\tdescription: r.saw_template_ui_definition.description,\n\t\t\tthumbnail: r.saw_template_ui_definition.thumbnail\n\t\t\t? r.saw_template_ui_definition.thumbnail\n\t\t\t: r.saw_skin_ui_definition?.skin_folder\n\t\t\t\t? `${r.saw_skin_ui_definition.skin_folder}/ico.png`\n\t\t\t\t: `https://d312ucx3huj7iy.cloudfront.net/gf/images/saw/${r.saw_skin_key}/ico.png`,\n\t\t\tvisibile_when_can_spin: r.visibile_when_can_spin,\n\t\t\tover_limit_message: r.saw_template_ui_definition.over_limit_message,\n\t\t\tno_attempts_message: r.saw_template_ui_definition.no_attempts_message,\n\t\t\tjackpot_symbol: r.saw_template_ui_definition.jackpot_symbol,\n\t\t\tsaw_game_type: SAWGameTypeNamed(r.saw_game_type_id),\n\t\t\tsaw_buyin_type: SAWBuyInTypeNamed(r.saw_buyin_type_id),\n\t\t\t...(r.saw_buyin_type_id === SAWBuyInType.Points ? { buyin_cost_points: r.buyin_cost_points } : {}),\n\t\t\t...(r.saw_buyin_type_id === SAWBuyInType.Gems ? { buyin_cost_gems: r.buyin_cost_points } : {}),\n\t\t\t...(r.saw_buyin_type_id === SAWBuyInType.Diamonds ? { buyin_cost_diamonds: r.buyin_cost_points } : {}),\n\t\t\tjackpot_add_on_attempt: r.jackpot_add_on_attempt,\n\t\t\tjackpot_current: r.jackpot_current,\n\t\t\tspin_count: r.spin_count,\n\t\t\tpromo_image: r.saw_template_ui_definition.promo_image,\n\t\t\tpromo_text: r.saw_template_ui_definition.promo_text,\n\t\t\tcustom_data: IntUtils.JsonOrText(r.saw_template_ui_definition.custom_data),\n\t\t\texpose_game_stat_on_api: r.expose_game_stat_on_api,\n\t\t\trelative_period_timezone: r.relative_period_timezone,\n\t\t\tactiveFromDate: r.activeFromDate,\n\t\t\tactiveTillDate: r.activeTillDate,\n\t\t\tnext_available_spin_ts: r.next_available_spin_ts,\n\t\t\tearliest_expiration_dt: r.earliest_expiration_dt,\n\t\t\tlatest_expiration_dt: r.latest_expiration_dt,\n\t\t\tsteps_to_finish_game: r.saw_template_ui_definition.steps_to_finish_game,\n\t\t\tmin_steps_to_finish_game: r.saw_template_ui_definition.min_steps_to_finish_game,\n\t\t\tcustom_section_id: r.saw_template_ui_definition.custom_section_id,\n\t\t\tsaw_template_ui_definition: r.saw_template_ui_definition,\n\t\t\t...(r.saw_game_type_id === SAWGameType.LootboxCalendarDays || r.saw_game_type_id === SAWGameType.LootboxWeekdays\n\t\t\t\t? { game_layout: SAWGameLayoutNamed(r.saw_template_ui_definition.game_layout) }\n\t\t\t\t: {}\n\t\t\t),\n\t\t\tshow_prize_history: r.show_prize_history,\n\t\t\tmax_number_of_attempts: r.maxSpinsCount,\n\t\t\tmax_spins_period_ms: r.maxSpinsPediodMs,\n\t\t\t...(r.saw_template_ui_definition.expose_user_spin_id\n\t\t\t\t? { expose_user_spin_id: SAWExposeUserSpinIdNamed(r.saw_template_ui_definition.expose_user_spin_id) } \n\t\t\t\t: {}),\n\n\t\t\tprizes: r.prizes.map((p) => {\n\t\t\t\tconst y: TMiniGamePrize = {\n\t\t\t\t\tid: p.saw_prize_id,\n\t\t\t\t\tname: p.saw_prize_ui_definition.name,\n\t\t\t\t\tprize_type: MiniGamePrizeTypeNamed(p.prize_type_id),\n\t\t\t\t\tprize_value: p.prize_value,\n\t\t\t\t\tfont_size: p.saw_prize_ui_definition.font_size,\n\t\t\t\t\tfont_size_mobile: p.saw_prize_ui_definition.font_size_mobile,\n\t\t\t\t\ticon: p.saw_prize_ui_definition.icon,\n\t\t\t\t\tposition: p.saw_prize_ui_definition.position,\n\t\t\t\t\tsectors: p.saw_prize_ui_definition.sectors,\n\t\t\t\t\tacknowledge_type: SAWAcknowledgeTypeNamed(p.saw_prize_ui_definition.acknowledge_type),\n\t\t\t\t\taknowledge_message: p.saw_prize_ui_definition.aknowledge_message,\n\t\t\t\t\taknowledge_message_lose: p.saw_prize_ui_definition.aknowledge_message_lose,\n\t\t\t\t\tacknowledge_dp: p.saw_prize_ui_definition.acknowledge_dp,\n\t\t\t\t\tacknowledge_action_title: p.saw_prize_ui_definition.acknowledge_action_title,\n\t\t\t\t\tacknowledge_dp_additional: p.saw_prize_ui_definition.acknowledge_dp_additional,\n\t\t\t\t\tacknowledge_action_title_additional: p.saw_prize_ui_definition.acknowledge_action_title_additional,\n\t\t\t\t\tsecond_btn: p.saw_prize_ui_definition.second_btn,\n\t\t\t\t\tsecond_btn_action_title: p.saw_prize_ui_definition.second_btn_action_title,\n\t\t\t\t\tout_of_stock_message: p.saw_prize_ui_definition.out_of_stock_message,\n\t\t\t\t\tpool: p.pool,\n\t\t\t\t\tpool_initial: p.pool_initial,\n\t\t\t\t\twins_count: p.wins_count,\n\t\t\t\t\tweekdays: p.weekdays,\n\t\t\t\t\tactive_from_ts: p.active_from_ts,\n\t\t\t\t\tactive_till_ts: p.active_till_ts,\n\t\t\t\t\trelative_period_timezone: p.relative_period_timezone,\n\t\t\t\t\tis_surcharge: p.is_surcharge,\n\t\t\t\t\tis_deleted: p.is_deleted,\n\t\t\t\t\tcustom_data: IntUtils.JsonOrText(p.saw_prize_ui_definition?.custom_data),\n\t\t\t\t\tprize_modifiers: p.saw_prize_ui_definition.prize_modifiers,\n\t\t\t\t\tallow_split_decimal: p.saw_prize_ui_definition.allow_split_decimal,\n\t\t\t\t\thide_prize_from_history: p.saw_prize_ui_definition.hide_prize_from_history,\n\t\t\t\t\trequirements_to_get_prize: p.saw_prize_ui_definition.requirements_to_get_prize,\n\t\t\t\t\tmax_give_period_type_id: p.max_give_period_type_id,\n\t\t\t\t};\n\t\t\t\treturn y;\n\t\t\t}),\n\t\t};\n\t\treturn x;\n\t});\n};\n","/*\n *  Possible error codes for the mini-games attempts\n */\nexport enum SAWSpinErrorCode {\n\t/** No error */\n\tSAW_OK = 0,\n\t/** User doesn't have 'spin attempts' to play. In case buy in type for the game is 'spins' based */\n\tSAW_NO_SPINS = 40001,\n\t/** The are no prizes left to play the game */\n\tSAW_PRIZE_POOL_EMPTY = 40002,\n\t/** User doesn't have enough points to play. In case buy in type for the game is 'points' based */\n\tSAW_NOT_ENOUGH_POINTS = 40003,\n\t/** User reached max number of game attempts defined in the BackOffice */\n\tSAW_FAILED_MAX_SPINS_REACHED = 40004,\n\t/** User tries to play a template that is restricted by date */\n\tSAW_TEMPLATE_NOT_ACTIVE = 40007,\n\t/** Special code for the 'visitor' mode */\n\tSAW_VISITOR_STOP_SPIN_REQUEST = -40001,\n\t/** User is not in the segment */\n\tSAW_NOT_IN_SEGMENT = 40009,\n\t/** User doesn't have enough gems to play. In case buy in type for the game is 'gems' based */\n\tSAW_NO_BALANCE_GEMS = 40011,\n\t/** User doesn't have enough diamonds to play. In case buy in type for the game is 'diamonds' based */\n\tSAW_NO_BALANCE_DIAMONDS = 40012,\n}\n","export enum SAWWinSoundType {\n\tDisappointing = 1,\n\tPositive = 2,\n\tHighlyPositive = 3,\n\tNoSound = 4,\n\tCustom = 5,\n}\n\nexport const SAWWinSoundFiles = {\n\t[SAWWinSoundType.NoSound]: null,\n\t[SAWWinSoundType.Disappointing]: 'saw-disappointed.m4a',\n\t[SAWWinSoundType.Positive]: 'saw-positive.m4a',\n\t[SAWWinSoundType.HighlyPositive]: 'saw-highly-positive.m4a',\n};\n","import { ProtocolResponse } from \"../SmarticoLib\";\nimport { TSawHistory } from \"../WSAPI/WSAPITypes\";\nimport { SAWTemplate } from \"./SAWTemplate\";\n\nexport interface SAWWinningHistoryResponse extends ProtocolResponse {\n\tprizes: SAWPrizesHistory[];\n\thasMore: boolean;\n}\n\nexport interface SAWPrizesHistory {\n\ttemplate: SAWTemplate,\n\tsaw_template_id: number,\n\tsaw_prize_id: number,\n\tprize_amount: number,\n\tclient_request_id: string,\n\tis_claimed: boolean,\n\tcreate_date_ts: number;\n\tacknowledge_date_ts: number;\n}\n\nexport const SAWHistoryTransform = (items: SAWPrizesHistory[]): TSawHistory[] => {\n\treturn items.map((r) => {\n\t\tconst x: TSawHistory = {\n\t\t\ttemplate: r.template,\n\t\t\tsaw_template_id: r.saw_template_id,\n\t\t\tsaw_prize_id: r.saw_prize_id,\n\t\t\tprize_amount: r.prize_amount,\n\t\t\tclient_request_id: r.client_request_id,\n\t\t\tis_claimed: r.is_claimed,\n\t\t\tcreate_date_ts: r.create_date_ts,\n\t\t\tacknowledge_date_ts: r.acknowledge_date_ts,\n\t\t}\n\t\treturn x;\n\t})\n}\n\n","export enum PrizeModifiers {\n    '2x' = 1,\n    '5x' = 2,\n    '10x' = 3,\n    '/2' = 4,\n    '/5' = 5,\n    '/10' = 6,\n    '0x' = 7,\n    \"reset\" = 8,\n}\n\nexport const PrizeModifiersKeysNames = {\n    [PrizeModifiers['2x']]: '2x',\n    [PrizeModifiers['5x']]: '5x',\n    [PrizeModifiers['10x']]: '10x',\n    [PrizeModifiers['/2']]: '/2',\n    [PrizeModifiers['/5']]: '/5',\n    [PrizeModifiers['/10']]: '/10',\n    [PrizeModifiers['0x']]: '0',\n    [PrizeModifiers['reset']]: 'Reset to 0',\n};","export enum SAWWheelLayout {\n    Centered = 1,\n    LeftAligned = 2,\n    RightAligned = 3,\n    BottomAligned = 4,\n}","export enum SAWGameDifficultyType {\n\tEASY = 1,\n\tMEDIUM = 2,\n\tHARD = 3,\n}\n\nexport enum SAWGameDifficultyTypeName {\n\tEASY = 'easy',\n\tMEDIUM = 'medium',\n\tHARD = 'hard',\n}\n\n/** @hidden */\nexport const SawGameDifficultyTypeNamed = (type: SAWGameDifficultyType): SAWGameDifficultyTypeName => {\n\treturn (\n\t\t{\n\t\t\t[SAWGameDifficultyType.EASY]: SAWGameDifficultyTypeName.EASY,\n\t\t\t[SAWGameDifficultyType.MEDIUM]: SAWGameDifficultyTypeName.MEDIUM,\n\t\t\t[SAWGameDifficultyType.HARD]: SAWGameDifficultyTypeName.HARD,\n\t\t}[type]\n\t);\n};\n","export enum AttemptPeriodType {\n\tFromLastAttempt = 1,\n\tCalendarDaysUTC = 2,\n\tCalendarDaysUserTimeZone = 3,\n\tLifetime = 4,\n}","class NodeCache {\n\tprivate ttlChecker: NodeJS.Timeout;\n\n\tprivate cache: { [key: string]: any } = {};\n\n\tconstructor() {\t\t\n\t\tif (this.ttlChecker === undefined) {\n\t\t\tthis.ttlChecker = setInterval(() => {\n\t\t\t\tconst now = new Date().getTime();\n\t\t\t\tfor (const key in this.cache) {\n\t\t\t\t\tif (this.cache.hasOwnProperty(key)) {\n\t\t\t\t\t\tconst o = this.cache[key];\n\t\t\t\t\t\tif (o.ttl < now) {\n\t\t\t\t\t\t\tdelete this.cache[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\t}\n\n\tpublic get(key: string): any {\n\t\tconst o = this.cache[key];\n\t\tif (o !== undefined && o.ttl > new Date().getTime()) {\n\t\t\treturn o.value;\n\t\t}\n\t}\n\n\tpublic set(key: string, value: any, ttlSeconds: number = 60) {\n\t\tthis.cache[key] = {\n\t\t\tvalue,\n\t\t\tttl: new Date().getTime() + ttlSeconds * 1000,\n\t\t};\n\t}\n\n\tpublic remove(key: string) {\n\t\tif (this.cache.hasOwnProperty(key)) {\n\t\t\tdelete this.cache[key];\n\t\t}\n\t}\n\n\tpublic removeByPrefix(prefix: string) {\n\t\tfor (const key in this.cache) {\n\t\t\tif (this.cache.hasOwnProperty(key) && key.indexOf(prefix) === 0) {\n\t\t\t\tdelete this.cache[key];\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic flushAll() {\n\t\tthis.cache = {};\n\t\tif (this.ttlChecker) {\n\t\t\tclearInterval(this.ttlChecker);\n\t\t\tthis.ttlChecker = undefined\n\t\t}\n\t}\n}\n\nexport { NodeCache };\n","import { NodeCache } from './NodeCache';\n\nexport enum ECacheContext {\n\tTranslations,\n\tLabelInfo,\n\tWSAPI,\n}\n\nconst WITH_REF_CACHE = [ECacheContext.Translations];\n\nexport class OCache {\n\tprivate static cache: { [key: string]: NodeCache } = {};\n\n\tprivate static init(cacheContext: ECacheContext) {\n\t\tif (this.cache[cacheContext] === undefined) {\n\t\t\tthis.cache[cacheContext] = new NodeCache();\n\t\t}\n\t}\n\n\tpublic static get<T>(oKey: any, cacheContext: ECacheContext): T | undefined {\n\t\tconst key = cacheContext.toString() + '_' + JSON.stringify(oKey);\n\n\t\tthis.init(cacheContext);\n\n\t\treturn deepClone(this.cache[cacheContext].get(key));\n\t}\n\n\tpublic static set(oKey: any, o: any, cacheContext: ECacheContext, ttlSeconds: number = 60) {\n\t\tconst key = cacheContext.toString() + '_' + JSON.stringify(oKey);\n\n\t\tthis.init(cacheContext);\n\n\t\tthis.cache[cacheContext].set(key, deepClone(o), ttlSeconds);\n\t}\n\n\tpublic static async use<T>(oKey: any, cacheContext: ECacheContext, f: () => Promise<T>, ttlSeconds: number = 60) {\n\t\tif (ttlSeconds <= 0) {\n\t\t\treturn await f();\n\t\t} else {\n\t\t\tlet o: T = OCache.get(oKey, cacheContext);\n\n\t\t\tif (o === undefined) {\n\t\t\t\to = await f();\n\t\t\t\tOCache.set(oKey, o, cacheContext, ttlSeconds);\n\t\t\t}\n\n\t\t\treturn o;\n\t\t}\n\t}\n\n\tpublic static async clear(cacheContext: ECacheContext, oKey: any) {\n\t\tconst key = cacheContext.toString() + '_' + JSON.stringify(oKey);\n\n\t\tif (this.cache[cacheContext]) {\n\t\t\tthis.cache[cacheContext].remove(key);\n\t\t}\n\t}\n\n\t/**\n\t * Remove every entry whose string key starts with `oKeyBase` — the bare key\n\t * AND all per-parameter composite variants (`${oKeyBase}:…` / `${oKeyBase}<id>`).\n\t * Use when a cache is keyed per parameter (paginated, per-template, per-window):\n\t * an exact-key `clear(oKeyBase)` would miss every variant. `oKeyBase` must be a string.\n\t */\n\tpublic static async clearByPrefix(cacheContext: ECacheContext, oKeyBase: string) {\n\t\t// `set`/`get` build keys as `<context>_<JSON.stringify(oKey)>`; JSON.stringify\n\t\t// wraps a string in quotes, so dropping the trailing quote yields a prefix that\n\t\t// matches both the bare `\"base\"` key and every `\"base…\"` composite key.\n\t\tconst prefix = cacheContext.toString() + '_' + JSON.stringify(oKeyBase).slice(0, -1);\n\n\t\tif (this.cache[cacheContext]) {\n\t\t\tthis.cache[cacheContext].removeByPrefix(prefix);\n\t\t}\n\t}\n\n\tpublic static async clearContext(cacheContext: ECacheContext) {\n\t\tif (this.cache[cacheContext]) {\n\t\t\tthis.cache[cacheContext].flushAll();\n\t\t}\n\t}\n\n\tpublic static async clearAll() {\n\t\tfor (const cacheContext in this.cache) {\n\t\t\tif (this.cache.hasOwnProperty(cacheContext)) {\n\t\t\t\tthis.cache[cacheContext].flushAll();\n\t\t\t}\n\t\t}\n\t\tthis.cache = {};\n\t}\n}\n\nconst deepClone = (o: any) => {\n\tif (o) {\n\t\treturn JSON.parse(JSON.stringify(o));\n\t}\n\n\treturn o;\n};\n","export enum ActivityTypeLimited {\n\tDoNothing = 8,\n\tPoints = 12,\n\tGiveMission = 14,\n\tStartAnotherCampaign = 15,\n\tMiniGameAttempt = 16,\n\tDeductPoints = 21,\n\tResetPoints = 22,\n\tAddGemsAndDiamonds = 25,\n\tDeductGemsAndDiamonds = 26,\n\tResetGemsAndDiamonds = 27,\n\tPopup = 30,\n\tInbox = 31,\n\tSlack = 70,\n\tEmail_To_Customer_Support = 80,\n\tEmail_To_Risk_Operator = 90,\n\tBonus = 100,\n\tWebHook = 200,\n\tTagCustomer = 504,\n\tUnTagCustomer = 505,\n}\n","class CoreUtils {\n\tpublic static avatarUrl = (avatar_id: string, avatarDomain: string): string => {\n\t\tif (\n\t\t\tavatarDomain &&\n\t\t\tavatar_id !== null &&\n\t\t\tavatar_id !== undefined &&\n\t\t\t!(avatar_id.startsWith && avatar_id.startsWith('http'))\n\t\t) {\n\t\t\tif (avatarDomain.endsWith('/')) {\n\t\t\t\treturn avatarDomain.slice(0, -1) + '/avatar/' + avatar_id;\n\t\t\t} else {\n\t\t\t\treturn avatarDomain + '/avatar/' + avatar_id;\n\t\t\t}\n\t\t} else {\n\t\t\treturn avatar_id;\n\t\t}\n\t};\n\n\tpublic static currencySymbol(currency: string) {\n\t\treturn {\n\t\t\t[currency?.toUpperCase()]: currency?.toUpperCase(),\n\t\t\tUSD: '$', // United States Dollar\n\t\t\tEUR: '\\u20AC', // Euro\n\t\t\tJPY: '\\u00A5', // Japanese Yen\n\t\t\tGBP: '\\u00A3', // British Pound Sterling\n\t\t\tAUD: 'A$', // Australian Dollar\n\t\t\tCAD: 'C$', // Canadian Dollar\n\t\t\tCHF: 'CHF', // Swiss Franc\n\t\t\tCNY: '\\u00A5', // Chinese Yuan\n\t\t\tSEK: 'kr', // Swedish Krona\n\t\t\tNZD: 'NZ$', // New Zealand Dollar\n\t\t\tMXN: 'MX$', // Mexican Peso\n\t\t\tSGD: 'S$', // Singapore Dollar\n\t\t\tHKD: 'HK$', // Hong Kong Dollar\n\t\t\tNOK: 'kr', // Norwegian Krone\n\t\t\tKRW: '\\u20A9', // South Korean Won\n\t\t\tTRY: '\\u20BA', // Turkish Lira\n\t\t\tINR: '\\u20B9', // Indian Rupee\n\t\t\tRUB: '\\u20BD', // Russian Ruble\n\t\t\tBRL: 'R$', // Brazilian Real\n\t\t\tZAR: 'R', // South African Rand\n\t\t}[currency?.toUpperCase()];\n\t}\n}\n\nexport { CoreUtils };\n","export enum PublicLabelSettings {\n\tPUBLIC_API_URL = 'PUBLIC_API_URL',\n\tRECORDING_ENABLED_FOR_ALL_USERS = 'RECORDING_ENABLED_FOR_ALL_USERS',\n\tJS_INJECTION = 'JS_INJECTION',\n\tGAMIFICATION_UI_MAIN = 'GAMIFICATION_UI_MAIN',\n\tGAMIFICATION_UI_WIDGET = 'GAMIFICATION_UI_WIDGET',\n\tGAMIFICATION_UI_MINI_GAME = 'GAMIFICATION_UI_MINI_GAME',\n\tGAMIFICATION_UI_SETTINGS = 'GAMIFICATION_UI_SETTINGS',\n\tGAMIFICATION_UI_MAIN_TEST = 'GAMIFICATION_UI_MAIN_TEST',\n\tGAMIFICATION_UI_WIDGET_TEST = 'GAMIFICATION_UI_WIDGET_TEST',\n\tGAMIFICATION_UI_SETTINGS_TEST = 'GAMIFICATION_UI_SETTINGS_TEST',\n\tFRONT_END_ALLOWED_LANGUAGES = 'FRONT_END_ALLOWED_LANGUAGES',\n\tFRONT_END_ALLOW_DOMAINS = 'FRONT_END_ALLOW_DOMAINS',\n\tDELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS = 'DELAY_ENGAGEMENT_EXECUTION_ON_LOGIN_MS',\n\tSHADOW_LABEL_PUBLIC_KEY = 'SHADOW_LABEL_PUBLIC_KEY',\n\tDYNAMIC_IMAGE_DOMAIN = 'DYNAMIC_IMAGE_DOMAIN',\n\n\tGAMIFICATION_LEVELS_LOGIC2 = 'GAMIFICATION_LEVELS_LOGIC2',\n\tGAMIFICATION_LEVELS_LOGIC3 = 'GAMIFICATION_LEVELS_LOGIC2',\n\n\tAVATAR_CUSTOM_IMAGE_MAX_ID = 'AVATAR_CUSTOM_IMAGE_MAX_ID',\n\tAVATAR_CUSTOM_IMAGE_FOLDER = 'AVATAR_CUSTOM_IMAGE_FOLDER',\n\n\tGAMIFICATION_SHOW_POWERED_BY = 'GAMIFICATION_SHOW_POWERED_BY',\n\t_system_leader_board_mask_username = '_system_leader_board_mask_username',\n\t_system_gamification_mask_username = '_system_gamification_mask_username',\n\n\tINBOX_PUBLIC_CDN = 'INBOX_PUBLIC_CDN',\n}\n","enum TranslationArea {\n\tCasino = 1,\n\tGamification = 2,\n\tTrading = 3,\n\tArchived = 4,\n\tAffiliation = 5,\n\tRetentionGames = 6,\n\tAffIliateAdminNew = 7,\n\tAcademy = 8,\n}\n\nexport { TranslationArea };\n","import { TInboxMessage } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { InboxMessage } from './InboxMessage';\n\nexport interface GetInboxMessagesResponse extends ProtocolResponse {\n\tlog: InboxMessage[];\n\tunread_count: number;\n}\n\nexport const InboxMessagesTransform = (items: InboxMessage[]): TInboxMessage[] => {\n\treturn items.map((item) => {\n\t\tconst x: TInboxMessage = {\n\t\t\tsent_date: item.createDate,\n\t\t\tmessage_guid: item.engagement_uid,\n\t\t\tread: item.is_read,\n\t\t\tfavorite: item.is_starred,\n\t\t\tcategory_id: item.category_id,\n\t\t\texpire_on_dt: item.expire_on_dt,\n\t\t};\n\t\treturn x;\n\t});\n};\n","import { IntUtils } from '../IntUtils';\nimport { TInboxMessageBody } from '../WSAPI/WSAPITypes';\nimport { InboxCategories } from './InboxCategories';\nimport { InboxMessageType } from './InboxMessageType';\nimport { OpenLinksType } from './OpenLinksType';\n\nexport interface InboxMessageBody {\n\t// URL or deep-link that neeed to be executed when user clicks on the message\n\taction: string;\n\t// the body of the message in case it's 'simple' inbox message\n\tbody: string;\n\t// type of message, deprecated\n\ttype: InboxMessageType;\n\t// image of the icon\n\timage: string;\n\t// title of the message\n\ttitle: string;\n\t// HTML body of the message in case it's 'rich' inbox message\n\thtml_body: string;\n\t// set of the buttons with text on the button and action that could be URL or deep-link\n\tadditional_buttons?: { inbox_cta_text: string; action: string }[];\n\t// indicator if the message need to be shown when sent and overlay or it should be shown only in the inbox, when user open 'inbox' interface explicitly\n\t// default is 'true'\n\tshow_preview?: boolean;\n\t// duration in seconds for how long to show preview, default is 7 seconds\n\tshow_duration_sec?: number;\n\t// indicator if the image in html_body can be zoomed out\n\t// default is 'false'\n\tenable_zoom_mode?: boolean;\n\t// options that allows to open links in buttons either in new window or in the current one\n\topen_links?: OpenLinksType;\n\t// The custom data of the inbox message defined by operator. Can be a JSON object, string or number\n\tcustom_data?: string;\n}\n\nexport interface InboxMessage {\n\t// date when the message was created\n\tcreateDate: string;\n\t// body of the message according to the interface\n\tbody: InboxMessageBody;\n\t// unique identifier of the message that connects it to the campaign from which it was sent\n\tengagement_uid: string;\n\t// flag that indicates if the message was read by the user\n\tis_read: boolean;\n\t// flag that indicates if the message was marked as favorite by the user\n\tis_starred: boolean;\n\t// flag that indicates if the message was deleted by the user. Such messages are not returned in the response and property is used only internaly in Smartico\n\tis_deleted?: boolean;\n\t// category id of the inbox message, could be categorized as System/Personal/General messages in mentioned tabs\n\tcategory_id?: InboxCategories;\n\t// The epoch timestamp, with milliseconds, when the message is going to be expired \n\texpire_on_dt?: number;\n}\n\nexport const InboxMessageBodyTransform = (item: InboxMessageBody): TInboxMessageBody => {\n\tif (!item) {\n\t\treturn null;\n\t}\n\tconst x: TInboxMessageBody = {\n\t\taction: item.action,\n\t\ticon: item.image,\n\t\ttitle: item.title,\n\t\tpreview_body: item.body,\n\t\tcustom_data: IntUtils.JsonOrText(item?.custom_data),\n\t};\n\n\tif (item.action === 'dp:inbox') {\n\t\tif (item.additional_buttons && item.additional_buttons.length) {\n\t\t\tx.buttons = item.additional_buttons.map((b) => ({\n\t\t\t\taction: b.action,\n\t\t\t\ttext: b.inbox_cta_text,\n\t\t\t}));\n\t\t}\n\n\t\tx.html_body = item?.html_body || null;\n\t}\n\n\treturn x;\n};\n","export enum InboxMessageType {\n\tCustom = 0,\n\tMissionCompleted = 1,\n\tMissionUnlocked = 2,\n\tLeaderboardWon = 3,\n\tLevelChanged = 4,\n\tBonusGiven = 5,\n\tPointsAdded = 6,\n\tPointsUsed = 7,\n\tPersonalMessage = 8,\n}\n\n// keep in sync with BO enum\n","export enum OpenLinksType {\n\tNewWindow = 1,\n\tCurrentWindow = 2\n}","export enum InboxCategories {\n    General = 0,\n\tPlatform = 1,\n\tPersonal = 2,\n}","export enum InboxReadStatus {\n\tUnreadOnly = 1,\n\tReadOnly = 2,\n}","export enum BuyStoreItemErrorCode {\n\t/** Generic server error / control-group rejection */\n\tSHOP_FAILED_GENERIC = 1,\n\t/** Label mismatch detected before purchase transaction */\n\tSHOP_WRONG_LABEL_PRECHECK = 106,\n\t/** User don't have enough points on balance */\n\tSHOP_NO_BALANCE = 11000,\n\t/** Wrong shop item id */\n\tSHOP_WRONG_LABEL = 11001,\n\t/** Failed to buy bonus item, probably something wrong with the bonus configuration. */\n\tSHOP_FAILED_TO_BUY_BONUS = 11002, // remote product restriction\n\t/** Failed to buy store item because segment conditions are set by operator for specific CRM item */\n\tSHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION = 11003, // when not visible but trying to buy. shouldn't happen\n\t/**  Segment conditions are set by operator for specific CRM item and user not matching to this conditions */\n\tSHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE = 11004, // when visible but not matching to purchase segment\n\t/** Failed to buy matching bonus item */\n\tSHOP_FAILED_TO_BUY_MATCHING_BONUS = 11005,\n\t/** Failed to buy item because of limit of max items is reached */\n\tSHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED = 11006,\n\t/** Bonus was issued but a follow-up redemption step failed */\n\tSHOP_FAILED_BONUS_REDEMPTION = 11007,\n\t/** Failed to buy item because no more items are available */\n\tSHOP_FAILED_POOL_EMPTY = 11009,\n\t/** User doesn't have enough gems on balance */\n\tSHOP_NO_BALANCE_GEMS = 11011,\n\t/** User doesn't have enough diamonds on balance */\n\tSHOP_NO_BALANCE_DIAMONDS = 11012,\n\t/** Failed to buy item because of purchase limitation */\n\tSHOP_FAILED_PURCHASE_LIMITATION = 11014,\n\t/** Uncaught server exception */\n\tSHOP_UNEXPECTED_EXCEPTION = 9999,\n}\n","import { TStoreCategory } from '../WSAPI/WSAPITypes';\nimport { StoreCategoryPublicMeta } from './StoreCategoryPublicMeta';\n\nexport interface StoreCategory {\n\tid?: number;\n\tpublicMeta?: StoreCategoryPublicMeta;\n}\n\nexport const StoreCategoryTransform = (items: StoreCategory[]): TStoreCategory[] => {\n\treturn items.map((r) => {\n\t\tconst x: TStoreCategory = {\n\t\t\tid: r.id,\n\t\t\tname: r.publicMeta?.name,\n\t\t\torder: r.publicMeta?.order,\n\t\t};\n\t\treturn x;\n\t});\n};\n","export enum StoreItemPurchaseType {\n    Points = 0,\n    Gems = 1,\n    Diamonds = 2,\n}","export enum StoreItemType {\n\tBonus = 1,\n\tTangible = 2,\n\tMiniGameSpin = 3,\n\tChangeLevel = 4,\n\tPrizeDrop = 5,\n\tRaffleTicket = 6,\n}\n\nexport enum StoreItemTypeName {\n\tBonus = 'bonus',\n\tTangible = 'tangible',\n\tMiniGameSpin = 'minigamespin',\n\tChangeLevel = 'changelevel',\n\tPrizeDrop = 'prizedrop',\n\tRaffleTicket = 'raffleticket',\n\tUnknown = 'unknown',\n}\n\nexport const StoreItemTypeNamed = (type: StoreItemType): StoreItemTypeName => {\n\treturn (\n\t\t{\n\t\t\t[StoreItemType.Bonus]: StoreItemTypeName.Bonus,\n\t\t\t[StoreItemType.Tangible]: StoreItemTypeName.Tangible,\n\t\t\t[StoreItemType.MiniGameSpin]: StoreItemTypeName.MiniGameSpin,\n\t\t\t[StoreItemType.ChangeLevel]: StoreItemTypeName.ChangeLevel,\n\t\t\t[StoreItemType.PrizeDrop]: StoreItemTypeName.PrizeDrop,\n\t\t\t[StoreItemType.RaffleTicket]: StoreItemTypeName.RaffleTicket,\n\t\t}[type] || StoreItemTypeName.Unknown\n\t);\n};\n","import { AchRelatedGame } from '../Base/AchRelatedGame';\nimport { IntUtils } from '../IntUtils';\nimport { TStoreItem } from '../WSAPI/WSAPITypes';\nimport { StoreItemPublicMeta } from './StoreItemPublicMeta';\nimport { StoreItemPurchaseType } from './StoreItemPurchaseType';\nimport { StoreItemType, StoreItemTypeNamed } from './StoreItemType';\n\nexport interface StoreItem {\n\tid: number;\n\titemTypeId: StoreItemType;\n\titemPublicMeta: StoreItemPublicMeta;\n\tcategoryIds?: number[];\n\tcanBuy?: boolean;\n\tshopPool: number;\n\tactiveTillDate?: number;\n\trelatedGames?: AchRelatedGame[];\n}\n\nconst mapPurchaseType = (purchaseType: StoreItemPurchaseType) => {\n\tif (purchaseType === StoreItemPurchaseType.Points) {\n\t\treturn 'points';\n\t} else if (purchaseType === StoreItemPurchaseType.Gems) {\n\t\treturn 'gems';\n\t} else if (purchaseType === StoreItemPurchaseType.Diamonds) {\n\t\treturn 'diamonds';\n\t}\n\n\treturn 'points';\n};\n\nexport const StoreItemTransform = (items: StoreItem[]): TStoreItem[] => {\n\t\n\treturn items\n\t\t.filter((r) => r.id >= 1)\n\t\t.map((r) => {\n\t\t\tconst x: TStoreItem = {\n\t\t\t\tid: r.id,\n\t\t\t\tname: r.itemPublicMeta.name,\n\t\t\t\tpurchase_type: mapPurchaseType(r.itemPublicMeta.purchase_type),\n\t\t\t\tprice: Number(r.itemPublicMeta.price), // wire delivers price as a string; coerce to the number the type promises\n\t\t\t\timage: r.itemPublicMeta.image_url,\n\t\t\t\tdescription: r.itemPublicMeta.description,\n\t\t\t\tribbon: r.itemPublicMeta.label_tag === 'custom' ? r.itemPublicMeta.custom_label_tag : r.itemPublicMeta.label_tag,\n\t\t\t\tlimit_message: r.itemPublicMeta.limit_message,\n\t\t\t\tpurchase_limit_message: r.itemPublicMeta.purchase_limit_message,\n\t\t\t\tpriority: r.itemPublicMeta.priority ?? 0,\n\t\t\t\trelated_item_ids: r.itemPublicMeta.related_items,\n\t\t\t\thint_text: r.itemPublicMeta.hint_text,\n\t\t\t\ttype: StoreItemTypeNamed(r.itemTypeId),\n\t\t\t\tcan_buy: r.canBuy,\n\t\t\t\tcategory_ids: r.categoryIds ?? [],\n\t\t\t\tpool: r.shopPool,\n\t\t\t\tcustom_data: IntUtils.JsonOrText(r.itemPublicMeta.custom_data),\n\t\t\t\tactive_till_date: r.activeTillDate,\n\t\t\t\tshow_timer: r.itemPublicMeta.show_timer,\n\t\t\t\tdiscounted_price: r.itemPublicMeta.discount_prize,\n\t\t\t\tdiscount_price_ribbon: r.itemPublicMeta.discount_prize_ribbon,\n\t\t\t\tcustom_ribbon_image: r.itemPublicMeta.custom_ribbon_image,\n\t\t\t\tcustom_section_id: r.itemPublicMeta.custom_section_id,\n\t\t\t\tonly_in_custom_section: r.itemPublicMeta.only_in_custom_section,\n\t\t\t\tcustom_section_type_id: r.itemPublicMeta.custom_section_type_id,\n\t\t\t\t...(r.itemPublicMeta.cant_buy_message ? { cant_buy_message: r.itemPublicMeta.cant_buy_message } : {}),\n\t\t\t\trelated_games: (r.relatedGames?.filter((g) => g.game_public_meta.enabled) || []).map((g, i) => ({\n\t\t\t\t\text_game_id: g.ext_game_id,\n\t\t\t\t\tgame_public_meta: {\n\t\t\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\t\t\tpriority: i + 1,\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t\t};\n\t\t\treturn x;\n\t\t});\n};\n","import { IntUtils } from '../IntUtils';\nimport { TStoreItem } from '../WSAPI/WSAPITypes';\nimport { StoreItem } from './StoreItem';\nimport { StoreItemPurchaseType } from './StoreItemPurchaseType';\nimport { StoreItemTypeNamed } from './StoreItemType';\n\ninterface StoreItemPurchased extends StoreItem {\n\tpurchase_ts: number;\n\tpurchase_points_amount: number;\n\tpurchased_today?: boolean;\n\tpurchased_this_week?: boolean;\n\tpurchased_this_month?: boolean;\n}\n\nconst mapPurchaseType = (purchaseType: StoreItemPurchaseType) => {\n\tif (purchaseType === StoreItemPurchaseType.Points) {\n\t\treturn 'points';\n\t} else if (purchaseType === StoreItemPurchaseType.Gems) {\n\t\treturn 'gems';\n\t} else if (purchaseType === StoreItemPurchaseType.Diamonds) {\n\t\treturn 'diamonds';\n\t}\n\n\treturn 'points';\n};\n\nexport const StoreItemPurchasedTransform = (items: StoreItemPurchased[]): TStoreItem[] => {\n\treturn items\n\t\t.filter((r) => r.id >= 1)\n\t\t.map((r) => {\n\t\t\tconst purchasedToday = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'today') : false;\n\t\t\tconst purchasedThisWeek = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'thisWeek') : false;\n\t\t\tconst purchasedThisMonth = r.purchase_ts ? IntUtils.isWithinPeriod(r.purchase_ts, 'thisMonth') : false;\n\n\t\t\tconst x: TStoreItem = {\n\t\t\t\tid: r.id,\n\t\t\t\tname: r.itemPublicMeta.name,\n\t\t\t\tprice: r.itemPublicMeta.price as any as number, // AA: strange why it's string\n\t\t\t\tpurchase_type: mapPurchaseType(r.itemPublicMeta.purchase_type),\n\t\t\t\timage: r.itemPublicMeta.image_url,\n\t\t\t\tdescription: r.itemPublicMeta.description,\n\t\t\t\tribbon: r.itemPublicMeta.label_tag === 'custom' ? r.itemPublicMeta.custom_label_tag : r.itemPublicMeta.label_tag,\n\t\t\t\tlimit_message: r.itemPublicMeta.limit_message,\n\t\t\t\tpurchase_limit_message: r.itemPublicMeta.purchase_limit_message,\n\t\t\t\tpriority: r.itemPublicMeta.priority ?? 0,\n\t\t\t\trelated_item_ids: r.itemPublicMeta.related_items,\n\t\t\t\thint_text: r.itemPublicMeta.hint_text,\n\t\t\t\ttype: StoreItemTypeNamed(r.itemTypeId),\n\t\t\t\tcan_buy: r.canBuy,\n\t\t\t\tcategory_ids: r.categoryIds ?? [],\n\t\t\t\tpool: r.shopPool,\n\t\t\t\tpurchase_ts: r.purchase_ts,\n\t\t\t\tpurchase_points_amount: r.purchase_points_amount,\n\t\t\t\tpurchased_today: purchasedToday,\n\t\t\t\tpurchased_this_week: purchasedThisWeek,\n\t\t\t\tpurchased_this_month: purchasedThisMonth,\n\t\t\t\tcustom_data: r.itemPublicMeta.custom_data,\n\t\t\t\tshow_timer: r.itemPublicMeta.show_timer,\n\t\t\t\trelated_games: (r.relatedGames?.filter((g) => g.game_public_meta.enabled) || []).map((g, i) => ({\n\t\t\t\t\text_game_id: g.ext_game_id,\n\t\t\t\t\tgame_public_meta: {\n\t\t\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\t\t\tpriority: i + 1,\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t\t};\n\n\t\t\treturn x;\n\t\t});\n};\n\nexport { StoreItemPurchased };\n","export enum AchievementStatus {\n\tDraft = 1,\n\tAvailableUnlocked = 2,\n\tAvailableLocked = 3,\n\tArchived = 4,\n\tFeaturedManually = 5,\n\tFeaturedAI = 6,\n\tRecurring = 7,\n\tRecurringUponCompletion = 8\n}\n","export enum AchievementTaskType {\n\tCompleteAchievement = 1,\n\tUnlockAchievement = 2,\n}\n","export enum AchievementType {\n\tMission = 1,\n\tBadge = 2,\n}\n","/** Possible statuses of the mission availability. \n *  Notes:\n *   - Recurring missions have a special field next_recurrence_date_ts, but it's only relevant if the mission has no active till date or the next recurrence date is before the active till date.\n *   - For a locked mission or mission that requires opt-in, the time limit should be calculated as dt_start + time_limit_ms. For a mission that does not require opt-in or type is not Locked, it should be the highest value of dt_start and active_from_ts (if defined) + time_limit_ms.\n * */\n\nexport enum AchievementAvailabilityStatus {\n    /** Mission without date/time restrictions or with passed active from date and no opt-in required and mission is unlocked */\n    Available = 0,\n\n    /** Mission without date/time restrictions or with passed active from date, opt-in is required, user is not opted-in or mission is locked */\n    AvailableInactive = 1,\n\n    /** Mission without date/time restrictions or with passed active from date, opt-in is required, user is opted-in or mission is unlocked*/\n    AvailableActive = 2,\n\n    /** Mission with active from date defined, date is in future.\n     * Field: active_from_ts\n    */\n    UnavailableWithActiveFrom = 3,\n\n    /** Mission with active till date defined, date is in future, and no opt-in required and mission is unlocked.\n     * Field: active_till_ts\n    */\n    AvailableWithActiveTill = 4,\n\n    /** Mission with active till date defined, date is in future, and opt-in is required, user is not opted in or mission is locked.\n     * Fields: active_till_ts, is_requires_optin, is_opted_in, is_locked.\n    */\n    AvailableWithActiveTillInactive = 5,\n\n    /** Mission with active till date defined, date is in future, and opt-in is required, user is opted in or mission is unlocked.\n     * Fields: active_till_ts, is_requires_optin, is_opted_in, is_locked.\n    */\n    AvailableWithActiveTillActive = 6,\n\n    /** Available mission with time limit, and opt-in is required or mission is unlocked.\n     * The time limit is calculated as the sum of two properties: (highest value from dt_start and active_from_ts) + time_limit_ms.\n     * \n    */\n    AvailableLimited = 7,\n\n    /** Available mission with time limit, opt-in is required, user is not opted-in or mission is locked.\n     * Time limit at this stage is not relevant, user should be opted-in or mission should be unlocked.\n    */\n    AvailableLimitedInactive = 8,\n\n   /** Available mission with time limit, opt-in is required, user is opted-in or mission unlocked.\n     * The time limit is calculated as the sum of two properties: dt_start + time_limit_ms.\n    */\n    AvailableLimitedActive = 9,\n\n    /** Available mission with time limit and active till date, opt-in is not required and mission is unlocked.\n     * Fields: active_till_ts, time_limit_ms, dt_start, active_from_ts;\n     * The time limit is calculated as the sum of two properties: (highest value from dt_start and active_from_ts) + time_limit_ms.\n    */\n    AvailableFullyLimited = 10,\n\n   /** Available mission with time limit and active till date, opt-in is required, user is not opted in or mission is locked.\n     * Fields: active_till_ts, time_limit_ms, dt_start, active_from_ts, is_requires_optin, is_opted_in, is_locked.\n     * On this stage only active_till_ts is relevant. time_limit_ms is ignored because user should be opted in.\n    */\n    AvailableFullyLimitedInactive = 11,\n\n    /** Available mission with time limit and active till date, opt-in is required, user is opted in or mission is unlocked.\n     * Fields: active_till_ts, time_limit_ms, dt_start, is_requires_optin, is_opted_in, is_locked.\n     * The time limit is calculated as the sum of two properties: dt_start + time_limit_ms.\n    */\n    AvailableFullyLimitedActive = 12,\n\n    /** Missed mission when active till date is already passed. is_completed field indicating if mission is completed or just missed  */\n    MissedByActiveTill = 13,\n\n     /** Missed mission when start_date + time_limit_ms is already passed. is_completed field indicating if mission is completed or just missed  */\n    MissedByLimitInTime = 14,\n}","export enum BadgesTimeLimitStates {\n\t/** Before Start Date */\n\tBeforeStartDate = 0,\n\t/** After Start Date but before earned */\n\tAfterStartDateNoProgress = 1,\n\t/** After Start Date but before started (no progress) + End date */\n\tAfterStartDateNoProgressAndEndDate = 2,\n\t/** After Start Date, but with some progress + End date */\n\tAfterStartDateWithProgressAndEndDate = 3,\n\t/** After End Date (not started) */\n\tAfterEndDateNotStarted = 4,\n\t/** After End Date (player has some progress, but not completed) */\n\tAfterEndDateWithProgress = 5,\n}\n\n","import { IntUtils } from \"../IntUtils\";\nimport { AchievementAvailabilityStatus } from \"./AchievementAvailabilityStatus\";\nimport { AchievementStatus } from \"./AchievementStatus\";\nimport { UserAchievement } from \"./UserAchievement\";\nimport { UserAchievementTask } from \"./UserAchievementTask\";\nimport { BadgesTimeLimitStates } from \"./BadgesTimeLimitStates\";\n\ntype UserStateParamsKeys = 'core_fav_game_top3' | 'core_fav_game_type_top3' | 'core_fav_game_provider_top3' | 'core_recommended_deposit_amount' | 'core_recommended_casino_bet_amount';\nconst USER_STATE_PARAMS_KEYS_GAMES: UserStateParamsKeys[] = ['core_fav_game_top3', 'core_fav_game_type_top3', 'core_fav_game_provider_top3'];\nconst USER_STATE_PARAMS_KEYS_BET_AMOUNT: UserStateParamsKeys[] = [\n    'core_recommended_deposit_amount',\n    'core_recommended_casino_bet_amount',\n];\n\nconst MINOR_WORDS = new Set([\n    'of', 'at', 'in', 'on', 'to', 'up', 'as', 'by', 'for',\n    'from', 'into', 'onto', 'with', 'upon', 'via',\n    'and', 'but', 'or', 'nor', 'so', 'yet',\n    'vs', 'v',\n    'a', 'an', 'the',\n]);\n\nfunction toGameTitleCase(raw: string): string {\n    if (!raw) return raw;\n    const tokens = raw.toLowerCase().split(/(\\b\\w+\\b)/);\n    const wordTokens = tokens.filter((t) => /^\\w+$/.test(t));\n    const lastWordIdx = wordTokens.length - 1;\n    let wordIndex = 0;\n    return tokens\n        .map((token) => {\n            if (!/^\\w+$/.test(token)) return token;\n            const isFirst = wordIndex === 0;\n            const isLast  = wordIndex === lastWordIdx;\n            wordIndex++;\n            if (isFirst || isLast || !MINOR_WORDS.has(token)) {\n                return token.charAt(0).toUpperCase() + token.slice(1);\n            }\n            return token;\n        })\n        .join('');\n}\n\nexport class MissionUtils {\n\n    public static getAvailabilityStatus = (mission: UserAchievement) => {\n\n        if (!mission) {\n            return null;\n        }\n\n        const activeFrom = mission.active_from_ts ? MissionUtils.getMs(mission.active_from_ts) : null\n        const activeTill = mission.active_till_ts ? MissionUtils.getMs(mission.active_till_ts) : null;\n        const startDate = mission.start_date_ts ? MissionUtils.getMs(mission.start_date_ts) : null;\n        const timeLimit = mission.time_limit_ms;\n        const requiresOptIn = mission.requiresOptin;\n        const optedIn = mission.isOptedIn;\n        const isLockedMission = mission.ach_status_id === AchievementStatus.AvailableLocked;\n        const isLocked = mission.isLocked;\n\n        if (!activeFrom && !activeTill && !timeLimit) {\n            if (requiresOptIn) {\n                if (optedIn) {\n                    return AchievementAvailabilityStatus.AvailableActive;\n                } else {\n                    return AchievementAvailabilityStatus.AvailableInactive;\n                }\n            } else if (isLockedMission) {\n                if (!isLocked) {\n                    return AchievementAvailabilityStatus.AvailableActive;\n                } else {\n                    return AchievementAvailabilityStatus.AvailableInactive;\n                }\n            } else {\n                return AchievementAvailabilityStatus.Available;\n            }\n        }\n\n        if (activeFrom && activeFrom > Date.now()) {\n            return AchievementAvailabilityStatus.UnavailableWithActiveFrom;\n        }\n\n        if ((activeFrom && activeFrom < Date.now()) || !activeFrom) {\n            if (!activeTill && !timeLimit) {\n                if (requiresOptIn) {\n                    if (optedIn) {\n                        return AchievementAvailabilityStatus.AvailableActive;\n                    } else {\n                        return AchievementAvailabilityStatus.AvailableInactive;\n                    }\n                } else if (isLockedMission) {\n                    if (!isLocked) {\n                        return AchievementAvailabilityStatus.AvailableActive;\n                    } else {\n                        return AchievementAvailabilityStatus.AvailableInactive;\n                    }\n                } else {\n                    return AchievementAvailabilityStatus.Available;\n                }\n            }\n\n            if (activeTill && !timeLimit) {\n                if (activeTill > Date.now()) {\n                    if (requiresOptIn) {\n                        if (optedIn) {\n                            return AchievementAvailabilityStatus.AvailableWithActiveTillActive;\n                        } else {\n                            return AchievementAvailabilityStatus.AvailableWithActiveTillInactive;\n                        }\n                    } else if (isLockedMission) {\n                        if (!isLocked) {\n                            return AchievementAvailabilityStatus.AvailableWithActiveTillActive;\n                        } else {\n                            return AchievementAvailabilityStatus.AvailableWithActiveTillInactive;\n                        }\n                    } else {\n                        return AchievementAvailabilityStatus.AvailableWithActiveTill;\n                    }\n                } else {\n                    return AchievementAvailabilityStatus.MissedByActiveTill;\n                }\n            }\n\n            if (timeLimit && !activeTill) {\n                if (requiresOptIn) {\n                    const endDate = startDate + timeLimit;\n\n                    if (optedIn) {\n                        if (endDate > Date.now()) {\n                            return AchievementAvailabilityStatus.AvailableLimitedActive;\n                        } else {\n                            return AchievementAvailabilityStatus.MissedByLimitInTime;\n                        }\n                    } else {\n                        return AchievementAvailabilityStatus.AvailableLimitedInactive;\n                    }\n                } else if (isLockedMission) {\n                    const endDate = startDate + timeLimit;\n\n                    if (!isLocked) {\n                        if (endDate > Date.now()) {\n                            return AchievementAvailabilityStatus.AvailableLimitedActive;\n                        } else {\n                            return AchievementAvailabilityStatus.MissedByLimitInTime;\n                        }\n                    } else {\n                        return AchievementAvailabilityStatus.AvailableLimitedInactive;\n                    }\n                } else {\n                    const endDate = activeFrom && activeFrom > startDate ? activeFrom + timeLimit : startDate + timeLimit;\n\n                    if (endDate > Date.now()) {\n                        return AchievementAvailabilityStatus.AvailableLimited;\n                    } else {\n                        return AchievementAvailabilityStatus.MissedByLimitInTime;\n                    }\n                }\n            }\n\n            if (timeLimit && activeTill) {\n                if (activeTill > Date.now()) {\n                    if (requiresOptIn) {\n                        if (optedIn) {\n                            const endDate = startDate + timeLimit;\n\n                            if (endDate > Date.now()) {\n                                return AchievementAvailabilityStatus.AvailableFullyLimitedActive;\n                            } else {\n                                return AchievementAvailabilityStatus.MissedByLimitInTime;\n                            }\n                        } else {\n                            return AchievementAvailabilityStatus.AvailableFullyLimitedInactive;\n                        }\n                    } else if (isLockedMission) {\n                        if (!isLocked) {\n                            const endDate = startDate + timeLimit;\n\n                            if (endDate > Date.now()) {\n                                return AchievementAvailabilityStatus.AvailableFullyLimitedActive;\n                            } else {\n                                return AchievementAvailabilityStatus.MissedByLimitInTime;\n                            }\n                        } else {\n                            return AchievementAvailabilityStatus.AvailableFullyLimitedInactive;\n                        }\n                    } else {\n                        const endDate = activeFrom && activeFrom > startDate ? activeFrom + timeLimit : startDate + timeLimit;\n\n                        if (endDate > Date.now()) {\n                            return AchievementAvailabilityStatus.AvailableFullyLimited;\n                        } else {\n                            return AchievementAvailabilityStatus.MissedByLimitInTime;\n                        }\n                    }\n                } else {\n                    return AchievementAvailabilityStatus.MissedByActiveTill;\n                }\n            }\n        }\n    }\n\n    public static getMs = (ts: number): number => {\n        return new Date(ts).getTime();\n    }\n\n    public static replaceTagsFavMissionTask = ({ task, valueToReplace, currencySymbol }: { task: UserAchievementTask, valueToReplace: string, currencySymbol?: string }): string => {\n        let result = valueToReplace || '';\n\n        if (!task) {\n            return result;\n        }\n\n        const userStateParams = (task.user_state_params || {});\n        const userStateOperator = task.task_public_meta?.user_state_operations;\n        const userStateParamsKeys = Object.keys(userStateParams);\n\n        if (userStateParamsKeys.length === 0 || !userStateOperator) {\n            return result;\n        }\n\n        const operatorsMulti = ['has', '!has'];\n        const operatorsPos = ['pos1', 'pos2', 'pos3'];\n\n        let suggestedGames: string = '';\n        let suggestedValue: string = '';\n\n        userStateParamsKeys.forEach((k: UserStateParamsKeys) => {\n            const operator = userStateOperator[k]?.op;\n\n            if (USER_STATE_PARAMS_KEYS_GAMES.includes(k)) {\n                if (operatorsMulti.includes(operator)) {\n                    const value = userStateParams[k]?.filter(v => Boolean(v));\n                    if (value && value.length > 0) {\n                        suggestedGames = value.map((v: string) => {\n                            const cleaned = v.replace(/_/g, ' ');\n                            return toGameTitleCase(cleaned);\n                        }).join(', ');\n                    }\n                }\n\n                if (operatorsPos.includes(operator)) {\n                    const value = userStateParams[k];\n                    const pos = Number(operator.replace('pos', '')) - 1;\n\n                    if (IntUtils.isNotNull(pos) && value && value[pos]) {\n                        suggestedGames = value[pos];\n\n                        if (suggestedGames) {\n                            suggestedGames = toGameTitleCase(suggestedGames.replace(/_/g, ' '));\n                        }\n\n                    }\n                }\n            }\n\n            if (USER_STATE_PARAMS_KEYS_BET_AMOUNT.includes(k)) { \n                suggestedValue = userStateParams[k];\n\n                if (suggestedValue) {\n                    const currencyFromTheTask = userStateParams?.core_wallet_currency;\n\n                    suggestedValue = `${suggestedValue} ${currencySymbol || currencyFromTheTask || ''}`;\n                }\n            }\n        });\n\n        if (suggestedGames && result) {\n            result = result.replace('{{suggested_games}}', suggestedGames);\n        }\n\n        if (suggestedValue && result) {\n            result = result.replace('{{suggested_value}}', suggestedValue);\n        }\n\n        return result;\n    }\n\n    public static replaceFavGameNameTag = ({ task, currencySymbol }: { task: UserAchievementTask, currencySymbol?: string }): UserAchievementTask => {\n        if (task && task.task_public_meta && task.task_public_meta.name) {\n            task.task_public_meta.name = MissionUtils.replaceTagsFavMissionTask({ task, valueToReplace: task.task_public_meta.name, currencySymbol });\n        }\n\n        return task;\n    }\n\n    public static determineBadgeState = (badge: UserAchievement): BadgesTimeLimitStates | null => {\n        const now = Date.now();\n        const { active_from_ts, active_till_ts, progress, isCompleted, complete_date_ts } = badge;\n\n        // If badge is completed before active till date, return null\n        if (isCompleted && (!active_till_ts || complete_date_ts < active_till_ts)) {\n            return null;\n        }\n      \n        // 1. BEFORE START\n        if (active_from_ts > now) {\n            return BadgesTimeLimitStates.BeforeStartDate;\n        }\n      \n        // 2. AFTER START, NO END DATE (infinite badge)\n        //    → grey, no locked, no date chip\n        if (!active_till_ts) {\n            if (progress === 0) {\n                return BadgesTimeLimitStates.AfterStartDateNoProgress;\n            }\n            // If infinite and with progress → this state does not exist in enum\n            // (but if needed we can add one)\n        }\n      \n        // 3. AFTER START, BEFORE END DATE\n        if (now < active_till_ts) {\n            if (progress === 0) {\n                // now < end + has end date → must show chip\n                return BadgesTimeLimitStates.AfterStartDateNoProgressAndEndDate;\n            }\n        \n            return BadgesTimeLimitStates.AfterStartDateWithProgressAndEndDate;\n        }\n      \n        // 4. AFTER END DATE\n        if (progress === 0) {\n            return BadgesTimeLimitStates.AfterEndDateNotStarted;\n        }\n      \n        return BadgesTimeLimitStates.AfterEndDateWithProgress;\n    }\n}\n","import { AchRelatedGame } from '../Base/AchRelatedGame';\nimport { IntUtils } from '../IntUtils';\nimport { TMissionOrBadge } from '../WSAPI/WSAPITypes';\nimport { AchievementPublicMeta } from './AchievementPublicMeta';\nimport { AchievementStatus } from './AchievementStatus';\nimport { AchievementTaskType } from './AchievementTaskType';\nimport { AchievementType } from './AchievementType';\nimport { MissionUtils } from './MissionsUtils';\nimport { ScheduledMissionType } from './ScheduledMissionType';\nimport { UserAchievementTask } from './UserAchievementTask';\nimport { BadgesTimeLimitStates } from './BadgesTimeLimitStates';\nimport { AchievementClaimPeriodTypeId } from './AchievementClaimTypeId';\n\nexport interface UserAchievement {\n\tach_id?: number;\n\tach_type_id?: AchievementType;\n\tach_public_meta?: AchievementPublicMeta;\n\tisCompleted?: boolean;\n\tisLocked?: boolean;\n\trequiresOptin?: boolean;\n\tisOptedIn?: boolean;\n\tstart_date?: string; // time when mission unlocked or opted-in. Needed to calculated \"remaining time\" in case time_limit_ms is set\n\tstart_date_ts?: number;\n\ttime_limit_ms?: number;\n\tprogress?: number;\n\tcomplete_date?: string; // \"dd/MM/yyyy HH:mm:ss\" string (not ISO-8601); use complete_date_ts for epoch-ms\n\tcomplete_date_ts?: number;\n\tunlock_date?: string; // \"dd/MM/yyyy HH:mm:ss\" string (not ISO-8601)\n\tmilliseconds_till_available?: number;\n\tcompleted_tasks?: number;\n\tachievementTasks?: UserAchievementTask[];\n\tnext_recurrence_date_ts?: number;\n\tach_status_id?: AchievementStatus;\n\tscheduledMissionType?: ScheduledMissionType;\n\trelated_games?: AchRelatedGame[];\n\tactive_from_ts?: number; // indicates when 'scheduled' mission is active from,\n\tactive_till_ts?: number; // indicates when 'scheduled' mission is active till,\n\tach_categories?: number[];\n\trecurring_quantity?: number; // max completion count for Recurring upon completion\n\tcompleted_count?: number; // completion count for Recurring upon completion\n\n\tach_completed_id?: number; // ID of the completion fact from ach_completed or ach_completed_recurring tables\n\trequires_prize_claim?: boolean; // flag from achievement if the mission prize will be given only after user claims it\n\tprize_claimed_date_ts?: number; // the date/timestamp indicating when the prize was claimed by the user\n\n\tcompleted_today?: boolean;\n\tcompleted_this_week?: boolean;\n\tcompleted_this_month?: boolean;\n\tcustom_section_type_id?: number;\n\tbadgeTimeLimitState?: BadgesTimeLimitStates;\n\tprize_claim_expiration_date?: number;\n\tprize_claim_period_type_id?: AchievementClaimPeriodTypeId;\n}\n\nexport const enrichUserAchievementsWithBadgeState = (items: UserAchievement[]): UserAchievement[] => {\n\treturn items.map((item) => {\n\t\tif (item.ach_type_id === AchievementType.Badge && (item.active_from_ts || item.active_till_ts)) {\n\t\t\titem.badgeTimeLimitState = MissionUtils.determineBadgeState(item);\n\t\t}\n\t\treturn item;\n\t});\n};\n\nexport const UserAchievementTransform = (items: UserAchievement[]): TMissionOrBadge[] => {\n\treturn items\n\t\t.filter((r) => r.ach_id >= 1)\n\t\t.map((r) => {\n\t\t\tconst completedToday = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'today') : false;\n\t\t\tconst completedThisWeek = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'thisWeek') : false;\n\t\t\tconst completedThisMonth = r.complete_date_ts ? IntUtils.isWithinPeriod(r.complete_date_ts, 'thisMonth') : false;\n\n\t\t\tlet missionName = r.ach_public_meta.name;\n\t\t\tlet missionSubHeader = r.ach_public_meta.sub_header;\n\t\t\tlet missionDescription = r.ach_public_meta.description;\n\n\t\t\tif (missionName?.includes('{{suggested_') || missionSubHeader?.includes('{{suggested_') || missionDescription?.includes('{{suggested_')) {\n\t\t\t\tr.achievementTasks.forEach(t => {\n\t\t\t\t\tif (r.ach_public_meta.name?.includes('{{suggested_')) {\n\t\t\t\t\t\tmissionName = MissionUtils.replaceTagsFavMissionTask({ task: t, valueToReplace: r.ach_public_meta.name });\n\t\t\t\t\t}\n\t\t\t\t\tif (r.ach_public_meta.sub_header?.includes('{{suggested_')) {\n\t\t\t\t\t\tmissionSubHeader = MissionUtils.replaceTagsFavMissionTask({ task: t, valueToReplace: r.ach_public_meta.sub_header });\n\t\t\t\t\t}\n\t\t\t\t\tif (r.ach_public_meta.description?.includes('{{suggested_')) {\n\t\t\t\t\t\tmissionDescription = MissionUtils.replaceTagsFavMissionTask({ task: t, valueToReplace: r.ach_public_meta.description });\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst x: TMissionOrBadge = {\n\t\t\t\tid: r.ach_id,\n\t\t\t\tname: missionName,\n\t\t\t\tsub_header: missionSubHeader,\n\t\t\t\tdescription: missionDescription,\n\t\t\t\thint_text: r.ach_public_meta.hint_text,\n\t\t\t\tunlock_mission_description: r.ach_public_meta.unlock_mission_description,\n\t\t\t\timage: r.ach_public_meta.image_url,\n\t\t\t\tis_completed: r.isCompleted,\n\t\t\t\tis_locked: r.isLocked,\n\t\t\t\tis_requires_optin: r.requiresOptin,\n\t\t\t\tis_opted_in: r.isOptedIn,\n\t\t\t\ttime_limit_ms: r.time_limit_ms,\n\t\t\t\tactive_from_ts: r.active_from_ts,\n\t\t\t\tactive_till_ts: r.active_till_ts,\n\t\t\t\tdt_start: r.start_date_ts,\n\t\t\t\treward: r.ach_public_meta.reward,\n\t\t\t\tprogress: r.progress,\n\t\t\t\ttype: r.ach_type_id === AchievementType.Mission ? 'mission' : 'badge',\n\t\t\t\tcta_action: r.ach_public_meta.cta_action,\n\t\t\t\tcta_text: r.ach_public_meta.cta_text,\n\t\t\t\tcustom_section_id: r.ach_public_meta.custom_section_id,\n\t\t\t\tonly_in_custom_section: r.ach_public_meta.only_in_custom_section,\n\t\t\t\tcustom_data: IntUtils.JsonOrText(r.ach_public_meta.custom_data),\n\t\t\t\tposition: r.ach_public_meta.position,\n\t\t\t\tribbon:\n\t\t\t\t\tr.ach_public_meta.label_tag === 'custom' ? r.ach_public_meta.custom_label_tag : r.ach_public_meta.label_tag,\n\t\t\t\ttasks: (r.achievementTasks || [])\n\t\t\t\t\t.filter((t) => t.task_type_id === AchievementTaskType.CompleteAchievement)\n\t\t\t\t\t.map((t) => {\n\t\t\t\t\t\tMissionUtils.replaceFavGameNameTag({ task: t });\n\n\t\t\t\t\t\treturn ({\n\t\t\t\t\t\t\tid: t.task_id,\n\t\t\t\t\t\t\tname: t.task_public_meta?.name,\n\t\t\t\t\t\t\tpoints_reward: t.points_reward,\n\t\t\t\t\t\t\tgems_reward: t.gems_reward,\n\t\t\t\t\t\t\tdiamonds_reward: t.diamonds_reward,\n\t\t\t\t\t\t\tis_completed: t.isCompleted,\n\t\t\t\t\t\t\tprogress: t.userProgress,\n\t\t\t\t\t\t\texecution_count_expected: t.executionCount,\n\t\t\t\t\t\t\texecution_count_actual: t.userExecutedCount,\n\t\t\t\t\t\t\tdisplay_progress_as_count: t.task_public_meta.display_progress_as_count,\n\t\t\t\t\t\t\tstage_image: t.task_public_meta.stage_image,\n\t\t\t\t\t\t})\n\t\t\t\t\t}),\n\t\t\t\trelated_games: (r.related_games || []).map((g, i) => ({\n\t\t\t\t\text_game_id: g.ext_game_id,\n\t\t\t\t\tgame_public_meta: {\n\t\t\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\t\t\tpriority: i + 1,\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t\t\tcategory_ids: r.ach_categories ?? [],\n\t\t\t\tach_completed_id: r.ach_completed_id,\n\t\t\t\trequires_prize_claim: r.requires_prize_claim,\n\t\t\t\tprize_claimed_date_ts: r.prize_claimed_date_ts,\n\t\t\t\tcomplete_date: r.complete_date,\n\t\t\t\tcomplete_date_ts: r.complete_date_ts,\n\t\t\t\tcompleted_today: completedToday,\n\t\t\t\tcompleted_this_week: completedThisWeek,\n\t\t\t\tcompleted_this_month: completedThisMonth,\n\t\t\t\tcustom_section_type_id: r.ach_public_meta.custom_section_type_id,\n\t\t\t\tavailability_status: MissionUtils.getAvailabilityStatus(r),\n\t\t\t\tclaim_button_title: r.ach_public_meta.claim_button_title,\n\t\t\t\tclaim_button_action: r.ach_public_meta.claim_button_action,\n\t\t\t\tbadgeTimeLimitState: r.badgeTimeLimitState,\n\t\t\t\thide_locked_mission: r.ach_public_meta.hide_locked_mission,\n\t\t\t\tprize_claim_expiration_date: r.prize_claim_expiration_date,\n\t\t\t\tprize_claim_period_type_id: r.prize_claim_period_type_id,\n\t\t\t};\n\n\t\t\tif (r.ach_status_id === AchievementStatus.Recurring) {\n\t\t\t\tx.next_recurrence_date_ts = Date.now() + r?.milliseconds_till_available;\n\t\t\t}\n\n\t\t\tif (r.ach_status_id === AchievementStatus.RecurringUponCompletion) {\n\t\t\t\tx.completion_count = r.completed_count;\n\t\t\t\tx.max_completion_count = r.recurring_quantity;\n\t\t\t}\n\t\t\treturn x;\n\t\t});\n};\n","export enum ScheduledMissionType {\n\tFuture = 1,\n\tPast = 2,\n\tPresent = 3,\n}\n","import { TAchCategory } from '../WSAPI/WSAPITypes';\nimport { AchCategoryPublicMeta } from './AchCategoryPublicMeta';\n\nexport interface AchCategory {\n\tid?: number;\n\tpublicMeta?: AchCategoryPublicMeta;\n}\n\nexport const AchCategoryTransform = (items: AchCategory[]): TAchCategory[] => {\n\treturn items.map((r) => {\n\t\tconst x: TAchCategory = {\n\t\t\tid: r.id,\n\t\t\tname: r.publicMeta?.name,\n\t\t\torder: r.publicMeta?.order,\n\t\t};\n\t\treturn x;\n\t});\n};\n","export enum MissionCategory {\n\tOverview,\n\t// fake category for custom section overview missions, using in TSMap.to get correct missions\n\tCustomSectionOverview,\n\tAvailable,\n\tLocked,\n\tCompleted,\n\tMissed,\n}","export enum AchievementClaimPeriodTypeId {\n\tRelativePeriod = 0,\n\tExactPeriod = 1,\n}","import { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { TClanTournamentPlayers } from '../WSAPI/WSAPITypes';\n\nexport interface ClanTournamentPlayerRaw {\n\tuserId: number;\n\tcleanExtUserId: string;\n\tuserAltName: string;\n\tavatar_id: string;\n\tavatar_real_id: number;\n\tposition: number;\n\tscores: number;\n\tisMe: boolean;\n\tregistration_status?: number;\n\tcrmBrandId?: number;\n\tavatar_url?: string;\n}\n\nexport interface GetClanTournamentPlayersResponse extends ProtocolResponse {\n\ttournament_instance_id: number;\n\tplayers: ClanTournamentPlayerRaw[];\n}\n\n// Consumer-facing types live in WSAPITypes.ts (`TClanTournamentPlayers`) — the\n// single source documented + emitted to docs. This transform maps the raw wire\n// shape onto it; do not re-declare a parallel result/player type here.\nexport const clanTournamentPlayersTransform = (response: GetClanTournamentPlayersResponse): TClanTournamentPlayers => {\n\treturn {\n\t\ttournament_instance_id: response.tournament_instance_id,\n\t\tplayers: (response.players || []).map((p) => ({\n\t\t\tuser_id: p.userId,\n\t\t\tclean_ext_user_id: p.cleanExtUserId,\n\t\t\tpublic_username: p.userAltName,\n\t\t\tavatar_id: p.avatar_id,\n\t\t\tavatar_real_id: p.avatar_real_id,\n\t\t\tavatar_url: p.avatar_url,\n\t\t\tposition: p.position,\n\t\t\tscores: p.scores,\n\t\t\tis_me: p.isMe,\n\t\t})),\n\t};\n};\n","export enum TournamentRegistrationType {\n\tAUTO = 1,\n\tOPT_IN = 2,\n\tBUY_IN_POINTS = 3,\n\tMANUAL_APPROVAL = 4,\n\tREQUIRES_QUALIFICATION = 5,\n\tBUY_IN_GEMS = 6,\n\tBUY_IN_DIAMONDS = 7,\n\t// BUY_IN_CASH = 5???,\n}\n\nexport type TournamentRegistrationTypeName =\n\t| 'AUTO'\n\t| 'OPT_IN'\n\t| 'BUY_IN_POINTS'\n\t| 'MANUAL_APPROVAL'\n\t| 'REQUIRES_QUALIFICATION'\n\t| 'BUY_IN_GEMS'\n\t| 'BUY_IN_DIAMONDS'\n\t| 'UNKNOWN';\n\n/** @hidden */\nexport const TournamentRegistrationTypeGetName = (type: TournamentRegistrationType): TournamentRegistrationTypeName => {\n\treturn ({\n\t\t[TournamentRegistrationType.AUTO]: 'AUTO',\n\t\t[TournamentRegistrationType.BUY_IN_POINTS]: 'BUY_IN_POINTS',\n\t\t[TournamentRegistrationType.MANUAL_APPROVAL]: 'MANUAL_APPROVAL',\n\t\t[TournamentRegistrationType.OPT_IN]: 'OPT_IN',\n\t\t[TournamentRegistrationType.REQUIRES_QUALIFICATION]: 'REQUIRES_QUALIFICATION',\n\t\t[TournamentRegistrationType.BUY_IN_GEMS]: 'BUY_IN_GEMS',\n\t\t[TournamentRegistrationType.BUY_IN_DIAMONDS]: 'BUY_IN_DIAMONDS',\n\t}[type] || 'UNKNOWN') as any as TournamentRegistrationTypeName;\n};\n","export enum TournamentRegistrationStatus {\n\tNOT_REGISTERED = 0,\n\tREGISTERED = 1,\n\tFINISHED = 2,\n\tPENDING = 3,\n\tCANCELLED = 4,\n\tREGISTERED_PENDING_QUALIFICATION = 5,\n\tQUALIFIED_PENDING_REGISTRATION = 6,\n}\n\nexport enum TournamentRegistrationStatusName {\n\tNOT_REGISTERED = 'NOT_REGISTERED',\n\tREGISTERED = 'REGISTERED',\n\tFINISHED = 'FINISHED',\n\tPENDING = 'PENDING',\n\tCANCELLED = 'CANCELLED',\n\tREGISTERED_PENDING_QUALIFICATION = 'REGISTERED_PENDING_QUALIFICATION',\n\tQUALIFIED_PENDING_REGISTRATION = 'QUALIFIED_PENDING_REGISTRATION',\n\tUNKNOWN = 'UNKNOWN',\n}\n\n/** @hidden */\nexport const TournamentRegistrationStatusNamed = (type: TournamentRegistrationStatus): TournamentRegistrationStatusName => {\n\treturn ({\n\t\t[TournamentRegistrationStatus.CANCELLED]: TournamentRegistrationStatusName.CANCELLED,\n\t\t[TournamentRegistrationStatus.FINISHED]: TournamentRegistrationStatusName.FINISHED,\n\t\t[TournamentRegistrationStatus.NOT_REGISTERED]: TournamentRegistrationStatusName.NOT_REGISTERED,\n\t\t[TournamentRegistrationStatus.PENDING]: TournamentRegistrationStatusName.PENDING,\n\t\t[TournamentRegistrationStatus.QUALIFIED_PENDING_REGISTRATION]:\n\t\t\tTournamentRegistrationStatusName.QUALIFIED_PENDING_REGISTRATION,\n\t\t[TournamentRegistrationStatus.REGISTERED]: TournamentRegistrationStatusName.REGISTERED,\n\t\t[TournamentRegistrationStatus.REGISTERED_PENDING_QUALIFICATION]:\n\t\t\tTournamentRegistrationStatusName.REGISTERED_PENDING_QUALIFICATION,\n\t}[type] || TournamentRegistrationStatusName.UNKNOWN) as TournamentRegistrationStatusName;\n};\n","export enum TournamentInstanceStatus {\n\tPUBLISHED = 1,\n\tREGISTER = 2,\n\tSTARTED = 3,\n\tFINISHED = 4,\n\tCANCELLED = 5,\n\tFAILED = 6,\n\tFINALIZING = 7,\n}\n\nexport const TournamentInstanceStatusName = (s: TournamentInstanceStatus): string => {\n\treturn {\n\t\t[TournamentInstanceStatus.PUBLISHED]: 'PUBLISHED',\n\t\t[TournamentInstanceStatus.REGISTER]: 'REGISTER',\n\t\t[TournamentInstanceStatus.STARTED]: 'STARTED',\n\t\t[TournamentInstanceStatus.FINISHED]: 'FINISHED',\n\t\t[TournamentInstanceStatus.CANCELLED]: 'CANCELLED',\n\t\t[TournamentInstanceStatus.FAILED]: 'FAILED',\n\t\t[TournamentInstanceStatus.FINALIZING]: 'FINALIZING',\n\t}[s];\n};\n","import { ActivityTypeLimited } from '../Core';\nimport { Tournament } from './Tournament';\nimport { TournamentInstanceStatus } from './TournamentInstanceStatus';\nimport { TournamentPlayer } from './TournamentPlayer';\nimport { TournamentPrize } from './TournamentPrize';\nimport { TournamentRegistrationStatus } from './TournamentRegistrationStatus';\nimport { TournamentRegistrationType } from './TournamentRegistrationType';\n\nconst tournamentPrizeTypeToPrizeName = (type: ActivityTypeLimited) => {\n\treturn {\n\t\t[ActivityTypeLimited.DoNothing]: 'TANGIBLE',\n\t\t[ActivityTypeLimited.Points]: 'POINTS_ADD',\n\t\t[ActivityTypeLimited.DeductPoints]: 'POINTS_DEDUCT',\n\t\t[ActivityTypeLimited.ResetPoints]: 'POINTS_RESET',\n\t\t[ActivityTypeLimited.MiniGameAttempt]: 'MINI_GAME_ATTEMPT',\n\t\t[ActivityTypeLimited.Bonus]: 'BONUS',\n\t\t[ActivityTypeLimited.AddGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_ADD',\n\t\t[ActivityTypeLimited.DeductGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_DEDUCT',\n\t\t[ActivityTypeLimited.ResetGemsAndDiamonds]: 'GEMS_AND_DIAMONDS_RESET',\n\t}[type];\n};\n\nexport class TournamentUtils {\n\tpublic static isCanRegister = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\tif (tournament.tournamentRegistrationStatus === TournamentRegistrationStatus.QUALIFIED_PENDING_REGISTRATION) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t!tournament.isUserRegistered && (\n\t\t\t\t\ttournament.playersMaxCount !== tournament.registrationCount ||\n\t\t\t\t\ttournament.playersMaxCount === null ||\n\t\t\t\t\ttournament.playersMaxCount === 0\n\t\t\t\t) &&\n\t\t\t\ttournament.registrationType !== TournamentRegistrationType.AUTO && (\n\t\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.REGISTER || (\n\t\t\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.STARTED && tournament.allowLateRegistration\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isInProgress = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn tournament.tournamentInstanceStatus === TournamentInstanceStatus.STARTED;\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isActive = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn (\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.PUBLISHED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.REGISTER ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.STARTED\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isFinished = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn (\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.FINISHED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.CANCELLED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.FINALIZING\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isCancelled = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn tournament.tournamentInstanceStatus === TournamentInstanceStatus.CANCELLED;\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static isUpcoming = (tournament: Tournament): boolean => {\n\t\tif (tournament) {\n\t\t\treturn (\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.PUBLISHED ||\n\t\t\t\ttournament.tournamentInstanceStatus === TournamentInstanceStatus.REGISTER\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t};\n\n\tpublic static getPlayerTransformed = (player: TournamentPlayer, isMe?: boolean) => {\n\t\tif (player) {\n\t\t\tconst playerTransformed = {\n\t\t\t\tpublic_username: player.userAltName,\n\t\t\t\tavatar_url: player.avatar_url,\n\t\t\t\tposition: player.position,\n\t\t\t\tscores: player.scores,\n\t\t\t\tis_me: player.isMe,\n\t\t\t\tuser_ext_id: player.cleanExtUserId,\n\t\t\t\tcrm_brand_id: player.crmBrandId,\n\t\t\t\tuser_id: player.userId,\n\t\t\t};\n\n\t\t\tif (isMe) {\n\t\t\t\tdelete playerTransformed.is_me;\n\t\t\t}\n\n\t\t\treturn playerTransformed;\n\t\t}\n\n\t\treturn null;\n\t};\n\n\tpublic static getPrizeTransformed = (prize: TournamentPrize) => {\n\t\tif (prize) {\n\t\t\treturn { ...prize, type: tournamentPrizeTypeToPrizeName(prize.type) };\n\t\t}\n\n\t\treturn null;\n\t};\n}\n","import { TournamentRegistrationType, TournamentRegistrationTypeGetName } from './TournamentRegistrationType';\nimport { TournamentInstanceStatus } from './TournamentInstanceStatus';\nimport {\n\tTournamentRegistrationStatus,\n\tTournamentRegistrationStatusName,\n\tTournamentRegistrationStatusNamed,\n} from './TournamentRegistrationStatus';\nimport { TournamentType } from './TournamentType';\nimport { TournamentPublicMeta } from './TournamentPublicMeta';\nimport { TTournament } from '../WSAPI/WSAPITypes';\nimport { TournamentPlayer } from './TournamentPlayer';\nimport { TournamentPrize } from './TournamentPrize';\nimport { TournamentUtils } from './TournamentUtils';\nimport { IntUtils } from '../IntUtils';\nimport { AchRelatedGame } from '../Base/AchRelatedGame';\n\nexport interface Tournament {\n\t/** ID of tournament template */\n\ttournamentId?: number;\n\t/** ID of tournament instance. Generated every time when tournament based on specific template is scheduled for run */\n\ttournamentInstanceId?: number;\n\t/** Type of the tournament. For now only SCHEDULED is support */\n\ttournamentType?: TournamentType;\n\t/** Meta information about tournament that should be used to build UI */\n\tpublicMeta?: TournamentPublicMeta;\n\t/** Cost of registration in the tournament in gamification points */\n\tbuyInAmount?: number;\n\t/** Not in use */\n\tprizePool?: number;\n\t/** The time when tournament is going to start */\n\tstartTime?: string;\n\t/** The time when tournament is going to finish */\n\tendTime?: string;\n\t/** The time when tournament is going to start, epoch */\n\tstartTimeTs?: number;\n\t/** The time when tournament is going to finish, epoch */\n\tendTimeTs?: number;\n\t/** Number of users registered in the tournament */\n\tregistrationCount?: number;\n\t/** Not in use */\n\ttotalCount?: number;\n\t/** Type of registration in the tournament */\n\tregistrationType?: TournamentRegistrationType;\n\t/** Status of registration in the tournament for current user */\n\ttournamentRegistrationStatus?: TournamentRegistrationStatus;\n\t/** Status of tournament instance */\n\ttournamentInstanceStatus?: TournamentInstanceStatus;\n\t/** flag indicating if current user is registered in the tournament */\n\tisUserRegistered?: boolean;\n\t/** Indicator if tournament allows later registration, when tournament is already started */\n\tallowLateRegistration?: boolean;\n\t/** Minimum number of participant for this tournament. If tournament doesnt have enough registrations, it will not start */\n\tplayersMinCount?: number;\n\t/** Maximum number of participant for this tournament. When reached, new users won't be able to register */\n\tplayersMaxCount?: number;\n\t/** Tournament duration in millisecnnds */\n\tdurationMs?: number;\n\t/** prizes structure */\n\tprizeStructure?: {\n\t\tprizes: TournamentPrize[];\n\t};\n\t/** Information about current user */\n\ttournamentPlayer?: TournamentPlayer;\n\n\t/** List of casino games (or other types of entities) related to the tournament */\n\trelated_games?: AchRelatedGame[];\n\t/** The minimum amount of score points that the user should get in order to be qualified for the prize */\n\tminScoreToWin?: number;\n\t/** When enabled, users who don't meet the minimum qualifying score will be hidden from the Leaderboard. */\n\thideLeaderboardsMinScores?: boolean;\n\t/** Total scores across all participants in the tournament */\n\ttotalScores?: number;\n\t/** Indicates if the tournament is clan-based */\n\tisClanBased?: boolean;\n}\n\nexport const TournamentItemsTransform = (items: Tournament[]): TTournament[] => {\n\treturn items\n\t\t.filter((r) => r != null && r.tournamentId >= 1)\n\t\t.map((r) => {\n\t\t\tconst x: TTournament = {\n\t\t\t\tinstance_id: r.tournamentInstanceId,\n\t\t\t\ttournament_id: r.tournamentId,\n\t\t\t\tname: r.publicMeta.name,\n\t\t\t\tdescription: r.publicMeta.description,\n\t\t\t\tsegment_dont_match_message: r.publicMeta.segment_dont_match_message,\n\t\t\t\timage1: r.publicMeta.image_url,\n\t\t\t\timage2: r.publicMeta.image_url2,\n\t\t\t\timage2_mobile: r.publicMeta.image_url2_mobile,\n\t\t\t\tprize_pool_short: r.publicMeta.prize_pool_short,\n\t\t\t\tcustom_price_text: r.publicMeta.custom_price_text,\n\t\t\t\tcustom_section_id: r.publicMeta.custom_section_id,\n\t\t\t\tcustom_data: IntUtils.JsonOrText(r.publicMeta.custom_data),\n\t\t\t\tis_featured: r.publicMeta.featured,\n\t\t\t\tribbon: r.publicMeta.label_tag === 'custom' ? r.publicMeta.custom_label_tag : r.publicMeta.label_tag,\n\t\t\t\tpriority: r.publicMeta.position,\n\n\t\t\t\tstart_time: r.startTimeTs,\n\t\t\t\tend_time: r.endTimeTs,\n\t\t\t\tregistration_count: r.registrationCount,\n\t\t\t\tis_user_registered: r.isUserRegistered,\n\t\t\t\tplayers_min_count: r.playersMinCount,\n\t\t\t\tplayers_max_count: r.playersMaxCount,\n\t\t\t\tregistration_status: TournamentRegistrationStatusNamed(r.tournamentRegistrationStatus),\n\n\t\t\t\tregistration_type: TournamentRegistrationTypeGetName(r.registrationType),\n\t\t\t\t...(r.registrationType === TournamentRegistrationType.BUY_IN_POINTS ? { registration_cost_points: r.buyInAmount } : {}),\n\t\t\t\t...(r.registrationType === TournamentRegistrationType.BUY_IN_GEMS ? { registration_cost_gems: r.buyInAmount } : {}),\n\t\t\t\t...(r.registrationType === TournamentRegistrationType.BUY_IN_DIAMONDS ? { registration_cost_diamonds: r.buyInAmount } : {}),\n\t\t\t\tduration_ms: r.durationMs,\n\n\t\t\t\tis_active: TournamentUtils.isActive(r),\n\t\t\t\tis_can_register: TournamentUtils.isCanRegister(r),\n\t\t\t\tis_cancelled: TournamentUtils.isCancelled(r),\n\t\t\t\tis_finished: TournamentUtils.isFinished(r),\n\t\t\t\tis_in_progress: TournamentUtils.isInProgress(r),\n\t\t\t\tis_upcoming: TournamentUtils.isUpcoming(r),\n\n\t\t\t\tmin_scores_win: r.minScoreToWin,\n\t\t\t\thide_leaderboard_min_scores: r.hideLeaderboardsMinScores,\n\t\t\t\ttotal_scores: r.totalScores,\n\t\t\t\tis_clan_based: r.isClanBased,\n\t\t\t};\n\n\t\t\tif (r.prizeStructure) {\n\t\t\t\tx.prizes = r.prizeStructure.prizes.map((p) => TournamentUtils.getPrizeTransformed(p));\n\t\t\t}\n\n\t\t\tif (r.tournamentPlayer) {\n\t\t\t\tx.me = TournamentUtils.getPlayerTransformed(r.tournamentPlayer, true);\n\t\t\t}\n\n\t\t\treturn x;\n\t\t});\n};\n","import { Tournament, TournamentItemsTransform } from './Tournament';\nimport { TournamentPlayer } from './TournamentPlayer';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { TournamentPrize } from './TournamentPrize';\nimport { TTournamentDetailed } from '../WSAPI/WSAPITypes';\nimport { TournamentUtils } from './TournamentUtils';\nimport { ClanLeaderboardEntry, ClanPrizeStructureEntry } from './TournamentClan';\n\nexport interface GetTournamentInfoResponse extends ProtocolResponse {\n\t/** tournament info */\n\ttournamentInfo: {\n\t\t/** id of label, not in use */\n\t\tlabelId: number;\n\t\ttournamentLobbyInfo: Tournament;\n\t\t/** list of registered users */\n\t\tplayers: TournamentPlayer[];\n\t};\n\t/** information about current user position */\n\tuserPosition: TournamentPlayer;\n\t/** prizes structure */\n\tprizeStructure?: {\n\t\tprizes: TournamentPrize[];\n\t};\n\t/** Ranked list of clans in this tournament. Empty/null for non-clan tournaments. */\n\tclanLeaderboard?: ClanLeaderboardEntry[] | null;\n\t/**\n\t * The clan ID the current user belongs to.\n\t * null when the user has no clan or the tournament is not clan-based.\n\t * Match against clanLeaderboard[i].clan_id to highlight the user's clan row.\n\t */\n\tuserClanId?: number | null;\n\t/** Per-clan prize structure. Empty/null for non-clan tournaments. */\n\tclanPrizes?: ClanPrizeStructureEntry[] | null;\n}\n\nexport const tournamentInfoItemTransform = (t: GetTournamentInfoResponse): TTournamentDetailed => {\n\tconst response: TTournamentDetailed = {\n\t\t...TournamentItemsTransform([t.tournamentInfo?.tournamentLobbyInfo ?? null])?.[0],\n\t\trelated_games: (t.tournamentInfo.tournamentLobbyInfo.related_games || []).map((g, i) => ({\n\t\t\text_game_id: g.ext_game_id,\n\t\t\tgame_public_meta: {\n\t\t\t\tname: g.game_public_meta.name,\n\t\t\t\tlink: g.game_public_meta.link,\n\t\t\t\timage: g.game_public_meta.image,\n\t\t\t\tenabled: g.game_public_meta.enabled,\n\t\t\t\tgame_categories: g.game_public_meta.game_categories,\n\t\t\t\tgame_provider: g.game_public_meta.game_provider,\n\t\t\t\tmobile_spec_link: g.game_public_meta.mobile_spec_link,\n\t\t\t\tpriority: i + 1,\n\t\t\t},\n\t\t})),\n\t\tplayers: t.tournamentInfo.players.map((p) => TournamentUtils.getPlayerTransformed(p)),\n\t};\n\n\tif (t.prizeStructure) {\n\t\tresponse.prizes = t.prizeStructure.prizes.map((p) => TournamentUtils.getPrizeTransformed(p));\n\t}\n\n\tif (t.userPosition) {\n\t\tresponse.me = TournamentUtils.getPlayerTransformed(t.userPosition, true);\n\t}\n\n\tif (t.tournamentInfo?.tournamentLobbyInfo?.isClanBased) {\n\t\tresponse.is_clan_based = true;\n\t\tresponse.user_clan_id = t.userClanId ?? null;\n\t\tresponse.clan_leaderboard = t.clanLeaderboard\n\t\t\t? t.clanLeaderboard.map((entry) => ({\n\t\t\t\t\tclan_id: entry.clanId,\n\t\t\t\t\tpublic_meta: {\n\t\t\t\t\t\tname: entry.publicMeta.name,\n\t\t\t\t\t\tdescription: entry.publicMeta.description,\n\t\t\t\t\t\timage_url: entry.publicMeta.image_url,\n\t\t\t\t\t},\n\t\t\t\t\tposition: entry.rank,\n\t\t\t\t\ttotal_score: entry.totalScore,\n\t\t\t\t\tcontributing_members: entry.memberCount,\n\t\t\t  }))\n\t\t\t: null;\n\t\tresponse.clan_prize_structure = t.clanPrizes\n\t\t\t? t.clanPrizes.map((entry) => ({\n\t\t\t\t\tclan_place: entry.clan_place,\n\t\t\t\t\tprize_type_id: entry.prize_type_id,\n\t\t\t\t\tprize_pool_amount: entry.prize_pool_amount,\n\t\t\t\t\tprize_pool_currency_code: entry.prize_pool_currency_code,\n\t\t\t\t\tactivity_type_id: entry.activity_type_id,\n\t\t\t\t\tdetails_json: entry.details_json,\n\t\t\t\t\tpublic_meta: entry.public_meta\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tname: entry.public_meta.name,\n\t\t\t\t\t\t\t\tdescription: entry.public_meta.description,\n\t\t\t\t\t\t\t\timage_url: entry.public_meta.image_url,\n\t\t\t\t\t\t\t\tprize_name: entry.public_meta.prize_name,\n\t\t\t\t\t\t  }\n\t\t\t\t\t\t: null,\n\t\t\t\t\ttiers: (entry.player_tiers || []).map((tier) => ({\n\t\t\t\t\t\tplayer_place_from: tier.player_place_from,\n\t\t\t\t\t\tplayer_place_to: tier.player_place_to,\n\t\t\t\t\t\tpool_amount: tier.pool_amount,\n\t\t\t\t\t\tdistribution_type: tier.distribution_type,\n\t\t\t\t\t\tactivity_type_id: tier.activity_type_id,\n\t\t\t\t\t\tdetails_json: tier.details_json,\n\t\t\t\t\t\tpublic_meta: tier.public_meta\n\t\t\t\t\t\t\t? { name: tier.public_meta.name, description: tier.public_meta.description, image_url: tier.public_meta.image_url }\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t})),\n\t\t\t  }))\n\t\t\t: null;\n\t}\n\n\treturn response;\n};\n","/**\n * Error codes returned in `err_code` by the `registerInTournament` method.\n *\n * These are terse value definitions for lookup. The full per-code narrative —\n * when each fires and how the consumer's UI should react — lives in the\n * `registerInTournament` method TSDoc, which owns the error table.\n *\n * Note the numbering break: the gems / diamonds codes are 6-digit\n * (`300010` / `300011`) while the rest of the tournament block is 5-digit;\n * they were appended after the original `30001`–`30009` range was occupied.\n * Branch on the exact numeric value, not on digit count.\n */\nexport enum TournamentRegistrationError {\n\t/** Success — registration persisted; buy-in (if any) deducted. */\n\tNO_ERROR = 0,\n\t/** Clan-based tournament and the user does not belong to a clan yet. */\n\tTOURNAMENT_USER_CANNOT_JOIN_WITHOUT_CLAN = 1010,\n\t/** Instance id is invalid or the tournament was deleted. */\n\tTOURNAMENT_INSTANCE_NOT_FOUND = 30001,\n\t/** Insufficient points balance for a points-priced buy-in. */\n\tTOURNAMENT_REGISTRATION_NOT_ENOUGH_POINTS = 30002,\n\t/** Tournament is no longer in a registerable state (finished, cancelled, finalizing, or not yet open). */\n\tTOURNAMENT_INSTANCE_NOT_IN_STATE = 30003,\n\t/** User is already registered; treat as an idempotent success. */\n\tTOURNAMENT_ALREADY_REGISTERED = 30004,\n\t/** User does not satisfy the tournament's segment / entry conditions. */\n\tTOURNAMENT_USER_DONT_MATCH_CONDITIONS = 30005,\n\t/** User is not registered; anomalous on a register call (usually a server-side race). */\n\tTOURNAMENT_USER_NOT_REGISTERED = 30006,\n\t/** Registration status transition is not allowed (e.g. re-registering a finished tournament). */\n\tTOURNAMENT_CANT_CHANGE_REGISTRATION_STATUS = 30007,\n\t/** Tournament filled up — maximum registrations reached. */\n\tTOURNAMENT_MAX_REGISTRATIONS_REACHED = 30008,\n\t/**\n\t * The user's wallet currency could not be resolved. Emitted server-side\n\t * during tournament score processing, NOT during registration — it is\n\t * never returned by `registerInTournament`. Included for completeness.\n\t */\n\tTOURNAMENT_INVALID_USER_CURRENCY = 30009,\n\t/** Insufficient gems balance for a gems-priced buy-in. */\n\tTOURNAMENT_REGISTRATION_NOT_ENOUGH_GEMS = 300010,\n\t/** Insufficient diamonds balance for a diamonds-priced buy-in. */\n\tTOURNAMENT_REGISTRATION_NOT_ENOUGH_DIAMONDS = 300011,\n}\n","export enum TournamentType {\n\tSCHEDULED = 1,\n\tSNG = 2,\n\tTEST = 3,\n}\n","export enum LeaderBoardPeriodType {\n\tDAILY = 1,\n\tWEEKLY = 2,\n\tMONTHLY = 3,\n}\n","import { LeaderBoardDetailsT, LeaderBoardUserT, LeaderBoardsRewardsT } from '../WSAPI/WSAPITypes';\nimport { LeaderBoardDetails } from './LeaderBoardDetails';\nimport { LeaderBoardPeriodType } from './LeaderBoardPeriodType';\nimport { LeaderBoardPosition } from './LeaderBoardPosition';\n\nconst pointsRewardTransform = (reward_points: number[]): LeaderBoardsRewardsT[] => {\n\tif (reward_points && reward_points.length) {\n\t\treturn reward_points.map((r, i) => ({ place: i + 1, points: r }));\n\t}\n\n\treturn null;\n};\n\nconst getLeaderBoardPlayerTransformed = (user: LeaderBoardPosition, isMe?: boolean): LeaderBoardUserT => {\n\tif (user) {\n\t\treturn {\n\t\t\tpublic_username: user?.public_username || user.user_alt_name,\n\t\t\tavatar_url: user.avatar_url,\n\t\t\tlevel_id: user.level_id,\n\t\t\tposition: user.position_in_board,\n\t\t\tpoints: user.points_accumulated,\n\t\t\t// The `me` entry is the current user by definition, so force `true`\n\t\t\t// there; list rows carry the server-provided flag.\n\t\t\tis_me: isMe ? true : user.is_me,\n\t\t};\n\t}\n\n\treturn null;\n};\n\nexport const getLeaderBoardTransform = (board: LeaderBoardDetails): LeaderBoardDetailsT => {\n\tif (board) {\n\t\treturn {\n\t\t\tboard_id: board.board_id,\n\t\t\tname: board.board_public_meta.name,\n\t\t\tdescription: board.board_public_meta.description,\n\t\t\trules: board.board_public_meta.rules,\n\t\t\tperiod_type_id: board.period_type_id,\n\t\t\tversion_id: board.versiod_id,\n\t\t\tcreate_date: board.create_date,\n\t\t\trewards: pointsRewardTransform(board.reward_points),\n\t\t\tusers: (board.positions || []).map((p) => getLeaderBoardPlayerTransformed(p)),\n\t\t\tme: getLeaderBoardPlayerTransformed(board.userPosition, true),\n\t\t};\n\t}\n\n\treturn null;\n};\n","import { IntUtils } from '../IntUtils';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { TLevel } from '../WSAPI/WSAPITypes';\nimport { Level } from './Level';\n\nexport interface GetLevelMapResponse extends ProtocolResponse {\n\tlevels: Level[];\n}\n\nexport const GetLevelMapResponseTransform = (levels: GetLevelMapResponse): TLevel[] => {\n\tif (!levels?.levels) return [];\n\n\tconst mapped = levels.levels.map((l) => ({\n\t\tid: l.level_id,\n\t\tname: l.level_public_meta.name,\n\t\tdescription: l.level_public_meta.description,\n\t\timage: l.level_public_meta.image_url,\n\t\trequired_points: l.required_points,\n\t\tvisibility_points: l.level_public_meta.visibility_points ? parseInt(l.level_public_meta.visibility_points as any) : null,\n\t\trequired_level_counter_1: l.required_level_counter_1,\n\t\trequired_level_counter_2: l.required_level_counter_2,\n\t\tcustom_data: IntUtils.JsonOrText(l.level_public_meta?.custom_data),\n\t\tordinal_position: 0,\n\t}));\n\n\tconst ordinalById = new Map<number, number>();\n\t[...mapped]\n\t\t.sort((a, b) => a.required_points - b.required_points)\n\t\t.forEach((l, index) => ordinalById.set(l.id, index + 1));\n\n\treturn mapped.map((l) => ({ ...l, ordinal_position: ordinalById.get(l.id) }));\n};\n","import { ECacheContext, OCache } from '../OCache';\nimport { SmarticoAPI } from '../SmarticoAPI';\n\n/** @hidden */\nexport const CACHE_DATA_SEC = 30;\n\n/** @hidden */\nexport const JACKPOT_TEMPLATE_CACHE_SEC = 30;\n/** @hidden */\nexport const JACKPOT_POT_CACHE_SEC = 1;\n/** @hidden */\nexport const JACKPOT_WINNERS_CACHE_SEC = 30;\n/** @hidden */\nexport const JACKPOT_ELIGIBLE_GAMES_CACHE_SEC = 30;\n\n/** @hidden */\nexport enum onUpdateContextKey {\n\tSaw = 'saw',\n\tMissions = 'missions',\n\tTournamentList = 'tournamentList',\n\tInboxMessages = 'inboxMessages',\n\tBadges = 'badges',\n\tLevels = 'levels',\n\tStoreItems = 'storeItems',\n\tStoreCategories = 'storeCategories',\n\tAchCategories = 'achCategories',\n\tLeaderBoards = 'leaderBoards',\n\tLevelExtraCounters = 'levelExtraCounters',\n\tSegments = 'segments',\n\tStoreHistory = 'storeHistory',\n\tJackpots = 'jackpots',\n\tPots = 'Pots',\n\tCustomSections = 'customSections',\n\tBonuses = 'bonuses',\n\tClans = 'clans',\n\tSAWHistory = 'sawHistory',\n\tJackpotWinners = 'jackpotWinners',\n\tRaffles = 'raffles',\n\tJackpotEligibleGames = 'jackpotEligibleGames',\n\tCurrentLevel = 'currentLevel',\n\tInboxUnreadCount = 'inboxUnreadCount',\n\tActivityLog = 'activityLog',\n\tAvatarsList = 'avatarsList',\n\tAvatarsCustomized = 'avatarsCustomized',\n\tAvatarPrompts = 'avatarPrompts',\n}\n\n/**\n * Abstract base of the SDK's public surface. Holds the shared state\n * (`api`, `userExtId`, `onUpdateCallback` map) and the generic cache /\n * subscription helper (`updateEntity`). Domain-specific methods live on\n * subclasses; the terminator `WSAPI` class composes the whole chain.\n *\n * **Consumers should not instantiate this directly** — the SDK constructs\n * the concrete `WSAPI` via `_smartico.api`.\n *\n * @hidden\n */\nexport abstract class WSAPIBase {\n\t/** @hidden */\n\tprotected onUpdateCallback: Map<onUpdateContextKey, (data: any) => void> = new Map();\n\n\t/** @hidden */\n\tprotected userExtId: string = null;\n\n\t/** @private */\n\tconstructor(protected api: SmarticoAPI, userExtId: string = null) {\n\t\tthis.userExtId = userExtId;\n\t\tOCache.clearAll();\n\t}\n\n\t/** @private */\n\t// AA: this method is used from the _smartico script to clear cache when the context is changed,\n\t// e.g. when user is changed or language is changed\n\tpublic clearCaches() {\n\t\tOCache.clearAll();\n\t}\n\n\t/**\n\t * Generic cache-update + subscription-notify helper. Used by domain\n\t * classes' `update*` methods to refresh a context and fire any\n\t * registered `onUpdate` callback.\n\t * @hidden\n\t */\n\tprotected async updateEntity(contextKey: onUpdateContextKey, payload: any) {\n\t\tOCache.set(contextKey, payload, ECacheContext.WSAPI);\n\n\t\tconst onUpdate = this.onUpdateCallback.get(contextKey);\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tonUpdate(payload);\n\t\t}\n\t}\n}\n","import { TRaffle, TRaffleDraw, TRafflePrize, TRafflePrizeWinner, TRaffleTicket } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { Raffle } from './Raffle';\nimport { RaffleDraw } from './RaffleDraw';\nimport { RafflePrize } from './RafflePrize';\nimport { RafflePrizeWinner } from './RafflePrizeWinner';\nimport { RaffleTicket } from './RaffleTicket';\n\nexport interface GetRafflesResponse extends ProtocolResponse {\n\titems: Raffle[];\n}\n\n/** @hidden */\nexport const ticketsTransform = (items: RaffleTicket[]): TRaffleTicket[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tticekt_id: item.id,\n\t\t\tticket_id_string: item.s,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const winnersTransform = (items: RafflePrizeWinner[]): TRafflePrizeWinner[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.user_id,\n\t\t\tusername: item.public_username,\n\t\t\tavatar_url: item.avatar_url || item.avatar_id,\n\t\t\tticket: { ticekt_id: item.ticket.id, ticket_id_string: item.ticket.s },\n\t\t\traf_won_id: item.raf_won_id,\n\t\t\tclaimed_date: item.claimed_date,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const prizeTransform = (items: RafflePrize[]): TRafflePrize[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.prize_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription: item.public_meta.description,\n\t\t\timage_url: item.public_meta.image_url,\n\t\t\tcustom_data: item.public_meta.custom_data,\n\t\t\tprizes_per_run: item.prizes_per_run,\n\t\t\tprizes_per_run_actual: item.prizes_per_run_actual,\n\t\t\tchances_to_win_perc: item.chances_to_win_perc,\n\t\t\tmin_required_total_tickets: item.min_required_total_tickets,\n\t\t\tcap_prizes_per_run: item.cap_prizes_per_run,\n\t\t\tpriority: item.priority,\n\t\t\tstock_items_per_draw: item.stock_items_per_draw,\n\t\t\tshould_claim: item.should_claim,\n\t\t\twinners: winnersTransform(item.winners),\n\t\t\trequires_claim: item.requires_claim,\n\t\t\tmin_required_tickets_for_user: item.min_required_tickets_for_user,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const drawTransform = (items: RaffleDraw[]): TRaffleDraw[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.draw_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription: item.public_meta.description,\n\t\t\timage_url: item.public_meta.image_url,\n\t\t\timage_url_mobile: item.public_meta.image_url_mobile,\n\t\t\ticon_url: item.public_meta.icon_url,\n\t\t\tbackground_image_url: item.public_meta.background_image_url,\n\t\t\tbackground_image_url_mobile: item.public_meta.background_image_url_mobile,\n\t\t\tis_grand: item.public_meta.is_grand,\n\t\t\tprizes: prizeTransform(item.prizes),\n\t\t\tcurrent_state: item.current_state,\n\t\t\trun_id: item.run_id,\n\t\t\texecution_type: item.execution_type,\n\t\t\texecution_ts: item.execution_ts,\n\t\t\tprevious_run_ts: item.previous_run_ts,\n\t\t\tprevious_run_id: item.previous_run_id,\n\t\t\tticket_start_ts: item.ticket_start_ts,\n\t\t\tallow_multi_prize_per_ticket: item.allow_multi_prize_per_ticket,\n\t\t\ttotal_tickets_count: item.total_tickets_count,\n\t\t\tmy_tickets_count: item.my_tickets_count,\n\t\t\tmy_last_tickets: ticketsTransform(item.my_last_tickets),\n\t\t\tuser_opted_in: Boolean(item.user_opted_in),\n\t\t\trequires_optin: Boolean(item.requires_optin),\n\t\t\tis_active: Boolean(item.is_active),\n\t\t\twinners_limit: item.winners_limit,\n\t\t\twinners_offset: item.winners_offset,\n\t\t\twinners_total: item.winners_total,\n\t\t};\n\t});\n};\n\n/** @hidden */\nexport const raffleTransform = (items: Raffle[]): TRaffle[] => {\n\treturn items.map((item) => {\n\t\treturn {\n\t\t\tid: item.raffle_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription: item.public_meta.description,\n\t\t\tcustom_section_id: item.public_meta.custom_section_id,\n\t\t\timage_url: item.public_meta.image_url,\n\t\t\timage_url_mobile: item.public_meta.image_url_mobile,\n\t\t\tcustom_data: item.public_meta.custom_data,\n\t\t\tstart_date: item.start_date_ts,\n\t\t\tend_date: item.end_date_ts,\n\t\t\tmax_tickets_count: item.max_tickets_count,\n\t\t\tcurrent_tickets_count: item.current_tickets_count,\n\t\t\tdraws: drawTransform(item.draws),\n\t\t\tticket_cap_visualization: item.public_meta.ticket_cap_visualization,\n\t\t};\n\t});\n};\n","import { TRaffleDraw } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { RaffleDraw } from './RaffleDraw';\nimport { prizeTransform, ticketsTransform } from './GetRafflesResponse';\n\nexport interface GetDrawRunResponse extends ProtocolResponse {\n\tdraw: RaffleDraw;\n}\n\n/** @hidden */\nexport const drawRunTransform = (res: GetDrawRunResponse): TRaffleDraw => {\n\treturn {\n\t\tid: res.draw.draw_id,\n\t\tname: res.draw.public_meta.name,\n\t\tdescription: res.draw.public_meta.description,\n\t\timage_url:res.draw.public_meta.image_url,\n\t\timage_url_mobile:res.draw.public_meta.image_url_mobile,\n\t\ticon_url: res.draw.public_meta.icon_url,\n\t\tbackground_image_url: res.draw.public_meta.background_image_url,\n\t\tbackground_image_url_mobile: res.draw.public_meta.background_image_url_mobile,\n\t\tis_grand: res.draw.public_meta.is_grand,\n\t\tprizes: prizeTransform(res.draw.prizes),\n\t\tcurrent_state: res.draw.current_state,\n\t\trun_id: res.draw.run_id,\n\t\texecution_type: res.draw.execution_type,\n\t\texecution_ts: res.draw.execution_ts,\n\t\tprevious_run_ts: res.draw.previous_run_ts,\n\t\tprevious_run_id: res.draw.previous_run_id,\n\t\tticket_start_ts: res.draw.ticket_start_ts ?? res.draw['ticket_start_date'],\n\t\tallow_multi_prize_per_ticket: res.draw.allow_multi_prize_per_ticket,\n\t\ttotal_tickets_count: res.draw.total_tickets_count,\n\t\tmy_tickets_count: res.draw.my_tickets_count,\n\t\tmy_last_tickets: ticketsTransform(res.draw.my_last_tickets),\n\t\tuser_opted_in: Boolean(res.draw.user_opted_in),\n\t\trequires_optin: Boolean(res.draw.requires_optin),\n\t\tis_active: Boolean(res.draw.is_active),\n\t\twinners_limit: res.draw.winners_limit,\n\t\twinners_offset: res.draw.winners_offset,\n\t\twinners_total: res.draw.winners_total,\n\t} \t\n};","import { RaffleDraw } from \"./RaffleDraw\";\n\nexport enum RaffleTicketCapVisualization {\n\t/** Show nothing */\n\tEmpty = 0,\n\t/** Show ticket counter */\n\tCounter = 1,\n\t/** Show message when ticket cap is reached */\n\tMessage = 2,\n}\n\ninterface RafflePublicMeta {\n    /** Name of the raffle */\n    name: string;\n    /** Description of the raffle */\n    description: string;\n    /** ID of the custom section that is linked to the raffle in the Gamification widget */\n    custom_section_id: number;\n    /** URL of the image that represents the raffle */\n    image_url: string;\n    /** URL of the mobile image that represents the raffle */\n    image_url_mobile: string;\n     /** Text for Terms and Conditions */\n    hint_text:string;\n    /** \n\t * Custom data as string or JSON string that can be used in API to build custom UI\n\t * You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice\n\t * Read more here - <https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes>\n     */\n\tcustom_data: string;\n\n    /**\n     * - Value 1 (Counter): Shows a real-time \"Tickets Remaining\" display available during the whole Raffle activity.\n     * - Value 2 (Message): Will show a specific message that triggers only when the cap is reached and inform users that tickets will be no longer be issued.\n     */\n    ticket_cap_visualization?: RaffleTicketCapVisualization;\n}\n\n\ninterface Raffle {\n    /** ID of the Raffle template */\n    raffle_id: number;\n    /** Meta information about raffle for the presentation on UI */\n    public_meta: RafflePublicMeta;\n    /** Date of start */\n    start_date_ts: number;\n    /** Date of end */\n    end_date_ts: number;    \n    /** Maximum numer of tickets that can be given to all users for the whole period of raffle */\n    max_tickets_count: number;\n    /** \n     * Number of tickets that are already given to all users for this raffle\n     */\n    current_tickets_count: number;\n\n    /** \n     * List of draws that are available for this raffle.\n     * For example, if the raffle is containg one hourly draw, one daily draw and one draw on fixed date like 01/01/2022,\n     * Then the list will always return 3 draws, no matter if the draws are already executed or they are in the future.\n     */\n    draws: RaffleDraw[]\n\n}\n\nexport { Raffle, RafflePublicMeta };\n","import { RaffleDrawPublicMeta } from \"./RaffleDrawPublicMeta\";\nimport { RafflePrize } from \"./RafflePrize\";\nimport { RaffleTicket } from \"./RaffleTicket\";\n\nexport enum RaffleDrawInstanceState {\n    /** Draw is open for the tickets collection */\n    Open = 1,\n    /** Winner selection is in progress */\n    WinnerSelection = 2,\n    /** Draw is executed and the winners are selected */\n    Executed = 3,\n}\n\nexport enum RaffleDrawTypeExecution {\n    /** Draw is executed only once */\n    ExecDate = 0,\n    /** Draw is executed on a recurring basis */\n    Recurring = 1,\n    /** \n     * Draw is executed once and is marked as grand.\n     * This means it is a special or significant draw,\n     * often with larger prizes or more importance.\n     */\n    Grand = 2,\n}\n\n\ninterface RaffleDraw {\n    /** \n     * Id of the Draw definition, for the repetative draws (e.g. daily), this number will be the same for all draws that are repeating daily\n     * (internal name: schedule_id)\n     */\n    draw_id: number;\n\n    /** Meta information of the Draw for the presentaiton in UI */\n    public_meta: RaffleDrawPublicMeta;\n\n    /** Information about prizes in the draw */\n    prizes: RafflePrize[];\n\n    /** \n     * State of current instance of Draw\n     */\n    current_state: RaffleDrawInstanceState;\n\n    /** \n     * Field indicates the ID of the latest instance/run of draw\n    */\n    run_id: number;\n\n    /** \n     * Type of the draw execution, indicating how and when the draw is executed.\n     * \n     * - ExecDate: Draw is executed only once at a specific date and time.\n     * - Recurring: Draw is executed on a recurring basis (e.g., daily, weekly).\n     * - Grand: Draw is executed once and is marked as grand, often with larger prizes or more importance.\n     */\n    execution_type: RaffleDrawTypeExecution;\n\n    /** Date/time of the draw execution */\n    execution_ts: number;\n    \n    /** Date of the previously executed draw (if there is such) */\n    previous_run_ts?: number;\n\n    /** Unique ID of the previusly executed draw (if there is such) */\n    previous_run_id?: number;    \n\n    /** \n     * Date/time starting from which the tickets will participate in the upcoming draw\n     * This value need to be taken into account with next_execute_ts field value, for example\n     * Next draw is at 10:00, ticket_start_date is 9:00, so all tickets that are collected after 9:00 will participate in the draw at 10:00\n     * (internally this value is calculated as next_execute_ts - ticket_start_date)\n     */\n    ticket_start_ts: number;\n\n    /** \n     * Field is indicating if same ticket can win multiple prizes in the same draw\n     * For example there are 3 types of prizes in the draw - iPhone, iPad, MacBook\n     * If this field is true, then one ticket can win all 3 prizes (depending on the chances of course),\n     * if false, then one ticket can win only one prize.\n     * The distribution of the prizes is start from top (assuming on top are the most valuable prizes) to bottom (less valuable prizes)\n     * If specific prize has multiple values, e.g. we have 3 iPhones,\n     * then the same ticket can win only one prize of a kind, but can win multiple prizes of different kind (if allow_multi_prize_per_ticket is true)\n    */\n    allow_multi_prize_per_ticket: boolean;\n\n\n    /** \n     * The number of tickets that are already given to all users for this instance of draw.\n     * In other words tickets that are collected between ticket_start_date and current time (or till current_execution_ts is the instance is executed).\n     */\n    total_tickets_count: number;\n\n    /** \n     * The number of tickets collected by current user for this instance of draw.\n     */\n    my_tickets_count: number;\n\n    /**\n     * List of last 5 tickets are collected by current user for this instance of draw.\n     */\n    my_last_tickets: RaffleTicket[];\n\t/**\n\t * If true, the user has opted-in to the raffle.\n\t */\n\tuser_opted_in: boolean;\n\t/**\n\t * If true, the user needs to opt-in to the raffle before they can participate.\n\t */\n\trequires_optin: boolean;\n\n    /**\n     * If true, the draw is active and can be participated in.\n     */\n    is_active: boolean;\n    /**\n     * The number of winners to return\n     */\n\twinners_limit?: number;\n\n    /**\n     * The offset of the winners to return\n     */\n\twinners_offset?: number;\n\n    /**\n     * The total number of winners\n     */\n\twinners_total?: number;\n}\n\nexport { RaffleDraw };\n","import { TRaffleDrawRun } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { RaffleDrawRun } from './RaffleDrawRun';\n\nexport interface GetRaffleDrawRunsHistoryResponse extends ProtocolResponse {\n\tdraw_runs: RaffleDrawRun[];\n}\n\n/** @hidden */\nexport const drawRunHistoryTransform = (res: GetRaffleDrawRunsHistoryResponse): TRaffleDrawRun[] => {\n\treturn res.draw_runs.map((item) => {\n\t\treturn {\n\t\t\tid: item.draw_id,\n\t\t\trun_id: item.run_id,\n\t\t\tname: item.public_meta.name,\n\t\t\tdescription:  item.public_meta.description,\n\t\t\timage_url:  item.public_meta.image_url,\n\t\t\timage_url_mobile:  item.public_meta.image_url_mobile,\n\t\t\ticon_url:  item.public_meta.icon_url,\n\t\t\tbackground_image_url:  item.public_meta.background_image_url,\n\t\t\tbackground_image_url_mobile:  item.public_meta.background_image_url_mobile,\n\t\t\tis_grand:  item.public_meta.is_grand,\n\t\t\texecution_ts: item.execution_ts,\n\t\t\tactual_execution_ts:item.actual_execution_ts,\n\t\t\tticket_start_ts:item.ticket_start_ts,\n\t\t\tis_winner:item.is_winner,\n\t\t\thas_unclaimed_prize:item.has_unclaimed_prize\n\t\t};\n\t});\n};\n","import { TransformedRaffleClaimPrizeResponse } from \"../WSAPI/WSAPITypes\";\nimport { ProtocolResponse } from \"../Base/ProtocolResponse\";\n\nexport interface RaffleClaimPrizeResponse extends ProtocolResponse {\n    errCode: number\n    errMsg?: string\n}\n\n/** @hidden */\nexport const raffleClaimPrizeResponseTransform = (info: RaffleClaimPrizeResponse): TransformedRaffleClaimPrizeResponse => {\n    return {\n        errorCode: info.errCode,\n        errorMessage: info.errMsg\n    }\n}\n","import { CoreUtils } from '../Core';\nimport { ECacheContext, OCache } from '../OCache';\nimport {\n\tTActivityLog,\n\tTLevel,\n\tTLevelCurrent,\n\tTSegmentCheckResult,\n\tTUserProfile,\n\tUserLevelExtraCountersT,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIBase } from './WSAPIBase';\n\n/** @group User */\nexport class WSAPIUser extends WSAPIBase {\n\t/**\n\t * Returns the current user's public profile — the source of truth for\n\t * balances (points / gems / diamonds), the current level ID, the\n\t * display username + avatar, language, public tags, and the inbox\n\t * unread count. **This method is synchronous** (returns `TUserProfile`,\n\t * not a Promise): the SDK keeps a local snapshot of the user's public\n\t * properties that is initialised at identify time and kept live by a\n\t * server-driven update channel — every call returns the latest cached\n\t * values without a network round-trip.\n\t *\n\t * Subscribe to changes by registering a callback on `_smartico.on('props_change', ...)`\n\t * — the callback fires with the full snapshot at identify and with\n\t * partial-key updates on every subsequent server push (typically\n\t * under 1 second after the underlying state change).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * The tracker must be initialised — calling this before the identify\n\t * round-trip completes throws (`\"Tracker is not initialized, cannot\n\t * getUserProfile\"`). Safe ways to wait for readiness:\n\t * - register `_smartico.on('identify', (errCode, props) => ...)` —\n\t *   fires once after a successful identify with the full props\n\t * - register `_smartico.on('props_change', () => ...)` — fires first\n\t *   at identify with the full snapshot, then on every push update\n\t *\n\t * **What's kept live (push-updated)**\n\t * Balance fields (`ach_points_balance`, `ach_gems_balance`,\n\t * `ach_diamonds_balance`, `ach_points_ever`), `ach_level_current_id`,\n\t * `core_public_tags`, `core_inbox_unread_count`, `core_user_language`,\n\t * `avatar_url`, `public_username`, and the AI-driven recommended-amount\n\t * fields all flow over the SDK's user-properties update channel as\n\t * partial updates — the snapshot is patched in place when any of them\n\t * change server-side. Re-call `getUserProfile()` (or watch\n\t * `props_change`) to observe new values.\n\t *\n\t * **Reading state from the returned profile**\n\t * Balances (`ach_points_balance`, `ach_gems_balance`,\n\t * `ach_diamonds_balance`) are the canonical source for affordability\n\t * checks across the SDK — compare against `entry_fee_amount` (clans),\n\t * `registration_cost_points` / `_gems` / `_diamonds` (tournaments), and\n\t * `price` / `discounted_price` + `purchase_type` (store items).\n\t * `ach_points_ever` is monotonic — store purchases deduct from\n\t * `ach_points_balance` but NEVER from `ach_points_ever`, so it remains\n\t * useful for level-progress math (`required_points` on the next\n\t * {@link getLevels} entry minus `ach_points_ever`). `ach_level_current_id`\n\t * is the FK into the level ladder — resolve metadata via\n\t * {@link getCurrentLevel} (richer, includes progress %) or\n\t * {@link getLevels} (full ladder lookup table).\n\t *\n\t * **Inbox unread count** — `core_inbox_unread_count` on this profile\n\t * is push-updated in real time (under 1 second). For an inbox badge,\n\t * prefer this field over `getInboxUnreadCount` (which is cached\n\t * for 30 s) — same value, fresher signal.\n\t *\n\t * **Language**: `core_user_language` reflects the server's stored\n\t * language. If the consumer just called `_smartico.changeLanguage(...)`,\n\t * the field may briefly lag the local intent until the server push\n\t * arrives. Use `_smartico.getPublicProps()` for the\n\t * client-fallback-applied version if instant accuracy matters.\n\t *\n\t * **Idempotency / Side effects**: trivially safe — no network call,\n\t * no state mutation.\n\t *\n\t * **UI guidance**: see [UI Guide — `getUserProfile`](../../docs/ui/user/UIGuide_getUserProfile.md).\n\t *\n\t * **Visitor mode**: not supported — throws. Visitor sessions do not\n\t * have a public-profile snapshot.\n\t *\n\t * @returns The current cached `TUserProfile` snapshot. A shallow copy —\n\t *          mutating it does not affect the SDK's internal state.\n\t * @throws  `Error(\"Tracker is not initialized, cannot getUserProfile\")`\n\t *          if called before identify completes or from a visitor session.\n\t *\n\t * @example\n\t * ```ts\n\t * // Wait for identify before calling.\n\t * window._smartico.on('identify', (errCode) => {\n\t *   if (errCode !== 0) return;\n\t *   const profile = window._smartico.api.getUserProfile();\n\t *   console.log('[smartico] initial profile loaded — render the user widget:', profile);\n\t * });\n\t *\n\t * // Stay in sync with live updates.\n\t * window._smartico.on('props_change', (changed) => {\n\t *   // `changed` is the partial keys for this push (full snapshot at identify).\n\t *   const profile = window._smartico.api.getUserProfile();\n\t *   console.log('[smartico] profile updated — re-render any widgets bound to:', Object.keys(changed),\n\t *     '— balances now:', profile.ach_points_balance, profile.ach_gems_balance, profile.ach_diamonds_balance);\n\t *\n\t *   // React to specific fields.\n\t *   if ('ach_level_current_id' in changed) {\n\t *     console.log('[smartico] level changed — call getCurrentLevel() for richer detail, animate the level badge');\n\t *   }\n\t *   if ('core_inbox_unread_count' in changed) {\n\t *     console.log('[smartico] inbox unread count changed — update the badge to:', profile.core_inbox_unread_count);\n\t *   }\n\t * });\n\t *\n\t * // Affordability gating example — used inside a clan / tournament / store CTA handler.\n\t * const profile = window._smartico.api.getUserProfile();\n\t * const item = await window._smartico.api.getStoreItems().then(items => items[0]);\n\t * const price = item.discounted_price ?? item.price;\n\t * const balance = {\n\t *   points: profile.ach_points_balance,\n\t *   gems: profile.ach_gems_balance,\n\t *   diamonds: profile.ach_diamonds_balance,\n\t * }[item.purchase_type];\n\t * if (balance < price) {\n\t *   console.log('[smartico] insufficient', item.purchase_type, '— disable Buy and show deficit', price - balance);\n\t * }\n\t * ```\n\t */\n\tpublic getUserProfile(): TUserProfile {\n\t\tif (this.api.tracker) {\n\t\t\tconst o: TUserProfile = Object.assign({}, this.api.tracker.userPublicProps);\n\t\t\to.avatar_url = CoreUtils.avatarUrl(this.api.tracker.userPublicProps.avatar_id, this.api.avatarDomain);\n\t\t\treturn o;\n\t\t} else {\n\t\t\tthrow new Error('Tracker is not initialized, cannot getUserProfile');\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether the current user matches a single segment, returning\n\t * `true` / `false` directly. Use this as a decision primitive to gate\n\t * UI surfaces (e.g. show a \"VIP lounge\" tab only when the user is in\n\t * the VIP segment), or to drive segment-specific CTA copy.\n\t *\n\t * Every call is a server round-trip — there is no SDK-side cache. For\n\t * checking multiple segments in one round-trip, use\n\t * {@link checkSegmentListMatch} instead.\n\t *\n\t * @remarks\n\t * **Refresh model**\n\t * - **No client cache.** Every call sends a request; the SDK does not\n\t *   memoize results.\n\t * - **No push event** notifies the consumer when segment membership\n\t *   flips (the user crosses a qualification threshold, or the\n\t *   operator changes the segment definition). Membership changes\n\t *   become visible only on the next `checkSegmentMatch` call.\n\t * - **Behavioral segments (configured against BigQuery) have batch\n\t *   lag** — even if the user's activity has changed (deposit, wager,\n\t *   etc.), the segment-membership result may not reflect that change\n\t *   until the next batch evaluation run (typically up to several\n\t *   hours).\n\t *\n\t * **Rate limit** (important)\n\t * The server caps `checkSegment*` calls at **10 requests per\n\t * 60-second window**, with a minimum gap of **~5 seconds between\n\t * consecutive calls**. Avoid calling on every render — cache the\n\t * result client-side for the session, or until you have a reason to\n\t * believe the user's state changed (e.g. after a deposit completes,\n\t * a level changes via {@link getUserProfile}'s `props_change`, or a\n\t * specific custom event fires).\n\t *\n\t * **`is_matching: false` is ambiguous on the server** — both \"the\n\t * segment doesn't exist for this label\" and \"the user doesn't\n\t * qualify\" return `false` with no distinguishing signal. Pass IDs\n\t * you've verified are valid for your label.\n\t *\n\t * **Idempotency**: safe. Read-only. No side effects (no analytics\n\t * events, no DB writes).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param segment_id  The segment ID. Segment IDs are label-scoped;\n\t *                    the same numeric ID can refer to different\n\t *                    segments under different labels. Use the IDs\n\t *                    configured for your label.\n\t * @returns           `true` if the user currently matches the\n\t *                    segment, `false` otherwise. `false` also covers\n\t *                    the \"segment doesn't exist for this label\"\n\t *                    case — these are not distinguishable.\n\t *\n\t * @example\n\t * ```ts\n\t * const isVip = await window._smartico.api.checkSegmentMatch(vipSegmentId);\n\t * if (isVip) {\n\t *   console.log('[smartico] user is in VIP segment — render the VIP-only widget surface');\n\t * } else {\n\t *   console.log('[smartico] user not in VIP segment (or segment id misconfigured) — hide the VIP surface');\n\t * }\n\t *\n\t * // Cache the result for the session; re-check after material user-state changes.\n\t * window._smartico.on('props_change', async (changed) => {\n\t *   if ('ach_points_ever' in changed || 'ach_level_current_id' in changed) {\n\t *     const fresh = await window._smartico.api.checkSegmentMatch(vipSegmentId);\n\t *     console.log('[smartico] user state changed — VIP membership now:', fresh);\n\t *   }\n\t * });\n\t * ```\n\t */\n\tpublic async checkSegmentMatch(segment_id: number): Promise<boolean> {\n\t\tconst r = await this.api.coreCheckSegments(this.userExtId, [segment_id]);\n\t\tif (r && r.find((s) => s.segment_id === segment_id && s.is_matching)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Checks the current user's membership in multiple segments in a\n\t * single server round-trip — returns a `TSegmentCheckResult[]` with\n\t * one entry per *unique* segment ID. Use this instead of looping\n\t * {@link checkSegmentMatch} when you need to evaluate several\n\t * segments at once (e.g. multi-segment composite gating, A/B-style\n\t * cohort detection).\n\t *\n\t * @remarks\n\t * **Response order is NOT guaranteed**\n\t * The server returns results in an unspecified order — different\n\t * from the input array. Always correlate by the `segment_id` field on\n\t * each `TSegmentCheckResult` rather than by array position. The\n\t * returned array length may also be smaller than the input array\n\t * (duplicate IDs are silently de-duplicated server-side).\n\t *\n\t * **Single round-trip**\n\t * The entire `segment_ids` array is sent in one request. Two segments\n\t * cost the same as one in terms of network latency and rate-limit\n\t * consumption (one call = one rate-limit slot, regardless of how many\n\t * segments).\n\t *\n\t * **Shared semantics with `checkSegmentMatch`**\n\t * Both methods wrap the same underlying server endpoint and share\n\t * the same caching, refresh, rate-limit, and ambiguity behavior. See\n\t * {@link checkSegmentMatch} for: no client cache · no push event for\n\t * membership changes · behavioral segments have batch lag · rate\n\t * limit (10 requests / 60 s, ~5 s minimum gap between calls) ·\n\t * `is_matching: false` doesn't distinguish \"not in segment\" from\n\t * \"segment doesn't exist for this label\".\n\t *\n\t * **Idempotency**: safe. Read-only. No side effects.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param segment_ids  Array of segment IDs to check. Duplicates are\n\t *                     silently de-duplicated server-side. Segment IDs\n\t *                     are label-scoped — use the IDs configured for\n\t *                     your label.\n\t * @returns            Array of `{ segment_id, is_matching }` results.\n\t *                     Order is NOT guaranteed; correlate by\n\t *                     `segment_id`. Length may be less than the input\n\t *                     when duplicate IDs were sent.\n\t *\n\t * @example\n\t * ```ts\n\t * const segmentIds = [vipSegmentId, newPlayerSegmentId, freeRollSegmentId];\n\t * const results = await window._smartico.api.checkSegmentListMatch(segmentIds);\n\t *\n\t * // Always correlate by segment_id — the response order is unspecified.\n\t * const byId = new Map(results.map(r => [r.segment_id, r.is_matching]));\n\t *\n\t * if (byId.get(vipSegmentId)) {\n\t *   console.log('[smartico] user is in VIP segment — render VIP surface');\n\t * }\n\t * if (byId.get(newPlayerSegmentId) && byId.get(freeRollSegmentId)) {\n\t *   console.log('[smartico] new player AND eligible for free roll — show the welcome promo');\n\t * }\n\t *\n\t * // Cache the result map for the session; refresh on material state changes.\n\t * ```\n\t */\n\tpublic async checkSegmentListMatch(segment_ids: number[]): Promise<TSegmentCheckResult[]> {\n\t\treturn await this.api.coreCheckSegments(this.userExtId, Array.isArray(segment_ids) ? segment_ids : [segment_ids]);\n\t}\n\n\t/**\n\t * Returns the full level ladder configured for the current label —\n\t * one `TLevel` per active level, server-sorted by `required_points`\n\t * ASC (lowest first; `ordinal_position` is a 1-based index into the\n\t * returned array). Use this to render a level map / progression\n\t * screen, or as a lookup table to resolve `ach_level_current_id` from\n\t * {@link getUserProfile} into a richer level object.\n\t *\n\t * @remarks\n\t * **Server-side filtering**\n\t * The server returns ALL active levels for the label. There is NO\n\t * per-user filtering on visibility, level-status, or anything else —\n\t * the response is identical across users of the same label. Apply\n\t * `visibility_points` filtering client-side if you want to hide\n\t * not-yet-reached levels (compare against\n\t * `getUserProfile().ach_points_ever` and exclude levels where\n\t * `visibility_points > ach_points_ever`).\n\t *\n\t * **Sort order**\n\t * The returned array is already sorted by `required_points` ASC, and\n\t * `ordinal_position` is a 1-based index into that same sort order —\n\t * client-side re-sorting is not required for the default rendering.\n\t * If your label uses sliding-window leveling logic\n\t * (see {@link getUserLevelExtraCounters}) and you want to sort by\n\t * a multi-criteria key (`required_points`, then\n\t * `required_level_counter_1`, then `required_level_counter_2`), do\n\t * that client-side.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout. Operator-driven level edits\n\t * surface on the next cache miss.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only metadata. Calls\n\t * within the cache window de-duplicate to the same cached array.\n\t *\n\t * **UI guidance**: see [UI Guide — `getLevels`](../../docs/ui/user/UIGuide_getLevels.md).\n\t *\n\t * **Visitor mode**: supported. Use `_smartico.vapi(lang).getLevels()`\n\t * to fetch the ladder for anonymous viewers; the level configuration\n\t * is label-scoped static data so the response is meaningful even\n\t * without an authenticated user. Per-user fields (the implicit\n\t * \"current level\" via {@link getCurrentLevel}, or the user's progress)\n\t * are not available in visitor mode.\n\t *\n\t * @returns Promise resolving to the ordered `TLevel[]` ladder. Empty\n\t *          if no levels are configured for the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const [levels, profile] = await Promise.all([\n\t *   window._smartico.api.getLevels(),\n\t *   Promise.resolve(window._smartico.api.getUserProfile()),\n\t * ]);\n\t *\n\t * // Resolve the user's current level by ID.\n\t * const current = levels.find(l => l.id === profile.ach_level_current_id);\n\t * console.log('[smartico] render header badge — current level:', current?.name,\n\t *   '(position', current?.ordinal_position, 'of', levels.length, ')');\n\t *\n\t * // Filter to levels the user has unlocked enough to see.\n\t * const visible = levels.filter(l =>\n\t *   l.visibility_points == null || l.visibility_points <= profile.ach_points_ever\n\t * );\n\t * console.log('[smartico] render the level map with', visible.length, 'visible tiles');\n\t *\n\t * // Visitor-mode equivalent: returns the same ladder; no per-user state.\n\t * // const visitorLevels = await window._smartico.vapi('EN').getLevels();\n\t * ```\n\t */\n\tpublic async getLevels(): Promise<TLevel[]> {\n\t\treturn OCache.use(onUpdateContextKey.Levels, ECacheContext.WSAPI, () => this.api.levelsGetT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the user's current level — every `TLevel` field plus a\n\t * computed `progress` percentage toward the next level. Use this to\n\t * power a level badge with a progress bar.\n\t *\n\t * @remarks\n\t * **How `progress` is computed**\n\t * The SDK derives `progress` as the *delta-from-current-level-floor*:\n\t * `(ach_points_ever − current.required_points) / (next.required_points\n\t * − current.required_points) × 100`, clamped to `[0, 100]`. At the\n\t * highest level (no next level), `progress` is `100`. Reading the\n\t * source values directly from {@link getUserProfile}'s\n\t * `ach_points_ever` and {@link getLevels} would also work, but\n\t * `progress` saves the math.\n\t *\n\t * **Cache TTL & freshness**\n\t * The response is cached for 30 seconds, but the SDK automatically\n\t * drops that cache whenever a user-properties update arrives — the\n\t * same live channel that backs {@link getUserProfile}. The practical\n\t * effect depends on the label's leveling logic:\n\t * - **Points-based or operator-manual leveling**: a points or level\n\t *   change flows through the user-properties channel, so the cache is\n\t *   busted at that moment and the next `getCurrentLevel()` call\n\t *   returns up-to-date data without waiting out the TTL.\n\t * - **Counter-based leveling** (level driven by sliding-window\n\t *   counters such as deposit or wagering totals over a recent window —\n\t *   see {@link getUserLevelExtraCounters}): ordinary progress changes\n\t *   are recomputed by a periodic server job and do NOT emit a\n\t *   user-properties update, so they become visible on this method only\n\t *   after the 30 s TTL expires (or after `_smartico.api.clearCaches()`).\n\t *\n\t * Avoid calling `clearCaches()` on the points/manual path — it's\n\t * unnecessary there (the cache is already refreshed on the property\n\t * update) and forces a slower extra round-trip.\n\t *\n\t * **Leveling logic**\n\t * The semantics of how a user advances depends on the label's\n\t * leveling logic (configured per brand): points-only (the default),\n\t * sliding-window with extra counters (uses\n\t * {@link getUserLevelExtraCounters}), or fully-manual operator\n\t * assignment. The `progress` percentage on this method assumes the\n\t * points-only model — it's not meaningful for manual-only labels\n\t * where level changes are operator-driven rather than points-driven.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the cache\n\t * window return a deep-cloned cached value without a network\n\t * round-trip.\n\t *\n\t * **Side effects**: none — pure read.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns Promise resolving to `TLevelCurrent` — the current level\n\t *          plus `progress: number` (0–100).\n\t *\n\t * @example\n\t * ```ts\n\t * const level = await window._smartico.api.getCurrentLevel();\n\t * console.log('[smartico] render level badge — name:', level.name,\n\t *   'progress:', Math.round(level.progress), '%');\n\t *\n\t * // Detect level-up via getUserProfile's push channel. No clearCaches()\n\t * // needed — the SDK already drops the level cache on this update.\n\t * window._smartico.on('props_change', async (changed) => {\n\t *   if ('ach_level_current_id' in changed) {\n\t *     const fresh = await window._smartico.api.getCurrentLevel();\n\t *     console.log('[smartico] user levelled up — animate badge to new level:', fresh.name);\n\t *   }\n\t * });\n\t * ```\n\t */\n\tpublic async getCurrentLevel(): Promise<TLevelCurrent> {\n\t\treturn OCache.use(onUpdateContextKey.CurrentLevel, ECacheContext.WSAPI, () => this.api.getLevelCurrent(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the user's current values for the two label-defined \"extra\n\t * counters\" used by sliding-window leveling logic. Operators\n\t * configure what each counter means per label (e.g. `level_counter_1`\n\t * = total deposits in the last 30 days, `level_counter_2` = total\n\t * wagering in the last 30 days). Compare against\n\t * `required_level_counter_1` / `_2` on the next level from\n\t * {@link getLevels} to know how close the user is to advancing.\n\t *\n\t * @remarks\n\t * **When this matters**\n\t * Only labels configured for sliding-window leveling populate the\n\t * counter fields. On the default points-only leveling model, both\n\t * `level_counter_1` and `level_counter_2` are `undefined`. Detect\n\t * a points-only label by either counter being `undefined`.\n\t *\n\t * **Counter semantics — operator-defined**\n\t * The SDK exposes raw numeric values; the meaning of each counter\n\t * (deposit amount, wager amount, lifetime spend, etc.) is fully\n\t * operator-defined per label. Resolve labels for display via\n\t * `getTranslations` — the operator's display strings are\n\t * stored under the translation keys `levelsCounter1Name` and\n\t * `levelsCounter2Name`.\n\t *\n\t * **Refresh cadence**\n\t * Sliding-window counters are recomputed by a periodic server-side\n\t * job. Its rebuild cadence is operator-configured per brand —\n\t * commonly daily, though it can be set more frequent — so level\n\t * transitions driven by counter changes surface with a latency tied\n\t * to that rebuild schedule after the underlying activity (e.g. a\n\t * deposit), not in real time.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the cache\n\t * window return a deep-cloned cached value without a network\n\t * round-trip.\n\t *\n\t * **Side effects**: none — pure read.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns Promise resolving to `UserLevelExtraCountersT`. Both\n\t *          fields are `undefined` on labels not using sliding-window\n\t *          leveling.\n\t *\n\t * @example\n\t * ```ts\n\t * const [counters, levels, profile] = await Promise.all([\n\t *   window._smartico.api.getUserLevelExtraCounters(),\n\t *   window._smartico.api.getLevels(),\n\t *   Promise.resolve(window._smartico.api.getUserProfile()),\n\t * ]);\n\t *\n\t * // Quick detection: undefined means this label doesn't use sliding-window leveling.\n\t * if (counters.level_counter_1 === undefined) {\n\t *   console.log('[smartico] points-only label — skip counter UI; show points progress only');\n\t *   return;\n\t * }\n\t *\n\t * // Find the next level and render a 3-bar progress block.\n\t * const currentIdx = levels.findIndex(l => l.id === profile.ach_level_current_id);\n\t * const next = levels[currentIdx + 1];\n\t * if (next) {\n\t *   console.log('[smartico] render points bar:', profile.ach_points_ever, '/', next.required_points);\n\t *   if (next.required_level_counter_1) {\n\t *     console.log('[smartico] render counter 1 bar:', counters.level_counter_1, '/', next.required_level_counter_1);\n\t *   }\n\t *   if (next.required_level_counter_2) {\n\t *     console.log('[smartico] render counter 2 bar:', counters.level_counter_2, '/', next.required_level_counter_2);\n\t *   }\n\t * }\n\t * ```\n\t */\n\tpublic async getUserLevelExtraCounters(): Promise<UserLevelExtraCountersT> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.LevelExtraCounters,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getUserGamificationInfoT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the user's activity history within the requested time window,\n\t * ordered newest-first. Today that is primarily wallet changes (points /\n\t * gems / diamonds); when the server starts returning richer activity rows\n\t * (missions, badges, levels, …), the same method surfaces them via optional\n\t * fields on {@link TActivityLog} — no separate call, same wire CID.\n\t *\n\t * Existing wallet fields (`type`, `amount`, `balance`, `source_type_id`, …)\n\t * stay stable. Clients that only read those keep working; clients that want\n\t * the fuller feed can also read `activity_type_id`, `meta`,\n\t * `source_entity_*`, and `is_wallet_entry` when present.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not guarded at the SDK level\n\t *   but is not meaningful — activity is per-user.\n\t *\n\t * **Pagination — `from` / `to` are offset + ceiling, not timestamps**\n\t * The SDK derives `offset = from`, `limit = min(to - from, 50)` — the server\n\t * hard-caps a single response at 50 entries. For infinite scroll, advance\n\t * `from` by 50 between calls. Both `startTimeSeconds` and `endTimeSeconds`\n\t * are epoch seconds bounding the window the server scans.\n\t *\n\t * **Filtering** — optional server-side filters:\n\t * - `types` — {@link ActivityLogActivities} / `type_id` values (e.g. Points=3, Gems=1)\n\t * - `src_types` — {@link PointChangeSourceType} / `source_type_id` values\n\t * Omit both for an unfiltered window.\n\t *\n\t * **Subscription model (`onUpdate`)**\n\t * The callback fires when the user's `ach_points_balance`,\n\t * `ach_gems_balance`, or `ach_diamonds_balance` changes (i.e. whenever a\n\t * wallet event lands). The pushed payload is a FIXED re-fetch of the\n\t * **last 10 minutes / first 50 entries** — it does NOT honor the original\n\t * call's `startTimeSeconds` / `endTimeSeconds` / `from` / `to` / filters.\n\t * Consumers maintaining a long historical view must re-call `getActivityLog` with\n\t * their own params after receiving an `onUpdate` notification.\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - Push triggers fire only on balance changes; transactions that don't\n\t *   alter a balance (theoretical zero-amount entries) won't refresh.\n\t *\n\t * **Visitor mode**: not meaningful (no per-user history available).\n\t *\n\t * **UI guidance**: see [UI Guide — `getActivityLog`](../../docs/ui/user/UIGuide_getActivityLog.md).\n\t *\n\t * @returns Array of {@link TActivityLog} ordered newest-first.\n\t *\n\t * @example\n\t * ```ts\n\t * const now = Math.floor(Date.now() / 1000);\n\t * const start = now - 86400 * 30; // 30 days\n\t *\n\t * const log = await window._smartico.api.getActivityLog({\n\t *     startTimeSeconds: start,\n\t *     endTimeSeconds:   now,\n\t *     from: 0,\n\t *     to:   50,\n\t *     types: [1], // Gems only (ActivityLogActivities.Gems)\n\t *     src_types: [11], // Tournament wins only (PointChangeSourceType.Tournament)\n\t *     onUpdate: (refreshed) => {\n\t *         console.log('[smartico] wallet changed — refreshed payload is last 10 min / 50 entries:', refreshed.length, 'rows');\n\t *         // If the consumer is showing a full 30-day view, re-call getActivityLog with the original params here.\n\t *     },\n\t * });\n\t *\n\t * for (const row of log) {\n\t *     const sign = row.amount >= 0 ? '+' : '';\n\t *     console.log('[smartico] activity row — render with', row.type === 0 ? 'points' : row.type === 1 ? 'gems' : 'diamonds', 'icon, color by sign:', sign + row.amount, 'balance after:', row.balance, 'source:', row.source_type_id);\n\t * }\n\t * ```\n\t */\n\tpublic async getActivityLog({\n\t\tstartTimeSeconds,\n\t\tendTimeSeconds,\n\t\tfrom,\n\t\tto,\n\t\ttypes,\n\t\tsrc_types,\n\t\tonUpdate,\n\t}: {\n\t\t/** Window start in epoch seconds. */\n\t\tstartTimeSeconds: number;\n\t\t/** Window end in epoch seconds. */\n\t\tendTimeSeconds: number;\n\t\t/** Pagination offset (0-based). */\n\t\tfrom: number;\n\t\t/** Pagination ceiling (exclusive); server caps `to - from` at 50. */\n\t\tto: number;\n\t\t/** Optional — filter by {@link ActivityLogActivities} / `type_id`. */\n\t\ttypes?: number[];\n\t\t/** Optional — filter by {@link PointChangeSourceType} / `source_type_id`. */\n\t\tsrc_types?: number[];\n\t\t/** Optional push callback; payload is a fixed 10-min / 50-entry refresh on every wallet change (see Subscription model). */\n\t\tonUpdate?: (data: TActivityLog[]) => void;\n\t}): Promise<TActivityLog[]> {\n\n\t\tconst cacheKey = `${onUpdateContextKey.ActivityLog}:${startTimeSeconds}:${endTimeSeconds}:${from}:${to}:${types?.join(',') ?? ''}:${src_types?.join(',') ?? ''}`;\n\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.ActivityLog, onUpdate);\n\t\t\t// Remember the requested window so a push refresh re-fetches THIS window\n\t\t\t// and writes the matching composite cache key (see notifyActivityLogUpdate).\n\t\t\tthis.activityLogOnUpdateParams = { startTimeSeconds, endTimeSeconds, from, to, types, src_types };\n\t\t}\n\n\t\treturn await OCache.use(\n\t\t\tcacheKey,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getActivityLogT(this.userExtId, startTimeSeconds, endTimeSeconds, from, to, types, src_types),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/** @hidden Last window passed to `getActivityLog` with an `onUpdate`, so a push\n\t * refresh re-fetches the same window and updates its matching composite cache key. */\n\tprivate activityLogOnUpdateParams: {\n\t\tstartTimeSeconds: number;\n\t\tendTimeSeconds: number;\n\t\tfrom: number;\n\t\tto: number;\n\t\ttypes?: number[];\n\t\tsrc_types?: number[];\n\t} | undefined;\n\n\tprotected async notifyActivityLogUpdate() {\n\t\tconst params = this.activityLogOnUpdateParams;\n\t\t// No consumer has subscribed to a specific window yet — nothing to refresh.\n\t\tif (!params) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst payload = await this.api.getActivityLogT(\n\t\t\tthis.userExtId,\n\t\t\tparams.startTimeSeconds,\n\t\t\tparams.endTimeSeconds,\n\t\t\tparams.from,\n\t\t\tparams.to,\n\t\t\tparams.types,\n\t\t\tparams.src_types,\n\t\t);\n\t\tconst cacheKey = `${onUpdateContextKey.ActivityLog}:${params.startTimeSeconds}:${params.endTimeSeconds}:${params.from}:${params.to}:${params.types?.join(',') ?? ''}:${params.src_types?.join(',') ?? ''}`;\n\n\t\tOCache.set(cacheKey, payload, ECacheContext.WSAPI);\n\n\t\tconst onUpdate = this.onUpdateCallback.get(onUpdateContextKey.ActivityLog);\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tonUpdate(payload);\n\t\t}\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTGetTranslations,\n\tTUICustomSection,\n} from './WSAPITypes';\nimport { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIUser } from './WSAPIUser';\n\n/** @group General */\nexport class WSAPIGeneral extends WSAPIUser {\n\t/**\n\t * Returns the operator-configured \"custom sections\" the current user is eligible\n\t * to see. Custom sections are nav-level entries the operator builds in the BO —\n\t * HTML pages, themed mission grids, store / raffle / tournament category pages,\n\t * lootbox calendars, redirect links, and Liquid-templated dashboards — each\n\t * surfaced with its own icon and label.\n\t *\n\t * Use the response to build the side menu / bottom-bar / nav grid of a\n\t * gamification widget. Each section's `section_type_id` (see\n\t * {@link AchCustomSectionType}) tells the consumer which page component to mount\n\t * when the user opens the section.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - No prerequisite calls. Typically fetched once at app boot to build the\n\t *   navigation skeleton.\n\t *\n\t * **Server-side eligibility filtering**\n\t * Sections are filtered server-side by the user's segments / level / brand and\n\t * the section's `active_from_date` / `active_till_date` window. Sections the\n\t * user is ineligible for are omitted from the response entirely — there is no\n\t * \"locked\" state to render.\n\t *\n\t * **Ordering**\n\t * Response is server-ordered. Render in the order received; do NOT re-sort\n\t * client-side (the operator's order is the intended nav order).\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - No push subscription. Re-call after a segment / level change might\n\t *   make new sections eligible, or just rely on the 30 s cache turnover.\n\t *\n\t * **Visitor mode**: supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getCustomSections`](../../docs/ui/general/UIGuide_getCustomSections.md).\n\t *\n\t * @returns Array of {@link TUICustomSection} — empty if the label has no\n\t * active custom sections or the user is ineligible for all of them.\n\t *\n\t * @example\n\t * ```ts\n\t * const sections = await window._smartico.api.getCustomSections();\n\t *\n\t * for (const s of sections) {\n\t *     console.log('[smartico] nav entry', s.menu_name, 'type', s.section_type_id, '→ mount the matching page component');\n\t *     // Render s.menu_img (64x64) as the nav icon and s.menu_name as the label.\n\t *     // For section_type_id === AchCustomSectionType.REDIRECT_LINK, do NOT mount a page —\n\t *     // resolve s.url_or_dp on click (DP string or external URL).\n\t * }\n\t * ```\n\t */\n\tpublic async getCustomSections(): Promise<TUICustomSection[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.CustomSections,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.customSectionsGetT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the full set of operator-defined translation key/value pairs for the\n\t * label, merged across the requested language and the English baseline.\n\t *\n\t * Translation keys are free-form strings defined by the operator in the BO. The\n\t * SDK consumer treats the result as a flat dictionary: `translations[key]`. If\n\t * the key is missing entirely, do NOT trust `undefined` semantics — defensively\n\t * fall back to the key string itself or a hardcoded literal.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - No prerequisite calls.\n\t * - `lang_code` is the ISO language code the operator uses in the BO\n\t *   (e.g. `\"EN\"`, `\"FR\"`, `\"ES\"`). Case is not normalised — match what the\n\t *   operator configured.\n\t *\n\t * **EN fallback**\n\t * The SDK issues an English-baseline fetch first, then overlays the\n\t * `lang_code` translations on top. Any key the operator has only defined in\n\t * English (i.e. missing in the requested language) is returned with the\n\t * English value. Keys missing in both are absent from the map — the consumer\n\t * must handle missing keys (the default Smartico UI returns the key string\n\t * itself as the fallback text).\n\t *\n\t * **What's included**\n\t * The SDK passes an empty `areas` filter to the server, which returns ALL\n\t * translation namespaces configured for the label (Gamification, Casino,\n\t * Trading, Affiliation, etc. — whichever are populated). For a Gamification-\n\t * only widget, the consumer can ignore unused namespaces — keys are flat\n\t * strings, not nested.\n\t *\n\t * **Refresh**\n\t * - Cached internally per `(lang_code, label, brand)` for ~30 seconds.\n\t * - No push subscription. Operators editing translations in the BO will see\n\t *   the change after the cache window expires.\n\t *\n\t * **Visitor mode**: supported. Translations are label-scoped, not user-\n\t * scoped — `lang_code` is the sole language selector and is independent of\n\t * the `vapi(lang)` argument used elsewhere.\n\t *\n\t * @param lang_code  ISO language code (e.g. `\"EN\"`, `\"FR\"`). Defaults to\n\t *                   `\"EN\"` server-side if empty.\n\t * @returns {@link TGetTranslations} — `{ translations: { [key]: string } }`.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.getTranslations('FR');\n\t *\n\t * // Defensive lookup: fall back to the key itself if the operator hasn't\n\t * // defined the string.\n\t * const t = (k: string) => r.translations[k] ?? k;\n\t *\n\t * console.log('[smartico] localized label \"missions_title\" →', t('missions_title'));\n\t * ```\n\t */\n\tpublic async getTranslations(lang_code: string): Promise<TGetTranslations> {\n\t\tconst r = await this.api.getTranslationsT(this.userExtId, lang_code, []);\n\n\t\treturn {\n\t\t\ttranslations: r.translations,\n\t\t};\n\t}\n\n\t/**\n\t * Returns the missions and tournaments associated with a casino / sportsbook\n\t * game in the operator's games catalog — the reverse of \"given this mission,\n\t * which games count for it\" — so you can surface \"play this game to progress\n\t * mission X\" / \"tournament Y features this game\" badges on game tiles or\n\t * detail screens.\n\t *\n\t * The shape mirrors `getMissions` (`UserAchievement[]`) and `getTournamentsList`\n\t * (`Tournament[]`) — same wire types, no reduced subset.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - `related_game_id` must be a Games Catalog ID (the same external string the\n\t *   operator uses in the catalog at\n\t *   {@link https://help.smartico.ai/welcome/technical-guides/games-catalog-api}).\n\t *\n\t * **Server-side eligibility filtering**\n\t * Missions and tournaments are filtered by the user's segments / level / brand\n\t * before being returned. A user who is ineligible for a mission segment will\n\t * NOT see that mission in the result even if it lists the game. The same\n\t * filtering applies to tournaments. Treat the response as \"what this user\n\t * should see\" — no client-side eligibility pass needed.\n\t *\n\t * **No cache**\n\t * Every call is a live server round-trip. Missions/tournaments are operator-\n\t * mutated state (opt-in, completion, expiry) that changes during a session;\n\t * caching staler than the user's last action would mis-render eligibility.\n\t * Avoid building a consumer-side cache for UI-critical paths.\n\t *\n\t * **Refresh**\n\t * - Re-call when the user navigates to a new game tile / detail surface.\n\t * - Re-call after the user opts into / completes a related mission to refresh\n\t *   the \"play this game\" badge.\n\t *\n\t * **Visitor mode**: supported via `_smartico.vapi(lang).getRelatedItemsForGame(...)`.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRelatedItemsForGame`](../../docs/ui/general/UIGuide_getRelatedItemsForGame.md).\n\t *\n\t * @param related_game_id  External Games Catalog ID of the game (e.g. `\"gold-slot2\"`).\n\t * @returns {@link GetRelatedAchTourResponse} — `{ achievements, tournaments? }`.\n\t * `tournaments` may be `undefined` (treat as empty); both arrays may be empty\n\t * when no eligible entities reference the game.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.getRelatedItemsForGame('gold-slot2');\n\t *\n\t * const missions = r.achievements ?? [];\n\t * const tournaments = r.tournaments ?? [];\n\t *\n\t * if (missions.length === 0 && tournaments.length === 0) {\n\t *     console.log('[smartico] no related missions / tournaments — hide the related badge on the game tile');\n\t * } else {\n\t *     console.log('[smartico] related entities:', missions.length, 'missions /', tournaments.length, 'tournaments — show a \"X missions / Y tournaments\" badge');\n\t * }\n\t * ```\n\t */\n\tpublic async getRelatedItemsForGame(related_game_id: string): Promise<GetRelatedAchTourResponse> {\n\t\tconst result = await this.api.getRelatedItemsForGame(this.userExtId, related_game_id);\n\t\treturn result;\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTAchCategory,\n\tTMissionClaimRewardResult,\n\tTMissionOptInResult,\n\tTMissionOrBadge,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIGeneral } from './WSAPIGeneral';\n\n/** @group Missions */\nexport class WSAPIMissions extends WSAPIGeneral {\n\t/**\n\t * Returns all missions visible to the current user, scoped server-side\n\t * to what the user is qualified to see. Optionally subscribes to live\n\t * updates via `onUpdate`: the callback is invoked with the full, refreshed\n\t * mission array whenever the server pushes a mission-state-changing event.\n\t *\n\t * The returned list is the canonical source of truth for mission state\n\t * (`is_opted_in`, `progress`, `is_completed`, `completion_count`, etc.).\n\t * Consumers should NEVER mutate it optimistically — always wait for the\n\t * `onUpdate` callback (or a fresh `getMissions()` call after the 30s cache\n\t * window expires) to observe the new state.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed mission array (never a\n\t * diff/patch). Each subsequent call to `getMissions({ onUpdate })`\n\t * REPLACES the prior callback — only one active subscriber at a time.\n\t * Pass `onUpdate: undefined` (or omit it) to keep the prior callback in\n\t * place; the callback is never auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t * 1. **Mutation responses**: `requestMissionOptIn(...)` or\n\t *    `requestMissionClaimReward(...)` resolves (any `err_code`).\n\t * 2. **Asynchronous server pushes**: a user activity (deposit, bet,\n\t *    login, etc.) advances task progress on a task configured to push\n\t *    updates, or completes a mission.\n\t * 3. **Visibility changes**: the user's level changes, or other\n\t *    gamification visibility tags change.\n\t *\n\t * Operator-side BO mission-config edits do NOT push to connected\n\t * clients — those changes surface only on the next cache miss (after\n\t * the 30 s TTL) or alongside the next trigger from (1)–(3).\n\t *\n\t * **What's in the returned list / what's filtered server-side**\n\t * The response is pre-filtered by the server. Missions EXCLUDED before\n\t * reaching the SDK:\n\t * - Missions in `DRAFT` or `ARCHIVED` status (see {@link AchievementStatus}).\n\t * - Missions where the user fails visibility conditions. Exception:\n\t *   completed missions may remain visible after the user no longer\n\t *   qualifies (configurable per-brand).\n\t * - `FEATURED_MANUALLY` missions that are still locked — they appear\n\t *   only after the user unlocks them.\n\t * - Locked missions configured to hide while locked — UNLESS the\n\t *   mission is configured to expose immediately on unlock (then the\n\t *   locked mission is included as a teaser).\n\t * - `RECURRING` missions between cycles, until the next cycle starts.\n\t * - `RECURRING_QUANTITY` missions outside their `active_from_ts` /\n\t *   `active_till_ts` window.\n\t *\n\t * Client-side filtering you may still want: missions with\n\t * `only_in_custom_section: true` are intended for their custom-section\n\t * view only and should be hidden from the main mission list.\n\t *\n\t * **Status bucketing (which tab / section a mission belongs to)**\n\t * There is no pre-computed bucket field — assign each mission to exactly\n\t * ONE section reading the raw state fields directly (NOT `availability_status`;\n\t * see \"Timers\" below). Priority order, FIRST match wins:\n\t * 1. **Missed / Expired** — not completed and the window has closed:\n\t *    `!is_completed && ((time_limit_ms && dt_start && dt_start + time_limit_ms < Date.now())`\n\t *    `|| (active_till_ts && active_till_ts < Date.now()))`. Do NOT gate this on\n\t *    opt-in — an opt-in mission whose window closed before the user ever\n\t *    opted in is still Missed. Sort by `position` ASC.\n\t * 2. **Completed** — `is_completed === true`, OR (recurring-upon-completion\n\t *    missions) at least one cycle done / the cap reached — see the recurring\n\t *    caveats below. Sort by `complete_date_ts` DESC.\n\t * 3. **Locked** — `is_locked === true`, OR not yet started\n\t *    (`active_from_ts > Date.now()`). Sort by `position` ASC.\n\t * 4. **In-progress** — `is_opted_in === true`, OR (no opt-in required and\n\t *    `progress > 0`). Sort by `position` ASC.\n\t * 5. **Available** — everything else (opt-in required but not yet joined, or\n\t *    an unrestricted mission not yet started). Sort by `position` ASC.\n\t *\n\t * **Recurring-upon-completion caveats** (the common mis-bucketing trap):\n\t * - `is_completed` NEVER flips true for a recurring-upon-completion mission\n\t *   (only for one-shot missions) — detect a completed cycle from\n\t *   `completion_count > 0`, not `is_completed`.\n\t * - A non-null `completion_count` is what identifies a recurring-upon-completion\n\t *   mission. `max_completion_count === null` means an INFINITE cap (still\n\t *   recurring — never read null as \"not recurring\"), so only test\n\t *   `completion_count >= max_completion_count` when `max_completion_count` is set.\n\t *\n\t * **Timers & timestamps** (display only — NOT bucketing)\n\t * `availability_status` (enum {@link AchievementAvailabilityStatus}) is the\n\t * timer/window signal: use it to pick WHICH countdown to show and whether the\n\t * window has elapsed — NOT to choose the section. It does not read\n\t * `completion_count`, and between cycles the server may keep reporting the\n\t * just-elapsed cycle's `Missed*` value even after `dt_start` / `active_till_ts`\n\t * are cleared for the next attempt, so bucketing by it sends recurring missions\n\t * to the wrong tab. For time-limited / opt-in missions `dt_start` is the opt-in\n\t * timestamp (or unlock timestamp for previously-locked missions), and a\n\t * time-limited mission expires at `dt_start + time_limit_ms`.\n\t * `next_recurrence_date_ts` is populated for `RECURRING` / `RECURRING_QUANTITY`\n\t * missions but is no longer meaningful once `active_till_ts` has passed.\n\t *\n\t * **Refresh after a mutation**\n\t * After `requestMissionOptIn(...)` or `requestMissionClaimReward(...)`\n\t * resolves, the SDK auto-refreshes the mission cache; the `onUpdate`\n\t * callback fires with the new array shortly after. `is_opted_in`,\n\t * `progress`, and `is_completed` flip on the refreshed mission — do\n\t * NOT mutate them optimistically while the round-trip is pending.\n\t * Render any pending state from your own loading flag.\n\t *\n\t * **UI guidance**: see [UI Guide — `getMissions`](../../docs/ui/missions/UIGuide_getMissions.md).\n\t *\n\t * @param params              Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate     Callback invoked with the full refreshed\n\t *                            mission array on every server-pushed update\n\t *                            (after opt-in / claim-reward calls, or when\n\t *                            the server pushes an asynchronous\n\t *                            mission-state change). Each call to\n\t *                            `getMissions` overwrites the prior callback.\n\t *                            Never fires in visitor mode.\n\t * @returns                   Promise resolving to the current list of\n\t *                            missions visible to the user. Empty array if\n\t *                            the user has no missions (or if the visitor\n\t *                            proxy user has none configured).\n\t *\n\t * @example\n\t * ```ts\n\t * // 1. Initial fetch + subscribe to live updates\n\t * const missions = await window._smartico.api.getMissions({\n\t *   onUpdate: (refreshed) => {\n\t *     console.log('[smartico] mission list refreshed — re-render the entire mission list UI from this array, do not merge with prior state:', refreshed);\n\t *\n\t *     // 2. onUpdate fires for: opt-in/claim responses, task-progress\n\t *     //    pushes that complete a mission or move a \"pushToClient\" task,\n\t *     //    and user-level changes. Treat each call as authoritative.\n\t *     const claimable = refreshed.filter(m =>\n\t *       m.is_completed && m.requires_prize_claim && !m.prize_claimed_date_ts,\n\t *     );\n\t *     if (claimable.length > 0) {\n\t *       console.log('[smartico] there are unclaimed mission prizes — surface a \"Claim\" CTA on each of these missions:', claimable.map(m => m.id));\n\t *     }\n\t *   },\n\t * });\n\t *\n\t * // 3. Filter/render from the returned list. The server already excludes\n\t * //    DRAFT/ARCHIVED missions and ones the user can't see. You may need\n\t * //    client-side filters for view-specific concerns (custom sections,\n\t * //    completed/missed tabs).\n\t * const generalView = missions\n\t *   .filter(m => !m.only_in_custom_section)\n\t *   .sort((a, b) => (a.position ?? 0) - (b.position ?? 0));\n\t *\n\t * console.log('[smartico] initial mission list ready — render', generalView.length, 'missions sorted by position');\n\t *\n\t * // 4. Visitor-mode equivalent: onUpdate is accepted but never fires.\n\t * //    Re-poll if you need fresh data.\n\t * // const visitorMissions = await window._smartico.vapi('EN').getMissions();\n\t * // console.log('[smartico] visitor missions are the brand proxy user\\'s — per-user fields are not meaningful');\n\t * ```\n\t */\n\tpublic async getMissions({ onUpdate }: { onUpdate?: (data: TMissionOrBadge[]) => void } = {}): Promise<TMissionOrBadge[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Missions, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.Missions,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.missionsGetItemsT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns all the badges available to the current user.\n\t *\n\t * Badges are completion-tracked achievements that auto-unlock once the user\n\t * meets their criteria — there is no opt-in step, no claim step, and no\n\t * task-description reveal. Contrast with {@link getMissions}, which returns\n\t * the same `TMissionOrBadge[]` shape but represents explicit opt-in flows.\n\t *\n\t * @remarks\n\t * **Why no `onUpdate` callback?**\n\t * Unlike `getMissions({ onUpdate })`, this method does NOT accept an\n\t * `onUpdate` subscription. Internally the SDK never refreshes the `Badges`\n\t * cache from server pushes: the achievement-related push events\n\t * (mission opt-in / claim / reload) refresh the missions cache, NOT\n\t * the badges cache. The badges cache is flushed only by:\n\t * - its 30-second TTL\n\t * - a full SDK cache wipe at login / logout\n\t *\n\t * **How to refresh the badge list**\n\t * If you need near-live badge state, poll manually after the TTL expires.\n\t * The first call inside the 30 s window returns the cached payload; the\n\t * first call after the TTL triggers a fresh server round-trip. Example:\n\t * ```ts\n\t * setInterval(async () => {\n\t *   const badges = await window._smartico.api.getBadges();\n\t *   console.log('[smartico] badge list polled — re-render badge grid from this array', badges);\n\t * }, 30_000);\n\t * ```\n\t * Alternatively, re-fetch on a domain event your app already handles\n\t * (e.g. after the user finishes a game round or claims a bonus).\n\t *\n\t * **Differences from missions** (same `TMissionOrBadge` shape, different\n\t * feature)\n\t * The opt-in, claim, recurring-cycle, and unlock-description fields on\n\t * the returned objects are not populated for badges; treat their values\n\t * as undefined / default. Time windows are absolute calendar timestamps\n\t * (`active_from_ts` / `active_till_ts`), not opt-in-relative durations —\n\t * drive availability chips from the SDK-computed `badgeTimeLimitState`\n\t * (enum {@link BadgesTimeLimitStates}), not `time_limit_ms`. Locking for\n\t * badges is purely time-based: `is_locked` is `true` only when\n\t * `badgeTimeLimitState === BadgesTimeLimitStates.BeforeStartDate` (the\n\t * time window hasn't started yet). The primary navigation field is\n\t * `category_ids` — call {@link getAchCategories} to resolve category\n\t * metadata and group badges by category.\n\t *\n\t * **Idempotency / Side effects**: fetch-only; safe to call repeatedly.\n\t * The cache layer deduplicates concurrent calls within the TTL window.\n\t *\n\t * **Visitor mode**: not supported. Badges are an authenticated-only\n\t * feature; calling this on the visitor-mode handle (`_smartico.vapi`)\n\t * throws synchronously rather than silently returning an empty list.\n\t *\n\t * **UI guidance**: see [UI Guide — `getBadges`](../../docs/ui/missions/UIGuide_getBadges.md).\n\t *\n\t * @throws `Error(\"getBadges is not available in visitor mode\")` when\n\t *         called from a visitor-mode session.\n\t * @returns Promise resolving to `TMissionOrBadge[]`. Every item has\n\t *          `type === 'badge'`. Cached for 30 s under the `Badges` key.\n\t *\n\t * @example\n\t * ```ts\n\t * const [badges, categories] = await Promise.all([\n\t *   window._smartico.api.getBadges(),\n\t *   window._smartico.api.getAchCategories(),\n\t * ]);\n\t *\n\t * console.log('[smartico] badges fetched — render grouped grid with', badges.length, 'badges across', categories.length, 'categories');\n\t *\n\t * for (const category of categories) {\n\t *   const inCategory = badges.filter(b => b.category_ids?.includes(category.id));\n\t *   const completed = inCategory.filter(b => b.is_completed).length;\n\t *   console.log(`[smartico] render category section \"${category.name}\" header showing ${completed}/${inCategory.length}`);\n\t *\n\t *   for (const badge of inCategory) {\n\t *     // Use badgeTimeLimitState (not time_limit_ms) for availability chip\n\t *     if (badge.badgeTimeLimitState === 0) { // BadgesTimeLimitStates.BeforeStartDate\n\t *       console.log('[smartico] badge not yet started — render grayscaled card with \"Starts on\" chip for badge', badge.id);\n\t *     } else if (badge.is_completed) {\n\t *       console.log('[smartico] badge completed — render with completed styling and check-mark for badge', badge.id);\n\t *     } else {\n\t *       console.log('[smartico] badge in progress — render with stage counter (completed_tasks / total) for badge', badge.id);\n\t *     }\n\t *   }\n\t * }\n\t *\n\t * // No onUpdate available — poll if live state matters\n\t * setInterval(async () => {\n\t *   try {\n\t *     const fresh = await window._smartico.api.getBadges();\n\t *     console.log('[smartico] badge poll tick — diff against previous list and re-render any changed badge cards', fresh);\n\t *   } catch (e) {\n\t *     console.error('[smartico] badge poll failed — keep showing last known state, retry on next tick:', e);\n\t *   }\n\t * }, 30_000);\n\t * ```\n\t */\n\tpublic async getBadges(): Promise<TMissionOrBadge[]> {\n\t\t// Badges are an authenticated-only feature. The visitor-mode WSAPI\n\t\t// instance (`_smartico.vapi`) is constructed without a tracker, so the\n\t\t// server would silently return nothing; throw a clear error instead.\n\t\tif (!this.api.tracker) {\n\t\t\tthrow new Error('getBadges is not available in visitor mode');\n\t\t}\n\t\treturn OCache.use(onUpdateContextKey.Badges, ECacheContext.WSAPI, () => this.api.badgetsGetItemsT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the list of active mission/badge categories configured for the current label.\n\t * Categories are operator-defined groupings used to organize missions and badges into\n\t * sections, tabs, or filter chips in the gamification UI. The same category list serves\n\t * BOTH missions and badges — there is no separate \"mission categories\" vs \"badge\n\t * categories\" split on the server.\n\t *\n\t * @remarks\n\t * **What categories are**\n\t * - Operator-defined groupings, configured per-label by the brand operator.\n\t *   Only active categories are returned; inactive/deleted ones are filtered out.\n\t * - Each `TAchCategory` exposes `{ id, name, order }`. `name` is the display label;\n\t *   `order` is the relative position (lower = appears first).\n\t * - The same array covers BOTH missions and badges — categories are not filtered by\n\t *   entity type on the server.\n\t *\n\t * **Localization / translation**\n\t * - `name` is **pre-translated server-side** to the authenticated user's stored language.\n\t *   In visitor mode, the language passed to `_smartico.vapi(lang)` drives the\n\t *   translation. Consumers never need to translate `name` themselves.\n\t * - Fallback if no translation exists for the user's language: the brand's EN value\n\t *   is returned. The field is never null.\n\t *\n\t * **Sort order**\n\t * The server does NOT pre-sort. Sort client-side before rendering:\n\t * `categories.sort((a, b) => a.order - b.order)`.\n\t *\n\t * **How missions/badges join to categories**\n\t * Each `TMissionOrBadge` exposes `category_ids: number[]` (zero-or-more,\n\t * many-to-many). A single mission/badge can belong to multiple categories\n\t * simultaneously, or to none. To render a \"category → items\" view:\n\t * `missions.filter(m => m.category_ids.includes(cat.id))`.\n\t *\n\t * **Uncategorized items**\n\t * Items with `category_ids: []` are NOT represented by a synthetic \"Other\" entry.\n\t * If your UI needs one, generate it client-side by checking\n\t * `item.category_ids.length === 0`.\n\t *\n\t * **Empty categories**\n\t * A category may be returned even if zero missions/badges reference it. Filter\n\t * out empty categories on the consumer side if you don't want to render section\n\t * headers for them.\n\t *\n\t * **Refresh cadence / cache**\n\t * - The SDK caches the response for 30 seconds. Subsequent calls within that\n\t *   window return the cached array without a network round-trip.\n\t * - The cache is NOT invalidated by mission/badge push events — operator-driven\n\t *   category changes propagate at the next 30 s cache miss.\n\t * - Cache is fully cleared on login / logout.\n\t * - In **visitor mode** additional server-side caching applies on top of the\n\t *   SDK cache; worst-case staleness for an edited/added category is on the order\n\t *   of a few minutes for anonymous viewers.\n\t *\n\t * **Idempotency**: safe. Read-only metadata fetch. Cache de-duplicates concurrent calls.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAchCategories`](../../docs/ui/missions/UIGuide_getAchCategories.md).\n\t *\n\t * @returns Array of `{ id, name, order }`. Empty array if no active categories are\n\t *   configured for the label. `name` is pre-translated. Order is NOT applied — caller\n\t *   must sort.\n\t *\n\t * @example\n\t * ```ts\n\t * const categories = await window._smartico.api.getAchCategories();\n\t *\n\t * if (categories.length === 0) {\n\t *   console.log('[smartico] no categories configured — render missions/badges as a flat list without section headers');\n\t * } else {\n\t *   const sorted = [...categories].sort((a, b) => a.order - b.order);\n\t *   console.log('[smartico] categories loaded — render one tab/section per entry in this order:', sorted.map(c => c.name));\n\t *\n\t *   // Join to missions: render each category as a section\n\t *   const missions = await window._smartico.api.getMissions();\n\t *   for (const cat of sorted) {\n\t *     const items = missions.filter(m => m.category_ids.includes(cat.id));\n\t *     if (items.length === 0) {\n\t *       console.log('[smartico] category has no missions — skip rendering its section header:', cat.name);\n\t *       continue;\n\t *     }\n\t *     console.log(`[smartico] render section \"${cat.name}\" with ${items.length} mission(s)`);\n\t *   }\n\t *\n\t *   // Uncategorized items: surface in a caller-provided \"Other\" bucket if needed\n\t *   const uncategorized = missions.filter(m => m.category_ids.length === 0);\n\t *   if (uncategorized.length > 0) {\n\t *     console.log('[smartico] uncategorized missions exist — render a caller-provided \"Other\" section; server does NOT return id:-1:', uncategorized.length);\n\t *   }\n\t * }\n\t *\n\t * // Visitor mode — same shape, language driven by vapi(lang) argument\n\t * const visitorCats = await window._smartico.vapi('DE').getAchCategories();\n\t * console.log('[smartico] visitor-mode categories (names translated to DE):', visitorCats);\n\t * ```\n\t */\n\tpublic async getAchCategories(): Promise<TAchCategory[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AchCategories,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.achGetCategoriesT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Opt the current user in to a mission. The mission must have\n\t * `is_requires_optin: true` (from `getMissions()`) and must not already\n\t * be opted-in or locked. After a successful opt-in, the user's task\n\t * progress starts counting toward this mission — events fired BEFORE\n\t * opt-in do not count retroactively (except `UNLOCK_ACHIEVEMENT` tasks,\n\t * which are exempt and can fire pre-opt-in).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Only call when the mission has `is_requires_optin === true`,\n\t * `is_opted_in === false`, and `is_locked === false`. Calling on a\n\t * mission that does not require opt-in is wasted; calling twice returns\n\t * `40010`.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; task progress counting begins\n\t * - `105` — wrong mission id (different label) OR visibility conditions\n\t *   not met. Same code covers both; use `err_message` to disambiguate.\n\t * - `40010` — already opted-in. Safe to treat as \"no-op success\"; usually\n\t *   means local mission state was stale (e.g. user opted in from another\n\t *   session/tab).\n\t * - `40013` — mission not opt-in-able: missing `requires_optin`, in\n\t *   DRAFT/ARCHIVED state, or outside its `active_from_ts` /\n\t *   `active_till_ts` window.\n\t * - `40014` — mission is locked; user has unlock-tasks remaining.\n\t *   Surface the mission's `unlock_mission_description` to guide them.\n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * **Time-limited missions**\n\t * For missions with `time_limit_ms > 0`, the countdown begins at opt-in\n\t * time, not at mission creation. Server records expiration as\n\t * `optin_date + time_limit_ms`.\n\t *\n\t * **Refresh after success**\n\t * The SDK refreshes its mission cache automatically on opt-in response;\n\t * any `onUpdate` callback passed to a prior `getMissions({ onUpdate })`\n\t * fires with the new state shortly after. No manual re-fetch needed.\n\t *\n\t * **Idempotency**: not idempotent. A second call returns `40010`. Guard\n\t * the call site against double-clicks.\n\t *\n\t * **Side effects**: does NOT award points / badges / levels directly.\n\t * Rewards come from task completion, which is itself gated on opt-in.\n\t * May affect visibility of other missions whose visibility conditions\n\t * depend on this opt-in.\n\t *\n\t * **UI guidance**: see [UI Guide — `requestMissionOptIn`](../../docs/ui/missions/UIGuide_requestMissionOptIn.md).\n\t *\n\t * **Visitor mode: not supported**\n\t *\n\t * @param mission_id  The mission `id` (from `getMissions()`)\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`\n\t *\n\t * @example\n\t * ```ts\n\t * const missions = await window._smartico.api.getMissions({\n\t *   onUpdate: (m) => console.log('[smartico] mission list updated — re-render mission UI from this new array', m),\n\t * });\n\t * const mission = missions.find(m => m.id === missionId);\n\t *\n\t * if (!mission || !mission.is_requires_optin || mission.is_opted_in || mission.is_locked) {\n\t *   console.log('[smartico] opt-in not applicable — keep UI as-is');\n\t *   return;\n\t * }\n\t *\n\t * console.log('[smartico] opt-in starting — show loading spinner on opt-in button and disable it to prevent double-clicks');\n\t * const r = await window._smartico.api.requestMissionOptIn(mission.id);\n\t * console.log('[smartico] opt-in response received — clear loading spinner');\n\t *\n\t * if (r.err_code === 0 || r.err_code === 40010) {\n\t *   console.log('[smartico] opt-in succeeded (or was already done) — onUpdate above will fire with refreshed mission state; no manual re-fetch needed');\n\t * } else if (r.err_code === 40014) {\n\t *   console.error('[smartico] mission is locked — surface the unlock description as guidance:', mission.unlock_mission_description);\n\t * } else {\n\t *   console.error('[smartico] opt-in failed — show an error toast with this message to the user:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async requestMissionOptIn(mission_id: number): Promise<TMissionOptInResult> {\n\t\tconst r = await this.api.missionOptIn(this.userExtId, mission_id);\n\n\t\tconst o: TMissionOptInResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Claim the prize for a completed mission. This is the step that runs\n\t * AFTER `requestMissionOptIn()` (when applicable) and AFTER the user has\n\t * completed all of the mission's tasks. Only call when the mission has\n\t * `requires_prize_claim === true`, `is_completed === true`, and the prize\n\t * has not already been claimed.\n\t *\n\t * The points / bonuses / badge grants associated with the mission are\n\t * awarded server-side synchronously inside this call (before the response\n\t * is returned), so a successful response (`err_code === 0`) means the\n\t * reward has already landed in the user's account.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Only call when, on the mission object from `getMissions()`:\n\t * - `is_completed === true`\n\t * - `requires_prize_claim === true`\n\t * - `prize_claimed_date_ts == null` (i.e. not already claimed)\n\t * - `prize_claim_expiration_date` is `null` OR still in the future\n\t *\n\t * The `ach_completed_id` argument must be passed straight from the same\n\t * mission object (`mission.ach_completed_id`). It is a server-side primary\n\t * key identifying the specific completion row; the SDK consumer should\n\t * never synthesise or cache it across sessions — always re-read it from a\n\t * fresh `getMissions()` result.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the prize was claimed and rewards have been credited.\n\t * - `1` — generic server error. Covers several distinct underlying\n\t *   conditions, all collapsed into the same code: stale or wrong\n\t *   `ach_completed_id` (does not match user / mission), the mission no\n\t *   longer requiring a prize claim, the mission being archived/draft,\n\t *   label mismatch, or the completion being too old (server enforces a\n\t *   freshness window of several months). Recovery: re-fetch missions\n\t *   with `getMissions()`; if the mission still appears claimable,\n\t *   surface a generic error.\n\t * - `40015` — claim window expired (`prize_claim_expiration_date` has\n\t *   passed). Show a \"claim period ended\" message; do not retry.\n\t * - `40016` — mission is not completed yet. Indicates a race or a stale\n\t *   local cache. Re-fetch via `getMissions()`; if `is_completed` is still\n\t *   false, the UI should hide the claim button.\n\t * - `40017` — prize already claimed. Treat as idempotent success: refresh\n\t *   the mission list (auto-refresh will fire) and hide the claim button.\n\t *   Usually means another tab/session already claimed it.\n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * **Recurring missions**\n\t * The server transparently handles both one-shot and recurring mission\n\t * completions. The SDK consumer passes a single `ach_completed_id`\n\t * regardless of mission type; the server resolves the correct completion.\n\t *\n\t * **Refresh after success**\n\t * On any claim response (success OR failure), the SDK automatically\n\t * re-fetches the mission list and fires any `onUpdate` callback\n\t * registered via `getMissions({ onUpdate })`. No manual re-fetch needed.\n\t * Note: points balance, badges, and level state arrive through their\n\t * own push channels — subscribe to them separately if your UI shows\n\t * those values.\n\t *\n\t * **Idempotency**: not idempotent at the row level. A second call on the\n\t * same `ach_completed_id` returns `40017` (already claimed). For a stale\n\t * `ach_completed_id` the second call returns `1`. Guard the call site\n\t * against double-clicks; the SDK does not enforce its own in-flight lock.\n\t *\n\t * **Side effects** (consumer-observable effects of a successful claim):\n\t * - Points credited to the user's balance.\n\t * - CRM-rule activities executed (may grant bonuses, badges; may unlock\n\t *   follow-up missions, which arrive as a later mission auto-refresh).\n\t * - Analytics / automation events fired downstream; not directly observable\n\t *   in the response, but visible via the mission auto-refresh and any\n\t *   subsequent bonus / badge updates.\n\t *\n\t * **UI guidance**: see [UI Guide — `requestMissionClaimReward`](../../docs/ui/missions/UIGuide_requestMissionClaimReward.md).\n\t *\n\t * @param mission_id        The mission `ach_id` (from `getMissions()`).\n\t * @param ach_completed_id  The completion-row identifier, read from\n\t *                          `mission.ach_completed_id` on the same mission\n\t *                          object fetched via `getMissions()`. Never\n\t *                          fabricate or cache across sessions.\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`\n\t *          (or `40017` when treated as idempotent no-op).\n\t *\n\t * @example\n\t * ```ts\n\t * const missions = await window._smartico.api.getMissions({\n\t *   onUpdate: (m) => console.log('[smartico] mission list updated — re-render mission UI from this new array', m),\n\t * });\n\t * const mission = missions.find(m => m.ach_id === missionId);\n\t *\n\t * if (\n\t *   !mission ||\n\t *   !mission.is_completed ||\n\t *   !mission.requires_prize_claim ||\n\t *   mission.prize_claimed_date_ts ||\n\t *   (mission.prize_claim_expiration_date && Date.now() >= mission.prize_claim_expiration_date)\n\t * ) {\n\t *   console.log('[smartico] claim not applicable — keep claim button hidden');\n\t *   return;\n\t * }\n\t *\n\t * console.log('[smartico] claim starting — show loading spinner on claim button and disable it to prevent double-clicks');\n\t * const r = await window._smartico.api.requestMissionClaimReward(mission.ach_id, mission.ach_completed_id);\n\t * console.log('[smartico] claim response received — clear loading spinner');\n\t *\n\t * if (r.err_code === 0 || r.err_code === 40017) {\n\t *   console.log('[smartico] claim succeeded (or was already claimed) — points/bonuses are credited; mission list auto-refresh will fire via the onUpdate above; hide the claim button');\n\t * } else if (r.err_code === 40015) {\n\t *   console.error('[smartico] claim window expired — show a \"claim period ended\" message and remove the claim button:', mission.prize_claim_expiration_date);\n\t * } else if (r.err_code === 40016) {\n\t *   console.error('[smartico] mission reported as not completed by server — local state was stale; auto-refresh will reconcile, do not retry');\n\t * } else {\n\t *   console.error('[smartico] claim failed — show an error toast with this message to the user (and re-fetch missions to recover from a stale ach_completed_id):', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async requestMissionClaimReward(mission_id: number, ach_completed_id: number): Promise<TMissionClaimRewardResult> {\n\t\tconst r = await this.api.missionClaimPrize(this.userExtId, mission_id, ach_completed_id);\n\n\t\tconst o: TMissionClaimRewardResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\tprotected async updateMissions() {\n\t\tconst payload = await this.api.missionsGetItemsT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Missions, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTBonus,\n\tTClaimBonusResult,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIMissions } from './WSAPIMissions';\n\n/** @group Bonuses */\nexport class WSAPIBonuses extends WSAPIMissions {\n\t/**\n\t * Returns the bonuses awarded to the current user — both pending\n\t * (player-claim required) and already-redeemed. Each bonus carries\n\t * a `bonus_status_id` ({@link BonusStatus}) describing its lifecycle\n\t * stage and an `is_redeemable` flag that signals whether the\n\t * consumer must trigger a manual {@link claimBonus} call.\n\t *\n\t * Bonuses originate from many sources (CRM rules, mission/tournament\n\t * rewards, store redemptions, mini-game prizes, manual operator\n\t * awards) and all surface through this single list. The consumer\n\t * cannot distinguish the source server-side without operator\n\t * coordination.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed bonuses list (never a\n\t * diff/patch). Each subsequent call to `getBonuses({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires after every\n\t * {@link claimBonus} call resolves on this connection (success OR\n\t * failure). This is the ONLY trigger.\n\t *\n\t * Does NOT fire when: a new bonus is awarded server-side\n\t * (CRM rule, mission completion, store purchase, etc.), a bonus\n\t * expires, or an operator manually issues / cancels a bonus. Those\n\t * changes surface only on the next cache miss (after the 30 s TTL).\n\t * Re-call `getBonuses()` manually if your UI needs near-live state\n\t * for server-driven awards.\n\t *\n\t * **Reading state from the returned bonus**\n\t * Drive UI bucketing from `bonus_status_id` (enum {@link BonusStatus}):\n\t *\n\t * - `COUPON_ISSUED` (2) — actionable; player must claim. Pair with\n\t *   `is_redeemable === true` to gate the Claim button.\n\t * - `REDEEM_FAILED` (4) — also actionable; the previous claim\n\t *   attempt failed but the bonus is still valid. Surface a retry CTA\n\t *   — the default Smartico UI treats this identically to\n\t *   `COUPON_ISSUED` from the player's perspective.\n\t * - `REDEEMED` (3) — historical; show in a \"claimed\" tab.\n\t * - `New` (1), `COUPON_ISSUE_FAILED` (5), `EXPIRED` (6) — these\n\t *   should not normally reach the client and are typically filtered\n\t *   out by operator-side widget configuration; if they do appear,\n\t *   they have no player-actionable state.\n\t *\n\t * `is_redeemable` is the authoritative gate for showing the Claim\n\t * button — it's `true` only when the bonus is in a claimable status\n\t * AND the operator's integration uses a coupon model (where the\n\t * player must explicitly trigger delivery). Auto-redeemed bonuses\n\t * arrive already in `REDEEMED` state with `is_redeemable: false`.\n\t *\n\t * **Field hierarchy — display amount**\n\t * Bonuses carry both template-level (`label_bonus_template_meta_map.description`)\n\t * and instance-level (`bonus_meta_map.uiAmount`) display strings.\n\t * Prefer `bonus_meta_map.uiAmount` when present — it's the dynamic\n\t * amount computed at issuance time (e.g. from a dynamic-bonus\n\t * formula). Fall back to `label_bonus_template_meta_map.description`\n\t * (which can include HTML; sanitize before injecting).\n\t *\n\t * **Date format**\n\t * `create_date` and `redeem_date` are ISO 8601 UTC strings WITHOUT\n\t * a timezone suffix (`\"YYYY-MM-DDTHH:MM:SS\"`). Parse as UTC and\n\t * display in the user's local timezone. `redeem_date` is absent\n\t * until the bonus reaches `REDEEMED` status.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getBonuses`](../../docs/ui/bonuses/UIGuide_getBonuses.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params              Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate     Callback invoked with the full refreshed\n\t *                            bonuses list after every\n\t *                            {@link claimBonus} resolves. Each call\n\t *                            to `getBonuses` overwrites the prior\n\t *                            callback.\n\t * @returns                   Promise resolving to the bonuses list.\n\t *                            Empty array if no bonuses are visible.\n\t *\n\t * @example\n\t * ```ts\n\t * const bonuses = await window._smartico.api.getBonuses({\n\t *   onUpdate: (refreshed) => {\n\t *     console.log('[smartico] bonuses refreshed (after claimBonus) — re-render the bonuses UI from this array:', refreshed);\n\t *   },\n\t * });\n\t *\n\t * // Bucket into pending vs redeemed tabs. The default Smartico UI groups\n\t * // COUPON_ISSUED + REDEEM_FAILED into the same \"Pending\" tab.\n\t * const pending = bonuses.filter(b =>\n\t *   b.bonus_status_id === 2 || b.bonus_status_id === 4  // COUPON_ISSUED or REDEEM_FAILED\n\t * );\n\t * const redeemed = bonuses.filter(b => b.bonus_status_id === 3);  // REDEEMED\n\t *\n\t * console.log('[smartico] render bonus tabs: pending=', pending.length, 'redeemed=', redeemed.length);\n\t *\n\t * // Render each pending bonus card; show Claim button only when redeemable.\n\t * for (const b of pending) {\n\t *   const amount = b.bonus_meta_map?.uiAmount || b.label_bonus_template_meta_map?.description;\n\t *   if (b.is_redeemable) {\n\t *     console.log('[smartico] render Claim button for bonus', b.bonus_id, '— amount:', amount);\n\t *   } else {\n\t *     console.log('[smartico] render bonus as informational (no Claim button) — amount:', amount);\n\t *   }\n\t * }\n\t *\n\t * // Server-awarded bonuses (e.g. from a CRM campaign) do NOT push;\n\t * // poll if you need near-live awareness.\n\t * setInterval(async () => {\n\t *   const fresh = await window._smartico.api.getBonuses();\n\t *   const newCount = fresh.filter(b => b.bonus_status_id === 2 || b.bonus_status_id === 4).length;\n\t *   console.log('[smartico] poll tick — pending bonuses now:', newCount);\n\t * }, 30_000);\n\t * ```\n\t */\n\tpublic async getBonuses({ onUpdate }: { onUpdate?: (data: TBonus[]) => void } = {}): Promise<TBonus[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Bonuses, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(onUpdateContextKey.Bonuses, ECacheContext.WSAPI, () => this.api.bonusesGetItemsT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Triggers manual redemption of a coupon-model bonus the user has\n\t * been awarded. For bonuses with `is_redeemable === true` returned\n\t * by {@link getBonuses}, this is the call that asks the operator's\n\t * integration to actually credit the bonus to the player's account.\n\t * Bonuses on integrations that auto-redeem arrive already in\n\t * `REDEEMED` state and do not require this call.\n\t *\n\t * Use this for `bonus_status_id` of `COUPON_ISSUED` (2) as the\n\t * first-time claim, and for `REDEEM_FAILED` (4) as a retry after a\n\t * prior unsuccessful attempt.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate bonus from {@link getBonuses} and gate the\n\t * call on `is_redeemable === true`. The SDK forwards the request\n\t * unconditionally — calling on a non-claimable bonus returns\n\t * `err_code = -1`.\n\t *\n\t * **Error codes** (in `err_code`)\n\t *\n\t * The SDK currently types `err_code` as {@link SAWSpinErrorCode} for\n\t * historical reasons, but the values returned by this method come\n\t * from the server's general error space and are NOT mini-game codes.\n\t * Branch on the numeric values:\n\t *\n\t * - `0` — success; the bonus has been redeemed and the operator's\n\t *   integration has credited the player's account.\n\t * - `-1` — bonus not claimable: not found, already claimed by\n\t *   another session, or its status is no longer `COUPON_ISSUED` /\n\t *   `REDEEM_FAILED`. Treat as idempotent — refresh\n\t *   {@link getBonuses} and reconcile.\n\t * - `1` — generic server error. Transient; allow retry after a brief\n\t *   delay.\n\t * - `9999` — uncaught server exception. Treat as a transient failure;\n\t *   surface a generic error and allow retry.\n\t * - other non-zero — generic server error. Surface `err_message` if\n\t *   any.\n\t *\n\t * **`success` field is unreliable**: the wire response does not\n\t * carry a `success` boolean — the field on `TClaimBonusResult` will\n\t * be `undefined` in practice. Always branch on `err_code === 0`\n\t * for the success check.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the bonuses cache on every\n\t * response (success OR failure) and fires any `onUpdate` callback\n\t * registered via {@link getBonuses}'s `onUpdate`. After\n\t * `err_code === 0`, the redeemed bonus shifts from\n\t * `COUPON_ISSUED` / `REDEEM_FAILED` to `REDEEMED` on the refreshed\n\t * array, with `redeem_date` populated. After a failure, the bonus\n\t * typically lands in `REDEEM_FAILED` and remains claimable for a\n\t * retry.\n\t *\n\t * **Idempotency**: NOT idempotent at the SDK level. A second call\n\t * returns `err_code = -1` once the first has succeeded — treat that\n\t * as success in the UI rather than as a real error. Guard the call\n\t * site against double-clicks (set a local \"claiming\" flag on click,\n\t * clear it on response).\n\t *\n\t * **Side effects** (on `err_code === 0`)\n\t * - Bonus status transitions to `REDEEMED`; `redeem_date` is set.\n\t * - The operator's integration credits the player's account\n\t *   externally. The SDK does not observe that credit directly —\n\t *   balance updates flow over the user-properties channel from the\n\t *   operator's side, not from this response.\n\t * - Server-side analytics events fire downstream (not directly\n\t *   observable from the SDK).\n\t *\n\t * **UI guidance**: see [UI Guide — `claimBonus`](../../docs/ui/bonuses/UIGuide_claimBonus.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param bonus_id  The `bonus_id` from a `TBonus` returned by\n\t *                  {@link getBonuses}.\n\t * @returns `{ err_code, err_message, success? }`; success when\n\t *          `err_code === 0` (or `err_code === -1` when treated as\n\t *          idempotent no-op). The `success` field is unreliable —\n\t *          ignore it.\n\t *\n\t * @example\n\t * ```ts\n\t * const bonuses = await window._smartico.api.getBonuses({\n\t *   onUpdate: (refreshed) => console.log('[smartico] bonuses refreshed — re-render from this array', refreshed),\n\t * });\n\t * const bonus = bonuses.find(b => b.bonus_id === bonusId);\n\t *\n\t * if (!bonus) {\n\t *   console.log('[smartico] bonus no longer visible — refresh list and hide CTA');\n\t *   return;\n\t * }\n\t * if (!bonus.is_redeemable) {\n\t *   console.log('[smartico] bonus is not claimable (auto-redeemed or already finalised) — keep CTA hidden');\n\t *   return;\n\t * }\n\t *\n\t * console.log('[smartico] claim starting — set in-flight flag, show loading dots on the Claim button, keep the modal open');\n\t * const r = await window._smartico.api.claimBonus(bonus.bonus_id);\n\t * console.log('[smartico] claim response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0 || r.err_code === -1) {\n\t *   console.log('[smartico] claim succeeded (or was already done) — show a success toast; the getBonuses onUpdate above will fire with the refreshed list');\n\t * } else if (r.err_code === 9999) {\n\t *   console.error('[smartico] uncaught server exception — show a generic error toast and allow retry');\n\t * } else {\n\t *   console.error('[smartico] claim failed — surface this error message to the user; the bonus will move to REDEEM_FAILED state and remain claimable for a retry:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async claimBonus(bonus_id: number): Promise<TClaimBonusResult> {\n\t\tconst r = await this.api.bonusClaimItem(this.userExtId, bonus_id);\n\n\t\tconst o: TClaimBonusResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t\tsuccess: r.success,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\tprotected async updateBonuses() {\n\t\tconst payload = await this.api.bonusesGetItemsT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Bonuses, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTBuyStoreItemResult,\n\tTStoreCategory,\n\tTStoreItem,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIBonuses } from './WSAPIBonuses';\n\n/** @group Store */\nexport class WSAPIStore extends WSAPIBonuses {\n\tprivate storeHistoryOnUpdateParams: { limit: number; offset: number } = { limit: 20, offset: 0 };\n\n\tprivate storeHistoryCacheKey(limit: number, offset: number): string {\n\t\treturn `${onUpdateContextKey.StoreHistory}:${limit}:${offset}`;\n\t}\n\n\t/**\n\t * Returns the catalog of buyable store items visible to the current user,\n\t * scoped server-side to what the user is qualified to see. Optionally\n\t * subscribes to live updates via `onUpdate`: the callback is invoked with\n\t * the full refreshed catalog after every purchase the user makes from this\n\t * device.\n\t *\n\t * The returned list is the canonical source of truth for store state\n\t * (`can_buy`, `pool`, `discounted_price`, `active_till_date`, etc.).\n\t * Consumers should NEVER mutate it optimistically — always re-fetch (or\n\t * wait for the `onUpdate` callback) to observe the new state.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * The catalog is per-user. Visitor mode is supported with caveats (see\n\t * \"Visitor mode\" below). For the authenticated path, the user's balances\n\t * (`ach_points_balance`, `ach_gems_balance`, `ach_diamonds_balance` from\n\t * {@link getUserProfile}) must be tracked client-side to drive the\n\t * affordability state of the Buy button — the SDK does not pre-compute\n\t * affordability into `can_buy`.\n\t *\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed catalog (never a diff/patch).\n\t * Each subsequent call to `getStoreItems({ onUpdate })` REPLACES the prior\n\t * callback — only one active subscriber at a time. Pass\n\t * `onUpdate: undefined` (or omit it) to keep the prior callback in place;\n\t * the callback is never auto-cleared.\n\t *\n\t * **Update triggers**\n\t *\n\t * Fires after: any `buyStoreItem(...)` call resolves on this connection\n\t * (success OR failure). This is the ONLY trigger. The refreshed array\n\t * reflects pool decrement on the just-bought item, per-period purchase\n\t * cap re-evaluation on `can_buy`, and any `purchased_today` /\n\t * `purchased_this_week` / `purchased_this_month` flips visible via\n\t * {@link getStorePurchasedItems}.\n\t *\n\t * Does NOT fire for:\n\t * - Operator-side BO catalog edits (price, ribbons, pool seed, segment\n\t *   conditions, new/removed items) — surface only on the next cache miss.\n\t * - Concurrent purchases by OTHER users — the current user's view of\n\t *   `pool` may be stale until they themselves refresh.\n\t * - User balance changes from gameplay — the catalog is independent of\n\t *   balance; the consumer drives Buy-button affordability from a\n\t *   separately-tracked balance source.\n\t * - Items going past their `active_till_date` while the page is open —\n\t *   the item simply disappears on the next refresh.\n\t *\n\t * **Server-side filtering** (what's already excluded before the SDK sees it)\n\t * - Items outside the `[active_from_date, active_till_date]` window —\n\t *   past the till-date, items are ALWAYS filtered out server-side.\n\t * - Items the user fails visibility-segment / visibility-condition\n\t *   checks for.\n\t * - Items configured to hide-when-empty whose pool has reached 0\n\t *   (per-item operator flag). Items without that flag are still returned\n\t *   with `pool === 0` so a \"Sold out\" state can be rendered.\n\t * - Items where the per-period bought-count cap is reached (and the\n\t *   operator chose to hide rather than just disable).\n\t *\n\t * **Reading state from the returned item**\n\t * The catalog row carries everything a Buy button needs except the user's\n\t * balance: `can_buy` already reflects segment / visibility / per-period\n\t * cap checks, but the SDK does NOT pre-compute balance affordability —\n\t * compare `discounted_price ?? price` against the user's balance for\n\t * `purchase_type` (`ach_points_balance` / `ach_gems_balance` /\n\t * `ach_diamonds_balance` from {@link getUserProfile}). `purchase_type` is\n\t * per-item (`'points'` / `'gems'` / `'diamonds'`); operators can mix\n\t * currencies within a single catalog. For sold-out display, `pool === 0`\n\t * means the operator chose to keep the item visible — render an \"Out of\n\t * stock\" overlay. When `discounted_price` is set, render `price` with a\n\t * strikethrough and `discounted_price` as the active price; the\n\t * accompanying `discount_price_ribbon` is either a percentage preset\n\t * (`'10'`, `'15'`, `'20'`, `'25'`, `'50'`) or the literal `'custom'`\n\t * (in which case `custom_ribbon_image` is the artwork at 250×300 px).\n\t * A live countdown for time-limited items is rendered only when the\n\t * operator has enabled the per-item `show_timer` flag.\n\t *\n\t * **Cross-references**\n\t * `category_ids` joins to `TStoreCategory.id` from\n\t * {@link getStoreCategories} (many-to-many — an item can belong to\n\t * multiple categories). Items with `only_in_custom_section: true` are\n\t * returned in the catalog but intended for their custom-section view\n\t * only — filter them client-side for the main store view. The\n\t * history-only fields (`purchase_ts`, `purchase_points_amount`, the\n\t * `purchased_*` booleans) are populated only by\n\t * {@link getStorePurchasedItems}, not by this method.\n\t *\n\t * **Idempotency**: yes. `getStoreItems` is a pure read. Calling it\n\t * repeatedly within the 30-second cache window resolves from the cache\n\t * without a network round-trip.\n\t *\n\t * **Side effects** (of a successful purchase that triggers `onUpdate`)\n\t * Documented here because the consumer's `onUpdate` handler will observe\n\t * the resulting state changes on the next refreshed array:\n\t * - Points / gems / diamonds balance deducted per `purchase_type`. The\n\t *   new balance becomes visible on the user's gamification profile via\n\t *   the SDK's user-properties update channel (`ach_points_balance` /\n\t *   `ach_gems_balance` / `ach_diamonds_balance`).\n\t * - `pool` decremented for limited-stock items.\n\t * - `type = 'bonus'` → a CRM bonus is granted; surfaces via\n\t *   {@link getBonuses}.\n\t * - `type = 'raffleticket'` → raffle tickets granted; surfaces via\n\t *   `getRaffles`.\n\t * - `type = 'changelevel'` → user's level adjusted; surfaces via\n\t *   {@link getCurrentLevel}.\n\t * - `type = 'minigamespin'` → SAW spin attempts granted; visible via the\n\t *   mini-game APIs.\n\t * - `type = 'prizedrop'` → one prize-drop attempt granted.\n\t * - `type = 'tangible'` → no automatic gameplay effect; the purchase is\n\t *   recorded for the operator's manual fulfillment (e.g. physical merch).\n\t *\n\t * **UI guidance**: see [UI Guide — `getStoreItems`](../../docs/ui/store/UIGuide_getStoreItems.md).\n\t *\n\t * @param params              Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate     Callback invoked with the full refreshed\n\t *                            catalog after every {@link buyStoreItem}\n\t *                            round-trip on this connection. Each call to\n\t *                            `getStoreItems` overwrites the prior\n\t *                            callback. Never fires in visitor mode.\n\t * @returns                   Promise resolving to the catalog of store\n\t *                            items visible to the user. Empty array if\n\t *                            the user has no items (or if the visitor\n\t *                            proxy user has none configured).\n\t *\n\t * @example\n\t * ```ts\n\t * // 1. Initial fetch + subscribe to live updates\n\t * const items = await window._smartico.api.getStoreItems({\n\t *   onUpdate: (refreshed) => {\n\t *     console.log('[smartico] store catalog refreshed after a purchase — re-render the entire store UI from this array, do not merge with prior state:', refreshed);\n\t *\n\t *     // 2. onUpdate fires only after the current user's own purchase\n\t *     //    round-trip. Pool counts and can_buy flags are now current\n\t *     //    for this user.\n\t *     const soldOut = refreshed.filter(i => i.pool === 0);\n\t *     if (soldOut.length > 0) {\n\t *       console.log('[smartico] these items are now sold out — render an \"Out of stock\" overlay on each:', soldOut.map(i => i.id));\n\t *     }\n\t *   },\n\t * });\n\t *\n\t * // 3. Live affordability per item. Compare each item's price against\n\t * //    the user's balance for its purchase_type (read from\n\t * //    getUserProfile(), kept live by the SDK's user-properties channel).\n\t * const profile = window._smartico.api.getUserProfile();\n\t * const balances = {\n\t *   points: profile?.ach_points_balance ?? 0,\n\t *   gems: profile?.ach_gems_balance ?? 0,\n\t *   diamonds: profile?.ach_diamonds_balance ?? 0,\n\t * };\n\t *\n\t * // 4. Filter out items that are custom-section-only for the main view.\n\t * const mainViewItems = items.filter(i => !i.only_in_custom_section);\n\t *\n\t * // 5. Bucket each item's button state for rendering.\n\t * for (const i of mainViewItems) {\n\t *   const activePrice = i.discounted_price ?? i.price;\n\t *   const canAfford = balances[i.purchase_type] >= activePrice;\n\t *   if (i.pool === 0) {\n\t *     console.log('[smartico] item', i.id, 'is sold out — render disabled Buy with \"Out of stock\" overlay');\n\t *   } else if (i.can_buy === false) {\n\t *     console.log('[smartico] item', i.id, 'is not eligible — render disabled Buy and surface cant_buy_message on the popup:', i.cant_buy_message);\n\t *   } else if (!canAfford) {\n\t *     console.log('[smartico] item', i.id, 'is unaffordable — render disabled Buy and show \"short by\" line on popup; deficit =', activePrice - balances[i.purchase_type], i.purchase_type);\n\t *   } else {\n\t *     console.log('[smartico] item', i.id, 'is buyable — render enabled Buy at price', activePrice, i.purchase_type);\n\t *   }\n\t * }\n\t *\n\t * // 6. Visitor-mode equivalent: onUpdate is accepted but never fires.\n\t * //    Re-poll if you need fresh data; buyStoreItem is not supported.\n\t * // const visitorItems = await window._smartico.vapi('EN').getStoreItems();\n\t * // console.log('[smartico] visitor catalog is the brand proxy user\\'s — per-user fields are not meaningful');\n\t * ```\n\t */\n\tpublic async getStoreItems({ onUpdate }: { onUpdate?: (data: TStoreItem[]) => void } = {}): Promise<TStoreItem[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.StoreItems, onUpdate);\n\t\t}\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.StoreItems,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.storeGetItemsT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Purchase a specific store item on behalf of the current user. Spends\n\t * the user's points / gems / diamonds (depending on the item's\n\t * `purchase_type`) and triggers reward delivery (bonus issuance, mini-game\n\t * spin grant, level change, prize-drop, raffle ticket, or tangible item).\n\t *\n\t * A successful response (`err_code === 0`) means the funds have already\n\t * been debited and the reward has been queued / granted server-side. The\n\t * user's balance change arrives over a separate push channel, not in this\n\t * response — see \"Refresh after success\" below.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate item from `getStoreItems()` first and gate the call\n\t * on these fields:\n\t * - `can_buy === true` — server-derived; combines segment / visibility\n\t *   conditions and any operator-set restrictions.\n\t * - `pool == null || pool > 0` — `null` means unlimited stock; a positive\n\t *   number means N units remain.\n\t * - User's balance for the item's `purchase_type`\n\t *   (`'points'` / `'gems'` / `'diamonds'`) is `>= price` (or\n\t *   `>= discounted_price` if set). Balances are not on `TStoreItem` —\n\t *   read them from the user properties returned by `getUserState()`.\n\t * - If `active_till_date` is set, it is in the future.\n\t *\n\t * Calling without satisfying these will most likely return a non-zero\n\t * `err_code` (one of the codes below). The SDK does not pre-validate\n\t * — it forwards the request to the server unconditionally.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; funds debited and reward delivered.\n\t * - `1` — generic server error / control-group rejection. Treat as a\n\t *   transient failure; show a \"try again later\" message.\n\t * - `106` — label mismatch detected before the purchase transaction\n\t *   (e.g. cross-label item id). From a consumer perspective: the item is\n\t *   not purchasable by this user.\n\t * - `11000` (`SHOP_NO_BALANCE`) — insufficient **points** balance.\n\t *   Show an insufficient-balance message that names how many points are\n\t *   missing (`price - current_points_balance`). The Buy button on the\n\t *   item should already be disabled when this is the case; this code\n\t *   normally fires only on a stale local balance.\n\t * - `11001` (`SHOP_WRONG_LABEL`) — user-vs-item label mismatch detected\n\t *   inside the purchase transaction. Distinct from `106`; both mean\n\t *   \"not purchasable by this user\" from the consumer's perspective.\n\t *   Surface as a generic \"item not available\" message.\n\t * - `11002` (`SHOP_FAILED_TO_BUY_BONUS`) — the bonus configured on the\n\t *   store item couldn't be issued (bad / disabled bonus config on the\n\t *   operator side). Funds are NOT debited. Surface a generic error and\n\t *   advise the user to contact support if it persists.\n\t * - `11003` (`SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION`) — the item's\n\t *   **visibility** segment condition is not satisfied. Shouldn't be\n\t *   reachable through a correctly-rendered UI (the item shouldn't be\n\t *   shown in the first place); usually indicates a stale local store\n\t *   list. Re-fetch via `getStoreItems()`.\n\t * - `11004` (`SHOP_FAILED_TO_BUY_SHOP_ITEM_CONDITION_PURSHASE`) — the\n\t *   item's **purchase** segment condition is not satisfied (the item is\n\t *   visible but the user is not in the buyable segment). Surface a\n\t *   localized \"try again later\" / \"you're not eligible\" message; do not\n\t *   retry automatically.\n\t * - `11005` (`SHOP_FAILED_TO_BUY_MATCHING_BONUS`) — matching-bonus\n\t *   coupon issuance failed (variant of `11002` for matching-deposit\n\t *   bonuses). Funds are NOT debited. Surface a generic error.\n\t * - `11006` (`SHOP_FAILED_MAX_BOUGHT_ITEMS_REACHED`) — per-user purchase\n\t *   cap reached (e.g. \"max 1 per day\"). Surface the item's\n\t *   `limit_message` if set, otherwise `err_message`. Do not retry.\n\t * - `11007` — bonus was issued but a follow-up redemption step failed\n\t *   server-side. Funds **are** debited and the purchase event is recorded;\n\t *   the consumer's UI should refresh the store list (auto-refresh will\n\t *   fire) and surface a soft warning rather than a hard error.\n\t * - `11009` (`SHOP_FAILED_POOL_EMPTY`) — stock pool is empty / sold out.\n\t *   Show a \"sold out\" message; auto-refresh will mark the item as such\n\t *   in subsequent `getStoreItems()` updates.\n\t * - `11011` (`SHOP_NO_BALANCE_GEMS`) — insufficient **gems** balance.\n\t *   Same handling as `11000` but for the gems currency.\n\t * - `11012` (`SHOP_NO_BALANCE_DIAMONDS`) — insufficient **diamonds**\n\t *   balance. Same handling as `11000` but for the diamonds currency.\n\t * - `11014` (`SHOP_FAILED_PURCHASE_LIMITATION`) — outside the configured\n\t *   purchase window (purchase weekday / time-of-day / window). Surface\n\t *   the item's `purchase_limit_message` if set, otherwise `err_message`.\n\t * - `9999` — uncaught server exception. Treat as a transient failure;\n\t *   surface a generic error and allow retry.\n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * **Idempotency**: NOT idempotent. The server performs no de-duplication —\n\t * a second successful call deducts funds again and grants the reward\n\t * again (subject to per-user purchase caps). The SDK itself does **not**\n\t * enforce a single in-flight call. The consumer MUST guard the call site\n\t * against double-clicks (set a local \"buying\" flag on click, clear it on\n\t * response).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically re-fetches the store item list and the\n\t * purchased-items history on every response (success or error). Any\n\t * `onUpdate` callback registered via `getStoreItems({ onUpdate })` (or\n\t * the purchased-items equivalent) fires shortly after with the updated\n\t * arrays — reflecting the new `pool`, `can_buy`, and any `purchased_*`\n\t * flags. The user's balance (points / gems / diamonds) is exposed on the\n\t * user-properties channel and updates independently; if the UI displays\n\t * the balance, subscribe to user-property updates separately (it does\n\t * NOT flow through `getStoreItems`).\n\t *\n\t * **Side effects** (consumer-observable on success)\n\t * - User's points / gems / diamonds balance decreases by `price`\n\t *   (or `discounted_price` if set).\n\t * - Item's `pool` decrements by 1 (when `pool != null`).\n\t * - Per-user purchase counters update — `purchased_today`,\n\t *   `purchased_this_week`, `purchased_this_month` on the next\n\t *   `getStoreItems()` refresh.\n\t * - The reward is delivered: bonus issuance, mini-game spin grant,\n\t *   level change, prize drop, raffle ticket, or tangible-item record.\n\t *   Each reward type pushes its own follow-up update (e.g. a new\n\t *   bonus appears in `getBonuses()`, the spin shows up in\n\t *   `getMiniGames()`). Subscribe to each relevant channel separately.\n\t * - A purchase row is appended to the user's purchase history,\n\t *   surfaced via the purchased-items list.\n\t *\n\t * **UI guidance**: see [UI Guide — `buyStoreItem`](../../docs/ui/store/UIGuide_buyStoreItem.md).\n\t *\n\t * @param item_id  The store item `id` (from `getStoreItems()`).\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * const items = await window._smartico.api.getStoreItems({\n\t *   onUpdate: (next) => console.log('[smartico] store items updated — re-render store grid with this fresh array', next),\n\t * });\n\t * const item = items.find(i => i.id === itemId);\n\t *\n\t * if (!item) {\n\t *   console.log('[smartico] item not in current store list — keep UI as-is, possibly refresh getStoreItems');\n\t *   return;\n\t * }\n\t *\n\t * // Local pre-checks: keep these aligned with the Buy-button decision matrix above.\n\t * const effectivePrice = item.discounted_price ?? item.price;\n\t * const inStock = item.pool == null || item.pool > 0;\n\t * const inWindow = !item.active_till_date || Date.now() < item.active_till_date;\n\t * if (!item.can_buy || !inStock || !inWindow) {\n\t *   console.log('[smartico] buy not applicable — show disabled state with operator copy if any:', item.cant_buy_message);\n\t *   return;\n\t * }\n\t *\n\t * console.log('[smartico] buy starting — set in-flight flag, show loading dots on Buy button, keep detail modal open');\n\t * const r = await window._smartico.api.buyStoreItem(item.id);\n\t * console.log('[smartico] buy response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0) {\n\t *   console.log('[smartico] purchase successful — close the detail modal, show a success toast; getStoreItems onUpdate above will fire with the refreshed list (do NOT manually re-fetch)');\n\t * } else if (r.err_code === 11000 || r.err_code === 11011 || r.err_code === 11012) {\n\t *   console.error('[smartico] insufficient balance for this purchase_type — show insufficient-balance UI and how many units are missing:', item.purchase_type, effectivePrice);\n\t * } else if (r.err_code === 11009) {\n\t *   console.error('[smartico] item sold out — show a dedicated \"Sold out\" message; the auto-refresh will mark the card as such shortly');\n\t * } else if (r.err_code === 11006) {\n\t *   console.error('[smartico] per-user purchase cap reached — surface the operator-defined limit message:', item.limit_message || r.err_message);\n\t * } else if (r.err_code === 11014) {\n\t *   console.error('[smartico] outside purchase window — surface the operator-defined purchase-limit message:', item.purchase_limit_message || r.err_message);\n\t * } else if (r.err_code === 11004 || r.err_code === 11003) {\n\t *   console.error('[smartico] user not eligible / stale visibility — show a localized \"try again later\" message and let auto-refresh reconcile');\n\t * } else {\n\t *   console.error('[smartico] buy failed — show a generic error toast/modal with this message:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async buyStoreItem(item_id: number): Promise<TBuyStoreItemResult> {\n\t\tconst r = await this.api.buyStoreItem(this.userExtId, item_id);\n\n\t\tconst o: TBuyStoreItemResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Returns the list of active store categories configured for the current label.\n\t * Categories are operator-defined groupings used to organize store items into tabs,\n\t * sections, or filter chips in the gamification store UI.\n\t *\n\t * @remarks\n\t * **What categories are**\n\t * - Operator-defined groupings, configured per-label by the brand operator.\n\t *   Only active categories are returned; inactive / archived / deleted ones are\n\t *   filtered out server-side.\n\t * - Each `TStoreCategory` exposes `{ id, name, order }`. `name` is the display label;\n\t *   `order` is the relative position (lower = appears first).\n\t * - The same set of categories is returned to every user of the label — there is no\n\t *   per-segment / per-currency / per-device filtering on the category list. Item-level\n\t *   segment visibility happens on {@link getStoreItems}, not here.\n\t *\n\t * **Localization / translation**\n\t * - `name` is **pre-translated server-side** to the authenticated user's stored language.\n\t *   In visitor mode, the language passed to `_smartico.vapi(lang)` drives the translation.\n\t *   Consumers never need to translate `name` themselves.\n\t * - Fallback if no translation exists for the user's language: the operator-set default\n\t *   (typically the brand's English) value is returned. The field is never null for an\n\t *   active category.\n\t *\n\t * **Sort order**\n\t * The server does NOT pre-sort. Sort client-side before rendering:\n\t * `categories.sort((a, b) => a.order - b.order)`.\n\t *\n\t * **How store items join to categories**\n\t * Each `TStoreItem` exposes `category_ids: number[]` (zero-or-more, many-to-many).\n\t * A single store item can belong to multiple categories, or to none. To render a\n\t * \"category → items\" view:\n\t * `items.filter(i => i.category_ids.includes(cat.id))`.\n\t *\n\t * **Uncategorized items**\n\t * Items with `category_ids: []` are NOT represented by a synthetic \"Other\" entry\n\t * in the response. The convention used by the reference store UI is to synthesize\n\t * a client-side bucket (e.g. labelled \"General\") for items that have no category, OR\n\t * for items whose `category_ids` reference a category that is no longer returned by\n\t * this method (e.g. archived since the item was tagged). If you choose to render\n\t * such a synthetic bucket, place it first (the reference UI uses an `order: -1`\n\t * convention so it precedes all operator-defined categories).\n\t *\n\t * **Empty categories**\n\t * A category may be returned even if zero items currently reference it (since this\n\t * method does not join against items). The reference store UI hides such empty\n\t * categories from its tab strip — replicate that filter if you don't want to render\n\t * tabs that lead to empty content panels.\n\t *\n\t * **Refresh cadence / cache**\n\t * - The SDK caches the response for 30 seconds. Subsequent calls within that window\n\t *   return the cached array without a network round-trip.\n\t * - The cache is NOT invalidated by store-item push events or purchases — operator-driven\n\t *   category changes propagate at the next 30 s cache miss.\n\t * - Cache is fully cleared on login / logout.\n\t * - In **visitor mode**, additional server-side caching applies on top of the SDK cache;\n\t *   worst-case staleness for an edited/added category is on the order of a few minutes\n\t *   for anonymous viewers.\n\t *\n\t * **Idempotency**: safe. Read-only metadata fetch. Cache de-duplicates concurrent calls.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getStoreCategories`](../../docs/ui/store/UIGuide_getStoreCategories.md).\n\t *\n\t * @returns Array of `{ id, name, order }`. Empty array if no active categories are\n\t *   configured for the label. `name` is pre-translated. Order is NOT applied — caller\n\t *   must sort.\n\t *\n\t * @example\n\t * ```ts\n\t * const [categories, items] = await Promise.all([\n\t *   window._smartico.api.getStoreCategories(),\n\t *   window._smartico.api.getStoreItems(),\n\t * ]);\n\t *\n\t * if (categories.length === 0) {\n\t *   console.log('[smartico] no store categories configured — render items as a flat grid without tabs:', items.length);\n\t * } else {\n\t *   // Sort categories; build per-category item buckets; hide empty categories\n\t *   const sorted = [...categories].sort((a, b) => a.order - b.order);\n\t *   const tabs = sorted\n\t *     .map(cat => ({ cat, items: items.filter(i => i.category_ids?.includes(cat.id)) }))\n\t *     .filter(t => t.items.length > 0);\n\t *\n\t *   // Optional: synthesize an \"Other\" bucket for items with no (or unknown) category\n\t *   const knownIds = new Set(categories.map(c => c.id));\n\t *   const orphans = items.filter(i => !i.category_ids?.length || !i.category_ids.some(id => knownIds.has(id)));\n\t *   if (orphans.length > 0) {\n\t *     console.log('[smartico] uncategorized store items — render a client-synthesized \"Other\" tab at the front of the tab strip:', orphans.length);\n\t *   }\n\t *\n\t *   console.log('[smartico] render store tabs in this order with these counts:', tabs.map(t => `${t.cat.name} (${t.items.length})`));\n\t * }\n\t *\n\t * // Visitor mode — same shape, language driven by vapi(lang) argument\n\t * const visitorCats = await window._smartico.vapi('DE').getStoreCategories();\n\t * console.log('[smartico] visitor-mode store categories (names translated to DE):', visitorCats);\n\t * ```\n\t */\n\tpublic async getStoreCategories(): Promise<TStoreCategory[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.StoreCategories,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.storeGetCategoriesT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Fetches the authenticated user's **store purchase history** — a paginated,\n\t * newest-first list of past store purchases (one row per redemption).\n\t *\n\t * Designed for a \"My Purchases\" / \"Order History\" screen. Each entry carries\n\t * the same descriptive fields as the catalog card plus three history-only\n\t * fields: `purchase_ts` (when the purchase happened), `purchase_points_amount`\n\t * (the amount actually paid at that time — a price snapshot, not the\n\t * current `price`), and `purchase_type` (`'points' | 'gems' | 'diamonds'`).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported (the SDK only\n\t *   exposes this method on the authenticated `_smartico.api`, not on\n\t *   `_smartico.vapi`).\n\t * - No prerequisite calls — calling without first fetching\n\t *   {@link getStoreItems} or {@link getStoreCategories} is fine.\n\t *\n\t * **Pagination semantics**\n\t * - **Offset-based**, newest-first. The server orders rows by purchase\n\t *   timestamp **descending** and the SDK does NOT re-sort — items arrive\n\t *   ready to render in display order.\n\t * - `limit` — page size. **The SDK default is 20.** There is no server-side\n\t *   hard cap, but 20 matches what the default Smartico UI uses end-to-end; the\n\t *   protocol and storage layers were sized for this page size. Treat `20`\n\t *   as the conventional/recommended value; passing a much larger limit will\n\t *   return more rows but is not the supported integration pattern.\n\t *   Avoid `limit <= 0` — the server peeks `limit + 1` rows internally, so\n\t *   `limit = 0` returns 1 row with a misleading \"has more\" signal, and\n\t *   negative values produce undefined results.\n\t * - `offset` — number of items to skip from the start. The SDK default is\n\t *   `0` (first page). For load-more pagination, pass\n\t *   `offset = (previously-loaded items).length` on each subsequent call.\n\t * - **No `hasMore` on the returned array.** `TStoreItem[]` is a flat list;\n\t *   the underlying protocol response carries `hasMore` but it is not\n\t *   surfaced through this method. Two ways for consumers to know they\n\t *   reached the end:\n\t *     1. The returned array is shorter than `limit` (definitive end), or\n\t *     2. A subsequent call at `offset = previous.length` returns `[]`.\n\t *   Either is reliable.\n\t * - No date-range / category / status filter parameters — pagination is the\n\t *   only server-side slicing. Apply any further filtering client-side.\n\t *\n\t * **No per-item fulfillment status**\n\t * - History entries do NOT carry a `delivered` / `pending` / `cancelled` /\n\t *   `refunded` field. The list contains rows for committed purchase\n\t *   attempts; the server query does not filter by transaction-status, so in\n\t *   practice the rows that appear are completed purchases (failed\n\t *   transactions roll back and don't write a row). Treat every item as a\n\t *   completed transaction unless a future SDK release adds an explicit\n\t *   status field.\n\t *\n\t * **Bonus-type entries**\n\t * - When the user redeemed a bonus item, the entry's `type` field surfaces\n\t *   as `'bonus'`. **Known limitation:** the SDK transform currently maps\n\t *   both `Bonus` and `Tangible` server-side item types to the same string\n\t *   `'bonus'` — so the `type` field on history rows cannot distinguish a\n\t *   bonus redemption from a tangible-prize redemption. The actual bonus\n\t *   payload (wallet credit, free spins, etc.) is dispatched by the server\n\t *   asynchronously and is NOT embedded in the history entry — consumers\n\t *   that need bonus details should subscribe to bonus push events\n\t *   separately rather than reading them from this list.\n\t * - History rows render identically across types — there is no deep-link to\n\t *   the bonus wallet or re-claim affordance on the row itself.\n\t *\n\t * **Per-row data**\n\t * Each row uses the `TStoreItem` shape but populates four history-only\n\t * fields not present on `getStoreItems` output. `purchase_ts` is the\n\t * Unix-ms timestamp of the purchase — format with\n\t * `new Date(purchase_ts).toLocaleString()` in the user's local timezone;\n\t * no relative labels (\"Today\" / \"Yesterday\") are produced by the SDK.\n\t * `purchase_points_amount` is the amount actually paid at the time of\n\t * purchase — a snapshot of the historical price, which may differ from\n\t * the item's current `price`. `purchase_type` is the currency actually\n\t * charged (`'points' | 'gems' | 'diamonds'`); render the matching\n\t * balance icon next to the amount. The convenience booleans\n\t * `purchased_today` / `purchased_this_week` / `purchased_this_month` are\n\t * computed client-side from the consumer's local clock — useful for\n\t * grouping rows under \"Today\" / \"This Week\" headers.\n\t *\n\t * **Catalog fields on a history row**\n\t * The promotional fields (`ribbon`, `discounted_price`,\n\t * `discount_price_ribbon`, `custom_ribbon_image`, `active_till_date`)\n\t * reflect the CURRENT catalog state of the item, NOT its state at\n\t * purchase time — the default Smartico UI hides them on history rows to\n\t * avoid implying that the historical purchase carried the current\n\t * promotional banner. Descriptive marketing fields (`description`,\n\t * `hint_text`, `related_games`) are typically suppressed on a compact\n\t * history row. The current-purchasability fields `can_buy` and `pool`\n\t * reflect now, not then — useful only if you render a \"Buy Again\"\n\t * affordance on the row. One implementation gotcha: unlike\n\t * `getStoreItems`, this method's transform does NOT auto-parse JSON\n\t * strings in `custom_data` — call `JSON.parse()` yourself if you store\n\t * JSON there.\n\t *\n\t * **Cache & refresh**\n\t * - The SDK caches each `(limit, offset)` page separately for 30 seconds.\n\t *   Repeated calls within that window resolve from cache without a\n\t *   network round-trip.\n\t * - The cache is invalidated and `onUpdate` (when registered) is invoked\n\t *   automatically after a successful {@link buyStoreItem} call — the SDK\n\t *   re-fetches the same page parameters that were registered together with\n\t *   the current `onUpdate` callback and pushes the fresh array.\n\t * - Multi-tab caveat: if the user has the same brand open in multiple\n\t *   tabs, **all open tabs** receive the `onUpdate` event on a purchase,\n\t *   not only the tab that initiated the buy. The event is scoped to the\n\t *   current authenticated user — a different user's purchase never fires\n\t *   this callback.\n\t * - Only ONE `onUpdate` callback can be registered at a time. Each call to\n\t *   `getStorePurchasedItems({ onUpdate })` overwrites the previous handler.\n\t *\n\t * **Idempotency**: safe. Pure read.\n\t *\n\t * **Side effects**: none — read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getStorePurchasedItems`](../../docs/ui/store/UIGuide_getStorePurchasedItems.md).\n\t *\n\t * @param params - Optional pagination + callback bag.\n\t * @param params.limit - Page size. Defaults to `20`. Use `20` as the\n\t *   conventional value (matches the default Smartico UI end-to-end). Avoid\n\t *   non-positive values.\n\t * @param params.offset - Number of rows to skip from the newest end.\n\t *   Defaults to `0`. For load-more pagination pass the current array\n\t *   length.\n\t * @param params.onUpdate - Optional callback invoked after a successful\n\t *   {@link buyStoreItem} elsewhere in the session. Receives the refreshed\n\t *   page for the same `(limit, offset)` used on the call that registered\n\t *   this callback. Only ONE callback can be registered; each new call\n\t *   overwrites the previous one. Pass a stable handler or\n\t *   re-register intentionally on screen entry.\n\t *\n\t * @returns Promise resolving to an array of `TStoreItem` history entries\n\t *   in newest-first order. Empty array if the user has no purchases (or\n\t *   the requested `offset` is beyond the end). Each entry carries\n\t *   `purchase_ts`, `purchase_points_amount`, `purchase_type`, and the\n\t *   `purchased_today/this_week/this_month` convenience flags in addition\n\t *   to the standard item fields.\n\t *\n\t * @example\n\t * ```ts\n\t * // Initial load + subscribe to refresh-on-purchase.\n\t * const handleHistoryUpdate = (items: TStoreItem[]) => {\n\t *   console.log(\n\t *     '[smartico] purchase history refreshed — re-render the history list with these',\n\t *     items.length,\n\t *     'items (newest first):',\n\t *     items,\n\t *   );\n\t * };\n\t *\n\t * try {\n\t *   const firstPage = await _smartico.api.getStorePurchasedItems({\n\t *     limit: 20,\n\t *     offset: 0,\n\t *     onUpdate: handleHistoryUpdate,\n\t *   });\n\t *\n\t *   if (firstPage.length === 0) {\n\t *     console.log('[smartico] no purchase history — render the empty state (\"No purchases yet\")');\n\t *   } else {\n\t *     console.log(\n\t *       '[smartico] render',\n\t *       firstPage.length,\n\t *       'history rows (newest first). Show \"Load more\" button if length === 20:',\n\t *       firstPage,\n\t *     );\n\t *\n\t *     // Inspect the first entry's history-only fields.\n\t *     const first = firstPage[0];\n\t *     console.log(\n\t *       '[smartico] most-recent purchase: name=', first.name,\n\t *       'paid', first.purchase_points_amount, first.purchase_type,\n\t *       'at', new Date(first.purchase_ts ?? 0).toLocaleString(),\n\t *       '— format with toLocaleString (user-local time) on the row.',\n\t *     );\n\t *   }\n\t *\n\t *   // Load-more pattern: fetch page 2 once the user scrolls / clicks \"Load more\".\n\t *   if (firstPage.length === 20) {\n\t *     const nextPage = await _smartico.api.getStorePurchasedItems({\n\t *       limit: 20,\n\t *       offset: firstPage.length,\n\t *     });\n\t *     const isLastPage = nextPage.length < 20;\n\t *     console.log(\n\t *       '[smartico] appended page 2 —',\n\t *       nextPage.length,\n\t *       'rows.',\n\t *       isLastPage ? 'Hide \"Load more\" — end reached.' : 'Keep \"Load more\" visible.',\n\t *     );\n\t *   }\n\t * } catch (e) {\n\t *   console.error(\n\t *     '[smartico] failed to load purchase history — show a generic error placeholder or retry with backoff:',\n\t *     e,\n\t *   );\n\t * }\n\t * ```\n\t */\n\tpublic async getStorePurchasedItems({\n\t\tlimit,\n\t\toffset,\n\t\tonUpdate,\n\t}: { limit?: number; offset?: number; onUpdate?: (data: TStoreItem[]) => void } = {}): Promise<TStoreItem[]> {\n\t\tconst requestLimit = limit === undefined ? 20 : limit;\n\t\tconst requestOffset = offset === undefined ? 0 : offset;\n\t\tconst cacheKey = this.storeHistoryCacheKey(requestLimit, requestOffset);\n\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.StoreHistory, onUpdate);\n\t\t\tthis.storeHistoryOnUpdateParams = { limit: requestLimit, offset: requestOffset };\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tcacheKey,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.storeGetPurchasedItemsT(this.userExtId, requestLimit, requestOffset),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\tprotected async updateStorePurchasedItems() {\n\t\tconst payload = await this.api.storeGetPurchasedItemsT(\n\t\t\tthis.userExtId,\n\t\t\tthis.storeHistoryOnUpdateParams.limit,\n\t\t\tthis.storeHistoryOnUpdateParams.offset,\n\t\t);\n\t\tconst cacheKey = this.storeHistoryCacheKey(this.storeHistoryOnUpdateParams.limit, this.storeHistoryOnUpdateParams.offset);\n\n\t\tOCache.set(cacheKey, payload, ECacheContext.WSAPI);\n\n\t\tconst onUpdate = this.onUpdateCallback.get(onUpdateContextKey.StoreHistory);\n\t\tif (onUpdate) {\n\t\t\tonUpdate(payload);\n\t\t}\n\t}\n\n\tprotected async updateStoreItems() {\n\t\tconst payload = await this.api.storeGetItemsT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.StoreItems, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTTournament,\n\tTTournamentDetailed,\n\tTTournamentRegistrationResult,\n\tTClanTournamentPlayers,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIStore } from './WSAPIStore';\n\n/** @group Tournaments */\nexport class WSAPITournaments extends WSAPIStore {\n\t/**\n\t * Returns the list of tournaments currently visible to the user, scoped\n\t * server-side to what the user's segments qualify them to see. Optionally\n\t * subscribes to live updates via `onUpdate`: the callback is invoked with\n\t * the full refreshed list whenever the user registers in a tournament.\n\t *\n\t * The returned list is the canonical source of truth for tournament\n\t * lobby state (`is_user_registered`, `registration_status`,\n\t * `is_in_progress`, `is_can_register`, etc.). Consumers should NOT\n\t * mutate it optimistically — always wait for the `onUpdate` callback\n\t * (or a fresh fetch after the 30 s cache window) to observe new state.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed list (never a diff/patch).\n\t * Each subsequent call to `getTournamentsList({ onUpdate })` REPLACES\n\t * the prior callback — only one active subscriber at a time. Pass\n\t * `onUpdate: undefined` (or omit it) to keep the prior callback in\n\t * place; the callback is never auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t *\n\t * 1. `registerInTournament(...)` resolves on this connection (any\n\t *    `err_code`). The refreshed list reflects the new\n\t *    `is_user_registered` / `registration_status` /\n\t *    `registration_count` on the affected tournament.\n\t *\n\t * Does NOT fire for: tournament lifecycle transitions (start, finish,\n\t * cancellation), score updates, other users' registrations, or\n\t * operator-side BO edits. Those changes surface only on the next\n\t * cache miss (after the 30 s TTL) — poll manually if your UI needs\n\t * sub-30s lifecycle freshness.\n\t *\n\t * **Server-side filtering** (what's excluded before the SDK sees it)\n\t * The server filters by visibility segment and entry segment, removes\n\t * tournaments past their post-finish display window, and excludes\n\t * tournaments not yet published. SDK consumers receive only items\n\t * the user is eligible to see; no client-side gating is required.\n\t *\n\t * **Reading state from the returned item**\n\t * Drive list bucketing and CTA labels from the SDK-computed booleans\n\t * (`is_active`, `is_can_register`, `is_cancelled`, `is_finished`,\n\t * `is_in_progress`, `is_upcoming`), NOT from raw `start_time` /\n\t * `end_time` comparisons — the booleans encode the canonical\n\t * lifecycle states and already reflect server-side rules around\n\t * qualifying scores and late registration. `is_user_registered` is\n\t * independent of `is_can_register` — a registered user has\n\t * `is_user_registered: true` and `is_can_register: false`. The `me`\n\t * block (if present) carries the user's own leaderboard position and\n\t * score; it's undefined for unregistered users, users without any\n\t * recorded score, and visitor-mode sessions. The `prize_pool_short`\n\t * field carries the operator-supplied summary string (\"$10,000\",\n\t * \"Mixed prizes\") for compact card rendering; the full per-place\n\t * `prizes[]` breakdown is also populated here but is typically\n\t * rendered only in the detail view via\n\t * {@link getTournamentInstanceInfo}.\n\t *\n\t * **Cross-references**\n\t * Tournaments with `is_clan_based: true` group participants by clan —\n\t * see {@link getClanTournamentPlayers} for fetching the players list\n\t * of a specific clan within a clan tournament. The detailed lobby\n\t * view (with full player leaderboard and prize structure) comes from\n\t * {@link getTournamentInstanceInfo}. Tournaments with\n\t * `custom_section_id` belong to an operator-defined custom section\n\t * (resolve metadata via `getCustomSections()`).\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache is\n\t * fully cleared on login / logout.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the cache\n\t * window return a deep-cloned cached array without a network\n\t * round-trip.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getTournamentsList`](../../docs/ui/tournaments/UIGuide_getTournamentsList.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned, scoped to\n\t * the brand's public tournament list. Per-user fields (`me`,\n\t * `is_user_registered`, `registration_status`) are not meaningful.\n\t * The `onUpdate` callback is accepted but never fires (registration\n\t * mutations are not supported in visitor mode).\n\t *\n\t * @param params              Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate     Callback invoked with the full refreshed\n\t *                            tournament list after every\n\t *                            {@link registerInTournament} round-trip on\n\t *                            this connection. Each call overwrites the\n\t *                            prior callback. Never fires in visitor mode.\n\t * @returns                   Promise resolving to the array of\n\t *                            tournaments visible to the user. Empty\n\t *                            array if no tournaments are visible.\n\t *\n\t * @example\n\t * ```ts\n\t * const tournaments = await window._smartico.api.getTournamentsList({\n\t *   onUpdate: (refreshed) => {\n\t *     console.log('[smartico] tournament list refreshed — re-render the lobby UI from this array, do not merge with prior state:', refreshed);\n\t *     const justRegistered = refreshed.filter(t => t.is_user_registered);\n\t *     console.log('[smartico] user is now registered in these tournaments:', justRegistered.map(t => t.name));\n\t *   },\n\t * });\n\t *\n\t * // Bucket items by lifecycle state for a tabbed UI.\n\t * const live = tournaments.filter(t => t.is_in_progress);\n\t * const upcoming = tournaments\n\t *   .filter(t => t.is_upcoming && !t.is_user_registered)\n\t *   .sort((a, b) => a.start_time - b.start_time);\n\t * const mine = tournaments.filter(t => t.is_user_registered);\n\t * const finished = tournaments.filter(t => t.is_finished);\n\t *\n\t * console.log('[smartico] render lobby tabs with these counts: live=', live.length,\n\t *   'upcoming=', upcoming.length, 'mine=', mine.length, 'finished=', finished.length);\n\t *\n\t * // Featured tournament: pin to position 0 of the Overview/Top tabs.\n\t * const featured = tournaments.find(t => t.is_featured && !t.is_cancelled);\n\t * if (featured) {\n\t *   console.log('[smartico] featured tournament — pin to position 0 of the Overview tab:', featured.name);\n\t * }\n\t *\n\t * // Visitor mode: onUpdate accepted but never fires; re-poll if needed.\n\t * // const visitorList = await window._smartico.vapi('EN').getTournamentsList();\n\t * ```\n\t */\n\tpublic async getTournamentsList({ onUpdate }: { onUpdate?: (data: TTournament[]) => void } = {}): Promise<TTournament[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.TournamentList, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.TournamentList,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.tournamentsGetLobbyT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the full detail of a single tournament instance — adds the\n\t * player leaderboard, the full prize structure, and (for clan\n\t * tournaments) the clan leaderboard and per-clan prize structure on\n\t * top of everything already in `TTournament`. Use this to power a\n\t * tournament detail / lobby screen after the user picks an item from\n\t * {@link getTournamentsList}.\n\t *\n\t * Live leaderboard updates require manual re-fetching — there is no\n\t * subscription model, no push event, and no client-side cache (each\n\t * call hits the server). The default Smartico UI polls every 3 seconds\n\t * while the detail view is open.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass a valid `tournamentInstanceId` read from `TTournament.instance_id`\n\t * on an item returned by {@link getTournamentsList}. The method works\n\t * standalone — calling `getTournamentsList()` first is not required by\n\t * the SDK, but is the only stable source of valid IDs.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** This is a one-shot promise; call again to\n\t *   refresh.\n\t * - **No client cache.** Every call sends a network request and\n\t *   returns the latest server snapshot. Safe to poll on an interval —\n\t *   the default Smartico UI uses 3 s while the detail view is visible.\n\t * - **No push event** invalidates or refreshes detail state. Score\n\t *   changes, registration count changes, lifecycle transitions — all\n\t *   require a fresh `getTournamentInstanceInfo` call.\n\t *\n\t * **Returned shape — beyond `TTournament`**\n\t * `TTournamentDetailed` extends `TTournament` with the following\n\t * additional data: a `players[]` leaderboard sorted server-side by\n\t * score (only members with at least one recorded score); the user's\n\t * own `me` block carrying their rank and score (undefined when not\n\t * registered or when the user has no score yet); a full per-place\n\t * `prizes[]` array (place range, type, points / gems / diamonds\n\t * amounts, image, name); and `related_games[]` if the operator has\n\t * associated games with this tournament. For clan tournaments\n\t * (`is_clan_based === true`), the response also carries\n\t * `clan_leaderboard[]` (ranked clans with `total_score` and\n\t * `contributing_members`), `clan_prize_structure[]` (per-clan-place\n\t * prize tiers — Fixed vs Dynamic, with ScoreWeighted /\n\t * EqualSplit distribution for Dynamic prizes), `user_clan_id` (the\n\t * user's own clan), and the advisory `user_position_in_clan` /\n\t * `user_score_in_clan` fields.\n\t *\n\t * **Idempotency**: safe. Read-only. Each call returns the latest\n\t * server snapshot.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getTournamentInstanceInfo`](../../docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md).\n\t *\n\t * **Visitor mode**: not supported. Use {@link getTournamentsList} for\n\t * the public lobby list in visitor mode; the detail endpoint requires\n\t * an authenticated session.\n\t *\n\t * @param tournamentInstanceId  The `instance_id` from a `TTournament`\n\t *                              returned by {@link getTournamentsList}.\n\t * @returns                     Promise resolving to `TTournamentDetailed`.\n\t *                              Rejects if the instance ID is invalid\n\t *                              or the user lacks visibility for it.\n\t *\n\t * @example\n\t * ```ts\n\t * const tournaments = await window._smartico.api.getTournamentsList();\n\t * const tournament = tournaments[0];\n\t *\n\t * console.log('[smartico] loading detail view for tournament', tournament.instance_id);\n\t * const detail = await window._smartico.api.getTournamentInstanceInfo(tournament.instance_id);\n\t *\n\t * console.log('[smartico] render detail with', detail.players?.length ?? 0,\n\t *   'players,', detail.prizes?.length ?? 0, 'prize tiers');\n\t *\n\t * if (detail.is_clan_based && detail.clan_leaderboard) {\n\t *   console.log('[smartico] clan tournament — render clan leaderboard tab with',\n\t *     detail.clan_leaderboard.length, 'clans');\n\t *   if (detail.user_clan_id != null) {\n\t *     console.log('[smartico] user belongs to clan', detail.user_clan_id,\n\t *       '— highlight that row in the clan leaderboard');\n\t *   }\n\t * }\n\t *\n\t * // Live leaderboard updates — poll every 3 seconds while the detail view is open.\n\t * const pollId = setInterval(async () => {\n\t *   try {\n\t *     const fresh = await window._smartico.api.getTournamentInstanceInfo(tournament.instance_id);\n\t *     console.log('[smartico] detail refreshed — re-render player + clan leaderboards from this new snapshot:', fresh);\n\t *   } catch (e) {\n\t *     console.error('[smartico] tournament detail poll failed — keep showing last snapshot, retry on next tick:', e);\n\t *   }\n\t * }, 3_000);\n\t * // clearInterval(pollId) when the detail view closes.\n\t *\n\t * if (detail.me) {\n\t *   console.log('[smartico] current user is rank', detail.me.position,\n\t *     'with', detail.me.scores, 'points — render the sticky \"me\" panel below the leaderboard');\n\t * }\n\t * ```\n\t */\n\tpublic async getTournamentInstanceInfo(tournamentInstanceId: number): Promise<TTournamentDetailed> {\n\t\treturn this.api.tournamentsGetInfoT(this.userExtId, tournamentInstanceId);\n\t}\n\n\t/**\n\t * Returns the ranked players of a specific clan within a clan-based\n\t * tournament instance. Used to drill down from the clan-leaderboard\n\t * tab on the tournament detail view into a single clan's member\n\t * roster.\n\t *\n\t * The server returns up to roughly 20 players (top-N by score\n\t * descending). Server-side ordering is already by `scores` DESC\n\t * (equivalent to `position` ASC) — no client-side re-sort is\n\t * required.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass a valid `tournamentInstanceId` (read from `TTournament.instance_id`\n\t * returned by {@link getTournamentsList}) and a `clanId` (read from\n\t * `TTournamentDetailed.clan_leaderboard[].clan_id` returned by\n\t * {@link getTournamentInstanceInfo}). The tournament should be\n\t * clan-based (`is_clan_based === true`); calling this against a\n\t * non-clan tournament typically returns an empty `players` array.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** This is a one-shot promise.\n\t * - **No client cache.** Every call hits the server.\n\t * - **No push event** refreshes the response. Live updates to clan\n\t *   member rankings require a fresh call.\n\t * - The default Smartico UI fetches this once when the user opens the\n\t *   clan-drill-down modal and does NOT refresh while the modal is\n\t *   open. If your UI needs live updates, re-call on an interval; the\n\t *   clan leaderboard at the parent level (via\n\t *   {@link getTournamentInstanceInfo}) does refresh via its own\n\t *   polling cadence.\n\t *\n\t * **Returned shape**\n\t * `TClanTournamentPlayers` carries the `tournament_instance_id`\n\t * alongside the `players[]` array — each entry has `position`,\n\t * `scores`, `public_username`, `clean_ext_user_id`, `avatar_id`,\n\t * `avatar_real_id`, the resolved `avatar_url`, `user_id`, and the\n\t * `is_me` flag identifying the current user's row. The response does\n\t * NOT echo the clan's identity — render the clan header from the\n\t * caller-side `ClanLeaderboardEntry` object you passed in.\n\t *\n\t * **Username display**: prefer `clean_ext_user_id` when set, falling\n\t * back to `public_username`. The default Smartico UI uses\n\t * `clean_ext_user_id || public_username || ''`.\n\t *\n\t * **Idempotency**: safe. Read-only. Each call returns the latest\n\t * server snapshot.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getClanTournamentPlayers`](../../docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param tournamentInstanceId  The tournament `instance_id` from a\n\t *                              clan-based `TTournament`.\n\t * @param clanId                The clan ID from\n\t *                              `TTournamentDetailed.clan_leaderboard[].clan_id`.\n\t * @returns                     Promise resolving to\n\t *                              `TClanTournamentPlayers`. An invalid\n\t *                              ID combination typically yields an\n\t *                              empty `players` array; the SDK does\n\t *                              not distinguish \"no scores yet\" from\n\t *                              \"invalid IDs\" — both manifest as an\n\t *                              empty list.\n\t *\n\t * @example\n\t * ```ts\n\t * const detail = await window._smartico.api.getTournamentInstanceInfo(tournamentInstanceId);\n\t * if (!detail.is_clan_based || !detail.clan_leaderboard) {\n\t *   console.log('[smartico] not a clan tournament — skip clan drill-down');\n\t *   return;\n\t * }\n\t *\n\t * // User clicked a clan row in the leaderboard.\n\t * const clickedClan = detail.clan_leaderboard[0];\n\t *\n\t * console.log('[smartico] opening clan drill-down — show modal skeleton while loading');\n\t * const result = await window._smartico.api.getClanTournamentPlayers(\n\t *   tournamentInstanceId,\n\t *   clickedClan.clan_id,\n\t * );\n\t *\n\t * if (result.players.length === 0) {\n\t *   console.log('[smartico] clan has no ranked players yet — render empty state (\"No leaders yet\")');\n\t * } else {\n\t *   console.log('[smartico] render clan member rows with .is-me highlight on the current user;',\n\t *     result.players.length, 'players ranked');\n\t *   const me = result.players.find(p => p.is_me);\n\t *   if (me) {\n\t *     console.log('[smartico] current user rank in this clan:', me.position, 'score:', me.scores);\n\t *   }\n\t * }\n\t * ```\n\t */\n\tpublic async getClanTournamentPlayers(tournamentInstanceId: number, clanId: number): Promise<TClanTournamentPlayers> {\n\t\treturn this.api.clanTournamentGetPlayers(this.userExtId, tournamentInstanceId, clanId);\n\t}\n\n\t/**\n\t * Registers the authenticated user in the specified tournament instance.\n\t * For tournaments with a buy-in cost, the user's balance is debited\n\t * synchronously before the response is returned; for free tournaments\n\t * the call is a simple membership add.\n\t *\n\t * A successful response (`err_code === 0`) means the registration row\n\t * exists server-side, the buy-in (if any) has been deducted, and the\n\t * SDK has already triggered a refresh of the tournament lobby cache.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate from {@link getTournamentsList} and gate the call\n\t * on `is_can_register === true`. This composite flag already encodes:\n\t * not already registered, slot available\n\t * (`registration_count < players_max_count`), tournament status is\n\t * REGISTER (or STARTED with late-registration enabled), and the\n\t * registration type is not AUTO. The SDK forwards the call\n\t * unconditionally — calling without satisfying these will return one\n\t * of the error codes below.\n\t *\n\t * For clan tournaments (`is_clan_based === true`), the user must\n\t * already belong to a clan before calling. If they don't, prompt them\n\t * to pick a clan first via `joinClan`, then call\n\t * `registerInTournament` after the clan-join resolves. See \"Error\n\t * codes\" `1010` below for the server-side safety net.\n\t *\n\t * **Error codes** (in `err_code`, typed as {@link TournamentRegistrationError})\n\t * - `0` — success; the registration is persisted, buy-in deducted,\n\t *   tournament lobby refresh fires.\n\t * - `1010` — `TOURNAMENT_USER_CANNOT_JOIN_WITHOUT_CLAN`: clan-based\n\t *   tournament and the user has no clan. Surface the clan-pick flow\n\t *   (e.g. open a clan-pick modal driven by `getClans` +\n\t *   `joinClan`), then retry registration.\n\t * - `30001` — `TOURNAMENT_INSTANCE_NOT_FOUND`: instance ID is invalid\n\t *   or the tournament was deleted. Refresh the lobby via\n\t *   `getTournamentsList()` and hide the entry from the UI.\n\t * - `30002` — `TOURNAMENT_REGISTRATION_NOT_ENOUGH_POINTS`: insufficient\n\t *   points balance for a points-cost tournament. Show an\n\t *   insufficient-balance UI naming the deficit.\n\t * - `30003` — `TOURNAMENT_INSTANCE_NOT_IN_STATE`: tournament is no\n\t *   longer in a registerable state (finished, cancelled, finalizing,\n\t *   or not yet published with late registration disabled). Refresh\n\t *   the lobby; the button should hide.\n\t * - `30004` — `TOURNAMENT_ALREADY_REGISTERED`: user is already\n\t *   registered. Treat as idempotent success — hide the Register button\n\t *   and refresh the lobby. Usually indicates a stale local state\n\t *   (e.g. registered from another tab).\n\t * - `30005` — `TOURNAMENT_USER_DONT_MATCH_CONDITIONS`: user fails the\n\t *   tournament's segment / entry conditions. Prefer\n\t *   `tournament.segment_dont_match_message` (operator-supplied) over\n\t *   `err_message` when both are available.\n\t * - `30006` — `TOURNAMENT_USER_NOT_REGISTERED`: anomalous on a fresh\n\t *   register call; usually indicates a server-side race. Treat as a\n\t *   generic transient error.\n\t * - `30007` — `TOURNAMENT_CANT_CHANGE_REGISTRATION_STATUS`: status\n\t *   transition not allowed (e.g. re-registering after a finished /\n\t *   cancelled tournament). Show a generic error; do not retry.\n\t * - `30008` — `TOURNAMENT_MAX_REGISTRATIONS_REACHED`: the tournament\n\t *   filled up between the lobby fetch and the registration click.\n\t *   Refresh the lobby — the button will hide on the refreshed item.\n\t * - `300010` — insufficient **gems** balance (gems-cost tournament).\n\t *   Same UI handling as `30002` but for the gems currency.\n\t * - `300011` — insufficient **diamonds** balance (diamonds-cost\n\t *   tournament). Same as `300010` but for diamonds. \n\t * - other non-zero — generic server error. Surface `err_message` if any.\n\t *\n\t * Note: clan-tournament registration can occasionally surface error\n\t * codes from the clan-join domain (e.g. `1011` — joined-after-start)\n\t * via the same response path. These are members of `JoinClanErrorCode`,\n\t * not `TournamentRegistrationError`. Branch on the numeric value.\n\t *\n\t * **Idempotency**: NOT idempotent. A second call on the same instance\n\t * returns `30004` once the first call has succeeded. The SDK does NOT\n\t * enforce an in-flight lock. The consumer MUST guard the call site\n\t * against double-clicks (set a local \"registering\" flag on click, clear\n\t * it on response).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the tournament lobby cache on every\n\t * response (success OR error) and fires any `onUpdate` callback\n\t * registered via `getTournamentsList({ onUpdate })`. After\n\t * `err_code === 0`, the affected item's `is_user_registered` /\n\t * `registration_status` / `registration_count` reflect the new\n\t * registered state on the refreshed array. Note that\n\t * {@link getTournamentInstanceInfo} is NOT auto-refreshed — if the\n\t * detail screen is open, call it again manually.\n\t *\n\t * The user's balance (points / gems / diamonds) is exposed on the\n\t * user-properties channel and updates independently of this call's\n\t * response — subscribe to user-property updates separately if your UI\n\t * shows the balance.\n\t *\n\t * **Side effects** (consumer-observable on success)\n\t * - Balance debited synchronously by the buy-in amount in the\n\t *   tournament's currency (`registration_cost_points`,\n\t *   `registration_cost_gems`, or `registration_cost_diamonds`). For\n\t *   free tournaments no deduction occurs.\n\t * - Server-side analytics events fire downstream\n\t *   (`tournament_user_registered` for immediate-registration types;\n\t *   `tournament_user_registration_pending` or\n\t *   `tournament_registered_pending_qualification` for\n\t *   manual-approval / qualification-based types).\n\t * - Any operator-configured on-join prizes are distributed (e.g.\n\t *   welcome bonus). These surface via the relevant follow-up channels\n\t *   (e.g. {@link getBonuses}).\n\t *\n\t * **UI guidance**: see [UI Guide — `registerInTournament`](../../docs/ui/tournaments/UIGuide_registerInTournament.md).\n\t *\n\t * **Visitor mode**: not supported. Calling from a visitor session\n\t * returns a generic error, not a typed `TournamentRegistrationError`.\n\t *\n\t * @param tournamentInstanceId  The `instance_id` from `TTournament`\n\t *                              (NOT the template `tournament_id`).\n\t * @returns `{ err_code, err_message }`; success when `err_code === 0`\n\t *          (or `30004` when treated as idempotent no-op).\n\t *\n\t * @example\n\t * ```ts\n\t * const tournaments = await window._smartico.api.getTournamentsList({\n\t *   onUpdate: (refreshed) => console.log('[smartico] tournament list updated — re-render lobby from this array', refreshed),\n\t * });\n\t * const tournament = tournaments.find(t => t.instance_id === instanceId);\n\t *\n\t * if (!tournament) {\n\t *   console.log('[smartico] tournament not in current lobby — refresh getTournamentsList and retry');\n\t *   return;\n\t * }\n\t * if (!tournament.is_can_register) {\n\t *   console.log('[smartico] tournament not currently registerable — keep CTA disabled');\n\t *   return;\n\t * }\n\t *\n\t * // Clan tournament + user has no clan → resolve clan first.\n\t * if (tournament.is_clan_based) {\n\t *   const userProfile = window._smartico.api.getUserProfile();\n\t *   const userClanId = userProfile?.clan_id;\n\t *   if (userClanId == null) {\n\t *     console.log('[smartico] clan tournament — open the clan-pick modal first; after joinClan resolves, call registerInTournament again');\n\t *     return;\n\t *   }\n\t * }\n\t *\n\t * console.log('[smartico] registration starting — set in-flight flag, show loading dots on the Join button, keep modal open');\n\t * const r = await window._smartico.api.registerInTournament(tournament.instance_id);\n\t * console.log('[smartico] registration response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0 || r.err_code === 30004) {\n\t *   console.log('[smartico] registered (or was already) — close any modal, show a success toast; getTournamentsList onUpdate above will fire with the refreshed array');\n\t * } else if (r.err_code === 1010) {\n\t *   console.log('[smartico] clan required — open the clan-pick modal again (this is the server-side safety net for a clan-leave race)');\n\t * } else if (r.err_code === 30002) {\n\t *   console.error('[smartico] insufficient points — show insufficient-balance UI; deficit:', tournament.registration_cost_points);\n\t * } else if (r.err_code === 300010) {\n\t *   console.error('[smartico] insufficient gems — show insufficient-balance UI; deficit:', tournament.registration_cost_gems);\n\t * } else if (r.err_code === 300011) {\n\t *   console.error('[smartico] insufficient diamonds — show insufficient-balance UI; deficit:', tournament.registration_cost_diamonds);\n\t * } else if (r.err_code === 30005) {\n\t *   console.error('[smartico] segment mismatch — prefer the operator-supplied message:', tournament.segment_dont_match_message || r.err_message);\n\t * } else if (r.err_code === 30008) {\n\t *   console.error('[smartico] tournament full — auto-refresh will hide the button on the refreshed lobby item');\n\t * } else {\n\t *   console.error('[smartico] registration failed — show a generic error toast with this message:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async registerInTournament(tournamentInstanceId: number): Promise<TTournamentRegistrationResult> {\n\t\tconst r = await this.api.registerInTournament(this.userExtId, tournamentInstanceId);\n\n\t\tconst o: TTournamentRegistrationResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\tprotected async updateTournaments() {\n\t\tconst payload = await this.api.tournamentsGetLobbyT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.TournamentList, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTClans,\n\tTClanInfo,\n\tTClanJoinResult,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPITournaments } from './WSAPITournaments';\n\n/** @group Clans */\nexport class WSAPIClans extends WSAPITournaments {\n\t/**\n\t * Returns the active clans visible to the current user along with the\n\t * user's own membership state (`user_clan_id`, `cooldown_until`,\n\t * `join_date`). Use this to power a clan-picker / clan-browser screen.\n\t *\n\t * The returned `clans[]` is server-sorted by `rating_position` ASC\n\t * (1 = highest-ranked). The server has already filtered out archived\n\t * clans, clans the user fails segment conditions for, and (when any\n\t * clan has a non-zero score) clans with a zero rating score.\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed `TClans` payload (never a\n\t * diff/patch). Each subsequent call to `getClans({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — note that, unlike most other subscription\n\t * methods in the SDK, this callback is **poll-driven only**. There\n\t * is NO server push that refreshes the clans list. The callback\n\t * fires when:\n\t *\n\t * 1. The 30-second cache TTL expires and a subsequent `getClans()`\n\t *    call (from the consumer) triggers a fresh fetch.\n\t *\n\t * Consequence: clan-membership changes (other users joining your\n\t * clan, an operator-driven kick, a clan being archived) surface\n\t * only on the next consumer-driven fetch. If your UI needs\n\t * near-live state, poll `getClans()` on an interval; or re-call\n\t * after a {@link joinClan} resolves to pick up the new\n\t * `user_clan_id` immediately.\n\t *\n\t * **Reading state from the returned payload**\n\t * Drive list rendering from `clans[]` (already sorted). Identify\n\t * the user's own clan via `clan.clan_id === user_clan_id`\n\t * (`null` for clanless users). Detect an active switch-cooldown\n\t * with `cooldown_until !== null` — when set, the user cannot join\n\t * any clan until the cooldown expires, even clans they could\n\t * normally join. The cooldown is **user-level**, not per-clan.\n\t *\n\t * `cooldown_until` is an ISO 8601 UTC datetime string with no\n\t * timezone suffix (`\"YYYY-MM-DDTHH:MM:SS\"`). Parse as UTC:\n\t * `new Date(cooldown_until + 'Z')` or `moment.utc(cooldown_until)`.\n\t * Display in the user's local time. The default cooldown period\n\t * is configured per label by the operator (typically 7 days).\n\t *\n\t * `rating_position` is a global rank computed server-side across\n\t * all active clans in the label (1 = highest-rated). Because some\n\t * clans may be hidden by per-user segment visibility, positions\n\t * the user sees may skip (e.g. 1, 3, 7) — don't assume the array\n\t * spans a contiguous range.\n\t *\n\t * The `entry_fee_currency_type_id` enum on each clan uses values\n\t * `0` = points, `1` = gems, `2` = diamonds, `3` = free. Compare\n\t * `entry_fee_amount` against the user's matching balance (from\n\t * {@link getUserProfile}) to drive Join button affordability.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout.\n\t *\n\t * **Idempotency**: safe. Read-only. Repeated calls within the\n\t * cache window return a deep-cloned cached payload without a\n\t * network round-trip.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getClans`](../../docs/ui/clans/UIGuide_getClans.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params              Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate     Callback invoked with the full refreshed\n\t *                            `TClans` payload whenever the 30 s cache\n\t *                            expires and a subsequent fetch lands.\n\t *                            Each call to `getClans` overwrites the\n\t *                            prior callback.\n\t * @returns                   Promise resolving to `TClans`. Empty\n\t *                            `clans` array if no clans are visible.\n\t *\n\t * @example\n\t * ```ts\n\t * const result = await window._smartico.api.getClans({\n\t *   onUpdate: (refreshed) => {\n\t *     console.log('[smartico] clans payload refreshed (poll-driven; ~30 s cadence) — re-render the clan list from this payload:', refreshed);\n\t *   },\n\t * });\n\t *\n\t * console.log('[smartico] user is', result.user_clan_id == null ? 'clanless' : 'in clan ' + result.user_clan_id);\n\t *\n\t * // Cooldown handling — affects ALL clans, not a specific one.\n\t * if (result.cooldown_until) {\n\t *   const cooldownEndsUtc = new Date(result.cooldown_until + 'Z');\n\t *   console.log('[smartico] switch-cooldown active — disable all Join buttons until', cooldownEndsUtc.toLocaleString(),\n\t *     '(local). Render the cooldown end on the disabled button label.');\n\t * }\n\t *\n\t * // Render clans — already sorted by rating_position ASC.\n\t * for (const clan of result.clans) {\n\t *   const isMine = clan.clan_id === result.user_clan_id;\n\t *   const isFull = clan.member_count >= clan.capacity_limit;\n\t *\n\t *   if (isMine) {\n\t *     console.log('[smartico] highlight clan', clan.clan_id, 'as \"Your clan\"; CTA label \"Your clan\", no-op');\n\t *   } else if (result.cooldown_until) {\n\t *     console.log('[smartico] clan', clan.clan_id, '— Join blocked by user cooldown; show disabled button with cooldown end date');\n\t *   } else if (isFull) {\n\t *     console.log('[smartico] clan', clan.clan_id, '— Clan full; show disabled \"Clan is full\" button');\n\t *   } else {\n\t *     const label = clan.entry_fee_amount === 0 || clan.entry_fee_currency_type_id === 3\n\t *       ? 'Join free'\n\t *       : `Join (${clan.entry_fee_amount} ${['Points','Gems','Diamonds'][clan.entry_fee_currency_type_id]})`;\n\t *     console.log('[smartico] clan', clan.clan_id, '— render enabled Join button labelled', label);\n\t *   }\n\t * }\n\t *\n\t * // After a successful joinClan(), re-call getClans manually — no push refresh.\n\t * // const r = await window._smartico.api.joinClan(targetClanId);\n\t * // if (r.errCode === 0) await window._smartico.api.getClans();\n\t * ```\n\t */\n\tpublic async getClans({ onUpdate }: { onUpdate?: (data: TClans) => void } = {}): Promise<TClans> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Clans, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.Clans,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.clansGetListT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the full detail of a single clan — adds the ranked\n\t * `members[]` roster and a fresh `cooldown_until` on top of the same\n\t * fields exposed on a `TClan` list entry. Use this to power a clan\n\t * detail screen / popup after the user picks an item from\n\t * {@link getClans}.\n\t *\n\t * Each call is a fresh server round-trip — there is no client cache\n\t * and no push event refreshes detail state. Re-call to refresh.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass a valid `clanId` (typically read from\n\t * `TClans.clans[i].clan_id` returned by {@link getClans}). The\n\t * method works standalone — `getClans()` is not required first —\n\t * but is the only stable source of valid IDs.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** One-shot promise.\n\t * - **No client cache.** Every call sends a network request.\n\t * - **No push event** refreshes the detail. Member-join, kick, or\n\t *   contribution-score changes require a fresh `getClanInfo` call.\n\t *\n\t * **Returned shape — beyond `TClan`**\n\t * `TClanInfo` adds two things on top of the same identity / capacity\n\t * / fee / rating fields you'd see on a `TClan` list entry:\n\t * 1. A ranked `members[]` array — each entry carries `user_id`,\n\t *    `public_username`, `avatar_id` / `avatar_real_id`, the resolved\n\t *    `avatar_url`, the member's `position` (rank within this clan),\n\t *    `contribution_score`, the `is_me` flag identifying the current\n\t *    user's row, and the optional `clean_ext_user_id`. The server\n\t *    orders members by score DESC (i.e. `position` ASC); no\n\t *    client-side re-sort is required.\n\t * 2. A fresh `cooldown_until` on the clan info itself. This is the\n\t *    SAME user-level cooldown as `TClans.cooldown_until` (the\n\t *    cooldown is global to the user, not per clan) — but `getClans`\n\t *    returns a value cached for up to 30 s while `getClanInfo`\n\t *    always returns the current value. If the list-cached cooldown\n\t *    has just expired, this detail call will reflect it first.\n\t *\n\t * **Username display**: in the default Smartico UI, member rows use\n\t * `public_username`. Some surfaces (e.g. the tournament clan\n\t * drill-down) prefer `clean_ext_user_id` as the primary display\n\t * with `public_username` as fallback — pick the convention that\n\t * matches your product's identity model.\n\t *\n\t * **Idempotency**: safe. Read-only.\n\t *\n\t * **Side effects**: none — pure metadata read.\n\t *\n\t * **UI guidance**: see [UI Guide — `getClanInfo`](../../docs/ui/clans/UIGuide_getClanInfo.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param clanId  The clan ID from `TClans.clans[i].clan_id`.\n\t * @returns       Promise resolving to `TClanInfo`. Rejects if the\n\t *                clan ID is invalid or the user lacks visibility\n\t *                for it.\n\t *\n\t * @example\n\t * ```ts\n\t * const result = await window._smartico.api.getClans();\n\t * const clan = result.clans[0];\n\t *\n\t * console.log('[smartico] loading detail for clan', clan.clan_id);\n\t * const detail = await window._smartico.api.getClanInfo(clan.clan_id);\n\t *\n\t * console.log('[smartico] render detail with', detail.members.length, 'members');\n\t *\n\t * // Find current user's row to power a sticky \"me\" footer.\n\t * const meRow = detail.members.find(m => m.is_me);\n\t * if (meRow) {\n\t *   console.log('[smartico] current user rank in this clan:', meRow.position,\n\t *     'contribution:', meRow.contribution_score, '— render sticky my-member footer');\n\t * }\n\t *\n\t * // Resolve Join CTA state using the detail's cooldown (always fresh).\n\t * const isMyClan = detail.clan_id === result.user_clan_id;\n\t * const inCooldown = detail.cooldown_until != null;\n\t * const isFull = detail.member_count >= detail.capacity_limit;\n\t * if (isMyClan) {\n\t *   console.log('[smartico] this is the user\\'s clan — render disabled \"Your clan\" button');\n\t * } else if (inCooldown) {\n\t *   const ends = new Date(detail.cooldown_until + 'Z');\n\t *   console.log('[smartico] user is in clan-switch cooldown until', ends.toLocaleString(),\n\t *     '— render disabled cooldown button');\n\t * } else if (isFull) {\n\t *   console.log('[smartico] clan is full — render disabled \"Clan is full\" button');\n\t * } else {\n\t *   console.log('[smartico] joinable — render enabled Join button');\n\t * }\n\t * ```\n\t */\n\tpublic async getClanInfo(clanId: number): Promise<TClanInfo> {\n\t\treturn this.api.clansGetInfoT(this.userExtId, clanId);\n\t}\n\n\t/**\n\t * Joins (or switches into) a clan on behalf of the current user. For\n\t * paid clans (`entry_fee_amount > 0`), the user's balance for the\n\t * matching currency is debited synchronously before the response\n\t * returns. If the user is already in a clan, this is treated as an\n\t * atomic clan-switch (deactivate old membership + insert new + debit\n\t * fee, all in one transaction — the user is never observably\n\t * clanless).\n\t *\n\t * A successful response (`errCode === 0`) means: membership is\n\t * persisted, the fee (if any) has been debited, the user's\n\t * switch-cooldown has restarted, and a clan-joined CRM event has\n\t * fired server-side.\n\t *\n\t * @remarks\n\t * **Result shape note**: `TClanJoinResult` uses `errCode` / `errMsg`\n\t * (camelCase) — different from most other SDK result types in this\n\t * library which use `err_code` / `err_message` (snake_case). Branch\n\t * on the camelCase keys when reading this method's result.\n\t *\n\t * **Preconditions**\n\t * Read the candidate from {@link getClans} and gate the call on\n\t * `clan.member_count < clan.capacity_limit`, `cooldown_until == null`\n\t * (on the `TClans` payload — the cooldown is user-level, not\n\t * per-clan), and the user's balance for `entry_fee_currency_type_id`\n\t * being at least `entry_fee_amount` (free clans bypass this check).\n\t * The SDK forwards the call unconditionally — calling without\n\t * satisfying these will most likely return one of the error codes\n\t * below.\n\t *\n\t * **Error codes** (in `errCode`, typed as {@link JoinClanErrorCode})\n\t * - `0` (`JOIN_CLAN_OK`) — success; membership persisted, fee\n\t *   debited, cooldown restarted.\n\t * - `1000` (`JOIN_CLAN_INVALID_PARAMETERS`) — request body missing\n\t *   `clan_id`. Should not occur via the SDK; treat as a programming\n\t *   error.\n\t * - `1001` (`JOIN_CLAN_NOT_FOUND`) — clan doesn't exist for this\n\t *   label, OR the clan is archived / in draft state. The server\n\t *   merges \"missing\" and \"archived\" into this single code. Refresh\n\t *   `getClans()` and remove the entry from the UI.\n\t * - `1002` (`JOIN_CLAN_FULL`) — capacity reached between the list\n\t *   fetch and the join click (`member_count >= capacity_limit` at\n\t *   the server's atomic check). Refresh the list — the button will\n\t *   become \"Clan is full\".\n\t * - `1003` (`JOIN_CLAN_INSUFFICIENT_FUNDS`) — insufficient balance\n\t *   for the clan's entry fee. A single code covers all three\n\t *   currencies (points / gems / diamonds); read\n\t *   `clan.entry_fee_currency_type_id` to identify which currency\n\t *   the user is short on. Show an insufficient-balance UI naming\n\t *   the deficit.\n\t * - `1004` (`JOIN_CLAN_SEGMENT_MISMATCH`) — user does not meet the\n\t *   clan's entry segment or numeric conditions. There is no\n\t *   client-side pre-guard for this — surface a gating message.\n\t * - `1005` (`JOIN_CLAN_USER_IS_NOT_IN_CLAN`) — this method NEVER\n\t *   returns `1005`. The code is shared with the tournament\n\t *   registration error space and fires only on\n\t *   {@link registerInTournament} responses when a clan-based\n\t *   tournament requires the user to be in a clan first.\n\t * - `1006` (`JOIN_CLAN_COOLDOWN_ACTIVE`) — user is inside the\n\t *   switch-cooldown window from a previous clan join (default\n\t *   7 days, configurable per label). Only reachable when the user is\n\t *   already in a *different* clan (this call is then a clan switch);\n\t *   a first-time join never returns `1006`. Surface the\n\t *   `TClans.cooldown_until` expiry in the disabled CTA.\n\t * - `1011` (`JOIN_CLAN_JOINED_AFTER_TOURNAMENT_START`) — this\n\t *   method does NOT return `1011` directly. The code fires on\n\t *   {@link registerInTournament} responses when the user joined\n\t *   their current clan after the tournament started AND already\n\t *   has tournament scores.\n\t * - other non-zero — generic server error. Surface `errMsg` if any.\n\t *\n\t * **Idempotency**: NOT safe — and notably dangerous. Calling\n\t * `joinClan` with the user's CURRENT `clanId` does NOT short-circuit\n\t * server-side; the call is treated as a clan-switch to the same\n\t * clan. If the label's cooldown is non-zero (the default), the\n\t * second call returns `1006`. If the cooldown is configured to\n\t * zero, the second call will deduct the entry fee AGAIN, deactivate\n\t * the membership, and re-insert it. The SDK does NOT enforce an\n\t * in-flight lock. Consumers MUST guard the call site against\n\t * double-clicks (set a local \"joining\" flag on click, clear it on\n\t * response) AND short-circuit when the user is already in the\n\t * target clan.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK does NOT automatically refresh the {@link getClans} cache\n\t * after a join. Manually re-call `getClans()` on success to pick up\n\t * the new `user_clan_id`, refreshed `member_count`, and the new\n\t * `cooldown_until` value. Until you do, the cached `TClans` payload\n\t * is stale.\n\t *\n\t * **Side effects** (consumer-observable on success)\n\t * - Entry-fee currency balance decreases by `entry_fee_amount`\n\t *   (visible on the next {@link getUserProfile} refresh / via the\n\t *   user-properties update channel).\n\t * - The user's clan membership row is created (or replaced, on a\n\t *   switch). `member_count` on the new clan increments by 1; on a\n\t *   switch, the old clan's `member_count` decrements by 1 in the\n\t *   same transaction.\n\t * - The user's switch-cooldown restarts at the join time (the\n\t *   `TClans.cooldown_until` field on the next list fetch reflects\n\t *   the new expiry).\n\t * - Server-side CRM analytics fire (clan-joined event, currency-\n\t *   deducted event for paid clans). These surface only as\n\t *   server-side traces; the SDK consumer observes them indirectly\n\t *   via balance / membership refresh.\n\t *\n\t * **UI guidance**: see [UI Guide — `joinClan`](../../docs/ui/clans/UIGuide_joinClan.md).\n\t *\n\t * **Visitor mode**: not supported. The server rejects the request\n\t * for unauthenticated sessions.\n\t *\n\t * @param clanId  The clan ID from `TClans.clans[i].clan_id` (or\n\t *                `TClanInfo.clan_id`).\n\t * @returns `{ errCode, errMsg }`; success when `errCode === 0`.\n\t *          Note camelCase keys (see \"Result shape note\" above).\n\t *\n\t * @example\n\t * ```ts\n\t * const result = await window._smartico.api.getClans();\n\t * const target = result.clans.find(c => c.clan_id === clanId);\n\t *\n\t * if (!target) {\n\t *   console.log('[smartico] clan not in current list — refresh getClans and retry');\n\t *   return;\n\t * }\n\t * if (target.clan_id === result.user_clan_id) {\n\t *   console.log('[smartico] user is already in this clan — short-circuit; do NOT call joinClan again, the server will treat it as a switch and may re-deduct the fee');\n\t *   return;\n\t * }\n\t * if (result.cooldown_until) {\n\t *   console.log('[smartico] user is in cooldown — disable Join until', new Date(result.cooldown_until + 'Z').toLocaleString());\n\t *   return;\n\t * }\n\t * if (target.member_count >= target.capacity_limit) {\n\t *   console.log('[smartico] clan is full — disable Join');\n\t *   return;\n\t * }\n\t *\n\t * console.log('[smartico] join starting — set in-flight flag, show loading dots on Join button, keep modal open');\n\t * const r = await window._smartico.api.joinClan(target.clan_id);\n\t * console.log('[smartico] join response received — clear in-flight flag');\n\t *\n\t * if (r.errCode === 0) {\n\t *   console.log('[smartico] joined successfully — refresh getClans to pick up the new user_clan_id, member_count, and cooldown_until');\n\t *   await window._smartico.api.getClans();\n\t * } else if (r.errCode === 1002) {\n\t *   console.error('[smartico] clan is full — refresh list, hide the Join CTA on the now-full clan');\n\t * } else if (r.errCode === 1003) {\n\t *   const currencyLabel = ['points', 'gems', 'diamonds'][target.entry_fee_currency_type_id] ?? 'currency';\n\t *   console.error('[smartico] insufficient', currencyLabel, '— need', target.entry_fee_amount);\n\t * } else if (r.errCode === 1004) {\n\t *   console.error('[smartico] user does not meet segment / entry conditions — show a gating message');\n\t * } else if (r.errCode === 1006) {\n\t *   console.error('[smartico] cooldown active — surface the cooldown_until from getClans:', result.cooldown_until);\n\t * } else if (r.errCode === 1001) {\n\t *   console.error('[smartico] clan not found or archived — refresh list and remove from UI');\n\t * } else {\n\t *   console.error('[smartico] join failed — show a generic error toast with this message:', r.errMsg);\n\t * }\n\t * ```\n\t */\n\tpublic async joinClan(clanId: number): Promise<TClanJoinResult> {\n\t\treturn this.api.clanJoin(this.userExtId, clanId);\n\t}\n\n\tprotected async updateClans() {\n\t\tconst payload = await this.api.clansGetListT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Clans, payload);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tJackpotDetails,\n\tJackpotPot,\n\tJackpotWinnerHistory,\n\tJackpotsOptinResponse,\n\tJackpotsOptoutResponse,\n} from '../Jackpots';\nimport { IntUtils } from '../IntUtils';\nimport { TGetJackpotEligibleGamesResponse } from '../Jackpots/GetJackpotEligibleGamesResponse';\nimport {\n\tJACKPOT_TEMPLATE_CACHE_SEC,\n\tJACKPOT_POT_CACHE_SEC,\n\tJACKPOT_WINNERS_CACHE_SEC,\n\tJACKPOT_ELIGIBLE_GAMES_CACHE_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIClans } from './WSAPIClans';\n\n/** @group Jackpots */\nexport class WSAPIJackpots extends WSAPIClans {\n\n\t/** @hidden */\n\tprotected jackpotGetSignature: string = '';\n\tprotected async jackpotClearCache() {\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Jackpots);\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.Pots);\n\t\t// Winners + eligible-games are cached per jp_template_id (composite keys),\n\t\t// so a bare clear misses every variant — clear by prefix.\n\t\tOCache.clearByPrefix(ECacheContext.WSAPI, onUpdateContextKey.JackpotWinners);\n\t\tOCache.clearByPrefix(ECacheContext.WSAPI, onUpdateContextKey.JackpotEligibleGames);\n\t}\n\n\t/**\n\t * Returns the user-eligible jackpots active for the label, fused with their live\n\t * pot values. Each entry carries the static template (name, description, opt-in\n\t * state, eligible games, currency) plus a freshly-fetched `pot` snapshot.\n\t *\n\t * Designed to be polled at high frequency (every 1 second is fine) — the SDK\n\t * splits the response into a 30-second template cache and a 1-second pot-value\n\t * cache so consumers can render a live-counting pot amount without hammering\n\t * the server for the static template data.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - No prerequisite calls.\n\t * - Visitor mode supported via `_smartico.vapi(lang).jackpotGet(...)`.\n\t *\n\t * **Server-side eligibility filtering**\n\t * Jackpots are filtered server-side by the user's segments before being\n\t * returned. Templates the user is ineligible for never appear in this\n\t * response — there is no \"locked\" state to render. An empty result for a\n\t * known-good user typically means none of the configured templates match\n\t * the user's segments / level / brand.\n\t *\n\t * **Filter behavior**\n\t * Passing `related_game_id` returns only jackpots linked to that game (from\n\t * the operator's games catalog). Passing `jp_template_id` returns just that\n\t * single template. With no filter, all active templates the user is\n\t * eligible for are returned. Changing the filter between calls flushes both\n\t * the template cache and the pot cache.\n\t *\n\t * **Two-tier cache**\n\t * - Template definitions: 30 s cache. Re-fetched on filter change or when\n\t *   opt-in / opt-out / a jackpot-win push lands.\n\t * - Pot values: 1 s cache. Re-fetched on every call past the 1-second\n\t *   window so a 1 Hz poll renders a smoothly counting pot.\n\t *\n\t * **`jp_public_meta.custom_data`**\n\t * Server returns this as a JSON-encoded string; the SDK parses it inline so\n\t * consumers always receive either a parsed object or the raw string.\n\t *\n\t * **Personal vs MultiUser jackpots** (see {@link JackpotType})\n\t * - `MultiUser` (1) — shared pot; `registration_count` reflects real opted-in\n\t *   user count; temperature transitions fire push events.\n\t * - `Personal` (2) — independent per-user pot; `registration_count` is\n\t *   always 1; temperature push events are suppressed.\n\t *\n\t * **Refresh**\n\t * - `jp_status_id`, segment changes, and operator template edits surface\n\t *   after the 30 s template cache TTL.\n\t * - Opt-in / opt-out / jackpot-win push events all clear the template and\n\t *   pot caches — the next call re-fetches.\n\t *\n\t * **Visitor mode**: supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `jackpotGet`](../../docs/ui/jackpots/UIGuide_jackpotGet.md).\n\t *\n\t * @param filter                     Optional filter narrowing the result set.\n\t * @param filter.related_game_id     Limit to jackpots linked to this game ID\n\t *                                    (from the operator's games catalog).\n\t * @param filter.jp_template_id      Limit to a single template.\n\t * @returns Array of {@link JackpotDetails} — empty if the user is eligible\n\t * for no active jackpots.\n\t *\n\t * @example\n\t * ```ts\n\t * // Poll every second for live pot counter\n\t * setInterval(async () => {\n\t *     const jackpots = await window._smartico.api.jackpotGet();\n\t *     for (const jp of jackpots) {\n\t *         console.log('[smartico] update pot widget for', jp.jp_public_meta.name, '— amount:', jp.pot.current_pot_amount_user_currency, jp.user_currency, '— temperature:', jp.pot.current_pot_temperature);\n\t *     }\n\t * }, 1000);\n\t *\n\t * // Filtered fetch for a specific game tile\n\t * const linked = await window._smartico.api.jackpotGet({ related_game_id: 'gold-slot2' });\n\t * console.log('[smartico] linked jackpots for game:', linked.length);\n\t * ```\n\t */\n\tpublic async jackpotGet(filter?: { related_game_id?: string; jp_template_id?: number }): Promise<JackpotDetails[]> {\n\t\tconst signature: string = `${filter?.jp_template_id}:${filter?.related_game_id}`;\n\n\t\tif (signature !== this.jackpotGetSignature) {\n\t\t\tthis.jackpotGetSignature = signature;\n\t\t\tthis.jackpotClearCache();\n\t\t}\n\n\t\tlet jackpots: JackpotDetails[] = [];\n\t\tlet pots: JackpotPot[] = [];\n\n\t\tjackpots = await OCache.use<JackpotDetails[]>(\n\t\t\tonUpdateContextKey.Jackpots,\n\t\t\tECacheContext.WSAPI,\n\t\t\tasync () => {\n\t\t\t\tconst _jackpots = await this.api.jackpotGet(this.userExtId, filter);\n\t\t\t\tif (!_jackpots?.items) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\t\t\t\tconst _pots = _jackpots.items.map((jp) => jp.pot);\n\n\t\t\t\t_jackpots.items.forEach((jp) => {\n\t\t\t\t\tjp.jp_public_meta.custom_data = IntUtils.JsonOrText(jp.jp_public_meta.custom_data);\n\t\t\t\t});\n\n\t\t\t\tOCache.set(onUpdateContextKey.Pots, _pots, ECacheContext.WSAPI, JACKPOT_POT_CACHE_SEC);\n\t\t\t\treturn _jackpots.items;\n\t\t\t},\n\t\t\tJACKPOT_TEMPLATE_CACHE_SEC,\n\t\t);\n\n\t\tif (jackpots.length > 0) {\n\t\t\tpots = await OCache.use<JackpotPot[]>(\n\t\t\t\tonUpdateContextKey.Pots,\n\t\t\t\tECacheContext.WSAPI,\n\t\t\t\tasync () => {\n\t\t\t\t\tconst jp_template_ids = jackpots.map((jp) => jp.jp_template_id);\n\t\t\t\t\treturn (await this.api.potGet(this.userExtId, { jp_template_ids })).items;\n\t\t\t\t},\n\t\t\t\tJACKPOT_POT_CACHE_SEC,\n\t\t\t);\n\t\t}\n\n\t\treturn jackpots.map((jp) => {\n\t\t\tlet _jp: JackpotDetails = {\n\t\t\t\t...jp,\n\t\t\t\tpot: pots.find((p) => p.jp_template_id === jp.jp_template_id),\n\t\t\t};\n\t\t\treturn _jp;\n\t\t});\n\t}\n\n\t/**\n\t * Opts the authenticated user into a jackpot. From this point on, the user\n\t * contributes to the pot (per the template's `contribution_type` and\n\t * `contribution_value`) and is eligible to win when the pot explodes.\n\t *\n\t * On success the SDK clears the jackpot caches — the next\n\t * {@link jackpotGet} call returns the updated `is_opted_in: true` and an\n\t * incremented `registration_count`.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `jp_template_id` is mandatory — the SDK throws synchronously if missing.\n\t * - The jackpot must currently be active and the user must be in its\n\t *   eligibility segment. Ineligible jackpots are filtered out of\n\t *   {@link jackpotGet} entirely, so a card the user sees is opt-in-able.\n\t * - Skip the opt-in CTA when the template reports `is_auto_opt_in: true` —\n\t *   eligible users are enrolled automatically and there is nothing to join.\n\t *\n\t * **Error handling**\n\t * The server returns a non-zero `errCode` with a human-readable `errMsg`\n\t * for any failure. Common causes:\n\t * - User is in a control group.\n\t * - Jackpot template is not active (status changed since the user opened\n\t *   the card).\n\t * - User is already opted in (the SDK has no client-side guard against a\n\t *   double-tap; the server enforces).\n\t * - DB race / generic server error.\n\t *\n\t * The SDK does NOT enumerate distinct numeric codes for each cause — branch\n\t * on `errCode === 0` for success and surface `errMsg` as-is for failures.\n\t *\n\t * **Idempotency / re-opt-in semantics**\n\t * - **Already opted in** → returns non-zero `errCode` (\"User already opted in\").\n\t * - **Previously opted in then opted out** → succeeds silently; the server\n\t *   re-activates the registration. This is not an error path — a user can\n\t *   freely cycle opt-in / opt-out.\n\t *\n\t * **Refresh after success**\n\t * - The SDK clears the template, pot, and winners caches.\n\t * - The next {@link jackpotGet} call returns `is_opted_in: true` for this\n\t *   template.\n\t *\n\t * **Side effects**\n\t * Fires a `JACKPOT_OPT_IN` engagement event (visible to operator-side\n\t * automation rules). Does NOT immediately move points / gems — contributions\n\t * happen per-bet via the user's gameplay, not on opt-in.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `jackpotOptIn`](../../docs/ui/jackpots/UIGuide_jackpotOptIn.md).\n\t *\n\t * @param filter.jp_template_id  ID of the jackpot template to join.\n\t * @returns {@link JackpotsOptinResponse} — `errCode === 0` on success.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.jackpotOptIn({ jp_template_id: 42 });\n\t *\n\t * if (r.errCode === 0) {\n\t *     console.log('[smartico] opted in — refresh jackpot card to show opt-out CTA');\n\t * } else {\n\t *     console.error('[smartico] opt-in failed — show this message in an error toast:', r.errMsg);\n\t * }\n\t * ```\n\t */\n\tpublic async jackpotOptIn(filter: { jp_template_id: number }): Promise<JackpotsOptinResponse> {\n\t\tif (!filter.jp_template_id) {\n\t\t\tthrow new Error('jp_template_id is required in jackpotOptIn');\n\t\t}\n\n\t\tconst result = await this.api.jackpotOptIn(this.userExtId, filter);\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Opts the authenticated user out of a jackpot. From this point on the user\n\t * no longer contributes to the pot and is not eligible to win.\n\t *\n\t * The user can re-join later via {@link jackpotOptIn} — opt-out is not\n\t * permanent.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `jp_template_id` is mandatory — the SDK throws synchronously if missing.\n\t *\n\t * **Error handling**\n\t * The server returns a non-zero `errCode` with a human-readable `errMsg` for\n\t * any failure. Common causes:\n\t * - User has never opted in OR is already opted out — server returns\n\t *   non-zero `errCode` for the \"already opted out\" case. Calling opt-out\n\t *   on a jackpot the user has never registered for typically returns\n\t *   success (the server finds no registration row to update).\n\t * - DB race / generic server error.\n\t *\n\t * Unlike {@link jackpotOptIn}, opt-out does NOT check the template's status\n\t * — the user can opt out of a jackpot that has been deactivated by the\n\t * operator.\n\t *\n\t * **Idempotency**\n\t * - First opt-out → success.\n\t * - Second opt-out → non-zero `errCode` (\"Already opted out\").\n\t * - Opt-out of a never-joined jackpot → typically succeeds silently\n\t *   (no registration row to act on).\n\t *\n\t * **Refresh after success**\n\t * - The SDK clears the template, pot, and winners caches.\n\t * - The next {@link jackpotGet} call returns `is_opted_in: false` for this\n\t *   template and a decremented `registration_count`.\n\t *\n\t * **Side effects**\n\t * Fires a `JACKPOT_OPT_OUT` engagement event for operator-side automation\n\t * rules. The user's existing contributions to the current pot remain in\n\t * place — opt-out stops future contributions but does not refund past ones.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `jackpotOptOut`](../../docs/ui/jackpots/UIGuide_jackpotOptOut.md).\n\t *\n\t * @param filter.jp_template_id  ID of the jackpot template to leave.\n\t * @returns {@link JackpotsOptoutResponse} — `errCode === 0` on success.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.jackpotOptOut({ jp_template_id: 42 });\n\t *\n\t * if (r.errCode === 0) {\n\t *     console.log('[smartico] opted out — refresh jackpot card to show join CTA');\n\t * } else {\n\t *     console.error('[smartico] opt-out failed — show this message in an error toast:', r.errMsg);\n\t * }\n\t * ```\n\t */\n\tpublic async jackpotOptOut(filter: { jp_template_id: number }): Promise<JackpotsOptoutResponse> {\n\t\tif (!filter.jp_template_id) {\n\t\t\tthrow new Error('jp_template_id is required in jackpotOptOut');\n\t\t}\n\n\t\tconst result = await this.api.jackpotOptOut(this.userExtId, filter);\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Returns past winners of a specific jackpot template, paginated. Use to\n\t * power a \"Recent winners\" panel inside the jackpot detail modal.\n\t *\n\t * **Important**: respect the `expose_winners_over_api` flag on the jackpot's\n\t * {@link JackpotDetails} before calling this method. The server-side handler\n\t * does NOT enforce that flag — it is a UI-only gate. Custom UIs that ignore\n\t * the flag will display winners the operator intended to keep private.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `jp_template_id` is mandatory — the SDK throws synchronously if missing.\n\t * - The consumer SHOULD check\n\t *   {@link JackpotDetails.expose_winners_over_api} before calling, since\n\t *   the server does not enforce it.\n\t *\n\t * **Pagination**\n\t * Server default page size is 20. Pass `limit` and `offset` to paginate\n\t * (e.g. infinite-scroll). The wire response carries a `has_more` flag, but\n\t * this SDK method returns only the `winners` array — detect end-of-list by\n\t * a returned array shorter than `limit`.\n\t *\n\t * **Currency caveat**\n\t * Winner amounts in the response (`winner.winning_amount_jp_currency`) are\n\t * in the jackpot's NATIVE currency, NOT the user's wallet currency. If a\n\t * user-currency display is needed, the consumer must convert client-side.\n\t *\n\t * **Refresh**\n\t * - The SDK caches each page separately (per `jp_template_id` +\n\t *   `limit` + `offset`) for 30 seconds, so paging back and forth is\n\t *   served from cache and each page keeps its own fresh copy.\n\t * - Caches clear on jackpot-win push events and on opt-in / opt-out.\n\t *\n\t * **Error handling**\n\t * Non-zero `errCode` on control-group users or generic server errors. The\n\t * SDK does NOT enumerate distinct codes — branch on `errCode === 0` and\n\t * surface `errMsg` on failure.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getJackpotWinners`](../../docs/ui/jackpots/UIGuide_getJackpotWinners.md).\n\t *\n\t * @returns Array of {@link JackpotWinnerHistory} entries newest-first.\n\t *\n\t * @example\n\t * ```ts\n\t * const [jp] = await window._smartico.api.jackpotGet({ jp_template_id: 42 });\n\t *\n\t * if (!jp || !jp.expose_winners_over_api) {\n\t *     console.log('[smartico] winners hidden by operator config — hide the winners tab');\n\t *     return;\n\t * }\n\t *\n\t * const winners = await window._smartico.api.getJackpotWinners({\n\t *     jp_template_id: 42,\n\t *     limit:          20,\n\t *     offset:         0,\n\t * });\n\t * console.log('[smartico] render', winners.length, 'recent winner rows (amounts in', jp.jp_currency + ')');\n\t * ```\n\t */\n\tpublic async getJackpotWinners({\n\t\tlimit,\n\t\toffset,\n\t\tjp_template_id,\n\t}: {\n\t\t/** Page size (default 20). */\n\t\tlimit?: number;\n\t\t/** Pagination offset (default 0). */\n\t\toffset?: number;\n\t\t/** Jackpot template ID (required). */\n\t\tjp_template_id?: number;\n\t}): Promise<JackpotWinnerHistory[]> {\n\t\t// Cache per (jp_template_id, limit, offset) so paging or switching\n\t\t// jackpot within the TTL doesn't return a colliding winners list.\n\t\tconst cacheKey = `${onUpdateContextKey.JackpotWinners}${jp_template_id}:${limit}:${offset}`;\n\t\treturn OCache.use(\n\t\t\tcacheKey,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getJackpotWinnersT(this.userExtId, limit, offset, jp_template_id),\n\t\t\tJACKPOT_WINNERS_CACHE_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the casino games eligible to contribute to a specific jackpot —\n\t * the catalog the user must play to grow the pot. Use to power an\n\t * \"Eligible games\" carousel inside the jackpot detail modal.\n\t *\n\t * **Shortcut**: when the jackpot's\n\t * {@link JackpotDetails.ach_related_game_allow_all} flag is `true`, every\n\t * game in the operator catalog contributes — there's no point calling this\n\t * method (the result would be the full catalog). The default Smartico UI\n\t * hides the Eligible Games tab entirely in that case.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - No authentication required — works in both identified and visitor mode.\n\t * - `jp_template_id` is mandatory.\n\t *\n\t * **`onUpdate` caveat**\n\t * The `onUpdate` callback is accepted to match the SDK's subscription\n\t * contract but is NOT auto-invoked by any current server push. It will only\n\t * fire if a consumer (or a future SDK version) explicitly pushes an update.\n\t * Treat it as a no-op for now.\n\t *\n\t * **Refresh**\n\t * - The SDK caches per `jp_template_id` for 30 seconds.\n\t * - Cache does NOT clear on opt-in / opt-out / jackpot-win — eligible-game\n\t *   lists rarely change during a session. Wait for the 30 s TTL.\n\t *\n\t * **Error handling**\n\t * Non-zero `errCode` on control-group users or generic server errors.\n\t * Branch on `errCode === 0` and surface `errMsg` on failure.\n\t *\n\t * **Visitor mode**: supported via\n\t * `_smartico.vapi(lang).getJackpotEligibleGames(...)`. The eligible-games\n\t * list is template-level (which games contribute to the pot) and carries no\n\t * per-user fields, so a visitor session receives the same list an identified\n\t * user would. The `lang` passed to `_smartico.vapi(lang)` drives the\n\t * translation of game names.\n\t *\n\t * **UI guidance**: see [UI Guide — `getJackpotEligibleGames`](../../docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md).\n\t *\n\t * @returns {@link TGetJackpotEligibleGamesResponse} —\n\t * `{ eligible_games: JackpotEligibleGame[] }`.\n\t *\n\t * @example\n\t * ```ts\n\t * const [jp] = await window._smartico.api.jackpotGet({ jp_template_id: 42 });\n\t *\n\t * if (jp?.ach_related_game_allow_all) {\n\t *     console.log('[smartico] all games eligible — hide the eligible-games tab');\n\t *     return;\n\t * }\n\t *\n\t * const r = await window._smartico.api.getJackpotEligibleGames({ jp_template_id: 42 });\n\t * console.log('[smartico] render', r.eligible_games.length, 'eligible game tiles');\n\t *\n\t * // Visitor mode — same shape, language driven by the vapi(lang) argument\n\t * const visitor = await window._smartico.vapi('EN').getJackpotEligibleGames({ jp_template_id: 42 });\n\t * console.log('[smartico] visitor eligible games:', visitor.eligible_games.length);\n\t * ```\n\t */\n\tpublic async getJackpotEligibleGames({ jp_template_id, onUpdate } : {\n\t\t/** Jackpot template ID (required). */\n\t\tjp_template_id: number,\n\t\t/** Optional callback; not auto-invoked today. */\n\t\tonUpdate?: () => void,\n\t}): Promise<TGetJackpotEligibleGamesResponse> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.JackpotEligibleGames, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.JackpotEligibleGames + jp_template_id,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getJackpotEligibleGamesT(this.userExtId, { jp_template_id }),\n\t\t\tJACKPOT_ELIGIBLE_GAMES_CACHE_SEC,\n\t\t);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTRaffle,\n\tTRaffleDraw,\n\tTRaffleDrawRun,\n\tTransformedRaffleClaimPrizeResponse,\n\tTRaffleOptinResponse,\n} from './WSAPITypes';\nimport {\n\tdrawRunHistoryTransform,\n\traffleClaimPrizeResponseTransform,\n\tGetRaffleWonPrizesResponse,\n} from '../Raffle';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIJackpots } from './WSAPIJackpots';\n\n/** @group Raffles */\nexport class WSAPIRaffles extends WSAPIJackpots {\n\tprotected async updateRaffles() {\n\t\tconst payload = await this.api.getRafflesT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Raffles, payload);\n\t}\n\n\t/**\n\t * Returns all raffles visible to the current user, each carrying an\n\t * embedded `draws[]` array with per-draw state (current state, ticket\n\t * counts, opt-in status, prize structure). Use this to power a\n\t * raffles lobby screen and to drive per-draw CTAs (opt-in, view\n\t * winners, claim).\n\t *\n\t * The embedded `draws[i]` objects are sufficient for rendering all\n\t * draw cards — winner details with usernames / avatars require a\n\t * follow-up {@link getRaffleDrawRun} call (the embedded form carries\n\t * only `winners_total` / `winners_limit` / `winners_offset` metadata,\n\t * not individual winner rows).\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed raffle list (never a\n\t * diff/patch). Each subsequent call to `getRaffles({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t *\n\t * 1. {@link claimRafflePrize} resolves on this connection (any\n\t *    response code) — the refreshed list reflects the new\n\t *    `has_unclaimed_prize` / `claimed_date` state.\n\t * 2. {@link requestRaffleOptin} resolves on this connection (any\n\t *    response code) — the refreshed list reflects the new\n\t *    `user_opted_in` state on the affected draw.\n\t *\n\t * Does NOT fire for: server-side draw executions, ticket increments\n\t * (other users earning tickets), or operator-side raffle/draw config\n\t * changes. Those changes surface only on the next cache miss (after\n\t * the 30 s TTL) — poll manually if your UI needs sub-30s freshness\n\t * during an in-progress draw.\n\t *\n\t * **Reading state from the returned raffle**\n\t * - `current_tickets_count` vs `max_tickets_count` drives the\n\t *   `ticket_cap_visualization` banner (enum\n\t *   {@link RaffleTicketCapVisualization}: `Empty` = no banner,\n\t *   `Counter` = show \"X tickets remaining\", `Message` = show\n\t *   sold-out message).\n\t * - Within each draw, `current_state`\n\t *   ({@link RaffleDrawInstanceState}) buckets the draw into Open\n\t *   (accepting tickets), WinnerSelection (currently drawing), or\n\t *   Executed (winners selected).\n\t * - `execution_type` ({@link RaffleDrawTypeExecution}) distinguishes\n\t *   one-shot (`ExecDate`), repeating (`Recurring`), or special\n\t *   one-shot (`Grand`) draws. Recurring draws share a stable\n\t *   `draws[i].id` (the schedule definition) across runs — `run_id`\n\t *   is the per-execution instance.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout. The server also invalidates\n\t * the SDK cache when a draw executes on the server side.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffles`](../../docs/ui/raffles/UIGuide_getRaffles.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned, scoped\n\t * to the brand's public raffles. Per-user fields (`my_tickets_count`,\n\t * `my_last_tickets`, `user_opted_in`) are not meaningful for\n\t * visitors. The `onUpdate` callback is accepted but never fires\n\t * because the mutation methods that trigger it\n\t * ({@link claimRafflePrize}, {@link requestRaffleOptin}) are not\n\t * available / not effective in visitor mode.\n\t *\n\t * @param params              Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate     Callback invoked with the full refreshed\n\t *                            raffles list after every\n\t *                            {@link claimRafflePrize} or\n\t *                            {@link requestRaffleOptin} round-trip\n\t *                            on this connection.\n\t * @returns                   Promise resolving to the raffles list.\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles({\n\t *   onUpdate: (refreshed) => {\n\t *     console.log('[smartico] raffles refreshed (after claim/optin) — re-render from this array:', refreshed);\n\t *   },\n\t * });\n\t *\n\t * for (const raffle of raffles) {\n\t *   console.log('[smartico] render raffle', raffle.id, '—', raffle.name, ':', raffle.draws.length, 'draws');\n\t *\n\t *   // Bucket draws: active/upcoming first (sorted by execution_ts ASC), then executed last.\n\t *   const sorted = [...raffle.draws].sort((a, b) => {\n\t *     const aDone = a.current_state === 3;  // Executed\n\t *     const bDone = b.current_state === 3;\n\t *     if (aDone !== bDone) return aDone ? 1 : -1;  // executed sink to the bottom\n\t *     return a.execution_ts - b.execution_ts;\n\t *   });\n\t *\n\t *   for (const d of sorted) {\n\t *     if (d.requires_optin && !d.user_opted_in && d.is_active && d.current_state !== 3) {\n\t *       console.log('[smartico] draw', d.run_id, '— show OPT IN CTA (requires_optin + not yet opted in + still active)');\n\t *     }\n\t *     if (d.current_state === 3) {\n\t *       console.log('[smartico] draw', d.run_id, 'executed — fetch winner details via getRaffleDrawRun');\n\t *     }\n\t *   }\n\t * }\n\t *\n\t * // For winner detail on an executed draw, call getRaffleDrawRun separately.\n\t * ```\n\t */\n\tpublic async getRaffles({ onUpdate }: { onUpdate?: (data: TRaffle[]) => void } = {}): Promise<TRaffle[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Raffles, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(onUpdateContextKey.Raffles, ECacheContext.WSAPI, () => this.api.getRafflesT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns the full detail of a single raffle draw run — same shape\n\t * as the embedded `TRaffleDraw` in {@link getRaffles}, but populated\n\t * with paginated `prizes[].winners[]` rows including usernames and\n\t * avatars. Use this to render a draw detail / winners screen, or to\n\t * page through the winner list of an executed draw.\n\t *\n\t * Each call is a fresh server round-trip — there is no client cache.\n\t * Re-call to refresh.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Pass `raffle_id` (the parent raffle's `id`) and `run_id` (the\n\t * specific run instance — `TRaffleDraw.run_id` from\n\t * {@link getRaffles}'s embedded draws). Note that\n\t * `TRaffleDraw.id` is the *schedule_id* (stable across runs of a\n\t * recurring draw) — that's NOT what this method takes; it takes the\n\t * per-instance `run_id`.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** One-shot promise.\n\t * - **No client cache.** Every call sends a network request.\n\t * - **No push event** refreshes the response. Live winner-list\n\t *   updates require a fresh call.\n\t * - The default Smartico UI polls this method on a variable cadence\n\t *   while a draw is in flight: every 3 s during `WinnerSelection`,\n\t *   every 10 s when the countdown is under 5 minutes, every 30 s\n\t *   otherwise.\n\t *\n\t * **Winner pagination**\n\t * `winners_from` / `winners_to` define a half-open range of winner\n\t * indices. The default window is `0–20` (20 winners). The server\n\t * caps the window at 50 rows per call — passing a larger range\n\t * silently truncates. For \"load more\" pagination, advance\n\t * `winners_from` by the prior page size and pass the same\n\t * `winners_to` offset. `winners_total` on the returned\n\t * `TRaffleDraw` is the authoritative total count for pagination.\n\t *\n\t * The current user's own winning rows (if any) are server-sorted\n\t * to the top of the result.\n\t *\n\t * **Throws**\n\t * Both `raffle_id` and `run_id` are required — the SDK throws\n\t * synchronously when either is missing or falsy.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffleDrawRun`](../../docs/ui/raffles/UIGuide_getRaffleDrawRun.md).\n\t *\n\t * **Visitor mode**: supported.\n\t *\n\t * @param props.raffle_id      The parent raffle's `id` (from `TRaffle.id`).\n\t * @param props.run_id         The draw run instance ID (from\n\t *                             `TRaffleDraw.run_id`, not `TRaffleDraw.id`).\n\t * @param props.winners_from   First winner index to return (0-based).\n\t *                             Defaults to `0`.\n\t * @param props.winners_to     Last winner index (exclusive).\n\t *                             Defaults to `20`. Server caps the\n\t *                             window at 50 rows per call.\n\t * @returns                    Promise resolving to `TRaffleDraw`\n\t *                             with `prizes[].winners[]` populated\n\t *                             and `winners_total` set.\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles();\n\t * const raffle = raffles[0];\n\t * const draw = raffle.draws.find(d => d.current_state === 3);  // Executed\n\t *\n\t * if (!draw) {\n\t *   console.log('[smartico] no executed draw — skip detail view');\n\t *   return;\n\t * }\n\t *\n\t * // First page of winners.\n\t * const detail = await window._smartico.api.getRaffleDrawRun({\n\t *   raffle_id: raffle.id,\n\t *   run_id: draw.run_id,   // NOTE: run_id, NOT draw.id\n\t *   winners_from: 0,\n\t *   winners_to: 20,\n\t * });\n\t *\n\t * for (const prize of detail.prizes) {\n\t *   console.log('[smartico] prize', prize.name, '— winners on this page:', prize.winners.length);\n\t *   const myWin = prize.winners.find(w => w.username === currentUsername);  // or another match\n\t *   if (myWin) {\n\t *     console.log('[smartico] current user won this prize — surface a Claim CTA if not yet claimed');\n\t *   }\n\t * }\n\t *\n\t * // Load more — pagination via winners_from / winners_to.\n\t * if ((detail.winners_total ?? 0) > 20) {\n\t *   const next = await window._smartico.api.getRaffleDrawRun({\n\t *     raffle_id: raffle.id,\n\t *     run_id: draw.run_id,\n\t *     winners_from: 20,\n\t *     winners_to: 40,\n\t *   });\n\t *   console.log('[smartico] page 2 loaded — append', next.prizes.flatMap(p => p.winners).length, 'winners');\n\t * }\n\t * ```\n\t */\n\tpublic async getRaffleDrawRun(props: { raffle_id: number; run_id: number; winners_from?: number; winners_to?: number }): Promise<TRaffleDraw> {\n\t\tif (!props.raffle_id || !props.run_id) {\n\t\t\tthrow new Error('both raffle_id and run_id are required');\n\t\t}\n\n\t\treturn await this.api.getRaffleDrawRunT(this.userExtId, props.raffle_id, props.run_id, props.winners_from, props.winners_to);\n\t}\n\n\t/**\n\t * Returns the history of past-executed draw runs for a raffle —\n\t * optionally scoped to a single recurring draw schedule. Each row\n\t * is a previously-executed run with its scheduled and\n\t * actual-execution timestamps, the user's win status, and an\n\t * unclaimed-prize flag for surfacing a Claim CTA on history rows.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * `raffle_id` is required. `draw_id` is optional — when omitted,\n\t * the response includes history for ALL draws of the raffle; when\n\t * supplied, it scopes to that one draw's recurring history. The\n\t * `draw_id` to pass is `TRaffleDraw.id` (the schedule_id, stable\n\t * across runs), not `run_id`.\n\t *\n\t * **Server-side filtering**\n\t * Draws configured by the operator to hide their history are\n\t * excluded from the response automatically. Cancelled runs are\n\t * also excluded.\n\t *\n\t * **Sort order**\n\t * Server returns rows by scheduled `execution_ts` descending\n\t * (newest first). No client-side sort required.\n\t *\n\t * **Refresh model**\n\t * - **No subscription.** One-shot promise.\n\t * - **No client cache.** Every call hits the server.\n\t * - **No push event** refreshes the response. Re-call manually to\n\t *   pick up newly-executed runs or `has_unclaimed_prize` flips\n\t *   after a {@link claimRafflePrize} call.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffleDrawRunsHistory`](../../docs/ui/raffles/UIGuide_getRaffleDrawRunsHistory.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned with\n\t * `is_winner` and `has_unclaimed_prize` always `false` for visitors.\n\t *\n\t * @param props.raffle_id  The parent raffle's `id` (from `TRaffle.id`).\n\t *                         Required.\n\t * @param props.draw_id    Optional — the draw's schedule_id\n\t *                         (`TRaffleDraw.id`). When set, scopes the\n\t *                         history to that one draw's runs. When\n\t *                         omitted, includes all draws of the raffle.\n\t * @returns                Promise resolving to a `TRaffleDrawRun[]`\n\t *                         ordered newest-first. Empty if no executed\n\t *                         runs exist.\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles();\n\t * const raffle = raffles[0];\n\t *\n\t * // History across all draws of the raffle.\n\t * const allHistory = await window._smartico.api.getRaffleDrawRunsHistory({\n\t *   raffle_id: raffle.id,\n\t * });\n\t *\n\t * // Highlight rows where the user has an unclaimed prize.\n\t * const unclaimed = allHistory.filter(r => r.has_unclaimed_prize);\n\t * if (unclaimed.length > 0) {\n\t *   console.log('[smartico] surface a \"Claim\" CTA on these', unclaimed.length, 'history rows:', unclaimed.map(r => r.run_id));\n\t * }\n\t *\n\t * // Scoped history of one recurring draw (use draw.id, the schedule_id).\n\t * const oneDrawHistory = await window._smartico.api.getRaffleDrawRunsHistory({\n\t *   raffle_id: raffle.id,\n\t *   draw_id: raffle.draws[0].id,   // schedule_id (stable across recurring runs)\n\t * });\n\t * console.log('[smartico] render history rows for the daily draw — newest first:', oneDrawHistory.length, 'rows');\n\t * ```\n\t */\n\tpublic async getRaffleDrawRunsHistory(props: { raffle_id: number; draw_id?: number }): Promise<TRaffleDrawRun[]> {\n\t\t\n\t\tconst res = await this.api.getRaffleDrawRunsHistory(this.userExtId, props);\n\n\t\tif (!props.raffle_id) {\n\t\t\tthrow new Error('raffle_id is required');\n\t\t}\n\n\t\treturn drawRunHistoryTransform(res);\n\t}\n\n\t/**\n\t * Claims a raffle prize the user has won. Call this when the user\n\t * has a winning row with `should_claim === true` and an unclaimed\n\t * `won_id` (read from a `TRafflePrizeWinner` on a\n\t * {@link getRaffleDrawRun} result, or surfaced by `has_unclaimed_prize`\n\t * on a {@link getRaffleDrawRunsHistory} row that the consumer drills\n\t * into).\n\t *\n\t * On success (`errorCode === 0`), the server records the claim and\n\t * triggers prize delivery through the operator's integration —\n\t * delivery is server-side, not part of this response.\n\t *\n\t * @remarks\n\t * **Result shape note**: this method returns\n\t * `TransformedRaffleClaimPrizeResponse` with `errorCode` /\n\t * `errorMessage` (camelCase full-word) — different from most other\n\t * SDK result types which use `err_code` / `err_message` (snake_case\n\t * short-word). Branch on the camelCase keys when reading this\n\t * method's result.\n\t *\n\t * **Preconditions**\n\t * Pass a `won_id` that identifies an unclaimed winning row for the\n\t * current user. The `won_id` comes from\n\t * `TRafflePrizeWinner.raf_won_id` returned by\n\t * {@link getRaffleDrawRun}.\n\t *\n\t * **Error codes** (in `errorCode`)\n\t * - `0` — success; the claim is recorded and prize delivery is\n\t *   queued server-side.\n\t * - `1` — generic claim failure. The `errorMessage` distinguishes\n\t *   the specific cause (the server uses one error code for several\n\t *   distinct conditions): the prize has already been claimed, the\n\t *   `won_id` doesn't match a winning row for this user, or the user\n\t *   is in a control group for this raffle. Treat `1` as a retryable\n\t *   error if the message suggests a transient condition; treat as\n\t *   idempotent success if the message indicates already-claimed\n\t *   (the underlying state is what the consumer wants either way —\n\t *   the prize is claimed).\n\t * - other non-zero — generic server error. Surface `errorMessage`\n\t *   if any.\n\t *\n\t * **Claim window**\n\t * There is no server-enforced claim deadline. Won prizes remain\n\t * claimable indefinitely until the operator archives them.\n\t *\n\t * **Idempotency**: NOT idempotent. A second call on the same\n\t * `won_id` returns `errorCode === 1` with `errorMessage` indicating\n\t * the prize has already been claimed. The SDK does NOT enforce an\n\t * in-flight lock. Guard the call site against double-clicks (set\n\t * a local \"claiming\" flag on click, clear it on response).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the raffles cache on every\n\t * response — both success and failure paths fire the `onUpdate`\n\t * callback registered via {@link getRaffles}. After `errorCode === 0`,\n\t * the affected `TRaffleDrawRun.has_unclaimed_prize` (in history)\n\t * and the winner row's `claimed_date` reflect the claim on the next\n\t * refresh.\n\t *\n\t * **Side effects** (on `errorCode === 0`)\n\t * - The winner row's `claimed_date` is set server-side.\n\t * - Prize delivery is queued for the operator's integration to\n\t *   process. Balance / bonus / inbox updates that result from the\n\t *   delivery arrive through their own channels — not in this\n\t *   response.\n\t *\n\t * **Throws**\n\t * `won_id` is required — the SDK throws synchronously when missing\n\t * or falsy.\n\t *\n\t * **UI guidance**: see [UI Guide — `claimRafflePrize`](../../docs/ui/raffles/UIGuide_claimRafflePrize.md).\n\t *\n\t * **Visitor mode**: not meaningfully supported. The SDK does not\n\t * block the call, but visitor sessions have no win history and the\n\t * server will reject it.\n\t *\n\t * @param props.won_id  The winning row's `raf_won_id` (from\n\t *                      `TRafflePrizeWinner` returned by\n\t *                      {@link getRaffleDrawRun}).\n\t * @returns `{ errorCode, errorMessage? }`; success when\n\t *          `errorCode === 0`. Note camelCase keys (see \"Result\n\t *          shape note\" above).\n\t *\n\t * @example\n\t * ```ts\n\t * const detail = await window._smartico.api.getRaffleDrawRun({\n\t *   raffle_id: raffleId,\n\t *   run_id: runId,\n\t * });\n\t * const myWin = detail.prizes.flatMap(p => p.winners).find(w => /* user match here *\\/ true);\n\t *\n\t * if (!myWin || !myWin.raf_won_id || myWin.claimed_date) {\n\t *   console.log('[smartico] nothing to claim — keep CTA hidden');\n\t *   return;\n\t * }\n\t *\n\t * console.log('[smartico] claim starting — set in-flight flag, show loading dots on the Claim button, keep the modal open');\n\t * const r = await window._smartico.api.claimRafflePrize({ won_id: myWin.raf_won_id });\n\t * console.log('[smartico] claim response received — clear in-flight flag');\n\t *\n\t * if (r.errorCode === 0) {\n\t *   console.log('[smartico] claim succeeded — show a success toast; getRaffles onUpdate above will fire with refreshed state; prize delivery happens server-side');\n\t * } else if (r.errorCode === 1 && r.errorMessage?.toLowerCase().includes('already claimed')) {\n\t *   console.log('[smartico] prize was already claimed (perhaps from another tab) — treat as success, hide the Claim CTA');\n\t * } else {\n\t *   console.error('[smartico] claim failed — surface this error message to the user and allow retry:', r.errorMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async claimRafflePrize(props: { won_id: number }): Promise<TransformedRaffleClaimPrizeResponse> {\n\t\tif (!props.won_id) {\n\t\t\tthrow new Error('won_id is required');\n\t\t}\n\n\t\tconst res = await this.api.claimRafflePrize(this.userExtId, { won_id: props.won_id });\n\t\treturn raffleClaimPrizeResponseTransform(res);\n\t}\n\n\t/**\n\t * Opts the current user into a specific raffle draw run. Required\n\t * for draws where `TRaffleDraw.requires_optin === true` — without\n\t * opt-in, the user's tickets do NOT participate in that run, even\n\t * if they hold tickets for the raffle.\n\t *\n\t * Opt-in is per-run: a recurring draw's next run requires a fresh\n\t * opt-in. The user's `TRaffleDraw.user_opted_in` flag reflects the\n\t * current state for the current run only.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate draw from {@link getRaffles}'s embedded\n\t * `draws[]` and gate the call on\n\t * `requires_optin === true && !user_opted_in && is_active &&\n\t * current_state !== Executed`. Calling without these guards may\n\t * return a non-zero `err_code`.\n\t *\n\t * **Argument mapping** — the three IDs come from different fields:\n\t * - `raffle_id` — the parent raffle's `TRaffle.id`\n\t * - `draw_id` — `TRaffleDraw.id` (schedule_id, stable across runs)\n\t * - `raffle_run_id` — `TRaffleDraw.run_id` (instance ID for this\n\t *   specific run)\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the user is opted into this run. Tickets\n\t *   collected after the run's `ticket_start_ts` will participate.\n\t * - `1` — generic opt-in failure. The `err_message` distinguishes\n\t *   the specific cause: the draw doesn't require opt-in\n\t *   (`requires_optin === false`), `raffle_id` doesn't match the\n\t *   `draw_id`, the user is already opted in (or the draw has\n\t *   completed), or the user is in a control group for this raffle.\n\t * - other non-zero — generic server error. Surface `err_message`.\n\t *\n\t * **Idempotency**: NOT idempotent. A second call on the same\n\t * `raffle_run_id` returns `err_code === 1` with `err_message`\n\t * indicating the user is already opted in. Treat as success in\n\t * the UI — the underlying state is what the consumer wants.\n\t * Guard the call site against double-clicks.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the raffles cache on every\n\t * response and fires the `onUpdate` callback registered via\n\t * {@link getRaffles}. After `err_code === 0`, the affected draw's\n\t * `user_opted_in` flips to `true` on the refreshed list.\n\t *\n\t * **Side effects** (on `err_code === 0`)\n\t * - The user is registered for this run. Tickets earned within\n\t *   the run's eligibility window will participate in the draw.\n\t * - No balance change. No CRM-side rewards. Opt-in is a metadata\n\t *   operation only.\n\t *\n\t * **Throws**\n\t * `raffle_id`, `draw_id`, and `raffle_run_id` are all required —\n\t * the SDK throws synchronously when any is missing or falsy.\n\t *\n\t * **UI guidance**: see [UI Guide — `requestRaffleOptin`](../../docs/ui/raffles/UIGuide_requestRaffleOptin.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param props.raffle_id      The parent raffle's `id`.\n\t * @param props.draw_id        The draw's schedule_id (`TRaffleDraw.id`).\n\t * @param props.raffle_run_id  The run instance ID (`TRaffleDraw.run_id`).\n\t * @returns                    `{ err_code, err_message? }`; success\n\t *                             when `err_code === 0` (treat\n\t *                             \"already opted in\" as idempotent\n\t *                             success).\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles({\n\t *   onUpdate: (refreshed) => console.log('[smartico] raffles refreshed — re-render', refreshed),\n\t * });\n\t * const raffle = raffles[0];\n\t * const draw = raffle.draws.find(d =>\n\t *   d.requires_optin && !d.user_opted_in && d.is_active && d.current_state !== 3\n\t * );\n\t *\n\t * if (!draw) {\n\t *   console.log('[smartico] no opt-in-required draw available — keep CTA hidden');\n\t *   return;\n\t * }\n\t *\n\t * console.log('[smartico] opt-in starting — set in-flight flag, show loading dots on the Opt-in button');\n\t * const r = await window._smartico.api.requestRaffleOptin({\n\t *   raffle_id: raffle.id,\n\t *   draw_id: draw.id,        // schedule_id, NOT run_id\n\t *   raffle_run_id: draw.run_id,\n\t * });\n\t * console.log('[smartico] opt-in response received — clear in-flight flag');\n\t *\n\t * if (r.err_code === 0) {\n\t *   console.log('[smartico] opted in successfully — show \"Fully opted in\" state on the draw card; onUpdate above will fire with user_opted_in: true');\n\t * } else if (r.err_code === 1 && r.err_message?.toLowerCase().includes('already opted in')) {\n\t *   console.log('[smartico] already opted in (perhaps from another tab) — treat as success, show \"Fully opted in\"');\n\t * } else {\n\t *   console.error('[smartico] opt-in failed — surface this error to the user:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async requestRaffleOptin(props: { raffle_id: number; draw_id: number; raffle_run_id: number }): Promise<TRaffleOptinResponse> {\n\t\tif (!props.raffle_id) {\n\t\t\tthrow new Error('raffle_id is required');\n\t\t}\n\t\tif (!props.draw_id) {\n\t\t\tthrow new Error('draw_id is required');\n\t\t}\n\t\tif (!props.raffle_run_id) {\n\t\t\tthrow new Error('raffle_run_id is required');\n\t\t}\n\n\t\tconst r = await this.api.raffleOptin(this.userExtId, props);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Returns every prize the current user has won within a single raffle —\n\t * across ALL of that raffle's draws, newest-won first — in one paginated\n\t * call. Use this to power a \"my prizes\" screen for a raffle (prize name,\n\t * prize image, the user's name/avatar) without walking\n\t * {@link getRaffleDrawRunsHistory} and then paging\n\t * {@link getRaffleDrawRun}'s per-draw winner lists.\n\t *\n\t * Each row carries its own `raf_won_id`, which IS the `won_id` to pass to\n\t * {@link claimRafflePrize}: a row with `requires_claim === true` and no\n\t * `claimed_date` is directly claimable.\n\t *\n\t * @remarks\n\t * **Authentication required**\n\t * Works only for an identified (logged-in) user. Visitor / anonymous\n\t * sessions are rejected — call this only after identify.\n\t *\n\t * **Preconditions**\n\t * `raffle_id` is required — the SDK throws synchronously when it is\n\t * missing or falsy.\n\t *\n\t * **Coverage & sort order**\n\t * Includes the user's wins from every draw of the raffle — recurring,\n\t * one-shot, and grand draws, across all historical runs. Rows are ordered\n\t * newest-win first; there is no \"unclaimed first\" ordering, so sort\n\t * client-side if you want claimable prizes at the top.\n\t *\n\t * **Pagination**\n\t * `offset` / `limit` page the `won_prizes[]` rows (the SDK defaults to\n\t * `0` / `20`). `total` is the authoritative full count of the user's wins\n\t * for this raffle across all draws — drive \"load more\" from it\n\t * (`offset + won_prizes.length < total`). An `offset` past the end returns\n\t * an empty `won_prizes[]` with the real `total` and `errCode 0` — not an\n\t * error. The server does NOT clamp `limit`, so always pass an explicit,\n\t * sane page size.\n\t *\n\t * **Rate limit**\n\t * The server caps this at roughly 30 calls per minute with a ~5-second\n\t * minimum gap between calls. Fetch on screen open and on explicit \"load\n\t * more\" — don't poll it on a timer.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success. Also returned with an empty `won_prizes[]` and\n\t *   `total 0` when the user has no wins, or is not eligible to see this\n\t *   raffle.\n\t * - `1` — generic server error; surface `errMsg` if present.\n\t *\n\t * There are no granular codes — an unknown raffle, an ineligible user,\n\t * and \"no wins\" all surface as `errCode 0` with an empty list.\n\t *\n\t * **Reading the result**\n\t * - Null-check `user` before reading it — it is `null` whenever\n\t *   `won_prizes` is empty.\n\t * - For the avatar, use `user.avatar_id` (already a full URL for a system\n\t *   avatar, otherwise an avatar token to resolve against the widget's\n\t *   avatar domain); `user.avatar_url` is always `null`.\n\t * - Render `public_username` as-is (it is server-masked for privacy, e.g.\n\t *   `\"32:r*****\"`) and substitute a \"You\" label for the current user.\n\t * - Treat `claimed_date` as the claim flag: `null` until claimed, then\n\t *   epoch ms.\n\t *\n\t * **Idempotency / Side effects**: safe and read-only — one-shot promise,\n\t * no client cache, no subscription. The server caches the response\n\t * briefly; a successful {@link claimRafflePrize} invalidates that cache,\n\t * so a follow-up call reflects the new `claimed_date`. This method does\n\t * NOT refresh the {@link getRaffles} list or fire its `onUpdate` — re-call\n\t * manually to pick up newly-won prizes or a `claimed_date` flip.\n\t *\n\t * **UI guidance**: see [UI Guide — `getRaffleWonPrizes`](../../docs/ui/raffles/UIGuide_getRaffleWonPrizes.md).\n\t *\n\t * **Visitor mode**: not supported (see \"Authentication required\").\n\t *\n\t * @param props.raffle_id  The parent raffle's `id` (from `TRaffle.id`). Required.\n\t * @param props.offset     Zero-based index of the first row to return. Defaults to `0`.\n\t * @param props.limit      Page size. Defaults to `20`.\n\t * @returns                Promise resolving to {@link GetRaffleWonPrizesResponse}\n\t *                         (`user`, this page of `won_prizes`, and `total`;\n\t *                         `errCode 0` on success).\n\t *\n\t * @example\n\t * ```ts\n\t * const raffles = await window._smartico.api.getRaffles();\n\t * const raffle = raffles[0];\n\t *\n\t * // First page of the user's won prizes for this raffle.\n\t * const page = await window._smartico.api.getRaffleWonPrizes({\n\t *   raffle_id: raffle.id,\n\t *   offset: 0,\n\t *   limit: 20,\n\t * });\n\t *\n\t * if (page.errCode !== 0) {\n\t *   console.error('[smartico] could not load won prizes — show a retry state:', page.errMsg);\n\t *   return;\n\t * }\n\t * if (page.won_prizes.length === 0) {\n\t *   console.log('[smartico] no wins in this raffle (or not eligible) — render the empty state');\n\t *   return;\n\t * }\n\t *\n\t * console.log('[smartico]', page.user?.public_username, 'won', page.total, 'prizes total');\n\t * for (const prize of page.won_prizes) {\n\t *   console.log('[smartico] render prize card —', prize.public_meta.name, prize.public_meta.image_url);\n\t *   if (prize.requires_claim && !prize.claimed_date) {\n\t *     console.log('[smartico] show a Claim CTA — on click call claimRafflePrize({ won_id:', prize.raf_won_id, '})');\n\t *   }\n\t * }\n\t *\n\t * // Load more.\n\t * if (page.offset + page.won_prizes.length < page.total) {\n\t *   const next = await window._smartico.api.getRaffleWonPrizes({\n\t *     raffle_id: raffle.id,\n\t *     offset: page.offset + page.limit,\n\t *     limit: 20,\n\t *   });\n\t *   console.log('[smartico] appended', next.won_prizes.length, 'more prizes');\n\t * }\n\t * ```\n\t */\n\tpublic async getRaffleWonPrizes(props: { raffle_id: number; offset?: number; limit?: number }): Promise<GetRaffleWonPrizesResponse> {\n\t\tif (!props.raffle_id) {\n\t\t\tthrow new Error('raffle_id is required');\n\t\t}\n\n\t\treturn await this.api.getRaffleWonPrizes(this.userExtId, {\n\t\t\traffle_id: props.raffle_id,\n\t\t\toffset: props.offset ?? 0,\n\t\t\tlimit: props.limit ?? 20,\n\t\t});\n\t}\n}\n","import { SAWSpinsCountPush } from '../MiniGames';\nimport { ECacheContext, OCache } from '../OCache';\nimport {\n\tTMiniGamePlayResult,\n\tTMiniGameTemplate,\n\tTMiniGamePlayBatchResult,\n\tTSawHistory,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIRaffles } from './WSAPIRaffles';\n\n/** @group MiniGames */\nexport class WSAPIMiniGames extends WSAPIRaffles {\n\t/**\n\t * Returns all mini-game templates (\"SAW\" = Spin And Win — the\n\t * umbrella term for wheel-spin, scratch-card, lootbox, gift-box,\n\t * treasure-hunt, plinko, coin-flip, quiz, and several other formats)\n\t * configured for the label. Optionally subscribes to live updates\n\t * via `onUpdate`: the callback fires whenever the user's\n\t * `spin_count` changes, jackpot grows, a manual spin is issued, or\n\t * a spin response lands.\n\t *\n\t * The list is NOT filtered by spin availability — every configured\n\t * template is returned, including ones the user cannot currently\n\t * play. The `visibile_when_can_spin` flag on each template hints\n\t * which to hide in a default lobby view (consumer-side filter).\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed template list (never a\n\t * diff/patch). Each subsequent call to `getMiniGames({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires when:\n\t *\n\t * 1. The server pushes a `spin_count` change (campaign award,\n\t *    store purchase, BO manual issuance, mission reward).\n\t * 2. Any {@link playMiniGame} or {@link playMiniGameBatch}\n\t *    resolves on this connection — the cached array refreshes\n\t *    with updated `spin_count`, `jackpot_current`, and any new\n\t *    `next_available_spin_ts`.\n\t * 3. Acknowledge responses land (via auto-acknowledge or\n\t *    {@link miniGameWinAcknowledgeRequest}).\n\t *\n\t * Jackpot growth is observable on the refreshed `jackpot_current`\n\t * field — the SDK inlines the live value into template `name` /\n\t * `promo_text` / prize `name` via a `{{jackpot}}` template\n\t * substitution at fetch time.\n\t *\n\t * **Game-type variants**\n\t * All twelve `SAWGameType` values (`SpinAWheel`, `ScratchCard`,\n\t * `MatchX`, `GiftBox`, `PrizeDrop`, `Quiz`, `LootboxWeekdays`,\n\t * `LootboxCalendarDays`, `TreasureHunt`, `Voyager`, `Plinko`,\n\t * `CoinFlip`) surface through the same template shape. Most are\n\t * played via {@link playMiniGame}; the exceptions are:\n\t * - `PrizeDrop` — server-push only; the consumer does NOT call\n\t *   `playMiniGame`. Prizes arrive via the prize-drop push channel.\n\t * - `MatchX` / `Quiz` — predictions are submitted via a separate\n\t *   games server (not this SDK); the SAW spin is fired\n\t *   server-internally to deduct the buy-in.\n\t *\n\t * **Per-prize statistics (`expose_game_stat_on_api`)**\n\t * Each template's `prizes` array always carries the definition\n\t * fields — name, icon, `prize_type`, `prize_value`, acknowledge\n\t * configuration. The stock-statistics fields are gated by an\n\t * operator template setting, surfaced as\n\t * `expose_game_stat_on_api`:\n\t * - Populated when enabled: `pool` (remaining stock),\n\t *   `wins_count` (total wins across all players), `weekdays`\n\t *   (ISO 1–7 days the prize can be won), `active_from_ts` /\n\t *   `active_till_ts` (prize availability window).\n\t * - Omitted when disabled (the default) — this keeps the live\n\t *   prize economy (stock levels, win rates, schedules) hidden\n\t *   from players.\n\t * - Exception: `pool` is always populated for `MatchX` / `Quiz`\n\t *   templates, whose game flow needs the remaining stock.\n\t * - `pool_initial` is populated regardless of the setting.\n\t * When enabled, the values are also kept current — the server\n\t * refreshes the prize rows on each fetch and drops its template\n\t * caches after every play, so `pool` / `wins_count` are safe to\n\t * drive an \"X prizes left\" scarcity UI.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds. Cache\n\t * is fully cleared on login / logout.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getMiniGames`](../../docs/ui/minigames/UIGuide_getMiniGames.md).\n\t *\n\t * **Visitor mode**: supported. Only templates configured with\n\t * `is_visitor_mode = true` in the BO are returned for anonymous\n\t * sessions. Spins from these templates may also be played (visitor\n\t * mode is the one mini-game flow that does support play — see\n\t * {@link playMiniGame} for the visitor-stop semantics).\n\t *\n\t * @param params              Optional. Omit to fetch without subscribing.\n\t * @param params.onUpdate     Callback invoked with the full refreshed\n\t *                            template array after any spin-count\n\t *                            change, spin response, or acknowledge\n\t *                            response on this connection.\n\t * @returns                   Promise resolving to the template\n\t *                            array. Empty if no templates are\n\t *                            visible to the user.\n\t *\n\t * @example\n\t * ```ts\n\t * const games = await window._smartico.api.getMiniGames({\n\t *   onUpdate: (refreshed) => {\n\t *     console.log('[smartico] mini-game templates refreshed — re-render lobby from this array:', refreshed);\n\t *   },\n\t * });\n\t *\n\t * // Filter the lobby view per the visibility flag.\n\t * const visible = games.filter(g =>\n\t *   !g.visibile_when_can_spin || (g.spin_count && g.spin_count > 0)\n\t * );\n\t *\n\t * for (const g of visible) {\n\t *   console.log('[smartico] render game card', g.id, '—', g.name,\n\t *     '— type:', g.saw_game_type,\n\t *     '— buy-in:', g.saw_buyin_type,\n\t *     '— spins available:', g.spin_count ?? 0,\n\t *     '— jackpot:', g.jackpot_current, g.jackpot_symbol);\n\t * }\n\t * ```\n\t */\n\tpublic async getMiniGames({ onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {}): Promise<\n\t\tTMiniGameTemplate[]\n\t> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);\n\t\t}\n\n\t\treturn OCache.use(onUpdateContextKey.Saw, ECacheContext.WSAPI, () => this.api.sawGetTemplatesT(this.userExtId), CACHE_DATA_SEC);\n\t}\n\n\t/**\n\t * Returns a paginated, newest-first list of the user's past\n\t * mini-game spins — each row carries the won prize ID, the\n\t * client-side `request_id` used for the spin, and a\n\t * server-recorded `is_claimed` flag (`true` if the spin has been\n\t * acknowledged). Optionally filter to a single template via\n\t * `saw_template_id`.\n\t *\n\t * Use this to power a \"My prizes\" / win-history surface, or to\n\t * recover unacknowledged spins (rows with `is_claimed === false`\n\t * carry a `client_request_id` you can pass to\n\t * {@link miniGameWinAcknowledgeRequest}).\n\t *\n\t * @remarks\n\t * **Pagination**\n\t * `limit` defaults to 20, `offset` defaults to 0. Sort order is\n\t * `create_date` DESC (newest first) — no client-side re-sort\n\t * required. For \"load more\" pagination, advance `offset` by the\n\t * page size on each subsequent call.\n\t *\n\t * The underlying protocol carries a `hasMore` boolean on the\n\t * response, but the SDK strips it from the public surface —\n\t * detect end of list when the returned array length is less than\n\t * `limit`.\n\t *\n\t * **`is_claimed` semantics**\n\t * Maps directly to the server's \"acknowledge_date is non-null\"\n\t * state. A spin where the auto-acknowledge fire-and-forget\n\t * succeeded shows `is_claimed: true`; a spin where the\n\t * acknowledge was lost (network drop) or where the user is on an\n\t * explicit-acknowledge flow shows `is_claimed: false` with a\n\t * usable `client_request_id`. A server-side fallback job\n\t * auto-acknowledges stale rows every ~60 seconds — so even\n\t * \"lost\" prizes are eventually delivered without consumer action.\n\t *\n\t * **Cache TTL**: the SDK caches the response for 30 seconds.\n\t * Cache is invalidated implicitly when a new spin or acknowledge\n\t * response lands.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getMiniGamesHistory`](../../docs/ui/minigames/UIGuide_getMiniGamesHistory.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params                  Optional pagination + filter bag.\n\t * @param params.limit            Page size. Defaults to 20.\n\t * @param params.offset           Number of rows to skip. Defaults to 0.\n\t * @param params.saw_template_id  When set, scopes the history to\n\t *                                a single template's spins.\n\t *\n\t * @returns Promise resolving to `TSawHistory[]` in newest-first\n\t *          order. Empty when the user has no history.\n\t *\n\t * @example\n\t * ```ts\n\t * const history = await window._smartico.api.getMiniGamesHistory({ limit: 20 });\n\t *\n\t * // Show unacknowledged spins with a Claim CTA.\n\t * const unacknowledged = history.filter(h => !h.is_claimed);\n\t * console.log('[smartico] surface a \"Claim\" CTA on these', unacknowledged.length, 'history rows:',\n\t *   unacknowledged.map(h => h.client_request_id));\n\t *\n\t * // Load-more pagination — advance offset by the prior page size.\n\t * const page2 = await window._smartico.api.getMiniGamesHistory({ limit: 20, offset: 20 });\n\t * console.log('[smartico] page 2 loaded —', page2.length, 'more rows;',\n\t *   page2.length < 20 ? 'end of list reached, hide \"Load more\"' : 'keep \"Load more\" visible');\n\t * ```\n\t */\n\n\tpublic async getMiniGamesHistory({\n\t\tlimit,\n\t\toffset,\n\t\tsaw_template_id,\n\t}: {\n\t\tlimit?: number;\n\t\toffset?: number;\n\t\tsaw_template_id?: number;\n\t}): Promise<TSawHistory[]> {\n\t\treturn OCache.use(\n\t\t\t`${onUpdateContextKey.SAWHistory}:${saw_template_id ?? ''}:${limit ?? ''}:${offset ?? ''}`,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getSawWinningHistoryT(this.userExtId, limit, offset, saw_template_id),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Plays one round of a mini-game template — runs the server's\n\t * randomised prize selection, deducts the buy-in cost (if any),\n\t * credits the won prize, and returns the won `prize_id`. By default\n\t * (`acknowledge: true`) the SDK then sends a server-side\n\t * acknowledgement and AWAITS it before resolving, so the win is\n\t * marked delivered by the time the promise settles. Pass\n\t * `acknowledge: false` to skip that step and finalise the win\n\t * yourself later (see the `acknowledge` parameter).\n\t *\n\t * Works for all `SAWGameType` values EXCEPT:\n\t * - `PrizeDrop` — prizes arrive server-pushed; do NOT call\n\t *   `playMiniGame` for this type.\n\t * - `MatchX` / `Quiz` — prediction submission goes through a\n\t *   separate games server; `playMiniGame` is not the entry point.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * Read the candidate template from {@link getMiniGames} and check:\n\t * - `spin_count > 0` for spin-based templates\n\t *   (`saw_buyin_type === 'spins'`).\n\t * - Sufficient balance for paid templates — points / gems /\n\t *   diamonds from {@link getUserProfile} against\n\t *   `buyin_cost_points` / `_gems` / `_diamonds`.\n\t * - `next_available_spin_ts` is in the past (or unset) — the\n\t *   server enforces a per-period max-attempts cap.\n\t * - Template is currently in its active period\n\t *   (operator-configured `activeFromDate` / `activeTillDate`).\n\t *\n\t * **Error codes** (in `err_code`, typed as {@link SAWSpinErrorCode})\n\t * - `0` (`SAW_OK`) — success; `prize_id` identifies the won prize\n\t *   in `template.prizes`.\n\t * - `40001` (`SAW_NO_SPINS`) — user has no spin attempts for a\n\t *   spin-based template.\n\t * - `40002` (`SAW_PRIZE_POOL_EMPTY`) — all prize slots in the\n\t *   template are depleted.\n\t * - `40003` (`SAW_NOT_ENOUGH_POINTS`) — insufficient points for a\n\t *   points-cost template.\n\t * - `40004` (`SAW_FAILED_MAX_SPINS_REACHED`) — per-period\n\t *   max-attempts cap reached. The server's\n\t *   `first_spin_in_period` value (exposed in\n\t *   {@link TMiniGamePlayBatchResult}; not surfaced in the single\n\t *   `TMiniGamePlayResult`) marks the period start.\n\t * - `40007` (`SAW_TEMPLATE_NOT_ACTIVE`) — template outside its\n\t *   active time window.\n\t * - `40009` (`SAW_NOT_IN_SEGMENT`) — user fails the template's\n\t *   visibility segment check, OR (for lootbox variants) the day's\n\t *   prize pool is empty.\n\t * - `40011` (`SAW_NO_BALANCE_GEMS`) — insufficient gems.\n\t * - `40012` (`SAW_NO_BALANCE_DIAMONDS`) — insufficient diamonds.\n\t * - `-40001` (`SAW_VISITOR_STOP_SPIN_REQUEST`) — visitor session\n\t *   tried to play a non-visitor-mode template. The default UI\n\t *   silently stops the game; no prize awarded.\n\t * - other non-zero — generic server error. Surface `err_message`.\n\t *\n\t * **Prize handling**\n\t * On `err_code === 0`, `prize_id` matches an entry in\n\t * `template.prizes`. Look up the prize's `prize_type`\n\t * ({@link MiniGamePrizeTypeName}) to decide UI treatment:\n\t * - `'no-prize'` — the user spun but won nothing (an operator-\n\t *   configured \"loss\" slot). Buy-in is still deducted.\n\t * - `'points'` / `'gems-and-diamonds'` / `'spin'` — value\n\t *   credited to the user's profile / spin balance; visible on\n\t *   the next refresh.\n\t * - `'bonus'` — surfaces via {@link getBonuses}.\n\t * - `'jackpot'` — drains the template's `jackpot_current` to the\n\t *   user; resets the accumulator.\n\t * - `'raffle-ticket'` — adds tickets to the relevant raffle.\n\t * - `'mission'` / `'change-level'` — visible via the\n\t *   corresponding domain methods.\n\t * - `'manual'` — operator delivers offline.\n\t *\n\t * **Acknowledge** (the `acknowledge` parameter, default `true`)\n\t * Every spin is finalised by a follow-up acknowledge step that\n\t * marks the win delivered. By default the SDK sends that\n\t * acknowledge and AWAITS it, so `playMiniGame` resolves only after\n\t * the win is finalised server-side. Keep the default unless you\n\t * have a specific reason not to.\n\t *\n\t * Pass `acknowledge: false` to skip that automatic step.\n\t * `playMiniGame` then resolves as soon as the spin result is known,\n\t * without waiting for the win to be marked delivered. You finalise\n\t * it later by calling {@link miniGameWinAcknowledgeRequest} with the\n\t * `request_id` returned on this result.\n\t *\n\t * What `acknowledge: false` defers:\n\t * - For STANDARD prizes the value is credited when the spin is\n\t *   finalised — by your later acknowledge or, failing that, by the\n\t *   server-side fallback below — so opting out delays the balance\n\t *   change by at most that fallback window. The `is_claimed` flag in\n\t *   {@link getMiniGamesHistory} flips on the same finalisation.\n\t * - For operator-configured \"explicit claim\" prizes the credit is\n\t *   deferred until your explicit acknowledge — the fallback does not\n\t *   cover them.\n\t *\n\t * While the spin is un-finalised it can also be finalised as LOST —\n\t * prize discarded back to the pool — via\n\t * {@link miniGameWinAcknowledgeRequest} with `{ lose: true }`.\n\t *\n\t * A server-side fallback auto-acknowledges ordinary un-acknowledged\n\t * spins after a short delay (about 1–3 minutes), so an ordinary\n\t * prize is never lost even without consumer action. \"Explicit\n\t * claim\" prizes are excluded from that fallback — if you use\n\t * `acknowledge: false` for one, you MUST acknowledge it explicitly\n\t * or its prize is never credited.\n\t *\n\t * **Idempotency**: NOT idempotent. A double-click sends two\n\t * spins and deducts the buy-in twice. The SDK does NOT guard\n\t * against rapid clicks at the public API level — guard the call\n\t * site with an in-flight flag. The server enforces a per-user\n\t * per-template lock that serialises concurrent requests, so two\n\t * simultaneous calls won't be processed in parallel, but they\n\t * will both be processed sequentially (i.e. both deduct).\n\t *\n\t * **Refresh after success (and after failure)**\n\t * The SDK automatically refreshes the templates cache on every\n\t * spin response and fires any `onUpdate` callback registered via\n\t * {@link getMiniGames} or this method. After `err_code === 0`, the\n\t * affected template's `spin_count` / `jackpot_current` /\n\t * `next_available_spin_ts` reflect the new state on the\n\t * refreshed array.\n\t *\n\t * **Side effects** (on `err_code === 0`)\n\t * - Buy-in deducted at spin time (points / gems / diamonds / spin\n\t *   tickets — depending on `saw_buyin_type`), already applied by the\n\t *   time the call resolves. Balance updates flow via the\n\t *   user-properties channel (observe via {@link getUserProfile}).\n\t * - Prize value credited per the prize's type (see \"Prize handling\"\n\t *   above) when the spin is finalised — with the default\n\t *   auto-acknowledge that happens before the call resolves;\n\t *   \"explicit claim\" prizes are credited only by an explicit\n\t *   acknowledge.\n\t * - The play is recorded server-side for analytics / reporting.\n\t *\n\t * **UI guidance**: see [UI Guide — `playMiniGame`](../../docs/ui/minigames/UIGuide_playMiniGame.md).\n\t *\n\t * **Visitor mode**: not supported. Visitor sessions trying to\n\t * spin receive `SAW_VISITOR_STOP_SPIN_REQUEST (-40001)`.\n\t *\n\t * @param template_id        The mini-game template ID (from\n\t *                           `TMiniGameTemplate.id`).\n\t * @param params             Optional options bag.\n\t * @param params.onUpdate    Pass a callback to subscribe to\n\t *                           subsequent template refreshes (same\n\t *                           channel as {@link getMiniGames}).\n\t * @param params.acknowledge Whether the SDK automatically sends and\n\t *                           awaits the win acknowledge after the\n\t *                           spin. Defaults to `true` (recommended).\n\t *                           Set `false` to finalise the win yourself\n\t *                           via {@link miniGameWinAcknowledgeRequest}\n\t *                           — see \"Acknowledge\" above for the\n\t *                           request-id caveat.\n\t * @returns `{ err_code, err_message, prize_id }` — success when\n\t *          `err_code === 0`. `prize_id` is always populated; look\n\t *          it up in `template.prizes` to interpret the prize.\n\t *\n\t * @example\n\t * ```ts\n\t * const games = await window._smartico.api.getMiniGames({\n\t *   onUpdate: (refreshed) => console.log('[smartico] templates refreshed — re-render lobby', refreshed),\n\t * });\n\t * const game = games.find(g => g.id === templateId);\n\t *\n\t * if (!game) {\n\t *   console.log('[smartico] template not in current list — refresh getMiniGames');\n\t *   return;\n\t * }\n\t * if (game.saw_buyin_type === 'spins' && (game.spin_count ?? 0) === 0) {\n\t *   console.log('[smartico] no spins available — disable Play button, show \"No spins\" message');\n\t *   return;\n\t * }\n\t *\n\t * console.log('[smartico] play starting — set in-flight flag, start game animation (wheel spin / scratch / lootbox open / etc.)');\n\t * const r = await window._smartico.api.playMiniGame(game.id);\n\t * console.log('[smartico] play response received');\n\t *\n\t * if (r.err_code === 0) {\n\t *   const prize = game.prizes.find(p => p.id === r.prize_id);\n\t *   if (prize?.prize_type === 'no-prize') {\n\t *     console.log('[smartico] user lost — animate to the no-prize slot and show \"Better luck next time\" modal');\n\t *   } else {\n\t *     console.log('[smartico] user won — animate to prize', prize?.name,\n\t *       '— show acknowledge modal per template.acknowledge_type;',\n\t *       'getMiniGames onUpdate fires shortly with refreshed spin_count / jackpot');\n\t *   }\n\t * } else if (r.err_code === 40004) {\n\t *   console.error('[smartico] max spins reached — show countdown to next available spin (use playMiniGameBatch for first_spin_in_period if needed)');\n\t * } else if (r.err_code === -40001) {\n\t *   console.log('[smartico] visitor stopped — silently end the game, no prize modal');\n\t * } else {\n\t *   console.error('[smartico] play failed — show generic error with this message:', r.err_message);\n\t * }\n\t * ```\n\t *\n\t * @example\n\t * Manual finalisation (`acknowledge: false`) — e.g. an explicit\n\t * \"Claim\" CTA, a decline/forfeit flow, or finalising on your own\n\t * schedule:\n\t * ```ts\n\t * const r = await window._smartico.api.playMiniGame(game.id, { acknowledge: false });\n\t * if (r.err_code === 0) {\n\t *   // Spin resolved but not yet finalised — the prize is not credited\n\t *   // yet. Your acknowledge below credits it (for standard prizes the\n\t *   // server-side fallback would eventually do the same).\n\t *   console.log('[smartico] prize won — show the result / Claim CTA, then finalise');\n\t *\n\t *   // On the user's Claim click, finalise with the request_id from the result.\n\t *   await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);\n\t *   console.log('[smartico] win finalised — refresh getUserProfile / getMiniGames to reflect it');\n\t *\n\t *   // Or, if the game flow ends in the player declining / losing the\n\t *   // drawn prize, finalise the spin as lost instead — the prize is\n\t *   // not credited and returns to the prize pool:\n\t *   // await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id, { lose: true });\n\t * }\n\t * ```\n\t */\n\tpublic async playMiniGame(\n\t\ttemplate_id: number,\n\t\t{ onUpdate, acknowledge = true }: { onUpdate?: (data: TMiniGameTemplate[]) => void, acknowledge?: boolean } = {},\n\t): Promise<TMiniGamePlayResult> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);\n\t\t}\n\n\t\tconst r = await this.api.sawSpinRequest(this.userExtId, template_id);\n\t\tif (acknowledge) {\n\t\t\tawait this.api.doAcknowledgeRequest(this.userExtId, r.request_id);\n\t\t}\n\t\tconst o: TMiniGamePlayResult = {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t\tprize_id: r.saw_prize_id,\n\t\t\trequest_id: r.request_id,\n\t\t};\n\n\t\treturn o;\n\t}\n\n\t/**\n\t * Manually acknowledges a mini-game spin — marks the win delivered\n\t * server-side, or (with `lose: true`) finalises it as lost and\n\t * returns the prize to the pool. Most consumers do NOT need this:\n\t * {@link playMiniGame} acknowledges by default (`acknowledge: true`)\n\t * and {@link playMiniGameBatch} acknowledges automatically. Call this\n\t * directly only when you took ownership of the acknowledge step or\n\t * need to recover a lost one.\n\t *\n\t * @remarks\n\t * **When to call**\n\t * - **Primary — after `playMiniGame(..., { acknowledge: false })`.**\n\t *   You opted out of the automatic acknowledge to finalise the win\n\t *   on your own schedule (e.g. on a user \"Claim\" tap). Pass the\n\t *   `request_id` from that call's result here when ready. This is\n\t *   REQUIRED for operator-configured \"explicit claim\" prizes — they\n\t *   are not covered by the server-side fallback, so without this\n\t *   call their prize is never credited.\n\t * - **Recovery — a lost acknowledge.** {@link playMiniGameBatch}\n\t *   acknowledges on a fire-and-forget basis; if one is lost (network\n\t *   drop) the spin shows `is_claimed: false` in\n\t *   {@link getMiniGamesHistory}. Pass that row's `client_request_id`\n\t *   to deliver it.\n\t *\n\t * The `request_id` on a {@link playMiniGame} result and the\n\t * `client_request_id` on a {@link getMiniGamesHistory} row are the\n\t * same correlation id — this method accepts either.\n\t *\n\t * **Finalising as lost (`lose: true`)**\n\t * Pass `{ lose: true }` to finalise the spin as LOST instead of won:\n\t * the prize is NOT credited and is returned to the game's prize pool\n\t * (available again for other players), and the spin fires the\n\t * mini-game \"lose\" engagement event instead of the win one. On the\n\t * next {@link getMiniGamesHistory} fetch the row shows `is_claimed:\n\t * true` with no prize attached. Use this for game mechanics where the\n\t * player can decline or forfeit the drawn prize — e.g. a\n\t * gamble/discard step, or a client-driven game where the user's final\n\t * action decides whether the pre-drawn prize is actually won (the\n\t * default Smartico UI does this for the Voyager game: failing the\n\t * star-collection run finalises the spin as lost). When configured,\n\t * the prize's `aknowledge_message_lose` is the operator's result copy\n\t * for this case — show it instead of `aknowledge_message`. It only\n\t * works on a spin that is not yet finalised, so it requires playing\n\t * with `acknowledge: false` and calling promptly — once the automatic\n\t * acknowledge or the server-side fallback (below) has finalised the\n\t * spin, `lose: true` is a no-op and the prize stays credited.\n\t * (\"Explicit claim\" prizes are exempt from the fallback, so for them\n\t * there is no time pressure.)\n\t *\n\t * **Idempotency**: safe. Acknowledging a spin that is already\n\t * finalised — by you, by the automatic acknowledge, or by the\n\t * fallback — is a no-op with no double credit. Acknowledging a\n\t * failed spin's id is likewise a no-op.\n\t *\n\t * **Server-side fallback**\n\t * Even if you never call this, a server-side job finalises ordinary\n\t * un-acknowledged spins automatically after a short delay (about 1–3\n\t * minutes), flipping `is_claimed` to `true` on the next\n\t * {@link getMiniGamesHistory} fetch. \"Explicit claim\" prizes are the\n\t * exception — excluded from the fallback, they require an explicit\n\t * call here.\n\t *\n\t * **Side effects** (first successful call for an un-acknowledged spin)\n\t * - Default (win): the prize value is credited on this call — this is\n\t *   the finalisation step that credits standard and \"explicit claim\"\n\t *   prizes alike (see {@link playMiniGame} \"Prize handling\").\n\t * - With `lose: true`: no credit; the prize returns to the prize pool\n\t *   and the \"lose\" engagement event fires.\n\t * - Either way the spin's `is_claimed` flips to `true` on the next\n\t *   {@link getMiniGamesHistory} fetch.\n\t *\n\t * **UI guidance**: see [UI Guide — `miniGameWinAcknowledgeRequest`](../../docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param request_id  Correlation id of the spin to finalise: the\n\t *                    `request_id` from a {@link playMiniGame} result\n\t *                    (played with `acknowledge: false`), or the\n\t *                    `client_request_id` of a\n\t *                    {@link getMiniGamesHistory} row.\n\t * @param lose  Optional. When `true`, finalises the spin as\n\t *              lost — the prize is not credited and returns\n\t *              to the prize pool (see \"Finalising as lost\").\n\t *              Omit (or pass `false`) to deliver the win.\n\t *\n\t * @example\n\t * ```ts\n\t * // Primary — finalise a win you played with acknowledge: false.\n\t * const r = await window._smartico.api.playMiniGame(templateId, { acknowledge: false });\n\t * if (r.err_code === 0) {\n\t *   console.log('[smartico] show the prize / Claim CTA; on Claim, finalise the win');\n\t *   await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);\n\t * }\n\t *\n\t * // Decline / forfeit — finalise the same spin as lost instead:\n\t * // the prize is not credited and goes back to the prize pool.\n\t * await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id, { lose: true });\n\t *\n\t * // Recovery — re-acknowledge any spins a batch acknowledge missed.\n\t * const history = await window._smartico.api.getMiniGamesHistory({ limit: 20 });\n\t * for (const row of history.filter(h => !h.is_claimed)) {\n\t *   console.log('[smartico] re-acknowledging stale spin', row.client_request_id);\n\t *   await window._smartico.api.miniGameWinAcknowledgeRequest(row.client_request_id);\n\t * }\n\t * ```\n\t */\n\tpublic async miniGameWinAcknowledgeRequest(request_id: string, { lose }: { lose?: boolean } = {}) {\n\t\treturn this.api.doAcknowledgeRequest(this.userExtId, request_id, lose);\n\t}\n\n\t/**\n\t * Plays a mini-game template `spin_count` times in one round-trip.\n\t * Returns an array of per-spin results — each independent, each\n\t * with its own error code. Like {@link playMiniGame}, the SDK\n\t * auto-acknowledges every result on a fire-and-forget basis.\n\t *\n\t * Use this when a UI offers \"spin N times\" affordances\n\t * (multi-spin buttons, lootbox open-N flows). The server processes\n\t * each spin independently — there is no atomicity / rollback if\n\t * one fails.\n\t *\n\t * @remarks\n\t * **Result shape note** — `TMiniGamePlayBatchResult` uses\n\t * `errCode` / `errMessage` (camelCase) — DIFFERENT from\n\t * {@link TMiniGamePlayResult} which uses `err_code` / `err_message`\n\t * (snake_case). Branch on the camelCase keys when reading batch\n\t * results.\n\t *\n\t * **Per-spin independence**\n\t * The server iterates the requested spins and calls the prize\n\t * engine once per entry. If spin #2 fails with `SAW_NO_SPINS`,\n\t * spin #3 is still attempted — the server does NOT stop on first\n\t * error and does NOT roll back successful spins. Each\n\t * `results[i].errCode` is independent.\n\t *\n\t * Practical implication: if the user has 3 spins available and\n\t * requests 5, expect results 0-2 with `errCode === 0` and results\n\t * 3-4 with `errCode === SAW_NO_SPINS`.\n\t *\n\t * **Error codes**\n\t * Per-result `errCode` is from {@link SAWSpinErrorCode}. See\n\t * {@link playMiniGame} for the full table; the same codes apply\n\t * per spin.\n\t *\n\t * **`first_spin_in_period` field**\n\t * Populated on results where `errCode === SAW_FAILED_MAX_SPINS_REACHED`\n\t * (40004). The value is the epoch-ms timestamp of the user's\n\t * first spin in the current cooldown period. Compute the\n\t * countdown as:\n\t * `template.max_spins_period_ms - (Date.now() - first_spin_in_period)`.\n\t *\n\t * **`jackpot_amount` field**\n\t * Populated on results where the won prize is a jackpot\n\t * (`prize_type === 'jackpot'`). The amount the user just claimed\n\t * from the template's jackpot accumulator.\n\t *\n\t * **Auto-acknowledge**\n\t * The SDK fires a batch-acknowledge for all `request_id`s after\n\t * the batch response lands — fire-and-forget. Same recovery\n\t * semantics as {@link playMiniGame}: lost acknowledgements\n\t * become recoverable via {@link miniGameWinAcknowledgeRequest}\n\t * per row, and a server-side fallback job auto-acknowledges\n\t * stale spins every ~60 seconds.\n\t *\n\t * **Idempotency**: NOT idempotent. A double-click sends two\n\t * batches. Guard the call site with an in-flight flag.\n\t *\n\t * **Refresh after success (and after failure)**\n\t * Same as {@link playMiniGame} — the templates cache refreshes\n\t * and any `onUpdate` callback registered via {@link getMiniGames}\n\t * fires with the updated `spin_count` / `jackpot_current`.\n\t *\n\t * **Side effects** (per-spin, on `errCode === 0`)\n\t * Same as {@link playMiniGame} — buy-in deducted, prize value\n\t * credited per prize type.\n\t *\n\t * **UI guidance**: see [UI Guide — `playMiniGameBatch`](../../docs/ui/minigames/UIGuide_playMiniGameBatch.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param template_id  The mini-game template ID.\n\t * @param spin_count   Number of spins to play. The server attempts\n\t *                     all `spin_count` spins — partial successes\n\t *                     are normal when the user runs out of\n\t *                     balance / spins mid-batch.\n\t * @param params       Optional. Pass an `onUpdate` callback to\n\t *                     subscribe to subsequent template refreshes.\n\t * @returns `TMiniGamePlayBatchResult[]` — one entry per requested\n\t *          spin, in request order. Note the camelCase `errCode` /\n\t *          `errMessage` keys (see \"Result shape note\" above).\n\t *\n\t * @example\n\t * ```ts\n\t * const game = (await window._smartico.api.getMiniGames()).find(g => g.id === templateId);\n\t * if (!game) return;\n\t *\n\t * console.log('[smartico] batch play starting — set in-flight flag, animate the chosen N spins sequentially in UI');\n\t * const results = await window._smartico.api.playMiniGameBatch(game.id, 5);\n\t * console.log('[smartico] batch response received — clear in-flight flag');\n\t *\n\t * for (const [i, r] of results.entries()) {\n\t *   if (r.errCode === 0) {\n\t *     const prize = game.prizes.find(p => p.id === r.saw_prize_id);\n\t *     console.log('[smartico] spin', i, 'won:', prize?.name,\n\t *       r.jackpot_amount ? '(jackpot: ' + r.jackpot_amount + ')' : '');\n\t *   } else if (r.errCode === 40004) {\n\t *     const msTillNext = game.max_spins_period_ms! - (Date.now() - (r.first_spin_in_period ?? 0));\n\t *     console.log('[smartico] spin', i, 'capped — ' + Math.ceil(msTillNext / 1000) + ' s until next allowed');\n\t *   } else {\n\t *     console.error('[smartico] spin', i, 'failed —', r.errCode, r.errMessage);\n\t *   }\n\t * }\n\t * ```\n\t */\n\tpublic async playMiniGameBatch(\n\t\ttemplate_id: number,\n\t\tspin_count: number,\n\t\t{ onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {},\n\t): Promise<TMiniGamePlayBatchResult[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);\n\t\t}\n\n\t\tconst response = await this.api.sawSpinBatchRequest(this.userExtId, template_id, spin_count);\n\n\t\tconst request_ids = response.results.map((result) => result.request_id);\n\t\tthis.api.doAcknowledgeBatchRequest(this.userExtId, request_ids);\n\n\t\tconst o: TMiniGamePlayBatchResult[] = response.results.map((result) => ({\n\t\t\terrCode: result.errCode,\n\t\t\terrMessage: result.errMsg,\n\t\t\tsaw_prize_id: result.saw_prize_id,\n\t\t\tjackpot_amount: result.jackpot_amount,\n\t\t\tfirst_spin_in_period: result.first_spin_in_period,\n\t\t}));\n\n\t\treturn o;\n\t}\n\n\tprotected async updateOnSpin(data: SAWSpinsCountPush) {\n\t\tconst templates: TMiniGameTemplate[] = await OCache.use(\n\t\t\tonUpdateContextKey.Saw,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.sawGetTemplatesT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t\tconst index = templates.findIndex((t) => t.id === data.saw_template_id);\n\t\tif (index === -1) {\n\t\t\treturn;\n\t\t}\n\t\ttemplates[index].spin_count = data.spin_count;\n\t\tthis.updateEntity(onUpdateContextKey.Saw, templates);\n\t}\n\n\tprotected async reloadMiniGameTemplate() {\n\t\tconst updatedTemplates = await this.api.sawGetTemplatesT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.Saw, updatedTemplates);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tTAvatarDefinition,\n\tTAvatarCustomized,\n\tTAvatarPrompt,\n\tTSetAvatarResult,\n} from './WSAPITypes';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIMiniGames } from './WSAPIMiniGames';\nimport { AvatarCustomizeResponse } from '../Avatars/AvatarCustomizeResponse';\n\n/** @group Avatars */\nexport class WSAPIAvatars extends WSAPIMiniGames {\n\t/**\n\t * Returns the avatar catalog available to the current user — every pre-defined\n\t * avatar configured for the label, with per-user unlock flags (`is_given`, `is_in_use`)\n\t * applied server-side.\n\t *\n\t * The returned `avatar_url` is the absolute CDN URL (the SDK prefixes relative paths\n\t * with the configured avatar domain). AI-customized variants are NOT returned here —\n\t * those live in {@link getAvatarsCustomized}.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - No other prerequisite calls.\n\t *\n\t * **Visibility filter** (consumer-applied)\n\t * Avatars with `hide_until_achieved === true && is_given === false` should be filtered\n\t * out of the grid — they represent surprise unlocks that should remain hidden until\n\t * the user earns them. The default Smartico UI drops these before rendering.\n\t *\n\t * **Lock state** (consumer-applied)\n\t * Lock condition: `!is_given && avatar_source_type_id !== 0`. Free avatars\n\t * (`avatar_source_type_id === 0`) are always selectable; non-free avatars are locked\n\t * until `is_given` flips to true (operator grants via campaign, mission reward, store\n\t * purchase, etc.).\n\t *\n\t * **Sort order**\n\t * Server does NOT pre-sort. Caller must sort by `priority` ascending (lower = first).\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - {@link setAvatar} clears this cache on completion; the next call re-fetches.\n\t * - No push subscription — there is no `onUpdate` callback for avatar methods.\n\t * - When `is_given` flips server-side (e.g. the user earns a new avatar), the change\n\t *   surfaces only on the next call after the 30-second cache window expires.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAvatarsList`](../../docs/ui/avatars/UIGuide_getAvatarsList.md).\n\t *\n\t * @returns Array of {@link TAvatarDefinition} — empty array if the feature is disabled\n\t * on the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const avatars = await window._smartico.api.getAvatarsList();\n\t *\n\t * // Apply the standard visibility filter and sort.\n\t * const visible = avatars\n\t *     .filter((a) => !a.hide_until_achieved || a.is_given)\n\t *     .sort((a, b) => a.priority - b.priority);\n\t *\n\t * console.log('[smartico] visible avatars:', visible.length, '— render as a grid');\n\t *\n\t * const active = visible.find((a) => a.is_in_use);\n\t * if (active) {\n\t *     console.log('[smartico] currently in use — overlay a checkmark on this card:', active.avatar_real_id);\n\t * }\n\t * ```\n\t */\n\tpublic async getAvatarsList(): Promise<TAvatarDefinition[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AvatarsList,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.avatarsGetListT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the user's previously generated AI-customized avatar variants.\n\t *\n\t * Each entry is one AI-generated image derived from a base avatar in the catalog\n\t * (the base is identified by `avatar_real_id` and was originally a\n\t * {@link TAvatarDefinition} from {@link getAvatarsList}). These variants are stored\n\t * server-side under the user record and persist across sessions.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - Has meaning only after at least one successful AI customization run (see below).\n\t *   New users get an empty array.\n\t *\n\t * **Where customized avatars come from**\n\t * AI customization is **not** a WebSocket method on this SDK. It is a separate HTTP\n\t * POST to the operator-configured `avatar-customize` endpoint that takes a base avatar\n\t * plus a style prompt from {@link getAvatarPrompts} and returns a generated CDN URL.\n\t * Once that POST resolves successfully, the new variant is persisted and surfaces in\n\t * the next `getAvatarsCustomized()` call. The variant URL can then be passed to\n\t * {@link setAvatar} to activate it.\n\t *\n\t * **Relation to `getAvatarsList`**\n\t * AI variants do NOT appear in {@link getAvatarsList}. Catalog and variants are two\n\t * separate collections — combine them client-side if the UI needs a unified view per\n\t * base avatar.\n\t *\n\t * **Sort order**\n\t * Server does NOT pre-sort. Caller typically sorts by `dt_created` descending to show\n\t * the newest variant first.\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - {@link setAvatar} clears this cache on completion.\n\t * - After a successful AI customization POST, the consumer should re-call to surface\n\t *   the new variant — the customization endpoint is outside the SDK so the SDK cannot\n\t *   auto-invalidate.\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAvatarsCustomized`](../../docs/ui/avatars/UIGuide_getAvatarsCustomized.md).\n\t *\n\t * @returns Array of {@link TAvatarCustomized} — empty if the user has never run AI\n\t * customization, or if the feature is disabled on the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const variants = await window._smartico.api.getAvatarsCustomized();\n\t *\n\t * // Group by the base avatar so the UI can show \"this base has 3 AI variants\".\n\t * const byBase = new Map<number, typeof variants>();\n\t * for (const v of variants) {\n\t *     const list = byBase.get(v.avatar_real_id) ?? [];\n\t *     list.push(v);\n\t *     byBase.set(v.avatar_real_id, list);\n\t * }\n\t *\n\t * // Newest-first within each base.\n\t * for (const list of byBase.values()) {\n\t *     list.sort((a, b) => b.dt_created - a.dt_created);\n\t * }\n\t *\n\t * console.log('[smartico] AI variants by base avatar — render as a carousel under each base');\n\t * ```\n\t */\n\tpublic async getAvatarsCustomized(): Promise<TAvatarCustomized[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AvatarsCustomized,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.avatarsGetCustomizedT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the catalog of AI style prompts available for avatar customization.\n\t *\n\t * Each entry is a \"style\" the user can apply to a base avatar (e.g. \"Cartoon\",\n\t * \"Watercolor\", \"Cyberpunk\"). Prompts carry a cost expressed in points, gems, or\n\t * diamonds — applying a prompt deducts the cost server-side as part of the AI\n\t * generation request.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - No other prerequisite calls. The customization UI typically calls this on demand\n\t *   when the user opens the style picker, not on app boot.\n\t *\n\t * **Cost handling**\n\t * Each prompt declares `cost_currency_type_id` (0 = points, 1 = gems, 2 = diamonds)\n\t * and `cost_value` (amount). The deduction happens server-side inside the\n\t * `avatar-customize` HTTP POST (the AI generation request, which is NOT part of this\n\t * SDK). The client should compare `cost_value` against the live balance from\n\t * {@link getUserProfile} to disable prompts the user cannot afford, but the server is\n\t * the source of truth and will reject under-funded requests authoritatively.\n\t *\n\t * **Refresh**\n\t * - The SDK caches results for 30 seconds.\n\t * - Not invalidated by {@link setAvatar} (prompts are catalog metadata, independent\n\t *   of the user's active avatar).\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `getAvatarPrompts`](../../docs/ui/avatars/UIGuide_getAvatarPrompts.md).\n\t *\n\t * @returns Array of {@link TAvatarPrompt} — empty if the AI customization feature is\n\t * disabled on the label.\n\t *\n\t * @example\n\t * ```ts\n\t * const [prompts, profile] = await Promise.all([\n\t *     window._smartico.api.getAvatarPrompts(),\n\t *     window._smartico.api.getUserProfile(),\n\t * ]);\n\t *\n\t * for (const p of prompts) {\n\t *     // The consumer reads the matching balance from profile based on\n\t *     // p.cost_currency_type_id (0=points, 1=gems, 2=diamonds).\n\t *     console.log('[smartico] prompt', p.name, '— cost', p.cost_value, 'currency_type', p.cost_currency_type_id);\n\t * }\n\t * ```\n\t */\n\tpublic async getAvatarPrompts(): Promise<TAvatarPrompt[]> {\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.AvatarPrompts,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.avatarsGetPromptsT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Activates the specified avatar for the current user. The chosen image becomes the\n\t * profile avatar — any subsequent {@link getUserProfile} call will reflect the new\n\t * `avatar_url`.\n\t *\n\t * Pass `avatar_url` (a {@link TAvatarDefinition.url} from the catalog or a\n\t * {@link TAvatarCustomized.url} from the AI-variant list) plus `avatar_real_id` of the\n\t * base avatar. The server validates ownership before applying — locked avatars are\n\t * rejected.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode is not supported.\n\t * - `avatar_url` must be non-empty and `avatar_real_id` must be truthy — the SDK\n\t *   throws synchronously otherwise (the request never reaches the server).\n\t * - The avatar must exist in the catalog from {@link getAvatarsList} (or be an AI\n\t *   variant of a base avatar the user already owns). Free avatars\n\t *   (`avatar_source_type_id === 0`) and the user's currently active avatar bypass the\n\t *   ownership check; all others require `is_given === true`.\n\t *\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; cache is cleared and the profile avatar updates immediately.\n\t * - `1` — avatar not found in the catalog. The `avatar_real_id` doesn't exist for\n\t *   this label.\n\t * - `2` — avatar inactive (deactivated by the operator).\n\t * - `3` — outside the avatar's active time window\n\t *   (`active_from_date` / `active_till_date`).\n\t * - `4` — user does not own this avatar (it isn't in their `is_given` set and isn't\n\t *   a free / default avatar).\n\t * - other non-zero — generic server error; surface `err_message` if present.\n\t *\n\t * The default Smartico UI shows a hardcoded \"Failed to apply avatar\" toast on any\n\t * non-zero `err_code` and does not surface `err_message`. Custom UIs SHOULD branch\n\t * on the code and prefer `err_message` when present (it is the localized server\n\t * string).\n\t *\n\t * **Refresh after success**\n\t * - The SDK clears both the `getAvatarsList` and `getAvatarsCustomized` caches —\n\t *   the next call to either returns fresh data with the new `is_in_use` flag set on\n\t *   the chosen avatar.\n\t * - The server persists the new avatar URL on the user record; {@link getUserProfile}\n\t *   reflects it on the next read in this session.\n\t * - **No push to other open sessions.** A second device / tab the user is logged in\n\t *   on will not see the new avatar until it next calls {@link getUserProfile} or\n\t *   re-identifies. Plan UI accordingly.\n\t *\n\t * **Idempotency**: safe to retry. Re-applying the same `avatar_real_id` returns\n\t * `err_code: 0` and produces no double side effects (no double-deduction — this\n\t * method does not charge any currency — and no duplicate log entries).\n\t *\n\t * **Side effects**: updates the user's stored `avatar_id` / `avatar_real_id`. Does\n\t * NOT cost points, gems, or diamonds — the cost lives on the separate AI\n\t * customization HTTP flow ({@link getAvatarPrompts}). Does NOT write a user-visible\n\t * entry to {@link getActivityLog}.\n\t *\n\t * **UI guidance**: see [UI Guide — `setAvatar`](../../docs/ui/avatars/UIGuide_setAvatar.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param props.avatar_url       Absolute CDN URL of the avatar image. Read from\n\t *                                {@link TAvatarDefinition.url} for catalog avatars or\n\t *                                {@link TAvatarCustomized.url} for AI variants.\n\t * @param props.avatar_real_id   Numeric ID of the base avatar from\n\t *                                {@link TAvatarDefinition.avatar_real_id}. For AI\n\t *                                variants, this is the `avatar_real_id` of the base\n\t *                                they were derived from.\n\t * @returns {@link TSetAvatarResult} — check `err_code === 0` for success.\n\t *\n\t * @example\n\t * ```ts\n\t * const avatars = await window._smartico.api.getAvatarsList();\n\t * const target = avatars.find((a) => a.avatar_real_id === 7);\n\t *\n\t * if (!target) {\n\t *     console.error('[smartico] avatar 7 not in catalog — hide the picker entry');\n\t *     return;\n\t * }\n\t *\n\t * const isLocked = !target.is_given && target.avatar_source_type_id !== 0;\n\t * if (isLocked) {\n\t *     console.log('[smartico] avatar is locked — show \"earn this first\" prompt instead of calling setAvatar');\n\t *     return;\n\t * }\n\t *\n\t * const r = await window._smartico.api.setAvatar({\n\t *     avatar_url:     target.avatar_url,\n\t *     avatar_real_id: target.avatar_real_id,\n\t * });\n\t *\n\t * switch (r.err_code) {\n\t *     case 0:\n\t *         console.log('[smartico] avatar applied — close picker, refresh header avatar');\n\t *         break;\n\t *     case 1:\n\t *         console.error('[smartico] avatar not in catalog — refresh catalog and show error');\n\t *         break;\n\t *     case 2:\n\t *         console.error('[smartico] avatar inactive — operator disabled it; hide from picker');\n\t *         break;\n\t *     case 3:\n\t *         console.error('[smartico] outside time window — show \"available on X\" message');\n\t *         break;\n\t *     case 4:\n\t *         console.error('[smartico] not owned — show unlock requirements');\n\t *         break;\n\t *     default:\n\t *         console.error('[smartico] avatar apply failed — show generic error toast:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async setAvatar(props: { avatar_url: string; avatar_real_id: number }): Promise<TSetAvatarResult> {\n\t\tif (!props.avatar_url) {\n\t\t\tthrow new Error('avatar_url is required');\n\t\t}\n\t\tif (!props.avatar_real_id) {\n\t\t\tthrow new Error('avatar_real_id is required');\n\t\t}\n\n\t\tconst r = await this.api.avatarSetAvatar(this.userExtId, props.avatar_url, props.avatar_real_id);\n\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.AvatarsList);\n\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.AvatarsCustomized);\n\n\t\treturn {\n\t\t\terr_code: r.errCode ?? 0,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Generates an AI-customized variant of a base avatar by applying an\n\t * operator-defined style prompt, returning the CDN URL of the result.\n\t * This is a paid, generate-only step: it does NOT change the user's\n\t * active avatar — pass the returned `cdn_url` to {@link setAvatar} to\n\t * activate it.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - Authenticated session required; not available in visitor mode (throws).\n\t * - All five fields are mandatory — the SDK throws synchronously\n\t *   (`Error(\"<field> is required\")`) if any is missing or zero.\n\t * - `prompt_id` must be one of the prompts from {@link getAvatarPrompts};\n\t *   `avatar_url` / `avatar_real_id` identify the base avatar to style.\n\t *\n\t * **Cost**\n\t * Each generation costs the currency the operator configured on the\n\t * chosen prompt (points, gems, or diamonds — some prompts are free; read\n\t * `cost_currency_type_id` / `cost_value` from the {@link getAvatarPrompts}\n\t * entry to gate the UI before calling). The cost is charged only on\n\t * success; if the user can't afford it the call fails with `errCode -1`\n\t * and nothing is generated or charged.\n\t *\n\t * **Latency**\n\t * Generation runs server-side AI image synthesis and is synchronous from\n\t * the caller's side — expect several seconds (roughly 5–20 s) before the\n\t * promise resolves. There is no SDK cache and no push/subscription; show\n\t * a loading state for the full duration and disable the trigger to\n\t * prevent duplicate submissions.\n\t *\n\t * **Result & error codes**\n\t * On success the result has `cdn_url` set; on failure it has `errCode` /\n\t * `errMessage` set and no `cdn_url`. Branch on `errCode` — the generic\n\t * message is fixed text, not cause-specific:\n\t * - `12001` (`AvatarCustomizeErrorCode.AVATAR_USER_LIMIT`) — the user hit\n\t *   their monthly per-user generation cap. Nothing is generated or charged.\n\t * - `12002` (`AvatarCustomizeErrorCode.AVATAR_LABEL_LIMIT`) — the brand's\n\t *   shared monthly pool is exhausted. Nothing is generated or charged;\n\t *   surface a \"try again later\" message.\n\t * - `-1` — generic failure: insufficient balance, an unavailable prompt,\n\t *   or a generation error. Nothing is charged. Allow the user to retry.\n\t *\n\t * Both monthly caps are operator-configured and reset at the start of\n\t * each calendar month.\n\t *\n\t * **Side effects (on success)**\n\t * The generated variant is persisted to the user's customization history\n\t * and counts toward the monthly caps **whether or not** it is later\n\t * activated — generation is not reversible. The SDK clears the\n\t * {@link getAvatarsCustomized} cache so the next call surfaces the new\n\t * variant. The user's active avatar is unchanged until you call\n\t * {@link setAvatar} with the returned `cdn_url`.\n\t *\n\t * **Idempotency**: not idempotent — each successful call generates (and\n\t * charges for) a new variant. Guard the call site against double-clicks.\n\t *\n\t * **UI guidance**: see [UI Guide — `avatarsCustomize`](../../docs/ui/avatars/UIGuide_avatarsCustomize.md).\n\t *\n\t * **Visitor mode**: not supported (throws).\n\t *\n\t * @param props.user_id         Numeric Smartico user ID.\n\t * @param props.prompt_id       Style-prompt ID (`prompt_id`) from {@link getAvatarPrompts}.\n\t * @param props.avatar_url      CDN URL of the base avatar to customize.\n\t * @param props.avatar_real_id  `avatar_real_id` of the base avatar.\n\t * @returns {@link AvatarCustomizeResponse} — `cdn_url` set on success;\n\t *          `errCode` / `errMessage` set on failure.\n\t *\n\t * @example\n\t * ```ts\n\t * // user_id identifies the Smartico user being customized.\n\t * const prompts = await window._smartico.api.getAvatarPrompts();\n\t * const prompt = prompts[0];\n\t *\n\t * console.log('[smartico] generating avatar — show a spinner for ~5-20s and disable the Generate button');\n\t * const result = await window._smartico.api.avatarsCustomize({\n\t *   user_id,\n\t *   prompt_id: prompt.prompt_id,\n\t *   avatar_url: baseAvatar.avatar_url,\n\t *   avatar_real_id: baseAvatar.avatar_real_id,\n\t * });\n\t *\n\t * if (result.cdn_url) {\n\t *   console.log('[smartico] generation succeeded — preview this URL, then call setAvatar to apply it:', result.cdn_url);\n\t *   // await window._smartico.api.setAvatar({ avatar_url: result.cdn_url, avatar_real_id: baseAvatar.avatar_real_id });\n\t * } else if (result.errCode === 12001) {\n\t *   console.error('[smartico] user monthly limit reached — show \"you have used all your custom avatars this month\"');\n\t * } else if (result.errCode === 12002) {\n\t *   console.error('[smartico] brand monthly pool exhausted — show \"custom avatars are unavailable right now, try later\"');\n\t * } else {\n\t *   console.error('[smartico] generation failed (e.g. not enough balance) — let the user retry:', result.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async avatarsCustomize(props: {\n\t\tuser_id: number;\n\t\tprompt_id: number;\n\t\tavatar_url: string;\n\t\tavatar_real_id: number;\n\t}): Promise<AvatarCustomizeResponse> {\n\t\tconst required: (keyof typeof props)[] = ['user_id', 'prompt_id', 'avatar_url', 'avatar_real_id'];\n\t\tfor (const field of required) {\n\t\t\tif (!props[field]) {\n\t\t\t\tthrow new Error(`${field} is required`);\n\t\t\t}\n\t\t}\n\n\t\tconst r = await this.api.avatarsCustomize(props);\n\n\t\t// On success a new variant is persisted server-side — drop the cached\n\t\t// list so the next getAvatarsCustomized() surfaces it.\n\t\tif (r.cdn_url) {\n\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.AvatarsCustomized);\n\t\t}\n\n\t\treturn r;\n\t}\n}\n","import { GamePickGameInfo, GamePickRequestParams, GamePickRound, GamePickRoundBoard, GamePickRoundRequestParams, GamePickUserInfo, GamesApiResponse } from '../GamePick';\nimport { WSAPIAvatars } from './WSAPIAvatars';\n\n/** @group GamePick */\nexport class WSAPIGamePick extends WSAPIAvatars {\n\t/**\n\t * Returns every open round for a MatchX or Quiz game template, with the full\n\t * event list (matches / questions) and the current user's selections per event.\n\t *\n\t * Use to power the rounds-lobby screen — typically a list of round cards a user\n\t * can tap into to make predictions. For a single round, use\n\t * {@link gamePickGetActiveRound} (lighter payload when only one round is shown).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated.\n\t * - `saw_template_id` must reference a MatchX or Quiz game template. The SDK\n\t *   throws synchronously if it's missing.\n\t *\n\t * **Transport**\n\t * Game Pick methods are HTTP REST calls to a separate Game Pick games server\n\t * (not the main WebSocket). One consequence: there is no SDK cache and no push\n\t * subscription — every call is a fresh server roundtrip.\n\t *\n\t * **Round status**\n\t * Each round's `round_status_id` is a {@link GPRoundStatus} value. Rounds with\n\t * status `NoEventsDefined` (1) are filtered out server-side and never appear\n\t * here. Other values: `Other` (-1, normally open), `NoMoreBetsAllowed` (2),\n\t * `AllEventsResolved_ButNotRound` (3), `RoundResolved` (4 — appears here only\n\t * briefly during transition; use {@link gamePickGetHistory} for resolved rounds).\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found (the `saw_template_id` doesn't reference a\n\t *   MatchX/Quiz game).\n\t * - `100003` — no open rounds available for this template right now.\n\t * - `100000` — auth hash invalid; SDK session needs re-initialization.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache; every call is live.\n\t * - No push subscription. Poll while the user is on the screen if you need\n\t *   live round-status changes (typically every 30–60 s is enough).\n\t *\n\t * **Visitor mode**: not supported. The SDK throws synchronously on visitor\n\t * sessions.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetActiveRounds`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md).\n\t *\n\t * @param props.saw_template_id  ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetActiveRounds({ saw_template_id: 1083 });\n\t *\n\t * if (r.errCode !== 0) {\n\t *     console.error('[smartico] active rounds fetch failed — show empty rounds lobby:', r.errMessage);\n\t *     return;\n\t * }\n\t *\n\t * for (const round of r.data ?? []) {\n\t *     console.log('[smartico] render a round card:', round.round_name, '— events:', round.events.length, 'user has placed bet:', round.user_placed_bet);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetActiveRounds(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns a single round (events, user selections, scoring rules) for a\n\t * MatchX or Quiz game. Use to power the round-detail / prediction-input\n\t * screen the user lands on after picking a round from the lobby.\n\t *\n\t * Same shape as one entry of {@link gamePickGetActiveRounds}; cheaper when the\n\t * UI only shows one round at a time.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id` and `round_id` are mandatory — the SDK throws if either\n\t *   is missing.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `4` — round / event not found (e.g. round resolved after the last\n\t *   `gamePickGetActiveRounds` poll); non-fatal — retry after a fresh active-\n\t *   rounds fetch.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache; every call is live.\n\t * - Re-call after {@link gamePickSubmitSelection} or\n\t *   {@link gamePickSubmitSelectionQuiz} to surface the persisted predictions.\n\t * - Poll while the user is on the prediction screen if event resolution\n\t *   updates are needed (typically every 30–60 s).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetActiveRound`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md).\n\t *\n\t * @param props.saw_template_id  ID of the MatchX or Quiz game template.\n\t * @param props.round_id         ID of the round to fetch.\n\t * @returns Wrapped {@link GamesApiResponse} of a single {@link GamePickRound}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetActiveRound({\n\t *     saw_template_id: 1083,\n\t *     round_id:        31652,\n\t * });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t *     console.log('[smartico] render round detail page —', r.data.round_name, '— user has placed bet:', r.data.user_placed_bet, 'score so far:', r.data.user_score);\n\t * } else {\n\t *     console.error('[smartico] round fetch failed — bounce back to the lobby and refresh:', r.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round_id) {\n\t\t\tthrow new Error('round_id is required');\n\t\t}\n\t\treturn this.api.gpGetActiveRound(props.saw_template_id, props.round_id);\n\t}\n\n\t/**\n\t * Returns the full round history (active + resolved) for a MatchX or Quiz game\n\t * template, newest-first. Each round carries the user's predictions plus the\n\t * server-resolved outcome on each event.\n\t *\n\t * Use to power a \"Past predictions\" / history tab. For just the open rounds,\n\t * use {@link gamePickGetActiveRounds} (faster — skips resolved data).\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **Sort order**\n\t * Server returns rounds newest-first. No client-side sort needed.\n\t *\n\t * **Per-event resolution**\n\t * Each event in the rounds carries `resolution_type_id` — values are from\n\t * {@link GamePickResolutionType}: `None` (0, not yet resolved), `Lost` (2),\n\t * `PartialWin` (3), `FullWin` (4). Use these to render result badges on\n\t * each event row.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache.\n\t * - No push subscription. Re-call when the user opens the history tab.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetHistory`](../../docs/ui/gamepick/UIGuide_gamePickGetHistory.md).\n\t *\n\t * @param props.saw_template_id  ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array,\n\t * newest-first.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetHistory({ saw_template_id: 1083 });\n\t *\n\t * for (const round of r.data ?? []) {\n\t *     console.log('[smartico] history row —', round.round_name, 'score:', round.user_score, 'resolved:', round.is_resolved);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetGamesHistory(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns the leaderboard for a MatchX or Quiz game round — ranked list of\n\t * players plus the current user's entry (`my_user`). Pass `round_id: -1` for\n\t * the season / overall leaderboard across every round in the template.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **`round_id` semantics**\n\t * - Positive `round_id` — per-round leaderboard scoped to that round's events.\n\t * - `-1` — season / overall leaderboard aggregating scores across every round\n\t *   of the template.\n\t *\n\t * **`my_user`**\n\t * The current user's entry is returned separately from the `users[]` array\n\t * — `my_user` may be `null` if the user has never made a prediction on this\n\t * round / template. Use it to render the user's rank in a sticky footer or\n\t * \"you are here\" highlight regardless of pagination.\n\t *\n\t * **Username masking**\n\t * `public_username` on other players may be masked / anonymized by operator\n\t * label settings. Always pair with `avatar_url` so the user can recognize\n\t * themselves in the ranking by avatar even when usernames are hidden.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache.\n\t * - No push subscription. Poll while the leaderboard is visible\n\t *   (every 30–60 s) if you want live rank updates after match\n\t *   resolution.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetBoard`](../../docs/ui/gamepick/UIGuide_gamePickGetBoard.md).\n\t *\n\t * @param props.saw_template_id  ID of the MatchX or Quiz game template.\n\t * @param props.round_id         Round ID, or `-1` for the season leaderboard.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRoundBoard}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetBoard({\n\t *     saw_template_id: 1083,\n\t *     round_id:        -1, // season leaderboard\n\t * });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t *     console.log('[smartico] render leaderboard rows for top', r.data.users.length, 'players');\n\t *     if (r.data.my_user) {\n\t *         console.log('[smartico] pin \"you are rank #' + r.data.my_user.gp_position + '\" footer to bottom');\n\t *     } else {\n\t *         console.log('[smartico] user not ranked — render \"Play a round to join the leaderboard\" CTA');\n\t *     }\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round_id) {\n\t\t\tthrow new Error('round_id is required');\n\t\t}\n\t\treturn this.api.gpGetGameBoard(props.saw_template_id, props.round_id);\n\t}\n\n\t/**\n\t * Submits all score predictions for a round in a MatchX game in one shot.\n\t * Each event in the round must carry `team1_user_selection` and\n\t * `team2_user_selection` (the predicted scores).\n\t *\n\t * On the user's FIRST submit for a round, the server charges one buy-in (one\n\t * \"spin\" / one currency deduction based on the template's `saw_buyin_type_id`).\n\t * Subsequent edits within the same round are free and only persist changed\n\t * selections.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id` and `props.round.round_id` are mandatory — SDK throws if\n\t *   either is missing.\n\t * - Each event passed must include `gp_event_id` and the two\n\t *   `team{1,2}_user_selection` fields. Missing events default to \"no change\".\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success; the response `data` is the updated round with\n\t *   `user_placed_bet === true` and `has_not_submitted_changes === false`.\n\t * - `3` (`NoBetsUpdatedOnSubmit`) — submit produced no changes, OR every event\n\t *   is past its `last_bet_date` deadline. The buy-in is NOT consumed; the\n\t *   current round is still returned in `data`.\n\t * - `4` — round / event not found; refresh state and retry.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * Buy-in failures pass through the {@link SAWSpinErrorCode} values on first\n\t * submit:\n\t * - `40001` — no spins left (when `saw_buyin_type_id` is Spins).\n\t * - `40003` — insufficient points.\n\t * - `40004` — global max-spins cap hit.\n\t * - `40007` — template outside its active date window.\n\t * - `40009` — user excluded by segment rule.\n\t * - `40011` — insufficient gems.\n\t * - `40012` — insufficient diamonds.\n\t *\n\t * **Idempotency**\n\t * Re-submitting identical selections returns `errCode: 3` (no changes); the\n\t * buy-in is consumed exactly once per round-per-user. Re-submitting after\n\t * `last_bet_date` also returns `errCode: 3` without consuming the buy-in.\n\t *\n\t * **Side effects**\n\t * - First successful submit deducts the buy-in (Points / Gems / Diamonds /\n\t *   one Spin) per `saw_buyin_type_id`.\n\t * - Records the user's participation against the round and its events\n\t *   server-side and reports a prediction event to the operator's activity\n\t *   stream.\n\t * - Score is awarded after the operator resolves the round\n\t *   ({@link GPRoundStatus} = `RoundResolved`).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickSubmitSelection`](../../docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md).\n\t *\n\t * @param props.saw_template_id  ID of the MatchX game template.\n\t * @param props.round            Round object with `round_id` + `events[]`\n\t *                                carrying the user's score predictions.\n\t * @returns Wrapped {@link GamesApiResponse} with the updated round.\n\t *\n\t * @example\n\t * ```ts\n\t * const ar = await window._smartico.api.gamePickGetActiveRound({\n\t *     saw_template_id: 1190,\n\t *     round_id:        38665,\n\t * });\n\t * if (ar.errCode !== 0 || !ar.data) {\n\t *     console.error('[smartico] could not fetch round to submit — show error and bounce back');\n\t *     return;\n\t * }\n\t *\n\t * const round = ar.data;\n\t * round.events = round.events.map(e => ({\n\t *     gp_event_id:          e.gp_event_id,\n\t *     team1_user_selection: 1,\n\t *     team2_user_selection: 0,\n\t * }));\n\t *\n\t * const r = await window._smartico.api.gamePickSubmitSelection({\n\t *     saw_template_id: 1190,\n\t *     round,\n\t * });\n\t *\n\t * switch (r.errCode) {\n\t *     case 0:\n\t *         console.log('[smartico] predictions saved — show confirmation, refresh leaderboard');\n\t *         break;\n\t *     case 3:\n\t *         console.log('[smartico] nothing changed (or all events closed) — silent no-op');\n\t *         break;\n\t *     case 40001:\n\t *     case 40003:\n\t *     case 40011:\n\t *     case 40012:\n\t *         console.error('[smartico] insufficient balance / spins — show top-up CTA:', r.errMessage);\n\t *         break;\n\t *     default:\n\t *         console.error('[smartico] submit failed — show generic error toast:', r.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickSubmitSelection(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round?.round_id) {\n\t\t\tthrow new Error('round is required');\n\t\t}\n\t\treturn this.api.gpSubmitSelection(props.saw_template_id, props.round, false);\n\t}\n\n\t/**\n\t * Submits all quiz answers for a round in one shot. Each event in the round\n\t * must carry `user_selection` (the answer value — typically `\"1\"` / `\"2\"` /\n\t * `\"x\"` for 1×2 markets, `\"yes\"` / `\"no\"` for binary markets, or any\n\t * operator-defined string for custom markets).\n\t *\n\t * Same first-submit buy-in behavior as {@link gamePickSubmitSelection} — one\n\t * buy-in is charged on the first successful submit; subsequent edits within\n\t * the same round are free.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id` and `props.round.round_id` are mandatory — SDK throws if\n\t *   either is missing.\n\t * - Each event must include `gp_event_id` and `user_selection`. Missing\n\t *   events default to \"no change\".\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `3` (`NoBetsUpdatedOnSubmit`) — no changes, OR every event past\n\t *   `last_bet_date`. Buy-in NOT consumed; current round returned in `data`.\n\t * - `4` — round / event not found.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * Buy-in failures use the same {@link SAWSpinErrorCode} pass-through values\n\t * as {@link gamePickSubmitSelection} — see that method's TSDoc for the\n\t * `40001` / `40003` / `40004` / `40007` / `40009` / `40011` / `40012`\n\t * semantics.\n\t *\n\t * **Idempotency**: identical to {@link gamePickSubmitSelection} — re-submit\n\t * returns `errCode: 3` and never double-charges the buy-in.\n\t *\n\t * **Side effects**: identical to {@link gamePickSubmitSelection} — buy-in\n\t * deduction on first submit, participation recorded, score awarded on round\n\t * resolution.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickSubmitSelectionQuiz`](../../docs/ui/gamepick/UIGuide_gamePickSubmitSelectionQuiz.md).\n\t *\n\t * @param props.saw_template_id  ID of the Quiz game template.\n\t * @param props.round            Round object with `round_id` + `events[]`\n\t *                                carrying the user's answer selections.\n\t * @returns Wrapped {@link GamesApiResponse} with the updated round.\n\t *\n\t * @example\n\t * ```ts\n\t * const ar = await window._smartico.api.gamePickGetActiveRound({\n\t *     saw_template_id: 1183,\n\t *     round_id:        37974,\n\t * });\n\t * if (ar.errCode !== 0 || !ar.data) {\n\t *     console.error('[smartico] could not fetch round to submit answers — show error');\n\t *     return;\n\t * }\n\t *\n\t * const round = ar.data;\n\t * round.events = round.events.map(e => ({\n\t *     gp_event_id:    e.gp_event_id,\n\t *     user_selection: 'x',\n\t * }));\n\t *\n\t * const r = await window._smartico.api.gamePickSubmitSelectionQuiz({\n\t *     saw_template_id: 1183,\n\t *     round,\n\t * });\n\t *\n\t * if (r.errCode === 0) {\n\t *     console.log('[smartico] quiz answers saved — show confirmation');\n\t * } else if (r.errCode === 3) {\n\t *     console.log('[smartico] nothing changed — silent no-op');\n\t * } else {\n\t *     console.error('[smartico] quiz submit failed:', r.errMessage);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickSubmitSelectionQuiz(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round?.round_id) {\n\t\t\tthrow new Error('round is required');\n\t\t}\n\t\treturn this.api.gpSubmitSelection(props.saw_template_id, props.round, true);\n\t}\n\n\t/**\n\t * Returns the current user's profile within the Game Pick system — display\n\t * name, avatar, balances, and last wallet-sync timestamp. The Game Pick server\n\t * maintains its own user record that mirrors the user's Smartico balances; the\n\t * mirror is updated at most once per minute, so `last_wallet_sync_time` tells\n\t * the consumer how stale the balances on the response are.\n\t *\n\t * On the user's first call for a given game, the Game Pick server lazily\n\t * provisions a user record — so this method doubles as a \"register the user\n\t * with this game\" call.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **Balance freshness**\n\t * The balances returned here are the cached mirror — at most ~1 minute stale.\n\t * For an up-to-the-second view of Points / Gems / Diamonds, read from\n\t * {@link getUserProfile} instead. Use this method's balances only for\n\t * in-Game-Pick display.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache. Server-side mirror refreshes at most every 60 s.\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetUserInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md).\n\t *\n\t * @param props.saw_template_id  ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickUserInfo}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetUserInfo({ saw_template_id: 1083 });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t *     console.log('[smartico] render Game Pick header — name:', r.data.public_username, '— points:', r.data.ach_points_balance, '— synced:', r.data.last_wallet_sync_time);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetUserInfo(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns the game template configuration plus a metadata listing of every\n\t * round (without events). Use to power the game's welcome / lobby screen —\n\t * shows the template name, buy-in cost, the user's remaining attempts, and\n\t * the full round list.\n\t *\n\t * The `allRounds[]` here is a lightweight metadata-only view — to render\n\t * predictions or leaderboards, call {@link gamePickGetActiveRound} /\n\t * {@link gamePickGetActiveRounds} / {@link gamePickGetBoard} for the rounds\n\t * the user actually opens.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t *\n\t * **Buy-in semantics**\n\t * The `sawTemplate.saw_buyin_type_id` value determines which currency is\n\t * deducted on the user's first prediction in any round:\n\t * - Free — no deduction.\n\t * - Points — `buyin_cost_points` deducted from the user's points balance.\n\t * - Gems — deducted from the user's gems balance.\n\t * - Diamonds — deducted from the user's diamonds balance.\n\t * - Spins — one spin counted from `spin_count`.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache.\n\t * - No push subscription. Re-call after a successful\n\t *   {@link gamePickSubmitSelection} to refresh `spin_count`.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetGameInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md).\n\t *\n\t * @param props.saw_template_id  ID of the MatchX or Quiz game template.\n\t * @returns Wrapped {@link GamesApiResponse} of {@link GamePickGameInfo}.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.gamePickGetGameInfo({ saw_template_id: 1189 });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t *     console.log('[smartico] render Game Pick lobby — title:', r.data.sawTemplate.saw_template_ui_definition.name);\n\t *     console.log('[smartico] rounds available:', r.data.allRounds.length, '— buy-in type:', r.data.sawTemplate.saw_buyin_type_id, 'cost:', r.data.sawTemplate.buyin_cost_points);\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\treturn this.api.gpGetGameInfo(props.saw_template_id);\n\t}\n\n\t/**\n\t * Returns a round with another player's predictions instead of the current\n\t * user's. The target player is identified by `int_user_id` (the Game Pick\n\t * system's internal user ID, obtained from {@link gamePickGetBoard}'s\n\t * `users[].int_user_id`).\n\t *\n\t * Use to power \"view this player's picks\" affordances opened from leaderboard\n\t * rows — community / social inspection of how a top-ranked user predicted.\n\t *\n\t * @remarks\n\t * **Preconditions**\n\t * - User must be authenticated. Visitor mode not supported.\n\t * - `saw_template_id`, `round_id`, and `int_user_id` are all mandatory — SDK\n\t *   throws synchronously if any is missing.\n\t * - `int_user_id` must come from a leaderboard fetch in the same game\n\t *   template; it is stable within a template but not portable across\n\t *   templates.\n\t *\n\t * **Shape vs `gamePickGetActiveRound`**\n\t * Same {@link GamePickRound} structure, but `user_selection` /\n\t * `team1_user_selection` / `team2_user_selection` reflect the TARGET user's\n\t * predictions instead of the caller's. Each event still carries its own\n\t * `resolution_type_id` (see {@link GamePickResolutionType}) so the UI can\n\t * render result badges per pick.\n\t *\n\t * **Error codes** (in `errCode`)\n\t * - `0` — success.\n\t * - `4` — round / event / user not found.\n\t * - `100002` — template not found.\n\t * - `100000` — auth hash invalid.\n\t * - `100004` — generic server error.\n\t *\n\t * **Refresh**\n\t * - No cache. Re-call when opening a different leaderboard row's\n\t *   \"view picks\" modal.\n\t * - No push subscription.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * **UI guidance**: see [UI Guide — `gamePickGetRoundInfoForUser`](../../docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md).\n\t *\n\t * @param props.saw_template_id  ID of the MatchX or Quiz game template.\n\t * @param props.round_id         ID of the round to inspect.\n\t * @param props.int_user_id      Internal user ID from\n\t *                                `gamePickGetBoard.users[].int_user_id`.\n\t * @returns Wrapped {@link GamesApiResponse} with the target user's\n\t * {@link GamePickRound}.\n\t *\n\t * @example\n\t * ```ts\n\t * const board = await window._smartico.api.gamePickGetBoard({\n\t *     saw_template_id: 1083, round_id: 31652,\n\t * });\n\t * const topPlayer = board.data?.users?.[0];\n\t * if (!topPlayer) return;\n\t *\n\t * const r = await window._smartico.api.gamePickGetRoundInfoForUser({\n\t *     saw_template_id: 1083,\n\t *     round_id:        31652,\n\t *     int_user_id:     topPlayer.int_user_id,\n\t * });\n\t *\n\t * if (r.errCode === 0 && r.data) {\n\t *     for (const ev of r.data.events) {\n\t *         console.log('[smartico] render row —', ev.event_meta.team1_name, 'vs', ev.event_meta.team2_name, '— picked:', ev.user_selection, '— resolution:', ev.resolution_type_id);\n\t *     }\n\t * }\n\t * ```\n\t */\n\tpublic async gamePickGetRoundInfoForUser(props: GamePickRoundRequestParams & { int_user_id: number }): Promise<GamesApiResponse<GamePickRound>> {\n\t\tif (!props.saw_template_id) {\n\t\t\tthrow new Error('saw_template_id is required');\n\t\t}\n\t\tif (!props.round_id) {\n\t\t\tthrow new Error('round_id is required');\n\t\t}\n\t\tif (!props.int_user_id) {\n\t\t\tthrow new Error('int_user_id is required');\n\t\t}\n\t\treturn this.api.gpGetRoundInfoForUser(props.saw_template_id, props.round_id, props.int_user_id);\n\t}\n}\n","import { ECacheContext, OCache } from '../OCache';\nimport {\n\tLeaderBoardDetailsT,\n} from './WSAPITypes';\nimport { LeaderBoardPeriodType } from '../Leaderboard';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPIGamePick } from './WSAPIGamePick';\n\n/** @group LeaderBoard */\nexport class WSAPILeaderBoard extends WSAPIGamePick {\n\t/**\n\t * Returns the operator-configured standalone leaderboard for the\n\t * given period type — top-20 ranked entries, the current user's\n\t * own entry (when authenticated), and the configured prize table.\n\t * Use this to power a leaderboard page with daily / weekly /\n\t * monthly tabs.\n\t *\n\t * The leaderboard for each period type is configured separately by\n\t * the operator. A label may have any combination of DAILY, WEEKLY,\n\t * and MONTHLY boards configured (or none). To discover which boards\n\t * exist before loading any standings, call {@link getLeaderBoards}\n\t * (metadata only) and drive the tab selector from its `period_type_id`s.\n\t *\n\t * @remarks\n\t * **Return value note** — the runtime may return `undefined` if no\n\t * board is configured for the requested `periodType`, despite the\n\t * static return type being `Promise<LeaderBoardDetailsT>`. Defend\n\t * against that case in consumer code.\n\t *\n\t * **Preconditions**\n\t * Pass a `periodType` from {@link LeaderBoardPeriodType}\n\t * (`DAILY = 1`, `WEEKLY = 2`, `MONTHLY = 3`). Pass\n\t * `getPreviousPeriod: true` to fetch the most-recently-ended\n\t * period's snapshot (yesterday's / last week's / last month's\n\t * results) instead of the current live period. To reach older\n\t * snapshots, pass a number instead of a boolean: `1` = previous\n\t * period, `2` = the one before that, and so on (`0` / `false` =\n\t * current). Use the snapshot's `create_date` / `version_id` to label\n\t * which historical run a previous-period board is. How far back\n\t * snapshots are retained is operator-configured.\n\t *\n\t * **Top-20 cap**\n\t * The server hard-caps `users[]` at 20 entries, ordered by\n\t * `position` ASC. Position values are server-computed (DENSE_RANK\n\t * over all participants); the truncation at 20 is for transport\n\t * size only — `position` may exceed 20 elsewhere.\n\t *\n\t * **The `me` field**\n\t * Always populated for authenticated users (even when they have\n\t * zero points in the period). `me.position === -1` is the signal\n\t * that the user is active but ranked outside the top 20 (or has no\n\t * activity yet). `me` is `undefined` for visitor-mode sessions.\n\t *\n\t * **Rewards are points only**\n\t * `rewards[].points` are gamification points credited to the user's\n\t * balance when the period finalizes. The leaderboard never awards\n\t * gems, diamonds, store items, or bonuses. The first element of\n\t * the array is the prize for place 1, the second for place 2, and\n\t * so on. The array length is the number of paid places.\n\t *\n\t * **Cache TTL**\n\t * The SDK caches each response for 30 seconds. \n\t *\n\t * **Period boundaries**\n\t * The server finalizes each period on a server-configurable\n\t * schedule: DAILY at midnight + operator-defined offset; WEEKLY\n\t * at the start of Monday; MONTHLY on the 1st of each month. At\n\t * finalization, the server distributes the configured `rewards[]`\n\t * points to the top placeholders and resets the live board. After\n\t * finalization, `getLeaderBoard(periodType, false)` returns the\n\t * NEW (empty) period's board; call with\n\t * `getPreviousPeriod: true` to see the just-ended standings.\n\t *\n\t * **Refresh model**\n\t * - One-shot fetch (no subscription).\n\t * - No push event refreshes the cache; finalization at the period\n\t *   boundary is NOT pushed to the client.\n\t * - Poll manually if the consumer needs near-live state during an\n\t *   in-progress period.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getLeaderBoard`](../../docs/ui/leaderboard/UIGuide_getLeaderBoard.md).\n\t *\n\t * **Visitor mode**: supported. The same shape is returned, scoped\n\t * to the brand's public leaderboard. `me` is `undefined` for\n\t * visitors.\n\t *\n\t * @param periodType         The board's period type\n\t *                           ({@link LeaderBoardPeriodType}).\n\t *                           Selects which pre-configured board to\n\t *                           fetch; the board itself is bound to one\n\t *                           period by the operator.\n\t * @param getPreviousPeriod  Which period to fetch. `false` (default)\n\t *                           = current in-progress period; `true` =\n\t *                           the most recent finalized snapshot; a\n\t *                           number `n` = the n-th previous snapshot\n\t *                           (`1` = previous, `2` = the one before, …).\n\t * @returns                  Promise resolving to `LeaderBoardDetailsT`.\n\t *                           **At runtime, may resolve to `undefined`**\n\t *                           when no board is configured for the\n\t *                           requested period type — guard against it.\n\t *\n\t * @example\n\t * ```ts\n\t * import { LeaderBoardPeriodType } from '@smartico/public-api';\n\t *\n\t * const board = await window._smartico.api.getLeaderBoard(LeaderBoardPeriodType.WEEKLY);\n\t *\n\t * if (!board) {\n\t *   console.log('[smartico] no weekly board configured for this label — hide the leaderboard surface');\n\t *   return;\n\t * }\n\t *\n\t * console.log('[smartico] render leaderboard tab —', board.name, '—', board.users.length, 'ranked entries (top 20 max)');\n\t *\n\t * // Render prize table.\n\t * for (const reward of board.rewards) {\n\t *   console.log('[smartico] prize row — place', reward.place, '→', reward.points, 'points');\n\t * }\n\t *\n\t * // \"Me\" panel — sticky row showing the current user's rank.\n\t * if (board.me) {\n\t *   if (board.me.position === -1) {\n\t *     console.log('[smartico] user is unranked — show \"You are unranked, earn points to enter the leaderboard\"');\n\t *   } else if (board.me.position > 20) {\n\t *     console.log('[smartico] user is ranked', board.me.position, 'but outside the visible top-20 — show sticky \"me\" row with', board.me.points, 'points');\n\t *   } else {\n\t *     console.log('[smartico] user is in the top 20 at position', board.me.position, '— highlight their row in the main list');\n\t *   }\n\t * }\n\t *\n\t * // Switch to previous period view — cached separately from the current period.\n\t * const prev = await window._smartico.api.getLeaderBoard(LeaderBoardPeriodType.WEEKLY, true);\n\t * console.log('[smartico] previous-week standings — render with greyed-out \"ended\" treatment:', prev?.users.length, 'finalists');\n\t *\n\t * // Visitor-mode equivalent — me is always undefined.\n\t * // const visitorBoard = await window._smartico.vapi('EN').getLeaderBoard(LeaderBoardPeriodType.DAILY);\n\t * ```\n\t */\n\tpublic async getLeaderBoard(periodType: LeaderBoardPeriodType, getPreviousPeriod?: boolean | number): Promise<LeaderBoardDetailsT> {\n\t\t// Resolve the snapshot offset: false/omitted → 0 (current), true → 1\n\t\t// (previous), or an explicit number for older snapshots.\n\t\tconst offset = typeof getPreviousPeriod === 'number' ? getPreviousPeriod : getPreviousPeriod ? 1 : 0;\n\t\t// Cache per (periodType, offset) so switching tabs or period within the\n\t\t// TTL doesn't return a colliding board.\n\t\tconst cacheKey = `${onUpdateContextKey.LeaderBoards}:${periodType}:${offset}`;\n\t\treturn OCache.use(\n\t\t\tcacheKey,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.leaderboardsGetT(this.userExtId, periodType, offset),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the list of leaderboards the operator has configured for this\n\t * label — **metadata only, without participants**. Use it to discover\n\t * which boards exist (and their period types) so you can render the\n\t * board/tab selector, then load a specific board's standings on demand\n\t * with {@link getLeaderBoard}.\n\t *\n\t * This is the lightweight discovery counterpart to {@link getLeaderBoard}:\n\t * it issues one round-trip that returns every board's identity, name,\n\t * description, rules, `period_type_id`, and prize table, but **not** the\n\t * ranked players. Fetching the full standings for one board (the top-20\n\t * `users[]` and the caller's own `me` entry) is what {@link getLeaderBoard}\n\t * does per period.\n\t *\n\t * @remarks\n\t * **Returned shape**\n\t * An array of `LeaderBoardDetailsT`, one per configured board, ordered by\n\t * `period_type_id` ascending (DAILY, WEEKLY, MONTHLY, …). On every entry\n\t * `users` is an empty array and `me` is `undefined` — this call never\n\t * carries participant data. Read `period_type_id` from each entry and pass\n\t * it to {@link getLeaderBoard} to load that board's standings.\n\t *\n\t * **Empty result**\n\t * Resolves to an empty array when the label has no leaderboards configured\n\t * — treat that as \"hide the leaderboard surface\".\n\t *\n\t * **Cache TTL**\n\t * Cached for 30 seconds under a dedicated key (independent of\n\t * {@link getLeaderBoard}'s per-period cache). Repeated calls within the\n\t * window return the cached list without a round-trip.\n\t *\n\t * **Refresh model**: one-shot fetch — no subscription, no push. Board\n\t * configuration changes surface on the next cache miss.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **Visitor mode**: supported. Returns the brand's public board list.\n\t *\n\t * @returns Promise resolving to the array of configured boards\n\t *          (metadata only). Empty array when none are configured.\n\t *\n\t * @example\n\t * ```ts\n\t * const boards = await window._smartico.api.getLeaderBoards();\n\t *\n\t * if (boards.length === 0) {\n\t *   console.log('[smartico] no leaderboards configured — hide the leaderboard surface');\n\t *   return;\n\t * }\n\t *\n\t * // Render one tab per board from the lightweight list (no players yet).\n\t * console.log('[smartico] render leaderboard tabs:', boards.map(b => b.name));\n\t *\n\t * // When the user opens a tab, load that board's standings on demand.\n\t * const first = boards[0];\n\t * const full = await window._smartico.api.getLeaderBoard(first.period_type_id);\n\t * console.log('[smartico] loaded standings for', first.name, '—', full?.users.length ?? 0, 'players');\n\t * ```\n\t */\n\tpublic async getLeaderBoards(): Promise<LeaderBoardDetailsT[]> {\n\t\treturn OCache.use(\n\t\t\t`${onUpdateContextKey.LeaderBoards}:list`,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.leaderboardsGetListT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n}\n","import { ActivityTypeLimited } from '../Core';\nimport { ECacheContext, OCache } from '../OCache';\nimport {\n\tInboxMarkMessageAction,\n\tTInboxMessage,\n\tTInboxMessageBody,\n} from './WSAPITypes';\nimport { InboxCategories } from '../Inbox/InboxCategories';\nimport { InboxReadStatus } from '../Inbox/InboxReadStatus';\nimport {\n\tCACHE_DATA_SEC,\n\tonUpdateContextKey,\n} from './WSAPIBase';\nimport { WSAPILeaderBoard } from './WSAPILeaderBoard';\n\n/** @group Inbox */\nexport class WSAPIInbox extends WSAPILeaderBoard {\n\t/**\n\t * Records that an engagement (inbox message, popup) was displayed to\n\t * the user. Use this to drive engagement analytics — every visible\n\t * inbox message should fire one impression event per render\n\t * occurrence, and every popup display should fire one.\n\t *\n\t * **Fire-and-forget**: the call is asynchronous and one-way — there\n\t * is no response promise to await and no error reporting. The SDK\n\t * swallows transport failures silently. Returns `void`.\n\t *\n\t * @remarks\n\t * **When to call**\n\t * - Inbox: when a message becomes visible (the user opens / scrolls\n\t *   it into view). The default Smartico UI fires this when the\n\t *   message detail expands, alongside\n\t *   {@link markInboxMessageAsRead}.\n\t * - Popup: when the popup content is shown to the user.\n\t *\n\t * **Activity types**\n\t * Pass {@link ActivityTypeLimited.Inbox} (`31`) for inbox messages,\n\t * {@link ActivityTypeLimited.Popup} (`30`) for popups. Other values\n\t * are not used by the engagement-impression channel.\n\t *\n\t * **Idempotency**: the server records every impression event —\n\t * repeated calls add to the impression count. Don't fire it on\n\t * every re-render; fire it once per logical \"display\" event\n\t * (modal open, list-row scroll-into-view, popup show).\n\t *\n\t * **Side effects**: server-side increments the engagement's\n\t * `impression_count` and updates `last_impression_date`. The\n\t * counter is observable via operator analytics; the SDK consumer\n\t * receives no signal back.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @example\n\t * ```ts\n\t * // When the user opens an inbox message in the detail view.\n\t * window._smartico.api.reportImpressionEvent({\n\t *   engagement_uid: message.message_guid,\n\t *   activityType: 31,  // ActivityTypeLimited.Inbox\n\t * });\n\t * console.log('[smartico] inbox impression reported for', message.message_guid, '— no response to await, fire-and-forget');\n\t * ```\n\t */\n\tpublic reportImpressionEvent({\n\t\tengagement_uid,\n\t\tactivityType,\n\t}: {\n\t\t/** For inbox: the message's `message_guid` from `getInboxMessages`. For popups: the popup's GUID from the popup display callback. */\n\t\tengagement_uid: string;\n\t\t/** `ActivityTypeLimited.Inbox` (`31`) for inbox; `Popup` (`30`) for popups. */\n\t\tactivityType: ActivityTypeLimited | number;\n\t}): void {\n\t\tthis.api.reportEngagementImpression(this.userExtId, engagement_uid, activityType);\n\t}\n\n\t/**\n\t * Records that the user interacted with an engagement — typically\n\t * tapping a CTA button, following a deep-link, or clicking a popup\n\t * action. Use this to drive engagement analytics on what users\n\t * actually act on (vs what they merely see —\n\t * {@link reportImpressionEvent}).\n\t *\n\t * **Fire-and-forget**: the call is asynchronous and one-way — there\n\t * is no response promise to await and no error reporting. The SDK\n\t * swallows transport failures silently. Returns `void`.\n\t *\n\t * @remarks\n\t * **When to call**\n\t * - Inbox: when the user taps a CTA button on a message or follows\n\t *   a deep-link inside the message body. Pass the deep-link or URL\n\t *   as `action`.\n\t * - Popup: when the user clicks a popup action button.\n\t *\n\t * **Activity types**\n\t * Pass {@link ActivityTypeLimited.Inbox} (`31`) for inbox,\n\t * {@link ActivityTypeLimited.Popup} (`30`) for popups.\n\t *\n\t * **`action` payload**\n\t * Pass the deep-link or URL that the user triggered (e.g.\n\t * `'dp:gf_missions'`, `'https://example.com/promo'`). The SDK\n\t * forwards the string to the server for analytics — it does not\n\t * execute the deep-link. To execute deep-links safely, call\n\t * `_smartico.dp(action)` separately.\n\t *\n\t * **Idempotency**: the server records every click event —\n\t * repeated calls add to the count. Fire once per logical user\n\t * action.\n\t *\n\t * **Side effects**: server-side updates the engagement's\n\t * `last_action` field; observable via operator analytics. The SDK\n\t * consumer receives no signal back.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @example\n\t * ```ts\n\t * // When the user taps a CTA button in an inbox message.\n\t * window._smartico.api.reportClickEvent({\n\t *   engagement_uid: message.message_guid,\n\t *   activityType: 31,  // ActivityTypeLimited.Inbox\n\t *   action: 'dp:gf_missions',\n\t * });\n\t * window._smartico.dp('dp:gf_missions');   // separately execute the deep-link\n\t * ```\n\t */\n\tpublic reportClickEvent({\n\t\tengagement_uid,\n\t\tactivityType,\n\t\taction,\n\t}: {\n\t\t/** For inbox: the message's `message_guid` from `getInboxMessages`. */\n\t\tengagement_uid: string;\n\t\t/** `ActivityTypeLimited.Inbox` (`31`) for inbox; `Popup` (`30`) for popups. */\n\t\tactivityType: ActivityTypeLimited | number;\n\t\t/** The deep-link / URL the user triggered (optional but recommended for analytics fidelity). */\n\t\taction?: string;\n\t}): void {\n\t\tthis.api.reportEngagementAction(this.userExtId, engagement_uid, activityType, action);\n\t}\n\n\t/**\n\t * Returns the user's inbox messages — newest first — with optional\n\t * filtering by category, favorite status, and read state. Each\n\t * `TInboxMessage` is a lightweight envelope (`message_guid`,\n\t * `sent_date`, `read`, `favorite`, `category_id`, `expire_on_dt`);\n\t * fetch the rich body (title, preview, icon, html_body, buttons)\n\t * separately via {@link getInboxMessageBody}.\n\t *\n\t * Use this to power an inbox list screen. Subscribe via `onUpdate`\n\t * to react to newly-arrived messages pushed by the server (from\n\t * campaigns, automation rules, manual operator sends).\n\t *\n\t * @remarks\n\t * **Subscription model (`onUpdate`)**\n\t * The callback receives the FULL refreshed message list (never a\n\t * diff/patch). Each subsequent call to `getInboxMessages({ onUpdate })`\n\t * REPLACES the prior callback. Pass `onUpdate: undefined` (or omit\n\t * it) to keep the prior callback in place; the callback is never\n\t * auto-cleared.\n\t *\n\t * **Update triggers** — the callback fires ONLY when:\n\t *\n\t * 1. A new message is pushed by the server (campaign / automation /\n\t *    operator send). The refreshed list includes the new message\n\t *    at the top.\n\t *\n\t * Does NOT fire for: `markInboxMessageAsRead`,\n\t * `markAllInboxMessagesAsRead`,\n\t * `markUnmarkInboxMessageAsFavorite`, `deleteInboxMessage`,\n\t * `deleteAllInboxMessages`. After a mutation, re-call\n\t * `getInboxMessages` manually if your UI needs the refreshed list\n\t * — or maintain optimistic state locally.\n\t *\n\t * **Pagination**\n\t * `from` (defaults to `0`) and `to` (defaults to `20`) define a\n\t * half-open range of message indices. The server caps the page at\n\t * **20 messages per request** — passing `to - from > 20` silently\n\t * truncates to 20. For \"load more\" pagination, advance `from` by\n\t * the prior page size on each subsequent call.\n\t *\n\t * **Filters**\n\t * All filters are ANDed server-side. Omitting a filter means \"no\n\t * constraint\" on that dimension:\n\t * - `categoryId` ({@link InboxCategories}): `General` (0),\n\t *   `Platform` (1), `Personal` (2). Omit to get all categories.\n\t * - `onlyFavorite: true` returns only starred messages.\n\t *   Omit / `false` returns all (starred and not).\n\t * - `read_status` ({@link InboxReadStatus}): `UnreadOnly` (1) or\n\t *   `ReadOnly` (2). Omit to get both.\n\t *\n\t * **Server-side filtering** (always applied)\n\t * Expired messages (`expire_on_dt` in the past) and\n\t * soft-deleted messages are excluded server-side. Consumers do not\n\t * need to filter for these.\n\t *\n\t * **No client cache**: every call sends a fresh server round-trip.\n\t * To avoid redundant fetches in your UI, hold the result in\n\t * application state and re-fetch on `onUpdate` fires or explicit\n\t * user-driven refresh.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **UI guidance**: see [UI Guide — `getInboxMessages`](../../docs/ui/inbox/UIGuide_getInboxMessages.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params              Optional filters + subscription.\n\t * @param params.from         First message index (0-based). Defaults\n\t *                            to `0`.\n\t * @param params.to           Last message index (exclusive).\n\t *                            Defaults to `20`. Server caps the page\n\t *                            at 20.\n\t * @param params.onlyFavorite When `true`, returns only favorite\n\t *                            (starred) messages.\n\t * @param params.categoryId   When set, returns only messages in this\n\t *                            category ({@link InboxCategories}).\n\t * @param params.read_status  When set, scopes to read or unread\n\t *                            only ({@link InboxReadStatus}).\n\t * @param params.onUpdate     Callback invoked with the full\n\t *                            refreshed list when a new message\n\t *                            arrives.\n\t *\n\t * @returns Promise resolving to up to 20 `TInboxMessage` envelopes.\n\t *          Empty array when the user has no messages matching the\n\t *          filter.\n\t *\n\t * @example\n\t * ```ts\n\t * const messages = await window._smartico.api.getInboxMessages({\n\t *   onUpdate: (refreshed) => {\n\t *     console.log('[smartico] new inbox message arrived — re-render the list from this array, new message is at index 0:', refreshed);\n\t *   },\n\t * });\n\t *\n\t * // For each message, fetch its body for the list view (title, preview, icon).\n\t * for (const msg of messages) {\n\t *   const body = await window._smartico.api.getInboxMessageBody(msg.message_guid);\n\t *   console.log('[smartico] render message', msg.message_guid,\n\t *     '— title:', body.title,\n\t *     '— preview:', body.preview_body,\n\t *     '— read:', msg.read,\n\t *     '— favorite:', msg.favorite);\n\t * }\n\t *\n\t * // \"Load more\" pagination — advance from by the prior page size.\n\t * const page2 = await window._smartico.api.getInboxMessages({ from: 20, to: 40 });\n\t * console.log('[smartico] page 2:', page2.length, 'messages');\n\t *\n\t * // Filter examples.\n\t * const onlyStarred = await window._smartico.api.getInboxMessages({ onlyFavorite: true });\n\t * const onlyUnread = await window._smartico.api.getInboxMessages({ read_status: 1 });  // InboxReadStatus.UnreadOnly\n\t * ```\n\t */\n\tpublic async getInboxMessages({\n\t\tfrom,\n\t\tto,\n\t\tonlyFavorite,\n\t\tcategoryId,\n\t\tread_status,\n\t\tonUpdate,\n\t}: {\n\t\tfrom?: number;\n\t\tto?: number;\n\t\tonlyFavorite?: boolean;\n\t\tcategoryId?: InboxCategories;\n\t\tread_status?: InboxReadStatus;\n\t\tonUpdate?: (data: TInboxMessage[]) => void;\n\t} = {}): Promise<TInboxMessage[]> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.InboxMessages, onUpdate);\n\t\t}\n\t\treturn await this.api.getInboxMessagesT(this.userExtId, from, to, onlyFavorite, categoryId, read_status);\n\t}\n\n\t/**\n\t * Returns the user's current unread inbox message count — a single\n\t * integer suitable for driving a header badge. Optionally subscribe\n\t * to live updates via `onUpdate`.\n\t *\n\t * For most UIs, prefer `core_inbox_unread_count` from\n\t * {@link getUserProfile} instead: it carries the same value, is\n\t * push-updated in real time via the user-properties channel, and\n\t * doesn't require a separate cache. This method is useful when you\n\t * want a dedicated subscription tied to the inbox surface rather\n\t * than the broader user-properties channel.\n\t *\n\t * @remarks\n\t * **Subscription model**\n\t * `onUpdate` fires whenever the cached value changes — either on a\n\t * push from the user-properties channel (new message arrival,\n\t * mark-as-read, delete) or after an inbox-list fetch that returns\n\t * a fresh count.\n\t *\n\t * **Cache TTL**: 30 seconds. The cached value is patched in place\n\t * by push events (no full re-fetch on every push), so the\n\t * `onUpdate` callback reflects server state with sub-second latency\n\t * regardless of the TTL.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only.\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param params           Optional subscription bag.\n\t * @param params.onUpdate  Callback invoked with the new unread\n\t *                         count whenever it changes (push-driven).\n\t * @returns                Promise resolving to the current unread\n\t *                         count (integer, includes `0`).\n\t *\n\t * @example\n\t * ```ts\n\t * // Static read for an initial badge render.\n\t * const count = await window._smartico.api.getInboxUnreadCount();\n\t * console.log('[smartico] inbox badge initial count:', count);\n\t *\n\t * // Live subscription for badge updates.\n\t * await window._smartico.api.getInboxUnreadCount({\n\t *   onUpdate: (newCount) => {\n\t *     console.log('[smartico] inbox count changed — update the badge to:', newCount,\n\t *       '— hide badge entirely when 0, show raw integer otherwise (no \"99+\" cap in the default UI)');\n\t *   },\n\t * });\n\t * ```\n\t */\n\tpublic async getInboxUnreadCount({ onUpdate }: { onUpdate?: (unread_count: number) => void } = {}): Promise<number> {\n\t\tif (typeof onUpdate === 'function') {\n\t\t\tthis.onUpdateCallback.set(onUpdateContextKey.InboxUnreadCount, onUpdate);\n\t\t}\n\t\treturn OCache.use(\n\t\t\tonUpdateContextKey.InboxUnreadCount,\n\t\t\tECacheContext.WSAPI,\n\t\t\t() => this.api.getInboxUnreadCountT(this.userExtId),\n\t\t\tCACHE_DATA_SEC,\n\t\t);\n\t}\n\n\t/**\n\t * Returns the rich body of a single inbox message — title, preview\n\t * text, icon, click action, optional rich HTML body, and optional\n\t * buttons. Call this after fetching the envelope list via\n\t * {@link getInboxMessages} to render either a list-item preview or\n\t * a full detail view.\n\t *\n\t * The message body is served from a CDN — not over the WebSocket —\n\t * so latency depends on CDN proximity rather than WS round-trip\n\t * time. There is NO client-side cache; every call is a fresh\n\t * HTTP fetch. Browser HTTP caching applies (Cache-Control headers\n\t * from the CDN), but the SDK does not memoize the result.\n\t *\n\t * @remarks\n\t * **Rich vs simple messages**\n\t * The shape of the returned body branches on the `action` field:\n\t * - When `action === 'dp:inbox'`, the message has a rich HTML body\n\t *   (`html_body`) and may have up to 2 action `buttons`. Use these\n\t *   for a full-detail rendering.\n\t * - For any other `action` (deep-link like `'dp:deposit'` or a URL),\n\t *   the message is a simple notification — `html_body` and\n\t *   `buttons` will be `undefined` regardless of what's in the\n\t *   underlying CDN payload. Render `title` + `preview_body` + a\n\t *   single CTA driving the `action`.\n\t *\n\t * **The `action` field**\n\t * For both shapes, `action` carries either a deep-link\n\t * (`'dp:gf_missions'`) or a plain URL. Pass it to `_smartico.dp()`\n\t * for safe execution — that helper handles URL vs deep-link\n\t * routing.\n\t *\n\t * **Idempotency / Side effects**: safe. Read-only HTTP fetch.\n\t *\n\t * **UI guidance**: see [UI Guide — `getInboxMessageBody`](../../docs/ui/inbox/UIGuide_getInboxMessageBody.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid  The `message_guid` from a `TInboxMessage`\n\t *                     returned by {@link getInboxMessages}.\n\t * @returns            Promise resolving to `TInboxMessageBody`.\n\t *\n\t * @example\n\t * ```ts\n\t * const body = await window._smartico.api.getInboxMessageBody(messageGuid);\n\t *\n\t * console.log('[smartico] render message — title:', body.title,\n\t *   '— preview:', body.preview_body,\n\t *   '— icon:', body.icon);\n\t *\n\t * if (body.action === 'dp:inbox' && body.html_body) {\n\t *   console.log('[smartico] rich message — render the html_body in a sandboxed iframe; render up to 2 action buttons:',\n\t *     body.buttons?.length ?? 0);\n\t * } else {\n\t *   console.log('[smartico] simple message — show preview_body + single CTA wired to:', body.action,\n\t *     '— execute via _smartico.dp(body.action)');\n\t * }\n\t * ```\n\t */\n\tpublic async getInboxMessageBody(messageGuid: string): Promise<TInboxMessageBody> {\n\t\treturn await this.api.getInboxMessageBodyT(messageGuid);\n\t}\n\n\t/**\n\t * Marks a single inbox message as read. Server-side this flips the\n\t * message's `is_read` flag and decrements the user's unread count\n\t * (the change propagates back via the user-properties channel —\n\t * subscribers to {@link getInboxUnreadCount}'s `onUpdate` and\n\t * {@link getUserProfile}'s `core_inbox_unread_count` see it within\n\t * ~1 second).\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the message is now marked read. Idempotent — a\n\t *   second call on the same `messageGuid` also returns `0`.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Refresh after success**\n\t * The SDK does NOT auto-refresh {@link getInboxMessages} (no\n\t * `onUpdate` callback fires after this mutation). The unread-count\n\t * channel ({@link getInboxUnreadCount}, `core_inbox_unread_count`)\n\t * DOES auto-update — subscribers to it see the new count\n\t * automatically. If your inbox list UI shows the `read` field, you\n\t * have two options: re-call `getInboxMessages` after the mutation,\n\t * or update the local copy optimistically.\n\t *\n\t * **Idempotency**: safe. Repeated calls return `err_code === 0`.\n\t *\n\t * **Side effects** (on success)\n\t * - Server-side `is_read` flag set to true.\n\t * - Server-side `core_inbox_unread_count` decremented (if the\n\t *   message was previously unread).\n\t *\n\t * **UI guidance**: see [UI Guide — `markInboxMessageAsRead`](../../docs/ui/inbox/UIGuide_markInboxMessageAsRead.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid  The `message_guid` from a `TInboxMessage`.\n\t * @returns `{ err_code, err_message }`; success when\n\t *          `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * const r = await window._smartico.api.markInboxMessageAsRead(message.message_guid);\n\t * if (r.err_code === 0) {\n\t *   console.log('[smartico] marked as read — optimistically flip the local read indicator; the inbox badge auto-decrements via the user-properties channel');\n\t * } else {\n\t *   console.error('[smartico] mark-as-read failed — keep the local state as-is and show a non-blocking error if appropriate:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async markInboxMessageAsRead(messageGuid: string): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.markInboxMessageRead(this.userExtId, messageGuid);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Marks ALL of the user's inbox messages as read in one server\n\t * round-trip — typically wired to a \"Mark all as read\" CTA in the\n\t * inbox header.\n\t *\n\t * The operation is global to the user — NOT filtered by the\n\t * current view (active category tab, favorite filter, etc.). Every\n\t * unread message in the user's inbox flips to read.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; all currently-unread messages flipped to read.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Race condition note**: a new message arriving server-side\n\t * between the call and its processing remains unread (the\n\t * server's mark-all operation is a snapshot in time). Subsequent\n\t * `getInboxMessages` calls show the new message as unread.\n\t *\n\t * **Refresh after success**\n\t * Same as {@link markInboxMessageAsRead} — `getInboxMessages`\n\t * `onUpdate` does NOT fire automatically, but the unread-count\n\t * channel does (the badge will drop to 0, or to the count of any\n\t * new messages that arrived during processing).\n\t *\n\t * **Idempotency**: safe. A second call on an already-all-read\n\t * inbox returns `err_code === 0` with no-op effect.\n\t *\n\t * **Side effects** (on success)\n\t * - Every unread message flipped to read.\n\t * - `core_inbox_unread_count` drops to 0 (or near 0 if races).\n\t *\n\t * **UI guidance**: included in the\n\t * [UI Guide — `markInboxMessageAsRead`](../../docs/ui/inbox/UIGuide_markInboxMessageAsRead.md)\n\t * (Bulk variant section).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns `{ err_code, err_message }`; success when\n\t *          `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * console.log('[smartico] mark-all-read starting — set in-flight flag on the \"Mark all read\" button, show loading dots');\n\t * const r = await window._smartico.api.markAllInboxMessagesAsRead();\n\t * console.log('[smartico] mark-all-read response — clear in-flight flag');\n\t * if (r.err_code === 0) {\n\t *   console.log('[smartico] all messages marked read — optimistically flip every local read indicator; badge auto-drops via user-properties channel');\n\t * } else {\n\t *   console.error('[smartico] mark-all failed — surface a non-blocking error:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async markAllInboxMessagesAsRead(): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.markAllInboxMessageRead(this.userExtId);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Toggles a message's favorite (starred) state — pass `mark: true`\n\t * to favorite, `mark: false` to unfavorite. Use to power a star\n\t * icon click handler on the inbox list.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the message's favorite state flipped to the\n\t *   requested value.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Refresh after success**\n\t * The SDK does NOT auto-refresh {@link getInboxMessages}. To\n\t * reflect the new state in the UI, update the local copy of the\n\t * affected `TInboxMessage` (set `favorite` to the new value) or\n\t * re-call `getInboxMessages`.\n\t *\n\t * **Idempotency**: safe. `mark: true` on an already-favorite\n\t * message returns `err_code === 0` (no-op). Same for `mark: false`\n\t * on a non-favorite.\n\t *\n\t * **Side effects** (on success)\n\t * - Server-side `is_starred` flag set to the requested value.\n\t * - No effect on read state, unread count, or other fields.\n\t *\n\t * **UI guidance**: see [UI Guide — `markUnmarkInboxMessageAsFavorite`](../../docs/ui/inbox/UIGuide_markUnmarkInboxMessageAsFavorite.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid  The `message_guid` from a `TInboxMessage`.\n\t * @param mark         `true` to favorite, `false` to unfavorite.\n\t * @returns            `{ err_code, err_message }`; success when\n\t *                     `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * // Toggle handler — flip the local state optimistically, then\n\t * // call the server, and revert if the call fails.\n\t * const target = !message.favorite;\n\t * console.log('[smartico] optimistically flip the star to', target, '— it will revert if the server rejects');\n\t *\n\t * const r = await window._smartico.api.markUnmarkInboxMessageAsFavorite(\n\t *   message.message_guid,\n\t *   target,\n\t * );\n\t *\n\t * if (r.err_code === 0) {\n\t *   console.log('[smartico] favorite toggled — keep the local state and show a brief \"Added to favorites\" / \"Removed from favorites\" toast');\n\t * } else {\n\t *   console.error('[smartico] favorite toggle failed — revert the local state and show an error toast:', r.err_message);\n\t * }\n\t * ```\n\t */\n\tpublic async markUnmarkInboxMessageAsFavorite(messageGuid: string, mark: boolean): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.markUnmarkInboxMessageAsFavorite(this.userExtId, messageGuid, mark);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Soft-deletes a single inbox message. After deletion, the message\n\t * is excluded from future {@link getInboxMessages} responses\n\t * server-side, but its row is retained for analytics — there is no\n\t * \"undelete\" path via the SDK.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the message is now deleted from the user's\n\t *   view.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Refresh after success**\n\t * The SDK does NOT auto-refresh {@link getInboxMessages}. Drop the\n\t * deleted message from your local list, or re-call\n\t * `getInboxMessages` to reload. If the deleted message was unread,\n\t * the unread count drops automatically via the user-properties\n\t * channel.\n\t *\n\t * **Idempotency**: safe. A second call on an already-deleted\n\t * `messageGuid` returns `err_code === 0` (server treats it as a\n\t * no-op — already-deleted messages are filtered out).\n\t *\n\t * **Side effects** (on success)\n\t * - Server-side `is_deleted` flag set to true.\n\t * - If the message was unread, `core_inbox_unread_count`\n\t *   decrements via the user-properties channel.\n\t *\n\t * **UI guidance**: see [UI Guide — `deleteInboxMessage`](../../docs/ui/inbox/UIGuide_deleteInboxMessage.md).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @param messageGuid  The `message_guid` from a `TInboxMessage`.\n\t * @returns `{ err_code, err_message }`; success when\n\t *          `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * // Swipe-to-delete on mobile; trash-icon click on desktop.\n\t * console.log('[smartico] delete starting — animate the row out of the list (slide left/right by 100%)');\n\t * const r = await window._smartico.api.deleteInboxMessage(message.message_guid);\n\t * if (r.err_code === 0) {\n\t *   console.log('[smartico] deleted — drop the message from the local list, fire a brief \"Message deleted\" toast (no undo affordance — there is no undelete via the SDK)');\n\t * } else {\n\t *   console.error('[smartico] delete failed — animate the row back into place and show a non-blocking error:', r.err_message);\n\t * }\n\t * ```\n\t */\n\n\tpublic async deleteInboxMessage(messageGuid: string): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.deleteInboxMessage(this.userExtId, messageGuid);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\t/**\n\t * Soft-deletes ALL of the user's inbox messages in one server\n\t * round-trip — typically wired to a \"Delete all\" CTA in the inbox\n\t * header (usually behind a confirm dialog given the destructive\n\t * nature).\n\t *\n\t * The operation is global to the user — NOT filtered by the\n\t * current view (active category tab, favorite filter, etc.). Every\n\t * non-deleted message in the user's inbox flips to deleted.\n\t *\n\t * @remarks\n\t * **Error codes** (in `err_code`)\n\t * - `0` — success; the entire inbox is now empty from the user's\n\t *   view.\n\t * - other non-zero — server error. Surface `err_message` if any.\n\t *\n\t * **Race condition note**: a new message arriving server-side\n\t * between the call and its processing is NOT deleted (the\n\t * server's delete-all operation is a snapshot in time). Subsequent\n\t * `getInboxMessages` calls show the new message.\n\t *\n\t * **Refresh after success**\n\t * Same as {@link deleteInboxMessage} — `getInboxMessages` `onUpdate`\n\t * does not fire automatically. Replace the local list with `[]`\n\t * (or re-call `getInboxMessages`). The unread count drops to 0\n\t * (or near-0 if races) via the user-properties channel.\n\t *\n\t * **Idempotency**: safe. A second call on an already-empty inbox\n\t * returns `err_code === 0` with no-op effect.\n\t *\n\t * **Side effects** (on success)\n\t * - Every message flipped to deleted server-side.\n\t * - `core_inbox_unread_count` drops to 0.\n\t * - There is no SDK undelete path — recovery requires operator\n\t *   intervention.\n\t *\n\t * **UI guidance**: included in the\n\t * [UI Guide — `deleteInboxMessage`](../../docs/ui/inbox/UIGuide_deleteInboxMessage.md)\n\t * (Bulk variant section).\n\t *\n\t * **Visitor mode**: not supported.\n\t *\n\t * @returns `{ err_code, err_message }`; success when\n\t *          `err_code === 0`.\n\t *\n\t * @example\n\t * ```ts\n\t * // After a confirm dialog \"Are you sure you want to delete all messages?\"\n\t * console.log('[smartico] delete-all confirmed — show loading state on the \"Delete all\" button');\n\t * const r = await window._smartico.api.deleteAllInboxMessages();\n\t * if (r.err_code === 0) {\n\t *   console.log('[smartico] inbox cleared — replace the local list with [], fire a \"All messages deleted\" toast, badge auto-drops to 0');\n\t * } else {\n\t *   console.error('[smartico] delete-all failed — show a non-blocking error toast:', r.err_message);\n\t * }\n\t * ```\n\t */\n\n\tpublic async deleteAllInboxMessages(): Promise<InboxMarkMessageAction> {\n\t\tconst r = await this.api.deleteAllInboxMessages(this.userExtId);\n\n\t\treturn {\n\t\t\terr_code: r.errCode,\n\t\t\terr_message: r.errMsg,\n\t\t};\n\t}\n\n\tprotected async updateInboxUnreadCount(count: number) {\n\t\tthis.updateEntity(onUpdateContextKey.InboxUnreadCount, count);\n\t}\n\n\tprotected async updateInboxMessages() {\n\t\tconst payload = await this.api.getInboxMessagesT(this.userExtId);\n\t\tthis.updateEntity(onUpdateContextKey.InboxMessages, payload);\n\t}\n}\n","import { ClassId } from '../Base/ClassId';\nimport { SAWSpinsCountPush } from '../MiniGames';\nimport { ECacheContext, OCache } from '../OCache';\nimport { SmarticoAPI } from '../SmarticoAPI';\nimport { JackpotWinPush, JackpotsOptinResponse, JackpotsOptoutRequest } from '../Jackpots';\nimport { onUpdateContextKey } from './WSAPIBase';\nimport { WSAPIInbox } from './WSAPIInbox';\nimport { TUserProfile } from './WSAPITypes';\n\n/**\n * Public surface of the Smartico WebSocket API. The consumer reaches every\n * method on this class via `_smartico.api.X(...)`. The class is the\n * terminator of an inheritance chain that splits the surface into focused\n * domain classes (see `WSAPIBase` → `WSAPIUser` → ... → `WSAPIInbox` →\n * `WSAPI`); each domain class hosts its own subset of methods. Consumers\n * don't need to know about the chain — every method is reachable directly\n * on the `WSAPI` instance via prototype-chain lookup.\n *\n * @group General API\n */\nexport class WSAPI extends WSAPIInbox {\n\t/** @private */\n\tconstructor(api: SmarticoAPI, userExtId: string = null) {\n\t\tsuper(api, userExtId);\n\n\t\t// Push-subscription wiring. This block must live in the terminator\n\t\t// because it references `update*` helpers defined across multiple\n\t\t// domain classes; only the terminator has visibility into all of\n\t\t// them via the prototype chain.\n\t\tif (this.api.tracker) {\n\t\t\tconst on = this.api.tracker.on;\n\n\t\t\ton(ClassId.SAW_SPINS_COUNT_PUSH, (data: SAWSpinsCountPush) => this.updateOnSpin(data));\n\t\t\ton(ClassId.SAW_SHOW_SPIN_PUSH, () => this.reloadMiniGameTemplate());\n\t\t\ton(ClassId.SAW_AKNOWLEDGE_RESPONSE, () => {\n\t\t\t\tthis.reloadMiniGameTemplate();\n\t\t\t\tOCache.clearByPrefix(ECacheContext.WSAPI, onUpdateContextKey.SAWHistory);\n\t\t\t});\n\t\t\ton(ClassId.SAW_DO_SPIN_RESPONSE, () => {\n\t\t\t\tthis.reloadMiniGameTemplate();\n\t\t\t\tOCache.clearByPrefix(ECacheContext.WSAPI, onUpdateContextKey.SAWHistory);\n\t\t\t});\n\t\t\ton(ClassId.MISSION_OPTIN_RESPONSE, () => this.updateMissions());\n\t\t\ton(ClassId.ACHIEVEMENT_CLAIM_PRIZE_RESPONSE, () => this.updateMissions());\n\t\t\ton(ClassId.RELOAD_ACHIEVEMENTS_EVENT, () => this.updateMissions());\n\t\t\ton(ClassId.TOURNAMENT_REGISTER_RESPONSE, () => this.updateTournaments());\n\t\t\ton(ClassId.BUY_SHOP_ITEM_RESPONSE, () => {\n\t\t\t\tthis.updateStorePurchasedItems();\n\t\t\t\tthis.updateStoreItems();\n\t\t\t});\n\t\t\ton(ClassId.CLIENT_ENGAGEMENT_EVENT_NEW, () => this.updateInboxMessages());\n\t\t\ton(ClassId.LOGOUT_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));\n\t\t\ton(ClassId.IDENTIFY_RESPONSE, () => OCache.clearContext(ECacheContext.WSAPI));\n\t\t\ton(ClassId.JP_WIN_PUSH, (_data: JackpotWinPush) => this.jackpotClearCache());\n\t\t\ton(ClassId.JP_OPTOUT_RESPONSE, (_data: JackpotsOptoutRequest) => this.jackpotClearCache());\n\t\t\ton(ClassId.JP_OPTIN_RESPONSE, (_data: JackpotsOptinResponse) => this.jackpotClearCache());\n\t\t\ton(ClassId.CLAIM_BONUS_RESPONSE, () => this.updateBonuses());\n\t\t\ton(ClassId.SAW_DO_SPIN_BATCH_RESPONSE, () => {\n\t\t\t\tthis.reloadMiniGameTemplate();\n\t\t\t\tOCache.clearByPrefix(ECacheContext.WSAPI, onUpdateContextKey.SAWHistory);\n\t\t\t});\n\t\t\ton(ClassId.RAF_CLAIM_PRIZE_RESPONSE, () => this.updateRaffles());\n\t\t\ton(ClassId.GET_INBOX_MESSAGES_RESPONSE, (res) => {\n\t\t\t\tif (res.unread_count !== undefined && res.unread_count !== null) {\n\t\t\t\t\tthis.updateInboxUnreadCount(res.unread_count);\n\t\t\t\t}\n\t\t\t});\n\t\t\ton(ClassId.CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT, (data: { props: TUserProfile }) => {\n\t\t\t\tif (data?.props?.core_inbox_unread_count !== undefined && data?.props?.core_inbox_unread_count !== null) {\n\t\t\t\t\tthis.updateInboxUnreadCount(data.props.core_inbox_unread_count);\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t(\n\t\t\t\t\t\tdata?.props?.ach_points_balance !== undefined ||\n\t\t\t\t\t\tdata?.props?.ach_gems_balance !== undefined ||\n\t\t\t\t\t\tdata?.props?.ach_diamonds_balance !== undefined\n\t\t\t\t\t) && this.onUpdateCallback.get(onUpdateContextKey.ActivityLog)) {\n\t\t\t\t\tthis.notifyActivityLogUpdate();\n\t\t\t\t}\n\t\t\t\tOCache.clear(ECacheContext.WSAPI, onUpdateContextKey.CurrentLevel);\n\t\t\t});\n\t\t\ton(ClassId.RAF_OPTIN_RESPONSE, () => this.updateRaffles());\n\t\t}\n\t}\n}\n","export enum AchCustomSectionType {\n\tHTML_PAGE = 1,\n\tMISSIONS_CATEGORY = 2,\n\tTOURNAMENTS_CATEGORY = 3,\n\tLEVELS = 4,\n\tMINI_GAMES = 5,\n\tMISSION_CUSTOM_LAYOUT = 6,\n\tMATCH_X_AND_QUIZ = 7,\n\tREDIRECT_LINK = 9,\n\tLOOTBOX_WEEKLY = 10,\n\tLOOTBOX_CALENDAR_DAYS = 11,\n\tSTORE = 12,\n\tRAFFLE = 13,\n\tBADGES = 14,\n}\n\nexport enum AchCustomLayoutTheme {\n\tVALENTINES_LIGHT = 'valentines-light',\n\tVALENTINES_DARK = 'valentines-dark',\n\tEURO_2024 = 'euro-2024',\n\tGENERIC = 'generic',\n}\n\nexport enum AchMissionsTabsOptions {\n\tONLY_OVERVIEW = 1,\n\tNO_OVERVIEW = 2,\n\tALL = 3,\n}\n\nexport enum AchOverviewMissionsFilter {\n\tANY = 1,\n\tALL_MISSIONS = 2,\n\tALL_EXCEPT_COMPLETED = 3,\n\tALL_EXCEPT_LOCKED = 4,\n\tALL_EXCEPT_COMPLETED_AND_LOCKED = 5,\n}\n\nexport enum LiquidEntityData {\n\tMissions = 1,\n\tStore = 2,\n\tTournaments = 3,\n\tMiniGames = 4,\n\tLevels = 5,\n\tJackpots = 6,\n\tBonus = 7,\n\tLeaderboard = 8,\n\tBadges = 9,\n\tTournament = 10,\n\tRaffles = 11,\n\tSingleRaffle = 12,\n\tClans = 13,\n}","import { TUICustomSection } from '../WSAPI/WSAPITypes';\nimport {\n\tAchCustomLayoutTheme,\n\tAchCustomSectionType,\n\tAchMissionsTabsOptions,\n\tAchOverviewMissionsFilter,\n\tLiquidEntityData,\n} from './AchCustomSection';\nimport { GetCustomSectionsResponse } from './GetCustomSectionsResponse';\n\nexport interface UICustomSection {\n\tbody?: string;\n\tmenu_img?: string;\n\tmenu_name?: string;\n\tcustom_skin_images?: string;\n\tsection_type_id?: AchCustomSectionType;\n\ttheme?: AchCustomLayoutTheme;\n\tgeneric_custom_css?: string;\n\tmission_tabs_options?: AchMissionsTabsOptions;\n\toverview_missions_filter?: AchOverviewMissionsFilter;\n\toverview_missions_count?: number;\n\turl_or_dp?: string;\n\tliquid_entity_data?: LiquidEntityData[];\n\tach_tournament_id?: number;\n\traffle_id?: number;\n\tshow_raw_data?: boolean;\n\tliquid_template?: number;\n\tach_category_ids?: number[];\n\tshop_category_ids?: number[];\n}\n\nexport const UICustomSectionTransform = (response: GetCustomSectionsResponse): TUICustomSection[] => {\n\n\tconst items: TUICustomSection[] = [];\n\n\tObject.keys(response.customSections || []).forEach((key: string) => {\n\t\tconst r = response.customSections[key];\n\t\tconst id = parseInt(key);\n\t\tif (r.section_type_id !== undefined && r.section_type_id >= 1) {\n\t\t\tconst x: TUICustomSection = {\n\t\t\t\tid: id,\n\t\t\t\tbody: r.body,\n\t\t\t\tmenu_img: r.menu_img,\n\t\t\t\tmenu_name: r.menu_name,\n\t\t\t\tsection_type_id: r.section_type_id,\n\t\t\t\tcustom_skin_images: r.custom_skin_images,\n\t\t\t\tgeneric_custom_css: r.generic_custom_css,\n\t\t\t\tmission_tabs_options: r.mission_tabs_options,\n\t\t\t\toverview_missions_count: r.overview_missions_count,\n\t\t\t\toverview_missions_filter: r.overview_missions_filter,\n\t\t\t\turl_or_dp: r.url_or_dp,\n\t\t\t\ttheme: r.theme,\n\t\t\t\t...(r.section_type_id === AchCustomSectionType.LEVELS\n\t\t\t\t\t? {\n\t\t\t\t\t\tliquid_entity_data: r.liquid_entity_data,\n\t\t\t\t\t\tach_tournament_id: r.ach_tournament_id,\n\t\t\t\t\t\traffle_id: r.raffle_id,\n\t\t\t\t\t\tshow_raw_data: r.show_raw_data,\n\t\t\t\t\t\tliquid_template: r.liquid_template,\n\t\t\t\t\t}\n\t\t\t\t\t: {}\n\t\t\t\t),\n\t\t\t\t...(r.section_type_id === AchCustomSectionType.BADGES\n\t\t\t\t\t? {\n\t\t\t\t\t\tach_category_ids: r.ach_category_ids,\n\t\t\t\t\t}\n\t\t\t\t\t: {}\n\t\t\t\t),\n\t\t\t\t...(r.section_type_id === AchCustomSectionType.STORE\n\t\t\t\t\t? {\n\t\t\t\t\t\tshop_category_ids: r.shop_category_ids,\n\t\t\t\t\t}\n\t\t\t\t\t: {}\n\t\t\t\t),\n\t\t\t};\n\n\t\t\titems.push(x);\n\t\t}\n\t});\n\n\treturn items;\n};\n","import { BonusStatus } from './BonusStatus';\nimport { BonusTemplateMetaMap } from './BonusTemplateMetaMap';\nimport { BonusMetaMap } from './BonusMetaMap';\nimport { TBonus } from '../WSAPI/WSAPITypes';\n\nexport interface Bonus {\n\tid: number;\n\tredeemable?: boolean;\n\tcreateDate?: string;\n\tupdateDate?: string;\n\tredeemDate?: string;\n\tengagementUid?: string;\n\tlabelBonusTemplateId?: number;\n\tsourceProductRefId?: number;\n\tsourceProductId?: number;\n\tuserId?: number;\n\tbonusStatusId?: BonusStatus;\n\tlabelBonusTemplateMetaMap?: BonusTemplateMetaMap;\n\tbonusMetaMap?: BonusMetaMap;\n}\n\nexport const BonusItemsTransform = (items: Bonus[]): TBonus[] => {\n\treturn items\n\t\t.filter((r) => r.id >= 1)\n\t\t.map((r) => {\n\t\t\tconst x: TBonus = {\n\n              bonus_id: r.id,\n              is_redeemable: r.redeemable,\n              create_date: r.createDate,\n              redeem_date: r.redeemDate,\n              label_bonus_template_id: r.labelBonusTemplateId,\n              bonus_status_id: r.bonusStatusId,\n              label_bonus_template_meta_map: r.labelBonusTemplateMetaMap,\n              bonus_meta_map: r.bonusMetaMap\n\t\t\t};\n\n\t\t\treturn x;\n\t\t});\n};","export enum BonusStatus {\n\tNew = 1,\n\tCOUPON_ISSUED = 2,\n\tREDEEMED = 3,\n\tREDEEM_FAILED = 4, \n\tCOUPON_ISSUE_FAILED = 5, \n\tEXPIRED = 6, \n}","/** Activity-log entry type as returned on the wire (`type_id`). */\nexport enum ActivityLogActivities {\n\tGems = 1,\n\tDiamonds = 2,\n\tPoints = 3,\n\tLevelChanged = 4,\n\tBonus = 5,\n\tPrizeDrop = 6,\n\tMinigame = 7,\n\tRaffleTicket = 8,\n\tAvatar = 9,\n\tTask = 10,\n\tMission = 11,\n\tBadge = 12,\n\tTangiblePrize = 13,\n\tJackpot = 14,\n\tSpin = 15,\n\tNoPrize = 16,\n\tLeaderboard = 17,\n\tTournament = 18,\n\tClanTournament = 19,\n\tClan = 20,\n}\n","export enum UserBalanceType {\n    Points = 0,\n    Gems = 1,\n    Diamonds = 2\n}\n\n\n","import { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { ActivityLogEntry } from './ActivityLogEntry';\nimport { ActivityLogActivities } from './ActivityLogActivities';\nimport { TActivityLog } from '../WSAPI/WSAPITypes';\nimport { UserBalanceType } from './UserBalanceType';\n\nexport interface GetActivityLogResponse extends ProtocolResponse {\n\tlogHistory: ActivityLogEntry[];\n}\n\nexport const ActivityLogTransform = (items: ActivityLogEntry[]): TActivityLog[] => {\n\tif (!items) {\n\t\treturn [];\n\t}\n\n\treturn items.map((r: any): TActivityLog => {\n\t\t// The wire sends the activity kind as `type` (an ActivityLogActivities value).\n\t\t// `type_id` is accepted as an alias so an older/newer server spelling still maps.\n\t\tconst activityTypeId: ActivityLogActivities = r.type_id ?? r.type;\n\t\tconst isGems = activityTypeId === ActivityLogActivities.Gems;\n\t\tconst isDiamonds = activityTypeId === ActivityLogActivities.Diamonds;\n\t\tconst meta = r.ctx_meta ?? r.context_value_meta;\n\n\t\treturn {\n\t\t\tcreate_date: r.create_date?.seconds ?? r.create_date,\n\t\t\tuser_ext_id: r.user_ext_id,\n\t\t\t// Sent as a string on the wire.\n\t\t\tcrm_brand_id: Number(r.crm_brand_id),\n\t\t\ttype: isGems ? UserBalanceType.Gems : isDiamonds ? UserBalanceType.Diamonds : UserBalanceType.Points,\n\t\t\t// `amount` carries the real delta; `points_collected` is a `-1` placeholder on points rows.\n\t\t\tamount: r.amount ?? r.points_collected,\n\t\t\tbalance: r.user_points_balance ?? r.balance,\n\t\t\ttotal_ever: r.user_points_ever,\n\t\t\tsource_type_id: r.source_type_id,\n\t\t\tactivity_type_id: activityTypeId,\n\t\t\tcontext_value_1: r.ctx_1 ?? r.context_value_1,\n\t\t\tmeta,\n\t\t\t// Entity name travels inside the context meta, not as a top-level field.\n\t\t\tsource_entity_name: r.source_entity_name ?? meta?.name,\n\t\t\tsource_entity_id: r.source_entity_id,\n\t\t\tsource_reference_id: r.source_ref_id ?? r.source_reference_id,\n\t\t\tsource_root_id: r.source_root_id,\n\t\t\tis_wallet_entry:\n\t\t\t\tactivityTypeId == null\n\t\t\t\t|| activityTypeId === ActivityLogActivities.Gems\n\t\t\t\t|| activityTypeId === ActivityLogActivities.Diamonds\n\t\t\t\t|| activityTypeId === ActivityLogActivities.Points,\n\t\t};\n\t});\n};\n","export enum PointChangeSourceType {\n\tJourney = 1,\n\tAchievementTaskCompletion = 2,\n\tAchievementCompletion = 3,\n\tLevelsStructureChange = 4,\n\tStorePurchase = 5,\n\tManualAdjustment = 6,\n\tLeaderboard = 7,\n\tTournament = 11,\n\tAutomationRule = 12,\n\tTournamentRegistration = 13,\n\tTournamentRegistrationCancellation = 14,\n\tRefundPoints = 15,\n\tPlayMiniGame = 16,\n\tWinMiniGame = 17,\n\tAPI = 18,\n\tDynamicFormula = 19,\n\tJackpot = 20,\n\tRaffle = 21,\n\tAvatars = 22,\n\tClan = 23,\n}\n\n\n","import { TAvatarDefinition } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AvatarDefinition } from './AvatarDefinition';\n\nexport interface GetAvatarsListResponse extends ProtocolResponse {\n\tavatars: AvatarDefinition[];\n}\n\nexport const avatarDefinitionTransform = (items: AvatarDefinition[], avatarDomain: string): TAvatarDefinition[] => {\n\treturn items.map((item) => ({\n\t\tavatar_real_id: item.avatar_real_id,\n\t\tis_default: item.is_default,\n\t\thide_until_achieved: item.hide_until_achieved,\n\t\tpriority: item.priority,\n\t\tdescription: item.public_meta.description,\n\t\turl: item.public_meta.url,\n\t\tavatar_url: item.public_meta.url && !item.public_meta.url.startsWith('http') ? `${avatarDomain}${item.public_meta.url}` : item.public_meta.url,\n\t\tavatar_source_type_id: item.avatar_source_type_id,\n\t\tactive_from_date: item.active_from_date,\n\t\tactive_till_date: item.active_till_date,\n\t\tis_given: item.is_given,\n\t\tis_in_use: item.is_in_use,\n\t}));\n};\n","import { TAvatarCustomized } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AvatarCustomized } from './AvatarCustomized';\n\nexport interface GetAvatarsCustomizedResponse extends ProtocolResponse {\n\tavatars: AvatarCustomized[];\n}\n\nexport const avatarCustomizedTransform = (items: AvatarCustomized[], avatarDomain: string): TAvatarCustomized[] => {\n\treturn items.map((item) => ({\n\t\tavatar_real_id: item.avatar_real_id,\n\t\turl: item.url && !item.url.startsWith('http') ? `${avatarDomain}${item.url}` : item.url,\n\t\tdt_created: item.dt_created,\n\t}));\n};\n","import { TAvatarPrompt } from '../WSAPI/WSAPITypes';\nimport { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AvatarPrompt } from './AvatarPrompt';\n\nexport interface GetAvatarPromptsResponse extends ProtocolResponse {\n\tprompts: AvatarPrompt[];\n}\n\nexport const avatarPromptTransform = (items: AvatarPrompt[], avatarDomain: string): TAvatarPrompt[] => {\n\treturn items.map((item) => ({\n\t\tprompt_id: item.prompt_id,\n\t\tname: item.public_meta.name,\n\t\ticon_url: item.public_meta.icon_url && !item.public_meta.icon_url.startsWith('http') ? `${avatarDomain}${item.public_meta.icon_url}` : item.public_meta.icon_url,\n\t\tcost_currency_type_id: item.cost_currency_type_id,\n\t\tcost_value: item.cost_value,\n\t}));\n};\n","import { ProtocolResponse } from \"../Base/ProtocolResponse\";\nimport { JackPotWinner } from \"./JackPotWinner\";\n\nexport interface GetJackpotWinnersResponse extends ProtocolResponse {\n\t/** The list of jackpot winners */\n\twinners: JackpotWinnerHistory[];\n\t/** Whether there are more winners to fetch */\n\thas_more: boolean;\n}\n\nexport interface JackpotWinnerHistory {\n\t/** Id of the jackpot pot */\n\tjp_pot_id: number;\n\t/** Date of winning in milliseconds */\n\twin_date_ts: number;\n\t/** Info about jackpot winner */\n\twinner: JackPotWinner;\n}\n\n/**\n * @ignore\n */\nexport const GetJackpotWinnersResponseTransform = (items: JackpotWinnerHistory[]): JackpotWinnerHistory[] => {\n\treturn items.map((item) => {\n\t\tconst winnerInfo: JackpotWinnerHistory = {\n\t\t\twinner: item.winner,\n\t\t\twin_date_ts: item.win_date_ts,\n\t\t\tjp_pot_id: item.jp_pot_id,\n\t\t};\n\n\t\treturn winnerInfo;\n\t});\n};\n","import { ProtocolResponse } from '../Base/ProtocolResponse';\nimport { AchRelatedGame } from '../Base/AchRelatedGame';\n\nexport interface GetJackpotEligibleGamesResponse extends ProtocolResponse {\n\teligible_games: AchRelatedGame[];\n}\n\nexport interface TGetJackpotEligibleGamesResponse {\n\teligible_games: JackpotEligibleGame[];\n}\n\nexport interface JackpotEligibleGame {\n    /** ID of the game on Smartico side */\n\tgame_id: number;\n    /** ID of the game on operator side */\n    ext_game_id: string;\n    /** Name of the game */\n    name: string;\n    /** Link to the game */\n    link: string;\n    /** Image of the game */\n    image: string;\n    /** Whether the game is enabled */\n    enabled: boolean;\n    /** Categories of the game */\n    game_categories: string[];\n    /** Provider of the game */\n    game_provider: string;\n    /** The link to the mobile game */\n    mobile_spec_link: string;\n    /** The priority of the game */\n    priority: number;\n}\n\n/**\n * @ignore\n */\nexport const GetJackpotEligibleGamesResponseTransform = ({ eligible_games } : { eligible_games: AchRelatedGame[]}): TGetJackpotEligibleGamesResponse => {\n\tconst games = eligible_games.map((game: AchRelatedGame, i: number) => ({\n\t\tgame_id: game.ach_game_id,\n\t\text_game_id: game.ext_game_id,\n\t\tname: game.game_public_meta.name,\n\t\tlink: game.game_public_meta.link,\n\t\timage: game.game_public_meta.image,\n\t\tenabled: game.game_public_meta.enabled,\n\t\tgame_categories: game.game_public_meta.game_categories,\n\t\tgame_provider: game.game_public_meta.game_provider,\n\t\tmobile_spec_link: game.game_public_meta.mobile_spec_link,\n\t\tpriority: i + 1,\n\t}));\n\n\treturn { eligible_games: games };\n};\n","import { ClassId } from './Base/ClassId';\nimport { ProtocolRequest } from './Base/ProtocolRequest';\nimport { ProtocolResponse } from './Base/ProtocolResponse';\nimport { SAWGetTemplatesResponse } from './MiniGames/SAWGetTemplatesResponse';\nimport { SAWGetTemplatesRequest } from './MiniGames/SAWGetTemplatesRequest';\nimport { IntUtils } from './IntUtils';\nimport { ILogger } from './ILogger';\nimport {\n\tSAWDoAknowledgeRequest,\n\tSAWDoAknowledgeResponse,\n\tSAWDoSpinRequest,\n\tSAWDoSpinResponse,\n\tSAWHistoryTransform,\n\tSAWPrizesHistory,\n\tSAWSpinErrorCode,\n\tSAWTemplatesTransform,\n\tSAWWinningHistoryRequest,\n\tSAWWinningHistoryResponse,\n} from './MiniGames';\nimport { ECacheContext, OCache } from './OCache';\nimport {\n\tActivityTypeLimited,\n\tCoreUtils,\n\tGetTranslationsRequest,\n\tGetTranslationsResponse,\n\tPublicLabelSettings,\n\tResponseIdentify,\n\tTranslationArea,\n} from './Core';\nimport { GetLabelInfoResponse } from './Core/GetLabelInfoResponse';\nimport { GetLabelInfoRequest } from './Core/GetLabelInfoRequest';\nimport {\n\tGetInboxMessagesRequest,\n\tGetInboxMessagesResponse,\n\tInboxMessageBody,\n\tInboxMessageBodyTransform,\n\tInboxMessagesTransform,\n\tInboxReadStatus,\n\tMarkInboxMessageDeletedRequest,\n\tMarkInboxMessageDeletedResponse,\n\tMarkInboxMessageReadRequest,\n\tMarkInboxMessageReadResponse,\n\tMarkInboxMessageStarredRequest,\n\tMarkInboxMessageStarredResponse,\n} from './Inbox';\nimport {\n\tBuyStoreItemRequest,\n\tBuyStoreItemResponse,\n\tGetCategoriesStoreResponse,\n\tGetStoreHistoryRequest,\n\tGetStoreHistoryResponse,\n\tGetStoreItemsResponse,\n\tStoreCategoryTransform,\n\tStoreItemPurchasedTransform,\n\tStoreItemTransform,\n} from './Store';\nimport {\n\tAchCategoryTransform,\n\tAchClaimPrizeRequest,\n\tAchClaimPrizeResponse,\n\tAchievementOptinRequest,\n\tAchievementOptinResponse,\n\tAchievementType,\n\tGetAchCategoriesResponse,\n\tGetAchievementMapRequest,\n\tGetAchievementMapResponse,\n\tUserAchievementTransform,\n\tenrichUserAchievementsWithBadgeState,\n} from './Missions';\nimport {\n\tGetClanTournamentPlayersRequest,\n\tGetClanTournamentPlayersResponse,\n\tGetTournamentInfoRequest,\n\tGetTournamentInfoResponse,\n\tGetTournamentsRequest,\n\tGetTournamentsResponse,\n\tTournamentItemsTransform,\n\tTournamentRegisterRequest,\n\tTournamentRegisterResponse,\n\tclanTournamentPlayersTransform,\n\ttournamentInfoItemTransform,\n} from './Tournaments';\nimport { GetLeaderBoardsRequest, GetLeaderBoardsResponse, LeaderBoardDetails, LeaderBoardPeriodType } from './Leaderboard';\nimport { GetLevelMapResponse, GetLevelMapResponseTransform } from './Level';\nimport { WSAPI } from './WSAPI/WSAPI';\nimport {\n\tTInboxMessage,\n\tTInboxMessageBody,\n\tTLevel,\n\tTMiniGameTemplate,\n\tTMissionOrBadge,\n\tTStoreCategory,\n\tTAchCategory,\n\tTStoreItem,\n\tTTournament,\n\tTTournamentDetailed,\n\tLeaderBoardDetailsT,\n\tUserLevelExtraCountersT,\n\tTSegmentCheckResult,\n\tTUICustomSection,\n\tTBonus,\n\tTRaffle,\n\tTLevelCurrent,\n\tTActivityLog,\n\tTRaffleDraw,\n\tTAvatarDefinition,\n\tTAvatarCustomized,\n\tTAvatarPrompt,\n\tTClans,\n\tTClanInfo,\n\tTClanJoinResult,\n\tTClanTournamentPlayers,\n} from './WSAPI/WSAPITypes';\nimport { getLeaderBoardTransform } from './Leaderboard/LeaderBoards';\nimport { GetAchievementsUserInfoResponse } from './Core/GetAchievementsUserInfoResponse';\nimport { CheckSegmentMatchResponse } from './Core/CheckSegmentMatchResponse';\nimport { CheckSegmentMatchRequest } from './Core/CheckSegmentMatchRequest';\nimport {\n\tGetJackpotsPotsRequest,\n\tGetJackpotsPotsResponse,\n\tGetJackpotsRequest,\n\tGetJackpotsResponse,\n\tJackpotsOptinRequest,\n\tJackpotsOptinResponse,\n\tJackpotsOptoutRequest,\n\tJackpotsOptoutResponse,\n} from './Jackpots';\nimport { GetCustomSectionsRequest, GetCustomSectionsResponse, UICustomSectionTransform } from './CustomSections';\nimport { BonusItemsTransform, ClaimBonusRequest, ClaimBonusResponse, GetBonusesResponse } from './Bonuses';\nimport { GetBonusesRequest } from './Bonuses/GetBonusesRequest';\nimport { SAWDoSpinBatchResponse } from './MiniGames/SAWDoSpinBatchResponse';\nimport { SAWDoSpinBatchRequest } from './MiniGames/SAWDoSpinBatchRequest';\nimport { SAWDoAcknowledgeBatchRequest } from './MiniGames/SAWDoAcknowledgeBatchRequest';\nimport { SAWDoAcknowledgeBatchResponse } from './MiniGames/SAWDoAcknowledgeBatchResponse';\nimport { GetRelatedAchTourRequest } from './Missions/GetRelatedAchTourRequest';\nimport { GetRelatedAchTourResponse } from './Missions/GetRelatedAchTourResponse';\nimport { GetRafflesResponse, raffleTransform } from './Raffle/GetRafflesResponse';\nimport { GetRafflesRequest } from './Raffle/GetRafflesRequest';\nimport { GetActivityLogRequest, GetActivityLogResponse, ActivityLogTransform } from './ActivityLog';\nimport { GetClanListRequest, GetClanListResponse, GetClanInfoRequest, GetClanInfoResponse, JoinClanRequest, JoinClanResponse } from './Clans';\nimport { InboxCategories } from './Inbox/InboxCategories';\nimport { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse, RaffleClaimPrizeRequest, RaffleClaimPrizeResponse, RaffleOptinRequest, RaffleOptinResponse, drawRunTransform, GetRaffleWonPrizesRequest, GetRaffleWonPrizesResponse } from './Raffle';\nimport { GetAvatarsListResponse, avatarDefinitionTransform } from './Avatars/GetAvatarsListResponse';\nimport { GetAvatarsCustomizedResponse, avatarCustomizedTransform } from './Avatars/GetAvatarsCustomizedResponse';\nimport { GetAvatarPromptsResponse, avatarPromptTransform } from './Avatars/GetAvatarPromptsResponse';\nimport { SetAvatarRequest, SetAvatarResponse } from './Avatars';\nimport { AvatarCustomizeResponse } from './Avatars/AvatarCustomizeResponse';\nimport { GetJackpotWinnersResponse, GetJackpotWinnersResponseTransform, JackpotWinnerHistory } from './Jackpots/GetJackpotWinnersResponse';\nimport { GetJackpotWinnersRequest } from './Jackpots/GetJackpotWinnersRequest';\nimport { GetJackpotEligibleGamesRequest } from './Jackpots/GetJackpotEligibleGamesRequest';\nimport { GetJackpotEligibleGamesResponse, GetJackpotEligibleGamesResponseTransform, JackpotEligibleGame, TGetJackpotEligibleGamesResponse } from './Jackpots/GetJackpotEligibleGamesResponse';\nimport { GamePickGameInfo, GamePickRound, GamePickRoundBoard, GamePickUserInfo, GamesApiResponse } from './GamePick';\n\nconst PUBLIC_API_URL = 'https://papi{ENV_ID}.smartico.ai/services/public';\nconst C_SOCKET_PROD = 'wss://api{ENV_ID}.smartico.ai/websocket/services';\nconst GAMES_API_URL = 'https://r-games-api.smr.vc';\nconst AVATAR_DOMAIN = 'https://img{ENV_ID}.smr.vc';\nconst DEFAULT_LANG_EN = 'EN';\n\nconst SMR_TO_CLOUDFRONT_DOMAINS: { [key: string]: string } = {\n\t'img.smr.vc': 'd1am61onjxtys8.cloudfront.net',\n\t'img3.smr.vc': 'd3dubbodzd2q05.cloudfront.net',\n\t'img4.smr.vc': 'dvm0p9vsezqr2.cloudfront.net',\n\t'img5.smr.vc': 'd3gen1ksvxhac8.cloudfront.net',\n\t'img6.smr.vc': 'db1kmyg7iufeo.cloudfront.net',\n\t'img7.smr.vc': 'd36om2g86xefo6.cloudfront.net',\n\t'img8.smr.vc': 'd2zme31v54n5pb.cloudfront.net',\n\n\t'static.smr.vc': 'dtt380pweilws.cloudfront.net',\n\t'static3.smr.vc': 'd1qt8ake8g4imn.cloudfront.net',\n\t'static4.smr.vc': 'd146b4m7rkvjkw.cloudfront.net',\n\t'static5.smr.vc': 'd3l7suk1kl9rwh.cloudfront.net',\n\t'static6.smr.vc': 'd121pfj16xdfcq.cloudfront.net',\n\t'static7.smr.vc': 'd21deilz814qgl.cloudfront.net',\n\t'static8.smr.vc': 'd1uffsroxjy2ku.cloudfront.net',\n};\n\n// Single combined matcher built once, so a call is one pass instead of one per domain.\nconst SMR_DOMAIN_REGEX = new RegExp(\n\tObject.keys(SMR_TO_CLOUDFRONT_DOMAINS)\n\t\t.map((d) => d.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n\t\t.join('|'),\n\t'g',\n);\n\ninterface Tracker {\n\tlabel_api_key: string;\n\tuserPublicProps: any;\n\tparams?: { brand_key?: string };\n\ton: (callBackKey: ClassId, func: (data: any) => void) => void;\n\tgetLabelSetting: (key: PublicLabelSettings) => any;\n\ttriggerExternalCallBack: (callBackKey: string, payload: any) => void;\n\tgetExtUserId: () => string;\n}\ninterface IOptions {\n\tlogger?: ILogger;\n\tlogCIDs?: ClassId[];\n\tlogHTTPTiming?: boolean;\n\ttracker?: Tracker;\n\tbrand_api_key?: string;\n}\n\ntype MessageSender = (message: any, publicApuUrl?: string, expectCID?: ClassId) => Promise<any>;\n\nclass SmarticoAPI {\n\tprivate publicUrl: string;\n\tprivate wsUrl: string;\n\tprivate inboxCdnUrl: string;\n\tprivate partnerUrl: string;\n\tprivate gamesApiUrl: string;\n\tprivate baseRgApiParams: Record<string, string>;\n\tpublic avatarDomain: string;\n\tprivate avatarOriginDomain: string;\n\tprivate envId: number;\n\n\tprivate logger: ILogger;\n\tprivate logCIDs: ClassId[];\n\tprivate logHTTPTiming: boolean;\n\tpublic tracker?: Tracker;\n\n\tpublic constructor(\n\t\tprivate label_api_key: string,\n\t\tprivate brand_api_key: string,\n\t\tprivate messageSender: MessageSender,\n\t\toptions: IOptions = {},\n\t) {\n\t\tthis.logger = options.logger || (console as any);\n\n\t\tif (this.logger.always === undefined) {\n\t\t\tthis.logger.always = this.logger.info;\n\t\t}\n\n\t\tthis.logCIDs = options.logCIDs || [];\n\t\tthis.logHTTPTiming = options.logHTTPTiming || false;\n\t\tthis.tracker = options.tracker;\n\n\t\tthis.publicUrl = SmarticoAPI.getPublicUrl(label_api_key);\n\t\tthis.wsUrl = SmarticoAPI.getPublicWsUrl(label_api_key);\n\n\t\tif (this.tracker) {\n\t\t\t// available only for real users\n\t\t\tthis.baseRgApiParams = {\n\t\t\t\tenv_id: String(SmarticoAPI.getEnvId(label_api_key)),\n\t\t\t\tlabel_api_key: label_api_key,\n\t\t\t\tbrand_key: options.brand_api_key || this.tracker.params.brand_key,\n\t\t\t\thash: IntUtils.uuid(),\n\t\t\t}\n\t\t}\n\n\t\tthis.avatarDomain = SmarticoAPI.getAvatarUrl(label_api_key || options.tracker?.label_api_key);\n\t\tthis.avatarOriginDomain = SmarticoAPI.getAvatarOriginUrl(label_api_key || options.tracker?.label_api_key);\n\n\t\tthis.label_api_key = SmarticoAPI.getCleanLabelApiKey(label_api_key);\n\t}\n\n\tpublic static getEnvDnsSuffix(label_api_key: string): string {\n\t\tlet ENV_ID = label_api_key.length === 38 ? label_api_key.substring(37, 38) : '';\n\n\t\tif (ENV_ID === '1' || ENV_ID === '2') {\n\t\t\tENV_ID = '';\n\t\t}\n\t\treturn ENV_ID;\n\t}\n\n\tpublic static replaceSmrDomainsWithCloudfront<T>(value: string | { [key: string]: any }): T {\n\t\tif (!value) {\n\t\t\treturn value as T;\n\t\t}\n\n\t\tconst isString = typeof value === 'string';\n\t\tconst source = isString ? (value as string) : JSON.stringify(value);\n\t\tif (!source.includes('smr.vc')) return value as T;   // ← skip even the regex\n\n\t\tconst replaced = source.replace(SMR_DOMAIN_REGEX, (match) => SMR_TO_CLOUDFRONT_DOMAINS[match]);\n\n\t\t// No domain matched: skip the JSON re-parse and return the input untouched.\n\t\tif (replaced === source) {\n\t\t\treturn value as T;\n\t\t}\n\n\t\tif (isString) {\n\t\t\treturn replaced as T;\n\t\t}\n\n\t\ttry {\n\t\t\treturn JSON.parse(replaced);\n\t\t} catch (err) {\n\t\t\treturn value as T;\n\t\t}\n\t}\n\n\tpublic static getEnvId(label_api_key: string): number {\n\t\treturn label_api_key.length === 38 ? parseInt(label_api_key.substring(37, 38), 10) : 2;\n\t}\n\n\tpublic static getCleanLabelApiKey(label_api_key: string): string {\n\t\treturn label_api_key.substring(0, 36);\n\t}\n\n\tpublic static getPublicUrl(label_api_key: string): string {\n\t\treturn PUBLIC_API_URL.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t}\n\n\tpublic static getPublicWsUrl(label_api_key: string): string {\n\t\treturn C_SOCKET_PROD.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t}\n\n\tpublic static getAvatarUrl(label_api_key: string): string {\n\t\tconst avatarUrl = AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t\treturn SmarticoAPI.replaceSmrDomainsWithCloudfront(avatarUrl);\n\t}\n\n\tpublic static getAvatarOriginUrl(label_api_key: string): string {\n\t\treturn AVATAR_DOMAIN.replace('{ENV_ID}', SmarticoAPI.getEnvDnsSuffix(label_api_key));\n\t}\n\n\tprivate async send<T>(message: any, expectCID?: ClassId, force_language?: string): Promise<T> {\n\t\tif (this.logCIDs.includes(message.cid)) {\n\t\t\tthis.logger.info('REQ', message);\n\t\t}\n\n\t\tif (force_language) {\n\t\t\tmessage.force_language = force_language;\n\t\t}\n\n\t\tlet result: any;\n\n\t\ttry {\n\t\t\tconst timeStart = new Date().getTime();\n\t\t\tresult = await this.messageSender(message, this.publicUrl, expectCID);\n\n\t\t\tif (result.errCode && result.errSetup) {\n\t\t\t\tthrow new Error(result.errMessage);\n\t\t\t}\n\n\t\t\tresult = SmarticoAPI.replaceSmrDomainsWithCloudfront(result);\n\t\t\tconst timeEnd = new Date().getTime();\n\n\t\t\tif (this.logHTTPTiming) {\n\t\t\t\tthis.logger.always('HTTP time, ms:' + (timeEnd - timeStart));\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tthis.logger.warn(`Failed to make request to smartico channel, L2. ${e.message}`, {\n\t\t\t\turl: this.publicUrl,\n\t\t\t\trequest: message,\n\t\t\t\terror: e.message,\n\t\t\t});\n\t\t\tthrow new Error(`Failed to make request to smartico channel, L2 L1. ${e.message}`);\n\t\t}\n\n\t\tif (this.logCIDs.includes(message.cid)) {\n\t\t\tthis.logger.info('RES', result);\n\t\t}\n\n\t\tif (expectCID) {\n\t\t\tif (Array.isArray(result)) {\n\t\t\t\tfor (const str of result as string[]) {\n\t\t\t\t\tconst obj: ProtocolResponse = JSON.parse(str);\n\t\t\t\t\tif (this.logCIDs.includes(obj.cid)) {\n\t\t\t\t\t\tthis.logger.info('RES', result);\n\t\t\t\t\t}\n\t\t\t\t\tif (obj.cid === expectCID) {\n\t\t\t\t\t\treturn obj as any;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.logger.error(`Cant find proper response in array, expected CID ${expectCID}`, {\n\t\t\t\t\trequest: message,\n\t\t\t\t\tresponse: result,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t} else {\n\t\t\tif (Array.isArray(result)) {\n\t\t\t\tif (result.length === 1) {\n\t\t\t\t\tconst obj = JSON.parse(result[0]);\n\t\t\t\t\tif (this.logCIDs.includes(obj.cid)) {\n\t\t\t\t\t\tthis.logger.info('RES', result);\n\t\t\t\t\t}\n\t\t\t\t\treturn obj;\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.error('Expected one response, but got array', { request: message, response: result });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tprivate buildMessage<TRequest, TResponse>(user_ext_id: string, cid: ClassId, payload: Partial<TRequest> = {}): TResponse {\n\t\tconst message: ProtocolRequest = {\n\t\t\t// AA: in fact we need api and brand keys and ext_user_id only in the context of HTTP\n\t\t\t// its not needed in WebSocket and can be deleted\n\t\t\tapi_key: this.label_api_key,\n\t\t\tbrand_key: this.brand_api_key,\n\t\t\text_user_id: user_ext_id,\n\t\t\tcid,\n\t\t\tuuid: IntUtils.uuid(),\n\t\t\tts: new Date().getTime(),\n\t\t\t...payload,\n\t\t};\n\n\t\tif (message.ext_user_id === undefined || message.ext_user_id === null) {\n\t\t\tdelete message.ext_user_id;\n\t\t}\n\n\t\tif (message.brand_key === undefined || message.brand_key === null) {\n\t\t\tdelete message.brand_key;\n\t\t}\n\n\t\treturn message as any;\n\t}\n\n\tpublic async coreReportCustomEvent(user_ext_id: string, eventType: string, payload: any = {}): Promise<any> {\n\t\tconst eventMessage = this.buildMessage<any, any>(user_ext_id, ClassId.EVENT, {\n\t\t\teventType,\n\t\t\tpayload,\n\t\t});\n\n\t\tconst eventResponse = await this.send<any>(eventMessage, ClassId.EVENT_RESPONSE);\n\t\treturn eventResponse;\n\t}\n\n\tpublic async coreGetTranslations(\n\t\tuser_ext_id: string,\n\t\tlang_code: string,\n\t\tareas: TranslationArea[],\n\t\tcacheSec: number = 60,\n\t): Promise<GetTranslationsResponse> {\n\t\tif (lang_code === undefined || lang_code === null || (lang_code.trim && lang_code.trim() === '')) {\n\t\t\tlang_code = DEFAULT_LANG_EN;\n\t\t}\n\n\t\tconst response = await OCache.use<GetTranslationsResponse>(\n\t\t\t`${lang_code}-${this.label_api_key}-${this.brand_api_key}`,\n\t\t\tECacheContext.Translations,\n\t\t\tasync () => {\n\t\t\t\tconst tsBaseRQ = this.buildMessage<GetTranslationsRequest, GetTranslationsResponse>(\n\t\t\t\t\tuser_ext_id,\n\t\t\t\t\tClassId.GET_TRANSLATIONS_REQUEST,\n\t\t\t\t\t{\n\t\t\t\t\t\tlang_code: DEFAULT_LANG_EN,\n\t\t\t\t\t\thash_code: null,\n\t\t\t\t\t\tareas,\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tconst trBase = await this.send<GetTranslationsResponse>(tsBaseRQ, ClassId.GET_TRANSLATIONS_RESPONSE);\n\n\t\t\t\tif (lang_code !== DEFAULT_LANG_EN) {\n\t\t\t\t\tconst trUserRQ = this.buildMessage<GetTranslationsRequest, GetTranslationsResponse>(\n\t\t\t\t\t\tuser_ext_id,\n\t\t\t\t\t\tClassId.GET_TRANSLATIONS_REQUEST,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlang_code,\n\t\t\t\t\t\t\thash_code: null,\n\t\t\t\t\t\t\tareas,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\tconst trUser = await this.send<GetTranslationsResponse>(trUserRQ, ClassId.GET_TRANSLATIONS_RESPONSE);\n\n\t\t\t\t\tObject.keys(trUser?.translations ?? {}).forEach((k) => {\n\t\t\t\t\t\ttrBase.translations[k] = trUser.translations[k];\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn trBase;\n\t\t\t},\n\t\t\tcacheSec,\n\t\t);\n\n\t\treturn response;\n\t}\n\n\tpublic async coreIdentifyLabel(user_ext_id: string, cacheSec: number = 60): Promise<GetLabelInfoResponse> {\n\t\treturn OCache.use<GetLabelInfoResponse>(\n\t\t\t`${this.label_api_key} - ${this.brand_api_key}`,\n\t\t\tECacheContext.LabelInfo,\n\t\t\tasync () => {\n\t\t\t\tconst message = this.buildMessage<GetLabelInfoRequest, GetLabelInfoResponse>(user_ext_id, ClassId.INIT);\n\n\t\t\t\treturn this.send<GetLabelInfoResponse>(message, ClassId.INIT_RESPONSE);\n\t\t\t},\n\t\t\tcacheSec,\n\t\t);\n\t}\n\n\tpublic async coreIdentifyUser(user_ext_id: string): Promise<ResponseIdentify> {\n\t\tconst message = this.buildMessage<any, ResponseIdentify>(user_ext_id, ClassId.IDENTIFY, {\n\t\t\trequest_id: IntUtils.uuid(), // AA: do we need request_id?\n\t\t});\n\n\t\tconst r = await this.send<ResponseIdentify>(message, ClassId.IDENTIFY_RESPONSE);\n\n\t\tr.avatar_id = CoreUtils.avatarUrl(r.avatar_id, this.avatarDomain);\n\n\t\treturn r;\n\t}\n\n\tpublic async coreChangeUsername(\n\t\tuser_ext_id: string,\n\t\tpublic_username_custom: string,\n\t): Promise<{ public_username_custom: string }> {\n\t\tconst message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_SET_CUSTOM_USERNAME_REQUEST, {\n\t\t\tpublic_username_custom,\n\t\t});\n\n\t\treturn await this.send(message, ClassId.CLIENT_SET_CUSTOM_USERNAME_RESPONSE);\n\t}\n\n\tpublic async coreCheckSegments(user_ext_id: string, segment_id: number[]): Promise<TSegmentCheckResult[]> {\n\t\tconst message = this.buildMessage<CheckSegmentMatchRequest, any>(user_ext_id, ClassId.CHECK_SEGMENT_MATCH_REQUEST, {\n\t\t\tsegment_id,\n\t\t});\n\n\t\tconst results = await this.send<CheckSegmentMatchResponse>(message, ClassId.CHECK_SEGMENT_MATCH_RESPONSE);\n\n\t\treturn results.segments || [];\n\t}\n\n\t/**\n\t * Reports an engagement impression event (when engagement content is displayed to the user).\n\t */\n\tpublic reportEngagementImpression(\n\t\tuser_ext_id: string,\n\t\tengagement_uid: string,\n\t\tactivityType: ActivityTypeLimited | number,\n\t): void {\n\t\tconst message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_ENGAGEMENT_IMPRESSION_REQUEST, {\n\t\t\tengagement_uid,\n\t\t\tactivityType,\n\t\t});\n\n\t\tthis.send(message).catch(() => { });\n\t}\n\n\t/**\n\t * Reports an engagement action event (when user clicks/interacts with engagement content).\n\t */\n\tpublic reportEngagementAction(\n\t\tuser_ext_id: string,\n\t\tengagement_uid: string,\n\t\tactivityType: ActivityTypeLimited | number,\n\t\taction?: string,\n\t): void {\n\t\tconst message = this.buildMessage<any, any>(user_ext_id, ClassId.CLIENT_ENGAGEMENT_ACTION_REQUEST, {\n\t\t\tengagement_uid,\n\t\t\tactivityType,\n\t\t\t...(action && { action }),\n\t\t});\n\n\t\tthis.send(message).catch(() => { });\n\t}\n\n\tpublic async jackpotGet(\n\t\tuser_ext_id: string,\n\t\tfilter?: { related_game_id?: string; jp_template_id?: number },\n\t\tforce_language?: string,\n\t): Promise<GetJackpotsResponse> {\n\t\tconst message = this.buildMessage<GetJackpotsRequest, GetJackpotsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_JACKPOTS_REQUEST,\n\t\t\tfilter,\n\t\t);\n\t\treturn await this.send<GetJackpotsResponse>(message, ClassId.JP_GET_JACKPOTS_RESPONSE, force_language);\n\t}\n\n\tpublic async potGet(user_ext_id: string, filter: { jp_template_ids: number[] }): Promise<GetJackpotsPotsResponse> {\n\t\tconst message = this.buildMessage<GetJackpotsPotsRequest, GetJackpotsPotsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_LATEST_POTS_REQUEST,\n\t\t\tfilter,\n\t\t);\n\t\treturn await this.send<GetJackpotsPotsResponse>(message, ClassId.JP_GET_LATEST_POTS_RESPONSE);\n\t}\n\n\tpublic async jackpotOptIn(user_ext_id: string, payload: { jp_template_id: number }): Promise<JackpotsOptinResponse> {\n\t\tconst message = this.buildMessage<JackpotsOptinRequest, JackpotsOptinResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_OPTIN_REQUEST,\n\t\t\tpayload,\n\t\t);\n\t\treturn await this.send<JackpotsOptinResponse>(message, ClassId.JP_OPTIN_RESPONSE);\n\t}\n\n\tpublic async jackpotOptOut(user_ext_id: string, payload: { jp_template_id: number }): Promise<JackpotsOptoutResponse> {\n\t\tconst message = this.buildMessage<JackpotsOptoutRequest, JackpotsOptoutResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_OPTOUT_REQUEST,\n\t\t\tpayload,\n\t\t);\n\t\treturn await this.send<JackpotsOptoutResponse>(message, ClassId.JP_OPTOUT_RESPONSE);\n\t}\n\n\tpublic async getJackpotWinners(user_ext_id: string, limit: number = 20, offset: number = 0, jp_template_id: number): Promise<GetJackpotWinnersResponse> {\n\t\tconst message = this.buildMessage<GetJackpotWinnersRequest, GetJackpotWinnersResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_WINNERS_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t\tjp_template_id,\n\t\t\t},\n\t\t);\n\t\treturn await this.send<GetJackpotWinnersResponse>(message, ClassId.JP_GET_WINNERS_RESPONSE);\n\t}\n\n\tpublic async getJackpotWinnersT(user_ext_id: string, limit: number = 20, offset: number = 0, jp_template_id: number): Promise<JackpotWinnerHistory[]> {\n\t\treturn GetJackpotWinnersResponseTransform((await this.getJackpotWinners(user_ext_id, limit, offset, jp_template_id)).winners);\n\t}\n\n\tpublic async getJackpotEligibleGames(user_ext_id: string, { jp_template_id }: { jp_template_id: number }): Promise<GetJackpotEligibleGamesResponse> {\n\t\tconst message = this.buildMessage<GetJackpotEligibleGamesRequest, GetJackpotEligibleGamesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JP_GET_ELIGIBLE_GAMES_REQUEST,\n\t\t\t{ jp_template_id },\n\t\t);\n\n\t\treturn await this.send<GetJackpotEligibleGamesResponse>(message, ClassId.JP_GET_ELIGIBLE_GAMES_RESPONSE);\n\t}\n\n\tpublic async getJackpotEligibleGamesT(user_ext_id: string, { jp_template_id }: { jp_template_id: number }): Promise<TGetJackpotEligibleGamesResponse> {\n\t\treturn GetJackpotEligibleGamesResponseTransform(await this.getJackpotEligibleGames(user_ext_id, { jp_template_id }));\n\t}\n\n\tpublic async sawGetTemplates(\n\t\tuser_ext_id: string,\n\t\tforce_language?: string,\n\t\tis_visitor_mode: boolean = false,\n\t): Promise<SAWGetTemplatesResponse> {\n\t\tconst message = this.buildMessage<SAWGetTemplatesRequest, SAWGetTemplatesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.SAW_GET_SPINS_REQUEST,\n\t\t\t{ is_visitor_mode },\n\t\t);\n\n\t\tconst response = await this.send<SAWGetTemplatesResponse>(message, ClassId.SAW_GET_SPINS_RESPONSE, force_language);\n\n\t\tif (response && response.templates) {\n\t\t\tresponse.templates.forEach((t) => {\n\t\t\t\tif (t.jackpot_current !== undefined && t.jackpot_current !== null) {\n\t\t\t\t\tconst jackpotValue =\n\t\t\t\t\t\tt.jackpot_current +\n\t\t\t\t\t\t(t.saw_template_ui_definition?.jackpot_symbol ? ' ' + t.saw_template_ui_definition?.jackpot_symbol : '');\n\t\t\t\t\tt.saw_template_ui_definition.name = IntUtils.replaceAll(\n\t\t\t\t\t\tt.saw_template_ui_definition.name,\n\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t);\n\t\t\t\t\tt.saw_template_ui_definition.description = IntUtils.replaceAll(\n\t\t\t\t\t\tt.saw_template_ui_definition.description,\n\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t);\n\t\t\t\t\tt.saw_template_ui_definition.promo_text = IntUtils.replaceAll(\n\t\t\t\t\t\tt.saw_template_ui_definition.promo_text,\n\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t);\n\t\t\t\t\tt.prizes.forEach((p) => {\n\t\t\t\t\t\tp.saw_prize_ui_definition.name = IntUtils.replaceAll(\n\t\t\t\t\t\t\tp.saw_prize_ui_definition.name,\n\t\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tp.saw_prize_ui_definition.aknowledge_message = IntUtils.replaceAll(\n\t\t\t\t\t\t\tp.saw_prize_ui_definition.aknowledge_message,\n\t\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tp.saw_prize_ui_definition.aknowledge_message_lose = IntUtils.replaceAll(\n\t\t\t\t\t\t\tp.saw_prize_ui_definition.aknowledge_message_lose,\n\t\t\t\t\t\t\t'{{jackpot}}',\n\t\t\t\t\t\t\tjackpotValue,\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn response;\n\t}\n\n\tpublic async sawGetTemplatesT(user_ext_id: string): Promise<TMiniGameTemplate[]> {\n\t\treturn SAWTemplatesTransform((await this.sawGetTemplates(user_ext_id)).templates);\n\t}\n\n\tpublic async doAcknowledgeRequest(user_ext_id: string, request_id: string, lose?: boolean): Promise<SAWDoAknowledgeResponse> {\n\t\tconst message = this.buildMessage<SAWDoAknowledgeRequest, SAWDoAknowledgeResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.SAW_AKNOWLEDGE_REQUEST,\n\t\t\t{\n\t\t\t\trequest_id,\n\t\t\t\tlose,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<SAWDoAknowledgeResponse>(message, ClassId.SAW_AKNOWLEDGE_RESPONSE);\n\t}\n\n\tpublic async sawSpinRequest(user_ext_id: string, saw_template_id: number, round_id?: number): Promise<SAWDoSpinResponse> {\n\t\tif (!saw_template_id) {\n\t\t\tthrow new Error('Missing template id');\n\t\t}\n\n\t\tconst request_id = IntUtils.uuid();\n\n\t\tconst message = this.buildMessage<SAWDoSpinRequest, SAWDoSpinResponse>(user_ext_id, ClassId.SAW_DO_SPIN_REQUEST, {\n\t\t\tsaw_template_id,\n\t\t\trequest_id,\n\t\t});\n\n\t\tconst spinAttemptResponse = await this.send<SAWDoSpinResponse>(message, ClassId.SAW_DO_SPIN_RESPONSE);\n\n\t\t// to simulate fail\n\t\t// response.errCode = SAWSpinErrorCode.SAW_NO_SPINS;\n\n\t\tconst status: string =\n\t\t\t{\n\t\t\t\t[SAWSpinErrorCode.SAW_OK]: 'OK',\n\t\t\t\t[SAWSpinErrorCode.SAW_NO_SPINS]: 'NO SPINS AVAILABLE',\n\t\t\t\t[SAWSpinErrorCode.SAW_PRIZE_POOL_EMPTY]: 'PRIZE POOL IS EMPTY',\n\t\t\t\t[SAWSpinErrorCode.SAW_NOT_ENOUGH_POINTS]: 'NOT ENOUGH POINTS',\n\t\t\t\t[SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED]: 'MAX SPIN ATTEMPTS REACHED',\n\t\t\t\t[SAWSpinErrorCode.SAW_TEMPLATE_NOT_ACTIVE]: \"MINIGAME IS NOT IN ACTIVE PERIOD\",\n\t\t\t\t[SAWSpinErrorCode.SAW_NOT_IN_SEGMENT]: \"USER IS NOT IN SEGMENT\",\n\t\t\t\t[SAWSpinErrorCode.SAW_NO_BALANCE_GEMS]: \"NOT ENOUGH GEMS\",\n\t\t\t\t[SAWSpinErrorCode.SAW_NO_BALANCE_DIAMONDS]: \"NOT ENOUGH DIAMONDS\",\n\t\t\t}[spinAttemptResponse.errCode] || 'OTHER';\n\n\t\tawait this.coreReportCustomEvent(user_ext_id, 'minigame_attempt', {\n\t\t\tsaw_template_id,\n\t\t\tstatus,\n\t\t\tround_id,\n\t\t});\n\n\t\treturn { ...spinAttemptResponse, request_id };\n\t}\n\n\n\tpublic async doAcknowledgeBatchRequest(user_ext_id: string, request_ids: string[]): Promise<SAWDoAcknowledgeBatchResponse> {\n\t\tconst message = this.buildMessage<SAWDoAcknowledgeBatchRequest, SAWDoAcknowledgeBatchResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.SAW_AKNOWLEDGE_REQUEST,\n\t\t\t{\n\t\t\t\trequest_ids,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<SAWDoAcknowledgeBatchResponse>(message, ClassId.SAW_AKNOWLEDGE_BATCH_RESPONSE);\n\t}\n\n\tpublic async sawSpinBatchRequest(user_ext_id: string, saw_template_id: number, spins_count: number): Promise<SAWDoSpinBatchResponse> {\n\n\t\tconst spins = [];\n\t\tfor (let i = 0; i < spins_count; i++) {\n\t\t\tconst request_id = IntUtils.uuid();\n\t\t\tspins.push({ request_id, saw_template_id })\n\t\t}\n\n\t\tconst message = this.buildMessage<SAWDoSpinBatchRequest, SAWDoSpinBatchResponse>(user_ext_id, ClassId.SAW_DO_SPIN_BATCH_REQUEST, { spins });\n\t\tconst spinAttemptResponse = await this.send<SAWDoSpinBatchResponse>(message, ClassId.SAW_DO_SPIN_BATCH_RESPONSE);\n\n\t\t// If one response is 'OK' we consider that whole result is 'OK'\n\t\tconst result = spinAttemptResponse.results.find((res) => res.errCode === 0);\n\n\t\tlet status = 'OK';\n\t\tif (!result) {\n\t\t\tstatus = 'BATCH FAIL';\n\t\t}\n\n\t\tawait this.coreReportCustomEvent(user_ext_id, 'minigame_attempt', {\n\t\t\tsaw_template_id,\n\t\t\tstatus,\n\t\t\tspins_count,\n\t\t});\n\n\t\treturn { ...spinAttemptResponse };\n\t}\n\n\tpublic async getSawWinningHistory(user_ext_id: string, limit: number = 20, offset: number = 0, saw_template_id: number): Promise<SAWWinningHistoryResponse> {\n\t\tconst message = this.buildMessage<SAWWinningHistoryRequest, SAWWinningHistoryResponse>(user_ext_id, ClassId.GET_SAW_HISTORY_REQUEST, {\n\t\t\tlimit, offset, saw_template_id\n\t\t})\n\n\t\treturn await this.send<SAWWinningHistoryResponse>(message, ClassId.GET_SAW_HISTORY_RESPONSE);\n\t}\n\n\tpublic async getSawWinningHistoryT(user_ext_id: string, limit?: number, offset?: number, saw_template_id?: number): Promise<SAWPrizesHistory[]> {\n\t\tif (IntUtils.isNotNull(limit) && IntUtils.isNotNull(offset) && limit > 50) {\n\t\t\tlimit = 50;\n\t\t}\n\t\treturn SAWHistoryTransform((await this.getSawWinningHistory(user_ext_id, limit, offset, saw_template_id)).prizes);\n\t}\n\n\tpublic async missionOptIn(user_ext_id: string, mission_id: number) {\n\t\tif (!mission_id) {\n\t\t\tthrow new Error('Missing mission id');\n\t\t}\n\t\tconst message = this.buildMessage<AchievementOptinRequest, AchievementOptinResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MISSION_OPTIN_REQUEST,\n\t\t\t{\n\t\t\t\tachievementId: mission_id,\n\t\t\t},\n\t\t);\n\n\t\tconst res = await this.send<AchievementOptinResponse>(message, ClassId.MISSION_OPTIN_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async missionClaimPrize(user_ext_id: string, mission_id: number, ach_completed_id: number) {\n\t\tif (!mission_id) {\n\t\t\tthrow new Error('Missing mission id');\n\t\t}\n\n\t\tconst message = this.buildMessage<AchClaimPrizeRequest, AchClaimPrizeResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.ACHIEVEMENT_CLAIM_PRIZE_REQUEST,\n\t\t\t{\n\t\t\t\tach_id: mission_id,\n\t\t\t\tach_completed_id: ach_completed_id,\n\t\t\t},\n\t\t);\n\n\t\tconst res = await this.send<AchClaimPrizeResponse>(message, ClassId.ACHIEVEMENT_CLAIM_PRIZE_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async registerInTournament(user_ext_id: string, tournamentInstanceId: number) {\n\t\tif (!tournamentInstanceId) {\n\t\t\tthrow new Error('Missing tournament instance id');\n\t\t}\n\t\tconst message = this.buildMessage<TournamentRegisterRequest, TournamentRegisterResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.TOURNAMENT_REGISTER_REQUEST,\n\t\t\t{\n\t\t\t\ttournamentInstanceId,\n\t\t\t},\n\t\t);\n\n\t\tconst res = await this.send<TournamentRegisterResponse>(message, ClassId.TOURNAMENT_REGISTER_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async buyStoreItem(user_ext_id: string, itemId: number) {\n\t\tif (!itemId) {\n\t\t\tthrow new Error('Missing store item id');\n\t\t}\n\t\tconst message = this.buildMessage<BuyStoreItemRequest, BuyStoreItemResponse>(user_ext_id, ClassId.BUY_SHOP_ITEM_REQUEST, {\n\t\t\titemId,\n\t\t});\n\n\t\tconst res = await this.send<BuyStoreItemResponse>(message, ClassId.BUY_SHOP_ITEM_RESPONSE);\n\n\t\treturn res;\n\t}\n\n\tpublic async inboxGetMessages(\n\t\tuser_ext_id: string,\n\t\tlimit: number = 10,\n\t\toffset: number = 0,\n\t): Promise<GetInboxMessagesResponse> {\n\t\tconst message = this.buildMessage<GetInboxMessagesRequest, GetInboxMessagesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_INBOX_MESSAGES_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<GetInboxMessagesResponse>(message, ClassId.GET_INBOX_MESSAGES_RESPONSE);\n\t}\n\n\tpublic async storeGetItems(user_ext_id: string, force_language?: string): Promise<GetStoreItemsResponse> {\n\t\tconst message = this.buildMessage<any, GetStoreItemsResponse>(user_ext_id, ClassId.GET_SHOP_ITEMS_REQUEST);\n\t\treturn await this.send<GetStoreItemsResponse>(message, ClassId.GET_SHOP_ITEMS_RESPONSE, force_language);\n\t}\n\n\tpublic async storeGetItemsT(user_ext_id: string): Promise<TStoreItem[]> {\n\t\treturn StoreItemTransform((await this.storeGetItems(user_ext_id)).items);\n\t}\n\n\tpublic async storeGetCategories(user_ext_id: string, force_language?: string): Promise<GetCategoriesStoreResponse> {\n\t\tconst message = this.buildMessage<any, GetCategoriesStoreResponse>(user_ext_id, ClassId.GET_SHOP_CATEGORIES_REQUEST);\n\t\treturn await this.send<GetCategoriesStoreResponse>(message, ClassId.GET_SHOP_CATEGORIES_RESPONSE, force_language);\n\t}\n\n\tpublic async storeGetCategoriesT(user_ext_id: string): Promise<TStoreCategory[]> {\n\t\treturn StoreCategoryTransform((await this.storeGetCategories(user_ext_id)).categories);\n\t}\n\n\tpublic async storeGetPurchasedItems(\n\t\tuser_ext_id: string,\n\t\tlimit: number = 20,\n\t\toffset: number = 0,\n\t): Promise<GetStoreHistoryResponse> {\n\t\tconst message = this.buildMessage<GetStoreHistoryRequest, GetStoreHistoryResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.ACH_SHOP_ITEM_HISTORY_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<GetStoreHistoryResponse>(message, ClassId.ACH_SHOP_ITEM_HISTORY_RESPONSE);\n\t}\n\n\tpublic async storeGetPurchasedItemsT(user_ext_id: string, limit?: number, offset?: number): Promise<TStoreItem[]> {\n\t\tif (IntUtils.isNotNull(limit) && IntUtils.isNotNull(offset) && limit > 50) {\n\t\t\tlimit = 50;\n\t\t}\n\t\treturn StoreItemPurchasedTransform((await this.storeGetPurchasedItems(user_ext_id, limit, offset)).items);\n\t}\n\n\tpublic async missionsGetItems(user_ext_id: string, force_language?: string): Promise<GetAchievementMapResponse> {\n\t\tconst message = this.buildMessage<GetAchievementMapRequest, GetAchievementMapResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_REQUEST,\n\t\t);\n\t\tconst response = await this.send<GetAchievementMapResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\t\t// we need to clone response to avoid changing original object,for cases when its called together with badgesGetItems (e.g. in Promise.all)\n\t\tconst responseClone = { ...response };\n\n\t\tif (responseClone.achievements) {\n\t\t\tresponseClone.achievements = responseClone.achievements.filter((a) => a.ach_type_id === AchievementType.Mission);\n\t\t}\n\t\treturn responseClone;\n\t}\n\n\tpublic async missionsGetItemsT(user_ext_id: string): Promise<TMissionOrBadge[]> {\n\t\treturn UserAchievementTransform((await this.missionsGetItems(user_ext_id)).achievements);\n\t}\n\n\tpublic async getUserGamificationInfo(user_ext_id: string): Promise<GetAchievementsUserInfoResponse> {\n\t\tconst message = this.buildMessage<GetAchievementMapRequest, GetAchievementsUserInfoResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_ACHIEVEMENT_USER_REQUEST,\n\t\t);\n\n\t\treturn await this.send<GetAchievementsUserInfoResponse>(message, ClassId.GET_ACHIEVEMENT_USER_RESPONSE);\n\t}\n\n\tpublic async getUserGamificationInfoT(user_ext_id: string): Promise<UserLevelExtraCountersT> {\n\t\tconst response = await this.getUserGamificationInfo(user_ext_id);\n\n\t\treturn {\n\t\t\tlevel_counter_1: response.level_counter_1,\n\t\t\tlevel_counter_2: response.level_counter_2,\n\t\t};\n\t}\n\n\tpublic async achGetCategories(user_ext_id: string, force_language?: string): Promise<GetAchCategoriesResponse> {\n\t\tconst message = this.buildMessage<any, GetAchCategoriesResponse>(user_ext_id, ClassId.GET_ACH_CATEGORIES_REQUEST);\n\t\treturn await this.send<GetAchCategoriesResponse>(message, ClassId.GET_ACH_CATEGORIES_RESPONSE, force_language);\n\t}\n\n\tpublic async achGetCategoriesT(user_ext_id: string): Promise<TAchCategory[]> {\n\t\treturn AchCategoryTransform((await this.achGetCategories(user_ext_id)).categories);\n\t}\n\n\tpublic async badgetsGetItems(user_ext_id: string, force_language?: string): Promise<GetAchievementMapResponse> {\n\t\tconst message = this.buildMessage<GetAchievementMapRequest, GetAchievementMapResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_REQUEST,\n\t\t);\n\t\tconst response = await this.send<GetAchievementMapResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_ACHIEVEMENT_MAP_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\t\t// we need to clone response to avoid changing original object,for cases when its called together with missionsGetItems (e.g. in Promise.all)\n\t\tconst responseClone = { ...response };\n\n\t\tif (responseClone.achievements) {\n\t\t\tresponseClone.achievements = responseClone.achievements.filter((a) => a.ach_type_id === AchievementType.Badge);\n\t\t\tresponseClone.achievements = enrichUserAchievementsWithBadgeState(responseClone.achievements);\n\t\t}\n\t\treturn responseClone;\n\t}\n\n\tpublic async bonusesGetItems(user_ext_id: string, force_language?: string): Promise<GetBonusesResponse> {\n\t\tconst message = this.buildMessage<GetBonusesRequest, GetBonusesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_BONUSES_REQUEST,\n\t\t);\n\t\tconst response = await this.send<GetBonusesResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_BONUSES_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\n\t\tconst responseClone = { ...response };\n\n\t\treturn responseClone;\n\t}\n\tpublic async bonusClaimItem(user_ext_id: string, bonus_id: number): Promise<ClaimBonusResponse> {\n\t\tconst message = this.buildMessage<ClaimBonusRequest, ClaimBonusResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.CLAIM_BONUS_REQUEST,\n\t\t\t{ bonusId: bonus_id }\n\n\t\t);\n\t\tconst response = await this.send<ClaimBonusResponse>(\n\t\t\tmessage,\n\t\t\tClassId.CLAIM_BONUS_RESPONSE,\n\n\t\t);\n\n\t\tconst responseClone = { ...response };\n\n\t\treturn responseClone;\n\t}\n\n\tpublic async bonusesGetItemsT(user_ext_id: string): Promise<TBonus[]> {\n\t\treturn BonusItemsTransform((await this.bonusesGetItems(user_ext_id)).bonuses);\n\t}\n\n\tpublic async badgetsGetItemsT(user_ext_id: string): Promise<TMissionOrBadge[]> {\n\t\treturn UserAchievementTransform((await this.badgetsGetItems(user_ext_id)).achievements);\n\t}\n\n\tpublic async tournamentsGetLobby(user_ext_id: string, force_language?: string): Promise<GetTournamentsResponse> {\n\t\tconst message = this.buildMessage<GetTournamentsRequest, GetTournamentsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_TOURNAMENT_LOBBY_REQUEST,\n\t\t);\n\t\treturn await this.send<GetTournamentsResponse>(message, ClassId.GET_TOURNAMENT_LOBBY_RESPONSE, force_language);\n\t}\n\n\tpublic async tournamentsGetLobbyT(user_ext_id: string): Promise<TTournament[]> {\n\t\treturn TournamentItemsTransform((await this.tournamentsGetLobby(user_ext_id)).tournaments);\n\t}\n\n\tpublic async clansGetList(user_ext_id: string, force_language?: string): Promise<GetClanListResponse> {\n\t\tconst message = this.buildMessage<GetClanListRequest, GetClanListResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CLAN_LIST_REQUEST,\n\t\t);\n\t\treturn await this.send<GetClanListResponse>(message, ClassId.GET_CLAN_LIST_RESPONSE, force_language);\n\t}\n\n\tpublic async clansGetListT(user_ext_id: string): Promise<TClans> {\n\t\tconst response = await this.clansGetList(user_ext_id);\n\t\treturn {\n\t\t\tclans: response.clans,\n\t\t\tuser_clan_id: response.user_clan_id,\n\t\t\tcooldown_until: response.cooldown_until,\n\t\t\tjoin_date: response.join_date ?? null,\n\t\t};\n\t}\n\n\tpublic async clansGetInfo(user_ext_id: string, clanId: number, force_language?: string): Promise<GetClanInfoResponse> {\n\t\tconst message = this.buildMessage<GetClanInfoRequest, GetClanInfoResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CLAN_INFO_REQUEST,\n\t\t\t{ clan_id: clanId },\n\t\t);\n\t\treturn await this.send<GetClanInfoResponse>(message, ClassId.GET_CLAN_INFO_RESPONSE, force_language);\n\t}\n\n\tpublic async clansGetInfoT(user_ext_id: string, clanId: number, force_language?: string): Promise<TClanInfo> {\n\t\tconst response = await this.clansGetInfo(user_ext_id, clanId, force_language);\n\t\tconst c = response.clanInfo;\n\t\treturn {\n\t\t\tclan_id: c.clan_id,\n\t\t\tpublic_meta: c.public_meta,\n\t\t\tmember_count: c.member_count,\n\t\t\tcapacity_limit: c.capacity_limit,\n\t\t\tentry_fee_currency_type_id: c.entry_fee_currency_type_id,\n\t\t\tentry_fee_amount: c.entry_fee_amount,\n\t\t\trating_position: c.rating_position,\n\t\t\trating_score: c.rating_score,\n\t\t\tcooldown_until: c.cooldown_until ?? null,\n\t\t\tmembers: (c.members || []).map((m) => ({\n\t\t\t\tuser_id: m.user_id,\n\t\t\t\tpublic_username: m.public_username,\n\t\t\t\tavatar_id: m.avatar_id,\n\t\t\t\tavatar_real_id: m.avatar_real_id,\n\t\t\t\tavatar_url: CoreUtils.avatarUrl(m.avatar_id, this.avatarDomain),\n\t\t\t\tposition: m.position,\n\t\t\t\tcontribution_score: m.contribution_score,\n\t\t\t\tis_me: m.is_me,\n\t\t\t\tclean_ext_user_id: m.clean_ext_user_id,\n\t\t\t})),\n\t\t};\n\t}\n\n\tpublic async clanJoin(user_ext_id: string, clanId: number, joinSourceId: number = 0): Promise<TClanJoinResult> {\n\t\tconst message = this.buildMessage<JoinClanRequest, JoinClanResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.JOIN_CLAN_REQUEST,\n\t\t\t{ clan_id: clanId, join_source_id: joinSourceId },\n\t\t);\n\t\tconst response = await this.send<JoinClanResponse>(message, ClassId.JOIN_CLAN_RESPONSE);\n\t\treturn { errCode: response.errCode ?? 0, errMsg: response.errMsg ?? '' };\n\t}\n\n\tpublic async tournamentsGetInfo(\n\t\tuser_ext_id: string,\n\t\ttournamentInstanceId: number,\n\t\tforce_language?: string,\n\t): Promise<GetTournamentInfoResponse> {\n\t\tconst message = this.buildMessage<GetTournamentInfoRequest, GetTournamentInfoResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_TOURNAMENT_INFO_REQUEST,\n\t\t\t{\n\t\t\t\ttournamentInstanceId,\n\t\t\t},\n\t\t);\n\t\tconst response = await this.send<GetTournamentInfoResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_TOURNAMENT_INFO_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\n\t\tif (response.userPosition?.avatar_id) {\n\t\t\tresponse.userPosition.avatar_url = CoreUtils.avatarUrl(response.userPosition.avatar_id, this.avatarDomain);\n\t\t}\n\n\t\tif (response.tournamentInfo?.players?.length) {\n\t\t\tresponse.tournamentInfo.players.forEach((p) => {\n\t\t\t\tp.avatar_url = CoreUtils.avatarUrl(p.avatar_id, this.avatarDomain);\n\t\t\t});\n\t\t}\n\n\t\treturn response;\n\t}\n\n\tpublic async tournamentsGetInfoT(user_ext_id: string, tournamentInstanceId: number): Promise<TTournamentDetailed> {\n\t\tif (!tournamentInstanceId) {\n\t\t\tthrow new Error('Missing tournament instance id');\n\t\t}\n\t\tconst response = await this.tournamentsGetInfo(user_ext_id, tournamentInstanceId);\n\t\treturn tournamentInfoItemTransform(response);\n\t}\n\n\tpublic async clanTournamentGetPlayers(\n\t\tuser_ext_id: string,\n\t\ttournament_instance_id: number,\n\t\tclan_id: number,\n\t\tforce_language?: string,\n\t): Promise<TClanTournamentPlayers> {\n\t\tconst message = this.buildMessage<GetClanTournamentPlayersRequest, GetClanTournamentPlayersResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CLAN_TOURNAMENT_PLAYERS_REQUEST,\n\t\t\t{ tournament_instance_id, clan_id, force_language },\n\t\t);\n\t\tconst response = await this.send<GetClanTournamentPlayersResponse>(\n\t\t\tmessage,\n\t\t\tClassId.GET_CLAN_TOURNAMENT_PLAYERS_RESPONSE,\n\t\t\tforce_language,\n\t\t);\n\t\tif (response.players?.length) {\n\t\t\tresponse.players.forEach((p) => {\n\t\t\t\tp.avatar_url = CoreUtils.avatarUrl(p.avatar_id, this.avatarDomain);\n\t\t\t});\n\t\t}\n\t\treturn clanTournamentPlayersTransform(response);\n\t}\n\n\tpublic async leaderboardGet(\n\t\tuser_ext_id: string,\n\t\tperiod_type_id?: LeaderBoardPeriodType,\n\t\tprevPeriod: boolean | number = false,\n\t\tforce_language?: string,\n\t): Promise<LeaderBoardDetails> {\n\t\t// boolean keeps back-compat (false → current, true → previous);\n\t\t// a number selects an arbitrary snapshot offset (1 = previous, 2 = the one before, …).\n\t\tconst snapshot_offset = typeof prevPeriod === 'number' ? prevPeriod : prevPeriod ? 1 : 0;\n\t\tconst message = this.buildMessage<GetLeaderBoardsRequest, GetLeaderBoardsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_LEADERS_BOARD_REQUEST,\n\t\t\t{\n\t\t\t\tperiod_type_id,\n\t\t\t\tsnapshot_offset,\n\t\t\t\tinclude_users: true,\n\t\t\t},\n\t\t);\n\n\t\tconst response = await this.send<GetLeaderBoardsResponse>(message, ClassId.GET_LEADERS_BOARD_RESPONSE, force_language);\n\n\t\tconst boardKey = Object.keys(response.map || {}).find((k) => period_type_id === undefined || k === period_type_id?.toString());\n\n\t\tif (boardKey === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (response.map[boardKey]?.userPosition?.avatar_id) {\n\t\t\tresponse.map[boardKey].userPosition.avatar_url = CoreUtils.avatarUrl(\n\t\t\t\tresponse.map[boardKey].userPosition.avatar_id,\n\t\t\t\tthis.avatarDomain,\n\t\t\t);\n\t\t}\n\n\t\tif (response.map[boardKey]?.positions?.length) {\n\t\t\tresponse.map[boardKey].positions.forEach((p) => {\n\t\t\t\tp.avatar_url = CoreUtils.avatarUrl(p.avatar_id, this.avatarDomain);\n\t\t\t});\n\t\t}\n\n\t\treturn response.map[boardKey];\n\t}\n\n\tpublic async leaderboardsGetT(\n\t\tuser_ext_id: string,\n\t\tperiod_type_id: LeaderBoardPeriodType = LeaderBoardPeriodType.DAILY,\n\t\tprevPeriod: boolean | number = false,\n\t): Promise<LeaderBoardDetailsT> {\n\t\treturn getLeaderBoardTransform(await this.leaderboardGet(user_ext_id, period_type_id, prevPeriod));\n\t}\n\n\tpublic async leaderboardsGetList(\n\t\tuser_ext_id: string,\n\t\tforce_language?: string,\n\t): Promise<LeaderBoardDetails[]> {\n\t\tconst message = this.buildMessage<GetLeaderBoardsRequest, GetLeaderBoardsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_LEADERS_BOARD_REQUEST,\n\t\t\t{\n\t\t\t\t// No period_type_id → the server returns every configured board.\n\t\t\t\t// include_users: false → board metadata only (no positions / userPosition).\n\t\t\t\tsnapshot_offset: 0,\n\t\t\t\tinclude_users: false,\n\t\t\t},\n\t\t);\n\n\t\tconst response = await this.send<GetLeaderBoardsResponse>(message, ClassId.GET_LEADERS_BOARD_RESPONSE, force_language);\n\n\t\t// map is keyed by period_type_id; integer-like keys iterate in ascending order.\n\t\treturn Object.values(response.map || {});\n\t}\n\n\tpublic async leaderboardsGetListT(user_ext_id: string): Promise<LeaderBoardDetailsT[]> {\n\t\treturn (await this.leaderboardsGetList(user_ext_id)).map(getLeaderBoardTransform);\n\t}\n\n\tpublic async levelsGet(user_ext_id: string, force_language?: string): Promise<GetLevelMapResponse> {\n\t\tconst message = this.buildMessage<any, GetLevelMapResponse>(user_ext_id, ClassId.GET_LEVEL_MAP_REQUEST);\n\t\treturn await this.send<GetLevelMapResponse>(message, ClassId.GET_LEVEL_MAP_RESPONSE, force_language);\n\t}\n\n\tpublic async levelsGetT(user_ext_id: string): Promise<TLevel[]> {\n\t\treturn GetLevelMapResponseTransform(await this.levelsGet(user_ext_id));\n\t}\n\n\tpublic async getLevelCurrent(user_ext_id: string): Promise<TLevelCurrent> {\n\t\tconst levels = await this.levelsGetT(user_ext_id);\n\t\tconst userInfo = await this.getUserGamificationInfo(user_ext_id);\n\t\tif (!levels || levels.length === 0) return null;\n\n\t\tconst sortedLevels = [...levels].sort((a, b) => a.required_points - b.required_points);\n\n\t\tlet currentLevelIndex = sortedLevels.findIndex((level) => level.id === userInfo.current_level);\n\n\t\tif (currentLevelIndex === -1) {\n\t\t\tconst userPointsEver = userInfo.points_ever ?? 0;\n\t\t\tcurrentLevelIndex = sortedLevels.findIndex((level, index) => {\n\t\t\t\tconst nextLevel = sortedLevels[index + 1];\n\t\t\t\treturn userPointsEver >= level.required_points && (!nextLevel || userPointsEver < nextLevel.required_points);\n\t\t\t});\n\t\t\tif (currentLevelIndex === -1) {\n\t\t\t\tcurrentLevelIndex = sortedLevels.length - 1;\n\t\t\t}\n\t\t}\n\n\t\tconst currentLevel = sortedLevels[currentLevelIndex];\n\t\tconst nextLevel = sortedLevels[currentLevelIndex + 1];\n\t\tconst userPointsEver = userInfo.points_ever ?? 0;\n\t\tconst progress = nextLevel\n\t\t\t? ((userPointsEver - currentLevel.required_points) / (nextLevel.required_points - currentLevel.required_points)) * 100\n\t\t\t: 100;\n\n\t\treturn {\n\t\t\t...currentLevel,\n\t\t\tprogress: Math.min(Math.max(progress, 0), 100),\n\t\t};\n\t}\n\n\tpublic async customSectionsGet(user_ext_id: string, force_language?: string): Promise<GetCustomSectionsResponse> {\n\t\tconst message = this.buildMessage<GetCustomSectionsRequest, GetCustomSectionsResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_CUSTOM_SECTIONS_REQUEST,\n\t\t);\n\t\treturn await this.send<GetCustomSectionsResponse>(message, ClassId.GET_CUSTOM_SECTIONS_RESPONSE, force_language);\n\t}\n\n\tpublic async customSectionsGetT(user_ext_id: string): Promise<TUICustomSection[]> {\n\t\treturn UICustomSectionTransform(await this.customSectionsGet(user_ext_id));\n\t}\n\n\tpublic async getTranslationsT(\n\t\tuser_ext_id: string,\n\t\tlang_code: string,\n\t\tareas: TranslationArea[],\n\t\tcacheSec: number = 60,\n\t): Promise<GetTranslationsResponse> {\n\t\treturn await this.coreGetTranslations(user_ext_id, lang_code, areas, 30);\n\t}\n\n\tpublic async getInboxMessages(\n\t\tuser_ext_id: string,\n\t\tlimit: number = 20,\n\t\toffset: number = 0,\n\t\tstarred_only: boolean,\n\t\tcategory_id?: InboxCategories,\n\t\tread_status?: InboxReadStatus,\n\t): Promise<GetInboxMessagesResponse> {\n\t\tconst message = this.buildMessage<GetInboxMessagesRequest, GetInboxMessagesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_INBOX_MESSAGES_REQUEST,\n\t\t\t{\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t\tstarred_only,\n\t\t\t\tcategory_id,\n\t\t\t\tread_status,\n\t\t\t},\n\t\t);\n\t\treturn await this.send<GetInboxMessagesResponse>(message, ClassId.GET_INBOX_MESSAGES_RESPONSE);\n\t}\n\n\tpublic async getInboxMessagesT(\n\t\tuser_ext_id: string,\n\t\tfrom: number = 0,\n\t\tto: number = 20,\n\t\tfavoriteOnly: boolean = false,\n\t\tcategoryId?: InboxCategories,\n\t\tread_status?: InboxReadStatus,\n\t): Promise<TInboxMessage[]> {\n\t\tconst limit = to - from > 20 ? 20 : to - from;\n\t\tconst offset = from;\n\n\t\treturn InboxMessagesTransform((await this.getInboxMessages(user_ext_id, limit, offset, favoriteOnly, categoryId, read_status)).log);\n\t}\n\n\tpublic async getInboxUnreadCountT(\n\t\tuser_ext_id: string,\n\t): Promise<number> {\n\t\tconst limit = 1;\n\t\tconst offset = 0;\n\n\t\treturn (await this.getInboxMessages(user_ext_id, limit, offset, false, null)).unread_count;\n\t}\n\n\tpublic async getInboxMessageBody(messageGuid: string): Promise<InboxMessageBody> {\n\t\tconst getMessageBody = async (messageGuid: string): Promise<InboxMessageBody> => {\n\t\t\tconst inboxCdnUrl = this.tracker.getLabelSetting(PublicLabelSettings.INBOX_PUBLIC_CDN);\n\n\t\t\ttry {\n\t\t\t\tconst url = `${inboxCdnUrl}${messageGuid}.json`;\n\n\t\t\t\tconst response = await fetch(url, {\n\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t'Access-Control-Allow-Origin': '*',\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tconst data = await response.json();\n\t\t\t\treturn data || {};\n\t\t\t} catch (error) {\n\t\t\t\tthis.logger.error('Error fetching inbox message body:', error);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\n\t\treturn await getMessageBody(messageGuid);\n\t}\n\n\tpublic async getInboxMessageBodyT(messageGuid: string): Promise<TInboxMessageBody> {\n\t\tconst message = await this.getInboxMessageBody(messageGuid);\n\t\treturn InboxMessageBodyTransform(message);\n\t}\n\n\tpublic async markInboxMessageRead(user_ext_id: string, messageGuid: string): Promise<MarkInboxMessageReadResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageReadRequest, MarkInboxMessageReadResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_READ_REQUEST,\n\t\t\t{\n\t\t\t\tengagement_uid: messageGuid,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageReadResponse>(message, ClassId.MARK_INBOX_READ_RESPONSE);\n\t}\n\n\tpublic async markAllInboxMessageRead(user_ext_id: string): Promise<MarkInboxMessageReadResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageReadRequest, MarkInboxMessageReadResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_READ_REQUEST,\n\t\t\t{\n\t\t\t\tall_read: true,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageReadResponse>(message, ClassId.MARK_INBOX_READ_RESPONSE);\n\t}\n\n\tpublic async markUnmarkInboxMessageAsFavorite(\n\t\tuser_ext_id: string,\n\t\tmessageGuid: string,\n\t\tmark: boolean,\n\t): Promise<MarkInboxMessageStarredResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageStarredRequest, MarkInboxMessageStarredResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_STARRED_REQUEST,\n\t\t\t{\n\t\t\t\tengagement_uid: messageGuid,\n\t\t\t\tis_starred: mark,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageStarredResponse>(message, ClassId.MARK_INBOX_STARRED_RESPONSE);\n\t}\n\n\tpublic async deleteInboxMessage(user_ext_id: string, messageGuid: string): Promise<MarkInboxMessageDeletedResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageDeletedRequest, MarkInboxMessageDeletedResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_DELETED_REQUEST,\n\t\t\t{\n\t\t\t\tengagement_uid: messageGuid,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageDeletedResponse>(message, ClassId.MARK_INBOX_DELETED_RESPONSE);\n\t}\n\n\tpublic async deleteAllInboxMessages(user_ext_id: string): Promise<MarkInboxMessageDeletedResponse> {\n\t\tconst message = this.buildMessage<MarkInboxMessageDeletedRequest, MarkInboxMessageDeletedResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.MARK_INBOX_DELETED_REQUEST,\n\t\t\t{\n\t\t\t\tall_deleted: true,\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<MarkInboxMessageDeletedResponse>(message, ClassId.MARK_INBOX_DELETED_RESPONSE);\n\t}\n\n\tprivate buildGamesApiParams(): Record<string, string> {\n\t\tconst params: Record<string, string> = Object.assign({}, this.baseRgApiParams, {\n\t\t\text_user_id: this.tracker.userPublicProps?.user_id,\n\t\t\tsmartico_ext_user_id: this.tracker.getExtUserId(),\n\t\t\tlang: this.tracker.userPublicProps?.core_user_language,\n\t\t});\n\n\t\treturn params;\n\t}\n\n\tprivate async sendGamesApi<T>({ method, params, usePost = false }: { method: string, params: Record<string, any>, usePost?: boolean }): Promise<GamesApiResponse<T>> {\n\n\t\tif (!this.tracker) {\n\t\t\tthrow new Error(`MatchX and Quiz APIs are not available in the visitor mode`);\n\t\t}\n\n\t\tconst baseParams = this.buildGamesApiParams();\n\t\tconst queryString = Object.entries(baseParams).map(([k, v]) => `${k}=${encodeURIComponent(v)}`).join('&');\n\t\tlet url = `${GAMES_API_URL}/${method}?${queryString}`;\n\n\t\tlet fetchOptions: RequestInit = {\n\t\t\tmethod: 'GET',\n\t\t\theaders: { 'Accept': 'application/json' },\n\t\t};\n\n\t\tif (usePost && params) {\n\t\t\tfetchOptions = {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify(params),\n\t\t\t};\n\t\t} else if (params) {\n\t\t\tconst extraQuery = Object.entries(params)\n\t\t\t\t.filter(([, v]) => v !== null && v !== undefined)\n\t\t\t\t.map(([k, v]) => `${k}=${encodeURIComponent(typeof v === 'object' ? JSON.stringify(v) : v)}`)\n\t\t\t\t.join('&');\n\t\t\turl += `&${extraQuery}`;\n\t\t}\n\n\t\ttry {\n\t\t\tconst response = await fetch(url, fetchOptions);\n\n\t\t\tconst data = await response.json();\n\t\t\treturn SmarticoAPI.replaceSmrDomainsWithCloudfront<GamesApiResponse<T>>(data);\n\t\t} catch (e) {\n\t\t\tthis.logger.error(`Failed to call games API: ${method}`, { url, error: e.message });\n\t\t\tthrow new Error(`Failed to call games API: ${method}. ${e.message}`);\n\t\t}\n\t}\n\n\tprivate async sendAvatarApi<T>({ method, body }: { method: string, body: Record<string, any> }): Promise<T> {\n\t\tif (!this.tracker) {\n\t\t\tthrow new Error(`Avatar APIs are not available in the visitor mode`);\n\t\t}\n\n\t\tconst url = `${this.avatarOriginDomain}/${method}`;\n\n\t\ttry {\n\t\t\tconst response = await fetch(url, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t},\n\t\t\t\tbody: JSON.stringify(body),\n\t\t\t});\n\n\t\t\tconst data = await response.json();\n\t\t\treturn SmarticoAPI.replaceSmrDomainsWithCloudfront<T>(data);\n\t\t} catch (e) {\n\t\t\tthis.logger.error(`Failed to call avatar API: ${method}`, { url, error: e.message });\n\t\t\tthrow new Error(`Failed to call avatar API: ${method}. ${e.message}`);\n\t\t}\n\t}\n\n\tpublic async gpGetActiveRounds(saw_template_id: number): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound[]>({ method: 'active-rounds', params });\n\t}\n\n\tpublic async gpGetActiveRound(saw_template_id: number, round_id?: number): Promise<GamesApiResponse<GamePickRound>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround_id: round_id,\n\t\t};\t\n\t\t\n\t\treturn this.sendGamesApi<GamePickRound>({ method: 'active-round', params });\n\t}\n\n\tpublic async gpGetGamesHistory(saw_template_id: number): Promise<GamesApiResponse<GamePickRound[]>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound[]>({ method: 'games-history', params });\n\t}\n\n\tpublic async gpGetGameBoard(saw_template_id: number, round_id: number): Promise<GamesApiResponse<GamePickRoundBoard>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround_id: round_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRoundBoard>({ method: 'game-board', params });\n\t}\n\n\tpublic async gpSubmitSelection(saw_template_id: number, round: any, isQuiz: boolean): Promise<GamesApiResponse<GamePickRound>> {\n\t\tconst method = isQuiz ? 'submit-selection-quiz' : 'submit-selection';\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround: round,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound>({ method, params, usePost: true });\n\t}\n\n\tpublic async gpGetUserInfo(saw_template_id: number): Promise<GamesApiResponse<GamePickUserInfo>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickUserInfo>({ method: 'user-info', params });\n\t}\n\n\tpublic async gpGetGameInfo(saw_template_id: number): Promise<GamesApiResponse<GamePickGameInfo>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickGameInfo>({ method: 'game-info', params });\n\t}\n\n\tpublic async gpGetTranslations(saw_template_id: number): Promise<GamesApiResponse<any>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<any>({ method: 'translations', params });\n\t}\n\n\tpublic async gpGetRoundInfoForUser(saw_template_id: number, round_id: number, int_user_id: number): Promise<GamesApiResponse<GamePickRound>> {\n\t\tconst params = {\n\t\t\text_game_id: saw_template_id,\n\t\t\tround_id: round_id,\n\t\t\tint_user_id: int_user_id,\n\t\t};\n\n\t\treturn this.sendGamesApi<GamePickRound>({ method: 'game-round-info-for-user', params });\n\t}\n\n\tpublic async avatarsGetList(user_ext_id: string): Promise<GetAvatarsListResponse> {\n\t\tconst message = this.buildMessage<any, GetAvatarsListResponse>(user_ext_id, ClassId.GET_AVATARS_LIST_REQUEST);\n\t\treturn await this.send<GetAvatarsListResponse>(message, ClassId.GET_AVATARS_LIST_RESPONSE);\n\t}\n\n\tpublic async avatarsGetCustomized(user_ext_id: string): Promise<GetAvatarsCustomizedResponse> {\n\t\tconst message = this.buildMessage<any, GetAvatarsCustomizedResponse>(user_ext_id, ClassId.GET_AVATARS_CUSTOMIZED_REQUEST);\n\t\treturn await this.send<GetAvatarsCustomizedResponse>(message, ClassId.GET_AVATARS_CUSTOMIZED_RESPONSE);\n\t}\n\n\tpublic async avatarsGetPrompts(user_ext_id: string): Promise<GetAvatarPromptsResponse> {\n\t\tconst message = this.buildMessage<any, GetAvatarPromptsResponse>(user_ext_id, ClassId.GET_AVATAR_PROMPTS_REQUEST);\n\t\treturn await this.send<GetAvatarPromptsResponse>(message, ClassId.GET_AVATAR_PROMPTS_RESPONSE);\n\t}\n\n\tpublic async avatarSetAvatar(user_ext_id: string, avatar_id: string, avatar_real_id: number): Promise<SetAvatarResponse> {\n\t\tconst message = this.buildMessage<SetAvatarRequest, SetAvatarResponse>(user_ext_id, ClassId.CLIENT_SET_AVATAR_REQUEST, {\n\t\t\tavatar_id,\n\t\t\tavatar_real_id,\n\t\t});\n\t\treturn await this.send<SetAvatarResponse>(message, ClassId.CLIENT_SET_AVATAR_RESPONSE);\n\t}\n\n\tpublic async avatarsCustomize(params: {\n\t\tuser_id: number;\n\t\tprompt_id: number;\n\t\tavatar_url: string;\n\t\tavatar_real_id: number;\n\t}): Promise<AvatarCustomizeResponse> {\n\t\treturn this.sendAvatarApi<AvatarCustomizeResponse>({\n\t\t\tmethod: 'avatar-customize',\n\t\t\tbody: {\n\t\t\t\t// The server resolves label_id from label_api_key.\n\t\t\t\tlabel_api_key: this.label_api_key,\n\t\t\t\tuser_id: params.user_id,\n\t\t\t\tuser_ext_id: this.tracker?.getExtUserId(),\n\t\t\t\tbrand_key: this.brand_api_key || this.tracker?.params?.brand_key,\n\t\t\t\tprompt_id: params.prompt_id,\n\t\t\t\tavatar_url: params.avatar_url,\n\t\t\t\tavatar_real_id: params.avatar_real_id,\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic async avatarsGetListT(user_ext_id: string): Promise<TAvatarDefinition[]> {\n\t\treturn avatarDefinitionTransform((await this.avatarsGetList(user_ext_id)).avatars ?? [], this.avatarDomain);\n\t}\n\n\tpublic async avatarsGetCustomizedT(user_ext_id: string): Promise<TAvatarCustomized[]> {\n\t\treturn avatarCustomizedTransform((await this.avatarsGetCustomized(user_ext_id)).avatars ?? [], this.avatarDomain);\n\t}\n\n\tpublic async avatarsGetPromptsT(user_ext_id: string): Promise<TAvatarPrompt[]> {\n\t\treturn avatarPromptTransform((await this.avatarsGetPrompts(user_ext_id)).prompts ?? [], this.avatarDomain);\n\t}\n\n\tpublic getWSCalls(): WSAPI {\n\t\treturn new WSAPI(this);\n\t}\n\n\tpublic async getRelatedItemsForGame(user_ext_id: string, related_game_id: string,): Promise<GetRelatedAchTourResponse> {\n\t\tconst message = this.buildMessage<GetRelatedAchTourRequest, GetRelatedAchTourResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_RELATED_ACH_N_TOURNAMENTS_REQUEST,\n\t\t\t{\n\t\t\t\trelated_game_id: related_game_id\n\t\t\t}\n\t\t);\n\n\t\treturn await this.send<GetRelatedAchTourResponse>(message, ClassId.GET_RELATED_ACH_N_TOURNAMENTS_RESPONSE);\n\t}\n\n\tpublic async getRafflesT(user_ext_id: string): Promise<TRaffle[]> {\n\t\treturn raffleTransform((await this.getRaffles(user_ext_id)).items);\n\t}\n\n\tpublic async getRaffles(user_ext_id: string): Promise<GetRafflesResponse> {\n\t\tconst message = this.buildMessage<GetRafflesRequest, GetRafflesResponse>(user_ext_id, ClassId.RAF_GET_RAFFLES_REQUEST);\n\n\t\treturn await this.send<GetRafflesResponse>(message, ClassId.RAF_GET_RAFFLES_RESPONSE);\n\t}\n\n\tpublic async getRaffleDrawRun(user_ext_id: string, payload: { raffle_id: number; run_id: number; winners_limit?: number; winners_offset?: number }): Promise<GetDrawRunResponse> {\n\t\tconst message = this.buildMessage<GetDrawRunRequest, GetDrawRunResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_GET_DRAW_RUN_REQUEST,\n\t\t\tpayload,\n\t\t);\n\n\t\treturn await this.send<GetDrawRunResponse>(message, ClassId.RAF_GET_DRAW_RUN_RESPONSE);\n\t}\n\n\tpublic async getRaffleDrawRunT(\n\t\tuser_ext_id: string,\n\t\traffle_id: number,\n\t\trun_id: number,\n\t\twinners_from: number = 0,\n\t\twinners_to: number = 20,\n\t): Promise<TRaffleDraw> {\n\t\tconst winners_limit = winners_to - winners_from > 50 ? 50 : winners_to - winners_from;\n\t\tconst winners_offset = winners_from;\n\n\t\treturn drawRunTransform(await this.getRaffleDrawRun(user_ext_id, { raffle_id, run_id, winners_limit, winners_offset }),);\n\t}\n\n\tpublic async getRaffleDrawRunsHistory(\n\t\tuser_ext_id: string,\n\t\tprops: { raffle_id: number; draw_id?: number },\n\t): Promise<GetRaffleDrawRunsHistoryResponse> {\n\t\tconst message = this.buildMessage<GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_GET_DRAW_HISTORY_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<GetRaffleDrawRunsHistoryResponse>(message, ClassId.RAF_GET_DRAW_HISTORY_RESPONSE);\n\t}\n\n\tpublic async claimRafflePrize(user_ext_id: string, props: { won_id: number }): Promise<RaffleClaimPrizeResponse> {\n\t\tconst message = this.buildMessage<RaffleClaimPrizeRequest, RaffleClaimPrizeResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_CLAIM_PRIZE_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<RaffleClaimPrizeResponse>(message, ClassId.RAF_CLAIM_PRIZE_RESPONSE);\n\n\t}\n\n\tpublic async raffleOptin(user_ext_id: string, props: { raffle_id: number; draw_id: number; raffle_run_id: number }): Promise<RaffleOptinResponse> {\n\t\tconst message = this.buildMessage<RaffleOptinRequest, RaffleOptinResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_OPTIN_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<RaffleOptinResponse>(message, ClassId.RAF_OPTIN_RESPONSE);\n\n\t}\n\n\tpublic async getRaffleWonPrizes(\n\t\tuser_ext_id: string,\n\t\tprops: { raffle_id: number; offset: number; limit: number },\n\t): Promise<GetRaffleWonPrizesResponse> {\n\t\tconst message = this.buildMessage<GetRaffleWonPrizesRequest, GetRaffleWonPrizesResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.RAF_GET_WON_PRIZES_REQUEST,\n\t\t\tprops,\n\t\t);\n\n\t\treturn await this.send<GetRaffleWonPrizesResponse>(message, ClassId.RAF_GET_WON_PRIZES_RESPONSE);\n\t}\n\n\tpublic async getActivityLog(\n\t\tuser_ext_id: string,\n\t\tstartTimeSeconds: number,\n\t\tendTimeSeconds: number,\n\t\tlimit: number,\n\t\toffset: number,\n\t\ttypes?: number[],\n\t\tsrc_types?: number[],\n\t): Promise<GetActivityLogResponse> {\n\t\tconst message = this.buildMessage<GetActivityLogRequest, GetActivityLogResponse>(\n\t\t\tuser_ext_id,\n\t\t\tClassId.GET_POINT_HISTORY_REQUEST,\n\t\t\t{\n\t\t\t\tstartTimeSeconds: Math.floor(startTimeSeconds),\n\t\t\t\tendTimeSeconds: Math.floor(endTimeSeconds),\n\t\t\t\tlimit,\n\t\t\t\toffset,\n\t\t\t\t...(types ? { types } : {}),\n\t\t\t\t...(src_types ? { src_types } : {}),\n\t\t\t},\n\t\t);\n\n\t\treturn await this.send<GetActivityLogResponse>(message, ClassId.GET_POINT_HISTORY_RESPONSE);\n\t}\n\n\tpublic async getActivityLogT(\n\t\tuser_ext_id: string,\n\t\tstartTimeSeconds: number,\n\t\tendTimeSeconds: number,\n\t\tfrom: number = 0,\n\t\tto: number = 50,\n\t\ttypes?: number[],\n\t\tsrc_types?: number[],\n\t): Promise<TActivityLog[]> {\n\t\tconst limit = to - from > 50 ? 50 : to - from;\n\t\tconst offset = from;\n\n\t\treturn ActivityLogTransform(\n\t\t\t(await this.getActivityLog(user_ext_id, startTimeSeconds, endTimeSeconds, limit, offset, types, src_types)).logHistory,\n\t\t);\n\t}\n}\n\nexport { SmarticoAPI, MessageSender };\n","import { TSMap } from 'typescript-map';\n\nclass CookieStore {\n\tprivate static cookieStore = new TSMap<string, string[]>();\n\n\tpublic static get(key: string): string[] | undefined {\n\t\treturn CookieStore.cookieStore.get(key);\n\t}\n\n\tpublic static set(key: string, value: string[]) {\n\t\tconst v = value.map((v) => v.split(';')[0]);\n\t\tCookieStore.cookieStore.set(key, v);\n\t}\n}\n\nexport { CookieStore };\n","\nexport enum AnalyticsInterfaceType {\n\tMobile = 0,\n\tDesktop = 1,\n}\n\nexport enum AnalyticsScreenNameId {\n\tOverview = 1,\n\tMissions = 2,\n\tLeaderboards = 3,\n\tTournaments = 4,\n\tTournamentLobby = 5,\n\tLevels = 6,\n\tLevelsMap = 7,\n\tBadges = 8,\n\tBonuses = 9,\n\tSpinAWheel = 10,\n\tStore = 11,\n\tStoreHistory = 12,\n\tInbox = 13,\n\tMatchX = 14,\n\tQuiz = 15,\n\tJackpots = 16,\n\tLootbox = 17,\n\tCustomSection = 18,\n\tShortInbox = 19,\n\tLootboxWeekdays = 20,\n\tLootboxCalendarDays = 21,\n\tTreasureHunt = 22,\n\tLiquidSection = 23,\n\tActivityLog = 24,\n\tMiniGamesHistory = 25,\n\n\tModalMission = 31,\n\tModalLevel = 32,\n\tModalBadge = 33,\n\tModalStore = 34,\n\tModalBonus = 35,\n\tModalJackpot = 36,\n\tModalUsername = 37,\n\tModalAvatar = 38,\n\tModalQR = 39,\n}\n\nexport enum AnalyticsTournamentsLobbySubScreenNameId {\n\tGeneral = 1,\n\tPrizes = 2,\n\tPlayers = 3,\n\tRelatedGames = 4,\n}\n\nexport enum AnalyticsInboxSubScreenNameId {\n\tAll = 1,\n\tFavorite = 2,\n}\n","export enum QuizSportType {\n\tSoccer = 1,\n\tBasketball = 2,\n\tTennis = 5,\n}\n\nexport const quizSupportedSports = [QuizSportType.Basketball, QuizSportType.Soccer, QuizSportType.Tennis];\n","export enum SAWGPMarketType {\n\tTwoTeamsWithScore = 1,\n\tRedCard = 2,\n\tOneXTwo = 3,\n\tOneXTwoHalftime = 4,\n\t// HalftimeFulltime = 5,\n\tFirstGoal = 6,\n\tDoubleChance = 7,\n\tOverUnder2_5 = 8,\n\tOverUnder1_5Halftime = 9,\n\tOverUnder1_5__2ndHalf = 10,\n\tTotalCorners8_5 = 11,\n\tTotalCorners9_5 = 12,\n\tCorners1x2 = 13,\n\tOne_Two = 14,\n\tOvertime = 15,\n\tOddEven = 16,\n\tOddEvenHomeAway = 17,\n\tFirstSet = 18,\n\tSecondSet = 19,\n\tThirdSet = 20,\n\tFourthSet = 21,\n\tFifthSet = 22,\n\tPlayerOneWinsOneSet = 23,\n\tPlayerTwoWinsOneSet = 24,\n\tLastGoal = 25,\n\n\tCustomSport = 26,\n\tCustomNonSport = 27,\n}\n","export enum QuizAnswersValueType {\n\tHomeTeam = '1',\n\tAwayTeam = '2',\n\tDraw = 'x',\n\tHomeTeamHomeTeam = '1/1',\n\tHomeTeamDraw = '1/x',\n\tHomeTeamAwayTeam = '1/2',\n\tDrawHomeTeam = 'x/1',\n\tDrawDraw = 'x/x',\n\tDrawAwayTeam = 'x/2',\n\tAwayTeamHomeTeam = '2/1',\n\tAwayTeamDraw = '2/x',\n\tAwayTeamAwayTeam = '2/2',\n\tYes = 'yes',\n\tNo = 'no',\n\tOdd = 'odd',\n\tEven = 'even',\n\tHomeOdd = '1/odd',\n\tHomeEven = '1/even',\n\tAwayOdd = '2/odd',\n\tAwayEven = '2/even',\n}\n\nexport const quizAnswerHomeTeamReplacementText = '{quiz_home_team}';\nexport const quizAnswerAwayTeamReplacementText = '{quiz_away_team}';\nexport const quizDrawReplacementText = '{quiz_draw}';\nexport const quizYesReplacementText = '{yes}';\nexport const quizNoReplacementText = '{no}';\nexport const quizOddReplacementText = '{odd}';\nexport const quizEvenReplacementText = '{even}';\nexport const quizOrReplacementText = '{or}';\nexport const quizNoGoalsReplacementText = '{quiz_no_goals}';\n\nexport const quizAnswersTrKeys = {\n\t[quizDrawReplacementText]: 'quizAnswer_draw',\n\t[quizYesReplacementText]: 'quizAnswer_yes',\n\t[quizNoReplacementText]: 'quizAnswer_no',\n\t[quizOddReplacementText]: 'quizAnswer_odd',\n\t[quizEvenReplacementText]: 'quizAnswer_even',\n\t[quizOrReplacementText]: 'quizAnswer_or',\n\t[quizNoGoalsReplacementText]: 'quizAnswer_no_goals',\n};\n","import {\n\tQuizAnswersValueType,\n\tquizAnswerAwayTeamReplacementText,\n\tquizAnswerHomeTeamReplacementText,\n\tquizDrawReplacementText,\n\tquizEvenReplacementText,\n\tquizNoGoalsReplacementText,\n\tquizNoReplacementText,\n\tquizOddReplacementText,\n\tquizOrReplacementText,\n\tquizYesReplacementText,\n} from './MarketsAnswers';\nimport { SAWGPMarketType } from './MarketsType';\n\nconst yesNoAnswers = [\n\t{ text: quizYesReplacementText, value: QuizAnswersValueType.Yes },\n\t{ text: quizNoReplacementText, value: QuizAnswersValueType.No },\n];\n\nconst homeAwayAnswers = [\n\t{ text: quizAnswerHomeTeamReplacementText, value: QuizAnswersValueType.HomeTeam },\n\t{ text: quizAnswerAwayTeamReplacementText, value: QuizAnswersValueType.AwayTeam },\n];\n\nconst homeAwayDrawAnswers = [...homeAwayAnswers, { text: quizDrawReplacementText, value: QuizAnswersValueType.Draw }];\nconst homeAwayNoGoalsAnswers = [...homeAwayAnswers, { text: quizNoGoalsReplacementText, value: QuizAnswersValueType.Draw }];\n\nexport const marketsInfo = [\n\t{\n\t\ttype: SAWGPMarketType.OneXTwo,\n\t\tname: '1x2',\n\t\tquestion: { text: 'Who will win the match ?', trKey: 'quizQuestion_1x2' },\n\t\tanswers: homeAwayDrawAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OneXTwoHalftime,\n\t\tname: '1x2 Halftime',\n\t\tquestion: { text: 'Who will lead the first half of the match ?', trKey: 'quizQuestion_x2half' },\n\t\tanswers: homeAwayDrawAnswers,\n\t},\n\t// {\n\t// \ttype: SAWGPMarketType.HalftimeFulltime,\n\t// \tname: 'Halftime / Fulltime',\n\t// \tquestion: { text: 'Who will lead the first half and who will win the match ?', trKey: 'quizQuestion__HalftimeFulltime' },\n\t// \tanswers: [\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerHomeTeamReplacementText} / ${quizAnswerHomeTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.HomeTeamHomeTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerHomeTeamReplacementText} / ${quizDrawReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.HomeTeamDraw,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerHomeTeamReplacementText} / ${quizAnswerAwayTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.HomeTeamAwayTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizDrawReplacementText} / ${quizAnswerHomeTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.DrawHomeTeam,\n\t// \t\t},\n\t// \t\t{ text: `${quizDrawReplacementText} / ${quizDrawReplacementText}`, value: QuizAnswersValueType.DrawDraw },\n\t// \t\t{\n\t// \t\t\ttext: `${quizDrawReplacementText} / ${quizAnswerAwayTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.DrawAwayTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerAwayTeamReplacementText} / ${quizAnswerHomeTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.AwayTeamHomeTeam,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerAwayTeamReplacementText} / ${quizDrawReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.AwayTeamDraw,\n\t// \t\t},\n\t// \t\t{\n\t// \t\t\ttext: `${quizAnswerAwayTeamReplacementText} / ${quizAnswerAwayTeamReplacementText}`,\n\t// \t\t\tvalue: QuizAnswersValueType.AwayTeamAwayTeam,\n\t// \t\t},\n\t// \t],\n\t// },\n\t{\n\t\ttype: SAWGPMarketType.FirstGoal,\n\t\tname: 'First Goal',\n\t\tquestion: { text: 'Who will score the first goal ?', trKey: 'quizQuestion_firstGoal' },\n\t\tanswers: homeAwayNoGoalsAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.LastGoal,\n\t\tname: 'Last Goal',\n\t\tquestion: { text: 'Who will score the last goal ?', trKey: 'quizQuestion_lastGoal' },\n\t\tanswers: homeAwayNoGoalsAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.DoubleChance,\n\t\tname: 'Double Chance',\n\t\tquestion: { text: 'Who will win the match? Choose a combination:', trKey: 'quizQuestion_doubleChance' },\n\t\tanswers: [\n\t\t\t{\n\t\t\t\ttext: `${quizDrawReplacementText} ${quizOrReplacementText} ${quizAnswerHomeTeamReplacementText}`,\n\t\t\t\tvalue: QuizAnswersValueType.HomeTeamDraw,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: `${quizAnswerHomeTeamReplacementText} ${quizOrReplacementText} ${quizAnswerAwayTeamReplacementText}`,\n\t\t\t\tvalue: QuizAnswersValueType.HomeTeamAwayTeam,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttext: `${quizDrawReplacementText} ${quizOrReplacementText} ${quizAnswerAwayTeamReplacementText}`,\n\t\t\t\tvalue: QuizAnswersValueType.AwayTeamDraw,\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OverUnder2_5,\n\t\tname: 'Over/Under 2.5',\n\t\tquestion: { text: 'Will there be 3 or more goals in the match?', trKey: 'quizQuestion_overUnder2_5' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OverUnder1_5Halftime,\n\t\tname: 'Over/Under 1.5 Halftime',\n\t\tquestion: { text: 'Will there be 2 or more goals in the first half?', trKey: 'quizQuestion_overUnder1_5Halftime' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OverUnder1_5__2ndHalf,\n\t\tname: 'Over/Under 1.5 2nd Half',\n\t\tquestion: { text: 'Will there be 2 or more goals in the second half?', trKey: 'quizQuestion_overUnder1_5__2ndHalf' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.RedCard,\n\t\tname: 'Red Card',\n\t\tquestion: { text: 'Will there be a red card in the match?', trKey: 'quizQuestion_redCard' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.TotalCorners8_5,\n\t\tname: 'Total Corners 8.5',\n\t\tquestion: { text: 'Will there be 9 or more corners in the match?', trKey: 'quizQuestion_totalCorners8_5' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.TotalCorners9_5,\n\t\tname: 'Total Corners 9.5',\n\t\tquestion: { text: 'Will there be 10 or more corners in the match?', trKey: 'quizQuestion_totalCorners9_5' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.Corners1x2,\n\t\tname: 'Corners 1x2',\n\t\tquestion: { text: 'Which team will have more corners in the match?', trKey: 'quizQuestion_corners1x2' },\n\t\tanswers: homeAwayDrawAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.One_Two,\n\t\tname: '1-2',\n\t\tquestion: { text: 'Who will win the match ?', trKey: 'quizQuestion_1-2' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.Overtime,\n\t\tname: 'Overtime',\n\t\tquestion: { text: 'Will there be overtime in the match?', trKey: 'quizQuestion_overtime' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OddEven,\n\t\tname: 'Odd/Even',\n\t\tquestion: {\n\t\t\ttext: 'Is the sum of all points scored in the game going to be an odd number or even?',\n\t\t\ttrKey: 'quizQuestion_oddEven',\n\t\t},\n\t\tanswers: [\n\t\t\t{ text: quizOddReplacementText, value: QuizAnswersValueType.Odd },\n\t\t\t{ text: quizEvenReplacementText, value: QuizAnswersValueType.Even },\n\t\t],\n\t},\n\t{\n\t\ttype: SAWGPMarketType.OddEvenHomeAway,\n\t\tname: 'Odd/Even Home/Away',\n\t\tquestion: {\n\t\t\ttext: 'Which team will win and what will be the sum of the points (Odd or Even)?',\n\t\t\ttrKey: 'quizQuestion_oddEvenHomeAway',\n\t\t},\n\t\tanswers: [\n\t\t\t{ text: `${quizAnswerHomeTeamReplacementText} - ${quizOddReplacementText}`, value: QuizAnswersValueType.HomeOdd },\n\t\t\t{ text: `${quizAnswerHomeTeamReplacementText} - ${quizEvenReplacementText}`, value: QuizAnswersValueType.HomeEven },\n\t\t\t{ text: `${quizAnswerAwayTeamReplacementText} - ${quizOddReplacementText}`, value: QuizAnswersValueType.AwayOdd },\n\t\t\t{ text: `${quizAnswerAwayTeamReplacementText} - ${quizEvenReplacementText}`, value: QuizAnswersValueType.AwayEven },\n\t\t],\n\t},\n\t{\n\t\ttype: SAWGPMarketType.FirstSet,\n\t\tname: 'First Set',\n\t\tquestion: { text: 'Who will win the first set ?', trKey: 'quizQuestion_firstSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.SecondSet,\n\t\tname: 'Second Set',\n\t\tquestion: { text: 'Who will win the second set ?', trKey: 'quizQuestion_secondSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.ThirdSet,\n\t\tname: 'Third Set',\n\t\tquestion: { text: 'Who will win the third set ?', trKey: 'quizQuestion_thirdSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.FourthSet,\n\t\tname: 'Fourth Set',\n\t\tquestion: { text: 'Who will win the fourth set ?', trKey: 'quizQuestion_fourthSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.FifthSet,\n\t\tname: 'Fifth Set',\n\t\tquestion: { text: 'Who will win the fifth set ?', trKey: 'quizQuestion_fifthSet' },\n\t\tanswers: homeAwayAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.PlayerOneWinsOneSet,\n\t\tname: 'Player One Wins One Set',\n\t\tquestion: { text: 'Will Player One win at least one set?', trKey: 'quizQuestion_playerOneWinsOneSet' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.PlayerTwoWinsOneSet,\n\t\tname: 'Player Two Wins One Set',\n\t\tquestion: { text: 'Will Player Two win at least one set?', trKey: 'quizQuestion_playerTwoWinsOneSet' },\n\t\tanswers: yesNoAnswers,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.CustomNonSport,\n\t\tname: 'Custom question (non sport)',\n\t\tquestion: null,\n\t\tanswers: null,\n\t},\n\t{\n\t\ttype: SAWGPMarketType.CustomSport,\n\t\tname: 'Custom question (sport)',\n\t\tquestion: null,\n\t\tanswers: null,\n\t},\n];\n","import { SAWGPMarketType } from './MarketsType';\nimport { QuizSportType } from './SportTypes';\n\nexport const QuizMarketPerSport = {\n\t[QuizSportType.Basketball]: [\n\t\tSAWGPMarketType.One_Two,\n\t\tSAWGPMarketType.Overtime,\n\t\tSAWGPMarketType.OneXTwo,\n\t\tSAWGPMarketType.OddEven,\n\t\tSAWGPMarketType.OddEvenHomeAway,\n\t\tSAWGPMarketType.DoubleChance,\n\t],\n\t[QuizSportType.Soccer]: [\n\t\tSAWGPMarketType.OneXTwo,\n\t\tSAWGPMarketType.OneXTwoHalftime,\n\t\t// SAWGPMarketType.HalftimeFulltime,\n\t\tSAWGPMarketType.FirstGoal,\n\t\tSAWGPMarketType.LastGoal,\n\t\tSAWGPMarketType.DoubleChance,\n\t\tSAWGPMarketType.OverUnder2_5,\n\t\tSAWGPMarketType.OverUnder1_5Halftime,\n\t\tSAWGPMarketType.OverUnder1_5__2ndHalf,\n\t\tSAWGPMarketType.RedCard,\n\t\tSAWGPMarketType.TotalCorners8_5,\n\t\tSAWGPMarketType.TotalCorners9_5,\n\t\tSAWGPMarketType.Corners1x2,\n\t],\n\t[QuizSportType.Tennis]: [\n\t\tSAWGPMarketType.One_Two,\n\t\tSAWGPMarketType.FirstSet,\n\t\tSAWGPMarketType.SecondSet,\n\t\tSAWGPMarketType.ThirdSet,\n\t\tSAWGPMarketType.FourthSet,\n\t\tSAWGPMarketType.FifthSet,\n\t\tSAWGPMarketType.PlayerOneWinsOneSet,\n\t\tSAWGPMarketType.PlayerTwoWinsOneSet,\n\t\tSAWGPMarketType.OddEven,\n\t],\n};\n","import { SAWTemplate } from \"../MiniGames\";\nimport { QuizAnswersValueType } from \"./MarketsAnswers\";\nimport { SAWGPMarketType } from \"./MarketsType\";\n\n/**\n * GamePickMarketType defines legacy market categories for MatchX events\n */\nexport enum GamePickMarketType {\n\t/** Predict the number of goals */\n\tGoals = 1,\n\t/** Predict the winner */\n\tWinner = 2,\n}\n\n/**\n * GamePickResolutionType defines how a user's prediction was scored after event resolution\n */\nexport enum GamePickResolutionType {\n\t/** Event not yet resolved */\n\tNone = 0,\n\t/** Prediction was wrong */\n\tLost = 2,\n\t/** Prediction was partially correct (e.g. correct winner but wrong score) */\n\tPartialWin = 3,\n\t/** Prediction was fully correct */\n\tFullWin = 4,\n}\n\n/**\n * GPRoundStatus defines the lifecycle stage of a game round\n */\nexport enum GPRoundStatus {\n\t/** Round is in an active/other state */\n\tOther = -1,\n\t/** Round exists but has no events defined yet */\n\tNoEventsDefined = 1,\n\t/** Betting deadline has passed, no more bets allowed */\n\tNoMoreBetsAllowed = 2,\n\t/** All events in the round are resolved, but the round itself is not finalized */\n\tAllEventsResolved_ButNotRound = 3,\n\t/** Round is fully resolved and scored */\n\tRoundResolved = 4,\n}\n\n/**\n * GamePickScoreType defines how scores are calculated for predictions\n */\nexport enum GamePickScoreType {\n\t/** Score based on exact match of predicted result */\n\tExactScore = 1,\n\t/** Score based on closeness (difference) of predicted result */\n\tPointsDifference = 2,\n}\n\n/**\n * GamePickSportType defines supported sport types for events, using Betradar sport IDs\n */\nexport enum GamePickSportType {\n\tSoccer = 1,\n\tBasketball = 2,\n\tBaseball = 3,\n\tIceHockey = 4,\n\tTennis = 5,\n\tHandball = 6,\n\tFloorball = 7,\n\tGolf = 9,\n\tBoxing = 10,\n\tMotorsport = 11,\n\tRugby = 12,\n\tAussieRules = 13,\n\tBandy = 15,\n\tAmericanFootball = 16,\n\tCycling = 17,\n\tSpecials = 18,\n\tSnooker = 19,\n\tTableTennis = 20,\n\tCricket = 21,\n\tDarts = 22,\n\tVolleyball = 23,\n\tFieldHockey = 24,\n\tWaterpolo = 26,\n\tCurling = 28,\n\tFutsal = 29,\n\tBadminton = 31,\n\tBowls = 32,\n\tChess = 33,\n\tBeachVolley = 34,\n\tNetball = 35,\n\tAthletics = 36,\n\tSquash = 37,\n\tLacrosse = 39,\n\tFormula1 = 40,\n\tAlpineSkiing = 43,\n\tBiathlon = 44,\n\tCrossCountry = 46,\n\tNordicCombined = 47,\n\tSkiJumping = 48,\n\tSchwingen = 56,\n\tBeachSoccer = 60,\n\tPesapallo = 61,\n\tESportCounterStrike = 109,\n\tESportLeagueofLegends = 110,\n\tESportDota = 111,\n\tStarCraft = 112,\n\tMMA = 117,\n\tCallOfDuty = 118,\n\tESportOverwatch = 121,\n\tESportRocketLeague = 128,\n\tIndyRacing = 129,\n\tSpeedway = 131,\n\tGaelicFootball = 135,\n\tGaelicHurling = 136,\n\tESporteSoccer = 137,\n\tKabaddi = 138,\n\tESporteBasketball = 153,\n\tBasketball3x3 = 155,\n\tESportArenaofValor = 158,\n\tTouringCarRacing = 188,\n\tMotorcycleRacing = 190,\n\tStockCarRacing = 191,\n}\n\n/**\n * GameRoundOrderType defines how events within a round are ordered for display\n */\nexport enum GameRoundOrderType {\n\t/** Display in the order events were added */\n\tHowAdded = 1,\n\t/** Display in reverse of the order events were added */\n\tHowAddedReversed = 2,\n\t/** Display ordered by event/match date ascending (earliest first) */\n\tEventDateAscending = 3,\n\t/** Display ordered by event/match date descending (latest first) */\n\tEventDateDescending = 4,\n}\n\n/** Round ID constant used to request the overall/seasonal leaderboard across all rounds */\nexport const AllRoundsGameBoardID = -1;\n\n/**\n * QuizEventMeta describes metadata for a quiz-type event (custom question with answer options)\n */\nexport interface QuizEventMeta {\n\t/** List of possible answer options for the quiz question */\n\tanswers?: {\n\t\t/** Answer identifier value sent on submission */\n\t\tvalue: string;\n\t\t/** Localized display text of the answer */\n\t\ttext: string;\n\t\t/** Per-language overrides for the answer text */\n\t\t_translations: {\n\t\t\t[key: string]: {\n\t\t\t\ttext: string;\n\t\t\t};\n\t\t};\n\t}[];\n\t/** URL of an image associated with the question */\n\tquestion_image?: string;\n\t/** Correct answer value after resolution */\n\tresult?: QuizAnswersValueType;\n\t/** Custom question text displayed to the user */\n\tcustom_question: string;\n}\n\n/**\n * GamePickEventMeta describes metadata for a MatchX or Quiz event, including team info and sport context\n */\nexport interface GamePickEventMeta extends QuizEventMeta {\n\t/** Display name of the event/match */\n\tevent_name?: string;\n\t/** Name of the first team (home) */\n\tteam1_name: string;\n\t/** URL of the first team's logo image */\n\tteam1_image: string;\n\t/** Name of the second team (away) */\n\tteam2_name: string;\n\t/** URL of the second team's logo image */\n\tteam2_image: string;\n\t/** Actual result score for team 1 after resolution */\n\tteam1_result?: number;\n\t/** Actual result score for team 2 after resolution */\n\tteam2_result?: number;\n\t/** Betradar sport type ID for the event */\n\tsport_type_id?: number;\n\t/** Whether the event has been canceled */\n\tis_canceled?: boolean;\n\t/** Whether auto-resolution from live data feed is enabled */\n\tauto_resolve_enabled?: boolean;\n\t/** ISO date string for when auto-resolution is expected */\n\tauto_resolve_date?: string;\n\t/** Auto-resolved score for team 1 from live data feed */\n\tteam1_auto_result?: number;\n\t/** Auto-resolved score for team 2 from live data feed */\n\tteam2_auto_result?: number;\n\t/** Auto-resolved answer value from live data feed (for quiz events) */\n\tauto_result?: string;\n\t/** Per-language overrides for team names, event name, and custom question */\n\t_translations: {\n\t\t[key: string]: {\n\t\t\tteam1_name: string;\n\t\t\tteam2_name: string;\n\t\t\tevent_name: string;\n\t\t\tcustom_question: string;\n\t\t};\n\t};\n}\n\n/**\n * GamePickEvent describes a single event (match or question) within a round, including the user's prediction and resolution\n */\nexport interface GamePickEvent {\n\t/** Unique identifier of the event */\n\tgp_event_id: number;\n\t/** ISO 8601 date-time string when the event was resolved; null until resolved. */\n\tevent_resolution_date: string;\n\t/** ISO 8601 date-time string of the match/event start time. */\n\tmatch_date: string;\n\t/** Market type defining the prediction format (e.g. two-team score, quiz question, custom) */\n\tmarket_type_id: SAWGPMarketType;\n\t/** Event metadata containing team names, images, sport type, and question details */\n\tevent_meta: GamePickEventMeta;\n\t/** Whether the current user has submitted a prediction for this event */\n\tuser_placed_bet: boolean;\n\t/** User's predicted score for team 1 (MatchX only). Can be a number or a range object */\n\tteam1_user_selection?: number | { from: number; to: number };\n\t/** User's predicted score for team 2 (MatchX only). Can be a number or a range object */\n\tteam2_user_selection?: number | { from: number; to: number };\n\t/** User's selected answer (Quiz only). Value depends on market type (e.g. '1', '2', 'x', 'yes', 'no') */\n\tuser_selection?: QuizAnswersValueType;\n\t/** How the user's prediction was scored after resolution */\n\tresolution_type_id: GamePickResolutionType;\n\t/** Points awarded for this event based on prediction accuracy */\n\tresolution_score?: number;\n\t/** Whether this event is still accepting predictions */\n\tis_open_for_bets?: boolean;\n\t/** Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …).\n\t * Dual-purpose by event type:\n\t * - Sports / MatchX: decimal **betting odds** (e.g. `{ \"1\": 2.45, \"x\": 3.26, \"2\": 3.01 }`).\n\t * - Quiz: when the round's `show_users_preference` is `true`, these are aggregated\n\t *   **user-preference percentages** — what other users predicted, summing to ~100\n\t *   (e.g. `{ \"1\": 33, \"x\": 25, \"2\": 42 }`). Render as the \"what others predicted\" bar. */\n\todds_details?: { odd_value: { [key: string]: number } };\n\t/** URL of a question-specific image (quiz events) */\n\tquestion_image?: string;\n}\n\n/**\n * GamePickRoundPublicMeta describes the public-facing metadata and translations for a round, configured in the BackOffice\n */\nexport interface GamePickRoundPublicMeta {\n\t/** Localized round name */\n\tround_name: string;\n\t/** Localized round description */\n\tround_description: string;\n\t/** URL of the promotional image for the round */\n\tpromo_image: string;\n\t/** Promotional text displayed with the round */\n\tpromo_text: string;\n\t/** Whether to hide the round from the UI after it has been resolved */\n\thide_resolved_round: boolean;\n\t/** URL of the final screen image for desktop */\n\tfinal_screen_image_desktop: string;\n\t/** URL of the final screen image for mobile */\n\tfinal_screen_image_mobile: string;\n\t/** Message displayed on the final/results screen */\n\tfinal_screen_message: string;\n\t/** Label for the CTA button on the final screen */\n\tfinal_screen_cta_button_title: string;\n\t/** Deep link triggered by the CTA button on the final screen */\n\tfinal_screen_cta_dp: string;\n\t/** Whether users can edit their answers after initial submission (within betting window) */\n\tallow_edit_answers?: boolean;\n\t/** Per-language overrides for round display content */\n\t_translations: {\n\t\t[key: string]: {\n\t\t\tround_name: string;\n\t\t\tround_description: string;\n\t\t\tpromo_image: string;\n\t\t\tpromo_text: string;\n\t\t\tfinal_screen_image_desktop: string;\n\t\t\tfinal_screen_image_mobile: string;\n\t\t\tfinal_screen_message: string;\n\t\t\tfinal_screen_cta_button_title: string;\n\t\t};\n\t};\n}\n\n/**\n * GamePickRoundBase describes a game round's metadata (without events or user-specific data)\n */\nexport interface GamePickRoundBase {\n\t/** Unique round identifier */\n\tround_id: number;\n\t/** Sequential row ID used for ordering rounds */\n\tround_row_id: number;\n\t/** Localized display name of the round */\n\tround_name: string;\n\t/** Localized description of the round */\n\tround_description: string;\n\t/** Label for the CTA button on the final/results screen */\n\tfinal_screen_cta_button_title: string;\n\t/** Message displayed on the final/results screen */\n\tfinal_screen_message: string;\n\t/** URL of the final screen image (desktop) */\n\tfinal_screen_image_desktop: string;\n\t/** URL of the final screen image (mobile) */\n\tfinal_screen_image_mobile: string;\n\t/** URL of the promotional image for the round */\n\tpromo_image: string;\n\t/** Promotional text displayed with the round */\n\tpromo_text: string;\n\t/** Timestamp (ms) when the round opens for participation */\n\topen_date: number;\n\t/** Timestamp (ms) of the last moment bets are accepted */\n\tlast_bet_date: number;\n\t/** Timestamp (ms) when the round is expected to be resolved */\n\tresolution_date: number;\n\t/** Points awarded for a fully correct prediction */\n\tscore_full_win: number;\n\t/** Points awarded for a partially correct prediction */\n\tscore_part_win: number;\n\t/** Points awarded (or deducted) for an incorrect prediction */\n\tscore_lost: number;\n\t/** Whether the round is currently active for participation */\n\tis_active_now: boolean;\n\t/** Whether the round has been fully resolved and scored */\n\tis_resolved: boolean;\n\t/** Current lifecycle status of the round */\n\tround_status_id: GPRoundStatus;\n\t/** Total number of events in the round */\n\tevents_total: number;\n\t/** Number of events that have been resolved */\n\tevents_resolved: number;\n\t/** Scoring method used for this round */\n\tscore_type_id: GamePickScoreType;\n\t/** How events are ordered for display */\n\torder_events: GameRoundOrderType;\n\t/** Maximum number of users shown on the leaderboard */\n\tboard_users_count: number;\n\t/** Whether other users' predictions are hidden until resolution */\n\thide_users_predictions: boolean;\n\t/** Public metadata including translations and display settings from the BackOffice */\n\tpublic_meta: GamePickRoundPublicMeta;\n\t/** Timestamp (ms) when the next round opens, if available */\n\tnext_round_open_date: number;\n\t/** Whether to show aggregated user preference percentages for each outcome */\n\tshow_users_preference: boolean;\n}\n\n/**\n * GamePickRound describes a round with its events and the current user's prediction data\n */\nexport interface GamePickRound extends GamePickRoundBase {\n\t/** List of events (matches/questions) in this round */\n\tevents: GamePickEvent[];\n\t/** Current user's total score in this round */\n\tuser_score: number;\n\t/** Whether the current user has submitted any predictions in this round */\n\tuser_placed_bet: boolean;\n\t/** Whether there are events still open for betting */\n\thas_open_for_bet_events?: boolean;\n\t/** Whether the user has unsaved changes to their predictions */\n\thas_not_submitted_changes?: boolean;\n}\n\n/**\n * GamePickRoundBoard describes a round's leaderboard with ranked users\n */\nexport interface GamePickRoundBoard extends GamePickRoundBase {\n\t/** Current user's leaderboard entry, or null if user hasn't participated */\n\tmy_user: GamePickBoardUser;\n\t/** Ranked list of users on the leaderboard */\n\tusers: GamePickBoardUser[];\n}\n\n/**\n * GamePickBoardUser describes a user's entry on the round leaderboard\n */\nexport interface GamePickBoardUser {\n\t/** External user ID (Smartico numeric user ID) */\n\text_user_id: string;\n\t/** Internal user ID within the games system */\n\tint_user_id: number;\n\t/** Display name shown on the leaderboard */\n\tpublic_username: string;\n\t/** URL of the user's avatar image */\n\tavatar_url: string;\n\t/** User's rank position on the leaderboard, null if not yet ranked */\n\tgp_position: number;\n\t/** User's total score in this round/season */\n\tresolution_score: number;\n\t/** Number of fully correct predictions */\n\tfull_wins_count: number;\n\t/** Number of partially correct predictions */\n\tpart_wins_count: number;\n\t/** Number of incorrect predictions */\n\tlost_count: number;\n}\n\n/**\n * GamePickUserInfo describes the current user's profile in the games system\n */\nexport interface GamePickUserInfo {\n\t/** External user ID (Smartico numeric user ID) */\n\text_user_id: string;\n\t/** Internal user ID within the games system */\n\tint_user_id: number;\n\t/** Display name */\n\tpublic_username: string;\n\t/** URL of the user's avatar image */\n\tavatar_url: string;\n\t/** User's leaderboard rank position */\n\tgp_position?: number;\n\t/** Number of fully correct predictions */\n\tfull_wins_count?: number;\n\t/** Number of partially correct predictions */\n\tpart_wins_count?: number;\n\t/** User's total score */\n\tresolution_score?: number;\n\t/** ISO 8601 date-time string of the last time the user's balance was synced from the Smartico platform. */\n\tlast_wallet_sync_time?: string;\n\t/** User's current points balance */\n\tach_points_balance?: number;\n\t/** User's current gems balance */\n\tach_gems_balance?: number;\n\t/** User's current diamonds balance */\n\tach_diamonds_balance?: number;\n\t/** Whether the user has set a custom public username */\n\tpubic_username_set?: boolean;\n}\n\n/**\n * GamePickGameInfo describes the game configuration including SAW template, rounds list, and label settings\n */\nexport interface GamePickGameInfo {\n\t/** Game template configuration (SAW template) with UI settings, buy-in type, cost, and spin count */\n\tsawTemplate: SAWTemplate;\n\t/** List of all rounds (metadata only, no events) */\n\tallRounds: GamePickRoundBase[];\n\t/** Label/brand configuration and settings */\n\tlabelInfo: any;\n}\n\n/**\n * GamesApiResponse is the standard response wrapper for all GamePick/Quiz API calls\n */\nexport interface GamesApiResponse<T> {\n\t/** Error code; `0` = success. Per-method code tables live in each `gamePick*` method's TSDoc. */\n\terrCode: number;\n\t/** Human-readable error message; populated when `errCode` is non-zero. */\n\terrMessage?: string;\n\t/** Response payload, present on success */\n\tdata?: T;\n}\n\n/**\n * GamePickRequestParams describes the base parameters required for GamePick API calls\n */\nexport interface GamePickRequestParams {\n\t/** ID of the MatchX or Quiz game template. The only field the consumer supplies. */\n\tsaw_template_id: number;\n\t/** External user ID. Injected by the SDK from the active session; consumers omit it. */\n\text_user_id?: string;\n\t/** Platform external user ID. Injected by the SDK from the active session; consumers omit it. */\n\tsmartico_ext_user_id?: string;\n\t/** Language code for translations (e.g. 'EN', 'DE'). Defaults to the session language. */\n\tlang?: string;\n}\n\n/**\n * GamePickRoundRequestParams extends base params with a specific round ID\n */\nexport interface GamePickRoundRequestParams extends GamePickRequestParams {\n\t/** ID of the specific round */\n\tround_id: number;\n}\n","enum JackpotContributionType {\n\tFixed = 1,\n\tPercentage = 2,\n}\n\nexport { JackpotContributionType };\n","enum JackPotTemparature {\n\t/** cold, seed amount < current pot < (min amount - seed amount)/2 */\n\tCOLD = 0,\n\t/** warm, (min amount - seed amount)/2 < current pot < min amount */\n\tWARM = 1,\n\t/** hot, current pot > min amount, entered explosion range */\n\tHOT = 2,\n\t/** burning, current pot > min amount + 0.5 * (max amount - min amount). E.g. mid of allowed explosion range */\n\tBURNING = 3,\n}\n\n/**\n * Live snapshot of one jackpot pot's value and temperature.\n * Embedded on `JackpotDetails.pot`; refreshed at the 1 s SDK cache TTL.\n */\ninterface JackpotPot {\n\t/** Template ID this pot belongs to. */\n\tjp_template_id: number;\n\t/** Stable numeric ID of the current pot instance (rotates when the pot explodes). */\n\tjp_pot_id: number;\n\t/** Current pot amount in the jackpot's native currency (`jp_currency`). */\n\tcurrent_pot_amount: number;\n\t/** Current pot amount converted to the user's wallet currency (`user_currency`). */\n\tcurrent_pot_amount_user_currency: number;\n\t/** Unix ms timestamp of when this pot last exploded; `null` while the pot is still running. */\n\texplode_date_ts: number | null;\n\t/** Owning user for `JackpotType.Personal` pots; `null` for shared `MultiUser` pots. */\n\tuser_id: number | null;\n\t/** Heat band of the pot relative to its explosion range; see {@link JackPotTemparature}. */\n\tcurrent_pot_temperature: JackPotTemparature;\n}\n\nexport { JackpotPot, JackPotTemparature };\n","enum JackpotType {\n\tMultiUser = 1,\n\tPersonal = 2,\n}\n\nexport { JackpotType };\n","/**\n * Limit error codes returned in `errCode` by the `avatarsCustomize` method.\n * See the `avatarsCustomize` TSDoc for the full table (including the generic\n * `-1` failure, which has no named member here).\n */\nexport enum AvatarCustomizeErrorCode {\n\t/** The user has reached the operator-configured per-user monthly cap on custom-avatar generations. */\n\tAVATAR_USER_LIMIT = 12001,\n\t/** The brand's operator-configured shared monthly pool of custom-avatar generations is exhausted. */\n\tAVATAR_LABEL_LIMIT = 12002,\n}\n","/**\n * Error codes returned in `errCode` by the `joinClan` method (also carried\n * on `TClanJoinResult`). These are terse value definitions for lookup; the\n * full per-code narrative and UI handling lives in the `joinClan` method\n * TSDoc, which owns the error table.\n */\nexport enum JoinClanErrorCode {\n\t/** Success — join completed; entry fee (if any) deducted. */\n\tJOIN_CLAN_OK = 0,\n\t/** Request was malformed (missing or invalid parameters). */\n\tJOIN_CLAN_INVALID_PARAMETERS = 1000,\n\t/** Clan doesn't exist for this label. Archived clans are also reported as `1001`. */\n\tJOIN_CLAN_NOT_FOUND = 1001,\n\t/** Clan is full — member capacity reached. */\n\tJOIN_CLAN_FULL = 1002,\n\t/** Insufficient balance for the entry fee (points / gems / diamonds). */\n\tJOIN_CLAN_INSUFFICIENT_FUNDS = 1003,\n\t/** User doesn't meet the clan's entry segment or conditions. */\n\tJOIN_CLAN_SEGMENT_MISMATCH = 1004,\n\t/**\n\t * User is not in a clan. Note: a `registerInTournament` response code\n\t * that shares this enum — never returned by `joinClan`.\n\t */\n\tJOIN_CLAN_USER_IS_NOT_IN_CLAN = 1005,\n\t/** User is within the clan-switch cooldown window (switch only). */\n\tJOIN_CLAN_COOLDOWN_ACTIVE = 1006,\n\t/**\n\t * Clan joined after tournament start. Note: a `registerInTournament`\n\t * response code that shares this enum — never returned by `joinClan`.\n\t */\n\tJOIN_CLAN_JOINED_AFTER_TOURNAMENT_START = 1011,\n}\n"],"names":["ClassId","IntUtils","uuid","a","b","Math","random","toString","isNotNull","val","isNotEmpty","length","replaceAll","value","regex","replacement","replace","RegExp","escapeRegExp","v","JsonOrText","str","includes","JSON","parse","e","isWithinPeriod","timestamp","period","now","Date","completedDate","getFullYear","getMonth","getDate","startOfWeek","setDate","getDay","setHours","endOfWeek","SAWBuyInType","SAWBuyInTypeName","SAWBuyInTypeNamed","type","Free","Points","Spins","Gems","Diamonds","Unknown","SAWUtils","canPlay","t","user_balances","undefined","saw_buyin_type_id","spin_count","balance","ach_points_balance","ach_gems_balance","ach_diamonds_balance","buyin_cost_points","console","error","SAWAcknowledgeType","SAWAcknowledgeTypeName","SAWAcknowledgeTypeNamed","Silent","QuickMessage","FullMessage","ExplicityAcknowledge","SAWAskForUsername","SAWGameType","SAWGameTypeName","SAWGameTypeNamed","SpinAWheel","ScratchCard","MatchX","GiftBox","PrizeDrop","Quiz","LootboxWeekdays","LootboxCalendarDays","TreasureHunt","Voyager","Plinko","CoinFlip","CustomMinigame","SAWExposeUserSpinId","SAWExposeUserSpinIdName","SAWExposeUserSpinIdNamed","id","UserId","SpinId","SAWGameLayout","SAWGameLayoutName","SAWGameLayoutNamed","layout","Horizontal","VerticalMap","SAWPrizeType","MiniGamePrizeTypeName","MiniGamePrizeTypeNamed","NO_PRIZE","POINTS","BONUS","MANUAL","SPIN","JACKPOT","CHANGE_LEVEL","MISSION","RAFFLE_TICKET","GEMS_AND_DIAMONDS","UNKNOWN","SAWTemplatesTransform","items","map","r","_r$saw_skin_ui_defini","x","_extends","saw_template_id","name","saw_template_ui_definition","description","thumbnail","saw_skin_ui_definition","skin_folder","saw_skin_key","visibile_when_can_spin","over_limit_message","no_attempts_message","jackpot_symbol","saw_game_type","saw_game_type_id","saw_buyin_type","buyin_cost_gems","buyin_cost_diamonds","jackpot_add_on_attempt","jackpot_current","promo_image","promo_text","custom_data","expose_game_stat_on_api","relative_period_timezone","activeFromDate","activeTillDate","next_available_spin_ts","earliest_expiration_dt","latest_expiration_dt","steps_to_finish_game","min_steps_to_finish_game","custom_section_id","game_layout","show_prize_history","max_number_of_attempts","maxSpinsCount","max_spins_period_ms","maxSpinsPediodMs","expose_user_spin_id","prizes","p","_p$saw_prize_ui_defin","y","saw_prize_id","saw_prize_ui_definition","prize_type","prize_type_id","prize_value","font_size","font_size_mobile","icon","position","sectors","acknowledge_type","aknowledge_message","aknowledge_message_lose","acknowledge_dp","acknowledge_action_title","acknowledge_dp_additional","acknowledge_action_title_additional","second_btn","second_btn_action_title","out_of_stock_message","pool","pool_initial","wins_count","weekdays","active_from_ts","active_till_ts","is_surcharge","is_deleted","prize_modifiers","allow_split_decimal","hide_prize_from_history","requirements_to_get_prize","max_give_period_type_id","SAWSpinErrorCode","SAWWinSoundType","SAWWinSoundFiles","NoSound","Disappointing","Positive","HighlyPositive","SAWHistoryTransform","template","prize_amount","client_request_id","is_claimed","create_date_ts","acknowledge_date_ts","PrizeModifiers","PrizeModifiersKeysNames","SAWWheelLayout","SAWGameDifficultyType","SAWGameDifficultyTypeName","SawGameDifficultyTypeNamed","EASY","MEDIUM","HARD","AttemptPeriodType","NodeCache","constructor","ttlChecker","cache","setInterval","getTime","key","hasOwnProperty","o","ttl","get","set","ttlSeconds","remove","removeByPrefix","prefix","indexOf","flushAll","clearInterval","ECacheContext","OCache","init","cacheContext","oKey","stringify","deepClone","use","f","clear","clearByPrefix","oKeyBase","slice","clearContext","clearAll","ActivityTypeLimited","CoreUtils","currencySymbol","currency","toUpperCase","USD","EUR","JPY","GBP","AUD","CAD","CHF","CNY","SEK","NZD","MXN","SGD","HKD","NOK","KRW","TRY","INR","RUB","BRL","ZAR","avatarUrl","avatar_id","avatarDomain","startsWith","endsWith","PublicLabelSettings","TranslationArea","InboxMessagesTransform","item","sent_date","createDate","message_guid","engagement_uid","read","is_read","favorite","is_starred","category_id","expire_on_dt","InboxMessageBodyTransform","action","image","title","preview_body","body","additional_buttons","buttons","text","inbox_cta_text","html_body","InboxMessageType","OpenLinksType","InboxCategories","InboxReadStatus","BuyStoreItemErrorCode","StoreCategoryTransform","_r$publicMeta","_r$publicMeta2","publicMeta","order","StoreItemPurchaseType","StoreItemType","StoreItemTypeName","StoreItemTypeNamed","Bonus","Tangible","MiniGameSpin","ChangeLevel","RaffleTicket","mapPurchaseType","purchaseType","StoreItemTransform","filter","_r$itemPublicMeta$pri","_r$categoryIds","_r$relatedGames","itemPublicMeta","purchase_type","price","Number","image_url","ribbon","label_tag","custom_label_tag","limit_message","purchase_limit_message","priority","related_item_ids","related_items","hint_text","itemTypeId","can_buy","canBuy","category_ids","categoryIds","shopPool","active_till_date","show_timer","discounted_price","discount_prize","discount_price_ribbon","discount_prize_ribbon","custom_ribbon_image","only_in_custom_section","custom_section_type_id","cant_buy_message","related_games","relatedGames","g","game_public_meta","enabled","i","ext_game_id","link","game_categories","game_provider","mobile_spec_link","StoreItemPurchasedTransform","purchasedToday","purchase_ts","purchasedThisWeek","purchasedThisMonth","purchase_points_amount","purchased_today","purchased_this_week","purchased_this_month","AchievementStatus","AchievementTaskType","AchievementType","AchievementAvailabilityStatus","BadgesTimeLimitStates","USER_STATE_PARAMS_KEYS_GAMES","USER_STATE_PARAMS_KEYS_BET_AMOUNT","MINOR_WORDS","Set","toGameTitleCase","raw","tokens","toLowerCase","split","wordTokens","test","lastWordIdx","wordIndex","token","isFirst","isLast","has","charAt","join","MissionUtils","getAvailabilityStatus","mission","activeFrom","getMs","activeTill","startDate","start_date_ts","timeLimit","time_limit_ms","requiresOptIn","requiresOptin","optedIn","isOptedIn","isLockedMission","ach_status_id","AvailableLocked","isLocked","AvailableActive","AvailableInactive","Available","UnavailableWithActiveFrom","AvailableWithActiveTillActive","AvailableWithActiveTillInactive","AvailableWithActiveTill","MissedByActiveTill","endDate","AvailableLimitedActive","MissedByLimitInTime","AvailableLimitedInactive","AvailableLimited","AvailableFullyLimitedActive","AvailableFullyLimitedInactive","AvailableFullyLimited","ts","replaceTagsFavMissionTask","task","valueToReplace","_task$task_public_met","result","userStateParams","user_state_params","userStateOperator","task_public_meta","user_state_operations","userStateParamsKeys","Object","keys","operatorsMulti","operatorsPos","suggestedGames","suggestedValue","forEach","k","_userStateOperator$k","operator","op","_userStateParams$k","Boolean","cleaned","pos","currencyFromTheTask","core_wallet_currency","replaceFavGameNameTag","determineBadgeState","badge","progress","isCompleted","complete_date_ts","BeforeStartDate","AfterStartDateNoProgress","AfterStartDateNoProgressAndEndDate","AfterStartDateWithProgressAndEndDate","AfterEndDateNotStarted","AfterEndDateWithProgress","enrichUserAchievementsWithBadgeState","ach_type_id","Badge","badgeTimeLimitState","UserAchievementTransform","ach_id","_missionName","_missionSubHeader","_missionDescription","_r$ach_categories","completedToday","completedThisWeek","completedThisMonth","missionName","ach_public_meta","missionSubHeader","sub_header","missionDescription","achievementTasks","_r$ach_public_meta$na","_r$ach_public_meta$su","_r$ach_public_meta$de","unlock_mission_description","is_completed","is_locked","is_requires_optin","is_opted_in","dt_start","reward","Mission","cta_action","cta_text","tasks","task_type_id","CompleteAchievement","_t$task_public_meta","task_id","points_reward","gems_reward","diamonds_reward","userProgress","execution_count_expected","executionCount","execution_count_actual","userExecutedCount","display_progress_as_count","stage_image","ach_categories","ach_completed_id","requires_prize_claim","prize_claimed_date_ts","complete_date","completed_today","completed_this_week","completed_this_month","availability_status","claim_button_title","claim_button_action","hide_locked_mission","prize_claim_expiration_date","prize_claim_period_type_id","Recurring","next_recurrence_date_ts","milliseconds_till_available","RecurringUponCompletion","completion_count","completed_count","max_completion_count","recurring_quantity","ScheduledMissionType","AchCategoryTransform","MissionCategory","AchievementClaimPeriodTypeId","clanTournamentPlayersTransform","response","tournament_instance_id","players","user_id","userId","clean_ext_user_id","cleanExtUserId","public_username","userAltName","avatar_real_id","avatar_url","scores","is_me","isMe","TournamentRegistrationType","TournamentRegistrationTypeGetName","AUTO","BUY_IN_POINTS","MANUAL_APPROVAL","OPT_IN","REQUIRES_QUALIFICATION","BUY_IN_GEMS","BUY_IN_DIAMONDS","TournamentRegistrationStatus","TournamentRegistrationStatusName","TournamentRegistrationStatusNamed","CANCELLED","FINISHED","NOT_REGISTERED","PENDING","QUALIFIED_PENDING_REGISTRATION","REGISTERED","REGISTERED_PENDING_QUALIFICATION","TournamentInstanceStatus","TournamentInstanceStatusName","s","PUBLISHED","REGISTER","STARTED","FAILED","FINALIZING","tournamentPrizeTypeToPrizeName","DoNothing","DeductPoints","ResetPoints","MiniGameAttempt","AddGemsAndDiamonds","DeductGemsAndDiamonds","ResetGemsAndDiamonds","TournamentUtils","isCanRegister","tournament","tournamentRegistrationStatus","isUserRegistered","playersMaxCount","registrationCount","registrationType","tournamentInstanceStatus","allowLateRegistration","isInProgress","isActive","isFinished","isCancelled","isUpcoming","getPlayerTransformed","player","playerTransformed","user_ext_id","crm_brand_id","crmBrandId","getPrizeTransformed","prize","TournamentItemsTransform","tournamentId","instance_id","tournamentInstanceId","tournament_id","segment_dont_match_message","image1","image2","image_url2","image2_mobile","image_url2_mobile","prize_pool_short","custom_price_text","is_featured","featured","start_time","startTimeTs","end_time","endTimeTs","registration_count","is_user_registered","players_min_count","playersMinCount","players_max_count","registration_status","registration_type","registration_cost_points","buyInAmount","registration_cost_gems","registration_cost_diamonds","duration_ms","durationMs","is_active","is_can_register","is_cancelled","is_finished","is_in_progress","is_upcoming","min_scores_win","minScoreToWin","hide_leaderboard_min_scores","hideLeaderboardsMinScores","total_scores","totalScores","is_clan_based","isClanBased","prizeStructure","tournamentPlayer","me","tournamentInfoItemTransform","_TournamentItemsTrans","_t$tournamentInfo$tou","_t$tournamentInfo","_t$tournamentInfo2","tournamentInfo","tournamentLobbyInfo","userPosition","_t$userClanId","user_clan_id","userClanId","clan_leaderboard","clanLeaderboard","entry","clan_id","clanId","public_meta","rank","total_score","totalScore","contributing_members","memberCount","clan_prize_structure","clanPrizes","clan_place","prize_pool_amount","prize_pool_currency_code","activity_type_id","details_json","prize_name","tiers","player_tiers","tier","player_place_from","player_place_to","pool_amount","distribution_type","TournamentRegistrationError","TournamentType","LeaderBoardPeriodType","pointsRewardTransform","reward_points","place","points","getLeaderBoardPlayerTransformed","user","user_alt_name","level_id","position_in_board","points_accumulated","getLeaderBoardTransform","board","board_id","board_public_meta","rules","period_type_id","version_id","versiod_id","create_date","rewards","users","positions","GetLevelMapResponseTransform","levels","mapped","l","_l$level_public_meta","level_public_meta","required_points","visibility_points","parseInt","required_level_counter_1","required_level_counter_2","ordinal_position","ordinalById","Map","sort","index","CACHE_DATA_SEC","JACKPOT_TEMPLATE_CACHE_SEC","JACKPOT_POT_CACHE_SEC","JACKPOT_WINNERS_CACHE_SEC","JACKPOT_ELIGIBLE_GAMES_CACHE_SEC","onUpdateContextKey","WSAPIBase","api","userExtId","onUpdateCallback","clearCaches","updateEntity","contextKey","payload","WSAPI","onUpdate","ticketsTransform","ticekt_id","ticket_id_string","winnersTransform","username","ticket","raf_won_id","claimed_date","prizeTransform","prize_id","prizes_per_run","prizes_per_run_actual","chances_to_win_perc","min_required_total_tickets","cap_prizes_per_run","stock_items_per_draw","should_claim","winners","requires_claim","min_required_tickets_for_user","drawTransform","draw_id","image_url_mobile","icon_url","background_image_url","background_image_url_mobile","is_grand","current_state","run_id","execution_type","execution_ts","previous_run_ts","previous_run_id","ticket_start_ts","allow_multi_prize_per_ticket","total_tickets_count","my_tickets_count","my_last_tickets","user_opted_in","requires_optin","winners_limit","winners_offset","winners_total","raffleTransform","raffle_id","start_date","end_date","end_date_ts","max_tickets_count","current_tickets_count","draws","ticket_cap_visualization","drawRunTransform","res","_res$draw$ticket_star","draw","RaffleTicketCapVisualization","RaffleDrawInstanceState","RaffleDrawTypeExecution","drawRunHistoryTransform","draw_runs","actual_execution_ts","is_winner","has_unclaimed_prize","raffleClaimPrizeResponseTransform","info","errorCode","errCode","errorMessage","errMsg","WSAPIUser","args","activityLogOnUpdateParams","getUserProfile","tracker","assign","userPublicProps","Error","checkSegmentMatch","segment_id","coreCheckSegments","find","is_matching","checkSegmentListMatch","segment_ids","Array","isArray","getLevels","Levels","levelsGetT","getCurrentLevel","CurrentLevel","getLevelCurrent","getUserLevelExtraCounters","LevelExtraCounters","getUserGamificationInfoT","getActivityLog","startTimeSeconds","endTimeSeconds","from","to","types","src_types","_types$join","_src_types$join","cacheKey","ActivityLog","getActivityLogT","notifyActivityLogUpdate","_params$types$join","_params$types","_params$src_types$joi","_params$src_types","params","WSAPIGeneral","getCustomSections","CustomSections","customSectionsGetT","getTranslations","lang_code","getTranslationsT","translations","getRelatedItemsForGame","related_game_id","WSAPIMissions","getMissions","Missions","missionsGetItemsT","getBadges","Badges","badgetsGetItemsT","getAchCategories","AchCategories","achGetCategoriesT","requestMissionOptIn","mission_id","missionOptIn","err_code","err_message","requestMissionClaimReward","missionClaimPrize","updateMissions","WSAPIBonuses","getBonuses","Bonuses","bonusesGetItemsT","claimBonus","bonus_id","bonusClaimItem","success","updateBonuses","WSAPIStore","storeHistoryOnUpdateParams","limit","offset","storeHistoryCacheKey","StoreHistory","getStoreItems","StoreItems","storeGetItemsT","buyStoreItem","item_id","getStoreCategories","StoreCategories","storeGetCategoriesT","getStorePurchasedItems","requestLimit","requestOffset","storeGetPurchasedItemsT","updateStorePurchasedItems","updateStoreItems","WSAPITournaments","getTournamentsList","TournamentList","tournamentsGetLobbyT","getTournamentInstanceInfo","tournamentsGetInfoT","getClanTournamentPlayers","clanTournamentGetPlayers","registerInTournament","updateTournaments","WSAPIClans","getClans","Clans","clansGetListT","getClanInfo","clansGetInfoT","joinClan","clanJoin","updateClans","WSAPIJackpots","jackpotGetSignature","jackpotClearCache","Jackpots","Pots","JackpotWinners","JackpotEligibleGames","jackpotGet","_this","signature","jp_template_id","jackpots","pots","_jackpots","_pots","jp","pot","jp_public_meta","jp_template_ids","potGet","_jp","jackpotOptIn","jackpotOptOut","getJackpotWinners","getJackpotWinnersT","getJackpotEligibleGames","getJackpotEligibleGamesT","WSAPIRaffles","updateRaffles","getRafflesT","Raffles","getRaffles","getRaffleDrawRun","props","getRaffleDrawRunT","winners_from","winners_to","getRaffleDrawRunsHistory","claimRafflePrize","won_id","requestRaffleOptin","raffle_run_id","raffleOptin","getRaffleWonPrizes","_props$offset","_props$limit","WSAPIMiniGames","getMiniGames","Saw","sawGetTemplatesT","getMiniGamesHistory","SAWHistory","getSawWinningHistoryT","playMiniGame","template_id","acknowledge","sawSpinRequest","doAcknowledgeRequest","request_id","miniGameWinAcknowledgeRequest","lose","playMiniGameBatch","sawSpinBatchRequest","request_ids","results","doAcknowledgeBatchRequest","errMessage","jackpot_amount","first_spin_in_period","updateOnSpin","data","templates","findIndex","reloadMiniGameTemplate","updatedTemplates","WSAPIAvatars","getAvatarsList","AvatarsList","avatarsGetListT","getAvatarsCustomized","AvatarsCustomized","avatarsGetCustomizedT","getAvatarPrompts","AvatarPrompts","avatarsGetPromptsT","setAvatar","_r$errCode","avatarSetAvatar","avatarsCustomize","required","field","cdn_url","WSAPIGamePick","gamePickGetActiveRounds","gpGetActiveRounds","gamePickGetActiveRound","round_id","gpGetActiveRound","gamePickGetHistory","gpGetGamesHistory","gamePickGetBoard","gpGetGameBoard","gamePickSubmitSelection","_props$round","round","gpSubmitSelection","gamePickSubmitSelectionQuiz","_props$round2","gamePickGetUserInfo","gpGetUserInfo","gamePickGetGameInfo","gpGetGameInfo","gamePickGetRoundInfoForUser","int_user_id","gpGetRoundInfoForUser","WSAPILeaderBoard","getLeaderBoard","periodType","getPreviousPeriod","LeaderBoards","leaderboardsGetT","getLeaderBoards","leaderboardsGetListT","WSAPIInbox","reportImpressionEvent","activityType","reportEngagementImpression","reportClickEvent","reportEngagementAction","getInboxMessages","onlyFavorite","categoryId","read_status","InboxMessages","getInboxMessagesT","getInboxUnreadCount","InboxUnreadCount","getInboxUnreadCountT","getInboxMessageBody","messageGuid","getInboxMessageBodyT","markInboxMessageAsRead","markInboxMessageRead","markAllInboxMessagesAsRead","markAllInboxMessageRead","markUnmarkInboxMessageAsFavorite","mark","deleteInboxMessage","deleteAllInboxMessages","updateInboxUnreadCount","count","updateInboxMessages","on","SAW_SPINS_COUNT_PUSH","SAW_SHOW_SPIN_PUSH","SAW_AKNOWLEDGE_RESPONSE","SAW_DO_SPIN_RESPONSE","MISSION_OPTIN_RESPONSE","ACHIEVEMENT_CLAIM_PRIZE_RESPONSE","RELOAD_ACHIEVEMENTS_EVENT","TOURNAMENT_REGISTER_RESPONSE","BUY_SHOP_ITEM_RESPONSE","CLIENT_ENGAGEMENT_EVENT_NEW","LOGOUT_RESPONSE","IDENTIFY_RESPONSE","JP_WIN_PUSH","_data","JP_OPTOUT_RESPONSE","JP_OPTIN_RESPONSE","CLAIM_BONUS_RESPONSE","SAW_DO_SPIN_BATCH_RESPONSE","RAF_CLAIM_PRIZE_RESPONSE","GET_INBOX_MESSAGES_RESPONSE","unread_count","CLIENT_PUBLIC_PROPERTIES_CHANGED_EVENT","_data$props","_data$props2","_data$props3","_data$props4","_data$props5","core_inbox_unread_count","RAF_OPTIN_RESPONSE","AchCustomSectionType","AchCustomLayoutTheme","AchMissionsTabsOptions","AchOverviewMissionsFilter","LiquidEntityData","UICustomSectionTransform","customSections","section_type_id","menu_img","menu_name","custom_skin_images","generic_custom_css","mission_tabs_options","overview_missions_count","overview_missions_filter","url_or_dp","theme","LEVELS","liquid_entity_data","ach_tournament_id","show_raw_data","liquid_template","BADGES","ach_category_ids","STORE","shop_category_ids","push","BonusItemsTransform","is_redeemable","redeemable","redeem_date","redeemDate","label_bonus_template_id","labelBonusTemplateId","bonus_status_id","bonusStatusId","label_bonus_template_meta_map","labelBonusTemplateMetaMap","bonus_meta_map","bonusMetaMap","BonusStatus","ActivityLogActivities","UserBalanceType","ActivityLogTransform","_r$type_id","_r$ctx_meta","_r$create_date$second","_r$create_date","_r$amount","_r$user_points_balanc","_r$ctx_","_r$source_entity_name","_r$source_ref_id","activityTypeId","type_id","isGems","isDiamonds","meta","ctx_meta","context_value_meta","seconds","amount","points_collected","user_points_balance","total_ever","user_points_ever","source_type_id","context_value_1","ctx_1","source_entity_name","source_entity_id","source_reference_id","source_ref_id","source_root_id","is_wallet_entry","PointChangeSourceType","avatarDefinitionTransform","is_default","hide_until_achieved","url","avatar_source_type_id","active_from_date","is_given","is_in_use","avatarCustomizedTransform","dt_created","avatarPromptTransform","prompt_id","cost_currency_type_id","cost_value","GetJackpotWinnersResponseTransform","winnerInfo","winner","win_date_ts","jp_pot_id","GetJackpotEligibleGamesResponseTransform","eligible_games","games","game","game_id","ach_game_id","PUBLIC_API_URL","C_SOCKET_PROD","GAMES_API_URL","AVATAR_DOMAIN","DEFAULT_LANG_EN","SMR_TO_CLOUDFRONT_DOMAINS","SMR_DOMAIN_REGEX","d","SmarticoAPI","label_api_key","brand_api_key","messageSender","options","_options$tracker","_options$tracker2","publicUrl","wsUrl","inboxCdnUrl","partnerUrl","gamesApiUrl","baseRgApiParams","avatarOriginDomain","envId","logger","logCIDs","logHTTPTiming","always","getPublicUrl","getPublicWsUrl","env_id","String","getEnvId","brand_key","hash","getAvatarUrl","getAvatarOriginUrl","getCleanLabelApiKey","getEnvDnsSuffix","ENV_ID","substring","replaceSmrDomainsWithCloudfront","isString","source","replaced","match","err","send","message","expectCID","force_language","cid","timeStart","errSetup","timeEnd","warn","request","obj","buildMessage","api_key","ext_user_id","coreReportCustomEvent","eventType","eventMessage","EVENT","eventResponse","EVENT_RESPONSE","coreGetTranslations","areas","cacheSec","trim","Translations","tsBaseRQ","GET_TRANSLATIONS_REQUEST","hash_code","trBase","GET_TRANSLATIONS_RESPONSE","_trUser$translations","trUserRQ","trUser","coreIdentifyLabel","_this2","LabelInfo","INIT","INIT_RESPONSE","coreIdentifyUser","IDENTIFY","coreChangeUsername","public_username_custom","CLIENT_SET_CUSTOM_USERNAME_REQUEST","CLIENT_SET_CUSTOM_USERNAME_RESPONSE","CHECK_SEGMENT_MATCH_REQUEST","CHECK_SEGMENT_MATCH_RESPONSE","segments","CLIENT_ENGAGEMENT_IMPRESSION_REQUEST","catch","CLIENT_ENGAGEMENT_ACTION_REQUEST","JP_GET_JACKPOTS_REQUEST","JP_GET_JACKPOTS_RESPONSE","JP_GET_LATEST_POTS_REQUEST","JP_GET_LATEST_POTS_RESPONSE","JP_OPTIN_REQUEST","JP_OPTOUT_REQUEST","JP_GET_WINNERS_REQUEST","JP_GET_WINNERS_RESPONSE","JP_GET_ELIGIBLE_GAMES_REQUEST","JP_GET_ELIGIBLE_GAMES_RESPONSE","sawGetTemplates","is_visitor_mode","SAW_GET_SPINS_REQUEST","SAW_GET_SPINS_RESPONSE","_t$saw_template_ui_de","_t$saw_template_ui_de2","jackpotValue","SAW_AKNOWLEDGE_REQUEST","SAW_DO_SPIN_REQUEST","spinAttemptResponse","status","SAW_OK","SAW_NO_SPINS","SAW_PRIZE_POOL_EMPTY","SAW_NOT_ENOUGH_POINTS","SAW_FAILED_MAX_SPINS_REACHED","SAW_TEMPLATE_NOT_ACTIVE","SAW_NOT_IN_SEGMENT","SAW_NO_BALANCE_GEMS","SAW_NO_BALANCE_DIAMONDS","SAW_AKNOWLEDGE_BATCH_RESPONSE","spins_count","spins","SAW_DO_SPIN_BATCH_REQUEST","getSawWinningHistory","GET_SAW_HISTORY_REQUEST","GET_SAW_HISTORY_RESPONSE","MISSION_OPTIN_REQUEST","achievementId","ACHIEVEMENT_CLAIM_PRIZE_REQUEST","TOURNAMENT_REGISTER_REQUEST","itemId","BUY_SHOP_ITEM_REQUEST","inboxGetMessages","GET_INBOX_MESSAGES_REQUEST","storeGetItems","GET_SHOP_ITEMS_REQUEST","GET_SHOP_ITEMS_RESPONSE","storeGetCategories","GET_SHOP_CATEGORIES_REQUEST","GET_SHOP_CATEGORIES_RESPONSE","categories","storeGetPurchasedItems","ACH_SHOP_ITEM_HISTORY_REQUEST","ACH_SHOP_ITEM_HISTORY_RESPONSE","missionsGetItems","GET_ACHIEVEMENT_MAP_REQUEST","GET_ACHIEVEMENT_MAP_RESPONSE","responseClone","achievements","getUserGamificationInfo","GET_ACHIEVEMENT_USER_REQUEST","GET_ACHIEVEMENT_USER_RESPONSE","level_counter_1","level_counter_2","achGetCategories","GET_ACH_CATEGORIES_REQUEST","GET_ACH_CATEGORIES_RESPONSE","badgetsGetItems","bonusesGetItems","GET_BONUSES_REQUEST","GET_BONUSES_RESPONSE","CLAIM_BONUS_REQUEST","bonusId","bonuses","tournamentsGetLobby","GET_TOURNAMENT_LOBBY_REQUEST","GET_TOURNAMENT_LOBBY_RESPONSE","tournaments","clansGetList","GET_CLAN_LIST_REQUEST","GET_CLAN_LIST_RESPONSE","_response$join_date","clans","cooldown_until","join_date","clansGetInfo","GET_CLAN_INFO_REQUEST","GET_CLAN_INFO_RESPONSE","_c$cooldown_until","c","clanInfo","member_count","capacity_limit","entry_fee_currency_type_id","entry_fee_amount","rating_position","rating_score","members","m","contribution_score","joinSourceId","_response$errCode","_response$errMsg","JOIN_CLAN_REQUEST","join_source_id","JOIN_CLAN_RESPONSE","tournamentsGetInfo","_response$userPositio","_response$tournamentI","GET_TOURNAMENT_INFO_REQUEST","GET_TOURNAMENT_INFO_RESPONSE","_response$players","GET_CLAN_TOURNAMENT_PLAYERS_REQUEST","GET_CLAN_TOURNAMENT_PLAYERS_RESPONSE","leaderboardGet","prevPeriod","_response$map$boardKe","_response$map$boardKe2","snapshot_offset","GET_LEADERS_BOARD_REQUEST","include_users","GET_LEADERS_BOARD_RESPONSE","boardKey","DAILY","leaderboardsGetList","values","levelsGet","GET_LEVEL_MAP_REQUEST","GET_LEVEL_MAP_RESPONSE","_userInfo$points_ever2","userInfo","sortedLevels","currentLevelIndex","level","current_level","_userInfo$points_ever","userPointsEver","points_ever","nextLevel","currentLevel","min","max","customSectionsGet","GET_CUSTOM_SECTIONS_REQUEST","GET_CUSTOM_SECTIONS_RESPONSE","starred_only","favoriteOnly","log","_this3","getMessageBody","getLabelSetting","INBOX_PUBLIC_CDN","fetch","method","headers","json","MARK_INBOX_READ_REQUEST","MARK_INBOX_READ_RESPONSE","all_read","MARK_INBOX_STARRED_REQUEST","MARK_INBOX_STARRED_RESPONSE","MARK_INBOX_DELETED_REQUEST","MARK_INBOX_DELETED_RESPONSE","all_deleted","buildGamesApiParams","_this$tracker$userPub","_this$tracker$userPub2","smartico_ext_user_id","getExtUserId","lang","core_user_language","sendGamesApi","usePost","baseParams","queryString","entries","encodeURIComponent","fetchOptions","extraQuery","sendAvatarApi","isQuiz","gpGetTranslations","avatarsGetList","GET_AVATARS_LIST_REQUEST","GET_AVATARS_LIST_RESPONSE","avatarsGetCustomized","GET_AVATARS_CUSTOMIZED_REQUEST","GET_AVATARS_CUSTOMIZED_RESPONSE","avatarsGetPrompts","GET_AVATAR_PROMPTS_REQUEST","GET_AVATAR_PROMPTS_RESPONSE","CLIENT_SET_AVATAR_REQUEST","CLIENT_SET_AVATAR_RESPONSE","_this$tracker","_this$tracker2","_await$this$avatarsGe","avatars","_await$this$avatarsGe2","_await$this$avatarsGe3","prompts","getWSCalls","GET_RELATED_ACH_N_TOURNAMENTS_REQUEST","GET_RELATED_ACH_N_TOURNAMENTS_RESPONSE","RAF_GET_RAFFLES_REQUEST","RAF_GET_RAFFLES_RESPONSE","RAF_GET_DRAW_RUN_REQUEST","RAF_GET_DRAW_RUN_RESPONSE","RAF_GET_DRAW_HISTORY_REQUEST","RAF_GET_DRAW_HISTORY_RESPONSE","RAF_CLAIM_PRIZE_REQUEST","RAF_OPTIN_REQUEST","RAF_GET_WON_PRIZES_REQUEST","RAF_GET_WON_PRIZES_RESPONSE","GET_POINT_HISTORY_REQUEST","floor","GET_POINT_HISTORY_RESPONSE","logHistory","CookieStore","cookieStore","TSMap","AnalyticsInterfaceType","AnalyticsScreenNameId","AnalyticsTournamentsLobbySubScreenNameId","AnalyticsInboxSubScreenNameId","QuizSportType","quizSupportedSports","Basketball","Soccer","Tennis","SAWGPMarketType","QuizAnswersValueType","quizAnswerHomeTeamReplacementText","quizAnswerAwayTeamReplacementText","quizDrawReplacementText","quizYesReplacementText","quizNoReplacementText","quizOddReplacementText","quizEvenReplacementText","quizOrReplacementText","quizNoGoalsReplacementText","quizAnswersTrKeys","yesNoAnswers","Yes","No","homeAwayAnswers","HomeTeam","AwayTeam","homeAwayDrawAnswers","Draw","homeAwayNoGoalsAnswers","marketsInfo","OneXTwo","question","trKey","answers","OneXTwoHalftime","FirstGoal","LastGoal","DoubleChance","HomeTeamDraw","HomeTeamAwayTeam","AwayTeamDraw","OverUnder2_5","OverUnder1_5Halftime","OverUnder1_5__2ndHalf","RedCard","TotalCorners8_5","TotalCorners9_5","Corners1x2","One_Two","Overtime","OddEven","Odd","Even","OddEvenHomeAway","HomeOdd","HomeEven","AwayOdd","AwayEven","FirstSet","SecondSet","ThirdSet","FourthSet","FifthSet","PlayerOneWinsOneSet","PlayerTwoWinsOneSet","CustomNonSport","CustomSport","QuizMarketPerSport","GamePickMarketType","GamePickResolutionType","GPRoundStatus","GamePickScoreType","GamePickSportType","GameRoundOrderType","AllRoundsGameBoardID","JackpotContributionType","JackPotTemparature","JackpotType","AvatarCustomizeErrorCode","JoinClanErrorCode"],"mappings":";;IAAYA,QA6NX;AA7ND,CAAA,UAAYA,OAAO,EAAA;EAClBA,OAAA,CAAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;EACRA,OAAA,CAAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;EAERA,OAAA,CAAAA,OAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ,CAAA;EACRA,OAAA,CAAAA,OAAA,CAAA,eAAA,CAAA,GAAA,CAAA,CAAA,GAAA,eAAiB,CAAA;EACjBA,OAAA,CAAAA,OAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAY,CAAA;EACZA,OAAA,CAAAA,OAAA,CAAA,mBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,mBAAqB,CAAA;EACrBA,OAAA,CAAAA,OAAA,CAAA,OAAA,CAAA,GA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