import{j as t,e as D,L as B,T as R}from"./main-5057ff34.js";import{c as y}from"./chunk-index-89b7ba38.js";import{m as S,j as K,u as q,l as h,k as J,G as p,i as j,C as V,at as X,aA as Y,an as Z,n as w,e as b}from"./chunk-material-ui-eb5bb5f8.js";import{r as U}from"./chunk-react-162a731f.js";import{s as tt,W as et,B as ot,b as at,N as st}from"./chunk-Helmet-930b1405.js";const rt=S(o=>({cardRoot:{position:"relative",border:"unset",borderRadius:"unset",overflow:"unset"}}),{name:"ProductCard"}),mt=o=>{const a=rt();return t.jsx(K,{variant:"outlined",classes:{root:y(a.cardRoot)},children:o.children})},ut=({url:o,imgUrl:a=[],imgTitle:m,imgAlt:u,technologies:r,badge:i,advertBadge:x,sizes:c,onClickSize:n,containerSize:d,productSku:f,inWishlist:F,setClickOnWishListIcon:C,isUserAuth:N,colorRef:A,parentRef:k,addWishList:I,wishListItem:z,selectColor:H,showDisplayProductSiazes:M,setShowDisplayProductSizes:L,onCardClick:O,productId:_,isComingSoon:g,setIsComingSoon:$})=>{var P,T;const e=tt(),G=D(),[v,Q]=U.useState(!1),W=q("(max-width: 1024px)"),E=s=>{n&&n(s)};return t.jsxs(h,{classes:{root:y(e.productRoot,d==="small"&&e.productSmall,d==="medium"&&e.productMedium,d==="big"&&e.productBig,d==="main"&&e.productMain)},component:"div",ref:k,children:[a==null?void 0:a.map(s=>t.jsx("link",{rel:"preload",href:s,as:"image"})),C&&t.jsx(et,{setClickOnWishListIcon:C,inWishlist:F,productSku:f,isUserAuth:N,colorRef:A,addWishList:I,wishListItem:z,parentRef:k}),t.jsxs(J,{onClick:async s=>{await O(s),G(o,{preventScrollReset:!0,state:{sku:f}})},component:B,to:o??"",classes:{root:e.containerLink},children:[t.jsxs(p,{classes:{root:e.badgeGrid},children:[i&&t.jsx(j,{classes:{root:y(e.badgeStyle,i==="SOON"?e.badgeSoon:e.badgeNew)},label:i}),!Array.isArray(x)&&t.jsx(ot,{...x})]}),t.jsxs(p,{classes:{root:y(e.productImgGrid,(a==null?void 0:a[1])&&e.imgHover)},children:[t.jsx(h,{component:"img",classes:{media:e.productImg},src:a==null?void 0:a[0],alt:u,title:m,loading:"lazy"}),(a==null?void 0:a[1])&&t.jsx(h,{component:"img",classes:{media:e.productImg},src:a[1],alt:u,title:m,loading:"lazy"})]}),t.jsx("meta",{itemProp:"image",content:a==null?void 0:a[0]}),t.jsx(h,{component:"img",classes:{media:e.productImgTechno},src:r==null?void 0:r.image,alt:r==null?void 0:r.name,title:r==null?void 0:r.name})]}),g?t.jsx(at,{productId:_,isComingSoon:g,setIsComingSoon:$}):M&&!W&&t.jsx(V,{maxWidth:!1,disableGutters:!0,classes:{root:e.sizeContainer},children:t.jsx(X,{mouseEvent:"onMouseDown",touchEvent:"onTouchStart",onClickAway:()=>L(!1),children:t.jsxs(p,{container:!0,spacing:1,children:[c&&((T=(P=Object.values(c))==null?void 0:P.sort((s,l)=>!!s.name<!!l.name?1:-1))==null?void 0:T.sort((s,l)=>!!s.is_available<!!l.is_available?1:-1).map((s,l)=>t.jsx(t.Fragment,{children:s.is_available?t.jsx(p,{item:!0,md:"auto",children:t.jsx(j,{onClick:()=>E(s.id),classes:{root:e.sizeBtn,outlined:e.sizeBtnOutlined,clickable:e.sizeBtnClickable},label:s.name,variant:"outlined"})},l):t.jsx(t.Fragment,{children:v&&t.jsx(p,{item:!0,md:"auto",children:t.jsx(st,{sizeTitle:s.name,productPreview:!0,colorName:H},s.id)},l)})}))),(c==null?void 0:c.find(s=>!s.is_available))&&t.jsx(p,{item:!0,md:"auto",children:t.jsx(j,{variant:"outlined",icon:v?t.jsx(Y,{}):t.jsx(Z,{}),classes:{root:y(e.sizeBtn,e.setNoQuantity),outlined:e.sizeBtnOutlined,clickable:e.sizeBtnClickable},onClick:()=>Q(s=>!s)})})]})})})]})},nt=S(o=>({link:{textDecoration:"none"},cardContentRoot:{padding:0,"&:not(:last-child)":{paddingBottom:o.spacing(1)},"&:last-child":{padding:0}},productCategory:{display:"block",fontFamily:"TTFirsNeue-Light, sans-serif",fontWeight:300,color:o.textColor.black60.color,fontSize:"0.875rem",lineHeight:"1.5rem","@media (max-width: 479px)":{fontSize:o.typography.pxToRem(12),lineHeight:o.typography.pxToRem(14)}},productName:{fontFamily:"TTFirsNeue-Regular,sans-serif",fontWeight:400,fontSize:"0.875rem",lineHeight:"1.5rem",textTransform:"none","@media (max-width: 479px)":{fontSize:o.typography.pxToRem(12),lineHeight:o.typography.pxToRem(14)},"& b":{textTransform:"uppercase",fontFamily:o.typography.h2.fontFamily}},productChipPrice:{color:o.color.black60,height:26,textTransform:"uppercase",borderRadius:9,border:"1px solid #8F9BA4",boxSizing:"border-box",backgroundColor:o.color.black0,fontSize:"0.875rem","@media (max-width: 479px)":{border:"0.75px solid #8F9BA4",borderRadius:"5px",height:"25px",lineHeight:"16px"}},productPrice:{fontFamily:"TTFirsNeue-Medium, sans-serif",fontWeight:400,marginRight:o.spacing(1),"@media (max-width: 479px)":{fontSize:"0.625rem",lineHeight:"1rem"}},productOldPrice:{position:"relative",marginRight:o.spacing(2),"&:after":{position:"absolute",content:"' '",width:"100%",height:"1px",left:"0",top:"9px",background:o.color.black60,border:`1px solid ${o.color.black0}`,transform:"rotate(-3deg)",zIndex:10},"@media (max-width: 479px)":{fontSize:"0.625rem",lineHeight:"1rem","&:after":{top:"5px"}}}}),{name:"ProductInfo"}),xt=({title:o,brandName:a,name:m,price:u,oldPrice:r,percent:i,url:x,metaDesk:c})=>{const n=nt(),d=`${o} ${a} ${m}`;return t.jsxs(t.Fragment,{children:[t.jsx(w,{classes:{root:n.cardContentRoot},children:t.jsxs(B,{className:n.link,title:d,to:x,children:[t.jsx("div",{itemProp:"brand",itemType:"http://schema.org/Brand",itemScope:!0,children:t.jsx("meta",{itemProp:"name",content:a})}),t.jsxs(b,{itemProp:"category",variant:"body1",component:"span",classes:{root:n.productCategory},children:[o,"В "]}),t.jsxs(b,{itemProp:"name",variant:"body1",component:"span",classes:{root:n.productName},children:[t.jsx("b",{children:a})," ",m]})]})}),t.jsx("meta",{itemProp:"description",content:c}),t.jsx("meta",{itemProp:"url",content:x}),t.jsxs(w,{classes:{root:n.cardContentRoot},children:[t.jsxs(b,{itemProp:"offers",itemScope:!0,itemType:"http://schema.org/Offer",variant:"body1",component:"span",classes:{body1:n.productPrice},children:[t.jsx("meta",{itemProp:"price",content:String(u)}),t.jsx("meta",{itemProp:"priceCurrency",content:"RUB"}),t.jsx("link",{itemProp:"availability",href:"http://schema.org/InStock"}),R(u)]})," ",i&&r&&t.jsx(b,{dangerouslySetInnerHTML:{__html:R(r)},variant:"body1",component:"span",classes:{body1:n.productOldPrice}}),i&&t.jsx(j,{classes:{root:n.productChipPrice},label:i})]})]})};export{mt as P,ut as a,xt as b};