1"use strict";(self.webpackChunkreact_app=self.webpackChunkreact_app||[]).push([[9482,8924],{24:function(e,t,a){a.r(t),a.d(t,{default:function(){return B}});var n,i,r,l=a(3433),o=a(1413),c=a(9439),s=a(2791),u={topFilters:[{name:"query",label:Drupal.t("TITLE"),placeholder:Drupal.t("Search ..."),type:"autocomplete",submitOnResultSelect:!0,class:"search"},{name:"field_product_category_name",label:Drupal.t("Product Categories"),type:"select",options:[],isMulti:!0,class:"categories"},{name:"field_building_type_name",label:Drupal.t("Building Type"),type:"select",options:[],class:"building-type"},{name:"field_application_name",label:Drupal.t("Application"),type:"select",options:[],class:"application-name"},{name:"field_project_type_name",label:Drupal.t("Project Type"),type:"toggle",options:[],class:"project-type"},{name:"field_region_tid",label:Drupal.t("Country"),type:"select",options:[],class:"country"},{name:"field_region_name",label:Drupal.t("Region"),type:"select",options:[],class:"region"}]},d=a(4084),f=a(7571),p=a(7523),m=a(5259),h=a(1865),_=a(9647),v=a(2944),g=a(6922),y=a(7413),b=a(4178),x=a(8112),Z=a(7240),j=a(184),S=null===(n=window)||void 0===n||null===(i=n.drupalSettings)||void 0===i||null===(r=i.inspirationArticleBlock)||void 0===r?void 0:r.indexName,w=(0,d.zu)(S),N=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=(0,s.useState)([]),i=(0,c.Z)(n,2),r=i[0],l=i[1],u={page:0,hitsPerPage:5,attributesToRetrieve:["title","nid"]},d=function(e){var t=[];return Object.entries(e||{}).forEach((function(e){var a=(0,c.Z)(e,2),n=a[0],i=a[1];i&&"query"!==n&&(Array.isArray(i)&&i.length?t.push("".concat(n,":").concat(i.join(","))):i&&t.push("".concat(n,":").concat(i)))})),t.push("field_resource_type_name:-Contractor Project"),t};return(0,s.useEffect)((function(){t&&(e?w.search((0,Z.Z)(e),(0,o.Z)((0,o.Z)({},u),{},{facetFilters:d(a)})).then((function(e){l(e.hits||[])})):l([]))}),[t,a]),(0,s.useMemo)((function(){return r.length?r.map((function(e){var t,a;return{id:e.nid,value:(0,j.jsx)("div",{dangerouslySetInnerHTML:{__html:null===(t=e._highlightResult)||void 0===t||null===(a=t.title)||void 0===a?void 0:a.value}}),searchValue:e.title}})):[]}),[r])},k=a(2285),P=function(e){var t=e.filtersConfig,a=void 0===t?{}:t,n=e.filtersState,i=e.setFiltersState,r=e.queryPlaceHolder,l=e.filtersAnalyticsData,c=e.clearAllCallback,s=e.onSearch,u=a||{},d=(0,x.Z)(n.query,500),f=N(n.query,d,n),p=(null===n||void 0===n?void 0:n.query)||(null===n||void 0===n?void 0:n.field_product_category_name)||(null===n||void 0===n?void 0:n.field_project_type_name)||(null===n||void 0===n?void 0:n.field_region_name)||(null===n||void 0===n?void 0:n.field_region_tid)||(null===n||void 0===n?void 0:n.field_application_name)||(null===n||void 0===n?void 0:n.field_building_type_name);return(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:(0,_.Z)("ct-inspiration-article-listing__header",[],"",["flex"]),children:[u.map((function(e){var t=n,a=i,c=e;return"query"===e.name&&(c=(0,o.Z)((0,o.Z)({},e),r?{placeholder:r}:{})),(0,j.jsxs)("div",{className:(0,_.Z)("ct-inspiration-article-listing__item",[e.class],"",[""]),children:[(0,j.jsx)(b.Z,(0,o.Z)((0,o.Z)({fieldConfig:c,state:t,setState:a},e),{},{children:"query"===e.name&&f,analyticsData:l,onSearch:s}),"".concat(e.type,"-").concat(e.name)),"query"===e.name&&(0,j.jsx)(k.Z,{mods:["m","primary"],onClick:function(){s(!0)},children:"Search"})]})})),(0,j.jsx)("div",{className:"ct-inspiration-article-listing_acttons",children:(0,j.jsx)("a",{mods:["blank","arrow"],extra:[p?"":"disabled"],onClick:c,children:"Clear Filters"})})]})})},C=!1,D=function(e){var t=e.listingHeader,a=void 0===t||t,n=e.showSelectedSort,i=e.pagerData,r=e.enableAutoScroll,l=void 0===r||r,c=e.mods,u=e.extra,d=void 0===u?[]:u,f=e.children,p=e.queryState,m=e.setQueryState,h=e.filtersConfig,b=e.filtersState,x=e.setFiltersState,Z=e.queryPlaceHolder,S=e.clearAllCallback,w=e.onSearch,N=h||{},k=(0,s.useRef)(null),D=(0,y.Z)().width;return(0,s.useEffect)((function(){if(C&&l&&!window.isStoryBook){var e=parseInt(document.querySelector("body").style.paddingTop,10)||0,t=document.querySelector(".header"),a=!t||D<960?0:parseInt(t.offsetHeight,10);(0,g.Z)(100,k.current.offsetTop-e-a)}else"undefined"!==typeof i.meta.pageNumber&&(C=!0)}),[i.meta.pageNumber]),(0,j.jsxs)("div",{className:(0,_.Z)("ct-inspiration-article-listing",c,"",d),ref:k,children:[a&&(0,j.jsx)(P,{formConfig:N,queryState:p,setQueryState:m,filtersConfig:h,filtersState:b,setFiltersState:x,queryPlaceHolder:Z,clearAllCallback:S,onSearch:w}),(0,j.jsxs)("div",{className:(0,_.Z)("listing",["article"]),children:[f,n]}),(0,j.jsx)(v.Z,(0,o.Z)({},i))]})},T=a(6104),E=a(6903),O=function(e){return e?e.replace(/<[^>]*>/g,"").trim():""},R=function(e){var t=e.articles,a=e.displayType;return t&&0!==t.length?(0,j.jsx)("div",{className:(0,_.Z)("inspiration-listing",[a],""),children:t.map((function(e){return(0,j.jsxs)("div",{className:(0,_.Z)("card"),children:[(0,j.jsx)("div",{className:(0,_.Z)("card-brand"),children:(0,j.jsx)(E.Z,{responsiveImageStyle:"inspiration_card",imagePath:e.imagePath,damImage:e.damImage,altText:e.mediaAlt})}),(0,j.jsxs)("div",{className:(0,_.Z)("card-body"),children:[(0,j.jsx)("div",{className:(0,_.Z)("card-level"),children:O(e.resourceType)}),(0,j.jsx)("h5",{className:(0,_.Z)("card-title"),children:(0,j.jsx)("a",{className:(0,_.Z)("link--cover"),href:O(e.imageUrl),children:O(e.title)||"
1No Title"})})]})]},e.nid)}))}):(0,j.jsx)("div",{children:"No articles data available."})},q=function(e,t){return e.map((function(e){var a=e,n=a.type,i=a.name,r={};if(t["".concat(e.name)]){if("select"===n){var l=[];l=l.concat({label:"".concat(e.label),value:""}),Object.entries(t["".concat(i)]).forEach((function(e){var t=(0,c.Z)(e,1)[0];l.push({label:"".concat(t),value:t})})),e.options=l}if("toggle"===n){var o=[];Object.entries(t["".concat(i)]).forEach((function(e){var t=(0,c.Z)(e,1)[0];o.push({label:"".concat(t),value:t})})),e.options=o}r=e}else e=null;return r}))},F=function(e,t){return e.map((function(e){var a=e.type,n=e.name,i={};return t[n]?("select"===a&&Object.values(t[n]).forEach((function(){e.options=e.options.map((function(e){return e.label="".concat(e.value),e.disabled=!0,e.count=0,t[n][e.value]?(e.label="".concat(e.value," (").concat(t[n][e.value],")"),e.disabled=!1,e.count=t[n][e.value],e):e}))})),"toggle"===a&&Object.values(t[n]).forEach((function(){e.options=e.options.map((function(e){return e.label="".concat(e.value),e.disabled=!0,e.count=0,t[n][e.value]?(e.label="".concat(e.value," (").concat(t[n][e.value],")"),e.disabled=!1,e.count=t[n][e.value],e):e}))})),i=e):i=e,i}))},A=a(1335),H=!1,I={query:"query",field_product_category_name:"fieldProductCategoryname",field_project_type_name:"fieldProjectTypename",field_region_tid:"fieldCountryname",field_region_name:"fieldRegionName",field_application_name:"fieldApplicaionType",field_building_type_name:"fieldBuildingType"};function L(){if("undefined"!==typeof window){var e=window.location,t=e.protocol,a=e.host,n=e.pathname,i="".concat(t,"//").concat(a).concat(n);window.history.replaceState({},"",i)}}var B=function(e){var t=e.props,a=e.storyBookData,n=t.indexName,i=t.filters,r=t.disableUpdateParams,_=(0,s.useState)(a?0:(0,d.zu)(n)),v=(0,c.Z)(_,1)[0],g=(0,s.useState)("grid"),y=(0,c.Z)(g,2),b=y[0],x=y[1],S=(0,m.Z)("hitsPerPage"),w=(0,c.Z)(S,1)[0],N=(0,m.Z)("query"),k=(0,c.Z)(N,1)[0],P=(0,m.Z)("fieldProductCategoryname"),C=(0,c.Z)(P,1)[0],E=(0,m.Z)("fieldProjectTypename"),O=(0,c.Z)(E,1)[0],B=(0,m.Z)("fieldCountryname"),M=(0,c.Z)(B,1)[0],z=(0,m.Z)("fieldRegionName"),U=(0,c.Z)(z,1)[0],G=(0,m.Z)("fieldBuildingType"),Q=(0,c.Z)(G,1)[0],V=(0,m.Z)("fieldApplicaionType"),W={hitsPerPage:w||"",query:k||"",field_product_category_name:C||"",field_project_type_name:O||"Commercial",field_region_tid:M||"",field_region_name:U||"",field_application_name:(0,c.Z)(V,1)[0]||"",field_building_type_name:Q||""},K=(0,s.useState)(W),J=(0,c.Z)(K,2),$=J[0],X=J[1],Y=(0,s.useState)({query:""}),ee=(0,c.Z)(Y,2),te=ee[0],ae=ee[1],ne=(0,s.useState)(""),ie=(0,c.Z)(ne,2),re=ie[0],le=ie[1],oe=(0,s.useState)(0),ce=(0,c.Z)(oe,2),se=ce[0],ue=ce[1],de=(0,s.useState)(null),fe=(0,c.Z)(de,2),pe=fe[0],me=fe[1],he=(0,s.useState)(!0),_e=(0,c.Z)(he,2),ve=_e[0],ge=_e[1],ye={hitsPerPage:"",query:"",field_product_category_name:"",field_project_type_name:"Commercial",field_region_tid:"",field_region_name:"",field_application_name:"",field_building_type_name:""},be=(0,s.useMemo)((function(){return window.location.search.length>1}),[$]),xe=function(e){ue(e)};(0,s.useEffect)((function(){ge(!1)}),[]);var Ze=(0,s.useMemo)((function(){return function(e,t){var a=(0,o.Z)({},t);return Object.keys(a).forEach((function(t){var n=null===e||void 0===e?void 0:e.find((function(e){return e.name.toLowerCase()===t.toLowerCase()}));n&&(a[t].options=function(e){return e.terms.map((function(e){return{label:e.label,value:e.value}}))}(n))})),a}(i,u)}),[i]),je=(0,p.wf)(),Se=(0,s.useState)(void 0),we=(0,c.Z)(Se,2),Ne=we[0],ke=we[1],Pe=function(){var e=arguments.length>1?arguments[1]:void 0;if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&0!==se)e&&ke(e),ue(0);else{var t=(0,Z.Z)($.query),a=(0,o.Z)({},$);"Residential"===a.field_project_type_name&&(a.field_application_name=""),"Commercial"===a.field_project_type_name&&(a.field_building_type_name="");var n=(0,f.gz)(a),r=['field_resource_type_name:-"Contractor Project"'],s=n?[].concat((0,l.Z)(n),[r]):[r];v.search(t,{filters:i,facets:["*"],facetFilters:s,page:se,hitsPerPage:(null===$||void 0===$?void 0:$.hitsPerPage)||9,attributesToRetrieve:["nid","title","field_image","url","field_resource_type_name"]}).then((function(t){me(t);var n=t.facets,i=a.field_project_type_name;
1u.topFilters.forEach((function(e){e.hidden=!1}));var r=document.querySelector(".section-cc-inspiration-cta-banner"),l=document.querySelector(".section-cc-inspiration-featured-split");if("Commercial"===i&&(r&&l&&(r.style.display="flex",l.style.display="none"),u.topFilters.forEach((function(e){"field_building_type_name"===e.name&&(e.hidden=!0)}))),"Residential"===i&&(r&&l&&(l.style.display="flex",r.style.display="none"),u.topFilters.forEach((function(e){"field_application_name"===e.name&&(e.hidden=!0)}))),n&&Object.keys(n).length){q(u.topFilters,n);var s=["Residential","Commercial"];u.topFilters.forEach((function(e){if("field_project_type_name"===e.name){var t={};null!==n&&void 0!==n&&n.field_project_type_name&&Object.entries(n.field_project_type_name).forEach((function(e){var a=(0,c.Z)(e,2),n=a[0],i=a[1];t[n]=i})),e.options=s.map((function(e){return{label:e,value:e,count:t[e]||0}}))}}))}var d,f=["United States","Canada"];if(u.topFilters.forEach((function(e){"field_region_name"===e.name&&(e.options=e.options.filter((function(e){return!f.includes(e.label)})))})),null===t||void 0===t||!t.hits.length){var p=Object.fromEntries(Object.entries(n).map((function(e){var t=(0,c.Z)(e,2),a=t[0],n=t[1];return[a,Object.fromEntries(Object.keys(n).map((function(e){return[e,0]})))]}))),m=q(u.topFilters,p);F(u.topFilters,m)}(H||le(),H=!0,e=e||Ne)&&(je((0,o.Z)((0,o.Z)({},e),{},{search_term:te.query,number_of_results:getNumberOfResultsString(null===t||void 0===t||null===(d=t.hits)||void 0===d?void 0:d.length),content_type:"article",element_location:e.element_location||"listing"})),ke(void 0))})).catch((function(e){console.error("Search error:",e),H=!0}))}};(0,s.useEffect)((function(){Pe()}),[$,te.query]),(0,s.useEffect)((function(){0!==se?ue(0):H&&Pe(),be&&!r&&H&&function(e){if(window){var t=new URLSearchParams(window.location.search),a=window.location,n=a.protocol,i=a.pathname,r=a.host;Object.keys(e).forEach((function(a){var n="object"===typeof e[a]?e[a].join(","):e[a];""!==n.trim()?t.set(I[a],n):t.delete(I[a])}));var l="".concat(n,"//").concat(r).concat(i,"?").concat(t.toString());window.history.pushState({},"",l)}}($),ve||L()}),[$]),(0,s.useEffect)(Pe,[se]);var Ce,De=(0,s.useMemo)((function(){return pe?{analyticData:{listingType:"inspiration_article",searchTerm:te.query},meta:{totalRows:pe.nbHits,pageSize:0===pe.nbHits?0:pe.hitsPerPage,totalPages:pe.nbPages,pageNumber:pe.page},changePage:xe,itemsPerPage:{settings:{name:"itemsPerPage",label:Drupal.t("Items per page"),hideLabel:!0,options:[{value:9,label:"9 ".concat(Drupal.t("results per page"))},{value:12,label:"12 ".concat(Drupal.t("results per page"))},{value:15,label:"15 ".concat(Drupal.t("results per page"))}],state:{itemsPerPage:null===$||void 0===$?void 0:$.hitsPerPage}},onChange:function(e){X((function(t){return(0,o.Z)((0,o.Z)({},t),{},{hitsPerPage:e.target.value})}))}}}:{}}),[pe,te]);if(!pe)return"";if(te.query&&(Ce=pe.hits.filter((function(e){return e.title===te.query}))),!pe)return(0,j.jsx)("div",{children:"Loading..."});var Te=0===pe.nbHits?"0":(0,h.Z)(pe.page,pe.hitsPerPage,pe.nbHits);if(!pe)return"";var Ee={itemsPerPage:0===pe.nbHits?0:pe.hitsPerPage,totalResults:pe.nbHits,bottomSort:!0},Oe=(te.query?Ce:pe.hits).map((function(e){var t,a,n=(0,A.Z)(e.field_image);return{nid:e.nid,title:e.title||(null===(t=e._highlightResult)||void 0===t||null===(a=t.field_job_title)||void 0===a?void 0:a.value)||"No Title",damImage:null===n||void 0===n?void 0:n.damImage,imagePath:null===n||void 0===n?void 0:n.imagePath,mediaAlt:null===n||void 0===n?void 0:n.altText,imageUrl:e.url,resourceType:e.field_resource_type_name}}));return(0,j.jsx)("div",{className:"inspiration-container",children:(0,j.jsxs)(D,{pagerData:De,queryState:te,setQueryState:ae,filtersConfig:Ze.topFilters,filtersState:$,setFiltersState:X,onSearch:Pe,queryPlaceHolder:re,clearAllCallback:function(){L(),X(ye),ae("")},extra:"container",children:[(0,j.jsx)("div",{className:"ct-inspiration-article-results",children:Ee&&(0,j.jsx)(T.Z,(0,o.Z)((0,o.Z)({},Ee),{},{pagedItems:Te,displaySwitcherState:b,setDisplaySwitcherState:function(e){x(e)}}))}),Oe&&Oe.length>0?(0,j.jsx)(R,{articles:Oe,displayType:b}):(0,j.jsx)("div",{className:"search-no-results",children:(0,j.jsx)("h4",{children:Drupal.t("There are no results for this query. Please refine your search.")})})]})})}},4084:function(e,t,a){a.d(t,{zu:function(){return l}});var n=a(4296),i=a.n(n),r=function(){var e,t=(null===(e=window.drupalSettings)||void 0===e?void 0:e.algolia)||{},a=atob(t.app_id),n=atob(t.api_key);return i()(a,n)},l=function(e){return r().initIndex(e)}},2285:function(e,t,a){var n=a(1413),i=a(4925),r=a(2791),l=a(9647),o=a(184),c=["children","block","mods","base","extra"],s=(0,r.forwardRef)((function(e,t){var a=e.children,r=e.block,s=e.mods,u=e.base,d=e.extra,f=(0,i.Z)(e,c);return(0,o.jsx)("button",(0,n.Z)((0,n.Z)({ref:t,className:(0,l.Z)(r||"btn",s||[],u||"",d||[])},f),{},{children:a}))}));t.Z=s},6903:function(e,t,a){var n=a(1413),i=a(5880),r=a(184);t.Z=function(e){var t=e.imagePath,a=e.altText,l=e.responsiveImageStyle,o=e.damImage,c=e.caption,s=e.credit,u=e.className,d=void 0===u?"":u,f=e.imageMaxHeight,p=e.setHeight,m=e.urlWebp,h=e.lazySrcAttr,_=void 0!==h&&h,v=e.width,g=e.height,y=c||"";if(y=s?"Images by <u>".concat(s,"</u> : ").concat(y):y,"default"===l){var b=("object"===typeof o?null===o||void 0===o?void 0:o.src:o)||t;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:_?"":"".concat(b,"?crop=yes&k=c&w=").concat(v,"&h=").concat(g,"&itok=DnHkkNQG"),"data-src":_?b:"",alt:a||"",style:{maxHeight:f?"".concat(f,"px"):"",height:p&&f?"".concat(f,"px"):""},loading:"lazy"}),(c||s)&&(0,r.jsx)("div",{className:"image--description image--credit",dangerouslySetInnerHTML:{__html:y}})]})}var x=(0,i.l5)(l,t,o,m);if(!x)return"";var Z=x.find((function(e){return"string"===typeof e})),j=x.map((function(e){return"object"===typeof e?(0,r.jsx)("source",(0,n.Z)({},e),e.srcSet):""})).reverse();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("picture",{className:d,children:[j,(0,r.jsx)("img",{src:_?"":Z,"data-src":_?Z:"",alt:a,style:{maxHeight:f?"".concat(f,"px"):"",height:p&&f?"".concat(f,"px"):""},loading:"lazy"})]}),(c||s)&&(0,r.jsx)("div",{className:"image--description image--credit",dangerouslySetInnerHTML:{__html:y}})]})}},2944:function(e,t,a){var n=a(3433),i=a(9439),r=a(2791),l=a(6407),o=a(9647),c=a(836),s=a(7523),u=a(184);t.Z=function(e){var t=e.analyticData,a=e.meta,d=e.changePage,f=e.itemsPerPage,p=void 0===f?null:f,m="pager",h=a||{},_=h.pageNumber,v=h.totalPages,g=(0,r.useState)([]),y=(0,i.Z)(g,2),b=y[0],x=y[1],Z=(0,s.wf)();if((0,r.useEffect)((function(){if("number"===typeof _){var e=(0,n.Z)(Array(v+1).keys());if(e.length>5){var t=0;_>1&&(t=_>v-2?v-4:_-2),e=e.slice(t,t+5)}x(e)}}),[_,v]),!a&&_<2||v<2)return"";var j=function(e,a){if(d(e,a),t){var n=t.searchTerm?t.searchTerm:null;Z({event:"pagination_selected",event_origin:"front_end",number_of_results:e+1,content_type:t.listingType,search_term:n})}};return(0,u.jsxs)("div",{className:"pager-wrapper",children:[(0,u.jsx)("nav",{className:(0,o.Z)(m),role:"navigation",children:(0,u.jsxs)("ul",{className:(0,o.Z)("items",[],m,["flex","justify-center"]),children:[_<1?"":(0,u.jsx)("li",{className:(0,o.Z)("item",["previous"],m),children:(0,u.jsxs)("button",{type:"button",className:"btn-icon",title:Drupal.t("Go to previous page"),onClick:function(e){return j(_-1,e)},children:[(0,u.jsx)("span",{className:"visually-hidden",children:Drupal.t("Previous page")}
1),(0,u.jsx)(l.Z,{iconName:"chevron-thin"})]})}),b.map((function(e){return e+1>v?"":function(e){var t="".concat(Drupal.t("Go to page")," ");return _===e&&(t=Drupal.t("Current page")),(0,u.jsx)("li",{className:(0,o.Z)("item",[],m,["".concat(_===e?"is-active":"")]),children:(0,u.jsxs)("button",{type:"button",className:"btn-clear",onClick:function(t){return j(e,t)},children:[(0,u.jsx)("span",{className:"visually-hidden",children:t}),e+1]})},e)}(e)})),_+1===v?"":(0,u.jsx)("li",{className:(0,o.Z)("item",["next"],m),children:(0,u.jsxs)("button",{type:"button",className:"btn-icon",title:Drupal.t("Go to next page"),onClick:function(e){return j(_+1,e)},children:[(0,u.jsx)("span",{className:"visually-hidden",children:Drupal.t("Next page")}),(0,u.jsx)(l.Z,{iconName:"chevron-thin"})]})})]})}),p?(0,u.jsx)(c.Z,{settings:p.settings,onChange:p.onChange}):""]})}},6104:function(e,t,a){a.d(t,{Z:function(){return g}});var n=a(4942),i=a(1413),r=a(9439),l=a(2791),o=a(7413),c=a(6407),s=a(9647),u=a(1444),d=a(184),f=function(e){var t=e.groupId,a=e.groupLegend,n=e.options,i=e.selected,o=e.onOptionSelect,f=e.mods,p=e.extra,m=(0,l.useState)(i),h=(0,r.Z)(m,2),_=h[0],v=h[1],g="a-toggle",y=n.map((function(e){var a=function(){return(0,d.jsxs)("span",{className:(0,s.Z)("option-content",[],g),children:[(0,d.jsx)("span",{className:(0,s.Z)("option-icon",[],g),children:e.icon&&(0,d.jsx)(c.Z,{className:(0,s.Z)("icon-svg",[],g),iconName:e.icon,width:24,height:24})}),(0,d.jsx)("span",{className:(0,s.Z)("option-shortname",[],g),children:e.shortName}),(0,d.jsx)("span",{className:(0,s.Z)("option-name",[],g),children:e.name})]})};return(0,d.jsx)(u.Z,{type:"radio",name:t,onChange:function(){return t=e.value,o(t),void v(t);var t},children:(0,d.jsx)(a,{}),extraInput:["visually-hidden"],extraLabel:[(0,s.Z)("label",[],g),_===e.value?"is--active":""]},e.value)}));return(0,d.jsxs)("fieldset",{className:(0,s.Z)(g,f,"",p),children:[(0,d.jsx)("legend",{className:"visually-hidden",children:a}),y]})},p=function(e){var t=e.displaySwitcherState,a=e.setDisplaySwitcherState,n=e.displaySwitcherView,r=e.toggleData,l=e.mobileHidden,o=void 0===l||l;return t&&a?(0,d.jsx)("div",{className:(0,s.Z)("display-switcher",[],"",[o?"hidden":""]),children:"toggle"===n?(0,d.jsx)(f,(0,i.Z)((0,i.Z)({},r),{},{onOptionSelect:function(e){return a(e)}})):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{className:"btn-icon ".concat("list"===t?"active":""),onClick:function(){return a("list")},children:[(0,d.jsx)("span",{className:"visually-hidden",children:Drupal.t("List view")}),(0,d.jsx)(c.Z,{iconName:"list-view"})]}),(0,d.jsxs)("button",{className:"btn-icon ".concat("grid"===t?"active":""),onClick:function(){return a("grid")},children:[(0,d.jsx)("span",{className:"visually-hidden",children:Drupal.t("Grid view")}),(0,d.jsx)(c.Z,{iconName:"grid-view"})]})]})}):""},m=function(e){var t,a=e.sortByState,n=e.sortByOptions,i=void 0===n?[]:n,o=e.setSortByState,u=e.showSelected,f=void 0!==u&&u,p=e.analyticPushEvent,m=(0,l.useRef)(null),h=(0,l.useState)(!1),_=(0,r.Z)(h,2),v=_[0],g=_[1],y=function(e){m.current&&!m.current.contains(e.target)&&g(!1)};if((0,l.useEffect)((function(){return document.addEventListener("click",y),function(){document.removeEventListener("click",y)}}),[m]),!a||!o||!i.length)return"";var b="sort-by";return(0,d.jsxs)("div",{className:(0,s.Z)(b,[],"",["relative"]),ref:m,children:[(0,d.jsxs)("button",{className:(0,s.Z)("switcher",[],b,["flex","btn-icon","items-center"]),onClick:function(){return g(!v)},children:[Drupal.t("Sort by"),f&&": ".concat((null===(t=i.find((function(e){return e.value===a})))||void 0===t?void 0:t.label)||Drupal.t("Default")),(0,d.jsx)(c.Z,{iconName:"
1chevron-thin"})]}),v&&(0,d.jsx)("ul",{className:(0,s.Z)("options",[],b,["flex","flex-col"]),role:"list",children:i.map((function(e){return(0,d.jsx)("li",{"aria-labelledby":"Sort by ".concat(e.label),className:(0,s.Z)("option",[],b,[a===e.value?"active":""]),onClick:function(){o(e.value),g(!1),null===p||void 0===p||p(e)},onKeyDown:function(t){("Enter"===t.key&&13===t.keyCode||" "===t.key&&32===t.keyCode)&&(t.preventDefault(),o(e.value),g(!1),null===p||void 0===p||p(e))},role:"button",tabIndex:0,children:e.label},"sort-option-".concat(e.value))}))})]})},h=a(7523),_=a(485),v=a(3623),g=function(e){var t=e.pagedItems,a=e.itemsPerPage,u=e.totalResults,f=e.displaySwitcherState,g=e.setDisplaySwitcherState,y=e.sortByState,b=e.sortByOptions,x=e.setSortByState,Z=e.setFiltersActive,j=e.filtersState,S=e.setFiltersState,w=e.showingResultsCountText,N=e.showResults,k=void 0===N||N,P=e.bottomSort,C=void 0!==P&&P,D=e.showSelectedSort,T=void 0!==D&&D,E=e.displaySwitcherView,O=e.toggleData,R=e.displaySwitcherMobileHidden,q=e.showAppliedFilters,F=void 0===q||q,A=e.showFiltersText,H=e.showFiltersAnalytic,I=e.analyticsData,L=void 0===I?{}:I,B="listing-meta",M=(0,l.useState)(0),z=(0,r.Z)(M,2),U=z[0],G=z[1],Q=(0,h.z$)().pushEventWithGlobalData,V=(0,o.Z)().width;(0,l.useEffect)((function(){if(j){var e=0;Object.values(j).forEach((function(t){Array.isArray(t)&&t.length&&(e+=t.length)})),G(e)}}),[j]);var W=window.drupalSettings.algoliaSearch.facet.facetKey;return(0,d.jsxs)("div",{className:(0,s.Z)(B,[C&&"bottom-sort",E],"",["flex","justify-between"]),children:[!f&&!y&&V&&j<480?(0,d.jsxs)("button",{className:"".concat(B,"__filters-button btn btn--secondary ml-auto"),onClick:function(){Z(!0),"function"===typeof H&&H()},children:[Drupal.t("SHOW FILTERS")," ",U&&F?"(".concat(U,")"):""]}):"",k?(0,d.jsxs)("div",{className:(0,s.Z)("results-meta",[],B),children:[(0,d.jsxs)("b",{children:[w||Drupal.t("Results"),":"]})," ","".concat(t||a||0," of ").concat(u||0)]}):"",(0,d.jsxs)("div",{className:(0,s.Z)("controls",[],B,["flex","items-center"]),children:[y&&(0,d.jsx)(m,{sortByState:y,setSortByState:x,sortByOptions:b,showSelected:T,analyticPushEvent:function(e){Q((0,_.IT)(e.label,u))}}),f&&(0,d.jsx)(p,{displaySwitcherState:f,setDisplaySwitcherState:g,displaySwitcherView:E,toggleData:O,mobileHidden:R}),"function"===typeof Z&&j&&(0,d.jsxs)("button",{className:"".concat(B,"__filters-button btn btn--m btn--secondary"),onClick:function(){Z(!0),"function"===typeof H&&H()},children:[Drupal.t(A||"SHOW FILTERS")," ",U&&F?"(".concat(U,")"):""]})]}),F&&(U?(0,d.jsx)("div",{className:(0,s.Z)("applied-filters",[],B,["hidden","flex-wrap"]),children:Object.entries(j).map((function(e){var t=(0,r.Z)(e,2),a=t[0],l=t[1];return Array.isArray(l)&&W.indexOf(a)>-1?l.map((function(e){return(0,d.jsxs)("div",{className:(0,s.Z)("filter-tag",[],B),children:[e,(0,d.jsxs)("button",{className:"btn-icon",onClick:function(){return function(e,t){S((function(a){return(0,i.Z)((0,i.Z)({},a),{},(0,n.Z)({},t,a["".concat(t)].filter((function(t){return e!==t}))))})),(null===L||void 0===L?void 0:L.event)===v.Vl&&L.trackFilterChange(t,e,!1,L.totalCount)}(e,a)},children:[(0,d.jsx)("span",{className:"visually-hidden",children:Drupal.t("Remove")}
1),(0,d.jsx)(c.Z,{iconName:"close-thin"})]})]},"filter-".concat(a,"-").concat(e))})):""}))}):"")]})}},8112:function(e,t,a){var n=a(9439),i=a(2791);t.Z=function(e,t){var a=(0,i.useState)(e),r=(0,n.Z)(a,2),l=r[0],o=r[1];return(0,i.useEffect)((function(){var a=setTimeout((function(){o(e)}),t);return function(){clearTimeout(a)}}),[e,t]),l}},5259:function(e,t,a){var n=a(9439),i=a(2791),r=function(){return"undefined"!==typeof window?new URLSearchParams(window.location.search):new URLSearchParams};t.Z=function(e,t){var a=(0,i.useState)(function(e){return r().get(e)}(e)||t),l=(0,n.Z)(a,2),o=l[0],c=l[1];return[o,function(t){c(t);var a=r();if(""!==t.trim()?a.set(e,t):a.delete(e),"undefined"!==typeof window){var n=window.location,i=n.protocol,l=n.pathname,o=n.host,s="".concat(i,"//").concat(o).concat(l,"?").concat(a.toString());window.history.pushState({},"",s)}}]}},7571:function(e,t,a){a.d(t,{UT:function(){return c},gz:function(){return o},zC:function(){return s}});var n=a(3433),i=a(9439),r=function(e,t){return"".concat(t,":").concat(e)},l=function(e,t){if(!e)return"";if("string"===typeof e&&e.includes(" OR ")){var a=e.split(" OR ").map((function(e){return Number.isNaN(Number(e))?"".concat(t,':"').concat(e,'"'):"".concat(t,"=").concat(e)})).join(" OR ");return"(".concat(a,")")}return Number.isNaN(Number(e))?"".concat(t,':"').concat(e,'"'):"".concat(t,"=").concat(e)},o=function(e){var t=[],a=window.drupalSettings.algoliaSearch.facet.facetKey;return Object.entries(e).forEach((function(e){var n,l,o=(0,i.Z)(e,2),c=o[0],s=o[1],u="";a.indexOf(c)>-1&&(s&&(Array.isArray(s)&&(n=c,u=(l=s).length&&n?l.map((function(e){return r(e,n)})):null),"string"===typeof s&&(u=r(s,c))),u&&t.push(u))})),t},c=function(e){if(!e.length)return null;var t="";return e.forEach((function(e){t+=e&&t?" AND ".concat(e):e})),t},s=function(e){var t=[];return Object.entries(e).forEach((function(e){var a=(0,i.Z)(e,2),r=a[0],o=a[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})),t=[].concat((0,n.Z)(t),[l(c,r)])):(o.forEach((function(e){c+=c?" OR ".concat(e):e})),t=[].concat((0,n.Z)(t),[l(c,r)]))}else t=[].concat((0,n.Z)(t),[l(o,r)])})),c(t)}},1865:function(e,t){t.Z=function(e,t,a){var n=e+1,i=a<=n*t&&a>=0?a:n*t;return Math.min(i,a)}},5880:function(e,t,a){a.d(t,{u2:function(){return m},vP:function(){return d},l5:function(){return _}});var n=a(9439),i={article_card:{default:{article_card_tablet:"389x291"},mobile:{x1:{article_card_mobile:"720x540"}},tablet:{x1:{article_card_tablet:"389x291"}}},article_inspiration_small:{default:{article_inspiration_small_desktop:"360x239"},mobile:{x1:{article_inspiration_small_mobile:"720x479"}},tablet:{x1:{article_inspiration_small_tablet:"423x282"}},desktop:{x1:{article_inspiration_small_desktop:"360x239"}}},inspiration_card:{default:{article_inspiration_small_desktop:"427x237"},mobile:{x1:{article_inspiration_small_mobile:"360x192"}},desktop:{x1:{article_inspiration_small_desktop:"427x237"}}},article_inspiration_big:{default:{article_inspiration_big_desktop:"755x506"},mobile:{x1:{article_inspiration_small_mobile:"720x479"}},tablet:{x1:{article_inspiration_big_tablet:"727x581"}},desktop:{x1:{article_inspiration_big_desktop:"755x506"}}},search_card:{default:{search_card_tablet:"208x156"},mobile:{x1:{search_card_mobile:"720x479"}},tablet:{x1:{search_card_tablet:"208x156"}}},gallery:{default:{gallery_desktop:"1200x800"},mobile:{x1:{gallery_react_mobile:"960x640"}},mobile_small:{x1:{gallery_react_mobile_small:"480x320"}},tablet:{x1:{gallery_react_tablet:"1200x800"}},desktop:{x1:{gallery_react_mobile:"960x640"}}},gallery_thumbs:{default:{gallery_thumbnail_tablet_x2:"342x258"},tablet:{x1:{gallery_thumbnail_tablet:"171x129"}},desktop:{x1:{gallery_thumbnail_desktop:"132x92"}}},gallery_modal:{default:{gallery_modal_desktop:"x"},mobile:{x1:{gallery_modal_mobile:"x"}},smallMobile:{x1:{gallery_modal_mobile_small:"x"}},tablet:{x1:{gallery_modal_tablet:"x"}},desktop:{x1:{gallery_modal_desktop:"x"}}},gallery_modal_thumbnail:{default:{gallery_modal_thumbnail_desktop:"294x221"},mobile:{x1:{gallery_modal_thumbnail_mobile:"128x137"}},smallMobile:{x1:{gallery_modal_thumbnail_mobile_small:"86x65"}},tablet:{x1:{gallery_modal_thumbnail_tablet:"240x180"}},desktop:{x1:{gallery_modal_thumbnail_desktop:"294x221"}}},product_document_card:{default:{search_card_tablet:"120x120"},mobile:{x1:{search_card_mobile:"67x67"}},tablet:{x1:{search_card_tablet:"112x112"}},desktop:{x1:{gallery_modal_thumbnail_desktop:"120x120"}}},contractor_card:{default:{contractor_card_tablet:"163x163"},mobile:{x1:{contractor_card_mobile:"72x72"}},tablet:{x1:{contractor_card_tablet:"163x163"}}},chip_thumbnail:{default:{chip_thumbnail:"200x200"},mobile:{x1:{chip_thumbnail:"200x200"}}},chip_media:{default:{chip_media:"754x754"},mobile:{x1:{chip_media_mobile:"480x480"}},tablet:{x1:{chip_media:"754x754"}}},cover_flow_portrait:{default:{cover_flow_portrait_desktop:"510x786"},mobile:{x1:{cover_flow_portrait_mobile:"768x768"}},tablet:{x1:{cover_flow_portrait_tablet:"339x510"}},desktop:{x1:{cover_flow_portrait_desktop:"510x786"}}},cover_flow_landscape:{default:{cover_flow_landscape_desktop:"1440x810"},mobile:{x1:{cover_flow_landscape_mobile:"768x432"}},tablet:{x1:{cover_flow_landscape_tablet:"1280x720"}},desktop:{x1:{cover_flow_landscape_desktop:"1440x810"}}}},r=a(7745),l=function(e){if("string"!==typeof e||!e)return!1;try{return new URL(e),!0}catch(t){return!1}},o={smallMobile:"all and (max-width: 30em)",mobile:"all and (max-width: 59.999em)",tablet:"all and (min-width: 60em)",desktop:"all and (min-width: 80em)"},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object.keys(e)["".concat(t)]},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object.values(e)["".concat(t)]},u=function(e){return l(e)&&!(0,r.Z)(e)},d=function(e,t){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]){var a=e.split("x"),i=(0,n.Z)(a,2),r=i[0],l=i[1],o=r>=l?r:l;if(o>2048){var c=o/2048;r=Math.round(r/c),l=Math.round(l/c)}return"".concat(t,"?crop=yes&k=c&w=").concat(r,"&h=").concat(l,"&itok=DnHkkNQG")}return u(t)?t:"/sites/default/files/styles/".concat(e,"/public/").concat(t)},f=function(e){return"https://source.unsplash.com/random/".concat(e,"/?tech")},p=function(e){if(!e)return"";if(u(e))return e;var t=e.split("/");if(t.length<1)return"";var a=t.length-2;return t[4]&&"youtube_thumbnails"===t[4]&&(a-=1),"".concat(t.slice(Math.max(a,1)).join("/"),"?itok=38iJz1Pa")},m=function(e){if(!e)return"";var t=new URL(e);return"".concat(t.origin).concat(t.pathname)},h=function(e,t,a,r,l){var c=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];
1return Object.entries(i["".concat(e)]).map((function(e){var i=(0,n.Z)(e,2),s=i[0],u=i[1];if(o["".concat(s)]){var d=u.x1,f=u.x2,p=t(a(d),r,l);if(f){var m=t(a(f),r,l);p="".concat(p," 1x, ").concat(m," 2x")}return{srcSet:p,media:o["".concat(s)]}}return c&&"default"===s?t(a(u),r,l):""}))},_=function(e,t,a,n){if(!e||!Object.prototype.hasOwnProperty.call(i,e)||!window.isStoryBook&&!t&&!a)return!1;var r=!t&&a,l=window.isStoryBook||r?s:c,o=window.isStoryBook?f:d,u=r?m(a):p(t),_=h(e,o,l,u,r);return n&&(u=r?m(n):p(n),_=_.concat(h(e,o,l,u,r,!1))),_}},7745:function(e,t){var a=/(^|\.)widen(cdn)?\.net$/i;t.Z=function(e){if("string"!==typeof e||!e)return!1;var t,n;try{var i=new URL(e);t=i.hostname,n=i.protocol}catch(r){return!1}return("http:"===n||"https:"===n)&&a.test(t)}},1335:function(e,t){t.Z=function(e){if(!e)return{};try{var t=JSON.parse(e);return{imagePath:t.url,altText:t.alt,damImage:t.external_url,id:t.media_id}}catch(a){return{}}}},7240:function(e,t){t.Z=function(e){if(!e)return"";var t=new RegExp(/\.|,|'|\+|-/,"gi");return e.replace(t," ")}},6922:function(e,t){t.Z=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"smooth";setTimeout((function(){t.scrollTo({top:e,behavior:a})}),arguments.length>0&&void 0!==arguments[0]?arguments[0]:100)}},8924:function(e,t,a){var n=a(4678);t.Z=function(e,t){return(0,n.Z)(e,t)}}}]); 2//# sourceMappingURL=9482.8c27927f.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.