@trafilea/afrodita-components 7.26.2 → 7.26.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es/components/collection/product/mobile/ProductItemMobile.js +1 -1
- package/build/es/components/modal/Modal.js +1 -1
- package/build/es/components/review-detail/ReviewDetail.js +1 -1
- package/build/index.d.ts +1 -0
- package/build/lib/components/collection/product/mobile/ProductItemMobile.js +1 -1
- package/build/lib/components/modal/Modal.js +1 -1
- package/build/lib/components/review-detail/ReviewDetail.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsxs as o,jsx as r,Fragment as e}from"@emotion/react/jsx-runtime";import{useMemo as t,useState as s,Fragment as l}from"react";import a from"../../../SkeletonBox/SkeletonBox.js";import{ClubPriceMemberLabel as n}from"../../../atoms/ClubPriceMemberLabel/ClubPriceMemberLabel.js";import"../../../atoms/HorizontalDivider/HorizontalDivider.js";import"../../../atoms/Icon/Icon.js";import{Image as d}from"../../../atoms/Image/Image.js";import"../../../atoms/PriceLabel/PriceLabel.js";import"../../../atoms/PriceLabelV2/PriceLabelV2.js";import"react/jsx-runtime";import"../../../atoms/Toggle/toggle.styled.js";import{BuyNowPayLater as c}from"../../../buynowpaylater/BuyNowPayLater.js";import{ClubPriceLabel as m}from"../../../club-price-label/ClubPriceLabel.js";import{Spacing as p}from"../../../shared/spacing/Spacing.js";import{StrengthBars as u}from"../../../strength-bars/StrengthBars.js";import{useTheme as v}from"../../../../core/theme/Theme.js";import{useWindowDimensions as g}from"../../../../hooks/WindowDimensions.js";import"../../../../utils/constants/offerAtCart.js";import{getSrcSet as j}from"../../../../utils/getSrcSet/getSrcSet.js";import"../../../../utils/media.js";import"../../../../utils/mock-content/CancellationFlowAccordion.js";import{ComponentSize as f}from"../../../../types/enums.js";import"../../../PackSelectorV2/PackSelectoV2.js";import"../../../absorbency-level/AbsorbencyLevel.js";import"../../../accordion-options/AccordionOptions.js";import"../../../accordion/Accordion.js";import"../../../dropdown/variants/simple/SimpleDropdown.js";import{Icon as h}from"../../../icons/index.js";import"../../../radio/input/styles.js";import"../../../tooltip/Tooltip.js";import"../../../autoship/styled.js";import"../../../autoshipV2/styled.js";import"../../../before-after/BeforeAfter.js";import"../../../pricing/clubOffer/ClubOfferTag.js";import{DiscountTag as b}from"../../../pricing/discount/DiscountTag.js";import{PriceLabel as y}from"../../../pricing/price/PriceLabel.js";import{PriceLabelV2 as P}from"../../../pricing/priceLabelV2/PriceLabelV2.js";import"../../../pricing/priceLabelV3/PriceLabelV3.js";import"../../../pricing/priceLabelV5/PriceLabelV5.styled.js";import{PriceLabelV6 as C}from"../../../pricing/priceLabelV6/PriceLabelV6.js";import{PriceLabelWithCredits as S}from"../../../pricing/priceLabelWithCredits/PriceLabelWithCredits.js";import"../../../shared/card/Card.js";import"../../../bundle/minimalistic/styled.js";import"../../../text/Text.js";import"../../../bundle/motivator/styled.js";import"../../../bundle/simple/Simple.js";import"../../../offer-banner/OfferBanner.js";import"../../../cartProductItem/CloseIcon/CloseButton.js";import"../../../cartProductItem/Description/Description.js";import"../../../cartProductItem/Promo/Promo.js";import"../../../cartProductItem/Title/Title.js";import"../../../cartProductItem/TrashIcon/styled.js";import"../../../checkbox/Checkbox.js";import"../../grid/WithProductGrid.js";import{PriceLabelV4 as L}from"../../../pricing/priceLabelV4/PriceLabelV4.js";import{Rating as w}from"../../../rating/Rating.js";import{STYLES_BY_THEME as A}from"./constants.js";import{getStylesBySize as z,ProdCardContainer as x,CornerContainer as T,Container as k,ImageContainer as I,TopTagContainer as B,BottomTagContainer as V,ImageHoverContainer as D,Title as O,Divider as M,MarginTopContainer as R,OneLineInfoWrapper as N,ClubOfferPriceLabelWrapper as F,InlineContainer as W}from"./styled.js";import{TagContainer as G}from"../../../pricing/styles.js";import{IconButton as H}from"../../../icon-button/IconButton.js";import"../../../tag/variants/product/styled.js";import"../truekind/styled.js";import"../../../color/ColorRadioGroup.js";import"../../../color/selector/PatternSelector.js";import"../../../color/styles/ColorPickerwithTootip.styled.js";import"../../../cross-sell/Checkbox/CrossSellCheckbox.js";import"../../../cta/styled.js";import"../../../delivery-details/DeliveryDetails.js";import"../../../delivery-details/Note/Note.js";import"../../../drawer/style.js";import"../../../dropdown-list-icons/Styled.js";import"../../../dropdown/size-dropdown/Styled.js";import"../../../dropdown/variants/dialog/DropdownDialog.js";import"../../../dropdown/base/BaseDropdown.js";import"@headlessui/react";import"../../../input/base/Error.js";import"../../../shared/select/BaseSelect.js";import"../../../dropdown/variants/smart/styled.js";import"../../../filtering/Accordion.js";import"../../../filtering/FiltersStyled.js";import"../../../filtering/Tags/Tags.js";import"../../../fit-guarantee/FitGuarantee.js";import"../../../fit/FitPredictor.js";import"@ant-design/react-slick";import"react-zoom-pan-pinch";import"../../../modal/Modal.js";import"../../../organisms/ModalZoom/zoomModal.styled.js";import"../../../organisms/ModalZoom/ZoomModalV2.styled.js";import"../../../molecules/Video/components/styled.js";import"../../../molecules/Video/styled.js";import"../../../slider/ArrowButton.js";import"../../../slider/StyledSlider.js";import"../../../gallery/components/ImageSmallPreview/styled.js";import"../../../gallery/components/ImagePreviewList/styled.js";import"../../../gallery/components/ImageProductSlide/styled.js";import"../../../gallery/styled.js";import"../../../icon-button/amazonAndPaypal/AmazonPaypalButtons.js";import"../../../iconsWithTitle/index.js";import"../../../image-card/ImageCard.js";import"../../../input/label/Label.js";import"../../../input/base/Styled.js";import"../../../input/custom/Custom.js";import"../../../input/basePlusButton/BasePlusButton.js";import"../../../input/basePlusIcon/BasePlusIcon.js";import"../../../motivator-progress-bar/MotivatorProgressBar.js";import"../../../order-bar/OrderBar.js";import"../../../packs/selector/PackSelector.js";import"../../../pagination/styles.js";import"../../../payment-methods/PaymentMethod.js";import"../../../product/order/item/SimpleOrderItem.js";import"../../../progress-bar/ProgressBar.js";import"../../../quantityPicker/styled.js";import"../../../radio/RadioPrimary/radioPrimary.js";import"../../../radio/clubRadioInput/clubRadio.js";import"../../../rating/starList/StarList.js";import"../../../review-detail/ReviewDetail.js";import"../../../review/Review.js";import"../../../reviews-header/ReviewsHeader.js";import"../../../scroll-to-top/ScrollToTop.js";import"../../../search-bar/components/ClearButton/styled.js";import"../../../search-bar/components/Footer/styled.js";import"../../../search-bar/components/ProductItem/styled.js";import"../../../search-bar/components/ResultsPanel/styled.js";import"../../../search-bar/components/SearchControl/styled.js";import"../../../search-bar/styled.js";import"../../../search-navigation/styled.js";import"react-dom";import"../../../short-banner/ShortBanner.js";import"../../../size-chart/styled.js";import"../../../size-table/SizeTable.js";import"../../../size/guide/SizeFitGuide.js";import"../../../size/selector/styled.js";import"../../../tabs/Tab.js";import"../../../tabs/Tabs.js";import"../../../tag/Tag.js";import"@emotion/react";import"../../../textWithImage/index.js";import"../../../timer/styled.js";import"../../../toast/Toast.js";import"../../../totals/total/styled.js";import"../../../totals/subtotal/Subtotal.js";import"../../../tracking-progress-v2/TrackingProgressV2.js";import"../../../tracking-progress/TrackingProgress.js";import"../../../organisms/AutoshipOfferCard/AutoshipOfferCardItem.styled.js";import"../../../organisms/AutoshipOfferCardCta/AutoshipOfferCardItem.styled.js";import"../../../organisms/AutoshipPdpCard/AutoshipPdpCard.styled.js";import"../../../organisms/BasicAccordion/BasicAccordion.js";import"../../../organisms/CartItemCard/CartItem.js";import"../../../organisms/ClubOfferSelector/styled.js";import"../../../organisms/ClubOfferSelector2/styled.js";import"../../../organisms/JoinClubCard/joinClubCard.js";import"../../../organisms/OfferAtCart/styled.js";import"../../../organisms/OfferAtCartV2/styled.js";import"../../../organisms/OfferAtCartV3/styled.js";import"../../../organisms/OfferAtCartV4/styled.js";import"../../../organisms/OfferAtPDP/styled.js";import"../../../organisms/OfferAtPDP/types.js";import"../../../organisms/ProductCard/ProductCardV1/ProductCard.js";import"../../../organisms/ProductCard/ProductCardV2/styled.js";import"../../../organisms/ProductCard/ProductCardV3/styled.js";import"../../../organisms/ProductGalleryMobile/ProductGalleryMobileV1/ProductGalleryMobile.js";import"../../../organisms/SizeCharTable/SizeChartTableV2/styled.js";import"../../../organisms/SizeCharTable/SizeChartTableV3/styled.js";import"../../../molecules/ArrowTip/ArrowTip.styled.js";import"../../../organisms/SizeCharTable/SizeChartTableV4/SizeChartTableV4.styled.js";import"../../../organisms/SubscriptionPlanSelector/styled.js";import"../../../organisms/TwoCtasAtCart/Greeting.styled.js";import"../../../organisms/TwoCtasAtCart/Card.styled.js";import"../../../timerV2/styled.js";import"../../../molecules/OfferAtCartBenefits/OfferAtCartBenefits.styled.js";import"../../../molecules/OfferAtCartImage/OfferAtCartImage.styled.js";import"../../../molecules/CouponCard/styled.js";import"../../../molecules/BenefitsList/styled.js";import"../../../molecules/HurryUp/styled.js";import"../../../molecules/Spinner/styled.js";import"../../../molecules/IconsWithTitleList/IconsWithTitleList.styled.js";import{LikeButton as q}from"../../../molecules/LikeButton/LikeButton.js";import"../../../molecules/ScarcityTag/ScarcityTag.styled.js";var E=function(E){var Z,K,_,J,Q,U,X,Y,$,ii,oi,ri=E.title,ei=E.image,ti=E.imageHover,si=E.price,li=E.rating,ai=E.hideRating,ni=void 0!==ai&&ai,di=E.size,ci=E.alignName,mi=void 0===ci?"center":ci,pi=E.url,ui=E.className,vi=E.topTag,gi=E.bottomTag,ji=E.onClick,fi=E.priceDisplayType,hi=void 0===fi?"default":fi,bi=E.priceAtBottom,yi=E.ratingOnTop,Pi=E.priceLoading,Ci=E.noFollow,Si=void 0!==Ci&&Ci,Li=E.colorPicker,wi=void 0===Li?{display:!1,position:"top",component:void 0,componentContainerProps:{position:"absolute",top:"4px",right:"4px",padding:"0px",boxSizing:"border-box",zIndex:1}}:Li,Ai=E.isBNPL,zi=void 0===Ai?{displayBNPL:!1,installments:4,installmentPrice:"",iconFolder:"PDP",iconName:"Klarna",showLogo:!0,iconColor:"#292929",fontSize:"12px"}:Ai,xi=E.hasStrength,Ti=void 0===xi?{strength:-1,description:""}:xi,ki=E.clubPrice,Ii=void 0===ki?"":ki,Bi=E.showClubPriceLabel,Vi=void 0!==Bi&&Bi,Di=E.isRatingLoading,Oi=E.version,Mi=void 0===Oi?1:Oi,Ri=E.showDiscountPercentageTag,Ni=void 0!==Ri&&Ri,Fi=E.discountTagLoading,Wi=E.discountTag,Gi=E.isOnViewport,Hi=void 0!==Gi&&Gi,qi=E.hasDefaultSize,Ei=void 0!==qi&&qi,Zi=E.clubOffer,Ki=E.likeBtn,_i=E.onClickBottomButton,Ji=E.showDecimals,Qi=void 0===Ji||Ji,Ui=E.showDivider,Xi=void 0!==Ui&&Ui,Yi=E.invertPriceDirection,$i=void 0!==Yi&&Yi,io=E.priceAndReviewInOneLine,oo=void 0!==io&&io,ro=E.priceAndDiscountTagInOneLine,eo=void 0!==ro&&ro,to=E.tooltipText,so=E.tooltipIcon,lo=E.tooltipPosition,ao=E.credits,no=E.creditsLabel,co=E.creditsBadge,mo=E.originalPricePrefix,po=E.finalPriceAriaLabel,uo=E.originalPriceAriaLabel,vo=E.discountAriaLabel,go=E.tooltipAriaLabel,jo=E.quickViewAriaLabel,fo=E.sellingFastAriaLabel,ho=E.quickViewAriaHidden,bo=E.sellingFastAriaHidden,yo=E.sellingFast,Po=v(),Co=z(di),So=g().isMobile,Lo=t((function(){var i;return(i={},i[f.Large]=8,i[f.Medium]=4,i[f.Small]=2,i)[di]}),[di]),wo=Ni?Wi:void 0,Ao=function(o){var e,t,s,l,a,d;if(void 0===o&&(o=Mi),"hidden"===hi)return null;if("credits"===hi)return r(S,{finalPrice:si.finalPrice,originalPrice:si.originalPrice,color:si.color,credits:ao,creditsLabel:no,creditsBadge:co,originalPricePrefix:mo,tooltipText:to,tooltipIcon:so,tooltipPosition:lo,tooltipAriaLabel:go,testId:"price-with-credits",finalPriceAriaLabel:po,originalPriceAriaLabel:uo},void 0);switch(o){case 4:return r(L,"styled"===hi?{finalPrice:si.finalPrice,originalPrice:si.originalPrice,finalPriceStyled:!1,color:si.color,size:f.Medium,testId:"volume-discount-v4",clubStyle:Vi,clubPrice:Ii,styledPrice:!0,finalPriceAriaLabel:po,originalPriceAriaLabel:uo,discountAriaLabel:vo,finalPriceStyle:Vi?So?{fontSize:"12px",fontWeight:700,color:null===(t=Po.colors.pallete.brickRed)||void 0===t?void 0:t.color}:{fontSize:"16px",fontWeight:700,color:null===(e=Po.colors.pallete.brickRed)||void 0===e?void 0:e.color}:void 0}:{finalPrice:si.finalPrice,originalPrice:si.originalPrice,finalPriceStyled:!1,color:si.color,size:f.Medium,testId:"volume-discount-v4",clubStyle:Vi,clubPrice:Ii,finalPriceAriaLabel:po,originalPriceAriaLabel:uo,discountAriaLabel:vo,finalPriceStyle:Vi?So?{fontSize:"12px",fontWeight:700,color:null===(l=Po.colors.pallete.brickRed)||void 0===l?void 0:l.color}:{fontSize:"16px",fontWeight:700,color:null===(s=Po.colors.pallete.brickRed)||void 0===s?void 0:s.color}:void 0},void 0);case 5:return r(F,i({style:null==Zi?void 0:Zi.wrapperStyle},{children:r(n,{isClub:!0,isPDP:!0,finalPrice:null===(a=null==Zi?void 0:Zi.price)||void 0===a?void 0:a.finalPrice,originalPrice:null===(d=null==Zi?void 0:Zi.price)||void 0===d?void 0:d.originalPrice,finalPriceStyled:!1,color:si.color,size:f.Medium,testId:"volume-discount-v4",clubStyle:Vi,icon:null==Zi?void 0:Zi.clubOfferIcon,isCollections:null==Zi?void 0:Zi.isCollections},void 0)}),void 0);case 6:return r(C,{finalPrice:si.finalPrice,originalPrice:si.originalPrice,color:si.color,size:f.Medium,testId:"volume-discount-v6",showDecimals:Qi,tooltipText:to,tooltipIcon:so,tooltipPosition:lo,tooltipAriaLabel:go,isMobile:So,savingsDisplay:Ni,discount:wo,finalPriceAriaLabel:po,originalPriceAriaLabel:uo,discountAriaLabel:vo},void 0);default:return"styled"===hi?r(P,{finalPrice:si.finalPrice,originalPrice:si.originalPrice,finalPriceStyled:!1,color:si.color,size:f.Large,testId:"volume-discount",showDecimals:Qi,finalPriceAriaLabel:po,originalPriceAriaLabel:uo,discountAriaLabel:vo,tooltipAriaLabel:go},void 0):r(y,{invertDirection:$i,finalPrice:si.finalPrice,originalPrice:si.originalPrice,finalPriceStyled:!1,color:si.color,size:f.Medium,testId:"volume-discount",clubStyle:Vi,finalPriceAriaLabel:po,originalPriceAriaLabel:uo,discountAriaLabel:vo,finalPriceStyle:Vi?So?{fontSize:"12px",fontWeight:700}:{fontSize:"16px",fontWeight:700}:void 0},void 0)}},zo=function(){return ni||!li.reviews&&!li.rating?r(e,{},void 0):Di?r(a,{height:"20px",width:"80px"},void 0):r(w,{size:di===f.Large?f.Small:f.XSmall,rating:li.rating,reviews:null==li?void 0:li.reviews,reviewsText:"",wrapWithParenthesis:!0},void 0)},xo=s(null!==(Z=null==Ki?void 0:Ki.isLiked)&&void 0!==Z&&Z),To=xo[0],ko=xo[1],Io=s(null!==(K=null==Ki?void 0:Ki.likes)&&void 0!==K?K:0),Bo=Io[0],Vo=Io[1],Do=eo?W:l;return o(x,i({className:ui,"data-testid":"product-card-container-div"},{children:["corner"===wi.position&&r(T,i({},wi.componentContainerProps,{children:wi.component}),void 0),o(k,i({as:pi?"a":"div",href:pi,rel:Si?"nofollow":"",className:"picContainer",onClick:ji},{children:[!!Ki&&r(q,{isLiked:To,likes:Bo,onClick:function(i){i.stopPropagation(),Vo(To?function(i){return i-1}:function(i){return i+1}),ko((function(i){return!i})),null==Ki||Ki.onClick(i)},colors:{background:{active:null!==(Q=null===(J=null===(_=Ki.colors)||void 0===_?void 0:_.background)||void 0===J?void 0:J.active)&&void 0!==Q?Q:Po.colors.shades.white.color,hover:null!==(oi=null!==(Y=null===(X=null===(U=Ki.colors)||void 0===U?void 0:U.background)||void 0===X?void 0:X.hover)&&void 0!==Y?Y:null===(ii=null===($=Ki.colors)||void 0===$?void 0:$.background)||void 0===ii?void 0:ii.active)&&void 0!==oi?oi:Po.colors.shades.white.color}}},void 0),vi||gi?o(I,i({width:null==Co?void 0:Co.width,height:null==Co?void 0:Co.height,"data-testid":"tags-image-container"},{children:[r(d,{src:ei.src,srcSet:j(ei.src,180,360,720,960),alt:ei.alt,width:Ei?null==Co?void 0:Co.width:"100%",height:Ei?null==Co?void 0:Co.height:"100%",loading:Hi?"eager":"lazy",decoding:Hi?"sync":"async",borderRadius:A[Po.name].image.borderRadius},void 0),r(B,i({style:{width:wi.display?"100%":"inherit"}},{children:vi}),void 0),r(V,i({style:{width:wi.display?"100%":"inherit"}},{children:gi}),void 0)]}),void 0):r(d,{src:ei.src,srcSet:j(ei.src,180,360,720,960),alt:ei.alt,width:null==Co?void 0:Co.width,height:null==Co?void 0:Co.height,loading:Hi?"eager":"lazy",decoding:Hi?"sync":"async",borderRadius:A[Po.name].image.borderRadius},void 0),ti?r(D,{className:"hover__image",src:ti.src,srcSet:j(ti.src,180,360,720,960),loading:"lazy",decoding:"async",alt:ti.alt,width:null==Co?void 0:Co.width,height:null==Co?void 0:Co.height},void 0):null]}),void 0),wi.display&&"top"===wi.position&&o(e,{children:[r(p,{size:Lo},void 0),wi.component]},void 0),yi&&o(e,{children:[r(p,{size:Lo},void 0),r(p,{size:Lo},void 0),r(zo,{},void 0)]},void 0),o(k,i({as:pi?"a":"div",href:pi,rel:Si?"nofollow":"",onClick:ji,className:"textContainer",style:{alignItems:Vi?"flex-start":"center"}},{children:[r(p,{size:Lo},void 0),r(O,i({theme:Po,align:Vi?"left":mi,"data-testid":"product-card-title"},{children:ri}),void 0),r(p,{size:Lo},void 0),Xi&&o(e,{children:[r(M,{theme:Po},void 0),r(p,{size:Lo},void 0)]},void 0),Ti&&-1!==Ti.strength&&o(e,{children:[r(u,{barsFilled:Ti.strength,supportText:Ti.description},void 0),r(p,{size:10},void 0)]},void 0),o(e,bi&&!yi?{children:[r(zo,{},void 0),r(p,{size:Lo},void 0),o(R,i({style:{marginTop:(null==Zi?void 0:Zi.isClubOffer)?0:8}},{children:[Pi?r(a,{height:"20px",width:"140px"},void 0):Ao(),(null==Zi?void 0:Zi.isClubOffer)&&Ao(5)]}),void 0)]}:{children:[o(Do,{children:[Pi?r(a,{height:"20px",width:"140px"},void 0):oo&&!yi?o(N,{children:[Ao(),r(zo,{},void 0)]},void 0):o(e,{children:[!(null==Zi?void 0:Zi.isClubMember)&&Ao(),(null==Zi?void 0:Zi.isClubOffer)&&Ao(5),r(c,{displayBNPL:null==zi?void 0:zi.displayBNPL,installments:(null==zi?void 0:zi.installments)||0,installmentPrice:(null==zi?void 0:zi.installmentPrice)||"",iconFolder:null==zi?void 0:zi.iconFolder,iconName:(null==zi?void 0:zi.iconName)||"",showLogo:null==zi?void 0:zi.showLogo,iconColor:null==zi?void 0:zi.iconColor,fontSize:null==zi?void 0:zi.fontSize},void 0)]},void 0),Vi&&r(m,{clubPrice:Ii},void 0),6!==Mi&&(Fi?r(a,{height:"22px",width:"75px"},void 0):Ni&&r(G,i({size:f.Small},{children:Wi&&r(b,i({},Wi,{size:f.Medium,style:{letterSpacing:"-0.05rem"}}),void 0)}),void 0)),yo&&r(d,{src:"https://cdn.shopify.com/s/files/1/2679/8624/files/selling-fast-copy.png?v=1712665121",alt:fo||bo?null!=fo?fo:"":"selling-fast-copy","aria-hidden":!(!bo||fo)||void 0,width:"77px",height:"22px"},void 0)]},void 0),r(p,{size:Lo},void 0),!yi&&!oo&&r(zo,{},void 0)]},void 0),!!_i&&o(e,{children:[r(p,{size:Lo},void 0),r(p,{size:Lo},void 0),o(H,i({size:f.Small,width:"100%",onClick:function(i){i.preventDefault(),i.stopPropagation(),null==_i||_i(i)},onKeyDown:function(i){"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),i.stopPropagation(),null==_i||_i(i))},backgroundColor:{active:"transparent",hover:"transparent"},hasText:!0,rounded:!1,border:"1px solid #D1D1D1",role:"button",tabIndex:ho&&!jo?-1:0,"aria-label":jo,"aria-hidden":!(!ho||jo)||void 0},{children:[r(h.Custom.Eye,{fill:"black",width:"16px",height:"16px"},void 0),r("span",i({style:{color:"black",fontSize:"14px"}},{children:"Quick View"}),void 0)]}),void 0)]},void 0)]}),void 0),wi.display&&"bottom"===wi.position&&o(e,{children:[r(p,{size:Lo},void 0),wi.component]},void 0)]}),void 0)};export{E as default};
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as o,jsx as r,Fragment as e}from"@emotion/react/jsx-runtime";import{useMemo as t,useState as s,Fragment as l}from"react";import a from"../../../SkeletonBox/SkeletonBox.js";import{ClubPriceMemberLabel as n}from"../../../atoms/ClubPriceMemberLabel/ClubPriceMemberLabel.js";import"../../../atoms/HorizontalDivider/HorizontalDivider.js";import"../../../atoms/Icon/Icon.js";import{Image as d}from"../../../atoms/Image/Image.js";import"../../../atoms/PriceLabel/PriceLabel.js";import"../../../atoms/PriceLabelV2/PriceLabelV2.js";import"react/jsx-runtime";import"../../../atoms/Toggle/toggle.styled.js";import{BuyNowPayLater as c}from"../../../buynowpaylater/BuyNowPayLater.js";import{ClubPriceLabel as m}from"../../../club-price-label/ClubPriceLabel.js";import{Spacing as p}from"../../../shared/spacing/Spacing.js";import{StrengthBars as u}from"../../../strength-bars/StrengthBars.js";import{useTheme as v}from"../../../../core/theme/Theme.js";import{useWindowDimensions as g}from"../../../../hooks/WindowDimensions.js";import"../../../../utils/constants/offerAtCart.js";import{getSrcSet as j}from"../../../../utils/getSrcSet/getSrcSet.js";import"../../../../utils/media.js";import"../../../../utils/mock-content/CancellationFlowAccordion.js";import{ComponentSize as f}from"../../../../types/enums.js";import"../../../PackSelectorV2/PackSelectoV2.js";import"../../../absorbency-level/AbsorbencyLevel.js";import"../../../accordion-options/AccordionOptions.js";import"../../../accordion/Accordion.js";import"../../../dropdown/variants/simple/SimpleDropdown.js";import{Icon as h}from"../../../icons/index.js";import"../../../radio/input/styles.js";import"../../../tooltip/Tooltip.js";import"../../../autoship/styled.js";import"../../../autoshipV2/styled.js";import"../../../before-after/BeforeAfter.js";import"../../../pricing/clubOffer/ClubOfferTag.js";import{DiscountTag as b}from"../../../pricing/discount/DiscountTag.js";import{PriceLabel as y}from"../../../pricing/price/PriceLabel.js";import{PriceLabelV2 as P}from"../../../pricing/priceLabelV2/PriceLabelV2.js";import"../../../pricing/priceLabelV3/PriceLabelV3.js";import"../../../pricing/priceLabelV5/PriceLabelV5.styled.js";import{PriceLabelV6 as C}from"../../../pricing/priceLabelV6/PriceLabelV6.js";import{PriceLabelWithCredits as S}from"../../../pricing/priceLabelWithCredits/PriceLabelWithCredits.js";import"../../../shared/card/Card.js";import"../../../bundle/minimalistic/styled.js";import"../../../text/Text.js";import"../../../bundle/motivator/styled.js";import"../../../bundle/simple/Simple.js";import"../../../offer-banner/OfferBanner.js";import"../../../cartProductItem/CloseIcon/CloseButton.js";import"../../../cartProductItem/Description/Description.js";import"../../../cartProductItem/Promo/Promo.js";import"../../../cartProductItem/Title/Title.js";import"../../../cartProductItem/TrashIcon/styled.js";import"../../../checkbox/Checkbox.js";import"../../grid/WithProductGrid.js";import{PriceLabelV4 as L}from"../../../pricing/priceLabelV4/PriceLabelV4.js";import{Rating as w}from"../../../rating/Rating.js";import{STYLES_BY_THEME as A}from"./constants.js";import{getStylesBySize as z,ProdCardContainer as x,CornerContainer as T,Container as k,ImageContainer as I,TopTagContainer as B,BottomTagContainer as V,ImageHoverContainer as D,Title as O,Divider as M,MarginTopContainer as R,OneLineInfoWrapper as N,ClubOfferPriceLabelWrapper as F,InlineContainer as W}from"./styled.js";import{TagContainer as G}from"../../../pricing/styles.js";import{IconButton as H}from"../../../icon-button/IconButton.js";import"../../../tag/variants/product/styled.js";import"../truekind/styled.js";import"../../../color/ColorRadioGroup.js";import"../../../color/selector/PatternSelector.js";import"../../../color/styles/ColorPickerwithTootip.styled.js";import"../../../cross-sell/Checkbox/CrossSellCheckbox.js";import"../../../cta/styled.js";import"../../../delivery-details/DeliveryDetails.js";import"../../../delivery-details/Note/Note.js";import"../../../drawer/style.js";import"../../../dropdown-list-icons/Styled.js";import"../../../dropdown/size-dropdown/Styled.js";import"../../../dropdown/variants/dialog/DropdownDialog.js";import"../../../dropdown/base/BaseDropdown.js";import"@headlessui/react";import"../../../input/base/Error.js";import"../../../shared/select/BaseSelect.js";import"../../../dropdown/variants/smart/styled.js";import"../../../filtering/Accordion.js";import"../../../filtering/FiltersStyled.js";import"../../../filtering/Tags/Tags.js";import"../../../fit-guarantee/FitGuarantee.js";import"../../../fit/FitPredictor.js";import"@ant-design/react-slick";import"react-zoom-pan-pinch";import"../../../modal/Modal.js";import"../../../organisms/ModalZoom/zoomModal.styled.js";import"../../../organisms/ModalZoom/ZoomModalV2.styled.js";import"../../../molecules/Video/components/styled.js";import"../../../molecules/Video/styled.js";import"../../../slider/ArrowButton.js";import"../../../slider/StyledSlider.js";import"../../../gallery/components/ImageSmallPreview/styled.js";import"../../../gallery/components/ImagePreviewList/styled.js";import"../../../gallery/components/ImageProductSlide/styled.js";import"../../../gallery/styled.js";import"../../../icon-button/amazonAndPaypal/AmazonPaypalButtons.js";import"../../../iconsWithTitle/index.js";import"../../../image-card/ImageCard.js";import"../../../input/label/Label.js";import"../../../input/base/Styled.js";import"../../../input/custom/Custom.js";import"../../../input/basePlusButton/BasePlusButton.js";import"../../../input/basePlusIcon/BasePlusIcon.js";import"../../../motivator-progress-bar/MotivatorProgressBar.js";import"../../../order-bar/OrderBar.js";import"../../../packs/selector/PackSelector.js";import"../../../pagination/styles.js";import"../../../payment-methods/PaymentMethod.js";import"../../../product/order/item/SimpleOrderItem.js";import"../../../progress-bar/ProgressBar.js";import"../../../quantityPicker/styled.js";import"../../../radio/RadioPrimary/radioPrimary.js";import"../../../radio/clubRadioInput/clubRadio.js";import"../../../rating/starList/StarList.js";import"../../../review-detail/ReviewDetail.js";import"../../../review/Review.js";import"../../../reviews-header/ReviewsHeader.js";import"../../../scroll-to-top/ScrollToTop.js";import"../../../search-bar/components/ClearButton/styled.js";import"../../../search-bar/components/Footer/styled.js";import"../../../search-bar/components/ProductItem/styled.js";import"../../../search-bar/components/ResultsPanel/styled.js";import"../../../search-bar/components/SearchControl/styled.js";import"../../../search-bar/styled.js";import"../../../search-navigation/styled.js";import"react-dom";import"../../../short-banner/ShortBanner.js";import"../../../size-chart/styled.js";import"../../../size-table/SizeTable.js";import"../../../size/guide/SizeFitGuide.js";import"../../../size/selector/styled.js";import"../../../tabs/Tab.js";import"../../../tabs/Tabs.js";import"../../../tag/Tag.js";import"@emotion/react";import"../../../textWithImage/index.js";import"../../../timer/styled.js";import"../../../toast/Toast.js";import"../../../totals/total/styled.js";import"../../../totals/subtotal/Subtotal.js";import"../../../tracking-progress-v2/TrackingProgressV2.js";import"../../../tracking-progress/TrackingProgress.js";import"../../../organisms/AutoshipOfferCard/AutoshipOfferCardItem.styled.js";import"../../../organisms/AutoshipOfferCardCta/AutoshipOfferCardItem.styled.js";import"../../../organisms/AutoshipPdpCard/AutoshipPdpCard.styled.js";import"../../../organisms/BasicAccordion/BasicAccordion.js";import"../../../organisms/CartItemCard/CartItem.js";import"../../../organisms/ClubOfferSelector/styled.js";import"../../../organisms/ClubOfferSelector2/styled.js";import"../../../organisms/JoinClubCard/joinClubCard.js";import"../../../organisms/OfferAtCart/styled.js";import"../../../organisms/OfferAtCartV2/styled.js";import"../../../organisms/OfferAtCartV3/styled.js";import"../../../organisms/OfferAtCartV4/styled.js";import"../../../organisms/OfferAtPDP/styled.js";import"../../../organisms/OfferAtPDP/types.js";import"../../../organisms/ProductCard/ProductCardV1/ProductCard.js";import"../../../organisms/ProductCard/ProductCardV2/styled.js";import"../../../organisms/ProductCard/ProductCardV3/styled.js";import"../../../organisms/ProductGalleryMobile/ProductGalleryMobileV1/ProductGalleryMobile.js";import"../../../organisms/SizeCharTable/SizeChartTableV2/styled.js";import"../../../organisms/SizeCharTable/SizeChartTableV3/styled.js";import"../../../molecules/ArrowTip/ArrowTip.styled.js";import"../../../organisms/SizeCharTable/SizeChartTableV4/SizeChartTableV4.styled.js";import"../../../organisms/SubscriptionPlanSelector/styled.js";import"../../../organisms/TwoCtasAtCart/Greeting.styled.js";import"../../../organisms/TwoCtasAtCart/Card.styled.js";import"../../../timerV2/styled.js";import"../../../molecules/OfferAtCartBenefits/OfferAtCartBenefits.styled.js";import"../../../molecules/OfferAtCartImage/OfferAtCartImage.styled.js";import"../../../molecules/CouponCard/styled.js";import"../../../molecules/BenefitsList/styled.js";import"../../../molecules/HurryUp/styled.js";import"../../../molecules/Spinner/styled.js";import"../../../molecules/IconsWithTitleList/IconsWithTitleList.styled.js";import{LikeButton as q}from"../../../molecules/LikeButton/LikeButton.js";import"../../../molecules/ScarcityTag/ScarcityTag.styled.js";var E=function(E){var Z,K,_,J,Q,U,X,Y,$,ii,oi,ri=E.title,ei=E.image,ti=E.imageHover,si=E.price,li=E.rating,ai=E.hideRating,ni=void 0!==ai&&ai,di=E.size,ci=E.alignName,mi=void 0===ci?"center":ci,pi=E.url,ui=E.className,vi=E.topTag,gi=E.bottomTag,ji=E.onClick,fi=E.priceDisplayType,hi=void 0===fi?"default":fi,bi=E.priceAtBottom,yi=E.ratingOnTop,Pi=E.priceLoading,Ci=E.noFollow,Si=void 0!==Ci&&Ci,Li=E.colorPicker,wi=void 0===Li?{display:!1,position:"top",component:void 0,componentContainerProps:{position:"absolute",top:"4px",right:"4px",padding:"0px",boxSizing:"border-box",zIndex:1}}:Li,Ai=E.isBNPL,zi=void 0===Ai?{displayBNPL:!1,installments:4,installmentPrice:"",iconFolder:"PDP",iconName:"Klarna",showLogo:!0,iconColor:"#292929",fontSize:"12px"}:Ai,xi=E.hasStrength,Ti=void 0===xi?{strength:-1,description:""}:xi,ki=E.clubPrice,Ii=void 0===ki?"":ki,Bi=E.showClubPriceLabel,Vi=void 0!==Bi&&Bi,Di=E.isRatingLoading,Oi=E.version,Mi=void 0===Oi?1:Oi,Ri=E.showDiscountPercentageTag,Ni=void 0!==Ri&&Ri,Fi=E.discountTagLoading,Wi=E.discountTag,Gi=E.isOnViewport,Hi=void 0!==Gi&&Gi,qi=E.hasDefaultSize,Ei=void 0!==qi&&qi,Zi=E.clubOffer,Ki=E.likeBtn,_i=E.onClickBottomButton,Ji=E.showDecimals,Qi=void 0===Ji||Ji,Ui=E.showDivider,Xi=void 0!==Ui&&Ui,Yi=E.invertPriceDirection,$i=void 0!==Yi&&Yi,io=E.priceAndReviewInOneLine,oo=void 0!==io&&io,ro=E.priceAndDiscountTagInOneLine,eo=void 0!==ro&&ro,to=E.tooltipText,so=E.tooltipIcon,lo=E.tooltipPosition,ao=E.credits,no=E.creditsLabel,co=E.creditsBadge,mo=E.originalPricePrefix,po=E.finalPriceAriaLabel,uo=E.originalPriceAriaLabel,vo=E.discountAriaLabel,go=E.tooltipAriaLabel,jo=E.quickViewAriaLabel,fo=E.sellingFastAriaLabel,ho=E.quickViewAriaHidden,bo=E.sellingFastAriaHidden,yo=E.sellingFast,Po=E.infoLabel,Co=v(),So=z(di),Lo=g().isMobile,wo=t((function(){var i;return(i={},i[f.Large]=8,i[f.Medium]=4,i[f.Small]=2,i)[di]}),[di]),Ao=Ni?Wi:void 0,zo=function(o){var e,t,s,l,a,d;if(void 0===o&&(o=Mi),"hidden"===hi)return null;if("credits"===hi)return r(S,{finalPrice:si.finalPrice,originalPrice:si.originalPrice,color:si.color,credits:ao,creditsLabel:no,creditsBadge:co,originalPricePrefix:mo,tooltipText:to,tooltipIcon:so,tooltipPosition:lo,tooltipAriaLabel:go,testId:"price-with-credits",finalPriceAriaLabel:po,originalPriceAriaLabel:uo},void 0);switch(o){case 4:return r(L,"styled"===hi?{finalPrice:si.finalPrice,originalPrice:si.originalPrice,finalPriceStyled:!1,color:si.color,size:f.Medium,testId:"volume-discount-v4",clubStyle:Vi,clubPrice:Ii,styledPrice:!0,finalPriceAriaLabel:po,originalPriceAriaLabel:uo,discountAriaLabel:vo,finalPriceStyle:Vi?Lo?{fontSize:"12px",fontWeight:700,color:null===(t=Co.colors.pallete.brickRed)||void 0===t?void 0:t.color}:{fontSize:"16px",fontWeight:700,color:null===(e=Co.colors.pallete.brickRed)||void 0===e?void 0:e.color}:void 0}:{finalPrice:si.finalPrice,originalPrice:si.originalPrice,finalPriceStyled:!1,color:si.color,size:f.Medium,testId:"volume-discount-v4",clubStyle:Vi,clubPrice:Ii,finalPriceAriaLabel:po,originalPriceAriaLabel:uo,discountAriaLabel:vo,finalPriceStyle:Vi?Lo?{fontSize:"12px",fontWeight:700,color:null===(l=Co.colors.pallete.brickRed)||void 0===l?void 0:l.color}:{fontSize:"16px",fontWeight:700,color:null===(s=Co.colors.pallete.brickRed)||void 0===s?void 0:s.color}:void 0},void 0);case 5:return r(F,i({style:null==Zi?void 0:Zi.wrapperStyle},{children:r(n,{isClub:!0,isPDP:!0,finalPrice:null===(a=null==Zi?void 0:Zi.price)||void 0===a?void 0:a.finalPrice,originalPrice:null===(d=null==Zi?void 0:Zi.price)||void 0===d?void 0:d.originalPrice,finalPriceStyled:!1,color:si.color,size:f.Medium,testId:"volume-discount-v4",clubStyle:Vi,icon:null==Zi?void 0:Zi.clubOfferIcon,isCollections:null==Zi?void 0:Zi.isCollections},void 0)}),void 0);case 6:return r(C,{finalPrice:si.finalPrice,originalPrice:si.originalPrice,color:si.color,size:f.Medium,testId:"volume-discount-v6",showDecimals:Qi,tooltipText:to,tooltipIcon:so,tooltipPosition:lo,tooltipAriaLabel:go,isMobile:Lo,savingsDisplay:Ni,discount:Ao,finalPriceAriaLabel:po,originalPriceAriaLabel:uo,discountAriaLabel:vo},void 0);default:return"styled"===hi?r(P,{finalPrice:si.finalPrice,originalPrice:si.originalPrice,finalPriceStyled:!1,color:si.color,size:f.Large,testId:"volume-discount",showDecimals:Qi,finalPriceAriaLabel:po,originalPriceAriaLabel:uo,discountAriaLabel:vo,tooltipAriaLabel:go},void 0):r(y,{invertDirection:$i,finalPrice:si.finalPrice,originalPrice:si.originalPrice,finalPriceStyled:!1,color:si.color,size:f.Medium,testId:"volume-discount",clubStyle:Vi,finalPriceAriaLabel:po,originalPriceAriaLabel:uo,discountAriaLabel:vo,finalPriceStyle:Vi?Lo?{fontSize:"12px",fontWeight:700}:{fontSize:"16px",fontWeight:700}:void 0},void 0)}},xo=function(){return ni||!li.reviews&&!li.rating?r(e,{},void 0):Di?r(a,{height:"20px",width:"80px"},void 0):r(w,{size:di===f.Large?f.Small:f.XSmall,rating:li.rating,reviews:null==li?void 0:li.reviews,reviewsText:"",wrapWithParenthesis:!0},void 0)},To=s(null!==(Z=null==Ki?void 0:Ki.isLiked)&&void 0!==Z&&Z),ko=To[0],Io=To[1],Bo=s(null!==(K=null==Ki?void 0:Ki.likes)&&void 0!==K?K:0),Vo=Bo[0],Do=Bo[1],Oo=eo?W:l;return o(x,i({className:ui,"data-testid":"product-card-container-div"},{children:["corner"===wi.position&&r(T,i({},wi.componentContainerProps,{children:wi.component}),void 0),o(k,i({as:pi?"a":"div",href:pi,rel:Si?"nofollow":"",className:"picContainer",onClick:ji},{children:[!!Ki&&r(q,{isLiked:ko,likes:Vo,onClick:function(i){i.stopPropagation(),Do(ko?function(i){return i-1}:function(i){return i+1}),Io((function(i){return!i})),null==Ki||Ki.onClick(i)},colors:{background:{active:null!==(Q=null===(J=null===(_=Ki.colors)||void 0===_?void 0:_.background)||void 0===J?void 0:J.active)&&void 0!==Q?Q:Co.colors.shades.white.color,hover:null!==(oi=null!==(Y=null===(X=null===(U=Ki.colors)||void 0===U?void 0:U.background)||void 0===X?void 0:X.hover)&&void 0!==Y?Y:null===(ii=null===($=Ki.colors)||void 0===$?void 0:$.background)||void 0===ii?void 0:ii.active)&&void 0!==oi?oi:Co.colors.shades.white.color}}},void 0),vi||gi?o(I,i({width:null==So?void 0:So.width,height:null==So?void 0:So.height,"data-testid":"tags-image-container"},{children:[r(d,{src:ei.src,srcSet:j(ei.src,180,360,720,960),alt:ei.alt,width:Ei?null==So?void 0:So.width:"100%",height:Ei?null==So?void 0:So.height:"100%",loading:Hi?"eager":"lazy",decoding:Hi?"sync":"async",borderRadius:A[Co.name].image.borderRadius},void 0),r(B,i({style:{width:wi.display?"100%":"inherit"}},{children:vi}),void 0),r(V,i({style:{width:wi.display?"100%":"inherit"}},{children:gi}),void 0)]}),void 0):r(d,{src:ei.src,srcSet:j(ei.src,180,360,720,960),alt:ei.alt,width:null==So?void 0:So.width,height:null==So?void 0:So.height,loading:Hi?"eager":"lazy",decoding:Hi?"sync":"async",borderRadius:A[Co.name].image.borderRadius},void 0),ti?r(D,{className:"hover__image",src:ti.src,srcSet:j(ti.src,180,360,720,960),loading:"lazy",decoding:"async",alt:ti.alt,width:null==So?void 0:So.width,height:null==So?void 0:So.height},void 0):null]}),void 0),wi.display&&"top"===wi.position&&o(e,{children:[r(p,{size:wo},void 0),wi.component]},void 0),yi&&o(e,{children:[r(p,{size:wo},void 0),r(p,{size:wo},void 0),r(xo,{},void 0)]},void 0),o(k,i({as:pi?"a":"div",href:pi,rel:Si?"nofollow":"",onClick:ji,className:"textContainer",style:{alignItems:Vi?"flex-start":"center"}},{children:[r(p,{size:wo},void 0),r(O,i({theme:Co,align:Vi?"left":mi,"data-testid":"product-card-title"},{children:ri}),void 0),r(p,{size:wo},void 0),!!Po&&Po,Xi&&o(e,{children:[r(M,{theme:Co},void 0),r(p,{size:wo},void 0)]},void 0),Ti&&-1!==Ti.strength&&o(e,{children:[r(u,{barsFilled:Ti.strength,supportText:Ti.description},void 0),r(p,{size:10},void 0)]},void 0),o(e,bi&&!yi?{children:[r(xo,{},void 0),r(p,{size:wo},void 0),o(R,i({style:{marginTop:(null==Zi?void 0:Zi.isClubOffer)?0:8}},{children:[Pi?r(a,{height:"20px",width:"140px"},void 0):zo(),(null==Zi?void 0:Zi.isClubOffer)&&zo(5)]}),void 0)]}:{children:[o(Oo,{children:[Pi?r(a,{height:"20px",width:"140px"},void 0):oo&&!yi?o(N,{children:[zo(),r(xo,{},void 0)]},void 0):o(e,{children:[!(null==Zi?void 0:Zi.isClubMember)&&zo(),(null==Zi?void 0:Zi.isClubOffer)&&zo(5),r(c,{displayBNPL:null==zi?void 0:zi.displayBNPL,installments:(null==zi?void 0:zi.installments)||0,installmentPrice:(null==zi?void 0:zi.installmentPrice)||"",iconFolder:null==zi?void 0:zi.iconFolder,iconName:(null==zi?void 0:zi.iconName)||"",showLogo:null==zi?void 0:zi.showLogo,iconColor:null==zi?void 0:zi.iconColor,fontSize:null==zi?void 0:zi.fontSize},void 0)]},void 0),Vi&&r(m,{clubPrice:Ii},void 0),6!==Mi&&(Fi?r(a,{height:"22px",width:"75px"},void 0):Ni&&r(G,i({size:f.Small},{children:Wi&&r(b,i({},Wi,{size:f.Medium,style:{letterSpacing:"-0.05rem"}}),void 0)}),void 0)),yo&&r(d,{src:"https://cdn.shopify.com/s/files/1/2679/8624/files/selling-fast-copy.png?v=1712665121",alt:fo||bo?null!=fo?fo:"":"selling-fast-copy","aria-hidden":!(!bo||fo)||void 0,width:"77px",height:"22px"},void 0)]},void 0),r(p,{size:wo},void 0),!yi&&!oo&&r(xo,{},void 0)]},void 0),!!_i&&o(e,{children:[r(p,{size:wo},void 0),r(p,{size:wo},void 0),o(H,i({size:f.Small,width:"100%",onClick:function(i){i.preventDefault(),i.stopPropagation(),null==_i||_i(i)},onKeyDown:function(i){"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),i.stopPropagation(),null==_i||_i(i))},backgroundColor:{active:"transparent",hover:"transparent"},hasText:!0,rounded:!1,border:"1px solid #D1D1D1",role:"button",tabIndex:ho&&!jo?-1:0,"aria-label":jo,"aria-hidden":!(!ho||jo)||void 0},{children:[r(h.Custom.Eye,{fill:"black",width:"16px",height:"16px"},void 0),r("span",i({style:{color:"black",fontSize:"14px"}},{children:"Quick View"}),void 0)]}),void 0)]},void 0)]}),void 0),wi.display&&"bottom"===wi.position&&o(e,{children:[r(p,{size:wo},void 0),wi.component]},void 0)]}),void 0)};export{E as default};
|
|
2
2
|
//# sourceMappingURL=ProductItemMobile.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n,__assign as o}from"tslib";import{jsxs as t,jsx as r}from"@emotion/react/jsx-runtime";import{css as i}from"@emotion/react";import e from"@emotion/styled";import{dispatchCustomEvent as a}from"@ribeirolabs/events";import{useEvent as d}from"@ribeirolabs/events/react";import{useMemo as l,useCallback as c,useState as
|
|
1
|
+
import{__makeTemplateObject as n,__assign as o}from"tslib";import{jsxs as t,jsx as r}from"@emotion/react/jsx-runtime";import{css as i}from"@emotion/react";import e from"@emotion/styled";import{dispatchCustomEvent as a}from"@ribeirolabs/events";import{useEvent as d}from"@ribeirolabs/events/react";import{useMemo as l,useCallback as c,useState as u}from"react";import{Portal as p}from"../shared/portal/Portal.js";import{mediaQueries as m}from"../../utils/media.js";var s,f,v,h,x,g,y,b=function(o){var t=o.opened;return i(t?s||(s=n(["\n opacity: 1;\n pointer-events: all;\n "],["\n opacity: 1;\n pointer-events: all;\n "])):f||(f=n(["\n opacity: 0;\n pointer-events: none;\n "],["\n opacity: 0;\n pointer-events: none;\n "])))},w=e.div(g||(g=n(["\n border: 1px solid var(--colors-pallete-primary-color);\n border-radius: ",";\n padding: ",";\n position: fixed;\n left: ",";\n top: ",";\n z-index: var(--zIndex-modal);\n background-color: var(--colors-background-color);\n transition: transform 0.3s, opacity 0.3s;\n overflow-y: auto;\n max-width: ",";\n max-height: ",";\n max-height: ",";\n width: ",";\n height: ",";\n ","\n ","\n ","\n"],["\n border: 1px solid var(--colors-pallete-primary-color);\n border-radius: ",";\n padding: ",";\n position: fixed;\n left: ",";\n top: ",";\n z-index: var(--zIndex-modal);\n background-color: var(--colors-background-color);\n transition: transform 0.3s, opacity 0.3s;\n overflow-y: auto;\n max-width: ",";\n max-height: ",";\n max-height: ",";\n width: ",";\n height: ",";\n ","\n ","\n ","\n"])),(function(n){return"".concat(n.maxFullScreen||n.countryRedirModalWithCoupon?"0":"var(--radius-regular)")}),(function(n){return"".concat(n.padding?n.padding:"20px 10px")}),(function(n){return"".concat(n.maxFullScreen?"0":"50%")}),(function(n){return n.maxFullScreen?"0":n.initialTop?n.initialTop:"50%"}),(function(n){return"".concat(n.maxFullScreen?"100%":"90vw")}),(function(n){return"".concat(n.maxFullScreen?"100%":"90vh")}),(function(n){return"".concat(n.maxFullScreen?"100%":"90dvh")}),(function(n){return"".concat(n.maxFullScreen?"100%":"auto")}),(function(n){return"".concat(n.maxFullScreen?"100%":"inherit")}),(function(o){var t=o.width;return t?i(x||(x=n(["\n width: ",";\n "],["\n width: ",";\n "])),t):m({minWidth:["90%","var(--component-modal-minWidth)"]})}),b,(function(o){var t=o.opened,r=o.maxFullScreen,e=o.initialTop;return t?i(v||(v=n(["\n transform: ",";\n top: ",";\n "],["\n transform: ",";\n top: ",";\n "])),r?"translateY(0)":"translate(-50%, -50%)",r?"0":e||"50%"):i(h||(h=n(["\n transform: ",";\n top: ",";\n "],["\n transform: ",";\n top: ",";\n "])),r?"translateY(10%)":"translate(-50%, -40%)",r?"0":e||"50%")})),F=e.div(y||(y=n(["\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.75);\n z-index: var(--zIndex-overlay);\n transition: opacity 0.3s;\n ","\n"],["\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.75);\n z-index: var(--zIndex-overlay);\n transition: opacity 0.3s;\n ","\n"])),b),S=function(n){var i=n.id,e=n.children,a=n.dismissable,d=void 0===a||a,l=n.maxFullScreen,c=void 0!==l&&l,u=n.padding,m=n.onClickOverlayHandler,s=n.width,f=n.initialTop,v=void 0===f?"50%":f,h=n.countryRedirModalWithCoupon,x=void 0!==h&&h,g=n.className,y=C(i),b=y.opened,S=y.close;return t(p,o({id:i,className:g},{children:[r(w,o({opened:b,maxFullScreen:c,padding:u,width:s,initialTop:v,countryRedirModalWithCoupon:x},{children:e}),void 0),r(F,{"data-testid":"modal-overlay",opened:b,onClick:function(){null==m||m(),d&&S()}},void 0)]}),void 0)},k=function(n,t){a("modal",o({id:n},t))},z=function(n,o){d("modal",c((function(t){t.detail.id===n&&o(t)}),[n,o]))},C=function(n){var o=u(!1),t=o[0],r=o[1];z(n,c((function(n){return r("open"===n.detail.type)}),[]));var i=c((function(){k(n,{type:"open"})}),[n]),e=c((function(){k(n,{type:"close"})}),[n]);return l((function(){return{opened:t,open:i,close:e}}),[e,i,t])};export{S as Modal,F as Overlay,k as modalEvent,C as useModal,z as useModalEvent};
|
|
2
2
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n,__assign as i}from"tslib";import{jsx as t,jsxs as e}from"react/jsx-runtime";import o from"@emotion/styled";import{useRef as d,useEffect as r}from"react";import{DateFormat as a,formatDate as l}from"../../utils/dateFormatter/dateFormatter.js";import{Image as p}from"../atoms/Image/Image.js";import{Icon as h}from"../icons/index.js";import{useModal as c,Modal as x}from"../modal/Modal.js";import{StarList as m}from"../rating/starList/StarList.js";var g,s,f,u,w,v,b,y,k,z,j,C,I,F,L,M,S,T,D,H,A,N,Y,_=o.div(g||(g=n(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"]))),B=o.div(s||(s=n(["\n display: flex;\n flex-direction: column;\n padding: 20px;\n padding-top: 0;\n"],["\n display: flex;\n flex-direction: column;\n padding: 20px;\n padding-top: 0;\n"]))),U=o.div(f||(f=n(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),V=o.div(u||(u=n(["\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n margin-bottom: 5px;\n\n @media (min-width: 768px) {\n margin-top: 10px;\n }\n"],["\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n margin-bottom: 5px;\n\n @media (min-width: 768px) {\n margin-top: 10px;\n }\n"]))),X=o.span(w||(w=n(["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n"]))),q=o.h1(v||(v=n(["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n padding: 20px;\n display: flex;\n"],["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n padding: 20px;\n display: flex;\n"]))),E=o.h1(b||(b=n(["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n color: #1cc286;\n margin-left: 6px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n }\n"],["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n color: #1cc286;\n margin-left: 6px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n }\n"]))),G=o.h2(y||(y=n(["\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin: 0;\n"],["\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin: 0;\n"]))),J=o.div(k||(k=n(["\n font-weight: normal;\n font-size: 16px;\n margin: 0;\n line-height: 25px;\n word-break: break-word;\n margin-top: 5px;\n white-space: pre-wrap;\n"],["\n font-weight: normal;\n font-size: 16px;\n margin: 0;\n line-height: 25px;\n word-break: break-word;\n margin-top: 5px;\n white-space: pre-wrap;\n"]))),K=o.div(z||(z=n(["\n width: 100% !important;\n min-width: 100%;\n height: initial !important;\n min-height: 250px;\n background-size: contain !important;\n margin: 0 !important;\n line-height: 0;\n\n @media (min-width: 768px) {\n width: unset;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n padding: 20px;\n }\n"],["\n width: 100% !important;\n min-width: 100%;\n height: initial !important;\n min-height: 250px;\n background-size: contain !important;\n margin: 0 !important;\n line-height: 0;\n\n @media (min-width: 768px) {\n width: unset;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n padding: 20px;\n }\n"]))),O=o(p)(j||(j=n(["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n"],["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n"]))),P=o.video(C||(C=n(["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n"],["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n"]))),Q=o.div(I||(I=n(["\n padding: 20px;\n border-top: 1px solid #eee;\n cursor: pointer;\n"],["\n padding: 20px;\n border-top: 1px solid #eee;\n cursor: pointer;\n"]))),R=o.div(F||(F=n(["\n align-items: center;\n margin-top: 10px;\n margin-bottom: 15px;\n font-size: 12px;\n line-height: 16px;\n text-align: center;\n max-width: 192px;\n"],["\n align-items: center;\n margin-top: 10px;\n margin-bottom: 15px;\n font-size: 12px;\n line-height: 16px;\n text-align: center;\n max-width: 192px;\n"]))),W=o(p)(L||(L=n(["\n max-height: 100px;\n height: auto;\n width: auto;\n"],["\n max-height: 100px;\n height: auto;\n width: auto;\n"]))),Z=o.div(M||(M=n(["\n display: inline-block;\n padding: 10px;\n border: 1px solid #ececec;\n line-height: 0;\n text-align: center;\n width: 100%;\n box-sizing: border-box !important;\n max-width: 192px;\n"],["\n display: inline-block;\n padding: 10px;\n border: 1px solid #ececec;\n line-height: 0;\n text-align: center;\n width: 100%;\n box-sizing: border-box !important;\n max-width: 192px;\n"]))),$=o.div(S||(S=n(["\n @media (min-width: 768px) {\n min-width: 40%;\n }\n"],["\n @media (min-width: 768px) {\n min-width: 40%;\n }\n"]))),nn=o.div(T||(T=n(["\n display: flex;\n justify-content: end;\n margin-top: 20px;\n"],["\n display: flex;\n justify-content: end;\n margin-top: 20px;\n"]))),tn=o.div(D||(D=n(["\n display: flex;\n cursor: pointer;\n"],["\n display: flex;\n cursor: pointer;\n"]))),en=o.div(H||(H=n(["\n display: flex;\n cursor: pointer;\n"],["\n display: flex;\n cursor: pointer;\n"]))),on=o.span(A||(A=n(["\n font-size: 15px;\n text-align: right;\n margin-right: 15px;\n margin-left: 4px;\n"],["\n font-size: 15px;\n text-align: right;\n margin-right: 15px;\n margin-left: 4px;\n"]))),dn=o.span(N||(N=n(["\n font-size: 15px;\n text-align: right;\n margin-left: 4px;\n"],["\n font-size: 15px;\n text-align: right;\n margin-left: 4px;\n"]))),rn=o.span(Y||(Y=n(["\n cursor: pointer;\n display: inline-block;\n position: absolute;\n background: #fff;\n color: #000;\n box-shadow: none;\n opacity: 0.8;\n top: 0;\n right: 0;\n z-index: 3;\n font-size: 0;\n line-height: 30px;\n text-align: center;\n width: 45px;\n height: 50px;\n font-weight: 400;\n float: right;\n\n &::before {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(-45deg);\n }\n\n &::after {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(45deg);\n }\n"],["\n cursor: pointer;\n display: inline-block;\n position: absolute;\n background: #fff;\n color: #000;\n box-shadow: none;\n opacity: 0.8;\n top: 0;\n right: 0;\n z-index: 3;\n font-size: 0;\n line-height: 30px;\n text-align: center;\n width: 45px;\n height: 50px;\n font-weight: 400;\n float: right;\n\n &::before {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(-45deg);\n }\n\n &::after {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(45deg);\n }\n"]))),an=function(n){var o=n.reviewId,p=n.reviewerName,g=n.date,s=n.rating,f=n.stars,u=n.title,w=n.description,v=n.image,b=n.modalId,y=n.maxFullScreen,k=void 0!==y&&y,z=n.verified,j=n.productImage,C=n.productTitle,I=n.productLink,F=n.helpfulCount,L=void 0===F?0:F,M=n.helpfulAction,S=n.notHelpfulCount,T=void 0===S?0:S,D=n.notHelpfulAction,H=n.dateFormat,A=void 0===H?a.DDMMYY:H,N=null==v?void 0:v.src.includes("/video"),Y=d(null),an=c(b),ln=an.opened,pn=an.close;return r((function(){Y.current&&(ln?Y.current.play():Y.current.pause())}),[ln]),t(x,i({id:b,maxFullScreen:k,padding:"0"},{children:e(_,{children:[t(rn,i({onClick:pn},{children:"X"}),void 0),t(K,{children:v&&(N?t(P,{ref:Y,src:v.src,width:"100%",controls:!0},void 0):t(O,{src:v.src,alt:v.alt},void 0))},void 0),e($,{children:[ln&&e(q,{children:[p,z&&t(E,{children:"Verified Buyer"},void 0)]},void 0),e(B,i({"data-testid":"review-detail-content"},{children:[e(U,{children:[t(m,{starsNumber:5,rating:s,fill:f.color,size:f.size},void 0),t(X,{children:l(g,A)},void 0)]},void 0),e(V,{children:[t(G,{children:u},void 0),t(J,{dangerouslySetInnerHTML:{__html:w}},void 0)]},void 0),e(nn,{children:[e(tn,i({"data-testid":"helpful-action",onClick:function(){return M?M(o):void 0}},{children:[t(h.Custom.ThumbsUp,{width:1,height:1,fill:"#000"},void 0),t(on,{children:L},void 0)]}),void 0),e(en,i({"data-testid":"not-helpful-action",onClick:function(){return D?D(o):void 0}},{children:[t(h.Custom.ThumbsDown,{width:1,height:1,fill:"#000"},void 0),t(dn,{children:T},void 0)]}),void 0)]},void 0)]}),void 0),j&&I&&e(Q,i({onClick:function(){return window.location.href=I}},{children:[t(Z,{children:t(W,{src:j,alt:"productImage"},void 0)},void 0),t(R,{children:C},void 0)]}),void 0)]},void 0)]},void 0)}),void 0)};export{an as default};
|
|
1
|
+
import{__makeTemplateObject as n,__assign as i}from"tslib";import{jsx as t,jsxs as e}from"react/jsx-runtime";import o from"@emotion/styled";import{useRef as d,useEffect as r}from"react";import{DateFormat as a,formatDate as l}from"../../utils/dateFormatter/dateFormatter.js";import{Image as p}from"../atoms/Image/Image.js";import{Icon as h}from"../icons/index.js";import{useModal as c,Modal as x}from"../modal/Modal.js";import{StarList as m}from"../rating/starList/StarList.js";var g,s,f,u,w,v,b,y,k,z,j,C,I,F,L,M,S,T,D,H,A,N,Y,_=o.div(g||(g=n(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"]))),B=o.div(s||(s=n(["\n display: flex;\n flex-direction: column;\n padding: 20px;\n padding-top: 0;\n"],["\n display: flex;\n flex-direction: column;\n padding: 20px;\n padding-top: 0;\n"]))),U=o.div(f||(f=n(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),V=o.div(u||(u=n(["\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n margin-bottom: 5px;\n\n @media (min-width: 768px) {\n margin-top: 10px;\n }\n"],["\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n margin-bottom: 5px;\n\n @media (min-width: 768px) {\n margin-top: 10px;\n }\n"]))),X=o.span(w||(w=n(["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n"]))),q=o.h1(v||(v=n(["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n padding: 20px;\n display: flex;\n"],["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n padding: 20px;\n display: flex;\n"]))),E=o.h1(b||(b=n(["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n color: #1cc286;\n margin-left: 6px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n }\n"],["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n color: #1cc286;\n margin-left: 6px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n }\n"]))),G=o.h2(y||(y=n(["\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin: 0;\n"],["\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin: 0;\n"]))),J=o.div(k||(k=n(["\n font-weight: normal;\n font-size: 16px;\n margin: 0;\n line-height: 25px;\n word-break: break-word;\n margin-top: 5px;\n white-space: pre-wrap;\n"],["\n font-weight: normal;\n font-size: 16px;\n margin: 0;\n line-height: 25px;\n word-break: break-word;\n margin-top: 5px;\n white-space: pre-wrap;\n"]))),K=o.div(z||(z=n(["\n width: 100% !important;\n min-width: 100%;\n height: initial !important;\n min-height: 250px;\n background-size: contain !important;\n margin: 0 !important;\n line-height: 0;\n\n @media (min-width: 768px) {\n width: unset;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n padding: 20px;\n }\n"],["\n width: 100% !important;\n min-width: 100%;\n height: initial !important;\n min-height: 250px;\n background-size: contain !important;\n margin: 0 !important;\n line-height: 0;\n\n @media (min-width: 768px) {\n width: unset;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n padding: 20px;\n }\n"]))),O=o(p)(j||(j=n(["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n"],["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n"]))),P=o.video(C||(C=n(["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n"],["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n"]))),Q=o.div(I||(I=n(["\n padding: 20px;\n border-top: 1px solid #eee;\n cursor: pointer;\n"],["\n padding: 20px;\n border-top: 1px solid #eee;\n cursor: pointer;\n"]))),R=o.div(F||(F=n(["\n align-items: center;\n margin-top: 10px;\n margin-bottom: 15px;\n font-size: 12px;\n line-height: 16px;\n text-align: center;\n max-width: 192px;\n"],["\n align-items: center;\n margin-top: 10px;\n margin-bottom: 15px;\n font-size: 12px;\n line-height: 16px;\n text-align: center;\n max-width: 192px;\n"]))),W=o(p)(L||(L=n(["\n max-height: 100px;\n height: auto;\n width: auto;\n"],["\n max-height: 100px;\n height: auto;\n width: auto;\n"]))),Z=o.div(M||(M=n(["\n display: inline-block;\n padding: 10px;\n border: 1px solid #ececec;\n line-height: 0;\n text-align: center;\n width: 100%;\n box-sizing: border-box !important;\n max-width: 192px;\n"],["\n display: inline-block;\n padding: 10px;\n border: 1px solid #ececec;\n line-height: 0;\n text-align: center;\n width: 100%;\n box-sizing: border-box !important;\n max-width: 192px;\n"]))),$=o.div(S||(S=n(["\n @media (min-width: 768px) {\n min-width: 40%;\n }\n"],["\n @media (min-width: 768px) {\n min-width: 40%;\n }\n"]))),nn=o.div(T||(T=n(["\n display: flex;\n justify-content: end;\n margin-top: 20px;\n"],["\n display: flex;\n justify-content: end;\n margin-top: 20px;\n"]))),tn=o.div(D||(D=n(["\n display: flex;\n cursor: pointer;\n"],["\n display: flex;\n cursor: pointer;\n"]))),en=o.div(H||(H=n(["\n display: flex;\n cursor: pointer;\n"],["\n display: flex;\n cursor: pointer;\n"]))),on=o.span(A||(A=n(["\n font-size: 15px;\n text-align: right;\n margin-right: 15px;\n margin-left: 4px;\n"],["\n font-size: 15px;\n text-align: right;\n margin-right: 15px;\n margin-left: 4px;\n"]))),dn=o.span(N||(N=n(["\n font-size: 15px;\n text-align: right;\n margin-left: 4px;\n"],["\n font-size: 15px;\n text-align: right;\n margin-left: 4px;\n"]))),rn=o.span(Y||(Y=n(["\n cursor: pointer;\n display: inline-block;\n position: absolute;\n background: #fff;\n color: #000;\n box-shadow: none;\n opacity: 0.8;\n top: 0;\n right: 0;\n z-index: 3;\n font-size: 0;\n line-height: 30px;\n text-align: center;\n width: 45px;\n height: 50px;\n font-weight: 400;\n float: right;\n\n &::before {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(-45deg);\n }\n\n &::after {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(45deg);\n }\n"],["\n cursor: pointer;\n display: inline-block;\n position: absolute;\n background: #fff;\n color: #000;\n box-shadow: none;\n opacity: 0.8;\n top: 0;\n right: 0;\n z-index: 3;\n font-size: 0;\n line-height: 30px;\n text-align: center;\n width: 45px;\n height: 50px;\n font-weight: 400;\n float: right;\n\n &::before {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(-45deg);\n }\n\n &::after {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(45deg);\n }\n"]))),an=function(n){var o=n.reviewId,p=n.reviewerName,g=n.date,s=n.rating,f=n.stars,u=n.title,w=n.description,v=n.image,b=n.modalId,y=n.maxFullScreen,k=void 0!==y&&y,z=n.verified,j=n.productImage,C=n.productTitle,I=n.productLink,F=n.helpfulCount,L=void 0===F?0:F,M=n.helpfulAction,S=n.notHelpfulCount,T=void 0===S?0:S,D=n.notHelpfulAction,H=n.dateFormat,A=void 0===H?a.DDMMYY:H,N=null==v?void 0:v.src.includes("/video"),Y=d(null),an=c(b),ln=an.opened,pn=an.close;return r((function(){Y.current&&(ln?Y.current.play():Y.current.pause())}),[ln]),t(x,i({id:b,maxFullScreen:k,padding:"0"},{children:e(_,{children:[t(rn,i({onClick:pn},{children:"X"}),void 0),t(K,{children:v&&(N?t(P,{ref:Y,src:v.src,width:"100%",controls:!0},void 0):t(O,{src:v.src,alt:v.alt},void 0))},void 0),e($,{children:[ln&&e(q,{children:[p,z&&t(E,{children:"Verified Buyer"},void 0)]},void 0),e(B,i({"data-testid":"review-detail-content"},{children:[e(U,{children:[t(m,{starsNumber:5,rating:s,fill:f.color,size:f.size},void 0),t(X,{children:l(g,A)},void 0)]},void 0),e(V,{children:[t(G,{children:u},void 0),t(J,{dangerouslySetInnerHTML:{__html:w}},void 0)]},void 0),e(nn,{children:[e(tn,i({"data-testid":"helpful-action",onClick:function(){return M?M(o):void 0}},{children:[t(h.Custom.ThumbsUp,{width:1,height:1,fill:"#000"},void 0),t(on,{children:L},void 0)]}),void 0),e(en,i({"data-testid":"not-helpful-action",onClick:function(){return D?D(o):void 0}},{children:[t(h.Custom.ThumbsDown,{width:1,height:1,fill:"#000"},void 0),t(dn,{children:T},void 0)]}),void 0)]},void 0)]}),void 0),j&&I&&e(Q,i({onClick:function(){return window.location.href=I}},{children:[t(Z,{children:t(W,{src:j,alt:"productImage"},void 0)},void 0),t(R,{children:C},void 0)]}),void 0)]},void 0)]},void 0)}),void 0)};export{an as default};
|
|
2
2
|
//# sourceMappingURL=ReviewDetail.js.map
|
package/build/index.d.ts
CHANGED
|
@@ -3222,6 +3222,7 @@ interface ProductItemSmallMobileProps extends ProductItemProps {
|
|
|
3222
3222
|
originalPriceAriaLabel?: string;
|
|
3223
3223
|
discountAriaLabel?: string;
|
|
3224
3224
|
tooltipAriaLabel?: string;
|
|
3225
|
+
infoLabel?: JSX.Element;
|
|
3225
3226
|
}
|
|
3226
3227
|
|
|
3227
3228
|
declare function withProductGrid<P extends ProductItemProps>(ProductItemComponent: react__default.FC<P>, data: ProductItemProps[]): {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),i=require("@emotion/react/jsx-runtime"),r=require("react"),o=require("../../../SkeletonBox/SkeletonBox.js"),s=require("../../../atoms/ClubPriceMemberLabel/ClubPriceMemberLabel.js");require("../../../atoms/HorizontalDivider/HorizontalDivider.js"),require("../../../atoms/Icon/Icon.js");var t=require("../../../atoms/Image/Image.js");require("../../../atoms/PriceLabel/PriceLabel.js"),require("../../../atoms/PriceLabelV2/PriceLabelV2.js"),require("react/jsx-runtime"),require("../../../atoms/Toggle/toggle.styled.js");var l=require("../../../buynowpaylater/BuyNowPayLater.js"),a=require("../../../club-price-label/ClubPriceLabel.js"),n=require("../../../shared/spacing/Spacing.js"),d=require("../../../strength-bars/StrengthBars.js"),c=require("../../../../core/theme/Theme.js"),u=require("../../../../hooks/WindowDimensions.js");require("../../../../utils/constants/offerAtCart.js");var g=require("../../../../utils/getSrcSet/getSrcSet.js");require("../../../../utils/media.js"),require("../../../../utils/mock-content/CancellationFlowAccordion.js");var j=require("../../../../types/enums.js");require("../../../PackSelectorV2/PackSelectoV2.js"),require("../../../absorbency-level/AbsorbencyLevel.js"),require("../../../accordion-options/AccordionOptions.js"),require("../../../accordion/Accordion.js"),require("../../../dropdown/variants/simple/SimpleDropdown.js");var p=require("../../../icons/index.js");require("../../../radio/input/styles.js"),require("../../../tooltip/Tooltip.js"),require("../../../autoship/styled.js"),require("../../../autoshipV2/styled.js"),require("../../../before-after/BeforeAfter.js"),require("../../../pricing/clubOffer/ClubOfferTag.js");var v=require("../../../pricing/discount/DiscountTag.js"),m=require("../../../pricing/price/PriceLabel.js"),q=require("../../../pricing/priceLabelV2/PriceLabelV2.js");require("../../../pricing/priceLabelV3/PriceLabelV3.js"),require("../../../pricing/priceLabelV5/PriceLabelV5.styled.js");var b=require("../../../pricing/priceLabelV6/PriceLabelV6.js"),h=require("../../../pricing/priceLabelWithCredits/PriceLabelWithCredits.js");require("../../../shared/card/Card.js"),require("../../../bundle/minimalistic/styled.js"),require("../../../text/Text.js"),require("../../../bundle/motivator/styled.js"),require("../../../bundle/simple/Simple.js"),require("../../../offer-banner/OfferBanner.js"),require("../../../cartProductItem/CloseIcon/CloseButton.js"),require("../../../cartProductItem/Description/Description.js"),require("../../../cartProductItem/Promo/Promo.js"),require("../../../cartProductItem/Title/Title.js"),require("../../../cartProductItem/TrashIcon/styled.js"),require("../../../checkbox/Checkbox.js"),require("../../grid/WithProductGrid.js");var P=require("../../../pricing/priceLabelV4/PriceLabelV4.js"),y=require("../../../rating/Rating.js"),f=require("./constants.js"),S=require("./styled.js"),C=require("../../../pricing/styles.js"),x=require("../../../icon-button/IconButton.js");require("../../../tag/variants/product/styled.js"),require("../truekind/styled.js"),require("../../../color/ColorRadioGroup.js"),require("../../../color/selector/PatternSelector.js"),require("../../../color/styles/ColorPickerwithTootip.styled.js"),require("../../../cross-sell/Checkbox/CrossSellCheckbox.js"),require("../../../cta/styled.js"),require("../../../delivery-details/DeliveryDetails.js"),require("../../../delivery-details/Note/Note.js"),require("../../../drawer/style.js"),require("../../../dropdown-list-icons/Styled.js"),require("../../../dropdown/size-dropdown/Styled.js"),require("../../../dropdown/variants/dialog/DropdownDialog.js"),require("../../../dropdown/base/BaseDropdown.js"),require("@headlessui/react"),require("../../../input/base/Error.js"),require("../../../shared/select/BaseSelect.js"),require("../../../dropdown/variants/smart/styled.js"),require("../../../filtering/Accordion.js"),require("../../../filtering/FiltersStyled.js"),require("../../../filtering/Tags/Tags.js"),require("../../../fit-guarantee/FitGuarantee.js"),require("../../../fit/FitPredictor.js"),require("@ant-design/react-slick"),require("react-zoom-pan-pinch"),require("../../../modal/Modal.js"),require("../../../organisms/ModalZoom/zoomModal.styled.js"),require("../../../organisms/ModalZoom/ZoomModalV2.styled.js"),require("../../../molecules/Video/components/styled.js"),require("../../../molecules/Video/styled.js"),require("../../../slider/ArrowButton.js"),require("../../../slider/StyledSlider.js"),require("../../../gallery/components/ImageSmallPreview/styled.js"),require("../../../gallery/components/ImagePreviewList/styled.js"),require("../../../gallery/components/ImageProductSlide/styled.js"),require("../../../gallery/styled.js"),require("../../../icon-button/amazonAndPaypal/AmazonPaypalButtons.js"),require("../../../iconsWithTitle/index.js"),require("../../../image-card/ImageCard.js"),require("../../../input/label/Label.js"),require("../../../input/base/Styled.js"),require("../../../input/custom/Custom.js"),require("../../../input/basePlusButton/BasePlusButton.js"),require("../../../input/basePlusIcon/BasePlusIcon.js"),require("../../../motivator-progress-bar/MotivatorProgressBar.js"),require("../../../order-bar/OrderBar.js"),require("../../../packs/selector/PackSelector.js"),require("../../../pagination/styles.js"),require("../../../payment-methods/PaymentMethod.js"),require("../../../product/order/item/SimpleOrderItem.js"),require("../../../progress-bar/ProgressBar.js"),require("../../../quantityPicker/styled.js"),require("../../../radio/RadioPrimary/radioPrimary.js"),require("../../../radio/clubRadioInput/clubRadio.js"),require("../../../rating/starList/StarList.js"),require("../../../review-detail/ReviewDetail.js"),require("../../../review/Review.js"),require("../../../reviews-header/ReviewsHeader.js"),require("../../../scroll-to-top/ScrollToTop.js"),require("../../../search-bar/components/ClearButton/styled.js"),require("../../../search-bar/components/Footer/styled.js"),require("../../../search-bar/components/ProductItem/styled.js"),require("../../../search-bar/components/ResultsPanel/styled.js"),require("../../../search-bar/components/SearchControl/styled.js"),require("../../../search-bar/styled.js"),require("../../../search-navigation/styled.js"),require("react-dom"),require("../../../short-banner/ShortBanner.js"),require("../../../size-chart/styled.js"),require("../../../size-table/SizeTable.js"),require("../../../size/guide/SizeFitGuide.js"),require("../../../size/selector/styled.js"),require("../../../tabs/Tab.js"),require("../../../tabs/Tabs.js"),require("../../../tag/Tag.js"),require("@emotion/react"),require("../../../textWithImage/index.js"),require("../../../timer/styled.js"),require("../../../toast/Toast.js"),require("../../../totals/total/styled.js"),require("../../../totals/subtotal/Subtotal.js"),require("../../../tracking-progress-v2/TrackingProgressV2.js"),require("../../../tracking-progress/TrackingProgress.js"),require("../../../organisms/AutoshipOfferCard/AutoshipOfferCardItem.styled.js"),require("../../../organisms/AutoshipOfferCardCta/AutoshipOfferCardItem.styled.js"),require("../../../organisms/AutoshipPdpCard/AutoshipPdpCard.styled.js"),require("../../../organisms/BasicAccordion/BasicAccordion.js"),require("../../../organisms/CartItemCard/CartItem.js"),require("../../../organisms/ClubOfferSelector/styled.js"),require("../../../organisms/ClubOfferSelector2/styled.js"),require("../../../organisms/JoinClubCard/joinClubCard.js"),require("../../../organisms/OfferAtCart/styled.js"),require("../../../organisms/OfferAtCartV2/styled.js"),require("../../../organisms/OfferAtCartV3/styled.js"),require("../../../organisms/OfferAtCartV4/styled.js"),require("../../../organisms/OfferAtPDP/styled.js"),require("../../../organisms/OfferAtPDP/types.js"),require("../../../organisms/ProductCard/ProductCardV1/ProductCard.js"),require("../../../organisms/ProductCard/ProductCardV2/styled.js"),require("../../../organisms/ProductCard/ProductCardV3/styled.js"),require("../../../organisms/ProductGalleryMobile/ProductGalleryMobileV1/ProductGalleryMobile.js"),require("../../../organisms/SizeCharTable/SizeChartTableV2/styled.js"),require("../../../organisms/SizeCharTable/SizeChartTableV3/styled.js"),require("../../../molecules/ArrowTip/ArrowTip.styled.js"),require("../../../organisms/SizeCharTable/SizeChartTableV4/SizeChartTableV4.styled.js"),require("../../../organisms/SubscriptionPlanSelector/styled.js"),require("../../../organisms/TwoCtasAtCart/Greeting.styled.js"),require("../../../organisms/TwoCtasAtCart/Card.styled.js"),require("../../../timerV2/styled.js"),require("../../../molecules/OfferAtCartBenefits/OfferAtCartBenefits.styled.js"),require("../../../molecules/OfferAtCartImage/OfferAtCartImage.styled.js"),require("../../../molecules/CouponCard/styled.js"),require("../../../molecules/BenefitsList/styled.js"),require("../../../molecules/HurryUp/styled.js"),require("../../../molecules/Spinner/styled.js"),require("../../../molecules/IconsWithTitleList/IconsWithTitleList.styled.js");var L=require("../../../molecules/LikeButton/LikeButton.js");require("../../../molecules/ScarcityTag/ScarcityTag.styled.js");module.exports=function(w){var z,T,A,I,k,B,V,D,_,O,M,F=w.title,R=w.image,W=w.imageHover,N=w.price,H=w.rating,E=w.hideRating,G=void 0!==E&&E,Y=w.size,Z=w.alignName,K=void 0===Z?"center":Z,J=w.url,Q=w.className,U=w.topTag,X=w.bottomTag,$=w.onClick,ee=w.priceDisplayType,ie=void 0===ee?"default":ee,re=w.priceAtBottom,oe=w.ratingOnTop,se=w.priceLoading,te=w.noFollow,le=void 0!==te&&te,ae=w.colorPicker,ne=void 0===ae?{display:!1,position:"top",component:void 0,componentContainerProps:{position:"absolute",top:"4px",right:"4px",padding:"0px",boxSizing:"border-box",zIndex:1}}:ae,de=w.isBNPL,ce=void 0===de?{displayBNPL:!1,installments:4,installmentPrice:"",iconFolder:"PDP",iconName:"Klarna",showLogo:!0,iconColor:"#292929",fontSize:"12px"}:de,ue=w.hasStrength,ge=void 0===ue?{strength:-1,description:""}:ue,je=w.clubPrice,pe=void 0===je?"":je,ve=w.showClubPriceLabel,me=void 0!==ve&&ve,qe=w.isRatingLoading,be=w.version,he=void 0===be?1:be,Pe=w.showDiscountPercentageTag,ye=void 0!==Pe&&Pe,fe=w.discountTagLoading,Se=w.discountTag,Ce=w.isOnViewport,xe=void 0!==Ce&&Ce,Le=w.hasDefaultSize,we=void 0!==Le&&Le,ze=w.clubOffer,Te=w.likeBtn,Ae=w.onClickBottomButton,Ie=w.showDecimals,ke=void 0===Ie||Ie,Be=w.showDivider,Ve=void 0!==Be&&Be,De=w.invertPriceDirection,_e=void 0!==De&&De,Oe=w.priceAndReviewInOneLine,Me=void 0!==Oe&&Oe,Fe=w.priceAndDiscountTagInOneLine,Re=void 0!==Fe&&Fe,We=w.tooltipText,Ne=w.tooltipIcon,He=w.tooltipPosition,Ee=w.credits,Ge=w.creditsLabel,Ye=w.creditsBadge,Ze=w.originalPricePrefix,Ke=w.finalPriceAriaLabel,Je=w.originalPriceAriaLabel,Qe=w.discountAriaLabel,Ue=w.tooltipAriaLabel,Xe=w.quickViewAriaLabel,$e=w.sellingFastAriaLabel,ei=w.quickViewAriaHidden,ii=w.sellingFastAriaHidden,ri=w.sellingFast,oi=c.useTheme(),si=S.getStylesBySize(Y),ti=u.useWindowDimensions().isMobile,li=r.useMemo((function(){var e;return(e={},e[j.ComponentSize.Large]=8,e[j.ComponentSize.Medium]=4,e[j.ComponentSize.Small]=2,e)[Y]}),[Y]),ai=ye?Se:void 0,ni=function(r){var o,t,l,a,n,d;if(void 0===r&&(r=he),"hidden"===ie)return null;if("credits"===ie)return i.jsx(h.PriceLabelWithCredits,{finalPrice:N.finalPrice,originalPrice:N.originalPrice,color:N.color,credits:Ee,creditsLabel:Ge,creditsBadge:Ye,originalPricePrefix:Ze,tooltipText:We,tooltipIcon:Ne,tooltipPosition:He,tooltipAriaLabel:Ue,testId:"price-with-credits",finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je},void 0);switch(r){case 4:return"styled"===ie?i.jsx(P.PriceLabelV4,{finalPrice:N.finalPrice,originalPrice:N.originalPrice,finalPriceStyled:!1,color:N.color,size:j.ComponentSize.Medium,testId:"volume-discount-v4",clubStyle:me,clubPrice:pe,styledPrice:!0,finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je,discountAriaLabel:Qe,finalPriceStyle:me?ti?{fontSize:"12px",fontWeight:700,color:null===(t=oi.colors.pallete.brickRed)||void 0===t?void 0:t.color}:{fontSize:"16px",fontWeight:700,color:null===(o=oi.colors.pallete.brickRed)||void 0===o?void 0:o.color}:void 0},void 0):i.jsx(P.PriceLabelV4,{finalPrice:N.finalPrice,originalPrice:N.originalPrice,finalPriceStyled:!1,color:N.color,size:j.ComponentSize.Medium,testId:"volume-discount-v4",clubStyle:me,clubPrice:pe,finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je,discountAriaLabel:Qe,finalPriceStyle:me?ti?{fontSize:"12px",fontWeight:700,color:null===(a=oi.colors.pallete.brickRed)||void 0===a?void 0:a.color}:{fontSize:"16px",fontWeight:700,color:null===(l=oi.colors.pallete.brickRed)||void 0===l?void 0:l.color}:void 0},void 0);case 5:return i.jsx(S.ClubOfferPriceLabelWrapper,e.__assign({style:null==ze?void 0:ze.wrapperStyle},{children:i.jsx(s.ClubPriceMemberLabel,{isClub:!0,isPDP:!0,finalPrice:null===(n=null==ze?void 0:ze.price)||void 0===n?void 0:n.finalPrice,originalPrice:null===(d=null==ze?void 0:ze.price)||void 0===d?void 0:d.originalPrice,finalPriceStyled:!1,color:N.color,size:j.ComponentSize.Medium,testId:"volume-discount-v4",clubStyle:me,icon:null==ze?void 0:ze.clubOfferIcon,isCollections:null==ze?void 0:ze.isCollections},void 0)}),void 0);case 6:return i.jsx(b.PriceLabelV6,{finalPrice:N.finalPrice,originalPrice:N.originalPrice,color:N.color,size:j.ComponentSize.Medium,testId:"volume-discount-v6",showDecimals:ke,tooltipText:We,tooltipIcon:Ne,tooltipPosition:He,tooltipAriaLabel:Ue,isMobile:ti,savingsDisplay:ye,discount:ai,finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je,discountAriaLabel:Qe},void 0);default:return"styled"===ie?i.jsx(q.PriceLabelV2,{finalPrice:N.finalPrice,originalPrice:N.originalPrice,finalPriceStyled:!1,color:N.color,size:j.ComponentSize.Large,testId:"volume-discount",showDecimals:ke,finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je,discountAriaLabel:Qe,tooltipAriaLabel:Ue},void 0):i.jsx(m.PriceLabel,{invertDirection:_e,finalPrice:N.finalPrice,originalPrice:N.originalPrice,finalPriceStyled:!1,color:N.color,size:j.ComponentSize.Medium,testId:"volume-discount",clubStyle:me,finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je,discountAriaLabel:Qe,finalPriceStyle:me?ti?{fontSize:"12px",fontWeight:700}:{fontSize:"16px",fontWeight:700}:void 0},void 0)}},di=function(){return G||!H.reviews&&!H.rating?i.jsx(i.Fragment,{},void 0):qe?i.jsx(o,{height:"20px",width:"80px"},void 0):i.jsx(y.Rating,{size:Y===j.ComponentSize.Large?j.ComponentSize.Small:j.ComponentSize.XSmall,rating:H.rating,reviews:null==H?void 0:H.reviews,reviewsText:"",wrapWithParenthesis:!0},void 0)},ci=r.useState(null!==(z=null==Te?void 0:Te.isLiked)&&void 0!==z&&z),ui=ci[0],gi=ci[1],ji=r.useState(null!==(T=null==Te?void 0:Te.likes)&&void 0!==T?T:0),pi=ji[0],vi=ji[1],mi=Re?S.InlineContainer:r.Fragment;return i.jsxs(S.ProdCardContainer,e.__assign({className:Q,"data-testid":"product-card-container-div"},{children:["corner"===ne.position&&i.jsx(S.CornerContainer,e.__assign({},ne.componentContainerProps,{children:ne.component}),void 0),i.jsxs(S.Container,e.__assign({as:J?"a":"div",href:J,rel:le?"nofollow":"",className:"picContainer",onClick:$},{children:[!!Te&&i.jsx(L.LikeButton,{isLiked:ui,likes:pi,onClick:function(e){e.stopPropagation(),vi(ui?function(e){return e-1}:function(e){return e+1}),gi((function(e){return!e})),null==Te||Te.onClick(e)},colors:{background:{active:null!==(k=null===(I=null===(A=Te.colors)||void 0===A?void 0:A.background)||void 0===I?void 0:I.active)&&void 0!==k?k:oi.colors.shades.white.color,hover:null!==(M=null!==(D=null===(V=null===(B=Te.colors)||void 0===B?void 0:B.background)||void 0===V?void 0:V.hover)&&void 0!==D?D:null===(O=null===(_=Te.colors)||void 0===_?void 0:_.background)||void 0===O?void 0:O.active)&&void 0!==M?M:oi.colors.shades.white.color}}},void 0),U||X?i.jsxs(S.ImageContainer,e.__assign({width:null==si?void 0:si.width,height:null==si?void 0:si.height,"data-testid":"tags-image-container"},{children:[i.jsx(t.Image,{src:R.src,srcSet:g.getSrcSet(R.src,180,360,720,960),alt:R.alt,width:we?null==si?void 0:si.width:"100%",height:we?null==si?void 0:si.height:"100%",loading:xe?"eager":"lazy",decoding:xe?"sync":"async",borderRadius:f.STYLES_BY_THEME[oi.name].image.borderRadius},void 0),i.jsx(S.TopTagContainer,e.__assign({style:{width:ne.display?"100%":"inherit"}},{children:U}),void 0),i.jsx(S.BottomTagContainer,e.__assign({style:{width:ne.display?"100%":"inherit"}},{children:X}),void 0)]}),void 0):i.jsx(t.Image,{src:R.src,srcSet:g.getSrcSet(R.src,180,360,720,960),alt:R.alt,width:null==si?void 0:si.width,height:null==si?void 0:si.height,loading:xe?"eager":"lazy",decoding:xe?"sync":"async",borderRadius:f.STYLES_BY_THEME[oi.name].image.borderRadius},void 0),W?i.jsx(S.ImageHoverContainer,{className:"hover__image",src:W.src,srcSet:g.getSrcSet(W.src,180,360,720,960),loading:"lazy",decoding:"async",alt:W.alt,width:null==si?void 0:si.width,height:null==si?void 0:si.height},void 0):null]}),void 0),ne.display&&"top"===ne.position&&i.jsxs(i.Fragment,{children:[i.jsx(n.Spacing,{size:li},void 0),ne.component]},void 0),oe&&i.jsxs(i.Fragment,{children:[i.jsx(n.Spacing,{size:li},void 0),i.jsx(n.Spacing,{size:li},void 0),i.jsx(di,{},void 0)]},void 0),i.jsxs(S.Container,e.__assign({as:J?"a":"div",href:J,rel:le?"nofollow":"",onClick:$,className:"textContainer",style:{alignItems:me?"flex-start":"center"}},{children:[i.jsx(n.Spacing,{size:li},void 0),i.jsx(S.Title,e.__assign({theme:oi,align:me?"left":K,"data-testid":"product-card-title"},{children:F}),void 0),i.jsx(n.Spacing,{size:li},void 0),Ve&&i.jsxs(i.Fragment,{children:[i.jsx(S.Divider,{theme:oi},void 0),i.jsx(n.Spacing,{size:li},void 0)]},void 0),ge&&-1!==ge.strength&&i.jsxs(i.Fragment,{children:[i.jsx(d.StrengthBars,{barsFilled:ge.strength,supportText:ge.description},void 0),i.jsx(n.Spacing,{size:10},void 0)]},void 0),re&&!oe?i.jsxs(i.Fragment,{children:[i.jsx(di,{},void 0),i.jsx(n.Spacing,{size:li},void 0),i.jsxs(S.MarginTopContainer,e.__assign({style:{marginTop:(null==ze?void 0:ze.isClubOffer)?0:8}},{children:[se?i.jsx(o,{height:"20px",width:"140px"},void 0):ni(),(null==ze?void 0:ze.isClubOffer)&&ni(5)]}),void 0)]},void 0):i.jsxs(i.Fragment,{children:[i.jsxs(mi,{children:[se?i.jsx(o,{height:"20px",width:"140px"},void 0):Me&&!oe?i.jsxs(S.OneLineInfoWrapper,{children:[ni(),i.jsx(di,{},void 0)]},void 0):i.jsxs(i.Fragment,{children:[!(null==ze?void 0:ze.isClubMember)&&ni(),(null==ze?void 0:ze.isClubOffer)&&ni(5),i.jsx(l.BuyNowPayLater,{displayBNPL:null==ce?void 0:ce.displayBNPL,installments:(null==ce?void 0:ce.installments)||0,installmentPrice:(null==ce?void 0:ce.installmentPrice)||"",iconFolder:null==ce?void 0:ce.iconFolder,iconName:(null==ce?void 0:ce.iconName)||"",showLogo:null==ce?void 0:ce.showLogo,iconColor:null==ce?void 0:ce.iconColor,fontSize:null==ce?void 0:ce.fontSize},void 0)]},void 0),me&&i.jsx(a.ClubPriceLabel,{clubPrice:pe},void 0),6!==he&&(fe?i.jsx(o,{height:"22px",width:"75px"},void 0):ye&&i.jsx(C.TagContainer,e.__assign({size:j.ComponentSize.Small},{children:Se&&i.jsx(v.DiscountTag,e.__assign({},Se,{size:j.ComponentSize.Medium,style:{letterSpacing:"-0.05rem"}}),void 0)}),void 0)),ri&&i.jsx(t.Image,{src:"https://cdn.shopify.com/s/files/1/2679/8624/files/selling-fast-copy.png?v=1712665121",alt:$e||ii?null!=$e?$e:"":"selling-fast-copy","aria-hidden":!(!ii||$e)||void 0,width:"77px",height:"22px"},void 0)]},void 0),i.jsx(n.Spacing,{size:li},void 0),!oe&&!Me&&i.jsx(di,{},void 0)]},void 0),!!Ae&&i.jsxs(i.Fragment,{children:[i.jsx(n.Spacing,{size:li},void 0),i.jsx(n.Spacing,{size:li},void 0),i.jsxs(x.IconButton,e.__assign({size:j.ComponentSize.Small,width:"100%",onClick:function(e){e.preventDefault(),e.stopPropagation(),null==Ae||Ae(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),null==Ae||Ae(e))},backgroundColor:{active:"transparent",hover:"transparent"},hasText:!0,rounded:!1,border:"1px solid #D1D1D1",role:"button",tabIndex:ei&&!Xe?-1:0,"aria-label":Xe,"aria-hidden":!(!ei||Xe)||void 0},{children:[i.jsx(p.Icon.Custom.Eye,{fill:"black",width:"16px",height:"16px"},void 0),i.jsx("span",e.__assign({style:{color:"black",fontSize:"14px"}},{children:"Quick View"}),void 0)]}),void 0)]},void 0)]}),void 0),ne.display&&"bottom"===ne.position&&i.jsxs(i.Fragment,{children:[i.jsx(n.Spacing,{size:li},void 0),ne.component]},void 0)]}),void 0)};
|
|
1
|
+
"use strict";var e=require("tslib"),i=require("@emotion/react/jsx-runtime"),r=require("react"),o=require("../../../SkeletonBox/SkeletonBox.js"),s=require("../../../atoms/ClubPriceMemberLabel/ClubPriceMemberLabel.js");require("../../../atoms/HorizontalDivider/HorizontalDivider.js"),require("../../../atoms/Icon/Icon.js");var t=require("../../../atoms/Image/Image.js");require("../../../atoms/PriceLabel/PriceLabel.js"),require("../../../atoms/PriceLabelV2/PriceLabelV2.js"),require("react/jsx-runtime"),require("../../../atoms/Toggle/toggle.styled.js");var l=require("../../../buynowpaylater/BuyNowPayLater.js"),a=require("../../../club-price-label/ClubPriceLabel.js"),n=require("../../../shared/spacing/Spacing.js"),d=require("../../../strength-bars/StrengthBars.js"),c=require("../../../../core/theme/Theme.js"),u=require("../../../../hooks/WindowDimensions.js");require("../../../../utils/constants/offerAtCart.js");var g=require("../../../../utils/getSrcSet/getSrcSet.js");require("../../../../utils/media.js"),require("../../../../utils/mock-content/CancellationFlowAccordion.js");var j=require("../../../../types/enums.js");require("../../../PackSelectorV2/PackSelectoV2.js"),require("../../../absorbency-level/AbsorbencyLevel.js"),require("../../../accordion-options/AccordionOptions.js"),require("../../../accordion/Accordion.js"),require("../../../dropdown/variants/simple/SimpleDropdown.js");var p=require("../../../icons/index.js");require("../../../radio/input/styles.js"),require("../../../tooltip/Tooltip.js"),require("../../../autoship/styled.js"),require("../../../autoshipV2/styled.js"),require("../../../before-after/BeforeAfter.js"),require("../../../pricing/clubOffer/ClubOfferTag.js");var v=require("../../../pricing/discount/DiscountTag.js"),m=require("../../../pricing/price/PriceLabel.js"),q=require("../../../pricing/priceLabelV2/PriceLabelV2.js");require("../../../pricing/priceLabelV3/PriceLabelV3.js"),require("../../../pricing/priceLabelV5/PriceLabelV5.styled.js");var b=require("../../../pricing/priceLabelV6/PriceLabelV6.js"),h=require("../../../pricing/priceLabelWithCredits/PriceLabelWithCredits.js");require("../../../shared/card/Card.js"),require("../../../bundle/minimalistic/styled.js"),require("../../../text/Text.js"),require("../../../bundle/motivator/styled.js"),require("../../../bundle/simple/Simple.js"),require("../../../offer-banner/OfferBanner.js"),require("../../../cartProductItem/CloseIcon/CloseButton.js"),require("../../../cartProductItem/Description/Description.js"),require("../../../cartProductItem/Promo/Promo.js"),require("../../../cartProductItem/Title/Title.js"),require("../../../cartProductItem/TrashIcon/styled.js"),require("../../../checkbox/Checkbox.js"),require("../../grid/WithProductGrid.js");var P=require("../../../pricing/priceLabelV4/PriceLabelV4.js"),y=require("../../../rating/Rating.js"),f=require("./constants.js"),S=require("./styled.js"),C=require("../../../pricing/styles.js"),x=require("../../../icon-button/IconButton.js");require("../../../tag/variants/product/styled.js"),require("../truekind/styled.js"),require("../../../color/ColorRadioGroup.js"),require("../../../color/selector/PatternSelector.js"),require("../../../color/styles/ColorPickerwithTootip.styled.js"),require("../../../cross-sell/Checkbox/CrossSellCheckbox.js"),require("../../../cta/styled.js"),require("../../../delivery-details/DeliveryDetails.js"),require("../../../delivery-details/Note/Note.js"),require("../../../drawer/style.js"),require("../../../dropdown-list-icons/Styled.js"),require("../../../dropdown/size-dropdown/Styled.js"),require("../../../dropdown/variants/dialog/DropdownDialog.js"),require("../../../dropdown/base/BaseDropdown.js"),require("@headlessui/react"),require("../../../input/base/Error.js"),require("../../../shared/select/BaseSelect.js"),require("../../../dropdown/variants/smart/styled.js"),require("../../../filtering/Accordion.js"),require("../../../filtering/FiltersStyled.js"),require("../../../filtering/Tags/Tags.js"),require("../../../fit-guarantee/FitGuarantee.js"),require("../../../fit/FitPredictor.js"),require("@ant-design/react-slick"),require("react-zoom-pan-pinch"),require("../../../modal/Modal.js"),require("../../../organisms/ModalZoom/zoomModal.styled.js"),require("../../../organisms/ModalZoom/ZoomModalV2.styled.js"),require("../../../molecules/Video/components/styled.js"),require("../../../molecules/Video/styled.js"),require("../../../slider/ArrowButton.js"),require("../../../slider/StyledSlider.js"),require("../../../gallery/components/ImageSmallPreview/styled.js"),require("../../../gallery/components/ImagePreviewList/styled.js"),require("../../../gallery/components/ImageProductSlide/styled.js"),require("../../../gallery/styled.js"),require("../../../icon-button/amazonAndPaypal/AmazonPaypalButtons.js"),require("../../../iconsWithTitle/index.js"),require("../../../image-card/ImageCard.js"),require("../../../input/label/Label.js"),require("../../../input/base/Styled.js"),require("../../../input/custom/Custom.js"),require("../../../input/basePlusButton/BasePlusButton.js"),require("../../../input/basePlusIcon/BasePlusIcon.js"),require("../../../motivator-progress-bar/MotivatorProgressBar.js"),require("../../../order-bar/OrderBar.js"),require("../../../packs/selector/PackSelector.js"),require("../../../pagination/styles.js"),require("../../../payment-methods/PaymentMethod.js"),require("../../../product/order/item/SimpleOrderItem.js"),require("../../../progress-bar/ProgressBar.js"),require("../../../quantityPicker/styled.js"),require("../../../radio/RadioPrimary/radioPrimary.js"),require("../../../radio/clubRadioInput/clubRadio.js"),require("../../../rating/starList/StarList.js"),require("../../../review-detail/ReviewDetail.js"),require("../../../review/Review.js"),require("../../../reviews-header/ReviewsHeader.js"),require("../../../scroll-to-top/ScrollToTop.js"),require("../../../search-bar/components/ClearButton/styled.js"),require("../../../search-bar/components/Footer/styled.js"),require("../../../search-bar/components/ProductItem/styled.js"),require("../../../search-bar/components/ResultsPanel/styled.js"),require("../../../search-bar/components/SearchControl/styled.js"),require("../../../search-bar/styled.js"),require("../../../search-navigation/styled.js"),require("react-dom"),require("../../../short-banner/ShortBanner.js"),require("../../../size-chart/styled.js"),require("../../../size-table/SizeTable.js"),require("../../../size/guide/SizeFitGuide.js"),require("../../../size/selector/styled.js"),require("../../../tabs/Tab.js"),require("../../../tabs/Tabs.js"),require("../../../tag/Tag.js"),require("@emotion/react"),require("../../../textWithImage/index.js"),require("../../../timer/styled.js"),require("../../../toast/Toast.js"),require("../../../totals/total/styled.js"),require("../../../totals/subtotal/Subtotal.js"),require("../../../tracking-progress-v2/TrackingProgressV2.js"),require("../../../tracking-progress/TrackingProgress.js"),require("../../../organisms/AutoshipOfferCard/AutoshipOfferCardItem.styled.js"),require("../../../organisms/AutoshipOfferCardCta/AutoshipOfferCardItem.styled.js"),require("../../../organisms/AutoshipPdpCard/AutoshipPdpCard.styled.js"),require("../../../organisms/BasicAccordion/BasicAccordion.js"),require("../../../organisms/CartItemCard/CartItem.js"),require("../../../organisms/ClubOfferSelector/styled.js"),require("../../../organisms/ClubOfferSelector2/styled.js"),require("../../../organisms/JoinClubCard/joinClubCard.js"),require("../../../organisms/OfferAtCart/styled.js"),require("../../../organisms/OfferAtCartV2/styled.js"),require("../../../organisms/OfferAtCartV3/styled.js"),require("../../../organisms/OfferAtCartV4/styled.js"),require("../../../organisms/OfferAtPDP/styled.js"),require("../../../organisms/OfferAtPDP/types.js"),require("../../../organisms/ProductCard/ProductCardV1/ProductCard.js"),require("../../../organisms/ProductCard/ProductCardV2/styled.js"),require("../../../organisms/ProductCard/ProductCardV3/styled.js"),require("../../../organisms/ProductGalleryMobile/ProductGalleryMobileV1/ProductGalleryMobile.js"),require("../../../organisms/SizeCharTable/SizeChartTableV2/styled.js"),require("../../../organisms/SizeCharTable/SizeChartTableV3/styled.js"),require("../../../molecules/ArrowTip/ArrowTip.styled.js"),require("../../../organisms/SizeCharTable/SizeChartTableV4/SizeChartTableV4.styled.js"),require("../../../organisms/SubscriptionPlanSelector/styled.js"),require("../../../organisms/TwoCtasAtCart/Greeting.styled.js"),require("../../../organisms/TwoCtasAtCart/Card.styled.js"),require("../../../timerV2/styled.js"),require("../../../molecules/OfferAtCartBenefits/OfferAtCartBenefits.styled.js"),require("../../../molecules/OfferAtCartImage/OfferAtCartImage.styled.js"),require("../../../molecules/CouponCard/styled.js"),require("../../../molecules/BenefitsList/styled.js"),require("../../../molecules/HurryUp/styled.js"),require("../../../molecules/Spinner/styled.js"),require("../../../molecules/IconsWithTitleList/IconsWithTitleList.styled.js");var L=require("../../../molecules/LikeButton/LikeButton.js");require("../../../molecules/ScarcityTag/ScarcityTag.styled.js");module.exports=function(w){var z,T,A,I,k,B,V,D,_,O,M,F=w.title,R=w.image,W=w.imageHover,N=w.price,H=w.rating,E=w.hideRating,G=void 0!==E&&E,Y=w.size,Z=w.alignName,K=void 0===Z?"center":Z,J=w.url,Q=w.className,U=w.topTag,X=w.bottomTag,$=w.onClick,ee=w.priceDisplayType,ie=void 0===ee?"default":ee,re=w.priceAtBottom,oe=w.ratingOnTop,se=w.priceLoading,te=w.noFollow,le=void 0!==te&&te,ae=w.colorPicker,ne=void 0===ae?{display:!1,position:"top",component:void 0,componentContainerProps:{position:"absolute",top:"4px",right:"4px",padding:"0px",boxSizing:"border-box",zIndex:1}}:ae,de=w.isBNPL,ce=void 0===de?{displayBNPL:!1,installments:4,installmentPrice:"",iconFolder:"PDP",iconName:"Klarna",showLogo:!0,iconColor:"#292929",fontSize:"12px"}:de,ue=w.hasStrength,ge=void 0===ue?{strength:-1,description:""}:ue,je=w.clubPrice,pe=void 0===je?"":je,ve=w.showClubPriceLabel,me=void 0!==ve&&ve,qe=w.isRatingLoading,be=w.version,he=void 0===be?1:be,Pe=w.showDiscountPercentageTag,ye=void 0!==Pe&&Pe,fe=w.discountTagLoading,Se=w.discountTag,Ce=w.isOnViewport,xe=void 0!==Ce&&Ce,Le=w.hasDefaultSize,we=void 0!==Le&&Le,ze=w.clubOffer,Te=w.likeBtn,Ae=w.onClickBottomButton,Ie=w.showDecimals,ke=void 0===Ie||Ie,Be=w.showDivider,Ve=void 0!==Be&&Be,De=w.invertPriceDirection,_e=void 0!==De&&De,Oe=w.priceAndReviewInOneLine,Me=void 0!==Oe&&Oe,Fe=w.priceAndDiscountTagInOneLine,Re=void 0!==Fe&&Fe,We=w.tooltipText,Ne=w.tooltipIcon,He=w.tooltipPosition,Ee=w.credits,Ge=w.creditsLabel,Ye=w.creditsBadge,Ze=w.originalPricePrefix,Ke=w.finalPriceAriaLabel,Je=w.originalPriceAriaLabel,Qe=w.discountAriaLabel,Ue=w.tooltipAriaLabel,Xe=w.quickViewAriaLabel,$e=w.sellingFastAriaLabel,ei=w.quickViewAriaHidden,ii=w.sellingFastAriaHidden,ri=w.sellingFast,oi=w.infoLabel,si=c.useTheme(),ti=S.getStylesBySize(Y),li=u.useWindowDimensions().isMobile,ai=r.useMemo((function(){var e;return(e={},e[j.ComponentSize.Large]=8,e[j.ComponentSize.Medium]=4,e[j.ComponentSize.Small]=2,e)[Y]}),[Y]),ni=ye?Se:void 0,di=function(r){var o,t,l,a,n,d;if(void 0===r&&(r=he),"hidden"===ie)return null;if("credits"===ie)return i.jsx(h.PriceLabelWithCredits,{finalPrice:N.finalPrice,originalPrice:N.originalPrice,color:N.color,credits:Ee,creditsLabel:Ge,creditsBadge:Ye,originalPricePrefix:Ze,tooltipText:We,tooltipIcon:Ne,tooltipPosition:He,tooltipAriaLabel:Ue,testId:"price-with-credits",finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je},void 0);switch(r){case 4:return"styled"===ie?i.jsx(P.PriceLabelV4,{finalPrice:N.finalPrice,originalPrice:N.originalPrice,finalPriceStyled:!1,color:N.color,size:j.ComponentSize.Medium,testId:"volume-discount-v4",clubStyle:me,clubPrice:pe,styledPrice:!0,finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je,discountAriaLabel:Qe,finalPriceStyle:me?li?{fontSize:"12px",fontWeight:700,color:null===(t=si.colors.pallete.brickRed)||void 0===t?void 0:t.color}:{fontSize:"16px",fontWeight:700,color:null===(o=si.colors.pallete.brickRed)||void 0===o?void 0:o.color}:void 0},void 0):i.jsx(P.PriceLabelV4,{finalPrice:N.finalPrice,originalPrice:N.originalPrice,finalPriceStyled:!1,color:N.color,size:j.ComponentSize.Medium,testId:"volume-discount-v4",clubStyle:me,clubPrice:pe,finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je,discountAriaLabel:Qe,finalPriceStyle:me?li?{fontSize:"12px",fontWeight:700,color:null===(a=si.colors.pallete.brickRed)||void 0===a?void 0:a.color}:{fontSize:"16px",fontWeight:700,color:null===(l=si.colors.pallete.brickRed)||void 0===l?void 0:l.color}:void 0},void 0);case 5:return i.jsx(S.ClubOfferPriceLabelWrapper,e.__assign({style:null==ze?void 0:ze.wrapperStyle},{children:i.jsx(s.ClubPriceMemberLabel,{isClub:!0,isPDP:!0,finalPrice:null===(n=null==ze?void 0:ze.price)||void 0===n?void 0:n.finalPrice,originalPrice:null===(d=null==ze?void 0:ze.price)||void 0===d?void 0:d.originalPrice,finalPriceStyled:!1,color:N.color,size:j.ComponentSize.Medium,testId:"volume-discount-v4",clubStyle:me,icon:null==ze?void 0:ze.clubOfferIcon,isCollections:null==ze?void 0:ze.isCollections},void 0)}),void 0);case 6:return i.jsx(b.PriceLabelV6,{finalPrice:N.finalPrice,originalPrice:N.originalPrice,color:N.color,size:j.ComponentSize.Medium,testId:"volume-discount-v6",showDecimals:ke,tooltipText:We,tooltipIcon:Ne,tooltipPosition:He,tooltipAriaLabel:Ue,isMobile:li,savingsDisplay:ye,discount:ni,finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je,discountAriaLabel:Qe},void 0);default:return"styled"===ie?i.jsx(q.PriceLabelV2,{finalPrice:N.finalPrice,originalPrice:N.originalPrice,finalPriceStyled:!1,color:N.color,size:j.ComponentSize.Large,testId:"volume-discount",showDecimals:ke,finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je,discountAriaLabel:Qe,tooltipAriaLabel:Ue},void 0):i.jsx(m.PriceLabel,{invertDirection:_e,finalPrice:N.finalPrice,originalPrice:N.originalPrice,finalPriceStyled:!1,color:N.color,size:j.ComponentSize.Medium,testId:"volume-discount",clubStyle:me,finalPriceAriaLabel:Ke,originalPriceAriaLabel:Je,discountAriaLabel:Qe,finalPriceStyle:me?li?{fontSize:"12px",fontWeight:700}:{fontSize:"16px",fontWeight:700}:void 0},void 0)}},ci=function(){return G||!H.reviews&&!H.rating?i.jsx(i.Fragment,{},void 0):qe?i.jsx(o,{height:"20px",width:"80px"},void 0):i.jsx(y.Rating,{size:Y===j.ComponentSize.Large?j.ComponentSize.Small:j.ComponentSize.XSmall,rating:H.rating,reviews:null==H?void 0:H.reviews,reviewsText:"",wrapWithParenthesis:!0},void 0)},ui=r.useState(null!==(z=null==Te?void 0:Te.isLiked)&&void 0!==z&&z),gi=ui[0],ji=ui[1],pi=r.useState(null!==(T=null==Te?void 0:Te.likes)&&void 0!==T?T:0),vi=pi[0],mi=pi[1],qi=Re?S.InlineContainer:r.Fragment;return i.jsxs(S.ProdCardContainer,e.__assign({className:Q,"data-testid":"product-card-container-div"},{children:["corner"===ne.position&&i.jsx(S.CornerContainer,e.__assign({},ne.componentContainerProps,{children:ne.component}),void 0),i.jsxs(S.Container,e.__assign({as:J?"a":"div",href:J,rel:le?"nofollow":"",className:"picContainer",onClick:$},{children:[!!Te&&i.jsx(L.LikeButton,{isLiked:gi,likes:vi,onClick:function(e){e.stopPropagation(),mi(gi?function(e){return e-1}:function(e){return e+1}),ji((function(e){return!e})),null==Te||Te.onClick(e)},colors:{background:{active:null!==(k=null===(I=null===(A=Te.colors)||void 0===A?void 0:A.background)||void 0===I?void 0:I.active)&&void 0!==k?k:si.colors.shades.white.color,hover:null!==(M=null!==(D=null===(V=null===(B=Te.colors)||void 0===B?void 0:B.background)||void 0===V?void 0:V.hover)&&void 0!==D?D:null===(O=null===(_=Te.colors)||void 0===_?void 0:_.background)||void 0===O?void 0:O.active)&&void 0!==M?M:si.colors.shades.white.color}}},void 0),U||X?i.jsxs(S.ImageContainer,e.__assign({width:null==ti?void 0:ti.width,height:null==ti?void 0:ti.height,"data-testid":"tags-image-container"},{children:[i.jsx(t.Image,{src:R.src,srcSet:g.getSrcSet(R.src,180,360,720,960),alt:R.alt,width:we?null==ti?void 0:ti.width:"100%",height:we?null==ti?void 0:ti.height:"100%",loading:xe?"eager":"lazy",decoding:xe?"sync":"async",borderRadius:f.STYLES_BY_THEME[si.name].image.borderRadius},void 0),i.jsx(S.TopTagContainer,e.__assign({style:{width:ne.display?"100%":"inherit"}},{children:U}),void 0),i.jsx(S.BottomTagContainer,e.__assign({style:{width:ne.display?"100%":"inherit"}},{children:X}),void 0)]}),void 0):i.jsx(t.Image,{src:R.src,srcSet:g.getSrcSet(R.src,180,360,720,960),alt:R.alt,width:null==ti?void 0:ti.width,height:null==ti?void 0:ti.height,loading:xe?"eager":"lazy",decoding:xe?"sync":"async",borderRadius:f.STYLES_BY_THEME[si.name].image.borderRadius},void 0),W?i.jsx(S.ImageHoverContainer,{className:"hover__image",src:W.src,srcSet:g.getSrcSet(W.src,180,360,720,960),loading:"lazy",decoding:"async",alt:W.alt,width:null==ti?void 0:ti.width,height:null==ti?void 0:ti.height},void 0):null]}),void 0),ne.display&&"top"===ne.position&&i.jsxs(i.Fragment,{children:[i.jsx(n.Spacing,{size:ai},void 0),ne.component]},void 0),oe&&i.jsxs(i.Fragment,{children:[i.jsx(n.Spacing,{size:ai},void 0),i.jsx(n.Spacing,{size:ai},void 0),i.jsx(ci,{},void 0)]},void 0),i.jsxs(S.Container,e.__assign({as:J?"a":"div",href:J,rel:le?"nofollow":"",onClick:$,className:"textContainer",style:{alignItems:me?"flex-start":"center"}},{children:[i.jsx(n.Spacing,{size:ai},void 0),i.jsx(S.Title,e.__assign({theme:si,align:me?"left":K,"data-testid":"product-card-title"},{children:F}),void 0),i.jsx(n.Spacing,{size:ai},void 0),!!oi&&oi,Ve&&i.jsxs(i.Fragment,{children:[i.jsx(S.Divider,{theme:si},void 0),i.jsx(n.Spacing,{size:ai},void 0)]},void 0),ge&&-1!==ge.strength&&i.jsxs(i.Fragment,{children:[i.jsx(d.StrengthBars,{barsFilled:ge.strength,supportText:ge.description},void 0),i.jsx(n.Spacing,{size:10},void 0)]},void 0),re&&!oe?i.jsxs(i.Fragment,{children:[i.jsx(ci,{},void 0),i.jsx(n.Spacing,{size:ai},void 0),i.jsxs(S.MarginTopContainer,e.__assign({style:{marginTop:(null==ze?void 0:ze.isClubOffer)?0:8}},{children:[se?i.jsx(o,{height:"20px",width:"140px"},void 0):di(),(null==ze?void 0:ze.isClubOffer)&&di(5)]}),void 0)]},void 0):i.jsxs(i.Fragment,{children:[i.jsxs(qi,{children:[se?i.jsx(o,{height:"20px",width:"140px"},void 0):Me&&!oe?i.jsxs(S.OneLineInfoWrapper,{children:[di(),i.jsx(ci,{},void 0)]},void 0):i.jsxs(i.Fragment,{children:[!(null==ze?void 0:ze.isClubMember)&&di(),(null==ze?void 0:ze.isClubOffer)&&di(5),i.jsx(l.BuyNowPayLater,{displayBNPL:null==ce?void 0:ce.displayBNPL,installments:(null==ce?void 0:ce.installments)||0,installmentPrice:(null==ce?void 0:ce.installmentPrice)||"",iconFolder:null==ce?void 0:ce.iconFolder,iconName:(null==ce?void 0:ce.iconName)||"",showLogo:null==ce?void 0:ce.showLogo,iconColor:null==ce?void 0:ce.iconColor,fontSize:null==ce?void 0:ce.fontSize},void 0)]},void 0),me&&i.jsx(a.ClubPriceLabel,{clubPrice:pe},void 0),6!==he&&(fe?i.jsx(o,{height:"22px",width:"75px"},void 0):ye&&i.jsx(C.TagContainer,e.__assign({size:j.ComponentSize.Small},{children:Se&&i.jsx(v.DiscountTag,e.__assign({},Se,{size:j.ComponentSize.Medium,style:{letterSpacing:"-0.05rem"}}),void 0)}),void 0)),ri&&i.jsx(t.Image,{src:"https://cdn.shopify.com/s/files/1/2679/8624/files/selling-fast-copy.png?v=1712665121",alt:$e||ii?null!=$e?$e:"":"selling-fast-copy","aria-hidden":!(!ii||$e)||void 0,width:"77px",height:"22px"},void 0)]},void 0),i.jsx(n.Spacing,{size:ai},void 0),!oe&&!Me&&i.jsx(ci,{},void 0)]},void 0),!!Ae&&i.jsxs(i.Fragment,{children:[i.jsx(n.Spacing,{size:ai},void 0),i.jsx(n.Spacing,{size:ai},void 0),i.jsxs(x.IconButton,e.__assign({size:j.ComponentSize.Small,width:"100%",onClick:function(e){e.preventDefault(),e.stopPropagation(),null==Ae||Ae(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),null==Ae||Ae(e))},backgroundColor:{active:"transparent",hover:"transparent"},hasText:!0,rounded:!1,border:"1px solid #D1D1D1",role:"button",tabIndex:ei&&!Xe?-1:0,"aria-label":Xe,"aria-hidden":!(!ei||Xe)||void 0},{children:[i.jsx(p.Icon.Custom.Eye,{fill:"black",width:"16px",height:"16px"},void 0),i.jsx("span",e.__assign({style:{color:"black",fontSize:"14px"}},{children:"Quick View"}),void 0)]}),void 0)]},void 0)]}),void 0),ne.display&&"bottom"===ne.position&&i.jsxs(i.Fragment,{children:[i.jsx(n.Spacing,{size:ai},void 0),ne.component]},void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=ProductItemMobile.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("@emotion/react/jsx-runtime"),t=require("@emotion/react"),o=require("@emotion/styled"),r=require("@ribeirolabs/events"),a=require("@ribeirolabs/events/react"),i=require("react"),l=require("../shared/portal/Portal.js"),c=require("../../utils/media.js");function d(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var s,u,p,m,v,f,x,h=d(o),b=function(e){return e.opened?t.css(s||(s=n.__makeTemplateObject(["\n opacity: 1;\n pointer-events: all;\n "],["\n opacity: 1;\n pointer-events: all;\n "]))):t.css(u||(u=n.__makeTemplateObject(["\n opacity: 0;\n pointer-events: none;\n "],["\n opacity: 0;\n pointer-events: none;\n "])))},
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib"),e=require("@emotion/react/jsx-runtime"),t=require("@emotion/react"),o=require("@emotion/styled"),r=require("@ribeirolabs/events"),a=require("@ribeirolabs/events/react"),i=require("react"),l=require("../shared/portal/Portal.js"),c=require("../../utils/media.js");function d(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var s,u,p,m,v,f,x,h=d(o),b=function(e){return e.opened?t.css(s||(s=n.__makeTemplateObject(["\n opacity: 1;\n pointer-events: all;\n "],["\n opacity: 1;\n pointer-events: all;\n "]))):t.css(u||(u=n.__makeTemplateObject(["\n opacity: 0;\n pointer-events: none;\n "],["\n opacity: 0;\n pointer-events: none;\n "])))},g=h.default.div(f||(f=n.__makeTemplateObject(["\n border: 1px solid var(--colors-pallete-primary-color);\n border-radius: ",";\n padding: ",";\n position: fixed;\n left: ",";\n top: ",";\n z-index: var(--zIndex-modal);\n background-color: var(--colors-background-color);\n transition: transform 0.3s, opacity 0.3s;\n overflow-y: auto;\n max-width: ",";\n max-height: ",";\n max-height: ",";\n width: ",";\n height: ",";\n ","\n ","\n ","\n"],["\n border: 1px solid var(--colors-pallete-primary-color);\n border-radius: ",";\n padding: ",";\n position: fixed;\n left: ",";\n top: ",";\n z-index: var(--zIndex-modal);\n background-color: var(--colors-background-color);\n transition: transform 0.3s, opacity 0.3s;\n overflow-y: auto;\n max-width: ",";\n max-height: ",";\n max-height: ",";\n width: ",";\n height: ",";\n ","\n ","\n ","\n"])),(function(n){return"".concat(n.maxFullScreen||n.countryRedirModalWithCoupon?"0":"var(--radius-regular)")}),(function(n){return"".concat(n.padding?n.padding:"20px 10px")}),(function(n){return"".concat(n.maxFullScreen?"0":"50%")}),(function(n){return n.maxFullScreen?"0":n.initialTop?n.initialTop:"50%"}),(function(n){return"".concat(n.maxFullScreen?"100%":"90vw")}),(function(n){return"".concat(n.maxFullScreen?"100%":"90vh")}),(function(n){return"".concat(n.maxFullScreen?"100%":"90dvh")}),(function(n){return"".concat(n.maxFullScreen?"100%":"auto")}),(function(n){return"".concat(n.maxFullScreen?"100%":"inherit")}),(function(e){var o=e.width;return o?t.css(v||(v=n.__makeTemplateObject(["\n width: ",";\n "],["\n width: ",";\n "])),o):c.mediaQueries({minWidth:["90%","var(--component-modal-minWidth)"]})}),b,(function(e){var o=e.opened,r=e.maxFullScreen,a=e.initialTop;return o?t.css(p||(p=n.__makeTemplateObject(["\n transform: ",";\n top: ",";\n "],["\n transform: ",";\n top: ",";\n "])),r?"translateY(0)":"translate(-50%, -50%)",r?"0":a||"50%"):t.css(m||(m=n.__makeTemplateObject(["\n transform: ",";\n top: ",";\n "],["\n transform: ",";\n top: ",";\n "])),r?"translateY(10%)":"translate(-50%, -40%)",r?"0":a||"50%")})),y=h.default.div(x||(x=n.__makeTemplateObject(["\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.75);\n z-index: var(--zIndex-overlay);\n transition: opacity 0.3s;\n ","\n"],["\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.75);\n z-index: var(--zIndex-overlay);\n transition: opacity 0.3s;\n ","\n"])),b),_=function(e,t){r.dispatchCustomEvent("modal",n.__assign({id:e},t))},k=function(n,e){a.useEvent("modal",i.useCallback((function(t){t.detail.id===n&&e(t)}),[n,e]))},j=function(n){var e=i.useState(!1),t=e[0],o=e[1];k(n,i.useCallback((function(n){return o("open"===n.detail.type)}),[]));var r=i.useCallback((function(){_(n,{type:"open"})}),[n]),a=i.useCallback((function(){_(n,{type:"close"})}),[n]);return i.useMemo((function(){return{opened:t,open:r,close:a}}),[a,r,t])};exports.Modal=function(t){var o=t.id,r=t.children,a=t.dismissable,i=void 0===a||a,c=t.maxFullScreen,d=void 0!==c&&c,s=t.padding,u=t.onClickOverlayHandler,p=t.width,m=t.initialTop,v=void 0===m?"50%":m,f=t.countryRedirModalWithCoupon,x=void 0!==f&&f,h=t.className,b=j(o),_=b.opened,k=b.close;return e.jsxs(l.Portal,n.__assign({id:o,className:h},{children:[e.jsx(g,n.__assign({opened:_,maxFullScreen:d,padding:s,width:p,initialTop:v,countryRedirModalWithCoupon:x},{children:r}),void 0),e.jsx(y,{"data-testid":"modal-overlay",opened:_,onClick:function(){null==u||u(),i&&k()}},void 0)]}),void 0)},exports.Overlay=y,exports.modalEvent=_,exports.useModal=j,exports.useModalEvent=k;
|
|
2
2
|
//# sourceMappingURL=Modal.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var n=require("tslib"),i=require("react/jsx-runtime"),e=require("@emotion/styled"),t=require("react"),a=require("../../utils/dateFormatter/dateFormatter.js"),o=require("../atoms/Image/Image.js"),d=require("../icons/index.js"),l=require("../modal/Modal.js"),r=require("../rating/starList/StarList.js");function p(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var c,m,x,s,h,g,f,u,w,b,v,j,_,k,y,z,T,O,I,q,C,F,M,D=p(e),L=D.default.div(c||(c=n.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"]))),S=D.default.div(m||(m=n.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n padding: 20px;\n padding-top: 0;\n"],["\n display: flex;\n flex-direction: column;\n padding: 20px;\n padding-top: 0;\n"]))),H=D.default.div(x||(x=n.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),A=D.default.div(s||(s=n.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n margin-bottom: 5px;\n\n @media (min-width: 768px) {\n margin-top: 10px;\n }\n"],["\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n margin-bottom: 5px;\n\n @media (min-width: 768px) {\n margin-top: 10px;\n }\n"]))),N=D.default.span(h||(h=n.__makeTemplateObject(["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n"]))),Y=D.default.h1(g||(g=n.__makeTemplateObject(["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n padding: 20px;\n display: flex;\n"],["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n padding: 20px;\n display: flex;\n"]))),B=D.default.h1(f||(f=n.__makeTemplateObject(["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n color: #1cc286;\n margin-left: 6px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n }\n"],["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n color: #1cc286;\n margin-left: 6px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n }\n"]))),E=D.default.h2(u||(u=n.__makeTemplateObject(["\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin: 0;\n"],["\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin: 0;\n"]))),R=D.default.div(w||(w=n.__makeTemplateObject(["\n font-weight: normal;\n font-size: 16px;\n margin: 0;\n line-height: 25px;\n word-break: break-word;\n margin-top: 5px;\n white-space: pre-wrap;\n"],["\n font-weight: normal;\n font-size: 16px;\n margin: 0;\n line-height: 25px;\n word-break: break-word;\n margin-top: 5px;\n white-space: pre-wrap;\n"]))),U=D.default.div(b||(b=n.__makeTemplateObject(["\n width: 100% !important;\n min-width: 100%;\n height: initial !important;\n min-height: 250px;\n background-size: contain !important;\n margin: 0 !important;\n line-height: 0;\n\n @media (min-width: 768px) {\n width: unset;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n padding: 20px;\n }\n"],["\n width: 100% !important;\n min-width: 100%;\n height: initial !important;\n min-height: 250px;\n background-size: contain !important;\n margin: 0 !important;\n line-height: 0;\n\n @media (min-width: 768px) {\n width: unset;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n padding: 20px;\n }\n"]))),V=D.default(o.Image)(v||(v=n.__makeTemplateObject(["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n"],["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n"]))),X=D.default.video(j||(j=n.__makeTemplateObject(["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n"],["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n"]))),G=D.default.div(_||(_=n.__makeTemplateObject(["\n padding: 20px;\n border-top: 1px solid #eee;\n cursor: pointer;\n"],["\n padding: 20px;\n border-top: 1px solid #eee;\n cursor: pointer;\n"]))),J=D.default.div(k||(k=n.__makeTemplateObject(["\n align-items: center;\n margin-top: 10px;\n margin-bottom: 15px;\n font-size: 12px;\n line-height: 16px;\n text-align: center;\n max-width: 192px;\n"],["\n align-items: center;\n margin-top: 10px;\n margin-bottom: 15px;\n font-size: 12px;\n line-height: 16px;\n text-align: center;\n max-width: 192px;\n"]))),K=D.default(o.Image)(y||(y=n.__makeTemplateObject(["\n max-height: 100px;\n height: auto;\n width: auto;\n"],["\n max-height: 100px;\n height: auto;\n width: auto;\n"]))),P=D.default.div(z||(z=n.__makeTemplateObject(["\n display: inline-block;\n padding: 10px;\n border: 1px solid #ececec;\n line-height: 0;\n text-align: center;\n width: 100%;\n box-sizing: border-box !important;\n max-width: 192px;\n"],["\n display: inline-block;\n padding: 10px;\n border: 1px solid #ececec;\n line-height: 0;\n text-align: center;\n width: 100%;\n box-sizing: border-box !important;\n max-width: 192px;\n"]))),Q=D.default.div(T||(T=n.__makeTemplateObject(["\n @media (min-width: 768px) {\n min-width: 40%;\n }\n"],["\n @media (min-width: 768px) {\n min-width: 40%;\n }\n"]))),W=D.default.div(O||(O=n.__makeTemplateObject(["\n display: flex;\n justify-content: end;\n margin-top: 20px;\n"],["\n display: flex;\n justify-content: end;\n margin-top: 20px;\n"]))),Z=D.default.div(I||(I=n.__makeTemplateObject(["\n display: flex;\n cursor: pointer;\n"],["\n display: flex;\n cursor: pointer;\n"]))),$=D.default.div(q||(q=n.__makeTemplateObject(["\n display: flex;\n cursor: pointer;\n"],["\n display: flex;\n cursor: pointer;\n"]))),nn=D.default.span(C||(C=n.__makeTemplateObject(["\n font-size: 15px;\n text-align: right;\n margin-right: 15px;\n margin-left: 4px;\n"],["\n font-size: 15px;\n text-align: right;\n margin-right: 15px;\n margin-left: 4px;\n"]))),en=D.default.span(F||(F=n.__makeTemplateObject(["\n font-size: 15px;\n text-align: right;\n margin-left: 4px;\n"],["\n font-size: 15px;\n text-align: right;\n margin-left: 4px;\n"]))),tn=D.default.span(M||(M=n.__makeTemplateObject(["\n cursor: pointer;\n display: inline-block;\n position: absolute;\n background: #fff;\n color: #000;\n box-shadow: none;\n opacity: 0.8;\n top: 0;\n right: 0;\n z-index: 3;\n font-size: 0;\n line-height: 30px;\n text-align: center;\n width: 45px;\n height: 50px;\n font-weight: 400;\n float: right;\n\n &::before {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(-45deg);\n }\n\n &::after {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(45deg);\n }\n"],["\n cursor: pointer;\n display: inline-block;\n position: absolute;\n background: #fff;\n color: #000;\n box-shadow: none;\n opacity: 0.8;\n top: 0;\n right: 0;\n z-index: 3;\n font-size: 0;\n line-height: 30px;\n text-align: center;\n width: 45px;\n height: 50px;\n font-weight: 400;\n float: right;\n\n &::before {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(-45deg);\n }\n\n &::after {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(45deg);\n }\n"])));module.exports=function(e){var o=e.reviewId,p=e.reviewerName,c=e.date,m=e.rating,x=e.stars,s=e.title,h=e.description,g=e.image,f=e.modalId,u=e.maxFullScreen,w=void 0!==u&&u,b=e.verified,v=e.productImage,j=e.productTitle,_=e.productLink,k=e.helpfulCount,y=void 0===k?0:k,z=e.helpfulAction,T=e.notHelpfulCount,O=void 0===T?0:T,I=e.notHelpfulAction,q=e.dateFormat,C=void 0===q?a.DateFormat.DDMMYY:q,F=null==g?void 0:g.src.includes("/video"),M=t.useRef(null),D=l.useModal(f),an=D.opened,on=D.close;return t.useEffect((function(){M.current&&(an?M.current.play():M.current.pause())}),[an]),i.jsx(l.Modal,n.__assign({id:f,maxFullScreen:w,padding:"0"},{children:i.jsxs(L,{children:[i.jsx(tn,n.__assign({onClick:on},{children:"X"}),void 0),i.jsx(U,{children:g&&(F?i.jsx(X,{ref:M,src:g.src,width:"100%",controls:!0},void 0):i.jsx(V,{src:g.src,alt:g.alt},void 0))},void 0),i.jsxs(Q,{children:[an&&i.jsxs(Y,{children:[p,b&&i.jsx(B,{children:"Verified Buyer"},void 0)]},void 0),i.jsxs(S,n.__assign({"data-testid":"review-detail-content"},{children:[i.jsxs(H,{children:[i.jsx(r.StarList,{starsNumber:5,rating:m,fill:x.color,size:x.size},void 0),i.jsx(N,{children:a.formatDate(c,C)},void 0)]},void 0),i.jsxs(A,{children:[i.jsx(E,{children:s},void 0),i.jsx(R,{dangerouslySetInnerHTML:{__html:h}},void 0)]},void 0),i.jsxs(W,{children:[i.jsxs(Z,n.__assign({"data-testid":"helpful-action",onClick:function(){return z?z(o):void 0}},{children:[i.jsx(d.Icon.Custom.ThumbsUp,{width:1,height:1,fill:"#000"},void 0),i.jsx(nn,{children:y},void 0)]}),void 0),i.jsxs($,n.__assign({"data-testid":"not-helpful-action",onClick:function(){return I?I(o):void 0}},{children:[i.jsx(d.Icon.Custom.ThumbsDown,{width:1,height:1,fill:"#000"},void 0),i.jsx(en,{children:O},void 0)]}),void 0)]},void 0)]}),void 0),v&&_&&i.jsxs(G,n.__assign({onClick:function(){return window.location.href=_}},{children:[i.jsx(P,{children:i.jsx(K,{src:v,alt:"productImage"},void 0)},void 0),i.jsx(J,{children:j},void 0)]}),void 0)]},void 0)]},void 0)}),void 0)};
|
|
1
|
+
"use strict";var n=require("tslib"),i=require("react/jsx-runtime"),e=require("@emotion/styled"),t=require("react"),a=require("../../utils/dateFormatter/dateFormatter.js"),o=require("../atoms/Image/Image.js"),d=require("../icons/index.js"),l=require("../modal/Modal.js"),r=require("../rating/starList/StarList.js");function p(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var c,h,x,m,s,g,f,u,w,b,v,j,_,k,y,z,T,O,I,q,C,F,M,D=p(e),L=D.default.div(c||(c=n.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"],["\n display: flex;\n flex-direction: column;\n\n @media (min-width: 768px) {\n flex-direction: row;\n }\n"]))),S=D.default.div(h||(h=n.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n padding: 20px;\n padding-top: 0;\n"],["\n display: flex;\n flex-direction: column;\n padding: 20px;\n padding-top: 0;\n"]))),H=D.default.div(x||(x=n.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n"],["\n display: flex;\n justify-content: space-between;\n"]))),A=D.default.div(m||(m=n.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n margin-bottom: 5px;\n\n @media (min-width: 768px) {\n margin-top: 10px;\n }\n"],["\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n margin-bottom: 5px;\n\n @media (min-width: 768px) {\n margin-top: 10px;\n }\n"]))),N=D.default.span(s||(s=n.__makeTemplateObject(["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n"],["\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n"]))),Y=D.default.h1(g||(g=n.__makeTemplateObject(["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n padding: 20px;\n display: flex;\n"],["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n padding: 20px;\n display: flex;\n"]))),B=D.default.h1(f||(f=n.__makeTemplateObject(["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n color: #1cc286;\n margin-left: 6px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n }\n"],["\n font-weight: 600;\n margin: 0;\n font-size: 18px;\n color: #1cc286;\n margin-left: 6px;\n\n @media (min-width: 768px) {\n font-size: 18px;\n }\n"]))),E=D.default.h2(u||(u=n.__makeTemplateObject(["\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin: 0;\n"],["\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin: 0;\n"]))),R=D.default.div(w||(w=n.__makeTemplateObject(["\n font-weight: normal;\n font-size: 16px;\n margin: 0;\n line-height: 25px;\n word-break: break-word;\n margin-top: 5px;\n white-space: pre-wrap;\n"],["\n font-weight: normal;\n font-size: 16px;\n margin: 0;\n line-height: 25px;\n word-break: break-word;\n margin-top: 5px;\n white-space: pre-wrap;\n"]))),U=D.default.div(b||(b=n.__makeTemplateObject(["\n width: 100% !important;\n min-width: 100%;\n height: initial !important;\n min-height: 250px;\n background-size: contain !important;\n margin: 0 !important;\n line-height: 0;\n\n @media (min-width: 768px) {\n width: unset;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n padding: 20px;\n }\n"],["\n width: 100% !important;\n min-width: 100%;\n height: initial !important;\n min-height: 250px;\n background-size: contain !important;\n margin: 0 !important;\n line-height: 0;\n\n @media (min-width: 768px) {\n width: unset;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n padding: 20px;\n }\n"]))),V=D.default(o.Image)(v||(v=n.__makeTemplateObject(["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n"],["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n"]))),X=D.default.video(j||(j=n.__makeTemplateObject(["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n"],["\n width: 100%;\n min-width: 50%;\n max-width: 100%;\n background-color: #fff;\n display: inline-block;\n vertical-align: middle;\n max-height: calc(100vh - 100px);\n max-height: calc(100dvh - 100px);\n"]))),G=D.default.div(_||(_=n.__makeTemplateObject(["\n padding: 20px;\n border-top: 1px solid #eee;\n cursor: pointer;\n"],["\n padding: 20px;\n border-top: 1px solid #eee;\n cursor: pointer;\n"]))),J=D.default.div(k||(k=n.__makeTemplateObject(["\n align-items: center;\n margin-top: 10px;\n margin-bottom: 15px;\n font-size: 12px;\n line-height: 16px;\n text-align: center;\n max-width: 192px;\n"],["\n align-items: center;\n margin-top: 10px;\n margin-bottom: 15px;\n font-size: 12px;\n line-height: 16px;\n text-align: center;\n max-width: 192px;\n"]))),K=D.default(o.Image)(y||(y=n.__makeTemplateObject(["\n max-height: 100px;\n height: auto;\n width: auto;\n"],["\n max-height: 100px;\n height: auto;\n width: auto;\n"]))),P=D.default.div(z||(z=n.__makeTemplateObject(["\n display: inline-block;\n padding: 10px;\n border: 1px solid #ececec;\n line-height: 0;\n text-align: center;\n width: 100%;\n box-sizing: border-box !important;\n max-width: 192px;\n"],["\n display: inline-block;\n padding: 10px;\n border: 1px solid #ececec;\n line-height: 0;\n text-align: center;\n width: 100%;\n box-sizing: border-box !important;\n max-width: 192px;\n"]))),Q=D.default.div(T||(T=n.__makeTemplateObject(["\n @media (min-width: 768px) {\n min-width: 40%;\n }\n"],["\n @media (min-width: 768px) {\n min-width: 40%;\n }\n"]))),W=D.default.div(O||(O=n.__makeTemplateObject(["\n display: flex;\n justify-content: end;\n margin-top: 20px;\n"],["\n display: flex;\n justify-content: end;\n margin-top: 20px;\n"]))),Z=D.default.div(I||(I=n.__makeTemplateObject(["\n display: flex;\n cursor: pointer;\n"],["\n display: flex;\n cursor: pointer;\n"]))),$=D.default.div(q||(q=n.__makeTemplateObject(["\n display: flex;\n cursor: pointer;\n"],["\n display: flex;\n cursor: pointer;\n"]))),nn=D.default.span(C||(C=n.__makeTemplateObject(["\n font-size: 15px;\n text-align: right;\n margin-right: 15px;\n margin-left: 4px;\n"],["\n font-size: 15px;\n text-align: right;\n margin-right: 15px;\n margin-left: 4px;\n"]))),en=D.default.span(F||(F=n.__makeTemplateObject(["\n font-size: 15px;\n text-align: right;\n margin-left: 4px;\n"],["\n font-size: 15px;\n text-align: right;\n margin-left: 4px;\n"]))),tn=D.default.span(M||(M=n.__makeTemplateObject(["\n cursor: pointer;\n display: inline-block;\n position: absolute;\n background: #fff;\n color: #000;\n box-shadow: none;\n opacity: 0.8;\n top: 0;\n right: 0;\n z-index: 3;\n font-size: 0;\n line-height: 30px;\n text-align: center;\n width: 45px;\n height: 50px;\n font-weight: 400;\n float: right;\n\n &::before {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(-45deg);\n }\n\n &::after {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(45deg);\n }\n"],["\n cursor: pointer;\n display: inline-block;\n position: absolute;\n background: #fff;\n color: #000;\n box-shadow: none;\n opacity: 0.8;\n top: 0;\n right: 0;\n z-index: 3;\n font-size: 0;\n line-height: 30px;\n text-align: center;\n width: 45px;\n height: 50px;\n font-weight: 400;\n float: right;\n\n &::before {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(-45deg);\n }\n\n &::after {\n content: '';\n position: absolute;\n height: 1px;\n width: 100%;\n top: 50%;\n left: 0;\n margin-top: -1px;\n background: #000;\n transform: rotate(45deg);\n }\n"])));module.exports=function(e){var o=e.reviewId,p=e.reviewerName,c=e.date,h=e.rating,x=e.stars,m=e.title,s=e.description,g=e.image,f=e.modalId,u=e.maxFullScreen,w=void 0!==u&&u,b=e.verified,v=e.productImage,j=e.productTitle,_=e.productLink,k=e.helpfulCount,y=void 0===k?0:k,z=e.helpfulAction,T=e.notHelpfulCount,O=void 0===T?0:T,I=e.notHelpfulAction,q=e.dateFormat,C=void 0===q?a.DateFormat.DDMMYY:q,F=null==g?void 0:g.src.includes("/video"),M=t.useRef(null),D=l.useModal(f),an=D.opened,on=D.close;return t.useEffect((function(){M.current&&(an?M.current.play():M.current.pause())}),[an]),i.jsx(l.Modal,n.__assign({id:f,maxFullScreen:w,padding:"0"},{children:i.jsxs(L,{children:[i.jsx(tn,n.__assign({onClick:on},{children:"X"}),void 0),i.jsx(U,{children:g&&(F?i.jsx(X,{ref:M,src:g.src,width:"100%",controls:!0},void 0):i.jsx(V,{src:g.src,alt:g.alt},void 0))},void 0),i.jsxs(Q,{children:[an&&i.jsxs(Y,{children:[p,b&&i.jsx(B,{children:"Verified Buyer"},void 0)]},void 0),i.jsxs(S,n.__assign({"data-testid":"review-detail-content"},{children:[i.jsxs(H,{children:[i.jsx(r.StarList,{starsNumber:5,rating:h,fill:x.color,size:x.size},void 0),i.jsx(N,{children:a.formatDate(c,C)},void 0)]},void 0),i.jsxs(A,{children:[i.jsx(E,{children:m},void 0),i.jsx(R,{dangerouslySetInnerHTML:{__html:s}},void 0)]},void 0),i.jsxs(W,{children:[i.jsxs(Z,n.__assign({"data-testid":"helpful-action",onClick:function(){return z?z(o):void 0}},{children:[i.jsx(d.Icon.Custom.ThumbsUp,{width:1,height:1,fill:"#000"},void 0),i.jsx(nn,{children:y},void 0)]}),void 0),i.jsxs($,n.__assign({"data-testid":"not-helpful-action",onClick:function(){return I?I(o):void 0}},{children:[i.jsx(d.Icon.Custom.ThumbsDown,{width:1,height:1,fill:"#000"},void 0),i.jsx(en,{children:O},void 0)]}),void 0)]},void 0)]}),void 0),v&&_&&i.jsxs(G,n.__assign({onClick:function(){return window.location.href=_}},{children:[i.jsx(P,{children:i.jsx(K,{src:v,alt:"productImage"},void 0)},void 0),i.jsx(J,{children:j},void 0)]}),void 0)]},void 0)]},void 0)}),void 0)};
|
|
2
2
|
//# sourceMappingURL=ReviewDetail.js.map
|
package/package.json
CHANGED