import{j as t,r as o}from"./react-B_SyE9nW.js";import{S as e,o as r,B as s,q as a,n,t as i,A as c,E as x}from"./index-BQSZGmOF.js";import{M as d}from"./index-B6oO2W5I.js";import{P as l}from"./BagIco-DIsX_3l_.js";import{u}from"./embla-carousel-react.esm-NewS-kch.js";import{a as p}from"./SortProductReview-g2VrMATf.js";function m(o){return t.jsx(e,{...o,viewBox:"0 0 26 7",children:t.jsx("path",{d:"M26 2.1V0L13 4.6 0 0v2.1L13 7z"})})}function f(o){return t.jsx(e,{...o,viewBox:"0 0 26 7",children:t.jsx("path",{d:"M26 4.9V7L13 2.4 0 7V4.9L13 0z"})})}const j={width:"100%","& .MuiSvgIcon-root":{color:"var(--btn-expand-color)"}};const h=r((function({onClick:o,expanded:e,color:r="gray50"}){return t.jsx(s,{onClick:o,sx:j,style:{"--btn-expand-color":a[r]},className:"enj-btn-expand",children:e?t.jsx(m,{}):t.jsx(f,{})})})),g={"& .MuiDialog-paper":{width:"fit-content",maxWidth:"none",minWidth:"322px"},"& .MuiDialogContent-root":{"@media(max-width:768px)":{px:"15px"}}};const v=r((function(){const e=o.useContext(l),{loadData:r,clear:s}=e,a=u();return o.useLayoutEffect((()=>{if(n.isRateProduct){const t=a.get("productSlug");t&&r({slug:t})}}),[a,n.isRateProduct]),o.useLayoutEffect((()=>()=>{s()}),[a]),t.jsx(d,{open:n.isRateProduct,onClose:()=>{c(),a.delete("productSlug"),x.replace({search:a.toString()})},sx:g,title:i("reviews"),marginTitle:"0",centerText:!1,children:t.jsx(p,{forModal:!0})})}));export{h as B,v as R};