"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getDisplayAwardItemConfigs=void 0;var _util=require("../util"),normalizeAwardItemConfigs=function(e){return Array.isArray(null==e?void 0:e.AwardItemConfigs)?e.AwardItemConfigs:[]},getAwardItemConfigByResult=function(e,t){var r=normalizeAwardItemConfigs(e);return t!==_util.LotteryStatus.WIN?null:r.find(function(t){return t.AwardId===(null==e?void 0:e.AwardItemId)})||null},getFallbackAwardItemConfig=function(e){return{AwardItemIcon:null==e?void 0:e.AwardIcon,AwardItemName:null==e?void 0:e.Name,AwardItemCount:null==e?void 0:e.AwardNum,AwardItemType:null==e?void 0:e.AwardItemType,WinnerInfoType:null==e?void 0:e.WinnerInfoType,AwardLotteryTicketAddr:null==e?void 0:e.AwardLotteryTicketAddr}},getDisplayAwardItemConfigs=function(e,t){var r=normalizeAwardItemConfigs(e),n=getAwardItemConfigByResult(e,t);return n?[n]:r.length?r:[getFallbackAwardItemConfig(e)]};exports.getDisplayAwardItemConfigs=getDisplayAwardItemConfigs;