!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="763a1f2d-e326-4f33-85bf-7d1d3c074a0f",t._sentryDebugIdIdentifier="sentry-dbid-763a1f2d-e326-4f33-85bf-7d1d3c074a0f")}catch(t){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4688,5975],{71124:function(t,e,l){Promise.resolve().then(l.bind(l,6655))},35975:function(t,e,l){"use strict";l.r(e),l.d(e,{FavouriteItem:function(){return v},FavouritesSidebar:function(){return p},default:function(){return b}});var a=l(44581),s=l(79005),r=l(86437),n=l(72539),o=l(36150),i=l(77407),w=l(37574),d=l.n(w),c=l(44142),m=l(60709),u=l(33726),x=l(773),f={src:"/_next/static/media/Group1945.8bf41405.svg",height:286,width:378,blurWidth:0,blurHeight:0},h=l(17866);let p=()=>{var t,e,l,r,o,i,w,m;let h=(0,s.B)(),[p,g]=(0,u.useState)("");return(0,u.useEffect)(()=>{var t;let e=new URLSearchParams;e.append("items",JSON.stringify(null==h?void 0:null===(t=h.selectedItems)||void 0===t?void 0:t.map(t=>{let{UPID:e,slug:l,sku:a}=t;return{UPID:e,slug:l,sku:a}}))),g("/p/compare?"+e.toString())},[null==h?void 0:h.selectedItems]),(0,u.useEffect)(()=>{var t;null==h||null===(t=h.dialogRef.current)||void 0===t||t.showModal()},[]),(0,a.jsx)("dialog",{ref:null==h?void 0:h.dialogRef,onClick:null==h?void 0:h.close,role:"presentation",className:"tw-h-full tw-max-h-none tw-w-full tw-max-w-none tw-p-4 tw-border-0 tw-bg-transparent backdrop:tw-bg-black/40 focus:tw-outline-0",children:(0,a.jsx)("div",{onClick:t=>t.stopPropagation(),className:"tw-h-full tw-w-[400px] tw-max-w-[90%] tw-fixed tw-right-0 tw-bg-white tw-text-black tw-top-0 tw-px-4 tw-py-4 tw-pr-0 tw-pb-3",children:(0,a.jsxs)("div",{className:"tw-flex tw-flex-1 tw-flex-col tw-items-center tw-justify-start tw-h-full",children:[(0,a.jsxs)("div",{className:"tw-flex tw-flex-row tw-items-center tw-justify-between tw-text-gray-500 tw-mb-4 tw-w-full tw-pr-4",children:[(0,a.jsx)("span",{className:"tw-flex-1",children:"Favorite List"}),(0,a.jsx)(x.BetterButton,{btnStyle:"simple",icon:(0,a.jsx)(n.Z,{id:"favourite-modal-close"}),className:"tw-h-5",labelClassName:"tw-text-[11px] tw-leading-none",replaceClass:{"tw-w-3":"tw-w-5"},attributes:{type:"button",onClick:null==h?void 0:h.close}})]}),(0,a.jsx)("div",{className:d()("tw-flex tw-flex-col tw-gap-y-4 tw-text-center tw-flex-[0.8] tw-overflow-y-auto tw-w-full tw-px-2 tw-pl-0 tw-pt-3",(null==h?void 0:null===(t=h.favouriteProducts)||void 0===t?void 0:t.length)?"tw-justify-start":"tw-justify-center"),children:(null==h?void 0:null===(e=h.favouriteProducts)||void 0===e?void 0:e.length)?null==h?void 0:null===(l=h.favouriteProducts)||void 0===l?void 0:l.map(t=>{var e,l;return(0,a.jsx)(v,{productDetails:t,removeFromFavourites:()=>h.addRemoveProductsFromFav(t),closeSidebar:null==h?void 0:h.close,modifySelection:null==h?void 0:h.modifySelection,checkboxDisabled:(null==h?void 0:null===(e=h.selectedItems)||void 0===e?void 0:e.length)>=4,comparePage:!1,compareProductLength:null==h?void 0:null===(l=h.favouriteProducts)||void 0===l?void 0:l.length},t.UPID)}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.default,{src:f,alt:"no items available",className:"tw-w-[80%] tw-h-auto tw-self-center tw-mb-4"}),(0,a.jsx)("span",{className:"tw-text-base tw-text-gray-400 tw-uppercase tw-font-bold",children:"No Items on your Favorites yet"})]})}),(0,a.jsxs)("div",{className:"tw-flex tw-flex-col tw-items-center tw-justify-center tw-flex-[0.2] tw-w-full tw-backdrop-blur-sm tw-bg-white/30 tw-pr-4",children:[(0,a.jsx)("span",{className:"tw-mb-4 tw-w-[75%] tw-text-center tw-text-sm",children:"Please limit the comparison to a maximum of four items."}),(0,a.jsxs)("div",{className:"tw-px-5 tw-w-full tw-flex tw-flex-col tw-items-center tw-justify-between",children:[(0,a.jsx)(x.BetterButton,{btnStyle:"primary",href:(null==h?void 0:null===(r=h.selectedItems)||void 0===r?void 0:r.length)>=2?p:void 0,className:"tw-h-10",label:"Compare Selected(".concat(null==h?void 0:null===(o=h.selectedItems)||void 0===o?void 0:o.length,")"),labelClassName:"tw-text-md tw-leading-none",replaceClass:{"!tw-w-max":"!tw-w-full"},attributes:{"aria-disabled":(null==h?void 0:null===(i=h.selectedItems)||void 0===i?void 0:i.length)<2,onClick:(null==h?void 0:null===(w=h.selectedItems)||void 0===w?void 0:w.length)>=2?()=>{localStorage.setItem("previousRoute",window.location.href)}:void 0}}),(0,a.jsx)(x.BetterButton,{btnStyle:"simple",className:"tw-h-auto tw-mt-4 tw-transition-colors ",label:"Remove All",labelClassName:"!tw-text-sm !tw-font-semibold tw-underline tw-text-gray-500",replaceClass:{"!tw-w-max":"!tw-w-fit"},attributes:{type:"button",onClick:null==h?void 0:h.clear,id:"remove-all","aria-disabled":!(null==h?void 0:null===(m=h.selectedItems)||void 0===m?void 0:m.length)}})]})]})]})})})},v=t=>{let{productDetails:e,showCheckBox:l=!0,checkboxDisabled:s=!1,modifySelection:r=()=>{},closeSidebar:n=()=>{},removeFromFavourites:w=()=>{},comparePage:u=!0,compareProductLength:x=1}=t,f=(()=>{if("imageUrl"in e)return e.imageUrl;if("swatches"in e){var t;let l=null==e?void 0:null===(t=e.swatches)||void 0===t?void 0:t.find(t=>t.colorName===e.colorName);return l?l.imageURL.includes("res.cloudinary.com")?l.imageURL.replace("https://images.floorforce.com/Textures/",""):l.imageURL:null}return null})(),h={productDetails:e,showCheckBox:l,closeSidebar:n,comparePage:u};return(0,a.jsxs)("div",{id:"favourite_product_"+e.UPID,className:d()("tw-flex tw-items-center tw-justify-start tw-gap-x-2 tw-w-full max-lg:tw-min-w-52 tw-my-2",u?"tw-flex-col":"tw-flex-row",{"md:!tw-items-start":1===x&&u}),children:[l&&(0,a.jsx)("div",{className:"tw-flex tw-items-center tw-w-auto tw-justify-center tw-mr-2 tw-flex-0",children:(0,a.jsx)("input",{className:"tw-mr-0",disabled:!e.isSelected&&s,type:"checkbox",id:e.UPID+"_favourite_checkbox",value:e.UPID,checked:e.isSelected,onChange:r})}),(0,a.jsxs)("div",{className:d()("tw-flex tw-flex-1 tw-items-start tw-justify-between tw-gap-x-3 tw-w-full",{"md:tw-items-center md:tw-gap-x-8 md:tw-w-[90%]":2===x&&u},{"md:tw-w-[50%] md:tw-justify-start md:tw-items-center md:tw-gap-x-3":1===x&&u}),children:[(0,a.jsxs)("div",{className:"tw-relative",children:[(0,a.jsx)(i.Z,{"aria-label":"like",size:"small",className:d()("!tw-w-auto !tw-h-auto !tw-p-0 !tw-bg-white !tw-min-h-min !tw-absolute !-tw-top-1.5 !-tw-left-1.5"),onClick:w,children:(0,a.jsx)(o.Z,{className:"!tw-w-4 !tw-h-auto"})}),(0,a.jsx)(c.default,{alt:"favourite-product-image",src:f,width:90,height:90,loading:"lazy",className:"max-md:tw-w-[60px] max-md:tw-h-[60px] tw-rounded-md"})]}),(0,a.jsxs)("div",{className:"tw-flex tw-flex-1 tw-flex-col tw-items-baseline tw-justify-evenly tw-gap-y-1 tw-w-min ",children:[(0,a.jsx)(m.default,{href:"/d/".concat(e.slug,"/").concat(encodeURIComponent(e.sku)).toLowerCase(),onClick:n,className:"tw-no-underline",children:(0,a.jsxs)("h1",{className:"!tw-text-sm !tw-text-left !tw-max-w-40",children:[e.productName," by ",e.brandName]})}),(0,a.jsxs)("span",{className:"tw-text-xs tw-text-gray-500 tw-text-left",children:[e.productType," | ",e.sku]}),e.colorName&&(0,a.jsxs)("span",{className:"tw-font-normal tw-text-xs tw-text-black md:tw-text-left",children:["Color: ",e.colorName]}),!u||u&&3===x?(0,a.jsx)(g,{...h}):"",(0,a.jsx)("div",{className:d()("tw-hidden",{"max-sm:tw-block":1===x&&u}),children:(0,a.jsx)(g,{...h})})]}),(0,a.jsx)("div",{className:d()("tw-hidden",{"max-sm:tw-hidden md:tw-block":x<3&&u}),children:(0,a.jsx)(g,{...h})})]}),4===x&&u?(0,a.jsx)(g,{...h}):"",(0,a.jsx)("div",{className:d()("tw-hidden",{"max-sm:tw-block":2===x&&u}),children:(0,a.jsx)(g,{...h})})]})},g=t=>{let{productDetails:e,showCheckBox:l,comparePage:s,closeSidebar:n}=t,o=(0,u.useRef)(null);return(0,u.useEffect)(()=>{var t;if((null==o?void 0:o.current)===null)return;let e=null==o?void 0:null===(t=o.current)||void 0===t?void 0:t.querySelectorAll("[data-product-handle]");null==e||e.forEach(t=>{var e,l,a;t.addEventListener("click",e=>{var l,a,s,r,n,o;null==t||null===(o=t.view)||void 0===o||null===(n=o.wrapper)||void 0===n||null===(r=n.children)||void 0===r||null===(s=r[0])||void 0===s||null===(a=s.children)||void 0===a||null===(l=a[0])||void 0===l||l.click(),setTimeout(function(){var t;null==e||null===(t=e.ui)||void 0===t||t.openCart()},100)}),null===(a=window)||void 0===a||null===(l=a.EzCommerce)||void 0===l||null===(e=l.shopify)||void 0===e||e.createUIComponents(t,!0,null==t?void 0:t.dataset)})},[o]),(0,a.jsx)("div",{ref:o,children:(e.hasSample||e.hasVisualization)&&(0,a.jsxs)("div",{className:d()("tw-flex tw-flex-row tw-items-center tw-justify-between tw-mt-2",l?"tw-w-full":"",s?"":"tw-gap-2"),children:[e.hasSample&&(0,a.jsx)(h.L,{loadScript:!1,samplePrice:0,productInfo:e,replaceClass:{"tw-h-12":"tw-h-9","!tw-w-max":"!tw-w-fit","!tw-px-6":"tw-px-3"},labelClass:"!tw-text-[11px] tw-leading-none",onClick:n}),e.hasVisualization&&(0,a.jsx)(x.BetterButton,{btnStyle:"neutral",label:"See In My Room",href:(0,r.dN)(e.slug,e.sku,"visualizer"),className:d()("tw-h-9 tw-flex-0",l?"":"tw-mx-2"),labelClassName:"tw-text-[11px] tw-leading-none ",replaceClass:{"!tw-w-max":"!tw-w-fit","!tw-px-6":"!tw-px-3"}})]})})};var b=p},6655:function(t,e,l){"use strict";l.d(e,{CompareFavourites:function(){return u}});var a=l(44581),s=l(37574),r=l.n(s),n=l(34853),o=l(33726),i=l(773),w=l(35975),d=l(97924);let c=()=>{let[t,e]=(0,o.useState)();return(0,o.useEffect)(()=>{e(window.localStorage)},[]),t},m="tw-mr-3 lg:tw-border-solid lg:tw-border-y-0 lg:tw-border-x lg:tw-border-gray-500 tw-font-small lg:tw-font-medium last:tw-mr-0",u=t=>{let{productsInfo:e}=t,l=(0,n.useRouter)(),s="",w=(0,n.useSearchParams)(),d=c(),m=null==d?void 0:d.getItem("previousRoute");if(m){let t=(t=>{let e=t.match(/\/(d|p)/);return e?e[0]:null})(m);s="/p"===t?"Back to Product List":"/d"===t?"Back to Product Details":"Back to Previous Page"}let u=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,l={};return t.forEach(t=>{var a;l[e]||(l[e]=[]);let s=null==t?void 0:null===(a=t.specs.find(t=>t.key===e))||void 0===a?void 0:a.value;s&&(s=null==s?void 0:s.replace("true","Yes").replace("false","No")),l[e].push(null!=s?s:"-")}),l},p=(0,o.useMemo)(()=>e.reduce((t,e)=>(e.specs.forEach(e=>{t.includes(null==e?void 0:e.key)||t.push(null==e?void 0:e.key)}),t),[]).reduce((t,l)=>({...t,...u(e,l)}),{}),[e]),v=t=>{var e;let a=JSON.parse(null!==(e=w.get("items"))&&void 0!==e?e:"[]"),s=new URLSearchParams;s.append("items",JSON.stringify(a.filter(e=>e.UPID!==t.UPID))),l.replace("/p/compare?"+s.toString())};return(0,a.jsxs)("div",{className:"tw-flex tw-flex-col tw-flex-1 tw-items-center tw-justify-center tw-pb-7 tw-w-full max-lg:tw-px-2",children:[(0,a.jsx)("div",{className:"tw-flex tw-items-center tw-justify-start tw-w-[95%] tw-mt-4 tw-mb-10 max-lg:tw-my-2 max-lg:tw-mb-5 ",children:(0,a.jsx)(i.BetterButton,{btnStyle:"simple",className:"tw-flex tw-items-center tw-gap-2 !tw-text-sm !tw-text-gray-500 hover:!tw-text-gray-600",label:s,labelClassName:"tw-font-semibold",icon:'<svg\n          className="tw-w-4"\n          xmlns="http://www.w3.org/2000/svg"\n          viewBox="0 0 448 512"\n        >\n          <path\n            className="tw-fill-gray-500"\n            d="M7.4 273.4C2.7 268.8 0 262.6 0 256s2.7-12.8 7.4-17.4l176-168c9.6-9.2 24.8-8.8 33.9 .8s8.8 24.8-.8 33.9L83.9 232 424 232c13.3 0 24 10.7 24 24s-10.7 24-24 24L83.9 280 216.6 406.6c9.6 9.2 9.9 24.3 .8 33.9s-24.3 9.9-33.9 .8l-176-168z"\n          />\n        </svg>',attributes:{onClick:null==l?void 0:l.back}})}),e.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:r()("md:tw-flex md:tw-flex-row max-sm:tw-hidden"),children:[(0,a.jsxs)("table",{"aria-label":"Product Comparison Table",cellPadding:4,className:r()("lg:tw-max-w-[95%] tw-w-full max-lg:tw-block max-lg:tw-w-full max-lg:tw-overflow-scroll tw-border-separate tw-border-spacing-x-2 tw-rotate-180 compare-table tw-pb-3 tw-table-fixed",{"md:!tw-w-[51%]":1===e.length}),children:[(0,a.jsx)(x,{productsInfo:e}),(0,a.jsxs)("tbody",{className:"tw-rotate-180",children:[(0,a.jsx)(f,{productsInfo:e,handleFavouritesRemove:v}),Object.entries(p).map((t,e,l)=>{let[s,r]=t;return(0,a.jsx)(h,{propertyTitle:s,values:r,array:l,index:e})})]})]}),(0,a.jsx)("div",{className:r()("tw-hidden",{"md:tw-block tw-w-[541px]":1===e.length}),children:(0,a.jsx)("div",{className:"tw-bg-white tw-mt-[12px] tw-h-[98%] tw-border tw-border-solid tw-border-gray-500 tw-flex tw-justify-center tw-items-center tw-p-4",children:(0,a.jsx)("p",{className:"tw-text-[18px] tw-font-bold",children:"Please add other products to compare"})})})]}),(0,a.jsxs)("table",{"aria-label":"Product Comparison Table",cellPadding:4,className:r()("lg:tw-max-w-[95%] tw-w-full max-lg:tw-block max-lg:tw-w-full max-lg:tw-overflow-scroll tw-border-separate tw-border-spacing-x-2 tw-rotate-180 compare-table tw-pb-3 tw-table-fixed tw-hidden max-sm:tw-block"),children:[(0,a.jsx)(x,{productsInfo:e}),(0,a.jsxs)("tbody",{className:"tw-rotate-180",children:[(0,a.jsx)(f,{productsInfo:e,handleFavouritesRemove:v}),Object.entries(p).map((t,e,l)=>{let[s,r]=t;return(0,a.jsx)(h,{propertyTitle:s,values:r,array:l,index:e})})]})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"tw-my-4 max-sm:tw-text-center max-sm:tw-text-2xl",children:"Your comparison list is empty!"}),(0,a.jsx)("h3",{className:"tw-mb-8 max-sm:tw-text-center max-sm:tw-text-base max-sm:tw-mx-4",children:"Add items to start comparing and find the best choice for you."})]})]})},x=t=>{let{productsInfo:e}=t,l=e.length>=2?"calc(90%/".concat(e.length,")"):"calc('100%/2')";return(0,a.jsxs)("colgroup",{className:"tw-rotate-180 max-lg:tw-w-screen",children:[(0,a.jsx)("col",{className:"max-lg:!tw-hidden tw-w-[120px]"}),e.map(t=>(0,a.jsx)("col",{className:"tw-w-[".concat(l,"] tw-max-w-[").concat(l,"]")},t.UPID))]})},f=t=>{let{productsInfo:e,handleFavouritesRemove:l}=t;return(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"max-lg:tw-hidden"}),(0,a.jsx)(d.a,{strategy:"afterInteractive"}),null==e?void 0:e.map(t=>(0,a.jsx)("th",{scope:"col",className:r()("tw-p-3 tw-pl-4 max-lg:tw-rounded-md lg:tw-border-t tw-bg-white",m),children:(0,a.jsx)(w.FavouriteItem,{productDetails:{...t,isSelected:!0},showCheckBox:!1,removeFromFavourites:()=>l(t),compareProductLength:e.length,comparePage:!0})},t.UPID+"_header"))]},"produdct-header-row")},h=t=>{let{propertyTitle:e,values:l,index:s,array:n}=t;return(0,a.jsxs)("tr",{className:"tw-bg-white max-lg:tw-bg-transparent group",children:[(0,a.jsx)("th",{className:r()("tw-p-3 tw-pl-4 tw-text-sm tw-text-gray-400 tw-font-semibold max-lg:!tw-hidden tw-w-auto tw-text-end"),scope:"row",children:e}),l.map((t,l)=>(0,a.jsx)("td",{className:r()(m,0===s?"lg:tw-border-t":s===n.length-1?"lg:tw-border-b":""),children:(0,a.jsxs)("div",{className:"tw-flex tw-flex-col tw-item tw-justify-start max-lg:tw-my-2 group-first:max-lg:tw-mt-3 group-last:max-lg:tw-mb-3",children:[(0,a.jsx)("span",{className:r()("tw-text-sm tw-text-gray-400 tw-font-semibold lg:tw-hidden"),children:e}),(0,a.jsx)("span",{className:"tw-p-3 tw-pl-4 tw-bg-white tw-w-full max-lg:tw-rounded-lg max-lg:tw-p-2 max-lg:tw-mt-1",children:t||"-"})]})},"".concat(e,"-").concat(l)))]},e)}},34853:function(t,e,l){"use strict";var a=l(33931);l.o(a,"usePathname")&&l.d(e,{usePathname:function(){return a.usePathname}}),l.o(a,"useRouter")&&l.d(e,{useRouter:function(){return a.useRouter}}),l.o(a,"useSearchParams")&&l.d(e,{useSearchParams:function(){return a.useSearchParams}})}},function(t){t.O(0,[7706,7975,974,3445,7205,327,1744],function(){return t(t.s=71124)}),_N_E=t.O()}]);