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AAAuF,CAAA,CAAAjC,GAAAkC,oBAAA,CAAAlC,GAAA","sources":["webpack://_N_E/./components/SwitchTab/SwitchTab.js","webpack://_N_E/"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { mediaQueryHOC } from '../../adapters/helpers/Hooks';\nimport { isObjectEmpty } from '../../adapters/helpers/Utils';\nimport Block from '../../adapters/helpers/Block';\nimport dynamic from 'next/dynamic';\nconst DropDownSelector = dynamic(() => import('../DropDownSelector/DropDownSelector'));\nimport { MetaConstants, Constants } from '../../adapters/helpers/Constants';\nimport { useTabContext } from '../TabContext';\n\nconst SwitchTab = (props) => {\n \n const document = props?.document;\n const contentDetails = document?.fields?.contentDetails;\n const [selectedSwitchTypeIndex, setSelectedSwitchTypeIndex] = useState(0);\n const {activeTabIndex, setActiveTabIndex} = useTabContext() \n const isDropDown = document?.fields?.isDropDown;\n const hasAllProducts = document?.fields?.hasAllProducts;\n const anchorId = document?.fields?.anchorId;\n const className = document?.fields?.classNames;\n const isMultipleTabs = document?.fields?.isMultipleTabs;\n const isMobileDropDown = document?.fields?.isMobileDropdown;\n let switchType;\n switchType = Array.isArray( contentDetails ) && contentDetails.length > ( hasAllProducts ? selectedSwitchTypeIndex : activeTabIndex ) && contentDetails[hasAllProducts ? selectedSwitchTypeIndex : activeTabIndex];\n if ( hasAllProducts && isMultipleTabs && !isDropDown ) {\n switchType = Array.isArray( contentDetails ) && contentDetails.length > ( selectedSwitchTypeIndex ) && contentDetails[selectedSwitchTypeIndex];\n }\n if ( !isDropDown ) {\n switchType = Array.isArray( contentDetails ) && contentDetails.length > ( selectedSwitchTypeIndex ) && contentDetails[selectedSwitchTypeIndex];\n }\n let contents = switchType?.fields?.contents;\n \n const handleSwitchTypeChange = (index) => {\n setSelectedSwitchTypeIndex( index );\n setActiveTabIndex(index)\n };\n\n for ( let i = 0; i < contents?.length; i++ ){\n if ( contents?.[i]?.fields?.contentType === 'switchTabs' ) {\n if ( !contents[i].fields.onClickCallback ) {\n contents[i].fields.onClickCallback = props?.onClickCallback;\n }\n } else if ( contents?.[i]?.fields?.contentType === 'productRecommendBlockABtest' ) {\n if ( !contents[i].fields.onClickCallback ) {\n contents[i].fields.onClickCallback = props?.onClickCallback ? props?.onClickCallback : props?.document?.fields?.onClickCallback;\n }\n } \n }\n\n return (\n
\n

{document?.fields?.title}

