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yCAC1C,gBAAoB,MAAO,CAAEA,UAAW,YAGrC,gBAAoB,WAAgB,KAEnD,CACA,SAASH,EAAM1B,GACX,IAAIiC,EAAcjC,EAAM2B,kBACpBO,GAAQ,UACZ,OAAKD,EAGG,gBAAoB,MAAO,CAAEJ,WAAW,IAAAA,WAAU,sBAAuB,CAAEM,OAAQD,EAAME,YAC7F,gBAAoB,MAAO,CAAEP,UAAW,OAASI,EAAYI,iBAAoB,gBAAoB,WAAgB,KACjH,gBAAoBC,EAAO,CAAEX,kBAAmBM,IAChD,gBAAoBM,EAAS,CAAEZ,kBAAmBM,KAAoB,gBAAoB,WAAgB,KAC1G,gBAAoBM,EAAS,CAAEZ,kBAAmBM,IAClD,gBAAoBK,EAAO,CAAEX,kBAAmBM,OAP7C,IAQf,CACA,IAAIK,EAAQ,SAAUtC,GAClB,OAAQ,gBAAoB,MAAO,CAAE6B,WAAW,IAAAA,WAAU,gCAAiC,CAEnFW,aAAcxC,EAAM2B,kBAAkBU,oBAE1C,gBAAoB,MAAO,CAAEI,OAAQ,MAAOC,MAAO,MAAOb,UAAW,aAAcc,IAAK3C,EAAM2B,kBAAkBjB,MAAOkC,IAAK,cAAeC,QAAS,SAC5J,EACIN,EAAU,SAAUvC,GACpB,OAAQ,gBAAoB,MAAO,CAAE6B,UAAW,gCAC5C,gBAAoB,IAAK,CAAEA,UAAW,SAClC,gBAAoB,IAAK,KAAM7B,EAAM2B,kBAAkBhB,QAC3D,gBAAoB,IAAK,CAAEkB,UAAW,UAAY7B,EAAM2B,kBAAkBmB,iBAC1E,gBAAoB,IAAK,CAAEjB,UAAW,eAAiB7B,EAAM2B,kBAAkBoB,aACvF","sources":["webpack://geposit-base/./src/components/Testimonial.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { useState, useRef } from 'react';\r\nimport { Swiper, SwiperSlide, useSwiper, useSwiperSlide } from 'swiper/react';\r\nimport { className } from '@empori/util';\r\nexport default function TestimonialContent(props) {\r\n var testimonials = props.testimonials;\r\n var _a = useState(0), activeIndex = _a[0], updateIndex = _a[1];\r\n var parentRowDiv = useRef(null);\r\n if (!testimonials) {\r\n return null;\r\n }\r\n var configuredTestimonials = testimonials.filter(function (item) { return item.image && item.quote; });\r\n var breakpoints = {\r\n 0: {\r\n spaceBetween: 20\r\n }\r\n };\r\n return (React.createElement(React.Fragment, null,\r\n React.createElement(Swiper, { spaceBetween: 0, onSlideChange: function (swiper) { return updateIndex(swiper.realIndex); }, breakpoints: breakpoints, loop: configuredTestimonials.length > 1 ? true : false, autoHeight: true },\r\n React.createElement(PrevArrow, { activeIndex: activeIndex, totalSlides: configuredTestimonials.length }),\r\n configuredTestimonials.map(function (item, index) { return (React.createElement(SwiperSlide, { key: \"slide-no-\".concat(index + 1) },\r\n React.createElement(Slide, { singleTestimonial: item }))); }),\r\n React.createElement(NextArrow, { activeIndex: activeIndex, totalSlides: configuredTestimonials.length }))));\r\n}\r\nfunction PrevArrow(props) {\r\n var swiper = useSwiper();\r\n if (props.totalSlides > 1) {\r\n return (React.createElement(\"div\", { className: 'swiper-arrow swiper-prev' },\r\n React.createElement(\"div\", { className: 'arrow', onClick: function () { return swiper.slidePrev(); } },\r\n React.createElement(\"i\", { className: 'fa-solid fa-angle-left empori-icon' })),\r\n React.createElement(\"div\", { className: 'circle' })));\r\n }\r\n else {\r\n return React.createElement(React.Fragment, null);\r\n }\r\n}\r\nfunction NextArrow(props) {\r\n var swiper = useSwiper();\r\n if (props.totalSlides > 1) {\r\n return (React.createElement(\"div\", { className: 'swiper-arrow swiper-next' },\r\n React.createElement(\"div\", { className: 'arrow', onClick: function () { return swiper.slideNext(); } },\r\n React.createElement(\"i\", { className: 'fa-solid fa-angle-right empori-icon' })),\r\n React.createElement(\"div\", { className: 'circle' })));\r\n }\r\n else {\r\n return React.createElement(React.Fragment, null);\r\n }\r\n}\r\nfunction Slide(props) {\r\n var testimonial = props.singleTestimonial;\r\n var slide = useSwiperSlide();\r\n if (!testimonial) {\r\n return null;\r\n }\r\n return (React.createElement(\"div\", { className: className('testimonial-content', { active: slide.isActive }) },\r\n React.createElement(\"div\", { className: 'row' }, testimonial.isImageOnTheLeft ? (React.createElement(React.Fragment, null,\r\n React.createElement(Image, { singleTestimonial: testimonial }),\r\n React.createElement(Content, { singleTestimonial: testimonial }))) : (React.createElement(React.Fragment, null,\r\n React.createElement(Content, { singleTestimonial: testimonial }),\r\n React.createElement(Image, { singleTestimonial: testimonial }))))));\r\n}\r\nvar Image = function (props) {\r\n return (React.createElement(\"div\", { className: className('column column-3 image-wrapper', {\r\n // eslint-disable-next-line camelcase\r\n align_right: !props.singleTestimonial.isImageOnTheLeft\r\n }) },\r\n React.createElement(\"img\", { height: '180', width: '180', className: 'image-logo', src: props.singleTestimonial.image, alt: 'testimonial', loading: 'lazy' })));\r\n};\r\nvar Content = function (props) {\r\n return (React.createElement(\"div\", { className: 'column column-9 text-content' },\r\n React.createElement(\"p\", { className: 'quote' },\r\n React.createElement(\"q\", null, props.singleTestimonial.quote)),\r\n React.createElement(\"p\", { className: 'person' }, props.singleTestimonial.nameOfThePerson),\r\n React.createElement(\"p\", { className: 'designation' }, props.singleTestimonial.designation)));\r\n};\r\n"],"names":["TestimonialContent","props","testimonials","_a","useState","activeIndex","updateIndex","useRef","configuredTestimonials","filter","item","image","quote","spaceBetween","onSlideChange","swiper","realIndex","breakpoints","loop","length","autoHeight","PrevArrow","totalSlides","map","index","key","concat","Slide","singleTestimonial","NextArrow","className","onClick","slidePrev","slideNext","testimonial","slide","active","isActive","isImageOnTheLeft","Image","Content","align_right","height","width","src","alt","loading","nameOfThePerson","designation"],"sourceRoot":""}