{"version":3,"sources":["utils/helpers/attributeType/index.ts","utils/components/Corporate/ContentTypeAttributes/StyledAttributeIcon.ts","utils/components/Corporate/ContentTypeAttributes/AttributeIcon.tsx","utils/components/Corporate/ContentTypeAttributes/getAttributeRenderer.tsx","utils/helpers/contentType/index.ts","utils/components/Corporate/ContentTypeAttributes/index.tsx","utils/components/Corporate/HeadingWithDescription/StyledHeadingWithDescription.ts","utils/components/Corporate/HeadingWithDescription/index.tsx","utils/components/Corporate/ShowMore/StyledShowMore.ts","utils/components/Corporate/ShowMore/index.tsx","utils/helpers/jss/index.ts","components/Corporate/RelatedContentList/definitions.ts","components/Corporate/RelatedContentList/StyledItem.ts","components/Corporate/RelatedContentList/Item.tsx","components/Corporate/RelatedContentList/StyledRelatedContentList.ts","components/Corporate/RelatedContentList/index.tsx"],"names":["AttributeType","getAttributeType","value","key","getTypeFromValue","pickAttributeByType","attributes","attributeName","attrs","filter","attr","length","attrType","undefined","type","includesAttributeWithType","hasOwnProperty","includesAttributesWithTypes","types","i","NoBreakWrapper","styled","span","IconWrapper","theme","card","attributeIcon","icons","location","Marker","cost","Cost","time","Time","statusIcons","StatusType","book","Book","underReview","UnderReview","inProgress","InProgress","planned","Planned","closed","Closed","open","OpenForFeedback","completed","Completed","AttributeIcon","attribute","Icon","classNameAttribute","classNameStatus","statusIcon","className","ariaHidden","defaultOptions","showIcon","translations","Span","getAttributeRenderer","options","capacity","noun","parseInt","capacitySingular","capacityPlural","lastUpdated","date","dateConverter","visualDate","publicationLastUpdated","newsDate","whatsOnCost","getMultipleAttributeRenderer","statusName","timeSpecificity","timeUnit","timeEstimate","getTimeEstimate","costSpecificity","costEstimate","getCostEstimate","ContentType","getContentType","ContentTypeAttributes","contentType","Wrapper","useTranslation","t","attributeRenderers","project","projectRenderer","push","publication","service","timeRenderer","costRenderer","renderings","map","renderer","Boolean","rendering","index","Fragment","role","Container","div","Heading","Text","heading_xl","heading_l","heading_m","heading_s","heading_xs","spacing","pb","RichText","ContentRichText","HeadingWithDescription","headingField","descriptionField","headingLevel","tag","field","Button","button","buttonAsLinkReset","linkWithoutVisited","safeFocusRemoval","focusOutline","text_s","hideOnPrint","ArrowWrapper","svg","colors","element","white","iconColorOnPrint","primary","ShowMore","onClick","title","count","label","useState","showingMore","setShowingMore","e","aria-expanded","ScreenReader","normalizeJssFields","data","filters","normalized","keys","Object","indexOf","forEach","val","jss","ItemStyle","getItemStyle","stylesThatRenderImage","listingWithImage","listingWithImageAndDescription","stylesThatRenderDate","listingWithDate","stylesThatRenderDescription","cardWithDescription","container","css","mq","Card","NavLink","linkCard","p","Listing","borderDashed","pt","borderDashedHover","ImageColumn","ImageContainer","background","senary","mr","tertiary","Image","SCImage","DetailsColumn","Category","text_xscap","IconContainerStyles","action","IconContainer","LinkIconContainer","AttributesWrapper","secondary","mt","Title","TitleIconWrapper","Description","quaternary","Date","DateDay","DateNumber","text_l","DateMonth","all","blue","LogoWrapper","deepBlueTint15","componentForStyle","cardWithoutDescription","LazyImage","resizeImage","src","internal","startsWith","isContentful","resizeContentfulImage","width","convertSrcJss","imagePlaceholderSrc","alt","withEditMode","editMode","Item","description","primaryCategory","image","itemStyle","link","dateDay","dateNumber","dateMonth","descriptionForLabel","renderImage","renderDate","renderDescription","Component","renderPlaceholder","linkObj","getLink","linkProps","wrapperIsLink","titleIsLink","wrapperProps","StyledLink","titleWrapperProps","aria-hidden","Logo","fill","isValidLinkObject","Arrow","External","List","Grid","Row","decreasedSpacing","ListItem","between","PrimaryContainer","showOnPrint","ShowMoreContainer","FooterLinkContainer","FooterLink","FooterLinkLabel","EditContainer","compose","withEditModeNotice","EditFooterLink","EditShowMoreContainer","validateItem","item","errors","getInvalidItemMessage","join","EditorItem","itemsToShow","numVisibleItems","isValidFooterLink","isVisible","editProps","noticeEnabled","noticeLevel","noticeMessage","props","fieldsOverride","paramsOverride","fields","datasource","params","heading","items","footerLink","footerLinkLabel","editItems","slice","warnInDev","hasItems","canShowMore","setCanShowMore","evenItemsClass","showingAllClass","singleItemClass","footerLinkObj","isValidFooterLinkLabel","footerLinkNotice","url","useEffect","as","id","config","col","xs","lg","includes","NavItem"],"mappings":"4NAGYA,E,2BAAAA,K,oBAAAA,E,YAAAA,E,0BAAAA,E,oBAAAA,E,wBAAAA,E,wBAAAA,E,YAAAA,E,kCAAAA,E,oBAAAA,E,4BAAAA,E,4BAAAA,E,kCAAAA,E,0BAAAA,E,qBAAAA,M,KA0BL,IAAMC,EAAmB,SAACC,GAAiE,IAAzCC,EAAwC,uDAA1B,OACrE,OAAOC,YAAgCJ,EAAeE,EAAOC,IAOlDE,EAAsB,SACjCC,EACAC,GAEe,IADfJ,EACc,uDADA,OAEd,IAAKG,IAAeC,EAClB,OAAO,KAGT,IAAIC,EAAK,OAAGF,QAAH,IAAGA,OAAH,EAAGA,EAAYG,QAAO,SAACC,GAAD,OAAUA,EAAKP,KAASI,KAEvD,GAAIC,EAAMG,OAAQ,CAChB,IAAMD,EAAOF,EAAM,GACfI,EAA0BX,EAAiBS,EAAMP,GAErD,YAAiBU,IAAbD,EAEK,eACFF,EADL,CAEEI,KAAMF,IAID,eACFF,EADL,CAEEI,UAAMD,IAKZ,OAAO,MAGIE,EAA4B,SACvCT,EACAQ,GAEA,QAAKR,GAIEA,EAAWU,eAAeF,IAGtBG,EAA8B,SACzCX,EACAY,GAEA,IAAKZ,IAAeY,EAClB,OAAO,EAGT,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAMP,OAAQQ,IAAK,CACrC,IAAML,EAAOI,EAAMC,GACnB,IAAKJ,EAA0BT,EAAYQ,GACzC,OAAO,EAIX,OAAO,I,6gBCvFF,I,IAAMM,EAAiBC,UAAOC,KAAV,KAIdC,EAAcF,UAAOC,KAAV,KAgBZ,qBAAGE,MAAkBC,KAAKC,iB,gBCZhCC,GAAK,mBACR3B,IAAc4B,SAAWC,KADjB,cAER7B,IAAc8B,KAAOC,KAFb,cAGR/B,IAAcgC,KAAOC,KAHb,GAMLC,GAAW,mBACdC,IAAWC,KAAO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a,EACbC,YAAY,UACZC,cAAe,2EAInBa,aAAU,yEACH,OArBTA,aAAU,iEAER,kBAAC/B,GAAD,CACEgB,eAAa,EACbC,YAAY,UACZC,cAAe","file":"static/js/RelatedContentList.c3b812f0.chunk.js","sourcesContent":["import getTypeFromValue from '_utils/helpers/getTypeFromValue';\r\n\r\n// note! enum values match keys sent by server\r\nexport enum AttributeType {\r\n capacity = 'capacity',\r\n cost = 'cost',\r\n lastUpdated = 'lastUpdated',\r\n location = 'location',\r\n statusIcon = 'statusIcon',\r\n statusName = 'statusName',\r\n time = 'time',\r\n timeSpecificity = 'timeSpecificity',\r\n timeUnit = 'timeUnit',\r\n timeEstimate = 'timeEstimate',\r\n costEstimate = 'costEstimate',\r\n costSpecificity = 'costSpecificity',\r\n whatsOnCost = 'whatsOnCost',\r\n newsDate = 'newsDate'\r\n}\r\n\r\nexport type Attribute = {\r\n type: AttributeType;\r\n value: any;\r\n};\r\n\r\n/**\r\n * @param target either a string representation of a attribute type or an object containing a attribute type\r\n * @param key optional used to retrieve attributeType value (if passing an object)\r\n */\r\nexport const getAttributeType = (value: string | object, key: string = 'type'): AttributeType => {\r\n return getTypeFromValue(AttributeType, value, key);\r\n};\r\n\r\n/**\r\n * @param target either a string representation of a attribute type or an object containing a attribute type\r\n * @param key optional used to retrieve attributeType value (if passing an object)\r\n */\r\nexport const pickAttributeByType = (\r\n attributes,\r\n attributeName: string,\r\n key: string = 'type'\r\n): Attribute => {\r\n if (!attributes || !attributeName) {\r\n return null;\r\n }\r\n\r\n let attrs = attributes?.filter((attr) => attr[key] === attributeName);\r\n\r\n if (attrs.length) {\r\n const attr = attrs[0];\r\n let attrType: AttributeType = getAttributeType(attr, key);\r\n\r\n if (attrType !== undefined) {\r\n // found a known type\r\n return {\r\n ...attr,\r\n type: attrType\r\n };\r\n } else {\r\n // treat as generic\r\n return {\r\n ...attr,\r\n type: undefined\r\n };\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport const includesAttributeWithType = (\r\n attributes: { [key: string]: Attribute },\r\n type: AttributeType\r\n) => {\r\n if (!attributes) {\r\n return false;\r\n }\r\n\r\n return attributes.hasOwnProperty(type);\r\n};\r\n\r\nexport const includesAttributesWithTypes = (\r\n attributes: { [key: string]: Attribute },\r\n types: AttributeType[]\r\n) => {\r\n if (!attributes || !types) {\r\n return false;\r\n }\r\n\r\n for (let i = 0; i < types.length; i++) {\r\n const type = types[i];\r\n if (!includesAttributeWithType(attributes, type)) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\n// Old loose definitions Please migrate to strict ones above\r\n// DELETED use pickAttributeByType\r\n// export const getAttributeByType = (attributes, attributeType) => {\r\n\r\n// };\r\n\r\n// DELETED use AttributeIcon in utils/components/ContentTypeAttributes\r\n// export const AttributeIcon = ({ attribute }) => {\r\n\r\n// };\r\n","import styled from 'styled-components';\r\n// import { svg } from '_utils/styles/';\r\n\r\n/* \r\ninexplicably\r\nadding ${svg(24, 24)} into style defn, causes server error when deployed \r\nObject(...) is not a function TypeError: Object(...) is not a function \r\n*/\r\n\r\nexport const NoBreakWrapper = styled.span`\r\n white-space: nowrap;\r\n`;\r\n\r\nexport const IconWrapper = styled.span`\r\n position: relative;\r\n display: inline-block;\r\n margin-right: 8px;\r\n transform: translateY(-10%);\r\n height: 20px;\r\n white-space: nowrap;\r\n\r\n svg,\r\n img {\r\n vertical-align: middle;\r\n width: 20px;\r\n height: auto;\r\n }\r\n\r\n path {\r\n fill: ${({ theme }) => theme.card.attributeIcon};\r\n }\r\n`;\r\n","import React from 'react';\r\nimport { IconWrapper, NoBreakWrapper } from './StyledAttributeIcon';\r\nimport { AttributeType } from '_utils/helpers/attributeType';\r\nimport { StatusType } from '_utils/helpers/statusType';\r\nimport {\r\n Book,\r\n Closed,\r\n Completed,\r\n Cost,\r\n InProgress,\r\n Marker,\r\n OpenForFeedback,\r\n Planned,\r\n Time,\r\n UnderReview\r\n} from '_utils/icons';\r\n\r\nconst icons = {\r\n [AttributeType.location]: Marker,\r\n [AttributeType.cost]: Cost,\r\n [AttributeType.time]: Time\r\n};\r\n\r\nconst statusIcons = {\r\n [StatusType.book]: Book,\r\n [StatusType.underReview]: UnderReview,\r\n [StatusType.inProgress]: InProgress,\r\n [StatusType.planned]: Planned,\r\n [StatusType.closed]: Closed,\r\n [StatusType.open]: OpenForFeedback,\r\n [StatusType.completed]: Completed\r\n};\r\n\r\nconst AttributeIcon = ({ attribute }) => {\r\n if (!attribute) {\r\n return null;\r\n }\r\n\r\n let Icon = null;\r\n let classNameAttribute = attribute.type;\r\n let classNameStatus = '';\r\n\r\n if (attribute.type === AttributeType.statusIcon) {\r\n Icon = statusIcons[attribute.value];\r\n classNameStatus = attribute.value;\r\n } else {\r\n Icon = icons[attribute.type];\r\n }\r\n\r\n if (!Icon) {\r\n // console.log('no icon found for ', attribute.type);\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default AttributeIcon;\r\n","import React, { ReactNode } from 'react';\r\nimport styled from 'styled-components';\r\nimport {\r\n AttributeType,\r\n Attribute,\r\n includesAttributesWithTypes\r\n} from '_utils/helpers/attributeType';\r\nimport AttributeIcon from './AttributeIcon';\r\nimport { dateConverter, getTimeEstimate, getCostEstimate } from '_utils/helpers';\r\nimport { AttributeRendererOptions } from './definitions';\r\n\r\nconst defaultOptions = {\r\n showIcon: true,\r\n translations: null\r\n};\r\n\r\nconst Span = styled.span``;\r\n\r\nexport function getAttributeRenderer(\r\n attribute: Attribute,\r\n options?: AttributeRendererOptions\r\n): () => ReactNode {\r\n options = { ...defaultOptions, ...options };\r\n\r\n const value = attribute?.value;\r\n\r\n if (value === '' || value === undefined || value === null) {\r\n return () => null;\r\n }\r\n\r\n switch (attribute?.type) {\r\n case AttributeType.location: {\r\n return () => (\r\n \r\n {options.showIcon && }\r\n {value}\r\n \r\n );\r\n }\r\n\r\n case AttributeType.capacity: {\r\n const noun =\r\n parseInt(value, 10) === 1\r\n ? options.translations.capacitySingular\r\n : options.translations.capacityPlural;\r\n return () => `${value} ${noun}`;\r\n }\r\n\r\n case AttributeType.lastUpdated: {\r\n return () => {\r\n let date = dateConverter(value)?.visualDate;\r\n return date\r\n ? `${\r\n options?.translations?.publicationLastUpdated\r\n ? options?.translations?.publicationLastUpdated + ' '\r\n : ''\r\n }${date}`\r\n : null;\r\n };\r\n }\r\n\r\n case AttributeType.newsDate: {\r\n return () => value;\r\n }\r\n\r\n case AttributeType.whatsOnCost: {\r\n return () => (\r\n \r\n {options.showIcon && }\r\n {value}\r\n \r\n );\r\n }\r\n }\r\n\r\n return () => null;\r\n}\r\n\r\nexport function getMultipleAttributeRenderer(\r\n attributes: { [key: string]: Attribute },\r\n options?: AttributeRendererOptions\r\n): () => ReactNode {\r\n options = { ...defaultOptions, ...options };\r\n\r\n if (!attributes) {\r\n return () => null;\r\n }\r\n\r\n if (\r\n includesAttributesWithTypes(attributes, [AttributeType.statusName, AttributeType.statusIcon])\r\n ) {\r\n const statusName = attributes[AttributeType.statusName];\r\n const statusIcon = attributes[AttributeType.statusIcon];\r\n\r\n if (statusName && statusName.value) {\r\n return () => (\r\n \r\n {!!(statusIcon && options.showIcon) && }\r\n {statusName.value}\r\n \r\n );\r\n }\r\n }\r\n\r\n if (\r\n includesAttributesWithTypes(attributes, [\r\n AttributeType.timeSpecificity,\r\n AttributeType.timeUnit,\r\n AttributeType.timeEstimate\r\n ])\r\n ) {\r\n const timeSpecificity = attributes[AttributeType.timeSpecificity]?.value || '';\r\n const timeUnit = attributes[AttributeType.timeUnit]?.value || '';\r\n const timeEstimate = attributes[AttributeType.timeEstimate]?.value || '';\r\n\r\n const time = getTimeEstimate(timeSpecificity, timeUnit, timeEstimate);\r\n\r\n if (time) {\r\n return () => (\r\n \r\n \r\n {time}\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n if (\r\n includesAttributesWithTypes(attributes, [\r\n AttributeType.costSpecificity,\r\n AttributeType.costEstimate\r\n ])\r\n ) {\r\n const costEstimate = attributes[AttributeType.costEstimate]?.value || '';\r\n const costSpecificity = attributes[AttributeType.costSpecificity]?.value || '';\r\n\r\n const cost = getCostEstimate(costSpecificity, costEstimate);\r\n\r\n if (cost) {\r\n return () => (\r\n \r\n {options.showIcon && }\r\n {cost}\r\n \r\n );\r\n }\r\n }\r\n\r\n return () => null;\r\n}\r\n","import getTypeFromValue from '_utils/helpers/getTypeFromValue';\r\n\r\n// note! enum values match keys sent by server\r\nexport enum ContentType {\r\n collection = 'collection',\r\n committee = 'committee',\r\n focus = 'focus',\r\n place = 'place',\r\n profile = 'profile',\r\n program = 'program',\r\n project = 'project',\r\n publication = 'publication',\r\n service = 'service',\r\n space = 'space'\r\n}\r\n\r\n/**\r\n * @param target either a string representation of a content type or an object containing a content type\r\n * @param key optional used to retrieve contentType value (if passing an object)\r\n */\r\nexport const getContentType = (value: string | object, key: string = 'type'): ContentType => {\r\n return getTypeFromValue(ContentType, value, key);\r\n};\r\n","import React from 'react';\r\n\r\nimport { ContentType } from '_utils/helpers/contentType';\r\nimport { pickAttributeByType, AttributeType, Attribute } from '_utils/helpers/attributeType';\r\nimport { getAttributeRenderer, getMultipleAttributeRenderer } from './getAttributeRenderer';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nexport * from './getAttributeRenderer';\r\nexport * from './definitions';\r\n\r\nexport type WrapperProps = {};\r\n\r\ntype ContentTypeAttributesProps = {\r\n attributes: any[];\r\n contentType: ContentType;\r\n Wrapper: React.ComponentType;\r\n};\r\n\r\nconst ContentTypeAttributes: React.FC = ({\r\n attributes,\r\n contentType,\r\n Wrapper\r\n}) => {\r\n const [t] = useTranslation();\r\n\r\n let publicationLastUpdated = t('publication-related-content-last-updated-prefix');\r\n\r\n if (publicationLastUpdated === 'publication-related-content-last-updated-prefix') {\r\n publicationLastUpdated = '';\r\n }\r\n\r\n const translations = {\r\n publicationLastUpdated,\r\n capacitySingular: t('space-capacity-unit-singular'),\r\n capacityPlural: t('space-capacity-unit-plural')\r\n };\r\n\r\n let attributeRenderers: any[] = [];\r\n\r\n if (contentType === ContentType.project) {\r\n const statusName = pickAttributeByType(attributes, AttributeType.statusName);\r\n const statusIcon = pickAttributeByType(attributes, AttributeType.statusIcon);\r\n\r\n const projectRenderer = getMultipleAttributeRenderer({\r\n [AttributeType.statusName]: statusName,\r\n [AttributeType.statusIcon]: statusIcon\r\n });\r\n\r\n attributeRenderers.push(projectRenderer);\r\n }\r\n\r\n attributeRenderers.push(\r\n getAttributeRenderer(pickAttributeByType(attributes, AttributeType.location))\r\n );\r\n\r\n attributeRenderers.push(\r\n getAttributeRenderer(pickAttributeByType(attributes, AttributeType.capacity), {\r\n translations\r\n })\r\n );\r\n\r\n attributeRenderers.push(\r\n getAttributeRenderer(pickAttributeByType(attributes, AttributeType.whatsOnCost))\r\n );\r\n\r\n // lastUpdated can appear for other (unwanted) contentTypes - only display for publication\r\n if (contentType === ContentType.publication) {\r\n attributeRenderers.push(\r\n getAttributeRenderer(pickAttributeByType(attributes, AttributeType.lastUpdated), {\r\n translations\r\n })\r\n );\r\n }\r\n\r\n attributeRenderers.push(\r\n getAttributeRenderer(pickAttributeByType(attributes, AttributeType.newsDate))\r\n );\r\n\r\n if (contentType === ContentType.service) {\r\n const timeSpecificity: Attribute = pickAttributeByType(\r\n attributes,\r\n AttributeType.timeSpecificity\r\n );\r\n const timeUnit: Attribute = pickAttributeByType(attributes, AttributeType.timeUnit);\r\n const timeEstimate: Attribute = pickAttributeByType(attributes, AttributeType.timeEstimate);\r\n const costEstimate: Attribute = pickAttributeByType(attributes, AttributeType.costEstimate);\r\n const costSpecificity: Attribute = pickAttributeByType(\r\n attributes,\r\n AttributeType.costSpecificity\r\n );\r\n\r\n const timeRenderer = getMultipleAttributeRenderer({\r\n [AttributeType.timeSpecificity]: timeSpecificity,\r\n [AttributeType.timeUnit]: timeUnit,\r\n [AttributeType.timeEstimate]: timeEstimate\r\n });\r\n\r\n const costRenderer = getMultipleAttributeRenderer(\r\n {\r\n [AttributeType.costEstimate]: costEstimate,\r\n [AttributeType.costSpecificity]: costSpecificity\r\n },\r\n { showIcon: timeRenderer !== null }\r\n );\r\n\r\n attributeRenderers.push(timeRenderer, costRenderer);\r\n }\r\n\r\n const renderings = attributeRenderers\r\n .map((renderer) => (typeof renderer === 'function' ? renderer() : null))\r\n .filter(Boolean);\r\n\r\n if (renderings.length === 0) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {renderings.map((rendering, index) => (\r\n \r\n {index > 0 && ยท }\r\n {rendering}\r\n \r\n ))}\r\n \r\n );\r\n};\r\n\r\nexport default ContentTypeAttributes;\r\n","import styled from 'styled-components';\r\nimport { spacing } from '_utils/props';\r\nimport { Text } from '@sitecore-jss/sitecore-jss-react';\r\nimport { heading_xl, heading_l, heading_m, heading_s, heading_xs } from '_utils/styles/';\r\nimport ContentRichText from '_components/Corporate/ContentRichText';\r\n\r\nexport const Container = styled.div``;\r\n\r\nexport const Heading = styled(Text)`\r\n h2& {\r\n ${heading_xl}\r\n }\r\n\r\n h3& {\r\n ${heading_l}\r\n }\r\n\r\n h4& {\r\n ${heading_m}\r\n }\r\n\r\n h5& {\r\n ${heading_s}\r\n }\r\n\r\n h6& {\r\n ${heading_xs}\r\n }\r\n\r\n h2&,\r\n h3&,\r\n h4& {\r\n ${({ theme }) => spacing({ theme, pb: 3 })}\r\n }\r\n\r\n h5&,\r\n h6& {\r\n ${({ theme }) => spacing({ theme, pb: 2 })}\r\n }\r\n`;\r\n\r\nexport const RichText = styled(ContentRichText)`\r\n ${({ theme }) =>\r\n spacing({\r\n theme,\r\n pb: 3\r\n })}\r\n\r\n > :last-child {\r\n margin-bottom: 0;\r\n }\r\n`;\r\n","import React from 'react';\r\nimport { Container, Heading, RichText } from './StyledHeadingWithDescription';\r\n\r\nexport type HeadingWithDescriptionProps = {\r\n headingField: any;\r\n descriptionField: any;\r\n headingLevel: any;\r\n};\r\n\r\nconst HeadingWithDescription: React.FC = ({\r\n headingField,\r\n descriptionField,\r\n headingLevel\r\n}) => {\r\n headingLevel = headingLevel?.value || 'h2';\r\n\r\n return (\r\n \r\n {headingField && (\r\n \r\n )}\r\n {descriptionField && }\r\n \r\n );\r\n};\r\n\r\nexport default HeadingWithDescription;\r\n","import styled from 'styled-components';\r\nimport {\r\n buttonAsLinkReset,\r\n focusOutline,\r\n linkWithoutVisited,\r\n safeFocusRemoval,\r\n svg,\r\n text_s,\r\n hideOnPrint,\r\n iconColorOnPrint\r\n} from '../../../styles';\r\n\r\nexport const Button = styled.button`\r\n ${buttonAsLinkReset}\r\n ${linkWithoutVisited}\r\n &:focus {\r\n ${safeFocusRemoval}\r\n ${focusOutline}\r\n }\r\n ${text_s}\r\n padding-right: 4px;\r\n margin: 0;\r\n ${hideOnPrint}\r\n`;\r\n\r\nexport const ArrowWrapper = styled.span`\r\n ${svg(7, 12)}\r\n margin-left: 8px;\r\n width: 7px;\r\n transform: rotate(90deg);\r\n\r\n ${Button}:focus &,\r\n ${Button}:hover & {\r\n path {\r\n fill: ${({ theme }) => theme.colors.element.white};\r\n ${iconColorOnPrint}\r\n }\r\n }\r\n\r\n path {\r\n fill: ${({ theme }) => theme.colors.element.primary};\r\n }\r\n`;\r\n","import React, { useState } from 'react';\r\nimport { Button, ArrowWrapper } from './StyledShowMore';\r\nimport { SimpleArrow } from '_utils/icons';\r\nimport ScreenReader from '_utils/components/Corporate/ScreenReader';\r\n\r\nfunction ShowMore({ onClick, title, count, label = 'Show more' }) {\r\n const [showingMore, setShowingMore] = useState(false);\r\n\r\n return (\r\n {\r\n setShowingMore(true);\r\n onClick(e);\r\n }}\r\n aria-expanded={showingMore}\r\n >\r\n {/* eslint-disable-next-line jsx-a11y/aria-role */}\r\n \r\n {label} {title + ' '}({count})\r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport default ShowMore;\r\n","export const normalizeJssFields = (data: object, filters = []): any => {\r\n if (!data) {\r\n return data;\r\n }\r\n\r\n let normalized = {};\r\n\r\n const keys = Object.keys(data).filter((key) => !filters.length || filters.indexOf(key) > -1);\r\n\r\n keys.forEach((key) => {\r\n const val = data[key];\r\n if (val && typeof val === 'object' && val.hasOwnProperty('jss')) {\r\n normalized[key] = val.jss;\r\n } else {\r\n normalized[key] = val;\r\n }\r\n });\r\n\r\n return normalized;\r\n};\r\n","import getTypeFromValue from '_utils/helpers/getTypeFromValue';\r\n\r\nexport enum ItemStyle {\r\n listingWithImageAndDescription = 'listing-with-image-and-description',\r\n listingWithImage = 'listing-with-image',\r\n listingWithDate = 'listing-with-date',\r\n cardWithDescription = 'card-with-description',\r\n cardWithoutDescription = 'card-without-description'\r\n}\r\n\r\nexport const getItemStyle = (value: string | object, key: string = 'type'): ItemStyle => {\r\n return getTypeFromValue(ItemStyle, value, key);\r\n};\r\n\r\nexport const stylesThatRenderImage = {\r\n [ItemStyle.listingWithImage]: true,\r\n [ItemStyle.listingWithImageAndDescription]: true\r\n};\r\n\r\nexport const stylesThatRenderDate = {\r\n [ItemStyle.listingWithDate]: true\r\n};\r\n\r\nexport const stylesThatRenderDescription = {\r\n [ItemStyle.listingWithImageAndDescription]: true,\r\n [ItemStyle.cardWithDescription]: true,\r\n [ItemStyle.listingWithDate]: true\r\n};\r\n\r\nexport type ItemProps = {\r\n id: string;\r\n type: string;\r\n title: string;\r\n description?: string | object;\r\n primaryCategory?: string;\r\n image: {\r\n value: {\r\n src: string;\r\n alt: string;\r\n width: string;\r\n height: string;\r\n };\r\n };\r\n link: string;\r\n dateNumber?: string;\r\n dateDay?: string;\r\n dateMonth?: string;\r\n attributes: {\r\n value: string;\r\n type: string;\r\n }[];\r\n};\r\n\r\nexport type ListItemProps = ItemProps & {\r\n itemStyle: ItemStyle;\r\n editMode: boolean;\r\n};\r\n","import styled, { css } from 'styled-components';\r\nimport { NavLink } from 'react-router-dom';\r\nimport { Image as SCImage } from '@sitecore-jss/sitecore-jss-react';\r\nimport { text_xscap, heading_m, text_s, text_l, mq, svg, linkCard } from '_utils/styles';\r\nimport { spacing } from '_utils/props';\r\nimport ContentRichText from '../ContentRichText';\r\n\r\nconst container = css`\r\n width: 100%;\r\n display: flex;\r\n\r\n flex: 1 0 auto;\r\n flex-direction: row;\r\n color: inherit;\r\n text-decoration: none;\r\n position: relative;\r\n\r\n ${mq('lg')} {\r\n height: 100%;\r\n }\r\n`;\r\n\r\nexport const Card = styled(NavLink)`\r\n ${({ theme }) => linkCard({ theme })}\r\n ${({ theme }) => spacing({ theme, p: 3 })}\r\n ${container}\r\n display: block;\r\n @media print {\r\n page-break-inside: avoid;\r\n }\r\n`;\r\n\r\nexport const Listing = styled.div`\r\n ${container}\r\n border-bottom: ${({ theme }) => theme.card.borderDashed};\r\n\r\n /* juggle padding settings to keep border at bottom and \r\n work within grid gutters at various breakpoints */\r\n ${({ theme }) => spacing({ theme, pb: 1 })}\r\n \r\n ${mq('md')} {\r\n ${({ theme }) => spacing({ theme, pt: 1 })}\r\n ${({ theme }) => spacing({ theme, pb: 2 })}\r\n }\r\n\r\n ${mq('lg')} {\r\n ${({ theme }) => spacing({ theme, pt: 0 })}\r\n ${({ theme }) => spacing({ theme, pb: 3 })}\r\n }\r\n\r\n /* @media (hover: hover) {\r\n &:hover {\r\n border-bottom: ${({ theme }) => theme.card.borderDashedHover};\r\n }\r\n } */\r\n @media print {\r\n page-break-inside: avoid;\r\n\r\n }\r\n`;\r\n\r\nexport const ImageColumn = styled.div`\r\n flex: none;\r\n display: flex;\r\n align-items: flex-start;\r\n justify-content: center;\r\n`;\r\n\r\nexport const ImageContainer = styled.div`\r\n width: 56px;\r\n height: 56px;\r\n border-radius: 9999px;\r\n background-color: ${({ theme }) => theme.colors.background.senary};\r\n position: relative;\r\n overflow: hidden;\r\n ${({ theme }) => spacing({ theme, mr: 4 })}\r\n\r\n ${mq('md')} {\r\n width: 128px;\r\n height: 128px;\r\n }\r\n\r\n ${Listing}.publication &,\r\n ${Card}.publication & {\r\n border-radius: 0;\r\n background-color: transparent;\r\n }\r\n\r\n ${Listing}.focus &,\r\n ${Card}.focus & {\r\n background-color: ${({ theme }) => theme.colors.background.tertiary};\r\n }\r\n`;\r\n\r\nexport const Image = styled(SCImage)`\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n left: 0;\r\n top: 0;\r\n object-fit: cover;\r\n font-family: 'object-fit: cover;';\r\n\r\n ${Listing}.publication &,\r\n ${Card}.publication & {\r\n object-fit: contain;\r\n font-family: 'object-fit: contain;';\r\n }\r\n\r\n ${Listing}.focus &,\r\n ${Card}.focus & {\r\n width: 75%;\r\n height: 75%;\r\n left: 50%;\r\n top: 50%;\r\n transform: translate(-50%, -50%);\r\n object-fit: contain;\r\n font-family: 'object-fit: contain;';\r\n }\r\n`;\r\n\r\nexport const DetailsColumn = styled.div`\r\n flex: 1 1 auto;\r\n display: block;\r\n`;\r\n\r\nexport const Category = styled.p`\r\n ${text_xscap}\r\n margin: 0;\r\n`;\r\n\r\nconst IconContainerStyles = css`\r\n display: block;\r\n color: inherit;\r\n text-decoration: none;\r\n\r\n &.title-is-link:hover {\r\n color: ${({ theme }) => theme.card.action};\r\n }\r\n`;\r\n\r\nexport const IconContainer = styled.span`\r\n ${IconContainerStyles}\r\n`;\r\n\r\nexport const LinkIconContainer = styled(NavLink)`\r\n ${IconContainerStyles}\r\n`;\r\n\r\nexport const AttributesWrapper = styled.span`\r\n ${text_s}\r\n margin: 0;\r\n display: block;\r\n color: ${({ theme }) => theme.card.secondary};\r\n\r\n &:not(:first-child) {\r\n ${({ theme }) => spacing({ theme, mt: 1 })}\r\n }\r\n`;\r\n\r\nexport const ArrowWrapper = styled.span`\r\n ${svg(14, 14)}\r\n width: 14px;\r\n margin-left: 12px;\r\n display: inline-block;\r\n\r\n path {\r\n fill: ${({ theme }) => theme.card.action};\r\n }\r\n`;\r\n\r\nexport const Title = styled.span`\r\n ${heading_m}\r\n\r\n &:not(:first-child) {\r\n ${({ theme }) => spacing({ theme, mt: 1 })}\r\n }\r\n`;\r\n\r\nexport const TitleIconWrapper = styled.span`\r\n white-space: nowrap;\r\n line-height: 0;\r\n`;\r\n\r\nexport const Description = styled(ContentRichText)`\r\n ${text_s}\r\n margin: 0;\r\n &:not(:first-child) {\r\n ${({ theme }) => spacing({ theme, mt: 1 })}\r\n }\r\n color: ${({ theme }) => theme.colors.element.quaternary};\r\n\r\n > :last-child {\r\n margin-bottom: 0;\r\n }\r\n`;\r\n\r\nexport const DateWrapper = styled.div`\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n left: 0;\r\n top: 0;\r\n`;\r\n\r\nexport const Date = styled.span`\r\n display: flex;\r\n height: 100%;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n\r\n /* text needs a bit of help to fit */\r\n transform: scale(0.9);\r\n\r\n ${mq('md')} {\r\n transform: scale(1);\r\n }\r\n`;\r\n\r\nexport const DateDay = styled.span`\r\n ${text_s}\r\n line-height: 1;\r\n margin: 0;\r\n text-transform: uppercase;\r\n`;\r\nexport const DateNumber = styled.span`\r\n ${text_l}\r\n line-height: 1;\r\n margin: 0;\r\n`;\r\nexport const DateMonth = styled.span`\r\n ${text_s}\r\n line-height: 1;\r\n color: ${({ theme }) => theme.colors.all.blue};\r\n margin: 0;\r\n text-transform: uppercase;\r\n`;\r\n\r\nexport const LogoWrapper = styled.span`\r\n ${svg(39, 40)}\r\n\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n left: 50%;\r\n top: 50%;\r\n transform: translate(-50%, -50%);\r\n\r\n path {\r\n fill: ${({ theme }) => theme.colors.all.deepBlueTint15};\r\n }\r\n`;\r\n","import React from 'react';\r\nimport { withEditMode } from '_containers/BaseComponent';\r\nimport { convertSrcJss } from '_utils/media';\r\nimport { imagePlaceholderSrc } from '_utils/styles';\r\nimport NavLink from '../NavItem';\r\nimport { isValidLinkObject, getLink } from '_utils/helpers/link';\r\nimport { isContentful, resizeContentfulImage } from '_utils/helpers/image';\r\nimport ContentTypeAttributes from '_utils/components/Corporate/ContentTypeAttributes';\r\nimport {\r\n ListItemProps,\r\n stylesThatRenderImage,\r\n stylesThatRenderDate,\r\n stylesThatRenderDescription,\r\n ItemStyle\r\n} from './definitions';\r\nimport { getContentType } from '_utils/helpers/contentType';\r\nimport Arrow from '_utils/icons/Arrow';\r\nimport External from '_utils/icons/External';\r\nimport Logo from '_utils/icons/Logo';\r\n\r\nimport {\r\n Card,\r\n Category,\r\n Title,\r\n TitleIconWrapper,\r\n Listing,\r\n ImageColumn,\r\n ImageContainer,\r\n Image as StyledImage,\r\n DetailsColumn,\r\n AttributesWrapper,\r\n IconContainer,\r\n LinkIconContainer,\r\n Description,\r\n ArrowWrapper,\r\n Date,\r\n DateDay,\r\n DateMonth,\r\n DateNumber,\r\n LogoWrapper\r\n} from './StyledItem';\r\n\r\nexport const componentForStyle = {\r\n [ItemStyle.listingWithDate]: Listing,\r\n [ItemStyle.listingWithImage]: Listing,\r\n [ItemStyle.listingWithImageAndDescription]: Listing,\r\n [ItemStyle.cardWithDescription]: Card,\r\n [ItemStyle.cardWithoutDescription]: Card\r\n};\r\n\r\nconst LazyImage = ({ field }) => {\r\n if (field === null || Boolean(field?.value?.src) === false) {\r\n return null;\r\n }\r\n\r\n let resizeImage;\r\n\r\n const internal = field?.value?.src?.startsWith('/');\r\n\r\n if (isContentful(field.value.src)) {\r\n resizeImage = resizeContentfulImage(field?.value?.src, { width: 200 });\r\n } else if (internal) {\r\n resizeImage = convertSrcJss(field.value.src) + '?mw=200';\r\n } else {\r\n resizeImage = field.value.src;\r\n }\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst ImageRenderer = ({ field, editMode }) => {\r\n if (editMode) {\r\n return ;\r\n }\r\n\r\n return ;\r\n};\r\n\r\nconst Image = withEditMode(ImageRenderer);\r\n\r\nconst Item: React.FC = ({\r\n type,\r\n title,\r\n description,\r\n primaryCategory,\r\n image,\r\n itemStyle,\r\n link,\r\n attributes,\r\n dateDay,\r\n dateNumber,\r\n dateMonth,\r\n editMode\r\n}) => {\r\n const descriptionForLabel: string = (description as string) || '';\r\n const renderImage = stylesThatRenderImage[itemStyle] || false;\r\n const renderDate = stylesThatRenderDate[itemStyle] || false;\r\n const renderDescription = stylesThatRenderDescription[itemStyle] || false;\r\n const contentType = getContentType(type);\r\n const Component = componentForStyle[itemStyle] || Card;\r\n const renderPlaceholder = renderImage && !image?.value?.src;\r\n\r\n // convert plain strings into a field-like object\r\n if (typeof description === 'string') {\r\n description = {\r\n value: description\r\n };\r\n }\r\n\r\n let linkObj: any = getLink(link);\r\n\r\n const linkProps = {\r\n link: linkObj\r\n };\r\n\r\n const wrapperIsLink = Component === Card;\r\n const titleIsLink = Component !== Card;\r\n\r\n const Wrapper = wrapperIsLink ? NavLink : Component;\r\n const wrapperProps = wrapperIsLink\r\n ? {\r\n ...linkProps,\r\n StyledLink: Component\r\n }\r\n : {};\r\n\r\n let titleWrapperProps = {\r\n link: null,\r\n className: 'title-is-link',\r\n StyledLink: titleIsLink ? LinkIconContainer : IconContainer\r\n };\r\n\r\n if (titleIsLink) {\r\n titleWrapperProps = {\r\n ...titleWrapperProps,\r\n ...linkProps\r\n };\r\n }\r\n\r\n return (\r\n \r\n {renderDate && (\r\n \r\n \r\n \r\n {dateDay && {dateDay}}\r\n {dateNumber && {dateNumber}}\r\n {dateMonth && {dateMonth}}\r\n \r\n \r\n \r\n )}\r\n {renderImage && (\r\n \r\n \r\n \r\n {renderPlaceholder && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n )}\r\n \r\n {primaryCategory && {primaryCategory}}\r\n {title && (\r\n \r\n {title}\r\n {isValidLinkObject(linkObj) && (\r\n \r\n \r\n \r\n {linkObj.type !== 'external' && }\r\n {linkObj.type === 'external' && }\r\n \r\n \r\n )}\r\n \r\n )}\r\n {renderDescription && }\r\n\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Item;\r\n","import styled, { css } from 'styled-components';\r\nimport { NavLink } from 'react-router-dom';\r\nimport { Text } from '@sitecore-jss/sitecore-jss-react';\r\nimport Grid from '_utils/components/Corporate/Grid';\r\nimport { Primary as PrimaryContainer } from '_components/Corporate/TwoColumn/StyledTwoColumn';\r\nimport { mq, svg, text_s, link, showOnPrint } from '_utils/styles';\r\nimport { spacing } from '_utils/props';\r\n\r\nexport const Container = styled.div``;\r\n\r\nexport const List = styled(Grid.Row)`\r\n list-style: none;\r\n padding: 0;\r\n /* beat specificity of grid breakpoints */\r\n && {\r\n margin-top: 0;\r\n }\r\n`;\r\n\r\nconst decreasedSpacing = css`\r\n ${({ theme }) => spacing({ theme, mt: -1 })}\r\n`;\r\n\r\nexport const ListItem = styled(Grid.Item)`\r\n /* background-color: #00000011; */\r\n\r\n ${mq.between('md', 'lg')} {\r\n /* skip first item */\r\n &:not(:first-child) {\r\n ${decreasedSpacing}\r\n }\r\n }\r\n\r\n /* hide bottom border on last item if showing all */\r\n .is-showing-all & {\r\n &:last-child {\r\n div {\r\n border-bottom: none;\r\n }\r\n }\r\n }\r\n\r\n ${mq('lg')} {\r\n /* skip first two items */\r\n &:not(:nth-child(-n + 2)) {\r\n ${decreasedSpacing}\r\n }\r\n\r\n /* hide bottom border on 2nd last item (if showing all and in bottom row) */\r\n .is-even-items &:nth-last-child(2) {\r\n div {\r\n border-bottom: none;\r\n }\r\n }\r\n }\r\n\r\n /* force single item or items in lhs of a \r\n two column layout to be full width */\r\n &.is-single-item,\r\n ${PrimaryContainer} & {\r\n max-width: 100%;\r\n flex: 0 0 100%;\r\n ${mq('md')} {\r\n /* skip first item */\r\n &:not(:first-child) {\r\n ${decreasedSpacing}\r\n }\r\n }\r\n }\r\n\r\n ${mq('lg')} {\r\n margin-top: 0;\r\n align-self: stretch;\r\n }\r\n\r\n &.is-hidden {\r\n display: none;\r\n ${showOnPrint}\r\n }\r\n`;\r\n\r\nexport const ShowMoreContainer = styled.div`\r\n ${({ theme }) => spacing({ theme, mt: 3 })}\r\n`;\r\n\r\nexport const FooterLinkContainer = styled.div`\r\n ${({ theme }) => spacing({ theme, mt: 3 })}\r\n`;\r\n\r\nexport const FooterLink = styled(NavLink)`\r\n ${link};\r\n`;\r\n\r\nexport const FooterLinkLabel = styled(Text)`\r\n ${text_s}\r\n`;\r\n\r\nexport const ArrowWrapper = styled.span`\r\n ${svg(14, 14)}\r\n width: 14px;\r\n margin-left: 6px;\r\n margin-right: 2px;\r\n\r\n path {\r\n fill: ${({ theme }) => theme.card.action};\r\n }\r\n`;\r\n","import React, { useState, useEffect } from 'react';\r\nimport styled from 'styled-components';\r\nimport { compose } from 'ramda';\r\nimport { normalizeJssFields } from '_utils/helpers/jss';\r\nimport { Link } from '@sitecore-jss/sitecore-jss-react';\r\n\r\nimport { withEditMode, withEditModeNotice } from '_containers/BaseComponent';\r\nimport HeadingWithDescription from '_utils/components/Corporate/HeadingWithDescription';\r\nimport ShowMore from '_utils/components/Corporate/ShowMore';\r\nimport { getItemStyle } from './definitions';\r\nimport Item from './Item';\r\nimport NavItem from '../NavItem';\r\nimport Arrow from '_utils/icons/Arrow';\r\nimport External from '_utils/icons/External';\r\nimport {\r\n Container,\r\n List,\r\n ListItem,\r\n ShowMoreContainer,\r\n FooterLink,\r\n FooterLinkLabel,\r\n ArrowWrapper,\r\n FooterLinkContainer\r\n} from './StyledRelatedContentList';\r\nimport { getLink, isValidLinkObject } from '_utils/helpers/link';\r\nimport { warnInDev } from '_utils/helpers/dev';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nconst EditContainer = compose(withEditModeNotice)(styled.div``);\r\nconst EditFooterLink = compose(withEditModeNotice)(FooterLink);\r\nconst EditShowMoreContainer = compose(withEditModeNotice)(ShowMoreContainer);\r\n\r\nfunction validateItem(item) {\r\n let errors = [];\r\n\r\n if (!item) {\r\n errors.push('invalid item');\r\n } else {\r\n if (!Boolean(item?.title)) {\r\n errors.push('title is missing');\r\n }\r\n if (!isValidLinkObject(getLink(item?.link))) {\r\n errors.push('link is missing');\r\n }\r\n }\r\n\r\n return errors.length ? errors : undefined;\r\n}\r\n\r\nfunction getInvalidItemMessage(item) {\r\n const errors = validateItem(item);\r\n if (!errors) {\r\n return '';\r\n }\r\n return `Item will not be displayed: ${errors.join(\r\n '; '\r\n )}. Edit the component's related item to change items.`;\r\n}\r\n\r\nfunction EditorItem({\r\n item,\r\n itemStyle,\r\n itemsToShow,\r\n numVisibleItems,\r\n editMode,\r\n isValidFooterLink\r\n}) {\r\n const isVisible = itemsToShow.indexOf(item) > -1;\r\n const validationErrors = validateItem(item);\r\n\r\n let editProps = {};\r\n\r\n if (validationErrors !== undefined) {\r\n editProps = {\r\n noticeEnabled: validateItem(item) !== undefined,\r\n noticeLevel: 'warning',\r\n noticeMessage: getInvalidItemMessage(item)\r\n };\r\n } else if (!isVisible && isValidFooterLink) {\r\n editProps = {\r\n noticeEnabled: !isVisible,\r\n noticeLevel: 'warning',\r\n noticeMessage: `Item will be not be shown (showing first ${numVisibleItems} and footer link is set).`\r\n };\r\n } else {\r\n editProps = {\r\n noticeEnabled: !isVisible,\r\n noticeLevel: 'info',\r\n noticeMessage: `Item will be initially hidden (showing first ${numVisibleItems}).`\r\n };\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nfunction RelatedContentList(props) {\r\n const { rendering, editMode, fieldsOverride, paramsOverride } = props;\r\n\r\n const [t] = useTranslation();\r\n\r\n const fields = fieldsOverride || rendering?.fields?.data?.datasource || rendering?.fields;\r\n const params = paramsOverride || rendering?.params;\r\n\r\n const normalized = normalizeJssFields(fields);\r\n\r\n let {\r\n heading,\r\n description,\r\n headingLevel,\r\n items,\r\n numVisibleItems,\r\n footerLink,\r\n footerLinkLabel\r\n } = normalized;\r\n\r\n if (!items) items = [];\r\n\r\n if (typeof numVisibleItems === 'object' && numVisibleItems.hasOwnProperty('value')) {\r\n numVisibleItems = numVisibleItems.value;\r\n }\r\n\r\n if (typeof numVisibleItems === 'string') {\r\n numVisibleItems = parseInt(numVisibleItems, 10);\r\n }\r\n\r\n if (!numVisibleItems) {\r\n numVisibleItems = 4;\r\n }\r\n\r\n const editItems = items?.slice();\r\n\r\n items = items.filter((item) => validateItem(item) === undefined);\r\n\r\n if (!editMode && items.length !== editItems.length) {\r\n warnInDev(`RelatedContentList ignored ${editItems.length - items.length} invalid items`);\r\n }\r\n\r\n const hasItems = items && items.length;\r\n const itemStyle = getItemStyle(params, 'theme');\r\n\r\n const [canShowMore, setCanShowMore] = useState(items.length > numVisibleItems);\r\n const [showingMore, setShowingMore] = useState(false);\r\n\r\n const itemsToShow = showingMore ? items : items.slice(0, numVisibleItems);\r\n const evenItemsClass = items && items.length % 2 === 0 ? 'is-even-items' : '';\r\n const showingAllClass = !canShowMore || showingMore ? 'is-showing-all' : '';\r\n const singleItemClass = itemsToShow.length === 1 ? 'is-single-item ' : '';\r\n\r\n const footerLinkObj = getLink(footerLink?.value);\r\n\r\n const isValidFooterLink = isValidLinkObject(footerLinkObj);\r\n\r\n const isValidFooterLinkLabel = Boolean(footerLinkLabel?.value);\r\n\r\n let footerLinkNotice = {\r\n noticeEnabled: false,\r\n noticeLevel: 'info',\r\n noticeMessage: ''\r\n };\r\n\r\n if (isValidFooterLink) {\r\n if (!isValidFooterLinkLabel) {\r\n footerLinkNotice.noticeEnabled = true;\r\n footerLinkNotice.noticeLevel = 'warning';\r\n footerLinkNotice.noticeMessage = `Label not set. Link will be displayed as ${footerLinkObj.url}`;\r\n } else {\r\n footerLinkNotice.noticeEnabled = true;\r\n footerLinkNotice.noticeMessage = `${footerLinkObj.url}`;\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n setCanShowMore(items.length > numVisibleItems && !showingMore);\r\n }, [items, showingMore, numVisibleItems]);\r\n\r\n if (!fields) {\r\n warnInDev('Related content list component requires data source to render');\r\n return (\r\n \r\n );\r\n }\r\n\r\n if (!hasItems) {\r\n if (editMode) {\r\n return (\r\n \r\n );\r\n } else {\r\n warnInDev('Related content list component has no items and will not be displayed');\r\n return null;\r\n }\r\n }\r\n\r\n return (\r\n \r\n {Boolean(heading || description) && (\r\n \r\n )}\r\n \r\n {editMode &&\r\n editItems.map((item, index) => (\r\n \r\n \r\n \r\n ))}\r\n {!editMode &&\r\n items.map((item, index) => (\r\n \r\n \r\n \r\n ))}\r\n \r\n {Boolean(!isValidFooterLink && canShowMore) && (\r\n \r\n );\r\n}\r\n\r\nexport default compose(withEditMode)(RelatedContentList);\r\n"],"sourceRoot":""}