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AA,SAAAjC,CAAA,CAAAC,CAAA,sBAAAA,EAAAuC,MAAA,CAAAC,WAAA,OAAAZ,UAAA,CAAAe,MAAA,IAAA5C,CAAAA,EAAAqE,eAAA,CAAAC,KAAA,MAAAzC,UAAA,MAAAE,cAAA,OAAAA,cAAA,MAAAF,UAAA,CAAAe,MAAA,OAAAb,cAAA,qBAAA9B,EAAAuC,MAAA,CAAAC,WAAA,OAAAd,QAAA,CAAAiB,MAAA,IAAA5C,CAAAA,EAAAqE,eAAA,CAAAE,aAAA,MAAA5C,QAAA,MAAAC,YAAA,OAAAA,YAAA,MAAAD,QAAA,CAAAiB,MAAA,OAAAhB,YAAA,IAAA5B,CAAA,KAAAA,CAAA,IAAAwE,EAAAtE,EAAA,gBAAAI,EAAAN,CAAA,MAAAC,EAAAD,EAAAqE,eAAA,KAAAnE,EAAAD,EAAAwE,MAAA,CAAAtE,EAAA,IAAAqB,EAAA,CAAAyB,SAAAjD,EAAAiD,QAAA,CAAAvB,QAAAxB,CAAA,GAAAwE,iBAAA,EAAAL,gBAAApE,CAAA,EAAAD,EAAAoD,eAAA,CAAApD,EAAAqD,WAAA,WAAAtC,EAAA4C,GAAA,EAAApD,EAAAoE,QAAA,EAAAC,SAAA,GAAA7D,EAAA4C,GAAA,EAAAa,EAAAnE,OAAA,KAAAwD,SAAA,GAAA9C,EAAA4C,GAAA,SAAAT,UAAA,0BAAA2B,MAAA,CAAA7E,EAAAkD,SAAA,CAAAlD,EAAAkD,SAAA,KAAAW,SAAA1D,CAAA","sources":["webpack://_N_E/./adapters/helpers/ProductLegacyBlock.js","webpack://_N_E/./components/ProductLegacyBody/ProductLegacyBody.js","webpack://_N_E/"],"sourcesContent":["import React, {Fragment} from 'react'\nimport componentFactory from '../../components/ComponentFactory';\nimport { customSuperJsonParse, customSuperJsonStringify } from './Utils';\nimport LazyLoad from 'react-lazyload';\nclass ProductLegacyBlock {\n\n constructor(props) {\n this.props = props;\n this.product = props.product;\n this.contents = props.contents || this.product?.contents || [];\n this.contentIndex = props.contentIndex || 0;\n this.promotions = props.promotions || this.product?.relatedPromotions || [];\n this.promotionIndex = props.promotionIndex || 0;\n }\n\n renderBlock(moduleClass, attributes, moduleBody) {\n const moduleDefinition = componentFactory.getModule(moduleClass);\n if (moduleDefinition) {\n const module = React.createElement(moduleDefinition, attributes, moduleBody);\n return module;\n } else {\n console.info('Unsupported module type : ' + moduleClass);\n }\n }\n\n renderBlockFromDocument(extraAttributes, onClickCallback, customEvent, index) {\n const document = this.getDocument();\n if (document && document.fields && document.fields.contentType) {\n let contentType = document.fields.contentType;\n let blockName = document.fields.name;\n let className = document.fields.classNames;\n\n let attributes = {\n name: blockName,\n document: document,\n className: className,\n onClickCallback,\n customEvent,\n key: blockName,\n index,\n ...extraAttributes\n };\n\n return this.renderBlock(contentType, attributes, null);\n\n } else {\n console.error('Unsupported block is currently assign to page:' + this.props.page.fields.name);\n }\n }\n\n /**\n * Render the modules assigned to the page.\n * @returns {*}\n */\n renderChildBlocks(extraAttributes, onClickCallback, customEvent) {\n const doc = this.getDocument();\n return ((doc. fields && doc.fields.blocks) ?\n \n { doc.fields.blocks.map((child, index) => {\n if(this.isRenderable(child)) {\n let extraAttributesClone = customSuperJsonParse(customSuperJsonStringify(extraAttributes));\n let currentExtraAttributes = this.reassignExtraAttributes(extraAttributesClone, child);\n\n const props = {\n document: child,\n product: this.product,\n contents:this.contents,\n contentIndex: this.contentIndex,\n promotions:this.promotions,\n promotionIndex: this.promotionIndex\n };\n\n return \n {\n new ProductLegacyBlock(props)\n .renderBlockFromDocument(currentExtraAttributes, onClickCallback, customEvent, index)\n }\n \n }\n })}\n \n :\n null\n );\n }\n\n getDocument() {\n let doc = this.props.document;\n\n if (doc == null) {\n doc = this.props;\n }\n\n if (!doc) {\n doc = {};\n }\n\n return doc;\n }\n\n isRenderable(document) {\n if(document.fields.contentType == 'promoBlock' ){\n return (this.promotionIndex < this.promotions.length);\n } else if(document.fields.contentType == 'richTextBlock') {\n return (this.contentIndex < this.contents.length);\n } else {\n return true;\n }\n }\n\n reassignExtraAttributes(extraAttributes, document) {\n if(document.fields.contentType == 'promoBlock' && this.promotions.length > 0){\n extraAttributes['extraAttributes']['promo'] = this.promotions[this.promotionIndex];\n if(this.promotionIndex < this.promotions.length) {\n this.promotionIndex++;\n }\n }\n\n if(document.fields.contentType == 'richTextBlock' && this.contents.length > 0){\n extraAttributes['extraAttributes']['richTextBlock'] = this.contents[this.contentIndex];\n if(this.contentIndex < this.contents.length) {\n this.contentIndex++;\n }\n }\n return extraAttributes;\n }\n}\n\nexport default ProductLegacyBlock","import React,{Suspense} from 'react';\nimport PropTypes from 'prop-types';\nimport ProductLegacyBlock from '../../adapters/helpers/ProductLegacyBlock';\nimport Loader from '../../adapters/helpers/Loader';\n\nexport default function ProductLegacyBody(props) {\n const extraAttributes = props.extraAttributes || {};\n const product = extraAttributes.entity;\n\n const productLegacyBlock = new ProductLegacyBlock({document: props.document, product });\n\n const children = productLegacyBlock.renderChildBlocks({ extraAttributes }, props.onClickCallback, props.customEvent);\n\n return (\n }>\n
\n {children}\n
\n
\n );\n}\n\nProductLegacyBody.propTypes = {\n className: PropTypes.string,\n extraAttributes: PropTypes.object,\n document: PropTypes.object,\n onClickCallback: PropTypes.func,\n customEvent: PropTypes.object\n};\n","\"use strict\";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6632],{6632:function(t,e,n){n.r(e),n.d(e,{default:function(){return k}});var o=n(67294),r=n(930),s=n.n(r),i=n(33227),c=n.n(i),l=n(88361),u=n.n(l),d=n(63420),p=n(8996),a=n(1216),h=n(85893);function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}var m=function(){function t(e){var n,o;c()(this,t),this.props=e,this.product=e.product,this.contents=e.contents||(null==(n=this.product)?void 0:n.contents)||[],this.contentIndex=e.contentIndex||0,this.promotions=e.promotions||(null==(o=this.product)?void 0:o.relatedPromotions)||[],this.promotionIndex=e.promotionIndex||0}return u()(t,[{key:\"renderBlock\",value:function(t,e,n){var r=d.Z.getModule(t);if(r)return o.createElement(r,e,n);console.info(\"Unsupported module type : \"+t)}},{key:\"renderBlockFromDocument\",value:function(t,e,n,o){var r=this.getDocument();if(r&&r.fields&&r.fields.contentType){var i=r.fields.contentType,c=r.fields.name,l=function(t){for(var e=1;e0&&(t.extraAttributes.promo=this.promotions[this.promotionIndex],this.promotionIndex0&&(t.extraAttributes.richTextBlock=this.contents[this.contentIndex],this.contentIndex