var matchHeight={match:function(elements){var maxHeight=Math.max(...elements.map((e=>(e.style.height="auto",Math.ceil(e.clientHeight)+1))));elements.forEach((e=>{e.style.height=maxHeight+"px"}))},getOffsetTop:function(element){return Math.floor(element.getBoundingClientRect().top)},matchByRow:function(groups,rowThreshold=1){groups.forEach((elements=>elements.forEach((e=>{e.style.overflow&&e.setAttribute("data-orig-overflow",e.style.overflow),e.style.height="100px",e.style.overflow="hidden"}))));var newGroups=[];groups.forEach((elements=>{if(0!=elements.length){for(var currentGroup=[elements[0]],currentTop=this.getOffsetTop(elements[0]),i=1;i<elements.length;i++){var e=elements[i],top=this.getOffsetTop(e);currentTop-rowThreshold<top&&top<currentTop+rowThreshold?currentGroup.push(e):(newGroups.push(currentGroup),currentGroup=[e],currentTop=top)}currentGroup.length&&newGroups.push(currentGroup)}})),groups.forEach((elements=>elements.forEach((e=>{e.hasAttribute("data-orig-overflow")?(e.style.overflow=e.getAttribute("data-orig-overflow"),e.style.removeProperty("data-orig-overflow")):e.style.removeProperty("overflow")})))),newGroups.forEach((group=>{1==group.length&&(group[0].style.height="auto"),group.length>1&&this.match(group)}))},matchGroup:function(groupElements,byRow=!0,rowThreshold=1){var map={};groupElements.forEach((groupElement=>groupElement.querySelectorAll("[data-pwr-mh]").forEach((e=>{var key=e.getAttribute("data-pwr-mh");key in map?map[key].push(e):map[key]=[e]}))));var groups=Object.values(map);byRow?this.matchByRow(groups,rowThreshold):groups.forEach((elements=>elements.length>1&&this.match(elements)))},matchAll:function(){document.querySelectorAll(".pwr-mh-group-byRow").forEach((group=>{const dataRowThreshold=group.getAttribute("data-pwr-mh-group-byRow-threshold");matchHeight.matchGroup([group],!0,dataRowThreshold?parseInt(dataRowThreshold):1)})),document.querySelectorAll(".pwr-mh-group").forEach((group=>matchHeight.matchGroup([group],!1))),setTimeout((()=>pwr.aos.refresh()),50)},resetHeight:function(elements){elements.forEach((element=>element.querySelectorAll("[data-pwr-mh]").forEach((e=>{e.style.height="auto"}))))},init:function(){window.addEventListener("resize",this.matchAll),this.matchAll()}};document.addEventListener("DOMContentLoaded",(function(){matchHeight.init()})),window.addEventListener("update-heights",matchHeight.matchAll());
//# sourceURL=https://20010397.fs1.hubspotusercontent-na1.net/hubfs/20010397/hub_generated/template_assets/1/127225232194/1741697541106/template_pwr-match-height.js