1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a9c41dc6-255f-4e16-ad53-d20683bb7d79",e._sentryDebugIdIdentifier="sentry-dbid-a9c41dc6-255f-4e16-ad53-d20683bb7d79")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2097],{27939:(e,t,l)=>{function i(e){return e.split(/[+,]/).map(e=>e.trim()).filter(Boolean).join(",")}function r(e,t){return i(e)===i(t)}function o(e){let t=e.split(/[+,]/).map(e=>e.trim()).filter(Boolean);return t.length<2?e.trim():t.join("+")}l.d(t,{F1:()=>o,V8:()=>r})},30544:(e,t,l)=>{l.d(t,{M8:()=>n,W2:()=>o,eJ:()=>a});var i=l(1258),r=l(58249);function o(e){return(0,r.I)({...i.P.diamondTable.content(e),staleTime:3e5})}function n(e){return(0,r.I)({...i.P.diamondTable.contentBelowTable(e),staleTime:3e5})}function a(e){return(0,r.I)({...i.P.diamondTable.content(e),select:e=>{var t,l;let i=null==e||null==(t=e.diamondTable)?void 0:t.filterBar,r=null==i||null==(l=i.filterCategories)?void 0:l.find(e=>"diamondType"===e.filterKey);return r?r.filterItems.reduce((e,t)=>{var l;return{...e,[t.slug]:{iconActive:null==(l=t.iconActive)?void 0:l.url}}},{}):{}},staleTime:3e5})}},31946:(e,t,l)=>{l.d(t,{m:()=>a});var i=l(38900),r=l(60056),o=l(69178);let n=l(98320).Ay.div.withConfig({componentId:"sc-25a6786b-0"})([".tooltip-window{opacity:1;z-index:9999;background:var(--color-white);border:0.1rem solid var(--color-grey);padding:2rem;color:var(--color-black);text-wrap:wrap;max-width:97vw;@media (min-width:","){max-width:360px;}*{font-size:var(--font-size-xxxsmall);color:var(--color-black);}}.tooltip-arrow{border:0.1rem solid var(--color-grey);}.react-tooltip__place-top .tooltip-arrow{border-top:0;border-left:0;}.react-tooltip__place-bottom-start .tooltip-arrow{border-bottom:0;border-right:0;}.react-tooltip__place-bottom .tooltip-arrow,.react-tooltip__place-bottom-end .tooltip-arrow,.react-tooltip__place-top-end .tooltip-arrow{border-top:0;border-left:0;}.react-tooltip__place-left .tooltip-arrow{border-right:0;border-top:0;}.react-tooltip__place-right .tooltip-arrow{border-left:0;border-top:0;}.tooltip-trigger{justify-content:center;align-items:center;cursor:pointer;border-radius:50%;border:0.1rem solid var(--color-grey);height:1.2rem;width:1.2rem;padding:0;position:relative;background:transparent;&.mobile-only{display:flex;@media (min-width:","){display:none;}}&.desktop-and-up{display:none;@media (min-width:","){display:flex;}}*{font-size:var(--font-size-xxxxxsmall);font-family:var(--font-family-main);text-transform:none;color:var(--color-grey);display:block;line-height:1rem;}&:hover{border-color:var(--color-teal);*{color:var(--color-teal);}}}#tooltip-carat,#tooltip-color,#tooltip-clarity,#tooltip-cut{max-width:80%;}#tooltip-certificate{max-width:220px;@media (min-width:","){max-width:17rem;}}"],e=>{let{theme:t}=e;return t.sizes.tablet},e=>{let{theme:t}=e;return t.sizes.tablet},e=>{let{theme:t}=e;return t.sizes.tablet},e=>{let{theme:t}=e;return t.sizes.tablet}),a=e=>{let{id:t,children:l,className:a,place:s,onClick:d}=e,[c,u]=(0,r.useState)(!1),m=(0,r.useRef)(null),p=e=>{m.current&&m.current.contains(e.target)||(e.stopPropagation(),u(!1),window.removeEventListener("click",p))},h=()=>{let e=!c;u(e),e&&window.addEventListener("click",p)};return(0,r.useEffect)(()=>()=>{window.removeEventListener("click",p)},[]),(0,i.jsxs)(n,{ref:m,children:[(0,i.jsx)("button",{"data-tooltip-id":t,className:"tooltip-trigger tablet-and-up",onMouseEnter:e=>{e.stopPropagation(),u(!0),window.addEventListener("click",p)},onMouseLeave:e=>{e.stopPropagation(),u(!1),window.removeEventListener("click",p)},onClick:d||h,children:(0,i.jsx)("span",{children:"i"})}),(0,i.jsx)("button",{"data-tooltip-id":t,className:"tooltip-trigger mobile-only",onClick:d||h,children:(0,i.jsx)("span",{children:"i"})}),(0,i.jsx)(o.m_,{id:t,place:s,className:"tooltip-window ".concat(a),classNameArrow:"tooltip-arrow","data-tooltip-variant":"light",isOpen:c,clickable:!1,children:l})]})}},50724:(e,t,l)=>{l.d(t,{u:()=>s});var i=l(38900),r=l(60056),o=l(17403),n=l(8270),a=l(95938);let s=e=>{var t;let{items:l,initialState:s=0,isInvestmentDiamondsEnabled:d=!1}=e,[c,u]=(0,r.useState)(s);return(0,r.useEffect)(()=>{u(s)},[s]),(0,i.jsxs)("div",{children:[d&&(0,i.jsx)("div",{className:"overflow-x-auto no-scrollbar ml-5 pr-5",children:(0,i.jsx)("div",{className:"flex justify-center items-center mt-sm mb-0 gap-4 min-w-max",children:l.map((e,t)=>{let l=t===c;return(0,i.jsx)("div",{className:"",children:(0,i.jsx)(n.Z,{buttonType:"button",ctaButtonType:l?"solid":"outline",ctaColorDesktop:"content.primary.high",ctaWidthDesktop:"fluid",className:(0,o.cn)("text-nowrap capitalize [&>button]:flex [&>button]:items-center","transition-all duration-200 ease-in-out"),onClick:async()=>{var l;await (null==(l=e.onSelect)?void 0:l.call(e)),u(t)},typography:"body-m",children:(0,i.jsxs)("div",{className:"flex flex-row flex-nowrap justify-center items-center gap-2",children:[(0,i.jsx)("span",{className:(0,o.cn)("flex flex-col",{"[&_img]:brightness-0 [&_img]:invert":l,"text-content-primary-high":!l}),children:e.icon}),(0,i.jsx)("span",{className:"flex flex-col",children:(0,i.jsx)(a.y,{bodyColorDesktop:l?"content-secondary-high":"content-primary-high",bodyColorMobile:l?"content-secondary-high":"content-primary-high",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",additionalClassNames:"text-center",children:e.title})})]})})},t)})})}),(0,i.jsx)("div",{className:"mendes_tab_content block",children:(0,i.jsx)("div",{children:null==(t=l[c])?void 0:t.content},"tab-content-".concat(c))})]})}},65681:(e,t,l)=>{function i(e){return e.replace(/\D/g,"")}l.d(t,{ZZ:()=>i}),l(57930)},82531:(e,t,l)=>{l.d(t,{T:()=>eV});var i=l(38900),r=l(35145),o=l(5874),n=l(74682),a=l(31946),s=l(10439),d=l(45357),c=l(26755),u=l(27569),m=l(86858),p=l(38663),h=l(34836),x=l(83936),y=l(57930),g=l(65681),f=l(5552),v=l.n(f),b=l(31627),j=l(60056),w=l(4967);let k=e=>{let{diamondProductList:t=[]}=e,{asPath:l}=(0,b.useRouter)(),r=(0,w.Ym)(),{_t:o}=(0,d.c3)(r),{countryCode:n}=(0,p.a)(r),a=(0,m.OY)(n),s=(0,j.useMemo)(()=>null==t?void 0:t.reduce((e,t,i)=>{if(!t||!t.price)return e;let n="diamonds"in t,s=n?t.diamonds:[t],d=s.map(e=>{let t="".concat(e.carat," ").concat(o("Carat")),l=o(e.diamondType),i=o(e.cut),r=y.Bv[e.color],n=e.color+(r?"-".concat(o(r)):"");return"".concat(t," ").concat(l," ").concat(n," ").concat(i," ").concat(e.clarity)}).join(" - "),p=encodeURIComponent(s.map(e=>{let{lotId:t}=e;return t}).join(",")),f=n?l:x.m6,v="".concat(c.pc).concat(f,"?diamond=").concat(p),b=(0,m.S3)(t.price,r,!1,!0),j=(0,h.Lb)("%%shape%%-cut-diamonds",["%%shape%%"],[t.diamondType]),w=s.map(e=>{let t=(0,g.ZZ)(e.lotId);return"".concat(u.n,"/").concat(t,"-thumb.jpg")});return[...e,{"@type":"ListItem",position:i+1,item:{"@type":"Product",name:d,description:o(j),image:n?w:w[0],url:v,brand:"VRAI",offers:{"@type":"Offer",price:b,priceCurrency:a,url:v,seller:{name:"Vrai"},availability:"https://schema.org/InStock"}}}]},[]),[t,l,r,a,o]),f={"@context":"http://schema.org","@type":"ItemList",url:"".concat(c.pc).concat(l),numberOfItems:null==s?void 0:s.length,itemListElement:s};return(0,i.jsx)(v(),{children:(0,i.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(f)}})})};var M=l(31100),N=l(64547),T=l(8581),C=l(75830),S=l(51170),L=l(19552),D=l(40325),_=l(79626),A=l(43391),P=l(68470),O=l(58495),I=l(18286);function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",l=e.cfyStep;return!!("string"==typeof l&&Object.values(C.Z4).includes(l))||!t.includes("/customize/setting-to-diamond/pairs/")&&"diamondType"in e}let F=()=>{let e=(0,b.useRouter)(),t=E(e.query,e.asPath),l=(0,j.useRef)(null);t&&!l.current&&(l.current=K(e.query)),t||(l.current=null);let r=()=>{let t={...e.query};["diamondType","bitcoin","carat","cut","color","clarity","cfyStep","preCutDiamond"].forEach(e
1=>{e in t&&delete t[e]});let l=e.pathname,i=(0,O.D)(l,t,{stripLocale:I.Xn});e.push({pathname:l,query:t},i,{shallow:!0})},{focusProps:o}=(0,A.V)({isOpen:t,onClose:r});return t&&(0,i.jsx)("div",{...o,"aria-labelledby":"cfy-modal-title",children:(0,i.jsx)(P.X,{initialOptions:l.current,isModal:!0,defaultStep:C.Z4.cfyDetails,closeModal:r})})},K=function(){var e,t;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=null!=(e=(0,T.ej)(l))?e:{},r=null!=(t=null==l?void 0:l.filterOptions)?t:[],o=(Array.isArray(r)?r:[r]).find(e=>T.m3.isDiamondType(e));return!i.diamondType&&o&&(i={...i,diamondType:o}),i};var V=l(30544),H=l(17403),R=l(6144);let B=e=>{let{className:t=""}=e;return(0,i.jsx)("div",{className:(0,H.cn)("relative overflow-hidden diamond-pull-up-parent",t),children:(0,i.jsxs)("div",{className:"inner md:border border-content-primary-lowest flex md:block",children:[(0,i.jsx)("div",{className:"flex-[0_0_50%]",children:(0,i.jsx)("div",{className:"bg-[#F7F7F7] min-h-[23.3vw] h-full flex items-center justify-center animate-pulse",children:(0,i.jsx)(R.j,{width:170,height:170})})}),(0,i.jsx)("div",{className:"content-rows relative transition bg-white h-full flex-1",children:(0,i.jsx)("div",{className:"content-rows-inner py-sm relative",children:(0,i.jsxs)("div",{className:"content-row flex px-sm",children:[(0,i.jsxs)("div",{className:"text flex-1",children:[(0,i.jsx)("span",{className:"w-[175px] mb-sm block h-[20px] bg-[#F7F7F7] skeleton-shimmer "}),(0,i.jsx)("span",{className:"w-[100px] mb-sm block h-[20px] bg-[#F7F7F7] skeleton-shimmer "}),(0,i.jsx)("span",{className:"w-[250px] block h-[20px] bg-[#F7F7F7] skeleton-shimmer "})]}),(0,i.jsx)("div",{className:"favorite relative top-[2px] right-[-15px] md:right-[0px]",children:(0,i.jsx)("span",{className:"w-[20px] block h-[20px] bg-[#F7F7F7] skeleton-shimmer"})})]})})})]})})};var z=l(38662),q=l(8270),U=l(95938),Z=l(24895),W=l(6794),G=l(25725);let Y=(e,t,l)=>{var i,r;let o="diamonds"in e,n="",a=!1,s=!1,d={...t},c=!1;if(o?(n=e.diamonds.map(e=>e.lotId).join(","),a=(null==(i=e.diamonds)?void 0:i.some(e=>{var t;return null==(t=e.lotId)?void 0:t.endsWith("-B")}))||!1):(n=e.lotId,s="cto-diamonds"===e.slug,a=(null==(r=e.lotId)?void 0:r.endsWith("-B"))||!1),n&&t.diamond!==n)if(s){c=!0;let i=l.includes("/diamonds/bitcoin");d={...t,diamondType:e.diamondType,...i&&{bitcoin:a?C._q.AddBitcoins:C._q.JustDiamond},carat:e.carat.toString(),color:e.color,cut:e.cut,clarity:e.clarity,cfyStep:C.Z4.cfyDetails}}else c=!0,d.diamond=n;return{pathname:l,query:d,shouldNavigate:c}};var J=l(77094),X=l.n(J);function $(e){let{row:t,openModal:l,children:r,disabled:o,onClick:n,...a}=e,{pathname:s,query:d}=(0,b.useRouter)(),{pathname:c,query:u}=Y(t.original,d,s),m=(0,O.D)(c,u,{stripLocale:I.Xn});return(0,i.jsx)(X(),{href:{pathname:c,query:u},as:m,prefetch:!1,onClick:e=>{if(null==n||n(e),!e.defaultPrevented){if(o)return void e.preventDefault();0!==e.button||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),e.currentTarget.blur(),l(t.original))}},"aria-disabled":o||void 0,...a,children:r})}var Q=l(76929),ee=l(16935);let et=e=>{let{color:t,clarity:l,cut:r,className:o="",isCTODiamond:n}=e,a=(0,w.Ym)(),{_t:s}=(0,d.c3)(a),c=(0,T.y9)(t,n),u=n?c:s(c);return(0,i.jsxs)("ul",{"data-testid":"diamond-attributes",className:o,children:[(0,i.jsxs)("li",{className:"flex",children:[(0,i.jsx)(U.y,{bodyColorDesktop:"content-primary-mid",bodyColorMobile:"content-primary-mid",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",bodyText:"".concat(s("color")),additionalClassNames:"mr-[4px]"}),(0,i.jsx)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",bodyText:"".concat(u)})]}),(0,i.jsxs)("li",{className:"flex",children:[(0,i.jsx)(U.y,{bodyColorDesktop:"content-primary-mid",bodyColorMobile:"content-primary-mid",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",bodyText:"".concat(s("clarity")),additionalClassNames:"mr-[4px]"}),(0,i.jsx)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",bodyText:"".concat(s(l))})]}),(0,i.jsxs)("li",{className:"flex",children:[(0,i.jsx)(U.y,{bodyColorDesktop:"content-primary-mid",bodyColorMobile:"content-primary-mid",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",bodyText:"".concat(s("cut")),additionalClassNames:"mr-[4px]"}),(0,i.jsx)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",bodyText:"".concat(s(r))})]})]})};
1var el=l(71908),ei=l(50407),er=l(52315),eo=l.n(er);function en(e){let{diamondImage:t,diamondType:l,diamondVideo:r,aspectRatio:o,lotId:n,videoLoadEnabled:a=!1,videoPlaying:s=!1,isCtoDiamond:d=!1}=e,[c,u]=(0,j.useState)(!1),[m,p]=(0,j.useState)(!1),h="sm"!==(0,G.U)();(0,j.useEffect)(()=>{if(!h||!r)return;let e=!1;return(async()=>{try{let t=await fetch("/api/common/check_asset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:r})}),l=await t.json();e||l.exists||p(!0)}catch(t){e||p(!0)}})(),()=>{e=!0}},[r,h]);let x=m||c,y="square"===o?"aspect-square":"aspect-[3/4]",g=h&&a&&!x,f="h-full w-full object-cover";return(0,i.jsxs)("div",{className:(0,H.cn)("relative overflow-hidden",y),children:[d&&(0,i.jsx)("span",{className:"md:hidden mendes body-xs absolute top-0 left-0 p-4 sm:block",children:(0,i.jsx)(Z.A,{children:"CUT FOR YOU"})}),g?(0,i.jsx)(ei.Z,{url:r,playing:s,muted:!0,loop:!0,width:"100%",height:"100%",className:f,config:{file:{attributes:{preload:a?"auto":"none",poster:t,class:f}}}}):null,x||g?null:(0,i.jsx)(eo(),{src:t,alt:l,fill:!0,className:f,onError:()=>u(!0)}),x?(0,i.jsx)(el.e,{diamondType:l,className:(0,H.cn)("h-full w-full p-xl object-contain bg-alt",y)}):null]})}let ea=e=>{var t,l,r,o,n;let{row:a,data:s,openModal:d,isAnyModalOpen:c,suppressHoverExpand:u=!1,className:h="",settingProductType:x}=e,{query:y}=(0,b.useRouter)(),g=(0,w.Ym)(),f=(0,ee.j)(),v=(0,G.U)(),{data:k}=(0,z.G)(g),[M,N]=(0,j.useState)(!1),T=null!=(n=null==s?void 0:s.diamonds)?n:[],C=(0,Q.t)({diamondOrDiamondPair:a.original,copies:(null==k?void 0:k.mendesDiamondPdp)||{},settingProductType:x}),S=null==(t=C[Q.F.AddToSetting])?void 0:t.url,L=null==(l=C[Q.F.AddToSetting])?void 0:l.copy,D=L&&L!==(null==k||null==(r=k.mendesDiamondPdp)?void 0:r.ctaCopyFinish)?L:(null==k||null==(o=k.mendesDiamondPdp)?void 0:o.ctaCopyAddToRing)||"Add to ring",_="sm"!==v;(0,j.useEffect)(()=>{(c||u||!_)&&N(!1)},[c,u,_]);let A=(0,j.useCallback)(e=>{c||u||!_||"mouse"===e.pointerType&&N(!0)},[c,u,_]),P=(0,j.useCallback)(()=>{N(!1)},[]),O=(0,j.useCallback)(e=>{N(!1),d(e)},[d]);return(0,i.jsx)("div",{className:(0,H.cn)("group/card relative h-full min-h-0 flex flex-col overflow-hidden border border-content-primary-lowest bg-white",h),onPointerEnter:A,onPointerLeave:P,children:(0,i.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,i.jsx)("div",{className:"grid shrink-0 grid-cols-2 md:gap-x-px",children:T.map(e=>{let{diamondImage:t,diamondType:l,diamondVideo:r,lotId:o}=e;return(0,i.jsx)($,{row:a,openModal:O,className:"cursor-pointer",children:(0,i.jsx)(en,{diamondImage:t,diamondType:l,diamondVideo:r,videoLoadEnabled:M,videoPlaying:M,aspectRatio:"3/4",lotId:o})},o)})}),(0,i.jsx)("div",{className:"relative flex h-full min-h-0 flex-1 flex-col bg-white transition-transform duration-300 ease-out md:translate-y-0 md:[@media(hover:hover)_and_(pointer:fine)]:group-hover/card:-translate-y-[80px] md:group-data-[modal-lock=true]/grid:translate-y-0 md:group-data-[hover-expand-suppressed=true]/grid:translate-y-0",children:(0,i.jsxs)("div",{className:"relative flex min-h-0 flex-1 flex-col py-sm",children:[(0,i.jsx)($,{row:a,openModal:O,className:"w-full text-left",children:(0,i.jsx)("div",{className:"grid grid-cols-2 pb-sm",children:T.map(e=>{let{title:t,color:l,cut:r,clarity:o,lotId:n}=e;return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"content-row flex px-sm",children:(0,i.jsx)("div",{className:"text flex-1",children:(0,i.jsxs)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",children:[(0,i.jsx)("p",{children:t.shape}),(0,i.jsxs)("p",{children:[(0,p.OG)(t.caratVal,g,2)," ",t.caratText]})]})})}),(0,i.jsx)("div",{className:"divider h-[1px] bg-content-primary-lowest mx-sm my-xs md:my-sm"}),(0,i.jsx)("div",{className:"content-row px-sm",children:(0,i.jsx)(et,{clarity:o,color:l,cut:r,className:"space-y-[2px]"})})]},n)})})}),(0,i.jsxs)("div",{className:"flex gap-x-xs justify-between px-sm pt-sm pb-sm border-t border-content-primary-lowest",children:[(0,i.jsx)($,{row:a,openModal:O,className:"w-full text-left",children:(0,i.jsxs)("div",{className:"flex",children:[(0,i.jsxs)(U.y,{bodyColorDesktop:"content-primary-mid",bodyColorMobile:"content-primary-mid",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",children:[(0,i.jsx)(Z.A,{children:"Total price"}),"\xa0"]}),(0,i.jsx)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",children:(0,m.S3)(s.totalPrice,g,!0)})]})}),(0,i.jsx)(W.l,{item:{wishlistItemType:"builder-product",setting:{wishlistItemType:"product",productSlug:null==y?void 0:y.productSlug,collectionSlug:null==y?void 0:y.collectionSlug},diamonds:null==T?void 0:T.map(e=>{let{lotId:t}=e;return{wishlistItemType:"diamond",lotId:t}})}})]}),(0,i.jsx)("div",{className:"px-sm md:absolute md:bottom-0 md:left-0 md:right-0 transition-transform duration-300 ease-out md:translate-y-full md:pointer-events-none md:[@media(hover:hover)_and_(pointer:fine)]:group-hover/card:translate-y-[80px] md:[@media(hover:hover)_and_(pointer:fine)]:group-hover/card:pointer-events-auto md:[@media(hover:hover)_and_(pointer:fine)]:group-hover/card:pb-sm md:group-data-[modal-lock=true]/grid:translate-y-full md:group-data-[modal-lock=true]/grid:pointer-events-none md:group-data-[hover-expand-suppressed=true]/grid:translate-y-full md:group-data-[hover-expand-suppressed=true]/grid:pointer-events-none",children:S?(0,i.jsx)(q.Z,{ctaLinkUrl:S,rawHref:!0,ctaButtonType:"outline",shrinkOnHover:!1,className:"w-full min-w-0",onClick:()=>f(S,a.original),children:(0,i.jsx)(Z.A,{children:D})}):(0,i.jsx)(q.Z,{ctaButtonType:"outline",buttonType:"button",shrinkOnHover:!1,className:"w-full min-w-0",onClick:()=>{O(a.original),requestAnimationFrame(()=>{let e=document.activeElement;e instanceof HTMLElement&&e.blur()})},children:(0,i.jsx)(Z.A,{children:D})})})]})})]})})},es=e=>{let{color:t="currentColor",...l}=e;return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"18",viewBox:"0 0 13 18",fill:"none",...l,children:(0,i.jsx)("path",{d:"M3.40625 17.5V15.5H0.40625V14H2.40625V4H0.40625V2.5H3.40625V0.5H4.906V2.5H7.00225V0.5H8.50225V2.577C9.37525 2.7205 10.0935 3.11758 10.657 3.76825C11.2205 4.41892 11.5023 5.2045 11.5023 6.125C11.5023 6.634 11.4093 7.1045 11.2233 7.5365C11.0374 7.96867 10.7881 8.3405 10.4753 8.652C11.0971 8.93783 11.5903 9.36633 11.955 9.9375C12.3198 10.5087 12.5023 11.1545 12.5023 11.875C12.5023 12.898 12.1538 13.7579 11.457 14.4548C10.7602 15.1516 9.90025 15.5 8.87725 15.5H8.50225V17.5H7.00225V15.5H4.906V17.5H3.40625ZM3.906 8.25H7.87725C8.47858 8.25 8.98308 8.04617 9.39075 7.
16385C9.79842 7.23083 10.0023 6.72633 10.0023 6.125C10.0023 5.52367 9.79842 5.01917 9.39075 4.6115C8.98308 4.20383 8.47858 4 7.87725 4H3.906V8.25ZM3.906 14H8.87725C9.47858 14 9.98308 13.7962 10.3908 13.3885C10.7984 12.9808 11.0023 12.4763 11.0023 11.875C11.0023 11.2737 10.7984 10.7692 10.3908 10.3615C9.98308 9.95383 9.47858 9.75 8.87725 9.75H3.906V14Z",fill:t})})};var ed=l(82846),ec=l(45420);let eu=e=>{var t,l,r,o,n,a;let{row:s,data:d,openModal:c,className:u="",isAnyModalOpen:h,suppressHoverExpand:x=!1,settingProductType:y}=e,{diamondImage:g,diamondVideo:f,title:v,price:k,color:M,cut:N,clarity:T,diamondType:C,lotId:S,isCtoDiamond:L,storedValue:D}=d,_=(0,b.useRouter)(),A=(0,w.Ym)(),P=(0,ee.j)(),O=(0,G.U)(),{data:I}=(0,z.G)(A),E=(0,j.useRef)(null),[F,K]=(0,j.useState)(!1),V="View details for ".concat(C," ").concat((0,p.OG)(v.caratVal,A,2)," ").concat(v.caratText),R=S.endsWith("-B")&&D&&!Number.isNaN(D),B=(0,j.useMemo)(()=>{let e="en-US"===A?"":"/".concat(A);return"".concat(e,"/customize/diamond-to-setting/").concat(S)},[A,S]),Y=(0,Q.t)({diamondOrDiamondPair:s.original,copies:(null==I?void 0:I.mendesDiamondPdp)||{},settingProductType:y}),J=_.asPath.includes("/customize/setting-to-diamond/"),X=(0,ec.sV)(C),el=X&&!L,ei=X&&L,er=(null==(t=Y[Q.F.AddToSetting])?void 0:t.url)||(null==(l=Y[Q.F.SelectSetting])?void 0:l.url)||(J?null:B),eo=el||ei?null:er,ea=null==(r=Y[Q.F.AddToSetting])?void 0:r.copy,eu=el?"View More Details":ei?(null==I||null==(o=I.mendesDiamondPdp)?void 0:o.ctaCopyTalkToDx)||"Contact an expert":ea&&ea!==(null==I||null==(n=I.mendesDiamondPdp)?void 0:n.ctaCopyFinish)?ea:(null==I||null==(a=I.mendesDiamondPdp)?void 0:a.ctaCopyAddToRing)||"Add to ring",em="sm"!==O;(0,j.useEffect)(()=>{(h||x||!em)&&K(!1)},[h,x,em]);let ep=(0,j.useCallback)(e=>{h||x||!em||"mouse"===e.pointerType&&K(!0)},[h,x,em]),eh=(0,j.useCallback)(()=>{K(!1)},[]),ex=(0,j.useCallback)(e=>{K(!1),c(e)},[c]),ey=(0,j.useCallback)(e=>{E.current=e},[]),eg=ec.$G[A.split("-")[0]],ef=eg&&eu.length>25?eg:eu,ev=(0,j.useCallback)(()=>{var e;null==(e=E.current)||e.call(E)},[]),eb=(0,j.useCallback)(e=>{if(em)return;let t=e.target;if(!((null==t?void 0:t.closest('[role="dialog"], [data-testid="modal"]'))||(null==t?void 0:t.closest(".favorite")))){if(ei){e.preventDefault(),e.stopPropagation(),ev();return}eo&&(e.preventDefault(),e.stopPropagation(),P(eo,s.original),_.push(eo))}},[eo,em,ev,_,s.original,ei,P]),ej="shrink-0 flex-[0_0_50%] md:flex-none md:w-full",ew=(0,H.cn)(ej,"cursor-pointer");return(0,i.jsx)("div",{className:(0,H.cn)("group/card relative h-full min-h-0 overflow-hidden border border-content-primary-lowest bg-white",u),onClickCapture:eb,onPointerEnter:ep,onPointerLeave:eh,children:(0,i.jsxs)("div",{className:"flex h-full min-h-0 w-full flex-row md:flex-col",children:[L?(0,i.jsx)("div",{className:ej,children:(0,i.jsx)(en,{diamondImage:g,diamondType:C,diamondVideo:f,videoLoadEnabled:F,videoPlaying:F,aspectRatio:"square",lotId:S,isCtoDiamond:L})}):(0,i.jsx)($,{className:ew,row:s,openModal:ex,"aria-label":V,children:(0,i.jsx)(en,{diamondImage:g,diamondType:C,diamondVideo:f,videoLoadEnabled:F,videoPlaying:F,aspectRatio:"square",lotId:S,isCtoDiamond:L})}),(0,i.jsx)("div",{className:"relative flex h-full min-h-0 flex-1 flex-col bg-white transition-transform duration-300 ease-out md:translate-y-0 md:[@media(hover:hover)_and_(pointer:fine)]:group-hover/card:-translate-y-[80px] md:group-data-[modal-lock=true]/grid:translate-y-0 md:group-data-[hover-expand-suppressed=true]/grid:translate-y-0",children:(0,i.jsxs)("div",{className:"relative flex h-full min-h-0 flex-1 flex-col md:py-sm",children:[L&&(0,i.jsx)("span",{className:"mendes lg:block body-s absolute -top-14 left-5 right-0 p-2 z-10",children:(0,i.jsx)(Z.A,{children:"CUT FOR YOU"})}),(0,i.jsxs)("div",{className:"flex px-sm",children:[L?(0,i.jsxs)("div",{className:"flex-1",children:[(0,i.jsxs)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",children:[(0,i.jsx)(Z.A,{children:C})," ",(0,p.OG)(v.caratVal,A,2)," ",(0,i.jsxs)("span",{children:[" ",v.caratText]})]}),(0,i.jsx)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",children:(0,m.S3)(k,A,!0)})]}
1):(0,i.jsxs)($,{row:s,openModal:ex,className:"flex-1 cursor-pointer","aria-label":V,children:[(0,i.jsxs)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",children:[(0,i.jsx)(Z.A,{children:C})," ",(0,p.OG)(v.caratVal,A,2)," ",(0,i.jsxs)("span",{children:[" ",v.caratText]})]}),(0,i.jsx)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-m",bodyStyleMobile:"body-m",children:(0,m.S3)(k,A,!0)})]}),(0,i.jsx)("div",{className:"favorite relative top-[2px] right-[-15px] md:right-0",children:(0,i.jsx)(W.l,{item:{wishlistItemType:"diamond",lotId:S}})})]}),(0,i.jsx)("div",{className:"h-[1px] bg-content-primary-lowest my-xs md:my-sm"}),L?(0,i.jsx)("div",{className:"px-sm block",children:(0,i.jsx)(et,{clarity:T,color:M,cut:N,isCTODiamond:L,className:"md:flex gap-x-sm"})}):(0,i.jsx)($,{row:s,openModal:ex,className:"px-sm block","aria-label":V,children:(0,i.jsx)(et,{clarity:T,color:M,cut:N,isCTODiamond:L,className:"md:flex gap-x-sm"})}),R&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"h-[1px] bg-content-primary-lowest my-xs md:my-sm"}),L?(0,i.jsx)("div",{className:"px-sm block",children:(0,i.jsxs)("div",{className:"bg-alt py-[0.8rem] px-[1.2rem] inline-flex gap-[0.4rem] items-center",children:[(0,i.jsx)(es,{}),(0,i.jsxs)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-s",bodyStyleMobile:"body-s",children:[(0,i.jsx)(Z.A,{children:"VALUE"}),":"]}),(0,i.jsx)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-s",bodyStyleMobile:"body-s",children:(0,m.S3)(D,A,!0)})]})}):(0,i.jsx)($,{row:s,openModal:ex,className:"px-sm block","aria-label":V,children:(0,i.jsxs)("div",{className:"bg-alt py-[0.8rem] px-[1.2rem] inline-flex gap-[0.4rem] items-center",children:[(0,i.jsx)(es,{}),(0,i.jsxs)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-s",bodyStyleMobile:"body-s",children:[(0,i.jsx)(Z.A,{children:"VALUE"}),":"]}),(0,i.jsx)(U.y,{bodyColorDesktop:"content-primary-high",bodyColorMobile:"content-primary-high",bodyStyleDesktop:"body-s",bodyStyleMobile:"body-s",children:(0,m.S3)(D,A,!0)})]})})]}),(0,i.jsx)("div",{className:"hidden md:block absolute bottom-0 left-0 right-0 px-sm transition-transform duration-300 ease-out md:translate-y-full md:pointer-events-none md:[@media(hover:hover)_and_(pointer:fine)]:group-hover/card:translate-y-[80px] md:[@media(hover:hover)_and_(pointer:fine)]:group-hover/card:pointer-events-auto md:[@media(hover:hover)_and_(pointer:fine)]:group-hover/card:pb-sm md:group-data-[modal-lock=true]/grid:translate-y-full md:group-data-[modal-lock=true]/grid:pointer-events-none md:group-data-[hover-expand-suppressed=true]/grid:translate-y-full md:group-data-[hover-expand-suppressed=true]/grid:pointer-events-none",children:(0,i.jsx)("ul",{className:"flex",children:(0,i.jsx)("li",{className:"flex-1",children:ei?(0,i.jsx)(ed.Y,{source:"product",productType:ec.FU,productTitle:V,ctaButtonType:"outline",registerOpenHandler:ey,children:(0,i.jsx)(Z.A,{children:ef})}):eo?(0,i.jsx)(q.Z,{ctaLinkUrl:eo,rawHref:!0,ctaButtonType:"outline",onClick:()=>P(eo,s.original),children:(0,i.jsx)(Z.A,{children:eu})}):(0,i.jsx)(q.Z,{ctaButtonType:"outline",buttonType:"button",onClick:()=>ex(s.original),children:(0,i.jsx)(Z.A,{children:eu})})})})})]})})]})})};var em=l(39842),ep=l(47922),eh=l(96187),ex=l(67789);let ey=e=>{var t,l,r,o;let{className:n="",options:a}=e,{locale:s}=(0,b.useRouter)(),{consent:c}=(0,ex.X2)(),u=(0,ep.hK)(),{_t:m}=(0,d.c3)(s),{_t:p}=(0,d.c3)(s,["DIAMOND_SHAPES"]),{data:x}=(0,V.W2)(s),{data:y}=(0,z.G)(s),g=null==x?void 0:x.diamondTable,f=null==a||null==(l=a.diamondType)||null==(t=l.split(","))?void 0:t[0],v=f?p(null==(r=(0,T.Bk)(f))?void 0:r.slug):"",w=(null==y||null==(o=y.mendesDiamondPdp)?void 0:o.ctaCopyTalkToDx)||m("Speak with a Diamond Expert"),k=(null==a?void 0:a.caratMax)&&a.caratMax>4?null==g?void 0:g.bottomPromoContentLargerCarat:null==g?void 0:g.bottomPromoContent,M=(0,h.Lb)(k,["%%product_name%%"],[v]),N=(0,j.useCallback)(()=>
1{if((null==c?void 0:c.marketing)===!0)return void(0,eh.uz)();u&&(u.setPendingHubspotChatAction(eh.uz),u.openModal())},[null==c?void 0:c.marketing,u]),C=f?M:null==g?void 0:g.bottomPromoContentNoShape;return C?(Array.isArray(C)&&(C=C.join("")),(0,i.jsx)("div",{"data-testid":"diamond-table-empty-state",className:n,children:(0,i.jsxs)("div",{className:"text-center max-w-[800px] mx-auto",children:[(0,i.jsx)(em.o,{withStyles:!1,extraClass:"cfy-cta",children:C}),(0,i.jsx)("div",{className:"cta mt-xs flex justify-center",children:(0,i.jsx)(q.Z,{ctaWidthDesktop:"inline",ctaButtonType:"solid",buttonType:"button",onClick:N,children:(0,i.jsx)(Z.A,{children:w})})})]})})):null};var eg=l(15984),ef=l(32280),ev=l(80257);let eb=e=>{var t,l,r;let{diamonds:o,openModal:n,isDiamondPairs:a,isAnyModalOpen:s,queryDiamond:c,settingProductType:u}=e,m=(0,b.useRouter)(),p=(0,w.Ym)(),{_t:h}=(0,d.c3)(p),x=(0,j.useRef)(null),[y,g]=(0,j.useState)(!1),f=m.asPath.includes("/customize/"),v=(0,j.useRef)(null),[k,M]=(0,j.useState)(!1);(0,j.useLayoutEffect)(()=>{!0!==v.current||s||M(!0),v.current=s},[s]),(0,j.useEffect)(()=>{if(!k)return;let e=window.setTimeout(()=>M(!1),700);return()=>window.clearTimeout(e)},[k]);let{data:{diamondTable:{cfyDefaultShapeImages:T}={}}={}}=(0,V.W2)(m.locale),C=()=>{try{!c.hasNextPage||c.isFetching||c.isLoading||c.fetchNextPage()}catch(e){N.zR.captureException(e,{extra:{functionName:"MendesDiamondGrid onLoadMore"}})}},S=(0,eg.W)(x);(0,j.useEffect)(()=>{g(S)},[S]),(0,j.useEffect)(()=>{c.isFetching||c.isFetchingNextPage||c.isLoading||y&&c.hasNextPage&&C()},[y,c.hasNextPage,C]);let[L,D]=(0,j.useState)(!1),_=!(null==c?void 0:c.isLoading)&&!(null==c?void 0:c.isFetching)&&!(null==c?void 0:c.isFetchingNextPage)&&0===o.length;return(0,j.useEffect)(()=>{if(o.length>0){let e=setTimeout(()=>{D(!0)},250);return()=>clearTimeout(e)}},[o.length]),(0,i.jsxs)("div",{className:(0,H.cn)("group/grid mendes-container mx-auto pt-10 grid md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-x-sm gap-y-sm md:gap-y-lg mb-sm md:mb-lg"),"data-modal-lock":s?"true":"false","data-hover-expand-suppressed":k?"true":"false",children:[(null==c?void 0:c.isLoading)&&Array.from({length:12}).map((e,t)=>(0,i.jsx)(B,{},"skeleton-card-loading-".concat(t))),_&&(0,i.jsx)(ey,{className:"col-span-full py-md",options:null==c||null==(r=c.data)||null==(l=r.pages)||null==(t=l[0])?void 0:t.options}),null==o?void 0:o.map((e,t)=>{if(!(null==e?void 0:e.original))return null;if(a){var l;let r=null==e?void 0:e.original,o=null==r||null==(l=r.diamonds)?void 0:l.map(e=>ej(e,h)),a=o[0]&&o[1]?"".concat(o[0].lotId,"-").concat(o[1].lotId):null;return a&&(0,i.jsx)(j.Fragment,{children:(0,i.jsx)(ea,{data:{diamonds:o,totalPrice:e.getValue("price")},openModal:n,isAnyModalOpen:s,suppressHoverExpand:k,row:e,settingProductType:u})},"".concat(t,"-").concat(a))}{let l=null==e?void 0:e.original,r=ej(l,h,T);return(0,i.jsx)(j.Fragment,{children:(0,i.jsx)(eu,{data:{...r,isBuilderFlow:f},openModal:n,isAnyModalOpen:s,suppressHoverExpand:k,row:e,settingProductType:u,className:(0,H.cn)("transition-opacity",L?"opacity-100":"opacity-0")})},"".concat(t,"-").concat(l.lotId))}}),(0,i.jsx)(ef.N,{children:(null==c?void 0:c.isFetching)&&Array.from({length:8}).map((e,t)=>(0,i.jsx)(ev.P.div,{animate:{opacity:1},initial:{opacity:0}
1,transition:{duration:.2},children:(0,i.jsx)(B,{})},"skeleton-card-".concat(t)))}),(0,i.jsx)("div",{className:"vo-table-trigger h-0",ref:x})]})},ej=(e,t,l)=>{var i,r,o,n,a;let{clarity:s,color:d,cut:c,price:m,lotId:p,diamondType:h,slug:x,carat:y,storedValue:f}=e,v=p?(0,g.ZZ)(p):null,b=Array.isArray(l)?null==(o=l.find(e=>e.slug===h))||null==(r=o.image)||null==(i=r.desktopImage)?void 0:i.url:null==l||null==(a=l.image)||null==(n=a.desktopImage)?void 0:n.url,j="cto-diamonds"===x,w="".concat(u.n,"/").concat(v);return{mutatedLotId:v,diamondImage:j?b:"".concat(w,"-thumb.jpg"),diamondVideo:j?b:"".concat(w,".mp4"),title:{shape:t(h),caratText:t("Carat"),caratVal:y},clarity:s,color:d,cut:c,price:m,isCtoDiamond:j,lotId:p,diamondType:h,storedValue:f}};var ew=l(36823),ek=l(54385),eM=l(70592),eN=l(33125),eT=l(41690),eC=l(25810),eS=l(93947),eL=l(13125),eD=l(52515),e_=l(22361);let eA={"round-brilliant":(0,i.jsx)(eD.$,{}),"elongated-cushion":(0,i.jsx)(()=>(0,i.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsxs)("g",{"clip-path":"url(#clip0_140_6556)",children:[(0,i.jsx)("path",{d:"M19.7642 4.48486L27.0364 5.26062L29.7545 7.26789L31.8818 11.6315L32.6067 15.2V24.8485L31.8818 28.4849L29.7545 32.1794L27.0364 34.6909L20.0636 35.5152L13.0909 34.6909L9.82908 32.1794L8.04059 28.4849L7.39453 24.8485V15.2L8.04059 11.6315L9.82908 7.26789L13.0909 5.26062L19.7642 4.48486Z",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M14.8379 7.38465L20.0458 4.6792L25.5924 7.38465L20.0458 11.118L14.8379 7.38465Z",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M30.116 13.4155L32.3694 19.6895L30.116 26.3804L27.0039 19.6895L30.116 13.4155Z",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M9.94669 13.4155L7.69336 19.6895L9.94669 26.3804L13.0588 19.6895L9.94669 13.4155Z",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M14.8379 32.635L20.0458 35.4083L25.5924 32.635L20.0458 28.8047L14.8379 32.635Z",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M14.3648 12.5915L13.0254 19.9321L14.3648 26.8267L19.9981 28.6982L25.5921 27.1758L26.9708 19.8449L25.4739 12.4364L19.9981 11.3115L14.3648 12.5915Z",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M29.7242 7.37451H25.5957",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M8.00977 11.7285L9.92431 12.4363L14.3995 12.4848V7.37451H9.79825",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M8.00977 27.9224L9.92431 27.2243L14.3995 27.1758V32.2861H9.79825",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M31.9854 11.7285L30.0709 12.4363L25.5957 12.4848V7.37451H29.7242",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M31.9854 27.9224L30.0709 27.2243L25.7848 27.1758L25.5957 32.2861H29.7242",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M9.92383 12.4363V7.37451",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M9.92383 32.344V27.2822",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M29.7227 12.4363V7.37451",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M29.7227 32.344V27.2822",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M13.0605 34.7972L14.8412 32.6348",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M27.006 34.7972L25.5957 32.6348",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M13.0605 5.36719L14.8412 7.37446",stroke:"black","stroke-miterlimit":"10"}),(0,i.jsx)("path",{d:"M27.006 5.36719L25.5957 7.37446",stroke:"black","stroke-miterlimit":"10"})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_140_6556",children:(0,i.jsx)("rect",{width:"26",height:"32",fill:"white",transform:"translate(7 4)"})})})]}),{}),asscher:(0,i.jsx)(ew.$,{}),pear:(0,i.jsx)(eC.C,{}),oval:(0,i.jsx)(eT.A,{}),cushion:(0,i.jsx)(ek.H,{}),emerald:(0,i.jsx)(eM.U,{}),princess:(0,i.jsx)(eS.x,{}),radiant:(0,i.jsx)(eL.J,{}),trillion:(0,i.jsx)(e_.L,{}),marquise:(0,i.jsx)(eN.X,{})},eP="!bg-white whitespace-nowrap",eO=e=>{var t,l,r,o,n,a,s,d,c,u,m,p,h;let{row:x,isDiamondPairs:y,isFetchingDiamonds:g,openModal:f,className:v,colorMapAbridged:k,colSize:M,settingProductType:N}=e,T=(0,b.useRouter)(),C=(0,w.Ym)(),L=(0,ee.j)(),D=(0,j.useRef)(null),{data:_}=(0,V.eJ)(C),{data:A}=(0,z.G)(C),P=(null==(t=x.original)?void 0:t.slug)==="cto-diamonds",O=(0,ec.sV)(null==(l=x.original)?void 0:l.diamondType),I=O&&!P,E=O&&P,F=!!(P&&(null==(r=x.original)?void 0:r.lotId)&&!E),K=(0,j.useMemo)(()=>{var e,t;if(!(null==(e=x.original)?void 0:e.lotId))return null;let l="en-US"===C?"":"/".concat(C);return"".concat(l,"/customize/diamond-to-setting/").concat(null==(t=x.original)?void 0:t.lotId)},[C,null==(o=x.original)?void 0:o.lotId]),R=(0,Q.t)({diamondOrDiamondPair:x.original,copies:(null==A?void 0:A.mendesDiamondPdp)||{},settingProductType:N}),B=T.asPath.includes("/customize/setting-to-diamond/"),U=(null==(n=R[Q.F.AddToSetting])?void 0:n.url)||(null==(a=R[Q.F.SelectSetting])?void 0:a.url)||(B?null:K),W=I||E?null:U,G=null==(s=R[Q.F.AddToSetting])?void 0:s.copy,Y=I?"View More Details":E?(null==A||null==(d=A.mendesDiamondPdp)?void 0:d.ctaCopyTalkToDx)||"Contact an expert":G&&G!==(null==A||null==(c=A.mendesDiamondPdp)?void 0:c.ctaCopy
1Finish)?G:(null==A||null==(u=A.mendesDiamondPdp)?void 0:u.ctaCopyAddToRing)||"Add to ring",J=(0,j.useRef)(null),[X,et]=(0,j.useState)(!1);(0,j.useEffect)(()=>{var e;if(!E)return;let t=null==(e=J.current)?void 0:e.querySelector("button");t&&0!==t.scrollWidth&&et(t.scrollWidth>t.clientWidth)},[E,Y]);let el=X&&null!=(h=ec.$G[C.split("-")[0]])?h:Y,ei=(0,j.useCallback)(e=>{D.current=e},[]),er={carat:"mendes body-s md:title-m md:justify-center",color:"mendes body-s md:title-m justify-center text-center",cut:"mendes body-s md:title-m justify-center text-center",clarity:"mendes body-s md:title-m justify-center text-center",price:"mendes body-s md:title-m justify-end ml-[-20px]",storedValue:"mendes body-s md:title-m justify-center text-center",diamondType:"mendes body-s md:title-m hidden md:flex",shape:"mendes body-s md:title-m hidden md:flex"},eo={diamondType:"hidden md:flex ",shape:"hidden md:flex"},en=e=>{if(!k||!Array.isArray(k))return"";let t=null==k?void 0:k.find(t=>t.key===e);return t&&t.value?" - ".concat(t.value.replace(/\./g,"")):""},ea=(0,i.jsx)("div",{className:"sm:mendes-container ml-5 sm:mx-auto grid grid-cols-".concat(M-1," md:grid-cols-").concat(M),children:x.getVisibleCells().map(e=>{let t="price"===e.column.id;return(0,i.jsxs)("div",{className:(0,H.cn)("vo-table-cell min-h-[50px] flex items-center md:flex-1 ",er[e.column.id],eo[e.column.id]||"flex-1",{["transition-transform duration-300 ease-out ".concat("group-hover/diamond-row:md:-translate-x-[26rem]")]:t}),children:[("diamondType"===e.column.id||"carat"===e.column.id)&&!y&&(0,i.jsx)("span",{className:(0,H.cn)("flex flex-[0_0_20px] justify-center text-center",{"md:hidden":"carat"===e.column.id,"hidden md:flex":"diamondType"===e.column.id}),children:(0,i.jsx)("div",{className:"relative right-5",children:(e=>{let t=null==_?void 0:_[e];if(!(null==t?void 0:t.iconActive))return eA[e]})(x.original.diamondType)})}),t?(0,i.jsx)("span",{className:"relative z-20 rounded-full px-xs py-xxs transition-colors duration-300 ease-out group-hover/diamond-row:md:bg-[#eeeeee]",children:(0,S.Kv)(e.column.columnDef.cell,e.getContext())}):(0,S.Kv)(e.column.columnDef.cell,e.getContext()),"\xa0","color"===e.column.id&&(0,i.jsxs)("div",{className:"flex flex-col",children:[y&&(0,i.jsx)("span",{"data-testid":"diamond-color-pair-wrapper",className:"mendes body-s md:title-m justify-center hidden lg:block",children:en(x.original.color)}),x.original.color&&(0,i.jsx)("span",{"data-testid":"diamond-color-wrapper",className:"mendes body-s md:title-m justify-center lg:block max-[990px]:hidden",children:en(x.original.color)})]}),g&&(0,i.jsx)("div",{"data-testid":"vo-table-cell-loading",className:"vo-table-cell-loading"})]},e.id)})}),es=(0,i.jsx)("div",{ref:J,className:(0,H.cn)("absolute right-0 top-1/2 z-10 hidden md:flex -translate-y-1/2 translate-x-full transform-gpu will-change-transform transition-transform duration-300 ease-out group-hover/diamond-row:-translate-x-sm","w-[26rem]"),children:E?(0,i.jsx)(ed.Y,{source:"product",productType:ec.FU,productTitle:"".concat((null==(m=x.original)?void 0:m.diamondType)||""," ").concat((null==(p=x.original)?void 0:p.lotId)||"").trim(),ctaButtonType:"outline",className:"w-full",registerOpenHandler:ei,button:{ctaButtonType:"outline",shrinkOnHover:!1,disableHoverSizeChanges:!0,heightClass:"h-[4.4rem]",buttonClassName:eP},children:(0,i.jsx)(Z.A,{children:el})}):W?(0,i.jsx)(q.Z,{ctaLinkUrl:W,rawHref:!0,ctaButtonType:"outline",shrinkOnHover:!1,disableHoverSizeChanges:!0,heightClass:"h-[4.4rem]",className:"w-full",buttonClassName:eP,onClick:()=>L(W,x.original),children:(0,i.jsx)(Z.A,{children:Y})}):(0,i.jsx)(q.Z,{ctaButtonType:"outline",buttonType:"button",shrinkOnHover:!1,disableHoverSizeChanges:!0,heightClass:"h-[4.4rem]",className:"w-full",buttonClassName:eP,onClick:()=>f(x.original),children:(0,i.jsx)(Z.A,{children:Y})})});return(0,i.jsxs)("div",{"data-testid":"mendes-diamond-table-row",className:(0,H.cn)("vo-table-row group/diamond-row relative overflow-hidden",v,{"pair-row":y,"cursor-pointer hover:bg-[#15151526]":!P}),"data-id":x.id,children:[P?(0,i.jsx)("div",{className:"vo-table-row-head border-b border-content-primary-lowest block cursor-pointer md:cursor-default",onClick:()=>{var e,t,l;if(null==(e=(t=window).matchMedia)||!e.call(t,"(min-width: 768px)").matches){if(E){null==(l=D.current)||l.call(D);return}if(F&&W){L(W,x.original),T.push(W);return}f(x.original)}},children:ea}):(0,i.jsx)($,{className:"vo-table-row-head border-b border-content-primary-lowest block",openModal:f,row:x,children:ea}),es]})},eI=()=>(0,i.jsx)("div",{className:"vo-table-row",children:(0,i.jsx)("div",{className:"vo-table-row-head border-b border-content-primary-lowest",children:(0,i.jsx)("div",{className:"mendes-container mx-auto",children:(0,i.jsx)("div",{className:"-mx-xs flex",children:["shape","carat","color","cut","clarity","price"].map(e=>(0,i.jsx)("div",{className:(0,H.cn)("vo-table-cell px-xs min-h-[50px] flex items-center md:flex-1 max-w-[75px] md:max-w-[100%]",e,"color"===e?"flex-[0_0_65px] justify-center":"shape"===e?"flex-[0_0_65px]":"carat"===e?"flex-[0_0_75px] justify-center":"cut"===e?"flex-[0_0_80px] justify-center":"price"===e?"justify-end md:pr-sm hidden md:flex pr-md ml-[-20px]":"flex-1 justify-center"),children:(0,i.jsx)("span",{className:(0,H.cn)("h-[20px] bg-[#F7F7F7] skeleton-shimmer","color"===e?"w-[65p
1x]":"carat"===e?"w-[100px]":"cut"===e||"clarity"===e?"w-[80px]":"price"===e?" w-[120px] justify-end md:pr-sm ml-[-20px] max-w-[70px] md:max-w-[120px]":"flex-1")})},e))})})})}),eE=e=>{var t,l,r,o,n,a;let{handleSortChange:s,queryDiamond:d,options:c,table:u,isDiamondPairs:m,colorMapAbridged:p,openModal:h,isModalOpen:x,settingProductType:y}=e||{},g=u.getAllColumns().length,f=["diamondType"],[v,b]=(0,j.useState)(!1),[w,k]=(0,j.useState)(!1),M=(0,j.useRef)(null),T=(0,j.useRef)(null),C=(0,j.useRef)(null),L=u.getRowModel().rows||[],D=(0,j.useRef)(null),_=!(null==d?void 0:d.isLoading)&&!(null==d?void 0:d.isFetching)&&!(null==d?void 0:d.isFetchingNextPage)&&0===L.length,A=()=>{try{!d.hasNextPage||d.isFetching||d.isLoading||d.fetchNextPage()}catch(e){N.zR.captureException(e,{extra:{functionName:"onLoadMore"}})}};return(0,j.useEffect)(()=>{let e=D.current,t=new IntersectionObserver(e=>{let[t]=e;b(t.isIntersecting)},{root:null,rootMargin:"2000px",threshold:0});e&&t.observe(e);let l=()=>{if(x)return;let e=window.innerHeight+window.scrollY;k(e>document.documentElement.scrollHeight-2e3)};return window.addEventListener("scroll",l),()=>{e&&t.unobserve(e),t.disconnect(),window.removeEventListener("scroll",l)}},[x]),(0,j.useEffect)(()=>{!d.isFetching&&!d.isFetchingNextPage&&!d.isLoading&&(v||w)&&d.hasNextPage&&A()},[v,w,d.hasNextPage,A]),(0,i.jsxs)("div",{className:"vo-table-container",ref:M,children:[(0,i.jsx)("div",{ref:T,className:"vo-table-head sticky top-[71px] bg-white z-40",children:null==(t=u.getHeaderGroups())?void 0:t.map(e=>{var t;return(0,i.jsx)("div",{className:"vo-table-row border-b border-content-primary-lowest",children:(0,i.jsx)("div",{className:(0,H.cn)("mendes-container mx-auto grid",{"grid-cols-5 md:grid-cols-6":6===g,"grid-cols-6 md:grid-cols-7":7===g}),children:null==(t=e.headers)?void 0:t.map(e=>(0,i.jsxs)("div",{"data-testid":"MendesDiamondTableRows-".concat(e.id),className:(0,H.cn)("vo-table-cell cursor-pointer md:flex-1 mendes body-xs md:body-s uppercase min-h-[48px] flex items-center ",{"justify-center":"diamondType"!==e.id&&"price"!==e.id&&"shape"!==e.id&&"carat"!==e.id,"justify-start md:justify-center":"carat"===e.id,"justify-end md:ml-[-20px] flex-1":"price"===e.id,"hidden md:flex md:flex-1":"diamondType"===e.id||"shape"===e.id,"text-center":"storedValue"===e.id}),onClick:()=>(e=>{try{let t=e.id;if(f.includes(t))return;let l=c.sortOrder||"asc";d.isFetching||s({name:t,slug:"".concat(t,"-").concat(c.sortBy!==e.id||"asc"===l?"desc":"asc")});let i=M.current.getBoundingClientRect().top+window.scrollY-55;window.innerWidth>992?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo({top:i,behavior:"smooth"})}catch(e){N.zR.captureException(e,{extra:{functionName:"onHeaderClick"}})}})(e),children:[(0,S.Kv)(e.column.columnDef.header,e.getContext()),(0,i.jsxs)("div",{className:(0,H.cn)("vo-sort-icon",{"has-active":c.sortBy===e.id,"!hidden":f.includes(e.id)}),children:[(0,i.jsx)("span",{className:"arrow-up"+(c.sortBy===e.id&&"asc"===c.sortOrder?" active":"")}),(0,i.jsx)("span",{className:"arrow-down"+(c.sortBy===e.id&&"desc"===c.sortOrder?" active":"")})]})]},e.id))})},e.id)})}),(0,i.jsxs)("div",{ref:C,className:"vo-table-body",children:[d.isLoading&&(null==(l=Array.from({length:20}))?void 0:l.map((e,t)=>(0,i.jsx)(eI,{},t))),_&&(0,i.jsx)(ey,{className:"py-md",options:null==d||null==(n=d.data)||null==(o=n.pages)||null==(r=o[0])?void 0:r.options}),null==L?void 0:L.map((e,t)=>(0,i.jsx)(j.Fragment,{children:(0,i.jsx)(eO,{row:e,isDiamondPairs:m,isFetchingDiamonds:d.isFetching,openModal:h,className:t%2==0?"bg-alt":"",colorMapAbridged:p,colSize:g,settingProductType:y},e.id)},"table-row-".concat(t))),d.hasNextPage&&d.isFetching&&(null==(a=Array.from({length:20}))?void 0:a.map((e,t)=>(0,i.jsx)(eI,{},t))),(0,i.jsx)("div",{className:"vo-table-trigger",ref:D})]})]})};var eF=l(46785);let eK=e=>{let{diamonds:t,accessorKey:l,renderValue:r,className:o=""}=e,n=t.map(e=>e[l]),a=t.map(e=>e.diamondType),s={carat:"items-start md:items-center",diamondType:"items-start",price:"items-end"};return(0,i.jsx)("div",{className:(0,H.cn)("min-h-[72px] flex flex-col justify-center mendes !body-m text-content-primary-high",o,s[l]?
1s[l]:"items-center"),children:n.map((e,t)=>(0,i.jsxs)("div",{className:(0,H.cn)("font-[inherit] flex justify-center items-center whitespace-nowrap text-black mendes body-s md:title-m",{"h-[24px] md:h-auto":"carat"===l}),children:[("diamondType"===l||"carat"===l)&&(0,i.jsx)("span",{className:(0,H.cn)("mr-sm flex items-center justify-center text-center",{"md:hidden title-m":"carat"===l,"hidden md:flex":"diamondType"===l}),children:eA[a[t]]})," ",r?r(e):(0,i.jsx)(Z.A,{children:e})]},t.toString()))})},eV=e=>{var t;let{initialDiamonds:l,initialOptions:c,handleSortChange:u,isBuilderFlowOpen:h,isDiamondPairs:x,settingProductType:y,setRangesOfDiamondFilter:g,tableView:f=null,colorMapAbridged:v,tablePostProcessing:A=e=>e.value}=e,P="investment"===e.diamondQueryType,K=(0,b.useRouter)(),{asPath:V}=K,H=(0,w.Ym)(),R=(0,o.u)(),{_t:B}=(0,d.c3)(H),[z,q]=(0,j.useState)(!1),[U,Z]=(0,j.useState)(null),[W,G]=(0,j.useState)(null),J=(0,j.useMemo)(()=>E(K.query,K.asPath),[K.asPath,K.query]),X=z||J;(0,j.useContext)(_.YK);let $={...c,limit:20,fields:"lotId,carat,slug,color,cut,clarity,price,diamondType",diamondQueryType:e.diamondQueryType};P&&($.includeCto=!0),V.includes("toi-moi")?$.view="toimoi":x||($.includeCto=!0);let Q=(0,M.L1)((0,T.sU)($,H)),ee=(0,j.useMemo)(()=>{var e,t;return null==(t=Q.data)||null==(e=t.pages)?void 0:e.flatMap(e=>e.diamonds)},[Q.data]),et=(0,j.useMemo)(()=>[{accessorKey:"diamondType",cell:e=>{let t=null==e?void 0:e.row.original.diamondType;return(0,i.jsx)("span",{className:"tablet-and-up",children:(0,i.jsx)(s.A,{children:A({value:el(t),type:"cell"})})})},header:()=>(0,i.jsx)(s.A,{children:A({value:"Shape",type:"column"})})},{accessorKey:"carat",cell:e=>{var t,l;let r=Number(null==e?void 0:e.getValue()),o=(null==e||null==(l=e.row)||null==(t=l.original)?void 0:t.slug)==="cto-diamonds";return(0,i.jsxs)("span",{className:"flex flex-col items-start md:items-center w-full",children:[(0,p.OG)(r,H),(0,i.jsx)("span",{className:"text-sm md:text-lg font-medium text-left md:text-center w-[200%] md:w-3/4",children:(0,i.jsx)(s.A,{children:o?"CUT FOR YOU":""})})]})},header:()=>(0,i.jsx)(s.A,{children:"carat"})},{accessorKey:"color",cell:e=>{var t,l;let r=(null==e||null==(l=e.row)||null==(t=l.original)?void 0:t.slug)==="cto-diamonds",o=(0,T.y9)(e.getValue(),r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"hidden max-[990px]:block lg:hidden text-center",children:o}),(0,i.jsx)("span",{className:"max-[990px]:hidden lg:block",children:r?A({value:"".concat(o," - ").concat(B(e.getValue())),type:"cell"}):(0,i.jsx)(s.A,{children:A({value:e.getValue(),type:"cell"})})})]})},header:()=>(0,i.jsx)(s.A,{children:"color"})},{accessorKey:"cut",cell:e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"mobile-only text-center",children:B(A({value:e.getValue(),type:"cell"})).replace("+","+ ")}),(0,i.jsx)("span",{className:"tablet-and-up",children:(0,i.jsx)(s.A,{children:A({value:e.getValue(),type:"cell"})})})]}),header:()=>(0,i.jsx)(s.A,{children:"cut"})},{accessorKey:"clarity",cell:e=>null==e?void 0:e.getValue(),header:()=>(0,i.jsx)(s.A,{children:"clarity"})},...P?[{accessorKey:"storedValue",cell:e=>{let t=null==e?void 0:e.getValue();return(0,m.S3)(Number(t),H,!0)},header:()=>(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("span",{className:"mr-3 flex items-center gap-2",children:[(0,i.jsx)(a.m,{id:"price-tooltip",place:"left",onClick:t=>{t.stopPropagation(),t.preventDefault(),e.investmentDiamondEducationPageCta&&window.open("/bitcoin-diamond-TM","_blank")}}),(0,i.jsx)(s.A,{children:"value stored"})]})})}]:[],{accessorKey:"price",cell:e=>{let t=null==e?void 0:e.getValue();return(0,m.S3)(Number(t),H,!0)},header:()=>(0,i.jsx)(s.A,{children:"price"})}],[H,B]),{_t:el}=(0,d.c3)(H,["DIAMOND_SHAPES"]),ei=(0,j.useMemo)(()=>[{accessorKey:"shape",cell:e=>{if((0,C.fC)(e.row.original)){let t=e.row.original.diamonds;return(0,i.jsx)(eK,{diamonds:t,accessorKey:"diamondType",renderValue:e=>el(e)})}},header:()=>(0,i.jsx)(s.A,{children:"shape"})},{accessorKey:"carat",cell:e=>{if((0,C.fC)(e.row.original)){let t=e.row.original.diamonds;return(0,i.jsx)(eK,{diamonds:t,accessorKey:"carat",renderValue:e=>{let t=Number(e);return(0,p.OG)(t,H)}})}},header:()=>(0,i.jsx)(s.A,{children:"carat"})},{accessorKey:"color",cell:e=>{if((0,C.fC)(e.row.original)){let t=e.row.original.diamonds;return(0,i.jsx)(eK,{diamonds:t,accessorKey:"color"})}},header:()=>(0,i.jsx)(s.A,{children:"color"})},{accessorKey:"clarity",cell:e=>{if((0,C.fC)(e.row.original)){let t=e.row.original.diamonds;return(0,i.jsx)(eK,{diamonds:t,accessorKey:"clarity"})}},header:()=>(0,i.jsx)(s.A,{children:"clarity"})},{accessorKey:"cut",cell:e=>{if((0,C.fC)(e.row.original)){let t=e.row.original.diamonds;return(0,i.jsx)(eK,{diamonds:t,accessorKey:"cut"})}},header:()=>(0,i.jsx)(s.A,{children:"cut"})},{accessorKey:"price",cell:e=>{let t=null==e?void 0:e.getValue();return(0,m.S3)(Number(t),H,!0)},header:()=>(0,i.jsx)(s.A,{children:"price"})}],[H,B]),er=(0,S.N4)({columns:x?ei:et,data:null!=ee?ee:l||[],getCoreRowModel:(0,L.HT)()});(0,j.useEffect)(()=>
1{if(g){var e,t;g(null==(t=Q.data)||null==(e=t.pages)?void 0:e[0].ranges)}},[Q.data]);let eo=er.getRowModel().rows||[];function en(e){try{let t={...K.query},{shouldNavigate:l,pathname:i,query:r}=Y(e,t,K.pathname),o=(0,O.D)(i,r,{stripLocale:I.Xn});l&&K.push({pathname:i,query:r},o,{shallow:!0})}catch(e){N.zR.captureException(e,{extra:{functionName:"openModal"},tags:{component:"MendesDiamondTable"}})}}async function ea(e){let t=new URLSearchParams({lotIds:e.join(",")}).toString();try{let e=await fetch("/api/diamonds/getDiamondByLotId?".concat(t));if(!e.ok)throw Error("Network response was not ok");let l=await e.json();(null==l?void 0:l.length)>0&&(q(!0),1===l.length?Z(l[0]):Z({diamonds:l,price:l.reduce((e,t)=>e+t.price,0)}))}catch(t){N.zR.captureException(t,{extra:{functionName:"getDiamond",lotIds:e},tags:{component:"MendesDiamondTable",action:"fetchDiamondData"}})}}return((0,j.useEffect)(()=>{(async()=>{if(!K.isReady)return;let e=K.query.diamond;if(e){let t=e.includes(",")?e.split(","):[e];await ea(t)}else Z(null),q(!1)})()},[null==K?void 0:K.isReady,null==K||null==(t=K.query)?void 0:t.diamond]),(0,j.useEffect)(()=>{G(f)},[f]),f)?(0,i.jsxs)("div",{className:(0,D.A)("vo-table",{"flow-page":h}),children:[(0,i.jsx)(n.h,{}),(0,i.jsx)(k,{diamondProductList:ee}),!W&&(0,i.jsx)("div",{className:"h-screen"}),"table"===W&&(0,i.jsx)(eE,{handleSortChange:u,queryDiamond:Q,table:er,isDiamondPairs:x,options:$,settingProductType:y,colorMapAbridged:v,openModal:en,isModalOpen:X}),"grid"===W&&(0,i.jsx)(eb,{diamonds:eo,openModal:en,isDiamondPairs:x,isAnyModalOpen:X,options:$,settingProductType:y,queryDiamond:Q}),(0,i.jsx)("div",{className:"h-[40px]"}),z&&U&&(0,i.jsx)(eF.A,{isModal:!0,diamondOrDiamondPair:U,closeModal:function(){let e={...K.query};"diamond"in e&&delete e.diamond,q(!1),Z(null);let t=K.pathname,l=(0,O.D)(t,e,{stripLocale:I.Xn});K.push({pathname:t,query:e},l,{shallow:!0})}}),(0,i.jsx)(F,{}),R&&(0,i.jsx)(r.XB,{type:"diamond_table",diamondType:null==c?void 0:c.diamondType,diamonds:ee})]}):null}},84163:(e,t,l)=>{l.d(t,{D:()=>T});var i=l(49409),r=l(49990),o=l(86858),n=l(83726),a=l(31627),s=l(60056),d=l(27939),c=l(48822),u=l.n(c),m=l(63801),p=l.n(m),h=l(87602),x=l.n(h),y=l(4967);let g=["cut","clarity","color"],f=[.3,9],v=[1,2.2],b=[0,100],j=[0,100],w=e=>{let t=e.trim().toLowerCase();return t.includes("hearts")?"Ideal+Hearts":t.includes("ideal")||t.includes("excellent")?"Super Ideal":e.trim()},k=e=>[...new Set(e.map(w).filter(Boolean))],M=function(e,t,l){let c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},m=c.diamondType,h=l?n.L.diamondPairs:n.L.singleDiamond,M=(0,a.useRouter)(),N=(0,y.Ym)(),T=M.asPath.includes("/customize/"),{builderProduct:C}=(0,s.useContext)(i._),S=()=>{try{let e=window.localStorage.getItem(h);if(!e)return{};let t=JSON.parse(e),l={};return"string"==typeof(null==t?void 0:t.sortBy)&&(l.sortBy=t.sortBy),"string"==typeof(null==t?void 0:t.sortOrder)&&(l.sortOrder=t.sortOrder),l}catch(e){return{}}},[L,D]=(0,s.useState)(()=>T?{...e,...m?{diamondType:m}:{}}:{...S(),...e,...m?{diamondType:m}:{}}),[_,A]=(0,s.useState)(),[P,O]=(0,s.useState)({}),{cutOptions:I,clarityOptions:E,colorOptions:F}=(0,s.useMemo)(()=>{var e;let t=Object.values(r.Tn),l=(null==L||null==(e=L.diamondType)?void 0:e.split(","))||[],i=l.length>0&&!l.includes("round-brilliant")?r.Tn["Super Ideal"]:t.map(e=>e[0]);return{cutOptions:i,clarityOptions:Object.values(r.r1).flat(),colorOptions:Object.values(r.Q_).flat()}},[L]);(0,s.useEffect)(()=>{if(!_)return;let e=(null==_?void 0:_.price)!=null?{price:[1e4*Math.floor((0,o.HA)(_.price[0],N)/1e4),1e4*Math.ceil((0,o.HA)(_.price[1],N)/1e4)]}:{},t=(null==_?void 0:_.carat)!=null?{carat:[Math.floor(10*_.carat[0])/10,Math.ceil(10*_.carat[1])/10]}:{},l=(null==_?void 0:_.ratio)!=null?{ratio:[Math.floor(10*_.ratio[0])/10,Math.ceil(10*_.ratio[1])/10]}:{},i=(null==_?void 0:_.tableSize)!=null?{tableSize:[Math.floor(_.tableSize[0]),Math.ceil(_.tableSize[1])]}:{},r=(null==_?void 0:_.depthPercent)!=null?{depth:[Math.floor(_.depthPercent[0]),Math.ceil(_.depthPercent[1])]}:{};O({..._,...e,...t,...l,...i,...r,cut:I,clarity:E,color:F})},[_,I,E,F,N]);
1let[K,V]=(0,s.useState)(),H=(0,s.useCallback)((e,l)=>{var i,r,o,n,a,s,c,u,m,p,h,x,y,f,v,b,j,w,M,N,T,C,S,L,D,_,A;let P={};if(!(null==t?void 0:t.filterCategories))return P;if("priceMin"in e&&"priceMax"in e){let l=null==(i=t.filterCategories)?void 0:i.find(e=>"price"===e.filterKey),o=null==l||null==(r=l.filterItems)?void 0:r[0];o&&(P.price=[{...o,range:[e.priceMin/100,e.priceMax/100]}])}if("caratMin"in e||"caratMax"in e){let i=null==(o=t.filterCategories)?void 0:o.find(e=>"carat"===e.filterKey),r=null==i||null==(n=i.filterItems)?void 0:n[0];if(r){let t=null!=(c=e.caratMin)?c:null==l||null==(a=l.carat)?void 0:a[0],i=null!=(u=e.caratMax)?u:null==l||null==(s=l.carat)?void 0:s[1];t&&i&&(P.carat=[{...r,range:[t,i]}])}}if("ratioMin"in e||"ratioMax"in e){let i=null==(m=t.filterCategories)?void 0:m.find(e=>"ratio"===e.filterKey),r=null==i||null==(p=i.filterItems)?void 0:p[0];if(r){let t=null!=(y=e.ratioMin)?y:null==l||null==(h=l.ratio)?void 0:h[0],i=null!=(f=e.ratioMax)?f:null==l||null==(x=l.ratio)?void 0:x[1];t&&i&&(P.ratio=[{...r,range:[t,i]}])}}if("tableMin"in e||"tableMax"in e){let i=null==(v=t.filterCategories)?void 0:v.find(e=>"tableSize"===e.filterKey),r=null==i||null==(b=i.filterItems)?void 0:b[0];if(r){let t=null!=(M=e.tableMin)?M:null==l||null==(j=l.tableSize)?void 0:j[0],i=null!=(N=e.tableMax)?N:null==l||null==(w=l.tableSize)?void 0:w[1];t&&i&&(P.tableSize=[{...r,range:[t,i]}])}}if("depthMin"in e||"depthMax"in e){let i=null==(T=t.filterCategories)?void 0:T.find(e=>"depth"===e.filterKey),r=null==i||null==(C=i.filterItems)?void 0:C[0];if(r){let t=null!=(D=e.depthMin)?D:null==l||null==(S=l.depthPercent)?void 0:S[0],i=null!=(_=e.depthMax)?_:null==l||null==(L=l.depthPercent)?void 0:L[1];t&&i&&(P.depth=[{...r,range:[t,i]}])}}for(let[l,i]of Object.entries(e)){let e=null==(A=t.filterCategories)?void 0:A.filter(e=>e.filterKey===l);if("priceMin"===l||"priceMax"===l||"caratMin"===l||"caratMax"===l||"ratioMin"===l||"ratioMax"===l||"tableMin"===l||"tableMax"===l||"depthMin"===l||"depthMax"===l)continue;let r=g.includes(l)?"cut"===l?k(i.split(",")):i.split(","):[i];P[l]=e.filter(e=>e.filterKey===l).flatMap(e=>e.filterItems).filter(e=>"diamondType"===l?r.some(t=>(0,d.V8)(t,e.slug)):("cut"===l?k(e.slug.trim().split(",")):e.slug.trim().split(",")).every(e=>r.includes(e)))}return P},[null==t?void 0:t.filterCategories]);(0,s.useEffect)(()=>{V(H(L,P))},[L,P,H]);let R=(0,s.useMemo)(()=>{if(!(null==t?void 0:t.filterCategories)||!P)return[];let e=Object.keys(P),l=t.filterCategories.filter(t=>e.includes(t.filterKey)),i=l.find(e=>"color"===e.filterKey&&"icon"===e.filterDesign.slug);return l.map(e=>{var t,l,r,o,n,a;if(!e.filterItems)return e;let s=e.filterItems.filter(t=>{if("diamondType"===e.filterKey)return(P[e.filterKey]||[]).some(e=>(0,d.V8)(e,t.slug));let l="cut"===e.filterKey?k(t.slug.trim().split(",")):t.slug.trim().split(","),i="cut"===e.filterKey?k(P[e.filterKey]||[]):P[e.filterKey];return l.every(e=>null==i?void 0:i.includes(e))});return"color"===e.filterKey&&"icon"===e.filterDesign.slug&&s.push(...null!=(t=null==i?void 0:i.filterItems)?t:[]),"price"===e.filterKey&&s.push({id:"price",filterDesign:"range",name:"Price",slug:"price",range:(null==(l=P.price)?void 0:l.map(Number))||[0,1e6]}),"carat"===e.filterKey&&s.push({id:"carat",filterDesign:"range",name:"Carat",slug:"carat",range:(null==(r=P.carat)?void 0:r.map(Number))||f}),"ratio"===e.filterKey&&s.push({id:"ratio",filterDesign:"range",name:"Ratio",slug:"ratio",range:(null==(o=P.ratio)?void 0:o.map(Number))||v}),"tableSize"===e.filterKey&&s.push({id:"tableSize",filterDesign:"range",name:"Ratio",slug:"tableSize",range:(null==(n=P.tableSize)?void 0:n.map(Number))||b}),"depth"===e.filterKey&&s.push({id:"depth",filterDesign:"range",name:"Depth",slug:"depth",range:(null==(a=P.depth)?void 0:a.map(Number))||j}),{...e,filterItems:s}})},[P,t]),B=(0,s.useCallback)(()=>{var e;return(null==P||null==(e=P.price)?void 0:e.map(e=>parseFloat(e)))||[0,1e6]},[P])(),z=e=>{D(t=>{let l={...t},i=Object.keys(e);if(i.includes("priceMin")&&i.includes("priceMax"))t.priceMin===e.priceMin&&t.priceMax===e.priceMax?(delete l.priceMin,delete l.priceMax):l={...t,...e};else if(i.includes("caratMin")&&i.includes("caratMax"))t.caratMin===e.caratMin&&t.caratMax===e.caratMax?(delete l.caratMax,delete l.caratMin):l={...t,...e};else if(i.includes("ratioMin")&&i.includes("ratioMax"))t.ratioMin===e.ratioMin&&t.ratioMax===e.ratioMax?(delete l.ratioMin,delete l.ratioMax):l={...t,...e};else if(i.includes("tableMin")&&i.includes("tableMax"))t.tableMin===e.tableMin&&t.tableMax===e.tableMax?(delete l.tableMin,delete l.tableMax):l={...t,...e};else if(i.includes("depthMin")&&i.includes("depthMax"))t.depthMin===e.depthMin&&t.depthMax===e.depthMax?(delete l.depthMin,delete l.depthMax):l={...t,...e};else{var r,o;let n=i.pop();if("diamondType"===n)e[n].split().join(),l={...t,...e},t[n]&&t[n]===e[n]&&m!==e[n]&&delete l[n];else if("cut"===n){let i=k((null==(r=t[n])?void 0:r.split(","))||[]),o=w(e[n]);i.includes(o)?l[n]=i.filter(e=>e!==o).join(","):(i.push(o),l[n]=i.join(",")),l[n]||delete l[n]}else if("color"===n||"clarity"===n){let i=(null==(o=t[n])?void 0:o.split(","))||[];
1e[n].split(",").forEach(e=>{i.includes(e)?i=i.filter(t=>t!==e):i.push(e),l[n]=i.join(",")}),l[n]||delete l[n]}else l={...t,...e}}return l.diamondType&&l.cut&&"round-brilliant"!==l.diamondType&&(l.cut=l.cut.split(",").filter(e=>"Super Ideal"===e).join()),"sortBy"in l&&"sortOrder"in l&&localStorage.setItem(h,JSON.stringify({sortBy:l.sortBy,sortOrder:l.sortOrder})),l})};(0,s.useEffect)(()=>{if(T)return void D({...e,...m?{diamondType:m}:{}});D({...S(),...e,...m?{diamondType:m}:{}})},[null==C?void 0:C.product,m]);let q=function(e){let{selectorTitle:t,presetFilterGroups:l,options:i,setOptions:r}=e,[o,n]=(0,s.useState)(null);return(0,s.useMemo)(()=>{let e=null==l?void 0:l.map(e=>{let t={...i};return e.categories.forEach(e=>{t[e.filterKey]=e.filterItems.map(e=>e.slug).join()}),"round-brilliant"===t.diamondType&&e.roundBrilliantCategories.forEach(e=>{t[e.filterKey]=e.filterItems.map(e=>e.slug).join()}),n(l=>l===e.groupName?x()(u()(t,p()),u()(i,p()))?e.groupName:null:l),{name:e.groupName,onSelect:()=>{o!==e.groupName?(r(t),n(e.groupName)):(r(t=>{let l={...t};return e.categories.forEach(e=>{delete l[e.filterKey]}),"round-brilliant"===t.diamondType&&e.roundBrilliantCategories.forEach(e=>{delete l[e.filterKey]}),l}),n(null))},isActive:o===e.groupName}});return e?{title:t,groups:e}:null},[t,l,i,o,r])}({selectorTitle:null==t?void 0:t.presetFilterGroupSelectorTitle,presetFilterGroups:null==t?void 0:t.presetFilterGroups,options:L,setOptions:D});return{options:L,clearFilterOptions:()=>{localStorage.removeItem(h),D(m?{diamondType:m}:{})},setRanges:A,filters:R,handleFilterSelection:(e,t)=>{var l,i;if("sort"===e){let e=t[0];if(!e)return;if("featured"===e.id)return void z({sortBy:void 0,sortOrder:void 0});let[l,i]=e.slug.split("-");return void z({sortBy:l,sortOrder:i})}if("price"===e){let e=t[0];z({priceMin:(null==e?void 0:e.range)?(null==e?void 0:e.range[0])*100:B[0],priceMax:(null==e?void 0:e.range)?(null==e?void 0:e.range[1])*100:B[1]});return}if("carat"===e){let e=t[0];z({caratMin:(null==e?void 0:e.range)?null==e?void 0:e.range[0]:f[0],caratMax:(null==e?void 0:e.range)?null==e?void 0:e.range[1]:f[1]});return}if("ratio"===e){let e=t[0];z({ratioMin:(null==e?void 0:e.range)?null==e?void 0:e.range[0]:v[0],ratioMax:(null==e?void 0:e.range)?null==e?void 0:e.range[1]:v[1]});return}if("tableSize"===e){let e=t[0];z({tableMin:(null==e?void 0:e.range)?null==e?void 0:e.range[0]:b[0],tableMax:(null==e?void 0:e.range)?null==e?void 0:e.range[1]:b[1]});return}if("depth"===e){let e=t[0];z({depthMin:(null==e?void 0:e.range)?null==e?void 0:e.range[0]:j[0],depthMax:(null==e?void 0:e.range)?null==e?void 0:e.range[1]:j[1]});return}z({[e]:null!=(i=null==(l=t[0])?void 0:l.slug)?i:""})},selectedFilterValues:K,presetFilterGroupSelector:q}};var N=l(60319);let T=e=>{let{filterBar:t,initialOptions:l,isPairView:i=!1,requiredOptions:r}=e,{options:o,clearFilterOptions:a,setRanges:d,filters:c,handleFilterSelection:u,selectedFilterValues:m,presetFilterGroupSelector:p}=M(l,t,i,r),{sortOptions:h,handleSortChange:x,selectedSortOption:y,resetSortOptions:g}=(e=>{let t,{sortOptions:l,handleFilterSelection:i,isPairView:r=!1}=e;{let e=window.localStorage.getItem(r?n.L.diamondPairs:n.L.singleDiamond);if(e){let l=JSON.parse(e),i=l.sortBy,r=l.sortOrder;i&&r&&(t={sortKey:i,sortOrder:r})}}let{transformedSortOptions:o,handleSortChange:a,selectedSortOption:d,resetSortOptions:c}=(0,N.y)({sortOptions:l,initialSortOption:t});return(0,s.useEffect)(()=>{i("sort",[d])},[d]),{sortOptions:Object.values(o.reduce((e,t)=>{let[l,i]=t.name.includes(":")?t.name.split(":"):t.name.includes("(")?t.name.replace(")","").split("("):[null,t.name],r=l||"noCategory";return e[r]||(e[r]=[]),e[r].push({...t,name:i,categoryName:l}),e},{})).flatMap(e=>e.map((e,t)=>({...e,index:t}))).sort((e,t)=>null===e.categoryName?-1:+(null===t.categoryName)).reverse(),handleSortChange:a,selectedSortOption:d,resetSortOptions:c}})({sortOptions:null==t?void 0:t.sort,handleFilterSelection:u,isPairView:i});return{options:o,setRanges:d,filters:c,handleFilterSelection:u,selectedFilterValues:m,presetFilterGroupSelector:p,sortOptions:h,handleSortChange:x,selectedSortOption:y,resetSortOptions:g,clearFilterAndSortOptions:()=>{g(),a()}}}},95420:(e,t,l)=>{l.d(t,{T:()=>w});var i=l(38900),r=l(45357),o=l(76125),n=l(99168),a=l(63463),s=l(65804),d=l(79626),c=l(3652),u=l(57e3),m=l(17403),p=l(60056),h=l(4967);let x=e=>{let{gridTypeOptions:t,pageType:l,className:o}=e,{plpGridType:n,diamondTableGridType:a,investmentDiamondTableGridType:s}=(0,c.S)(),x="PLP"===l?n:"diamondTableInvestment"===l?s:a,g=(0,p.useContext)(d.YK),f=(0,h.Ym)(),{_t:v}=(0,r.c3)(f,[r.$0.FILTER_TOOLBAR]);return(0,i.jsx)("div",{"data-testid":"MendesGridSelector",className:(0,m.cn)("flex gap-x-[6px]",o),children:t.map(e=>(0,i.jsx)("button",{"aria-pressed":x===e,"aria-label":v("Switch to ".concat(e,"_").concat(l)),onClick:()=>(e=>{let t="PLP"===l?u._.PLP_USER_CHOSEN:"diamondTableInvestment"===l?u._.DIAMOND_TABLE_INVESTMENT_USER_CHOSEN:u._.DIAMOND_TABLE_USER_CHOSEN,i="PLP"===l?u._.PLP_LAST_USED:"diamondTableInvestment"===l?u._.DIAMOND_TABLE_INVESTMENT_LAST_USED:u._.DIAMOND_TABLE_LAST_USED,r="PLP"===l?{plpGridType:e}:"diamondTableInvestment"===l?{investmentDiamondTableGridType:e}:{diamondTableGridType:e};window.localStorage.setItem(t,e),window.localStorage.setItem(i,e),g(r)})(e),className:(0,m.cn)({"hidden lg:block":x===e}),children:(0,i.jsx)("span",{className:(0,m.cn)("block border rounded-none p-[8px]",{"opacity-100 border-content-primary-high":x===e,"opacity-40 border-content-primary-low":x!==e}),children:y[e]})},"grid-selector__".concat(e)))})},y={big_grid:(0,i.jsx)(e=>(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",...e,xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{x:"9",y:"14",width:"6",height:"6",stroke:"black",strokeWidth:"1.5"}),(0,i.jsx)("rect",{x:"9",y:"4",width:"6",height:"6",stroke:"black",strokeWidth:"1.5"})]}),{}),small_grid:(0,i.jsx)(e=>(0,i.jsxs)("svg",{width:"24",height:"24",fill:"none",...e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{x:"4",y:"14",width:"6",height:"6",stroke:"black",strokeWidth:"1.5"}),(0,i.jsx)("rect",{x:"14",y:"4",width:"6",height:"6",stroke:"black",strokeWidth:"1.5"}),(0,i.jsx)("rect",{x:"14",y:"14",width:"6",height:"6",stroke:"black",strokeWidth:"1.5"}),(0,i.jsx)("rect",{x:"4",y:"4",width:"6",height:"6",stroke:"black",strokeWidth:"1.5"})]}),{}),list:(0,i.jsx)(()=>(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M7.5 5.25H21",stroke:"black",strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M7.5 12H21",stroke:"black",strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M7.5 18.75H21",stroke:"black",strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M3 5.25H3.0105",stroke:"black",strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M3 12H3.0105",stroke:"black",strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M3 18.75H3.0105",stroke:"black",strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"})]}),{})};var g=l(35542),f=l(71684),v=l(26360),b=l(89310),j=l(25725);let w=e=>{var t;let{filters:l,handleFilterSelection:d,selectedFilterValues:c,clearAllFilters:u,sortOptions:y,handleSortChange:w,selectedSortOption:k,hiddenCategories:M,presetFilterGroupSelector:N,isInvestment:T=!1}
1=e,C=(0,j.U)()||"xl",S="laptop"===C||"xl"===C?7:5,{isModalOpen:L,handleOpenModal:D,accordionFilterOpen:_}=(0,s.B)({isModalOpen:!1,accordionFilterOpen:null==(t=l[0])?void 0:t.id}),A=(0,h.Ym)(),{_t:P}=(0,r.c3)(A),{filtersActiveHidden:O,filtersToHide:I}=(e=>{var t;let{filters:l,selectedFilterValues:i,mediaQuery:r,hiddenCategories:o}=e,n=null!=(t=null==o?void 0:o["sm"===r||"md"===r?"mobile":"lg"===r?"desktopSm":"laptop"===r?"desktopMd":"xl"===r?"desktopLg":null])?t:[],[a,s]=(0,p.useState)(0);return(0,p.useEffect)(()=>{var e,t,r;let o=null==l?void 0:l.filter(e=>null==n?void 0:n.includes(e.id)),a=i&&(null==(t=Object.entries(i))||null==(e=t.filter(e=>{let[t,l]=e;return!t.includes("sort")}))?void 0:e.map(e=>{let[t,l]=e;return{value:l,filterKey:t}}).flat()),d=null==a?void 0:a.filter(e=>null==o?void 0:o.some(t=>{var l;return null==t||null==(l=t.filterItems)?void 0:l.some(t=>{var l;return null==t?void 0:t.slug.includes(null==e||null==(l=e.value[0])?void 0:l.slug)})}));s(null!=(r=null==d?void 0:d.length)?r:0)},[n]),{filtersActiveHidden:a,filtersToHide:n}})({filters:l,hiddenCategories:M,selectedFilterValues:c,mediaQuery:C});if(null==l||(null==l?void 0:l.length)===0)return(0,i.jsx)("div",{className:"py-6",children:(0,i.jsx)("div",{className:"filters-skeleton h-[42px] lg:h-[67px]"})});let E=(0,i.jsx)(x,{pageType:T?"diamondTableInvestment":"diamondTable",gridTypeOptions:["list","small_grid"]});return(0,i.jsxs)(i.Fragment,{children:[L&&(0,i.jsx)(a.O,{filters:l,onChange:d,selectedFilterValues:c,onClose:()=>D(!1),isOpen:L,sortOptions:y,handleSortChange:w,selectedSortOption:k,clearAllFilters:u,expandedAccordion:_,presetFilterGroupSelector:N}),"sm"===C||"md"===C?(0,i.jsxs)("div",{className:"w-full py-6 overflow-x-auto hide-scrollbar flex gap-x-3",children:[(0,i.jsx)("div",{className:"pl-[5vw] md:pl-[2.5vw]",children:E}),(0,i.jsxs)("div",{className:"flex gap-x-3 pr-[5vw] md:pr-[2.5vw]",children:[l.map((e,t)=>{var l,r;if(I.includes(e.id))return null;let o=null==(l=c[e.filterKey])?void 0:l[0],n=null==(r=c[e.filterKey])?void 0:r.length,a=(null==o?void 0:o.range)?(0,b.N)({range:o.range,type:e.filterKey,locale:A,decimals:"carat"===e.filterKey?1:void 0}):(null==o?void 0:o.name)?(null==o?void 0:o.name)+(n>1?" + ".concat(n-1):""):P("all");return(0,i.jsx)(f.x,{label:e.title,selection:a,isSelected:(null==o?void 0:o.id)!=null,onClick:()=>D(!0,e.id)},e.id+"-mobile-"+t)}),y.length>0&&(0,i.jsx)(f.x,{label:P("Sorting By"),selection:P(null==k?void 0:k.name),onClick:()=>D(!0,"sort"),isSelected:null!=k}),I.length>0&&(0,i.jsx)(o.P,{onClick:()=>{D(!0)},activeFiltersOnModal:O})]})]}):(0,i.jsxs)("div",{className:"px-[2.5vw] hidden md:flex md:items-center w-full py-6 overflow-x-visible",children:[l.map((e,t)=>{var l,r;if(I.includes(e.id))return null;let o=null==(l=c[e.filterKey])?void 0:l[0],n=null==(r=c[e.filterKey])?void 0:r.length,a=(null==o?void 0:o.range)?(0,b.N)({range:o.range,type:e.filterKey,locale:A,decimals:1}):(null==o?void 0:o.name)?(null==o?void 0:o.name)+(n>1?" + ".concat(n-1):""):P("all");return(0,i.jsxs)("div",{className:"pl-sm first:pl-0 pr-sm border-r border-content-primary-lowest",children:["diamondType"!==e.filterKey&&(0,i.jsxs)("div",{children:[(null==e?void 0:e.title)&&(0,i.jsx)("div",{className:"mb-2 mendes body-m flex flex-nowrap gap-x-xs",children:(0,i.jsx)("h2",{className:"mendes body-m text-content-primary-mid whitespace-nowrap",children:null==e?void 0:e.title})}),(0,i.jsx)(f.x,{label:e.title,selection:a,isSelected:(null==o?void 0:o.id)!=null,onClick:()=>D(!0,e.id)},e.id+"-mobile-"+t)]}),"diamondType"===e.filterKey&&(0,i.jsx)(g.S,{label:e.title,value:e.filterItems,filterType:e.filterKey,onChange:d,selectedFilterValues:c,size:"medium",hideInputLabel:!0,visibleOptionsCount:"diamondType"===e.filterKey?S:void 0,onShowAllOptions:()=>D(!0,e.id)})]},e.id+"-desktop-"+t)}),y.length>0&&(0,i.jsx)("div",{className:(0,m.cn)("px-sm",{"border-r border-content-primary-lowest":I.length>0}),children:(0,i.jsx)(n.I,{triggerElementType:"link",label:P("Sorting By"),styleType:v.s.FILTER,filterType:"sort",selectedFilterValues:{sort:[k]},onChange:(e,t)=>
1{w(t[0])},options:y})}),I.length>0&&(0,i.jsx)("div",{className:"px-sm",children:(0,i.jsx)(o.P,{onClick:()=>{D(!0)},activeFiltersOnModal:O})}),(0,i.jsx)("div",{className:"grow pl-sm flex justify-end",children:E})]})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.