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sOverview.js","webpack://_N_E/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://_N_E/./node_modules/dom-helpers/esm/removeClass.js","webpack://_N_E/./node_modules/react-transition-group/esm/CSSTransition.js","webpack://_N_E/./node_modules/dom-helpers/esm/addClass.js","webpack://_N_E/./node_modules/dom-helpers/esm/hasClass.js","webpack://_N_E/"],"sourcesContent":["import React, { useCallback, useState, useRef, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport dynamic from 'next/dynamic';\nconst ProductOverview = dynamic(()=>import('../ProductOverview'))\nimport { Waypoint } from 'react-waypoint';\nimport C from 'classnames';\nimport { CSSTransition } from 'react-transition-group';\nimport { chunk, minimum} from '../../../adapters/helpers/functions';\nconst SeeMoreButton = dynamic(()=>import('../../SeeMoreButton/SeeMoreButton'))\nimport {useIsomorphicLayoutEffect} from '../../../adapters/helpers/Hooks';\n\nfunction makeRows(products, itemsPerLine) {\n return chunk(products, itemsPerLine)\n .map(chunk => {\n const aspectRatios = chunk\n .map((item) =>{ \n if(item?.fields?.mainAsset?.fields){\n item.fields.mainAsset.fields.isPreload = false\n }\n item?.fields?.mainAsset?.fields?.imageRendition?.fields?.aspectRatio});\n\n\n const minAspectRatio = minimum(aspectRatios)\n\n return {aspectRatio: minAspectRatio, items: chunk};\n }).map(row => {\n // Temporary while aspect Ratios are too extreme\n const aspectRatio = row.aspectRatio && Math.max(row.aspectRatio, 0.4);\n return {...row, aspectRatio};\n });\n}\n\nexport default function CollapsibleProductsOverview({\n products,\n seeMoreProductsText,\n seeLessProductsText,\n whiteText,\n itemsPerRow,\n onClickCallback,\n productOverview,\n isRecentlyViewed,\n removeLazyLoad\n}) {\n\n const [isViewedMore, setIsViewedMore] = useState(false);\n const [navHeight, setNavHeight] = useState(0);\n const [isLoaded, setIsLoaded] = useState(false);\n const collapsibleRef = useRef(null);\n const wrapperRef = useRef(null);\n const [isShown, setIsShown] = useState(false);\n\n const onViewMore = useCallback(\n () => {\n setIsViewedMore(prevState => !prevState);\n },\n [],\n );\n\n const handleWaypoint = useCallback(() => {\n setIsShown(true);\n }, []);\n\n const calculateHeight = useCallback(\n () => {\n if (collapsibleRef.current) {\n setNavHeight(collapsibleRef.current.scrollHeight);\n }\n },\n [],\n );\n\n useIsomorphicLayoutEffect(() => {\n if (wrapperRef?.current && isLoaded && !isRecentlyViewed) {\n const seeMoreWrapperClassName = 'ob-collapsible-products-overview-see-more-wrapper';\n const collapsibleWrapperClassName = 'ob-collapsible-products-overview-collapsible';\n const imageWrapperSelector = '.ob-products-overview__overview-image-wrapper-1';\n const productsOverviewRows = Array.from(wrapperRef?.current?.children);\n let imageHeight = 0;\n // The timeout is to give time for the images to load\n let timeout = null;\n timeout = window.setTimeout(() => {\n productsOverviewRows.forEach(productsOverviewRow => {\n if (!productsOverviewRow.classList.contains(seeMoreWrapperClassName)) {\n const productsOverviewList = Array.from(productsOverviewRow.children);\n\n productsOverviewList.forEach((productsOverviewListItem => {\n if (productsOverviewListItem.classList.contains(collapsibleWrapperClassName)) {\n const innerProductsOverviewList = Array.from(productsOverviewListItem.children);\n let innerImageHeight = 0;\n\n innerProductsOverviewList.forEach(innerProductsOverviewListItem => {\n const imageWrapper = innerProductsOverviewListItem.querySelector(imageWrapperSelector);\n const currentImageHeight = imageWrapper.clientHeight;\n innerImageHeight = currentImageHeight > innerImageHeight ? currentImageHeight : innerImageHeight;\n });\n\n // we have to do another loop to make sure every item gets the proper height\n innerProductsOverviewList.forEach(innerProductsOverviewListItem => {\n const imageWrapper = innerProductsOverviewListItem.querySelector(imageWrapperSelector);\n imageWrapper.style.height = `${innerImageHeight}px`;\n });\n }\n\n const imageWrapper = productsOverviewListItem.querySelector(imageWrapperSelector);\n const currentImageHeight = imageWrapper.clientHeight;\n imageHeight = currentImageHeight > imageHeight ? currentImageHeight : imageHeight;\n }));\n\n // we have to do another loop to make sure every item gets the proper height\n productsOverviewList.forEach(productsOverviewListItem => {\n const imageWrapper = productsOverviewListItem.querySelector(imageWrapperSelector);\n imageWrapper.style.height = `${imageHeight}px`;\n });\n }\n });\n }, 500);\n\n return () => {\n window.clearTimeout(timeout)\n }\n }\n },[isLoaded, isViewedMore]);\n\n const fullScreenWidth = useMemo(() => `${(100 / itemsPerRow).toFixed(2)}%`, [itemsPerRow]);\n const rows = useMemo(() => makeRows(products, itemsPerRow), [products, itemsPerRow]);\n const firstRow = useMemo(() => rows.length > 0 && rows[0], [rows]);\n const remainingRows = useMemo(() => rows.length > 1 ? rows.slice(1) : undefined, [rows]);\n\n const Row = useCallback(({row, isShown, isAnimated = false}) => (\n <>\n {row.items.map((item, i) => (\n
\n \n
\n ))}\n \n ), [fullScreenWidth, whiteText]);\n\n return (\n \n
setIsLoaded(true)}>\n\n {/* Arbitrary numbers */}\n {!!firstRow && \n
\n \n
\n
}\n\n {!!remainingRows &&\n
\n
\n {remainingRows.map((row, i) => (\n \n ))}\n
\n
}\n {!!remainingRows && !!seeMoreProductsText &&\n
\n \n
}\n
\n
\n )\n}\n\nCollapsibleProductsOverview.defaultProps = {\n products: [],\n}\n\nCollapsibleProductsOverview.propTypes = {\n products: PropTypes.array,\n seeMoreProductsText: PropTypes.string,\n seeLessProductsText: PropTypes.string,\n whiteText: PropTypes.bool,\n itemsPerRow: PropTypes.number.isRequired,\n productOverview: PropTypes.any,\n removeLazyLoad: PropTypes.bool,\n onClickCallback: PropTypes.func,\n isRecentlyViewed: PropTypes.bool\n}\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport addOneClass from 'dom-helpers/addClass';\nimport removeOneClass from 'dom-helpers/removeClass';\nimport React from 'react';\nimport Transition from './Transition';\nimport { classNamesShape } from './utils/PropTypes';\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return addOneClass(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return removeOneClass(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](http://www.nganimate.org/) library, you should use it if you're\n * using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n *
\n * {\"I'll receive my-node-* classes\"}\n *
\n *
\n * \n *
\n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (node, appearing) {\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(node, appearing);\n }\n };\n\n _this.onEntering = function (node, appearing) {\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(node, appearing);\n }\n };\n\n _this.onEntered = function (node, appearing) {\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(node, appearing);\n }\n };\n\n _this.onExit = function (node) {\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(node);\n }\n };\n\n _this.onExiting = function (node) {\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(node);\n }\n };\n\n _this.onExited = function (node) {\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(node);\n }\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n if (type === 'appear' && phase === 'done') {\n className += \" \" + this.getClassNames('enter').doneClassName;\n } // This is for to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n /* eslint-disable no-unused-expressions */\n node && node.scrollTop;\n }\n\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = _objectWithoutPropertiesLoose(_this$props, [\"classNames\"]);\n\n return React.createElement(Transition, _extends({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(React.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = process.env.NODE_ENV !== \"production\" ? _extends({}, Transition.propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided and it\n * will be suffixed for each stage: e.g.\n *\n * `classNames=\"fade\"` applies `fade-appear`, `fade-appear-active`,\n * `fade-appear-done`, `fade-enter`, `fade-enter-active`, `fade-enter-done`,\n * `fade-exit`, `fade-exit-active`, and `fade-exit-done`.\n *\n * **Note**: `fade-appear-done` and `fade-enter-done` will _both_ be applied.\n * This allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply an\n * epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: classNamesShape,\n\n /**\n * A `` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' class is\n * applied.\n *\n * @type Function(node: HtmlElement)\n */\n onExit: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit-active' is applied.\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * @type Function(node: HtmlElement)\n */\n onExited: PropTypes.func\n}) : {};\nexport default CSSTransition;","import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}","/**\n * Checks if a given element has a CSS class.\n * \n * @param element the element\n * @param className the CSS class name\n */\nexport default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}","\"use strict\";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9985],{39985:function(e,t,n){n.r(t),n.d(t,{default:function(){return w}});var s=n(930),r=n.n(s),a=n(67294),o=n(5152),i=n.n(o),c=n(83824),l=n(94184),u=n.n(l),p=n(68665),d=n(61986),f=n(71357),v=n(85893);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function h(e){for(var t=1;ts?t:s})),t.forEach((function(e){e.querySelector(n).style.height=\"\".concat(s,\"px\")}))}var a=e.querySelector(n).clientHeight;r=a>r?a:r})),t.forEach((function(e){e.querySelector(n).style.height=\"\".concat(r,\"px\")}))}}))}),500),function(){window.clearTimeout(t)}}}),[L,g]);var V=(0,a.useMemo)((function(){return\"\".concat((100/o).toFixed(2),\"%\")}),[o]),Z=(0,a.useMemo)((function(){return function(e,t){return(0,d.yo)(e,t).map((function(e){var t=e.map((function(e){var t,n,s,r,a,o,i;(null==e||null==(t=e.fields)||null==(n=t.mainAsset)?void 0:n.fields)&&(e.fields.mainAsset.fields.isPreload=!1),null==e||null==(s=e.fields)||null==(r=s.mainAsset)||null==(a=r.fields)||null==(o=a.imageRendition)||null==(i=o.fields)||i.aspectRatio}));return{aspectRatio:(0,d.LT)(t),items:e}})).map((function(e){var t=e.aspectRatio&&Math.max(e.aspectRatio,.4);return h(h({},e),{},{aspectRatio:t})}))}(t,o)}),[t,o]),q=(0,a.useMemo)((function(){return Z.length>0&&Z[0]}),[Z]),H=(0,a.useMemo)((function(){return Z.length>1?Z.slice(1):void 0}),[Z]),$=(0,a.useCallback)((function(e){var t=e.row,n=e.isShown,s=e.isAnimated,a=void 0!==s&&s;return(0,v.jsx)(v.Fragment,{children:t.items.map((function(e,s){return(0,v.jsx)(\"div\",{style:{width:V},className:\"ob-collapsible-products-overview-product-wrapper\",children:(0,v.jsx)(b,{product:e,whiteText:r,aspectRatio:t.aspectRatio,index:s,isShown:n,isRecentlyViewed:m,isAnimated:a,removeLazyLoad:w,onClickCallback:i,productOverview:l})},s)}))})}),[V,r]);return(0,v.jsx)(p.Z,{in:g,timeout:800,onEntering:D,onExit:D,children:(0,v.jsxs)(\"div\",{ref:A,className:u()(\"ob-collapsible-products-overview\"),onLoad:function(){return k(!0)},children:[!!q&&(0,v.jsx)(c.h,{onEnter:_,topOffset:\"500px\",bottomOffset:\"300px\",children:(0,v.jsx)(\"div\",{className:\"ob-collapsible-products-overview-first-line\",children:(0,v.jsx)($,{row:q,isShown:S,isAnimated:!0})})}),!!H&&(0,v.jsx)(\"div\",{className:\"ob-collapsible-products-overview-collapsible-wrapper\",style:{height:N},children:(0,v.jsx)(\"div\",{className:\"ob-collapsible-products-overview-collapsible\",ref:P,children:H.map((function(e,t){return(0,v.jsx)($,{isShown:!0,row:e,isAnimated:!0},t)}))})}),!!H&&!!n&&(0,v.jsx)(\"div\",{className:\"ob-collapsible-products-overview-see-more-wrapper\",children:(0,v.jsx)(x,{whiteText:r,onClick:M,isOpen:g,seeMoreText:n,seeLessText:s})})]})})}w.defaultProps={products:[]}},68665:function(e,t,n){function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t