{"version":3,"file":"js/scripts_react_mls-match-list_components_MatchModal_MatchModal_js.js?_t=40bbb114290c69e9079c","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AAAA;AAEA;AAEA;AACA;AAAA;AACA;AAEA;AAAA;AACA;AAEA;AAEA;AACA;AACA;AAAA;AAGA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AAAA;AAGA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAGA;AAAA;AACA;AAGA;AACA;AACA;AAAA;AAGA;AAAA;AACA;AACA;AAGA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AAGA;AACA;AAAA;AAGA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAAA;AAEA;AAEA;AACA;AACA;AAAA;AAGA;AAAA;AACA;AACA;AACA;AAGA;AACA;AAEA;AACA;AAAA;AAGA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAGA;AACA;AACA;AAEA;AAAA;AACA;AACA;AACA;AAOA;AACA;AACA;AAEA;AAEA;AAEA;AACA;AAAA;AAGA;AAEA;AACA;AAAA;AAGA;AAEA;AAEA;AACA;AACA;AAAA;AAGA;AACA;;;;;;;;;;;;;;;;;;;AC7LA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AAAA;AAGA;AAEA;AAIA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAwBA;AAEA;;;;;;;;;;;;;;;;ACrDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AAEA;AAAA;AACA;AACA;AACA;AACA;AAGA;AAAA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAAA;AAGA;AACA;AAEA;AAEA;AAEA;AACA;AAEA;AACA;AAEA;AACA;AAQA;AAAA;AACA;AACA;AAGA;AAMA;AACA;AACA;AAAA;AAGA;AAAA;AACA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AAAA;AAGA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AAAA;AAGA;AAkBA;AAEA;AAOA;AA+BA;AACA;AACA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AACA;AACA;AAWA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAIA;AAEA;AAQA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAIA;AAEA;AAaA;AAAA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAOA;AAAA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAOA;AAAA;AAAA;AACA;AACA;AAAA;AACA;AACA;AAUA;AAEA;;;;;;;;;;;;;;;;ACnRA;AAEA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAMA;AAAA;AAAA;AACA;AACA;AACA;AAAA;AAIA;AAGA;AAEA;;;;;;;;;;;;;;;;AC5BA","sources":["webpack://@mlssoccer/netcore/./scripts/react/mls-match-feed/utils.js","webpack://@mlssoccer/netcore/./scripts/react/mls-match-list/components/Club/Club.js","webpack://@mlssoccer/netcore/./scripts/react/mls-match-list/components/Club/index.js","webpack://@mlssoccer/netcore/./scripts/react/mls-match-list/components/MatchModal/MatchModal.js","webpack://@mlssoccer/netcore/./scripts/react/shared/svg/TicketIcon/TicketIcon.js","webpack://@mlssoccer/netcore/./scripts/react/shared/svg/TicketIcon/index.js"],"sourcesContent":["import { periodTypes } from \"../mls-match-list/utils\";\nimport { matchEventSubtypes, matchEventTypes } from \"../mls-match-summary/utils\";\nimport { highlightTypes } from \"../shared/utils\";\n\nexport const feedTypes = {\n goal: 'goal',\n};\n\nexport function getFeedType(type) {\n switch (type) {\n case feedTypes.goal:\n default: {\n return null;\n }\n }\n}\n\nexport function mergeFeedWithVideosAndPlayers({ feed, homeClub, mlsMatch, awayClub, videoList, players }) {\n if (!feed || feed.length === 0) {\n return null;\n }\n\n const { match_information } = mlsMatch;\n const { home_team_goals = 0, away_team_goals = 0, home_team_penalty_goals = 0, away_team_penalty_goals = 0 } = match_information;\n\n let homeScore = home_team_goals + home_team_penalty_goals;\n let awayScore = away_team_goals + away_team_penalty_goals;\n\n const composedFeed = [];\n\n for (let i = 0; i < feed.length; i++) {\n const current = feed[i] || {};\n const { player_id, team_id, second_player_id } = current;\n const isHome = team_id === homeClub?.team_id;\n const isAway = team_id === awayClub?.team_id;\n\n const isLastTimingCommentary = current?.type === matchEventTypes.startOfPeriod && current?.period === periodTypes.FirstHalf;\n\n const matchedVideo = videoList != null && videoList.length > 0 ? videoList.find(video => {\n const { fields } = video || {};\n const { sportecEventId } = fields || {};\n\n return sportecEventId === current?.event_id;\n }) : null;\n\n const matchedPlayer = Array.isArray(players) ? players?.find(player => player?.person_id === player_id) || null : null;\n const secondMatchedPlayer = second_player_id ? Array.isArray(players) ? players?.find(player => player?.person_id === second_player_id) || null : null : null;\n\n const { thumbnail, headshotNationalTeam, headshotClub } = matchedPlayer || {};\n\n let adjustedHomeScore = homeScore;\n let adjustedAwayScore = awayScore;\n\n if (team_id) {\n if (current.type === matchEventTypes.goal) {\n if (isHome) {\n adjustedHomeScore = adjustedHomeScore - 1;\n }\n else if (isAway) {\n adjustedAwayScore = adjustedAwayScore - 1;\n }\n }\n\n if (current.sub_type === matchEventSubtypes.ownGoal) {\n if (team_id == homeClub?.sportecId) {\n adjustedAwayScore = adjustedAwayScore - 1;\n }\n else if (team_id == awayClub?.sportecId) {\n adjustedHomeScore = adjustedHomeScore - 1;\n }\n }\n }\n\n composedFeed.push({\n ...current,\n first_player: composePlayer(matchedPlayer),\n second_player: composePlayer(secondMatchedPlayer),\n headshotNationalTeam: headshotNationalTeam != null ? headshotNationalTeam : null,\n headshotClub: headshotClub != null ? headshotClub : null,\n image: thumbnail != null ? thumbnail : null,\n video: matchedVideo != null ? matchedVideo : null,\n homeScore,\n awayScore,\n isLastTimingCommentary,\n scoreChange: adjustedHomeScore !== homeScore\n ? \"home\"\n : adjustedAwayScore !== awayScore\n ? \"away\"\n : null\n });\n\n homeScore = adjustedHomeScore;\n awayScore = adjustedAwayScore;\n }\n\n return composedFeed;\n}\n\nfunction composePlayer(player = {}) {\n return {\n ...player,\n known_name: player?.short_name,\n full_name: `${player?.first_name} ${player?.last_name}`,\n position: player?.playing_position,\n jersey: player?.shirt_number,\n slug: player?.person_id,\n }\n}\n\nexport function mergePlayers({ away, home }) {\n return [...away?.players, ...home?.players];\n}\n\nexport function mergePages(pages = []) {\n return pages && pages.length > 0 ? pages.reduce((accum, current = []) => {\n return [...accum, ...current];\n }, []) : [];\n}\n\nexport function composeVideoList(forgeVideos, validators) {\n if (forgeVideos == null) {\n return [];\n }\n\n const {\n fullGameTags,\n condensedGameTags,\n gameHighlightsTags\n } = validators || {};\n\n return forgeVideos.map(v => {\n const { tags } = v || {};\n\n if (tags == null) {\n return v;\n }\n\n const tagList = [];\n for (let i = 0; i < tags.length; i++) {\n const currentTag = tags[i];\n const neutralSlug = currentTag?.neutralSlug;\n\n if (neutralSlug != null) {\n tagList.push(neutralSlug);\n }\n }\n\n const isFullGame = tagValidator(tagList, fullGameTags);\n const isCondensedGame = tagValidator(tagList, condensedGameTags);\n const isGameHighlights = tagValidator(tagList, gameHighlightsTags);\n\n return {\n ...v,\n fields: {\n ...v.fields,\n highlightType: isFullGame\n ? highlightTypes.fullGame\n : isCondensedGame\n ? highlightTypes.condensedGame\n : isGameHighlights\n ? highlightTypes.gameHighlights\n : null\n }\n };\n });\n}\n\nexport function removeDuplicates(items = [], key = \"\") {\n\n if (!Array.isArray(items) || !key) {\n return []\n }\n\n const itemIds = {};\n\n items.forEach(item => {\n itemIds[item[key]] = item;\n })\n\n return Object.values(itemIds);\n\n}\n\nfunction tagValidator(arr, target) {\n if (arr == null || target == null) {\n return false;\n }\n\n return target.every(v => arr.some(x => x.includes(v)));\n}\n","import React from 'react';\nimport Picture from \"../../../shared/components/Picture\";\nimport { formatImageUrl } from \"../../../shared/utils\";\nimport { useReactAppState } from \"../../../shared/containers/utils\";\n\nconst Club = ({ clubData, isHome, isWinner, showShortName = false, showAbbreviation = false }) => {\n const { mediaQueries } = useReactAppState();\n\n const { isMediumLargeMin } = mediaQueries || {};\n\n const { abbreviation, fullName, shortName, logoColorUrl } = clubData || {};\n const availableShortName = shortName ? shortName : fullName;\n const isHomeModifierClass = `mls-o-match-strip__club--${isHome ? 'home' : 'away'}`;\n const isWinnerModifierClass = `${isWinner ? 'mls-o-match-strip__club--winner' : ''}`;\n if (!abbreviation && !availableShortName) {\n return null;\n }\n\n const { highQuality } = logoColorUrl ? formatImageUrl(logoColorUrl, { format: \"w_128,h_128,c_pad\", extension: \"f_png\" }) : { highQuality: \"/assets/images/Fallbacklogo-grey.png\" };\n\n return (\n