PageSourceSearch

https://www.certainteed.com/themes/custom/certainteed/react-app/build/static/js/7645.e052beaa.chunk.js

js certainteed.com collected 2026-10-02 02:54:51 UTC 10,129 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkreact_app=self.webpackChunkreact_app||[]).push([[7645],{4084:function(e,n,t){t.d(n,{zu:function(){return l}});var i=t(4296),r=t.n(i),a=function(){var e,n=(null===(e=window.drupalSettings)||void 0===e?void 0:e.algolia)||{},t=atob(n.app_id),i=atob(n.api_key);return r()(t,i)},l=function(e){return a().initIndex(e)}},581:function(e,n,t){t.d(n,{U:function(){return a},b:function(){return r}});var i=t(1413),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined",n=arguments.length>1?arguments[1]:void 0;return(0,i.Z)((0,i.Z)({},n),{},{search_result_selected:e})},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined",n=arguments.length>1?arguments[1]:void 0;return(0,i.Z)((0,i.Z)({},n),{},{eventOrigin:"front-end",search_term:e})}},8112:function(e,n,t){var i=t(9439),r=t(2791);n.Z=function(e,n){var t=(0,r.useState)(e),a=(0,i.Z)(t,2),l=a[0],o=a[1];return(0,r.useEffect)((function(){var t=setTimeout((function(){o(e)}),n);return function(){clearTimeout(t)}}),[e,n]),l}},6405:function(e,n,t){t.d(n,{Z:function(){return k}});var i,r=t(1413),a=t(9439),l=t(2791),o=t(3433),c=function(e,n){return e?(Array.isArray(e)||(e=[e]),e.map((function(e){var t,i=JSON.parse(e);return null!==n&&void 0!==n&&n.length&&null!==i&&void 0!==i&&null!==(t=i.ctburegions)&&void 0!==t&&t.regionID&&!n.some((function(e){return null===i||void 0===i?void 0:i.ctburegions.regionID.some((function(n){return n===e||"global"===n}))}))?null:{img:null===i||void 0===i?void 0:i.swatchImage,label:null===i||void 0===i?void 0:i.marketingColor,value:null===i||void 0===i?void 0:i.marketingColor}})).filter((function(e){return e}))):[]},u=t(6407),d=t(8486),s=t(5734),_=t(7523),f=t(8340),v=t(9243),h=t(9151),g=t(184),m=function(e){var n,t,i,r=e.suggestions,a=e.products,l=e.documents,m=e.searchTerm,p=e.defaultIndex,b=(0,_.wf)(),y=(0,v.T)().regionIds;if((null===r||void 0===r||null===(n=r.hits)||void 0===n||!n.length)&&(null===a||void 0===a||null===(t=a.hits)||void 0===t||!t.length)&&(null===l||void 0===l||null===(i=l.hits)||void 0===i||!i.length))return[];var x=function(e){var n=e.target;n.closest(".global-search-header")&&b({event:"search_result_clicked",event_origin:"front_end",search_term:m.queryValue,link_url:n.href,link_text:n.textContent,content_type:"search_auto_complete"})};return[].concat((0,o.Z)(function(){if(null===r||void 0===r||!r.nbHits)return[];var e=[];e.push({id:"suggestions-title",value:"Search suggestions",heading:!0});var n=r.hits.map((function(e){var n,t,i,r,a,l=(null===(n=e._highlightResult)||void 0===n||null===(t=n.query)||void 0===t?void 0:t.value)||e.media_field_name||e.media_name,o=e.query;return{value:(0,g.jsxs)("div",{className:"global-search-dynamic__suggestion",children:[(0,g.jsx)("div",{className:"global-search-dynamic__suggestion-title",dangerouslySetInnerHTML:{__html:l}})," ",!!(Array.isArray(null===(i=e[p])||void 0===i||null===(r=i.facets)||void 0===r||null===(a=r.exact_matches)||void 0===a?void 0:a.ct_bundle_label)&&e[p].facets.exact_matches.ct_bundle_label.length>0)&&(0,g.jsxs)("div",{className:"global-search-dynamic__suggestion-in",children:["in"," ",e[p].facets.exact_matches.ct_bundle_label[0].value]})]}),searchValue:o}}));return e.push.apply(e,(0,o.Z)(n)),e}()),(0,o.Z)(function(){if(null===a||void 0===a||!a.nbHits)return[];var e=[];e.push({value:(0,g.jsx)("div",{className:"global-search-dynamic__products-title",children:"Products"}),heading:!0});var n=a.hits.map((function(e){var n=e.field_is_specialty_ceiling?(0,s.Z)(e.product_color_chips):c(e.product_color_swatches,y),t={};e.field_product_image&&(t=(0,h.Z)(e.field_product_image));var i=(0,g.jsxs)("div",{className:"global-search-dynamic__product",children:[!!t.external_url&&(0,g.jsx)("img",{className:"global-search-dynamic__product-img",src:t.external_url,alt:t.alt}),(0,g.jsxs)("div",{className:"global-search-dynamic__product-content",children:[(0,g.jsxs)("ul",{className:"global-search-dynamic__product-tags",children:[(null===e||void 0===e?void 0:e.field_product_category)&&(0,g.jsx)("li",{children:null===e||void 0===e?void 0:e.field_product_category}),(null===e||void 0===e?void 0:e.product_new_tag)&&(0,g.jsx)("li",{children:"new"})]}),(0,g.jsx)("a",{className:"global-search-dynamic__product-title",href:e.url,onClick:x,children:e.title}),(null===n||void 0===n?void 0:n.length)>0&&(0,g.jsx)(f.Z,{items:n,keyProp:"product-card",type:"image",enableCustomColor:!0,enableMoreButtonClick:!1,machineName:"global-search-autocomplete-swatches-".concat(e.nid),customFixedItemsLength:4})]})]});return{id:e.nid,value:i,isLink:!0}}));return e.push.apply(e,(0,o.Z)(n)),e}()),(0,o.Z)(function(){if(null===l||void 0===l||!l.nbHits)return[];var e=[];e.push({id:"documents-title",value:"Documents",heading:!0});var n=l.hits.map((function(e){var n,t,i=(null===(n=e.media_field_name)||void 0===n?void 0:n.replace(/<\/?[^>]+(>|$)/g,""))||e.media_name,r=(0,g.jsxs)("div",{className:"global-search-dynamic__document",children:[(0,g.jsxs)("div",{className:"global-search-dynamic__document-header",children:[(0,g.jsx)(u.Z,{iconName:d.Z[null===e||void 0===e||null===(t=e.second_eyebrow)||void 0===t?void 0:t.toLowerCase()]||d.Z.default}),(0,g.jsxs)("ul",{className:"global-search-dynamic__document-tags",children:[e.second_eyebrow&&(0,g.jsx)("li",{children:e.second_eyebrow}
1),e.media_field_region_top_abbreviation&&(0,g.jsx)("li",{children:e.media_field_region_top_abbreviation}),e.media_field_language_abbreviation&&(0,g.jsx)("li",{children:e.media_field_language_abbreviation})]})]}),(0,g.jsx)("a",{className:"global-search-dynamic__document-link",href:e.ct_media_download_url,onClick:x,children:i})]});return{id:e.mid,value:r,isLink:!0,modClass:"document"}}));return e.push.apply(e,(0,o.Z)(n)),e}()),(0,o.Z)(function(){var e=(null===m||void 0===m?void 0:m.globalSearch)||(null===m||void 0===m?void 0:m.queryValue)||"";return e?[{id:"see-all-link",value:(0,g.jsx)("div",{className:"global-search-dynamic__see-all-link-wrap",children:(0,g.jsx)("a",{className:"global-search-dynamic__see-all-link",href:"/search?query=".concat(e),children:Drupal.t("See All")})}),isLink:!0}]:[]}()))},p=t(4084),b=t(4772),y=t(6856),x=t(7571),Z=t(7240),N=JSON.parse((null===(i=window.drupalSettings.algoliaSearch)||void 0===i?void 0:i.globalSearch[0])||"{}").algolia_index,w=(0,p.zu)(N),j=(0,p.zu)((0,b.Z)(N)),k=function(e){var n=e.searchTerm,t=e.debouncedSearchTerm,i=(null===n||void 0===n?void 0:n.globalSearch)||(null===n||void 0===n?void 0:n.queryValue)||"",o=(0,l.useState)({}),c=(0,a.Z)(o,2),u=c[0],d=c[1],s={page:0,hitsPerPage:3},_=function(e,n){return e.search((0,Z.Z)(i),n)};return(0,l.useEffect)((function(){t&&(i?Promise.all([_(j,(0,r.Z)((0,r.Z)({},s),{},{clickAnalytics:!0,attributesToRetrieve:["_highlightResult","media_field_name","media_name","query",N]})),_(w,(0,r.Z)((0,r.Z)({},s),{},{facetFilters:[["ct_bundle_label:Products"]],filters:(0,y.Rn)(),attributesToRetrieve:["field_is_specialty_ceiling","product_color_chips","product_color_swatches","field_image","field_product_image","field_product_category","product_new_tag","url","title","nid"]})),_(w,(0,r.Z)((0,r.Z)({},s),{},{facetFilters:[["ct_bundle_label:Documents & downloads"]],filters:(0,x.UT)([(0,y.Vb)(),(0,y.Ti)()]),attributesToRetrieve:["media_field_name","media_name","second_eyebrow","media_field_region_top_abbreviation","media_field_language_abbreviation","ct_media_download_url","mid"]}))]).then((function(e){var n=(0,a.Z)(e,3),t=n[0],i=n[1],r=n[2];d({suggestions:t,products:i,documents:r})})):d({}))}),[t]),m((0,r.Z)((0,r.Z)({},u),{},{searchTerm:n,defaultIndex:N}))}},7571:function(e,n,t){t.d(n,{UT:function(){return c},gz:function(){return o},zC:function(){return u}});var i=t(3433),r=t(9439),a=function(e,n){return"".concat(n,":").concat(e)},l=function(e,n){if(!e)return"";if("string"===typeof e&&e.includes(" OR ")){var t=e.split(" OR ").map((function(e){return Number.isNaN(Number(e))?"".concat(n,':"').concat(e,'"'):"".concat(n,"=").concat(e)})).join(" OR ");return"(".concat(t,")")}return Number.isNaN(Number(e))?"".concat(n,':"').concat(e,'"'):"".concat(n,"=").concat(e)},o=function(e){var n=[],t=window.drupalSettings.algoliaSearch.facet.facetKey;return Object.entries(e).forEach((function(e){var i,l,o=(0,r.Z)(e,2),c=o[0],u=o[1],d="";t.indexOf(c)>-1&&(u&&(Array.isArray(u)&&(i=c,d=(l=u).length&&i?l.map((function(e){return a(e,i)})):null),"string"===typeof u&&(d=a(u,c))),d&&n.push(d))})),n},c=function(e){if(!e.length)return null;var n="";return e.forEach((function(e){n+=e&&n?" AND ".concat(e):e})),n},u=function(e){var n=[];return Object.entries(e).forEach((function(e){var t=(0,r.Z)(e,2),a=t[0],o=t[1];if(Array.isArray(o)){var c="";o.length&&"object"===typeof o[0]?(o.forEach((function(e){c+=c?" OR ".concat(e.value):e.value})),n=[].concat((0,i.Z)(n),[l(c,a)])):(o.forEach((function(e){c+=c?" OR ".concat(e):e})),n=[].concat((0,i.Z)(n),[l(c,a)]))}else n=[].concat((0,i.Z)(n),[l(o,a)])})),c(n)}}
1,8486:function(e,n){n.Z={doc:"doc",docx:"docx",txt:"txt",dwg:"dwg",pdf:"pdf",xls:"xls",xlsx:"xlsx",default:"doc"}},4772:function(e,n){n.Z=function(e){return"".concat(e,"_query_suggestions")}},9151:function(e,n,t){var i=t(6856);n.Z=function(e){if(!e)return{};try{var n={ca:"Canada",us:"USA"}[(0,i.n3)()]||"",t={};return"string"===typeof e&&(t=JSON.parse(e)),Array.isArray(e)&&e.length>1&&e.length<4&&(t={},e.forEach((function(e){var i=JSON.parse(e);i.country&&i.country.trim()===n&&(t=i);var r;i.country&&(r=t,0===Object.entries(r).length)&&i.country.includes(n)&&(t=i)}))),t}catch(r){return{}}}},5734:function(e,n){n.Z=function(e){var n,t,i;if(!Array.isArray(e))return[];var r=null===(n=window.drupalSettings)||void 0===n||null===(t=n.ctGeolocation)||void 0===t||null===(i=t.siteLocale)||void 0===i?void 0:i.country;return e.map((function(e){return JSON.parse(e)})).filter((function(e){return"GLOBAL"===e.country||e.country===r})).map((function(e){return{img:e.url,label:e.color,value:e.color,field_is_custom:e.field_is_custom}}))}}
1,7240:function(e,n){n.Z=function(e){if(!e)return"";var n=new RegExp(/\.|,|'|\+|-/,"gi");return e.replace(n," ")}}}]);
2//# sourceMappingURL=7645.e052beaa.chunk.js.map

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.