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X,KAGH9B,EAAMsC,MAAOd,EAAAA,EAAAA,KAACe,EAAAA,EAAO,CAACC,KAAMxC,EAAMsC,KAAMG,WAAS,IAAM,MAGxDjB,EAAAA,EAAAA,KAACkB,EAAAA,EAAO,CAACC,QAAS3C,EAAM2C,QAASC,MAAOlC,IAGvCV,EAAM6C,OACHrB,EAAAA,EAAAA,KAACsB,EAAAA,EAAW,CACR1B,UAAWhB,EAAEyC,MACbE,IAAK/C,EAAM6C,MAAMG,IACjBC,aAAcjD,EAAM6C,MAAMK,MAC1BC,aAAcnD,EAAM6C,MAAMO,SAE9B,SAIR5B,EAAAA,EAAAA,KAAA,OAAKJ,UAAWhB,EAAEiD,MAAM9B,SACR,QADQtB,EACnBD,EAAMqD,aAAK,IAAApD,OAAA,EAAXA,EAAaqD,KAAI,CAACC,EAAMC,KACrBhC,EAAAA,EAAAA,KAACiC,EAAAA,EAAY,CAETC,MAAOH,EAAKzB,SACZ6B,iBAAe,EACfvC,UAAWhB,EAAEwD,UAAUrC,UAEvBC,EAAAA,EAAAA,KAACe,EAAAA,EAAO,CAACC,KAAMe,EAAKjB,QALfkB,YAcxBvC,GACGO,EAAAA,EAAAA,KAACqC,EAAAA,EAAM,CAAAtC,UACHC,EAAAA,EAAAA,KAAA,UAAQsC,KAAK,sBAAqBvC,SAC7BwC,KAAKC,UArEAC,MAAO,IAADC,EAC5B,MAAO,CACH,WAAY,qBACZ,QAAS,UACTC,WAAuB,QAAbD,EAAElE,EAAMqD,aAAK,IAAAa,OAAA,EAAXA,EAAaZ,KAAKC,IAAI,CAC9B,QAAS,WACTa,KAAMb,EAAKzB,SACXuC,eAAgB,CACZ,QAAS,SACT/B,KAAMiB,EAAKjB,UAGtB,EAyD+B2B,QAGxB,OACF,C","sources":["blocks/components/TextAccordions/hooks/usePosition.hook.ts","webpack://@danishagro/cms/./src/blocks/components/TextAccordions/TextAccordions.module.scss?8158","blocks/components/TextAccordions/TextAccordions.component.tsx"],"sourcesContent":["import { useMemo } from \"react\";\n\nexport const usePosition = (position: string, S: { [key: string]: string }) => {\n const positionClassName = useMemo(() => {\n switch (position) {\n case \"POSITION_ACCORDIONS_LEFT\":\n return S.positionAccordionLeft;\n case \"POSITION_ACCORDIONS_BOTTOM\":\n return S.positionAccordionBottom;\n }\n }, [position, S]);\n\n return {\n positionClassName,\n };\n};\n","// extracted by mini-css-extract-plugin\nexport default {\"wrapper\":\"TextAccordions_wrapper__Hj8pp\",\"inner\":\"TextAccordions_inner__EmlR5\",\"positionAccordionBottom\":\"TextAccordions_positionAccordionBottom__j1-Ir\",\"textWrapper\":\"TextAccordions_textWrapper__DYrW3\",\"positionAccordionLeft\":\"TextAccordions_positionAccordionLeft__r25-J\",\"tagline\":\"TextAccordions_tagline__i4+4k\",\"image\":\"TextAccordions_image__USaat\",\"items\":\"TextAccordions_items__Q3PyY\",\"accordion\":\"TextAccordions_accordion__3bf7y\"};","import React from \"react\";\nimport { Buttons } from \"src/components/Buttons/Buttons.component\";\nimport { cn } from \"@danishagro/shared/src/helpers/classNames.helper\";\nimport { DA_Accordion } from \"@danishagro/shared/src/components/molecules/Accordion/Accordion.component\";\nimport { DA_Container } from \"@danishagro/shared/src/components/atoms/Container/Container.component\";\nimport { DA_Text } from \"@danishagro/shared/src/components/atoms/Text/Text.component\";\nimport {\n DA_Title,\n DA_TitleTag,\n} from \"@danishagro/shared/src/components/atoms/Title/Title.component\";\nimport { Helmet } from \"react-helmet\";\nimport { ImageViewer } from \"src/components/ImageViewer/ImageViewer.component\";\nimport { useBackgroundColor } from \"@danishagro/cms/src/blocks/hooks/useBackgroundColor/useBackgroundColor.hook\";\nimport { usePadding } from \"@danishagro/cms/src/blocks/hooks/usePadding/usePadding.hook\";\nimport { usePosition } from \"./hooks/usePosition.hook\";\nimport { TextAccordionsProps } from \"./TextAccordions.interface\";\nimport S from \"./TextAccordions.module.scss\";\n\nconst TextAccordions = (props: TextAccordionsProps) => {\n const { positionClassName } = usePosition(props.position, S);\n const { backgroundColorClass, alternativeButtonTheme, hasBackgroundColor } = useBackgroundColor(\n props.backgroundColor\n );\n const { paddingClass } = usePadding(props.isCompact, hasBackgroundColor);\n\n // Ensure fAQContent is strictly true (not null, undefined, or false)\n const isFaqContent = props.fAQContent === true;\n\n // Function to generate the FAQ schema for each accordion item\n const generateFAQSchema = () => {\n return {\n \"@context\": \"https://schema.org\",\n \"@type\": \"FAQPage\",\n mainEntity: props.items?.map((item) => ({\n \"@type\": \"Question\",\n name: item.headline, // Title from the CMS item\n acceptedAnswer: {\n \"@type\": \"Answer\",\n text: item.text, // Answer from the CMS item\n },\n })),\n };\n };\n\n return (\n
\n \n
\n {/** Text */}\n
\n {/** Tagline */}\n {props.tagline ? {props.tagline} : null}\n\n {/** Title */}\n {props.headline ? (\n \n {props.headline}\n \n ) : null}\n\n {/** Text */}\n {props.text ? : null}\n\n {/** Buttons */}\n \n\n {/** Image */}\n {props.image ? (\n \n ) : null}\n
\n\n {/** Accordions */}\n
\n {props.items?.map((item, index) => (\n \n \n \n ))}\n
\n
\n
\n\n {/* Inject FAQ schema markup for all accordions */}\n\n {isFaqContent ? (\n \n \n \n ) : null}\n
\n );\n};\n\nexport default TextAccordions;\n"],"names":["props","_props$items2","positionClassName","position","S","useMemo","positionAccordionLeft","positionAccordionBottom","usePosition","backgroundColorClass","alternativeButtonTheme","hasBackgroundColor","useBackgroundColor","backgroundColor","paddingClass","usePadding","isCompact","isFaqContent","fAQContent","_jsxs","className","cn","wrapper","children","_jsx","DA_Container","noVerticalPadding","inner","textWrapper","tagline","headline","DA_Title","h2","tag","DA_TitleTag","H2","noMargin","fullWidth","text","DA_Text","html","noPadding","Buttons","buttons","theme","image","ImageViewer","src","url","aspectRatioX","width","aspectRatioY","height","items","map","item","index","DA_Accordion","title","showToggleIcons","accordion","Helmet","type","JSON","stringify","generateFAQSchema","_props$items","mainEntity","name","acceptedAnswer"],"sourceRoot":""}