{"version":3,"file":"components-headerWithParagraphButton-headerWithParagraphButton-c77446fd72d1914b265d.js","mappings":"4MAuGA,UA9FkCA,IAI3B,IAADC,EAAAC,EAAAC,EAAAC,EAAAC,EAAA,IAJ6B,YACjCC,EAAW,sBACXC,EAAqB,SACrBC,GACDR,GACCS,EAAAA,EAAAA,YAAUC,UAAa,IAADC,EACpB,IAAIL,aAAW,EAAXA,EAAaM,cAAcJ,SAAc,QAANG,EAARH,EAAUK,YAAI,IAAAF,OAAN,EAARA,EAAgBG,QAAQ,IAAK,KAAK,OACxC,IAAIC,SAASC,IAAa,IAADC,GACtC,QAARA,EAAAC,gBAAQ,IAAAD,OAAA,EAARA,EAAUE,eAAeb,aAAW,EAAXA,EAAaM,aAAcI,GAAQ,EAAK,KAGjEI,YAAW,KACTC,OAAOb,SAASc,KAAQ,IAAGhB,aAAW,EAAXA,EAAaM,WAAW,GAClD,IAEP,IACC,CAACN,aAAW,EAAXA,EAAaM,YACjB,MAAMW,EAAmB,CACvBC,WAAY,CACV,CAACC,EAAAA,OAAOC,WAAY,CAACC,EAAMC,IACzBC,EAAAA,cAACC,EAAAA,SAAe,KAAEF,GAEpB,CAACH,EAAAA,OAAOM,WAAY,CAACJ,EAAMC,IACzBC,EAAAA,cAACC,EAAAA,SAAe,KAAEF,GAEpB,CAACH,EAAAA,OAAOO,WAAY,CAACL,EAAMC,IACzBC,EAAAA,cAACC,EAAAA,SAAe,KAAEF,GAEpB,CAACH,EAAAA,OAAOQ,SAAU,CAACN,EAAMC,IACvBC,EAAAA,cAACC,EAAAA,cAAoB,KAAEF,GAEzB,CAACH,EAAAA,OAAOS,SAAU,CAACP,EAAMC,IACvBC,EAAAA,cAACC,EAAAA,YAAkB,KAAEF,GAEvB,CAACH,EAAAA,OAAOU,WAAY,CAACR,EAAMC,IACzBC,EAAAA,cAACC,EAAAA,SAAe,KAAEF,GAEpB,CAACQ,EAAAA,QAAQC,WAAY,CAACV,EAAMC,KAAQ,IAAAU,EAAAC,EAAAC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oUAwBnBW,EAAWX,EAAAA,QAAOY,GAAEV,WAAA,CAAAC,YAAA,2CAAAC,YAAA,gBAATJ,CAAS,8PAgBpBa,EAAgBb,EAAAA,QAAOc,GAAEZ,WAAA,CAAAC,YAAA,gDAAAC,YAAA,gBAATJ,CAAS,kCAIzBe,EAAcf,EAAAA,QAAOc,GAAEZ,WAAA,CAAAC,YAAA,8CAAAC,YAAA,gBAATJ,CAAS,2FAUvBgB,EAAWhB,EAAAA,QAAOiB,GAAEf,WAAA,CAAAC,YAAA,2CAAAC,YAAA,gBAATJ,CAAS,+HAIbkB,EAAAA,GAMPC,EAAcnB,EAAAA,QAAOoB,EAAClB,WAAA,CAAAC,YAAA,8CAAAC,YAAA,gBAARJ,CAAQ,+iBAUPqB,EAAAA,GAkBfC,EAAatB,EAAAA,QAAOuB,IAAGrB,WAAA,CAAAC,YAAA,6CAAAC,YAAA,gBAAVJ,CAAU,kGAQvBwB,EAAkBxB,EAAAA,QAAOyB,GAAEvB,WAAA,CAAAC,YAAA,kDAAAC,YAAA,iBAATJ,CAAS,2HAY3B0B,EAAY1B,EAAAA,QAAO2B,KAAIzB,WAAA,CAAAC,YAAA,4CAAAC,YAAA,iBAAXJ,CAAW,yG","sources":["webpack://islandpetro/./src/components/headerWithParagraphButton/headerWithParagraphButton.js","webpack://islandpetro/./src/components/headerWithParagraphButton/headerWithParagraphButtonStyle.js"],"sourcesContent":["import React from 'react';\nimport * as Styled from './headerWithParagraphButtonStyle';\nimport { BLOCKS, INLINES } from '@contentful/rich-text-types';\nimport { documentToReactComponents } from '@contentful/rich-text-react-renderer';\nimport { useContentfulImages } from '../../hooks/useContentfulImages';\nimport isExternalUrl, { isExternalUrlhref,addTrailingSlash } from '../../utils';\nimport { useEffect } from 'react';\nimport useContentfulAssets from '../../hooks/useContentfulAssets';\n\nconst HeaderWithParagraphButton = ({\n sectionData,\n handleRequestCallBack,\n location,\n}) => {\n useEffect(async () => {\n if (sectionData?.elementId === location?.hash?.replace('#', '')) {\n const waitedID = await new Promise((resolve) => {\n document?.getElementById(sectionData?.elementId) && resolve(true);\n });\n if (waitedID) {\n setTimeout(() => {\n window.location.href = `#${sectionData?.elementId}`;\n }, 500);\n }\n }\n }, [sectionData?.elementId]);\n const optionsMainStyle = {\n renderNode: {\n [BLOCKS.HEADING_2]: (node, children) => (\n {children}\n ),\n [BLOCKS.HEADING_3]: (node, children) => (\n {children}\n ),\n [BLOCKS.PARAGRAPH]: (node, children) => (\n {children}\n ),\n [BLOCKS.UL_LIST]: (node, children) => (\n {children}\n ),\n [BLOCKS.OL_LIST]: (node, children) => (\n {children}\n ),\n [BLOCKS.LIST_ITEM]: (node, children) => (\n {children}\n ),\n [INLINES.HYPERLINK]: (node, children) =>\n node?.data?.uri === '/contact/customer-care/#top' ? (\n \n {children}\n \n ) : (\n \n {children}\n \n ),\n [BLOCKS.EMBEDDED_ASSET]: (node) => {\n const asset = useContentfulImages(node.data.target.sys.id);\n return asset.node.file.url.includes('image') ? (\n \n ) : (\n <>\n );\n },\n [INLINES.ASSET_HYPERLINK]: (node, children) => {\n const asset = useContentfulAssets(node.data.target.sys.id);\n if (asset) {\n return (\n \n {children}\n \n );\n }\n },\n [BLOCKS.HR]: () => ,\n },\n renderText: (text) =>\n text.split('\\n').flatMap((text, i) => [i > 0 &&
, text]),\n };\n return (\n \n {sectionData?.elementId?.trim() && (\n \n )}\n {sectionData?.header?.trim() && (\n {sectionData.header}\n )}\n {sectionData?.subText?.trim() && (\n {sectionData.subText}\n )}\n {sectionData?.contentDetails &&\n documentToReactComponents(\n JSON.parse(sectionData?.contentDetails?.raw),\n optionsMainStyle\n )}\n \n );\n};\nexport default HeaderWithParagraphButton;\n","import styled from 'styled-components';\nimport ArrowImage from '../../images/arrow-green.png';\nimport LinkArrowImage from '../../images/icon-home-arrow-orange.png';\n\nexport const MainDiv = styled.div`\n color: #666;\n font-family: 'Figtree-Regular', arial, sans-serif;\n font-size: 15px;\n line-height: 24px;\n letter-spacing: 0.02em;\n @media (max-width: 767px) {\n font-size: 15px;\n line-height: 22px;\n }\n`;\nexport const HeaderH1 = styled.h1`\n margin: 0 0 35px 0;\n padding: 0;\n font-family: 'Figtree-Light', arial, sans-serif;\n font-weight: normal !important;\n color: #00483a;\n font-size: 45px;\n line-height: 50px;\n letter-spacing: 0.02em;\n @media (max-width: 767px) {\n font-size: 35px;\n line-height: 40px;\n }\n`;\nexport const HeaderH2 = styled.h2`\n margin: 0 0 35px 0;\n padding: 0;\n font-family: 'Figtree-Light', arial, sans-serif;\n font-weight: normal !important;\n color: #008268;\n font-size: 32px;\n line-height: 38px;\n letter-spacing: 0.02em;\n @media (max-width: 767px) {\n font-size: 25px;\n line-height: 30px;\n margin-bottom: 20px;\n }\n`;\n\nexport const ParaText = styled.p`\n margin: 0 0 30px 0;\n padding: 0;\n b {\n font-family: 'Figtree-Bold', arial, sans-serif;\n font-weight: bold;\n }\n i {\n font-style: italic;\n }\n code {\n font-size: 19px;\n line-height: 28px;\n color: #666;\n font-family: 'Figtree-Regular', arial, sans-serif;\n letter-spacing: 0.02em;\n font-style: normal !important;\n @media (max-width: 767px) {\n font-size: 18px;\n line-height: 25px;\n }\n }\n`;\n\nexport const HeaderH3 = styled.h3`\n margin: 0 0 35px 0;\n padding: 0;\n font-family: 'Figtree-Light', arial, sans-serif;\n font-weight: normal !important;\n color: #008168;\n font-size: 26px;\n line-height: 35px;\n letter-spacing: 0.02em;\n @media (max-width: 767px) {\n font-size: 18px;\n line-height: 23px;\n margin-bottom: 20px;\n }\n`;\n\nexport const UnorderedList = styled.ul`\n margin: 0 0 30px 0;\n padding: 0;\n`;\nexport const OrderedList = styled.ul`\n margin: 0 0 30px 0;\n padding-left: 40px;\n li {\n background: none;\n list-style: decimal;\n padding: 0;\n }\n`;\n\nexport const ListItem = styled.li`\n margin: 0;\n padding: 4px 0 4px 25px;\n list-style: none;\n background: url(${LinkArrowImage}) no-repeat 0 10px;\n background-size: 7px auto;\n p {\n margin: 0;\n }\n`;\nexport const ButtonStyle = styled.a`\n display: inline-block;\n padding: 16px 85px 14px 15px;\n margin: 0 5px 5px 0;\n font-family: 'Figtree-Medium', arial, sans-serif;\n font-size: 13px;\n line-height: 16px;\n text-transform: uppercase !important;\n text-align: left;\n color: #008268;\n background: #d9ece8 url(${ArrowImage}) no-repeat 99% center;\n background-size: 23px auto;\n transition: background-position 0.15s ease-out;\n border: none;\n cursor: pointer;\n text-decoration: none;\n letter-spacing: 0.02em;\n @media (max-width: 767px) {\n width: 100% !important;\n margin: 0 0 25px 0 !important;\n }\n :hover {\n background-position: 95% center;\n text-decoration: none;\n color: #008268;\n }\n`;\n\nexport const ImageStyle = styled.img`\n height: auto !important;\n width: auto !important;\n border: 0;\n vertical-align: top;\n margin-bottom: 30px;\n`;\n\nexport const HorizontalBreak = styled.hr`\n height: 1px;\n border: none;\n background: #e5e5e5;\n margin: 50px 0;\n clear: both;\n opacity: 1;\n @media (max-width: 767px) {\n margin: 30px 0;\n }\n`;\n\nexport const SpanStyle = styled.span`\n position: absolute;\n top: 460px;\n @media (max-width: 991px) {\n top: -60px;\n }\n @media (max-width: 767px) {\n top: -45px;\n }\n`;\n"],"names":["_ref","_sectionData$elementI","_sectionData$elementI2","_sectionData$header","_sectionData$subText","_sectionData$contentD","sectionData","handleRequestCallBack","location","useEffect","async","_location$hash","elementId","hash","replace","Promise","resolve","_document","document","getElementById","setTimeout","window","href","optionsMainStyle","renderNode","BLOCKS","HEADING_2","node","children","React","Styled","HEADING_3","PARAGRAPH","UL_LIST","OL_LIST","LIST_ITEM","INLINES","HYPERLINK","_node$data","_node$data2","_node$data3","_node$data4","_node$data5","data","uri","onClick","isExternalUrlhref","addTrailingSlash","process","target","isExternalUrl","EMBEDDED_ASSET","asset","useContentfulImages","sys","id","file","url","includes","src","alt","title","ASSET_HYPERLINK","useContentfulAssets","_asset$node","_asset$node$file","HR","renderText","text","split","flatMap","i","key","trim","header","subText","contentDetails","documentToReactComponents","JSON","parse","raw","MainDiv","styled","div","withConfig","displayName","componentId","HeaderH1","h1","HeaderH2","h2","ParaText","p","HeaderH3","h3","UnorderedList","ul","OrderedList","ListItem","li","LinkArrowImage","ButtonStyle","a","ArrowImage","ImageStyle","img","HorizontalBreak","hr","SpanStyle","span"],"sourceRoot":""}