{"version":3,"file":"js/scripts_react_mls-match-list_components_MatchModal_MatchModal_js.js?_t=2c69939ee72655d07b48","mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AAAA;AAEA;AAEA;AACA;AAAA;AACA;AAEA;AAAA;AACA;AAEA;AAEA;AACA;AACA;AAAA;AAIA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AAAA;AAGA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAA;AAGA;AAAA;AACA;AAGA;AACA;AACA;AAAA;AAGA;AAAA;AACA;AACA;AAGA;AAAA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AAGA;AACA;AAAA;AAGA;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;;;;;;;;;;;;;;;;;;;ACnLA;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;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;;;;;;;;;;;;;;;;ACpRA;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 { 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, awayClub, match, videoList, d3Players }) {\n if (!feed || feed.length === 0) {\n return null;\n }\n\n\n let homeScore = match?.homeScore;\n let awayScore = match?.awayScore;\n\n const composedFeed = [];\n\n for (let i = 0; i < feed.length; i++) {\n const current = feed[i];\n const club = current?.first_club;\n const first_player = current?.first_player;\n const first_player_match = current?.first_player_match;\n const isHome = club?.opta_id == homeClub?.optaId;\n const isAway = club?.opta_id == awayClub?.optaId;\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 { optaEventId } = fields || {};\n\n return optaEventId === current?.opta_id;\n }) : null;\n\n const matchedPlayer = Array.isArray(d3Players) ? d3Players?.find(d3Player => d3Player?.optaId.toString() == first_player?.opta_id) || null : null;\n const { thumbnail, headshotNationalTeam, headshotClub } = matchedPlayer || {};\n let adjustedHomeScore = homeScore;\n let adjustedAwayScore = awayScore;\n\n if (club) {\n if (current.type === matchEventTypes.goal || current.type === matchEventTypes.penaltyGoal && current.period !== periodTypes.ShootOut) {\n if (isHome) {\n adjustedHomeScore = adjustedHomeScore - 1;\n }\n else if (isAway) {\n adjustedAwayScore = adjustedAwayScore - 1;\n }\n }\n\n if (current.type === matchEventTypes.ownGoal) {\n if (club.opta_id == homeClub?.optaId) {\n adjustedAwayScore = adjustedAwayScore - 1;\n }\n else if (club.opta_id == awayClub?.optaId) {\n adjustedHomeScore = adjustedHomeScore - 1;\n }\n }\n }\n\n composedFeed.push({\n ...current,\n first_player: first_player != null\n ? (\n {\n ...first_player,\n first_name: matchedPlayer?.firstName ? matchedPlayer.firstName : first_player?.first_name,\n known_name: matchedPlayer?.knownName ? matchedPlayer.knownName : first_player?.known_name,\n last_name: matchedPlayer?.lastName ? matchedPlayer?.lastName : first_player?.last_name,\n jersey: matchedPlayer?.jerseyNumber ? matchedPlayer.jerseyNumber : first_player_match?.jersey,\n slug: matchedPlayer?.playerSlug ? matchedPlayer?.playerSlug : \"\",\n }\n ) : null,\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\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