} props.recommendedItems.items - Items to display side by side with button clickout
* @param {string} props.recommendedItems.recommendedType - String to determine recommendation type (hotels, bars, etc)
* @param {string} props.recommendedItems.recommendedClickout - String to determine clickout for viewAllButton
* @param {number} [props.recommendedItemCount] - Optional integer to determine how many recommended items to display
* @param {bool} [props.shouldHideBylines] - Optional boolean to hide bylines
* @param {bool} [props.shouldHideDangerousDek] - Optional boolean to hide dangerousDek
* @param {string} [props.shouldEnableBundleComponentAnalytics] - Optional feature flag to append data-section-title attribute for analytics
* @param {bool} [props.shouldAppendReadMoreLinkForDek] - Optional boolean to append a 'Read More' link in dangerousDek
* @param {string} [props.summaryItemRubricVariation] - Optional rubric variation to use for the SummaryItem
* @param {string} [props.trackingNamespace] - Optional override the base namespace of data-section-title for component tracking
* @param {string} [props.variations] - Variation properties used in rendering the component
*
* @returns {ReactElement}
*/
const SummaryCollectionSplitColumns = ({ className, dangerousHed, guideItem, hasBackgroundColor = true, hasBorderItem = true, hasExtraRubricSpace = false, hasLessBottomSpace = false, hasTighterBylineSpacing = false, itemHedTag, location, recommendedItems, recommendedItemCount = 2, shouldHideDangerousDek = false, shouldAppendReadMoreLinkForDek = true, shouldHideBylines = true, shouldEnableBundleComponentAnalytics, summaryItemRubricVariation, trackingNamespace }) => {
React.useEffect(() => {
window.Kendra.TRACK_COMPONENT.broadcast(TrackComponentChannel.RENDER, {
name: 'SummaryCollectionSplitColumns'
});
}, []);
const { formatMessage } = useIntl();
const { items, recommendedType, recommendedClickout } = recommendedItems;
const hedTag = itemHedTag || (dangerousHed ? 'h3' : 'h2');
// only show trending ad slot once request is fulfilled by googletag
const [shouldShowTrendingAd] = useOnAdFilled('trending-ad');
return (React.createElement(SummaryCollectionSplitColumnsWrapper, { className: className, "data-testid": "SummaryCollectionSplitColumnsWrapper", hasBackgroundColor: hasBackgroundColor },
React.createElement(SummaryCollectionSplitColumnsItems, { "data-testid": "SummaryCollectionSplitColumnsItems", showTrendingAd: shouldShowTrendingAd },
React.createElement(SummaryCollectionSplitColumnsRecsWrapper, null,
React.createElement("p", null, formatMessage(translations.recommendedTitle, {
recommendedType
})),
items.slice(0, recommendedItemCount).map((item, index) => {
const analyticsDataAttribute = componentTracking.addDataSectionTitleAttribute(shouldEnableBundleComponentAnalytics, trackingNamespace?.item, index);
return (React.createElement(React.Fragment, { key: index },
React.createElement(SummaryCollectionSplitColumnsItem, { ...item, analyticsDataAttribute: analyticsDataAttribute, variation: "TextBelowImageLeftHasRuleWithDek", hasBorder: hasBorderItem, hedTag: hedTag, key: index, rubricVariation: summaryItemRubricVariation, "data-testid": "SummaryCollectionSplitColumnsItem", shouldHideDangerousDek: shouldHideDangerousDek, shouldAppendReadMoreLinkForDek: shouldAppendReadMoreLinkForDek, shouldHideBylines: shouldHideBylines, hasLessBottomSpace: hasLessBottomSpace, hasExtraRubricSpace: hasExtraRubricSpace })));
}),
recommendedClickout && (React.createElement(Button.Utility, { label: formatMessage(translations.viewAllButton, {
location,
recommendedType
}), inputKind: "link", href: recommendedClickout }))),
React.createElement(SummaryCollectionSplitColumnsItem, { ...guideItem[0], image: guideItem[0].lede, dangerousHed: location
? formatMessage(translations.guideItemHed, { location })
: dangerousHed, variation: "TextBelowImageLeftHedAndDek", hasBorder: hasBorderItem, hedTag: hedTag, rubricVariation: summaryItemRubricVariation, "data-testid": "SummaryCollectionSplitColumnsItem", shouldHideBylines: shouldHideBylines, hasTighterBylineSpacing: hasTighterBylineSpacing, hasLessBottomSpace: hasLessBottomSpace, hasExtraRubricSpace: hasExtraRubricSpace }))));
};
SummaryCollectionSplitColumns.propTypes = {
className: PropTypes.string,
dangerousHed: PropTypes.string,
guideItem: PropTypes.arrayOf(PropTypes.shape(SummaryItem.propTypes))
.isRequired,
hasBackgroundColor: PropTypes.bool,
hasBorderItem: PropTypes.bool,
hasExtraRubricSpace: PropTypes.bool,
hasLessBottomSpace: PropTypes.bool,
hasTighterBylineSpacing: PropTypes.bool,
itemHedTag: PropTypes.string,
location: PropTypes.string,
recommendedItemCount: PropTypes.number,
recommendedItems: PropTypes.shape({
items: PropTypes.arrayOf(PropTypes.shape(SummaryItem.propTypes)),
recommendedType: PropTypes.string,
recommendedClickout: PropTypes.string
}).isRequired,
shouldAppendReadMoreLinkForDek: PropTypes.bool,
shouldEnableBundleComponentAnalytics: PropTypes.bool,
shouldHideBylines: PropTypes.bool,
shouldHideDangerousDek: PropTypes.bool,
summaryItemRubricVariation: PropTypes.string,
trackingNamespace: PropTypes.object
};
SummaryCollectionSplitColumns.displayName = 'SummaryCollectionSplitColumns';
module.exports = asConfiguredComponent(SummaryCollectionSplitColumns, 'SummaryCollectionSplitColumns');
//# sourceMappingURL=SummaryCollectionSplitColumns.js.map
/***/ }),
/***/ 94136:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = __webpack_require__(27612);
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 35516:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
const React = __webpack_require__(96540);
const { default: styled } = __webpack_require__(92168);
const { BylineWrapper, BylinePreamble, BylineName, BylineLink } = __webpack_require__(74423);
const SummaryItem = __webpack_require__(74992);
const { GridItem } = __webpack_require__(40653);
const Grid = __webpack_require__(86659);
const { calculateSpacing, getColorToken, getColorStyles, getTypographyStyles, minScreen, styledProperty } = __webpack_require__(26865);
const { BREAKPOINTS } = __webpack_require__(96472);
const SummaryCollectionSplitColumnsWrapper = styled.div.withConfig({
displayName: 'SummaryCollectionSplitColumnsWrapper'
}) `
margin: ${calculateSpacing(4)} 0;
background-color: ${({ hasBackgroundColor }) => hasBackgroundColor
? getColorToken('colors.discovery.body.light.background')
: 'transparent'};
`;
const disabledBorderSpaceStyling = `
&:last-child {
padding-bottom: 0;
${minScreen(BREAKPOINTS.md)}{
padding-bottom: ${calculateSpacing(2)};
}
}
`;
const SummaryCollectionSplitColumnsItem = styled(({ columnAmount, variation, shouldHideDangerousDek, hasExtraRubricSpace, hasLessBottomSpace, hasTighterBylineSpacing, ...rest }) => {
const SummaryItemComponent = SummaryItem[variation];
return React.createElement(SummaryItemComponent, { ...rest });
}).withConfig({ displayName: 'SummaryCollectionSplitColumnsItem' }) `
${SummaryCollectionSplitColumnsWrapper} & {
padding-bottom: ${calculateSpacing(2)};
${minScreen(BREAKPOINTS.md)} {
border-bottom: 0;
}
.summary-item__rubric {
${getTypographyStyles('typography.definitions.globalEditorial.context-primary')}
display: block;
color: ${getColorToken('colors.discovery.body.light.context-signature')};
${minScreen(BREAKPOINTS.md)} {
margin-bottom: ${({ hasExtraRubricSpace }) => hasExtraRubricSpace ? calculateSpacing(1) : calculateSpacing(0.5)};
}
}
.summary-item__hed-link {
color: ${getColorToken('colors.discovery.body.light.heading')};
&::after {
display: none;
}
}
.summary-item__hed {
${getTypographyStyles('typography.definitions.discovery.hed-bulletin-primary')}
margin-bottom: 0;
}
.summary-item__dek {
${getTypographyStyles('typography.definitions.discovery.description-page')}
display: ${({ shouldHideDangerousDek }) => shouldHideDangerousDek ? `none` : `block`};
margin: ${calculateSpacing(2)} 0 ${calculateSpacing(1)};
color: ${getColorToken('colors.discovery.body.white.description')};
}
.summary-item__content {
padding-bottom: ${({ hasLessBottomSpace }) => hasLessBottomSpace ? calculateSpacing(0) : ''};
}
.summary-item__byline {
margin-top: ${({ hasTighterBylineSpacing }) => hasTighterBylineSpacing ? calculateSpacing(1) : calculateSpacing(2)};
${BylineWrapper},
${BylinePreamble},
${BylineName},
${BylineLink} {
${getTypographyStyles('typography.definitions.globalEditorial.accreditation-core')}
color: ${getColorToken('colors.discovery.body.light.accreditation')};
}
${BylineLink}:link {
color: ${getColorToken('colors.discovery.body.light.accreditation')};
}
}
.summary-item__metadata-secondary {
margin: ${calculateSpacing(2)} 0 0 0;
}
${styledProperty('hasBorder', false, disabledBorderSpaceStyling)};
}
`;
const SummaryCollectionSplitColumnsItems = styled(Grid.ThreeUp).withConfig({
displayName: 'SummaryCollectionSplitColumnsItems'
}) `
${GridItem} {
grid-column: 1 / -1;
margin-top: ${calculateSpacing(2)};
}
${GridItem}:first-of-type {
margin: ${calculateSpacing(3)} 0;
${minScreen(BREAKPOINTS.md)} {
grid-column: span 7;
}
}
${GridItem}:last-of-type {
${minScreen(BREAKPOINTS.md)} {
grid-column: span 5;
margin: ${calculateSpacing(3)} 0;
}
}
`;
const SummaryCollectionSplitColumnsRecsWrapper = styled('div').withConfig({
displayName: 'SummaryCollectionSplitColumnsRecsWrapper'
}) `
display: grid;
grid-column-gap: ${calculateSpacing(3)};
grid-template-columns: repeat(6, 1fr);
grid-row-gap: ${calculateSpacing(2)};
height: 100%;
${minScreen(BREAKPOINTS.md)} {
display: grid;
grid-template-rows: 5% 75% 20%;
grid-row-gap: ${calculateSpacing(1)};
border-right: 1px solid;
border-color: ${({ theme }) => getColorStyles(theme, 'border-color', 'colors.consumption.body.standard.divider')};
padding-right: ${calculateSpacing(3)};
}
p {
grid-column: span 6;
grid-row: 1 / 1;
align-self: center;
margin: 0;
${({ theme }) => getTypographyStyles(theme, 'typography.definitions.foundation.link-primary')}
}
.summary-item {
display: grid;
grid-column-gap: 1rem;
grid-column: span 6;
grid-template-columns: 40% 60%;
align-items: center;
${minScreen(BREAKPOINTS.sm)} {
grid-template-columns: 1fr 1fr;
}
${minScreen(BREAKPOINTS.md)} {
display: unset;
grid-column: span 3;
grid-row: 2 / 2;
}
}
.button {
grid-column: span 6;
max-height: ${calculateSpacing(6)};
${minScreen(BREAKPOINTS.md)} {
grid-column: 2 / span 4;
grid-row: 3;
}
${minScreen(BREAKPOINTS.lg)} {
justify-self: center;
padding: 0 ${calculateSpacing(6)};
}
}
`;
module.exports = {
SummaryCollectionSplitColumnsWrapper,
SummaryCollectionSplitColumnsItems,
SummaryCollectionSplitColumnsRecsWrapper,
SummaryCollectionSplitColumnsItem
};
//# sourceMappingURL=styles.js.map
/***/ }),
/***/ 50518:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
var __webpack_unused_export__;
__webpack_unused_export__ = ({ value: true });
const react_intl_1 = __webpack_require__(46984);
exports.A = (0, react_intl_1.defineMessages)({
viewAllButton: {
id: 'SummaryCollectionSplitColumns.ViewAllButton',
defaultMessage: `View All {location} {recommendedType}`,
description: 'button label for view all button'
},
guideItemHed: {
id: 'SummaryCollectionSplitColumns.GuideItemHed',
defaultMessage: '{location} Travel Guide',
description: 'dangerousHed for guideItem'
},
recommendedTitle: {
id: 'SummaryCollectionSplitColumns.RecommendedTitle',
defaultMessage: `Recommended {recommendedType}`,
description: 'recommended title for recircs'
}
});
//# sourceMappingURL=translations.js.map
/***/ }),
/***/ 27612:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
const SummaryCollectionSplitColumns = __webpack_require__(97071);
module.exports = SummaryCollectionSplitColumns;
//# sourceMappingURL=variations.js.map
/***/ }),
/***/ 65315:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
const React = __webpack_require__(96540);
const PropTypes = __webpack_require__(5556);
const { TrackComponentChannel } = __webpack_require__(78788);
const BeopScript = ({ accountId }) => {
React.useEffect(() => {
window.Kendra.TRACK_COMPONENT.broadcast(TrackComponentChannel.RENDER, {
name: 'BeopScript'
});
}, []);
return (React.createElement(React.Fragment, null,
React.createElement("script", { id: "beop-script", className: "optanon-category-C0004", type: "text/plain", "data-testid": "beop-script", dangerouslySetInnerHTML: {
__html: `window.beOpAsyncInit = function () {
window.BeOpSDK.init({
account: '${accountId}'
});
window.BeOpSDK.watch();
};`
} }),
React.createElement("script", { id: "beop-sdk", async: true, src: "https://widget.beop.io/sdk.js" })));
};
BeopScript.propTypes = {
accountId: PropTypes.string.isRequired
};
module.exports = BeopScript;
//# sourceMappingURL=BeopScript.js.map
/***/ }),
/***/ 85508:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
const BeopScript = __webpack_require__(65315);
module.exports = {
BeopScript
};
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 90713:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
const PropTypes = __webpack_require__(5556);
const React = __webpack_require__(96540);
const ruleSets = __webpack_require__(9599);
const ruleEngine = __webpack_require__(45102);
const { TrackComponentChannel } = __webpack_require__(78788);
/**
* PaywallCollaborator component - HOC that wraps components which
* are not paywall components per se, but are components that must
* collaborate with the paywall to determine their final behavior.
*
* @param {object} props - React props
* @param {ReactElement} props.component - the child component
* @param {string} props.name - child component name
* @param {object} props.payment - payment object
* @param {object} props.paywall - paywall object
*
* @returns {ReactElement} child components
*/
const PaywallCollaborator = (props) => {
React.useEffect(() => {
window.Kendra.TRACK_COMPONENT.broadcast(TrackComponentChannel.RENDER, {
name: 'PaywallCollaborator'
});
}, []);
const { component: Component, name, paywall, ...others } = props;
const ruleSet = ruleSets[paywall.strategy];
const isPaywallConfigured = paywall.strategy && ruleSet;
const isComponentRecognized = ruleSet && ruleSet.names.includes(name);
if (!isPaywallConfigured || !isComponentRecognized) {
return React.createElement(Component, { ...others });
}
return React.createElement(Component, { ...ruleEngine.execute(ruleSet, props) });
};
PaywallCollaborator.propTypes = {
component: PropTypes.func.isRequired,
name: PropTypes.string.isRequired,
payment: PropTypes.object.isRequired,
paywall: PropTypes.object.isRequired
};
module.exports = PaywallCollaborator;
//# sourceMappingURL=PaywallCollaborator.js.map
/***/ }),
/***/ 81427:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
const flow = __webpack_require__(49870);
const PaywallCollaborator = __webpack_require__(90713);
const withArticleTruncation = __webpack_require__(32206);
const withGalleryTruncation = __webpack_require__(72274);
// Store helpers
const { connectDomain } = __webpack_require__(57744);
const { withIncognitoDetection } = __webpack_require__(15356);
const withUser = connectDomain('user');
const withPaywall = connectDomain('paywall');
const withPayment = connectDomain('payment');
const enhance = flow([
withUser,
withPayment,
withPaywall,
withIncognitoDetection
]);
module.exports = {
PaywallCollaborator: enhance(PaywallCollaborator),
withArticleTruncation,
withGalleryTruncation
};
//# sourceMappingURL=index.js.map
/***/ }),
/***/ 32206:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
const PropTypes = __webpack_require__(5556);
const React = __webpack_require__(96540);
/**
* withArticleTruncation
*
* This higher-order component wraps another and truncates its content
*
* @param {ReactComponent} Component - Required wrapped component
* @param {string} name - Required name of the property being passed to the wrapped component
*
* @returns {ReactElement} child components
*/
const withArticleTruncation = (Component, name) => {
const componentName = Component.displayName || Component.name;
const isAParagraph = (node) => typeof node === 'object' && node[0] === 'p';
const preceedingParagraphs = (jsonml, index) => jsonml.slice(0, index).filter(isAParagraph).length;
const truncate = (jsonml, paragraphLimit) => jsonml.filter((_, index) => preceedingParagraphs(jsonml, index) < paragraphLimit);
/**
* ArticleTruncation
*
* A component that truncates the content of a passed property
*
* @param {object} props - Required React Props
* @param {Array} props.[name] - Required parameter that contains the content
* @param {object} props.paywall - Required paywall configuration
* @param {object} props.paywall.gateway - external gateway state for paywall
* @param {object} props.paywall.gateway.paragraphLimit - number of paragraphs that should remain when an article is truncated
* @param {bool} props.paywall.gateway.shouldTruncate - flag indicating if the content should be truncated
* @param {object} props.paywall.paragraphLimit - Required number of paragraphs that should remain when an article is truncated
* @param {bool} props.shouldTruncate - Required flag indicating if the content should be truncated
*
* @returns {ReactElement} child components
*/
const ArticleTruncation = (props) => {
const { [name]: content, shouldTruncate, paywall: { gateway = {}, paragraphLimit } = {} } = props;
const execute = content &&
(gateway.shouldTruncate || shouldTruncate) &&
(gateway.paragraphLimit >= 0 || paragraphLimit >= 0);
return (React.createElement(Component, { ...props, ...{
[name]: execute
? truncate(content, gateway.paragraphLimit || paragraphLimit)
: content
} }));
};
ArticleTruncation.propTypes = {
[name]: PropTypes.array.isRequired,
paywall: PropTypes.shape({
gateway: PropTypes.shape({
paragraphLimit: PropTypes.number,
shouldTruncate: PropTypes.bool
}),
paragraphLimit: PropTypes.number
}),
shouldTruncate: PropTypes.bool
};
ArticleTruncation.displayName = `withArticleTruncation(${componentName})`;
return ArticleTruncation;
};
module.exports = withArticleTruncation;
//# sourceMappingURL=withArticleTruncation.js.map
/***/ }),
/***/ 72274:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
const PropTypes = __webpack_require__(5556);
const React = __webpack_require__(96540);
/**
* withGalleryTruncation
*
* This higher-order component wraps another and truncates its content
*
* @param {ReactComponent} Component - Required wrapped component
* @param {string} name - Required name of the property being passed to the wrapped component
*
* @returns {ReactElement} child components
*/
const withGalleryTruncation = (Component, name) => {
const componentName = Component.displayName || Component.name;
const preceedingSlides = (chunks, slide) => chunks.flat().indexOf(slide);
const truncate = (chunks, gallerySlideLimit) => chunks
.map((chunk) => chunk.filter((slide) => preceedingSlides(chunks, slide) < gallerySlideLimit))
.filter((chunk, index) => chunk.length > 0 || index === 0);
/**
* GalleryTruncation
*
* A component that truncates the content of a passed property
*
* @param {object} props - Required React Props
* @param {Array} props.[name] - Required parameter that contains the content
* @param {object} props.paywall - Required paywall configuration
* @param {object} props.paywall.gateway - external gateway state for paywall
* @param {object} props.paywall.gateway.gallerySlideLimit - number of slides that should remain when an Gallery is truncated
* @param {bool} props.paywall.gateway.shouldTruncate - flag indicating if the content should be truncated
* @param {object} props.paywall.gallerySlideLimit - Required number of slides that should remain when an Gallery is truncated
* @param {bool} props.shouldTruncate - Required flag indicating if the content should be truncated
*
* @returns {ReactElement} child components
*/
const GalleryTruncation = (props) => {
const { [name]: content, shouldTruncate, paywall: { gateway = {}, gallerySlideLimit } = {} } = props;
const execute = content &&
(gateway.shouldTruncate || shouldTruncate) &&
(gateway.gallerySlideLimit >= 0 || gallerySlideLimit >= 0);
return (React.createElement(Component, { ...props, ...{
[name]: execute
? truncate(content, gateway.gallerySlideLimit || gallerySlideLimit)
: content
} }));
};
GalleryTruncation.propTypes = {
[name]: PropTypes.array.isRequired,
paywall: PropTypes.shape({
gateway: PropTypes.shape({
gallerySlideLimit: PropTypes.number,
shouldTruncate: PropTypes.bool
}),
gallerySlideLimit: PropTypes.number
}).isRequired,
shouldTruncate: PropTypes.bool
};
GalleryTruncation.displayName = `withGalleryTruncation(${componentName})`;
return GalleryTruncation;
};
module.exports = withGalleryTruncation;
//# sourceMappingURL=withGalleryTruncation.js.map
/***/ }),
/***/ 70697:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ExperimentPlaceholder = exports.renderHeaderOrPlaceholder = void 0;
const react_1 = __importDefault(__webpack_require__(96540));
const styled_components_1 = __importDefault(__webpack_require__(92168));
const loaders_1 = __webpack_require__(62930);
const constants_1 = __webpack_require__(96472);
const utils_1 = __webpack_require__(26865);
/**
* Renders either the header or an experiment placeholder based on conditions
* @param {object} props - Component props
* @param {boolean} props.showExperimentPlaceholder - Controls whether to show experiment placeholder when GrowthBook is not initialized
* @param {Function} props.renderHeader - Function to render the header component
* @param {boolean} props.isGBInitialized - Whether GrowthBook is initialized
*/
function renderHeaderOrPlaceholder({ showExperimentPlaceholder, renderHeader, isGBInitialized }) {
if (!showExperimentPlaceholder) {
return renderHeader();
}
if (!isGBInitialized) {
return (react_1.default.createElement(exports.ExperimentPlaceholder, null,
react_1.default.createElement(loaders_1.Circle, null)));
}
return renderHeader();
}
exports.renderHeaderOrPlaceholder = renderHeaderOrPlaceholder;
const PlaceholderWrapper = styled_components_1.default.div.withConfig({
displayName: 'PlaceholderWrapper'
}) `
display: flex;
align-items: center;
justify-content: center;
background-color: #f5f5f5;
min-height: ${(props) => props.minHeight}px;
${(0, utils_1.minScreen)(constants_1.BREAKPOINTS.lg)} {
min-height: 90vh;
}
`;
const ExperimentPlaceholder = ({ minHeight = '700', children = null }) => {
return (react_1.default.createElement(PlaceholderWrapper, { minHeight: minHeight }, children));
};
exports.ExperimentPlaceholder = ExperimentPlaceholder;
//# sourceMappingURL=RenderHeaderOrPlaceholder.js.map
/***/ }),
/***/ 76449:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.renderHeader = void 0;
const react_1 = __importDefault(__webpack_require__(96540));
const one_cover_1 = __webpack_require__(69630);
const content_header_1 = __importDefault(__webpack_require__(69389));
const CONTENT_TYPES = {
GALLERY: 'gallery',
ARTICLE: 'article'
};
function renderHeader(headerComponent, props) {
if (headerComponent === 'OneCover') {
try {
const { header, headerProps, oneCover } = props;
// type gallery has it's content data in header, article in headerProps
const oneCoverContent = header || headerProps;
return (react_1.default.createElement(one_cover_1.OneCover, { oneCoverContent: oneCoverContent, oneCoverConfig: oneCover }));
}
catch (error) {
console.error('[OneCover] Caught error:', error);
return renderHeader('ContentHeader', props);
}
}
const { type } = props;
switch (type) {
case CONTENT_TYPES.GALLERY: {
const { header, itemsCount, socialMedia, hasNativeShareButton, shouldEnableNativeShareOnDesktop } = props;
return renderHeaderGallery(header, itemsCount, socialMedia, hasNativeShareButton, shouldEnableNativeShareOnDesktop);
}
case CONTENT_TYPES.ARTICLE:
return renderHeaderArticle(props);
default:
console.warn('Unknown header type::', type);
return react_1.default.createElement("div", null, "Unknown header type");
}
}
exports.renderHeader = renderHeader;
function renderHeaderGallery(header, itemsCount, socialMedia, hasNativeShareButton, shouldEnableNativeShareOnDesktop) {
return (react_1.default.createElement(content_header_1.default, { ...header, className: header.className, itemsCount: itemsCount, socialMedia: socialMedia, stickySocialAnchorBottom: [
{ selector: '.recirc-list__container', edge: 'bottom' },
{
selector: '.content-bottom-anchor',
edge: 'bottom'
}
], stickySocialAnchorTop: {
selector: '.sticky-box__gallery-anchor-top'
}, hasNativeShareButton: hasNativeShareButton, shouldEnableNativeShareOnDesktop: shouldEnableNativeShareOnDesktop }));
}
function renderHeaderArticle(props) {
const { headerProps, additionalHeaderProps, enableEnhancedArticleHeader, hasNativeShareButton, shouldEnableNativeShareOnDesktop, isFullBleedVideo, hasLightbox, interactiveOverride, metadataVideo, showBreadcrumbTrail } = props;
return (react_1.default.createElement(content_header_1.default, { ...headerProps, ...additionalHeaderProps, showFullHeaderViewInMobile: enableEnhancedArticleHeader, hasNativeShareButton: hasNativeShareButton, shouldEnableNativeShareOnDesktop: shouldEnableNativeShareOnDesktop, isFullBleedVideo: isFullBleedVideo, className: "article__content-header", hasLightbox: hasLightbox, stickySocialAnchorBottom: {
selector: '.content-bottom-anchor',
edge: 'bottom'
}, stickySocialAnchorTop: {
selector: '.body',
edge: 'top'
}, interactiveOverride: interactiveOverride, metadataVideo: metadataVideo, showBreadCrumb: showBreadcrumbTrail }));
}
//# sourceMappingURL=RenderHeader.js.map
/***/ }),
/***/ 62265:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
"use strict";
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getContentFooterWrapper = void 0;
const get = __webpack_require__(58156);
const Grid = __webpack_require__(86659);
/*
* Be aware:
* getContentFooterWrapper needs a general refactoring so that the function can be used in all content types and thus replaces all special solutions.
* The ticket for this: https://cnissues.atlassian.net/browse/LS4-924
* */
const wrapperGallery = (showAdRail, gridColumns, ContentWrapper) => {
if (showAdRail) {
return Grid.ContentWithAdRailNarrow;
}
const { start, end } = gridColumns || {};
if (start && end) {
return Grid.DynamicGrid(gridColumns);
}
return ContentWrapper;
};
const wrapperArticle = (variation, ContentWrapper) => {
return variation === 'WithAdRail'
? Grid.NarrowContentWithWideAdRail
: ContentWrapper;
};
const getContentFooterWrapper = (componentConfig, props) => {
let ContentWrapper = Grid.WithMargins;
// legacy
const { type, showAdRail, gridColumns } = props || {};
// legacy / deprecated for galleries
if (type === 'gallery') {
ContentWrapper = wrapperGallery(showAdRail, gridColumns, ContentWrapper);
}
// legacy / deprecated for articles
if (type === 'article') {
ContentWrapper = wrapperArticle(get(componentConfig, 'ChunkedArticleContent.variation'), ContentWrapper);
}
// proper tenant config
const variation = get(componentConfig, 'ContentWrapper.variation');
ContentWrapper = variation ? Grid[variation] : ContentWrapper;
return ContentWrapper;
};
exports.getContentFooterWrapper = getContentFooterWrapper;
//# sourceMappingURL=get-content-footer.js.map
/***/ })
}]);