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AAO,CAAEmB,UAAW,QAASC,WAAY,iBAIzG,gBAAKlB,wBAAyB,CAAEC,OAAQlC,EAAKoD,oBAE7C,iBAAKvB,UAAU,0BAA0BE,MAAO,CAAEM,UAAW,QAAS,WACpE,iBAAMJ,wBAAyB,CAAEC,OAAQlC,EAAK4C,gBAC7C5C,EAAK6C,UAAW,iBAAMZ,wBAAyB,CAAEC,OAAQlC,EAAK8C,qBAA+B,SAEhG,iBAAMO,WAAW,EAAM1B,SAAS,2BAA2BS,SAAS,QAAO,UACzE,iBAAMA,SAAS,OAAakB,QAAS,gDAEvC,iBAAMD,WAAW,EAAMjB,SAAS,cAAoBkB,QAAS1C,EAAeZ,EAAKc,sBAvCnCb,GA0ChD,uBACD,SAGN,C","sources":["pages/products/product-details.tsx"],"sourcesContent":["import { useEffect } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport TwoColumnLayOut from \"../../layouts/two-columns/two-column-layout\";\r\nimport { RootState, useAppDispatch } from \"../../redux/store\";\r\nimport { useParams, useLocation, Location } from \"react-router-dom\";\r\nimport { retrieveProductDetails } from \"../../redux/slice/products/product-details-slice\";\r\nimport { retrieveTaxonomyProduct } from \"../../redux/slice/taxonomy-product-slice\";\r\nimport { retrieveProductRightSideBooks } from \"../../redux/slice/right-side/product-right-side-books-slice\";\r\nimport { retrieveProductRightSideLearning } from \"../../redux/slice/right-side/product-right-side-learning-slice\";\r\nimport { retrieveProductRightSideNews } from \"../../redux/slice/right-side/product-right-side-news-slice\";\r\nimport { retrieveProductRightSideRelatedEvents } from \"../../redux/slice/right-side/product-right-side-related-events-slice\";\r\nimport { Helmet } from \"react-helmet-async\";\r\nimport LoadingComp from \"../../components/re-usable/loading/loading\";\r\n\r\nconst ProductDetails = () => {\r\n const routeParams = useParams();\r\n const dispatch = useAppDispatch();\r\n const location: Location = useLocation();\r\n const queryParams = new URLSearchParams(location.search);\r\n const isSale = queryParams.has(\"sale\");\r\n\r\n const { ProductDetailsData } = useSelector((state: RootState) => state.ProductDetails);\r\n const { rightSideFeaturedBooksData } = useSelector((state: RootState) => state.ProductRightSideBook);\r\n const { rightSideFeaturedLearningData } = useSelector((state: RootState) => state.ProductRightSideLearning);\r\n const { rightSideTrendingNewsData } = useSelector((state: RootState) => state.ProductRightSideNews);\r\n const { rightSidePopularEventsData } = useSelector((state: RootState) => state.ProductRightSideRelatedEvents);\r\n const { data } = useSelector((state: RootState) => state.taxonomyProduct);\r\n let productDetails = ProductDetailsData[0]?.productInfoItemsList;\r\n const path = routeParams.path;\r\n\r\n let detailPageNewsTrail = {\r\n trendingNewsData: rightSideTrendingNewsData,\r\n popularEventsData: rightSidePopularEventsData,\r\n featuredLearningData: rightSideFeaturedLearningData,\r\n featuredBooksData: rightSideFeaturedBooksData,\r\n };\r\n\r\n useEffect(() => {\r\n if (path) {\r\n dispatch(retrieveProductDetails(path));\r\n dispatch(retrieveTaxonomyProduct(path));\r\n dispatch(retrieveProductRightSideBooks(path));\r\n dispatch(retrieveProductRightSideLearning(path));\r\n dispatch(retrieveProductRightSideNews(path));\r\n dispatch(retrieveProductRightSideRelatedEvents(path));\r\n }\r\n }, [path, dispatch]);\r\n\r\n useEffect(() => {\r\n if (productDetails) {\r\n document.title = productDetails[0]?.name;\r\n }\r\n }, [productDetails]);\r\n\r\n if (productDetails === undefined || productDetails === null) return <LoadingComp />;\r\n\r\n const formatPrice = (price: string) => {\r\n let formattedPrice = price.replace(\"$\", \"\");\r\n let parseFloatCheck = parseFloat(formattedPrice);\r\n let parseIntCheck = parseInt(formattedPrice);\r\n\r\n if ((parseFloatCheck || parseFloatCheck === 0) || (parseIntCheck || parseIntCheck === 0)) {\r\n return `<span itemprop='priceCurrency' content='USD'>$</span><meta itemprop='price' content='${formattedPrice.replace(/[,]/g, \"\")}'><span>${formattedPrice}</span>`\r\n }\r\n\r\n return price;\r\n }\r\n\r\n const formatPricing = (pricing: string) => {\r\n let prices = pricing.split(/\\r?\\n|\\r|\\n/g)[0].split(' ');\r\n\r\n prices.map((item, index) => {\r\n let removedCurr = item.replace(\"$\", \"\");\r\n let parseFloatCheck = parseFloat(removedCurr);\r\n let parseIntCheck = parseInt(removedCurr);\r\n\r\n if ((parseFloatCheck || parseFloatCheck === 0) || (parseIntCheck || parseIntCheck === 0)) {\r\n prices[index] = \"<span itemscope itemprop='offers' itemtype='https://schema.org/Offer'>\" + formatPrice(item) + \"</span>\"\r\n }\r\n return prices.join(\" \")\r\n });\r\n\r\n return prices.join(\" \");\r\n };\r\n\r\n const getDescription = (fullDesc: string) => {\r\n var shortDescription = fullDesc;\r\n\r\n var descParts = fullDesc.split(/\\r?\\n|\\r|\\n/g)\r\n if (descParts.length > 1) shortDescription = descParts.slice(1).join(\" \");\r\n\r\n return shortDescription;\r\n };\r\n\r\n return (\r\n <>\r\n <Helmet>\r\n <title>{ProductDetailsData[0]?.productInfoItemsList[0]?.isPublic ? ProductDetailsData[0]?.productInfoItemsList[0]?.menuItemName : `| RAPS`}</title>\r\n </Helmet>\r\n <TwoColumnLayOut breadcrumbPath={`${path}`} isBreadcrumbpath={false} detailPageTaxonomy={data} detailPageNewsTrail={detailPageNewsTrail} showAds={true} isDetails={true} addSchema={true} schemaOptions={{ itemType: \"https://schema.org/Product\" }}>\r\n {productDetails?.length < 1 && \"Product is not found\"}\r\n {productDetails &&\r\n productDetails.map((item, index) => {\r\n var pricing = formatPricing(item.shortDescription) || item.shortDescription;\r\n if (isSale && item.alternatePricing !== \"\") pricing = formatPricing(item.alternatePricing) || item.alternatePricing;\r\n\r\n return item.isPublic ? (\r\n <div className=\"ed-content\" id=\"edcontent\" key={index}>\r\n <div className=\"row\">\r\n <div className=\"col-lg-8 col-md-12\">\r\n <div className=\"category-type\" style={{ display: \"block\" }}><span dangerouslySetInnerHTML={{ __html: item.badge }}></span></div>\r\n <h1 id=\"title\" itemProp=\"name\" style={{ marginTop: \"5px\" }} className=\"pd-header h1\">{item.name}</h1>\r\n <input type=\"hidden\" id=\"hdnProductCode\" value={item.code} />\r\n\r\n {item.educationCredits > 0.0 ? (\r\n <span className=\"products\" style={{ marginRight: \"20px\", display: \"inline\" }}>\r\n <span className=\"meta-item rac-credits\">\r\n <span style={{ margin: \"3px 0\" }} className=\"rac-credits\">\r\n <span style={{ marginRight: \"6px\" }} className=\"badge badge-credits\">{\" \"}{item.educationCredits}{\" \"}</span>\r\n <span className=\"badge-label\">RAC Credits</span>{\" \"}\r\n </span>\r\n </span>\r\n </span>\r\n ) : null}\r\n\r\n <span className=\"pricing\" dangerouslySetInnerHTML={{ __html: pricing }}></span>\r\n <div className=\"cta product-details-cta\" style={{ marginTop: \"12px\" }}>\r\n <span dangerouslySetInnerHTML={{ __html: item.addtoCartBtn }}></span>\r\n {item.hasEbook ? <span dangerouslySetInnerHTML={{ __html: item.addEbookToCartBtn }}></span> : null}\r\n </div>\r\n </div>\r\n <div className=\"col-lg-4 col-md-12\">\r\n <span style={{ display: \"block\" }}>\r\n <img itemProp=\"image\" alt={item.name} src={item.imageUrl} style={{ maxHeight: \"250px\", marginLeft: \"6px\" }} />\r\n </span>\r\n </div>\r\n </div>\r\n <div dangerouslySetInnerHTML={{ __html: item.longDescription }}></div>\r\n\r\n <div className=\"cta product-details-cta\" style={{ marginTop: \"20px\" }}>\r\n <span dangerouslySetInnerHTML={{ __html: item.addtoCartBtn }}></span>\r\n {item.hasEbook ? <span dangerouslySetInnerHTML={{ __html: item.addEbookToCartBtn }}></span> : null}\r\n </div>\r\n <span itemScope={true} itemType=\"https://schema.org/Brand\" itemProp=\"brand\">\r\n <span itemProp=\"name\" {...{ content: \"Regulatory Affairs Professionals Society\" }}></span>\r\n </span>\r\n <span itemScope={true} itemProp=\"description\" {...{ content: getDescription(item.shortDescription) }}></span>\r\n </div>\r\n ) : (\r\n \"Product is not valid \"\r\n );\r\n })}\r\n </TwoColumnLayOut>\r\n </>\r\n );\r\n};\r\n\r\nexport default ProductDetails;\r\n"],"names":["routeParams","useParams","dispatch","useAppDispatch","location","useLocation","isSale","URLSearchParams","search","has","ProductDetailsData","useSelector","state","ProductDetails","rightSideFeaturedBooksData","ProductRightSideBook","rightSideFeaturedLearningData","ProductRightSideLearning","rightSideTrendingNewsData","ProductRightSideNews","rightSidePopularEventsData","ProductRightSideRelatedEvents","data","taxonomyProduct","productDetails","productInfoItemsList","path","detailPageNewsTrail","trendingNewsData","popularEventsData","featuredLearningData","featuredBooksData","useEffect","retrieveProductDetails","retrieveTaxonomyProduct","retrieveProductRightSideBooks","retrieveProductRightSideLearning","retrieveProductRightSideNews","retrieveProductRightSideRelatedEvents","document","title","name","undefined","formatPricing","pricing","prices","split","map","item","index","removedCurr","replace","parseFloatCheck","parseFloat","parseIntCheck","parseInt","price","formattedPrice","formatPrice","join","getDescription","fullDesc","shortDescription","descParts","length","slice","isPublic","menuItemName","breadcrumbPath","isBreadcrumbpath","detailPageTaxonomy","showAds","isDetails","addSchema","schemaOptions","itemType","alternatePricing","className","id","style","display","dangerouslySetInnerHTML","__html","badge","itemProp","marginTop","type","value","code","educationCredits","marginRight","margin","addtoCartBtn","hasEbook","addEbookToCartBtn","alt","src","imageUrl","maxHeight","marginLeft","longDescription","itemScope","content"],"sourceRoot":""}