1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9323],{9323:(e,r,t)=>{t.d(r,{L9:()=>i,yF:()=>o,_4:()=>c});var l=t(9660),a=t(7620),n=t(51593);let i=(e,r)=>{if(!e)return null;for(let l of e){var t;if(l.group_id===r)return l;if(null==(t=l.children)?void 0:t.length){let e=i(l.children,r);if(e)return e}}return null},u=e=>e?e.replace(/^\/+/,"").replace(/\/+$/,""):"",o=(e,r)=>{if(!e)return null;let t=(e,l)=>{for(let i of e){var a,n;let e=(null==(a=i.data)?void 0:a.slug)||"",o=e?[...l,e]:l;if(i.group_id===r){let e=i.path?u(i.path):o.join("/");return{category:i,slugPath:e}}if(null==(n=i.children)?void 0:n.length){let e=t(i.children,o);if(e)return e}}return null};return t(e,[])};var d=t(65733),s=t(88180);let c=e=>{let r=(0,d.Lu)(),t=(0,s.G)(),{data:u}=(0,n.An)(r?{client:r,locale:t}:l.hT);return(0,a.useMemo)(()=>{var r,t;return u&&0!==u.length?e?null!=(r=i(u,e))?r:null:null!=(t=u[0])?t:null:null},[u,e])}},20545:(e,r,t)=>{t.d(r,{u:()=>l});let l=(e,r)=>{if(!r)return e;try{let r=new URL(e,"https://placeholder.com"),t=r.pathname.split("/").filter(Boolean);return t.length>=3&&"product"===t[0]&&(t.pop(),r.pathname="/".concat(t.join("/"))),r.pathname+r.search+r.hash}catch(r){return e.replace(/\/[^/?#]+(?:\?|#|$)/,"/")}}},51593:(e,r,t)=>{t.d(r,{EL:()=>p,S1:()=>h,An:()=>m,ol:()=>g});var l=t(9660),a=t(49321),n=t(62949),i=t(20545),u=t(74680);let o=function(e,r){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"entityId",l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(!e)return null;for(let n of Array.isArray(e)?e:[e]){var a;let e=l||n,i=n[t];if((null==i?void 0:i.toString())===(null==r?void 0:r.toString()))return e;if(null==(a=n.children)?void 0:a.length){let l=o(n.children,r,t,e);if(l)return l}}return null},d=(e,r,t,l)=>{var a;let{data:o}=e;if(!o)return null;let d=e.value||o["metadata:product_name"]||o.name||"",s=e.variations||[],c=s.length>1,p=o["metadata:average_rating"]||0,y=o["metadata:reviews"]||0,v=o.variation_id?"SKU: ".concat(o.variation_id):null,g=((e,r)=>{let t=[];return(null==e?void 0:e.hotbuy)&&t.push("hot-buy"),r.some(e=>{var r;return null==e||null==(r=e.data)?void 0:r.clearance})&&t.push("clearance"),t})({...o,id:null!=(a=o.id)?a:""},s),{regularPrice:f,salePrice:m,minPrice:h,maxPrice:_}=(e=>{let{data:r}=e,t=e.variations||[];if(!r)return{regularPrice:0,salePrice:null,minPrice:0,maxPrice:0,isSalePriceAvailable:!1};let l=r.sale_price,a=r.list_price||0,n="number"==typeof l&&l>0?l:void 0,i=e=>{let r=null==e?void 0:e.sale_price,t=null==e?void 0:e.facet_price,l=(null==e?void 0:e.list_price)||0;return"number"==typeof r&&r>0&&"number"==typeof l&&r<l?r:"number"==typeof t?t:l},u=i(r),o=i(r);for(let e of t)if(null==e?void 0:e.data){let r=i(e.data);r<u&&(u=r),r>o&&(o=r)}u||(u=null!=n?n:a),o||(o=a);let d="number"==typeof n&&n>0&&n!==a;return{regularPrice:a,salePrice:d?n:null,minPrice:u,maxPrice:o,isSalePriceAvailable:d}})(e),b=o["metadata:product_status"],{isComingSoon:w}=(0,u.Mh)({productStatus:b,productArrivalDate:o.arrival_date}),A=!!o["metadata:special_order"],S=(o.availabilityDetails||[]).length>0,I="OutOfStock";w?I="PreOrder":S&&(I="InStock");let P={productEntityId:o.product_entity_id||0,variantEntityId:o.variant_entity_id||0,productName:d,imageUrl:o.image_url||"/images/product-image.png",sku:o.variation_id||"",analyticsProductId:o.id||""},k=((e,r,t)=>{let l="number"==typeof t&&"number"==typeof r&&t<r,a=l?r-t:0,n=e["metadata:brand"],i=e["metadata:category_hierarchy"],u=(null==i?void 0:i.split(" > "))||[];return{pageContext:"carousel",price:l?t:r,...a>0&&{discount:Number(a.toFixed(2))},...n&&{brand:n},...u[0]&&{itemCategory:u[0]},...u[1]&&{itemCategory2:u[1]},...u[2]&&{itemCategory3:u[2]},...u[3]&&{itemCategory4:u[3]},sourcePage:"carousel"}})(o,f,m),L={productId:o.id||"",productName:d,brand:o["metadata:brand"]||void 0,productDescription:null!=v?v:"",imageSrc:!o.image_url||/\/images\/default-img\.\w+$/.test(o.image_url)?"/images/default-img.svg":o.image_url,productLink:(0,i.u)((0,n.M)(o.url||"#"),c),regularPrice:f,salePrice:null!=m?m:void 0,isWishlisted:!1,rating:Math.floor(p),averageRating:p,reviewCount:y,ratingLink:"".concat((0,n.M)(o.url||""),"#reviews-section"),productLabelVariants:g.length>
10?g:void 0,variant:c?"multiple":"single",minPrice:h,maxPrice:_,actionData:{isComingSoon:w,isSpecialOrder:A,isMultivariantItem:c,productEntityId:o.product_entity_id||0,variantEntityId:o.variant_entity_id||0,variantSku:c?void 0:o.variation_id||void 0,storeStatus:I,showComparison:t},wishlistData:P,wishlistTrackingContext:k,showControls:r,topLevelCategory:null};if(Array.isArray(o.groups))for(let e of o.groups)(null==e?void 0:e.group_id)&&!l.has(e.group_id)&&l.set(e.group_id,{id:e.group_id,label:e.display_name||e.group_id});return L},s=e=>{e.sort((e,r)=>{var t,l;let a=null!=(t=e.display_name)?t:"",n=null!=(l=r.display_name)?l:"";return a.localeCompare(n,"en",{sensitivity:"base"})}),e.forEach(e=>{var r;(null==(r=e.children)?void 0:r.length)&&s(e.children)})},c=e=>{let{endpointDefinition:r,endpointName:t,queryArgs:a}=e,n={...a};return delete n.client,(0,l.lE)({endpointName:t,queryArgs:n,endpointDefinition:r})},{useAutocompleteQuery:p,useSearchQuery:y,useLazySearchQuery:v,useRecommendationsQuery:g,useLazyRecommendationsQuery:f,useCategoryTreeQuery:m,useCarouselProductsQuery:h}=a.F.injectEndpoints({endpoints:e=>({autocomplete:e.query({queryFn:async e=>{let{client:r,query:t}=e;try{return{data:await r.autocomplete.getAutocompleteResults(t,{resultsPerSection:{Brands:3,Categories:5,Content:50,Products:12,"Search Suggestions":3}})}}catch(e){return{error:e}}},serializeQueryArgs:c}),search:e.query({queryFn:async e=>{let{client:r,query:t,filters:l={},sort:a,page:n=1,resultsPerPage:i=24,mode:u="search",browseFilter:o}=e;try{let e={resultsPerPage:i,page:n,filters:{}};return Object.entries(l).forEach(r=>{let[t,l]=r;null!=l&&""!==l&&(Array.isArray(l)&&l.length>0?e.filters[t]=l.map(String):Array.isArray(l)||(e.filters[t]=[String(l)]))}),a&&(e.sortBy=a.field,e.sortOrder="asc"===a.order?"ascending":"descending"),{data:"search"===u?await r.search.getSearchResults(t,e):(()=>{if(!(null==o?void 0:o.key)||!(null==o?void 0:o.value))throw Error("Browse mode requires browseFilter with key and value");return r.browse.getBrowseResults(o.key,o.value,e)})()}}catch(e){return{error:e}}},serializeQueryArgs:c}),recommendations:e.query({queryFn:async e=>{let{client:r,item_id:t,podId:l,numResults:a=24,ui:n,i}=e;try{let e=[];Array.isArray(t)?e=t:t&&(e=[t]);let u={itemIds:e,numResults:a};return n?u.ui=n:u.i=i,{data:await r.recommendations.getRecommendations(l,u)}}catch(e){return{error:e}}},serializeQueryArgs:c}),categoryTree:e.query({queryFn:async e=>{let{client:r}=e;try{var t;let e=null==(t=(await r.browse.getBrowseGroups({fmtOptions:{groups_max_depth:100}})).response)?void 0:t.groups;if(!e||0===e.length)return{data:[]};return s(e),{data:e}}catch(e){return{error:e}}},serializeQueryArgs:c}),carouselProducts:e.query({queryFn:async e=>{let{client:r,podId:t,itemId:l,itemIds:a,numResults:n,showControls:i=!1,showComparison:u=!1,categoryTree:s=[],ui:c,i:p}=e;try{let e=a&&a.length>0?a:l,y=[];Array.isArray(e)?y=e:e&&(y=[e]);let v=null;if("new-arrivals"===t)v=await r.browse.getBrowseResults("metadata:new_arrival","True",{resultsPerPage:n});else{let e={itemIds:y,numResults:n};c?e.ui=c:p&&(e.i=p),v=await r.recommendations.getRecommendations(t,e)}return{data:((e,r)=>{var t,l,a,n,i;let{showControls:u,showComparison:s,categoryTree:c=[]}=r,p=(e=>{if(!e)return[];let r=new Set;for(let l of e){var t;let e=null==(t=l.data)?void 0:t.group_ids;if(Array.isArray(e))for(let t of e)t&&r.add(t)}return Array.from(r)})(null==e||null==(t=e.response)?void 0:t.results),y=[],v=new Map;if(null==e||null==(l=e.response)?void 0:l.results)for(let r of e.response.results){let e=d(r,u,s,v);e&&y.push(e)}let g=new Map;for(let e of p){let r=o(c,e,"group_id");if(r)g.set(e,{id:r.group_id||e,label:r.display_name||r.title||e});else{let r=v.get(e);g.set(e,null!=r?r:{id:e,label:e})}}let f=new Map;for(let e of g.values())f.has(e.label)||f.set(e.label,e);let m=Array.from(f.values());for(let r of y){let t=null==e||null==(n=e.response)||null==(a=n.results)?void 0:a.find(e=>{var t;return(null==(t=e.data)?void 0:t.id)===r.productId});if(Array.isArray(null==t||null==(i=t.data)?void 0:i.group_ids)){let[e]=t.data.group_ids;if(e){let t=g.get(e);t&&(r.topLevelCategory=t)}}}return{products:y.slice(0,24),categories:m,resultId:null==e?void 0:e.result_id}})(v,{showControls:i,showComparison:u,categoryTree:s})}}catch(e){return{error:e}}},serializeQueryArgs:c})})})},62949:(e,r,t)=>{t.d(r,{M:()=>a});let l=/^\/(?:en|fr)(?:\/|$)/,a=e=>{try{let r=new URL(e);return r.pathname.replace(l,"/")+r.search+r.hash}catch(r){return console.error("Invalid URL provided to createRelativeURL:",e,r),e}}},65733:(e,r,t)=>{t.d(r,{Lu:()=>p});
1var l=t(50160),a=t.n(l),n=t(7620),i=t(41159),u=t(88180);let o={"en-US":"key_wIXKbLnT5aNrKxN9",fr:"key_KYd4C2FWl5eP3OyM"},d="https://ac.cnstrc.com/",s=null,c=null,p=()=>{let e=(0,u.G)(),r=(0,i.GV)(e=>e.user.id);return(0,n.useMemo)(()=>{if(s&&c&&c.locale===e&&c.userId===r)return s;let t={apiKey:o[e],...d&&{serviceUrl:d}};return null!==r&&(t.userId=r),s=new(a())(t),c={locale:e,userId:null!=r?r:null},s},[e,r])}}}]);
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.