var Underliner=function(){function Underliner(selector,color1,thickness1,strokeLinecap,rtl){this.els=document.querySelectorAll(selector),this.fill="transparent",this.color1=color1,this.thickness1=thickness1,this.strokeLinecap=strokeLinecap,this.rtl=rtl,this.className="mh-underliner",this.init()}var _proto=Underliner.prototype;return _proto.init=function(){var self=this;self.els.forEach((function(el){var squiggly="squiggly"==el.closest("[data-mh-underliner]").getAttribute("data-mh-underliner-type"),elWidth=parseInt(el.offsetWidth),svg=self.createSVG(elWidth,squiggly);el.classList.add(self.className),el.appendChild(svg)}))},_proto.setPath=function(pathD,color,thickness,strokeLinecap){var path=document.createElementNS("http://www.w3.org/2000/svg","path");return path.setAttribute("d",pathD),path.setAttribute("fill",this.fill),path.setAttribute("stroke",color),path.setAttribute("stroke-width",thickness),path.setAttribute("stroke-linecap",strokeLinecap),path.setAttribute("stroke-dasharray",path.getTotalLength()+10),path.setAttribute("stroke-dashoffset",path.getTotalLength()+10),path},_proto.randomizePath=function(elWidth){var curveXMax=elWidth,curveYMax=.12*elWidth;return"M5 "+(Math.floor(7*Math.random())+5)+" Q "+(Math.floor(Math.random()*(curveXMax-15))+15)+" "+(Math.floor(Math.random()*(curveYMax-7))+7)+" "+(elWidth-7)+" "+(Math.floor(6*Math.random())+5)},_proto.createSVG=function(elWidth,lineType){var svg=document.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttribute("width",elWidth),lineType?svg.setAttribute("viewBox","0 0 264 86.7"):svg.setAttribute("height","35"),svg.setAttribute("class",this.className+"__underline");document.createElementNS("http://www.w3.org/2000/svg","path");var pathD=lineType?"M5,26.8a1141.56,1141.56,0,0,0,129.8-10C202.2,7.4,259,5,259,5s-63,15-91.1,26.2-45.6,17.5-43.1,19.3,47.3-9.9,71.4-12.3c27.1-2.6,44.7,1.9,44.7,1.9L162.7,81.7":this.randomizePath(elWidth);return!0===this.rtl&&(pathD=this.reverseMe(pathD)),svg.appendChild(this.setPath(pathD,this.color1,this.thickness1,this.strokeLinecap)),svg.setAttribute("focusable",!1),svg},_proto.reverseMe=function(path){var pathOperators=path.replace(/[\d,\-\s]+/g,"").split(""),pathNums=path.replace(/[A-Za-z,]+/g," ").trim().replace(/\s\s+/g," ").split(" ");return pathOperators[0]+" "+pathNums[4]+" "+pathNums[5]+" "+pathOperators[1]+" "+pathNums[2]+" "+pathNums[3]+" "+pathNums[0]+" "+pathNums[1]},_proto.insertAfter=function(el,referenceNode){referenceNode.parentNode.insertBefore(el,referenceNode.nextSibling)},Underliner}(),singleUnderline=new Underliner("[data-mh-underliner] .mh-heading__effect","var(--mh-hand-drawn-color)",7,"round",!1);
//# sourceURL=https://cdn2.hubspot.net/hub/9360592/hub_generated/template_assets/46702316938/1654906562395/barnes/js/mh-underliner.js