\n {document?.fields?.doesHaveHorizontalLineBelowMainTitle &&
}\n {isDropDown || (isMobileDropDown && props.isSmall) ? (\n
\n \n
\n \n ) : (\n <>\n {!isMultipleTabs ? (Array.isArray(contentDetails) && \n ) : (\n Array.isArray(contentDetails) && \n )}\n \n )}\n {!isObjectEmpty(contents) &&\n new Block(contents).renderSpecifiedBlock(contents)\n }\n
\n )\n};\n\nSwitchTab.propTypes = {\n document: PropTypes.object\n};\n\nexport default mediaQueryHOC(SwitchTab);\n","\"use strict\";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7311],{17311:function(l,n,i){i.r(n);var e=i(67294),t=i(71357),a=i(8996),s=i(40483),c=i(5152),o=i.n(c),d=i(24036),r=i(41274),u=i(85893),b=o()((function(){return i.e(7200).then(i.bind(i,47200))}),{loadableGenerated:{webpack:function(){return[47200]}}});n.default=(0,t.Ui)((function(l){var n,i,t,c,o,h,f,v,k,w,m,p,C=null==l?void 0:l.document,_=null==C||null==(n=C.fields)?void 0:n.contentDetails,x=(0,e.useState)(0),j=x[0],y=x[1],A=(0,r._)(),N=A.activeTabIndex,g=A.setActiveTabIndex,T=null==C||null==(i=C.fields)?void 0:i.isDropDown,I=null==C||null==(t=C.fields)?void 0:t.hasAllProducts,B=null==C||null==(c=C.fields)?void 0:c.anchorId,D=null==C||null==(o=C.fields)?void 0:o.classNames,M=null==C||null==(h=C.fields)?void 0:h.isMultipleTabs,S=null==C||null==(f=C.fields)?void 0:f.isMobileDropdown;p=Array.isArray(_)&&_.length>(I?j:N)&&_[I?j:N],I&&M&&!T&&(p=Array.isArray(_)&&_.length>j&&_[j]),T||(p=Array.isArray(_)&&_.length>j&&_[j]);for(var E=null==(v=p)||null==(k=v.fields)?void 0:k.contents,F=0;F<(null==E?void 0:E.length);F++){var H,O,U,z;if(\"switchTabs\"===(null==E||null==(H=E[F])||null==(O=H.fields)?void 0:O.contentType))E[F].fields.onClickCallback||(E[F].fields.onClickCallback=null==l?void 0:l.onClickCallback);else if(\"productRecommendBlockABtest\"===(null==E||null==(U=E[F])||null==(z=U.fields)?void 0:z.contentType)){var G,K;if(!E[F].fields.onClickCallback)E[F].fields.onClickCallback=(null==l?void 0:l.onClickCallback)?null==l?void 0:l.onClickCallback:null==l||null==(G=l.document)||null==(K=G.fields)?void 0:K.onClickCallback}}return(0,u.jsxs)(\"section\",{className:\"ob-switch-tab-block \".concat(D||\"\"),id:B,children:[(0,u.jsx)(\"h3\",{className:\"ob-switch-tab-title\",children:null==C||null==(w=C.fields)?void 0:w.title}),(null==C||null==(m=C.fields)?void 0:m.doesHaveHorizontalLineBelowMainTitle)&&(0,u.jsx)(\"hr\",{}),T||S&&l.isSmall?(0,u.jsx)(\"div\",{className:\"ob-switch-dropdown-container\",children:(0,u.jsx)(b,{options:_,selectedOption:I?j:N,handleOptionClick:function(l){y(l),g(l)},anchorId:B})}):(0,u.jsx)(u.Fragment,{children:M?Array.isArray(_)&&(0,u.jsx)(\"ul\",{role:\"tablist\",className:\"ob-switch-tab-multiple__content-details\",children:_&&_.map((function(l,n){var i,e,t,a,s;return(0,u.jsxs)(\"li\",{role:\"tab\",children:[(0,u.jsxs)(\"a\",{className:\"ob-switch-tab__content-details-type \".concat(n===j?\"ob-switch-tab__active-switch\":\"\"),onClick:function(){return y(n)},tabIndex:n,children:[(0,u.jsx)(\"img\",{className:\"switch-tab-image-asset\",src:d.FU.https+(null==l||null==(i=l.fields)||null==(e=i.switchTabAsset)||null==(t=e.fields)||null==(a=t.file)?void 0:a.url),alt:d.gT.productType}),(0,u.jsx)(\"div\",{className:\"switch-tab-label\",children:null==l||null==(s=l.fields)?void 0:s.label})]},n),(0,u.jsx)(\"div\",{className:\"switch-tab-bottom-arrow \".concat(n===j?\"active\":\"\")})]},n)}))}):Array.isArray(_)&&(0,u.jsx)(\"ul\",{role:\"tablist\",className:\"ob-switch-tab__content-details\",children:_&&_.map((function(l,n){var i,e=0===n?\"ob-switch-tab__content-details-left\":n===_.length-1?\"ob-switch-tab__content-details-right\":\"\";return(0,u.jsx)(\"li\",{role:\"tab\",children:(0,u.jsx)(\"button\",{className:\"ob-switch-tab__content-details-type \".concat(n===j?\"ob-switch-tab__active-switch\":\"\",\" \").concat(e),onClick:function(){return y(n)},tabIndex:n,children:null==l||null==(i=l.fields)?void 0:i.label},n)},n)}))})}),!(0,a.nK)(E)&&new s.Z(E).renderSpecifiedBlock(E)]})}))}}]);"],"names":["self","webpackChunk_N_E","push","l","n","i","r","e","t","a","s","c","o","d","u","b","then","bind","loadableGenerated","webpack","default","Ui","H","O","U","z","G","K","h","f","v","k","w","m","p","C","document","_","fields","contentDetails","x","useState","j","y","A","N","activeTabIndex","g","setActiveTabIndex","T","isDropDown","I","hasAllProducts","B","anchorId","D","classNames","M","isMultipleTabs","S","isMobileDropdown","Array","isArray","length","E","contents","F","contentType","onClickCallback","jsxs","className","concat","id","children","jsx","title","doesHaveHorizontalLineBelowMainTitle","isSmall","options","selectedOption","handleOptionClick","Fragment","role","map","onClick","tabIndex","src","FU","https","switchTabAsset","file","url","alt","gT","productType","label","nK","Z","renderSpecifiedBlock"],"sourceRoot":""}