"use strict";!function(e,t){if("object"==typeof module&&"object"==typeof module.exports){if(!e.document)throw new Error("HC Off-canvas Nav requires a browser to run.");module.exports=t(e)}else"function"==typeof define&&define.amd?define("hcOffcanvasNav",[],t(e)):t(e)}("undefined"!=typeof window?window:this,function(e){function t(n,a){function l(e){if(d.length){for(var t=!1,n=(e="string"==typeof e?[e]:e).length,a=0;a<n;a++)-1!==d.indexOf(e[a])&&(t=!0);return t}}function c(t){function n(){var e=Number(this.dataset.level),t=Number(this.dataset.index);("true"===this.getAttribute("checked")?y:E)(e,t)}function a(e){e.classList.remove(C),e.setAttribute("aria-expanded",!1)}function c(){return!1!==u.levelOpen&&"none"!==u.levelOpen}function p(){return _}function f(){return X.length?Number(Array.prototype.filter.call(k.querySelectorAll(".hc-chk"),function(e){return e.value==X[X.length-1]})[0].dataset.level):0}function h(){return X.length?Number(Array.prototype.filter.call(k.querySelectorAll(".hc-chk"),function(e){return e.value==X[X.length-1]})[0].dataset.index):0}function m(t,n){var s,l;if((!_||void 0!==n)&&(_||(_=!0,O.style.visibility="visible",O.setAttribute("aria-hidden",!1),O.classList.add(o),S&&(S.forEach(a),M&&(M.classList.add(C),M.setAttribute("aria-expanded",!0))),"expand"===u.levelOpen&&z&&clearTimeout(z),u.disableBody&&(H=e.pageYOffset||i.scrollTop||r.documentElement.scrollTop||r.body.scrollTop,r.documentElement.scrollHeight>r.documentElement.clientHeight&&i.classList.add("hc-nav-yscroll"),r.body.classList.add("hc-nav-open"),H&&(r.body.style.top=-H+"px")),j&&(s="x"===v.getAxis(u.position)?D:U,v.setTransform(j,s,u.position)),B?B=!1:(O._eventListeners.toggle&&O._eventListeners.toggle.forEach(function(e){e.fn(v.customEventObject("toggle",O,O,{action:"open"}),Object.assign({},u))}),setTimeout(function(){O._eventListeners.open&&O._eventListeners.open.forEach(function(e){e.fn(v.customEventObject("open",O,O),Object.assign({},u))})},T))),c())){if("number"!=typeof t&&!v.isNumeric(t)||"number"!=typeof n&&!v.isNumeric(n))q?(l=Array.prototype.filter.call(k.querySelectorAll(".hc-chk"),function(e){return e.value==q})[0],!u.closeActiveLevel&&u.closeOpenLevels||(q=null)):!1===u.closeOpenLevels&&(l=(l=Array.prototype.filter.call(k.querySelectorAll(".hc-chk"),function(e){return"true"===e.getAttribute("checked")}))[l.length-1]);else if(!(l=r.querySelector("#"+L+"-"+t+"-"+n)))return void console.warn("HC Offcanvas Nav: level "+t+" doesn't have index "+n);if(l){var d=[];if(t=Number(l.dataset.level),n=Number(l.dataset.index),1<t){for(var p=[];l&&l!==r;l=l.parentNode)l.matches(".nav-wrapper")&&p.push(l);for(var f=0;f<p.length;f++){var h=p[f],m=Number(h.dataset.level);0<m&&d.push({level:m,index:Number(h.dataset.index)})}d=d.reverse()}d.push({level:t,index:n});for(var b=0;b<d.length;b++)y(d[b].level,d[b].index,!1)}}}function b(){var e;_&&(_=!1,j&&v.setTransform(j,!1),O.classList.remove(o),O.classList.remove("user-is-tabbing"),O.setAttribute("aria-hidden",!0),k.removeAttribute("style"),S&&S.forEach(a),"expand"===u.levelOpen&&-1!==["top","bottom"].indexOf(u.position)?E(0):c()&&(z=setTimeout(function(){E(0)},"expand"===u.levelOpen?T:0)),u.disableBody&&(r.body.classList.remove("hc-nav-open"),i.classList.remove("hc-nav-yscroll"),H&&(r.body.style.top="",r.body.scrollTop=H,i.scrollTop=H,"bottom"===u.position&&(e=H,setTimeout(function(){r.body.scrollTop=e,i.scrollTop=e},0)),H=0)),O._eventListeners.toggle&&O._eventListeners.toggle.forEach(function(e){e.fn(v.customEventObject("toggle",O,O,{action:"close"}),Object.assign({},u))}),setTimeout(function(){O.style.visibility="",O._eventListeners.close&&O._eventListeners.close.forEach(function(e){e.fn(v.customEventObject("close",O,O),Object.assign({},u))}),O._eventListeners["close.once"]&&O._eventListeners["close.once"].forEach(function(e){e.fn(v.customEventObject("close.once",O,O),Object.assign({},u))}),O.removeEventListener("close.once")},T))}function g(e){return function(t){t&&(t.preventDefault(),t.stopPropagation()),e&&(M=e),(_?b:m)()}}function y(e,t,n){void 0===n&&(n=!0);var a=r.querySelector("#"+L+"-"+e+"-"+t),i=a.value,s=a.parentNode,o=s.closest(".nav-wrapper"),l=v.children(s,".nav-wrapper")[0];!1===n&&(l.style.transition="none"),a.setAttribute("checked",!0),o.classList.add("sub-level-open"),s.classList.add("level-open"),s.querySelectorAll("[aria-controls]")[0].setAttribute("aria-expanded",!0),!1===n&&setTimeout(function(){l.style.transition=""},T),-1===X.indexOf(i)&&X.push(i),"overlap"===u.levelOpen&&(o.addEventListener("click",function(){return E(e,t)}),v.setTransform(k,e*u.levelSpacing,u.position),j&&(o="x"===v.getAxis(u.position)?D:U,v.setTransform(j,o+e*u.levelSpacing,u.position))),O._eventListeners["open.level"]&&O._eventListeners["open.level"].forEach(function(n){n.fn(v.customEventObject("open.level",O,l,{currentLevel:e,currentIndex:t}),Object.assign({},u))}),Q&&(K(0,e,t),Q=!1)}function E(e,t){for(var n,a=e;a<=Object.keys(I).length;a++)if(a===e&&void 0!==t)le(e,t,!0);else if(0!==e||u.closeOpenLevels)for(var i=0;i<I[a];i++)le(a,i,a===e);0<e&&O._eventListeners["close.level"]&&(n=r.querySelector("#"+L+"-"+e+"-"+t).closest(".nav-wrapper"),O._eventListeners["close.level"].forEach(function(t){t.fn(v.customEventObject("close.level",O,n,{currentLevel:e-1,currentIndex:h()}),Object.assign({},u))})),Q&&(K(null,e-1),Q=!1)}if(t.querySelector("ul")||"UL"===t.tagName){var L="hc-nav-"+ ++s,A=v.printStyle("hc-offcanvas-"+s+"-style"),x="keydown.hcOffcanvasNav",C=u.activeToggleClass||"toggle-open",O=v.createElement("nav",{id:L}),k=v.createElement("div",{class:"nav-container"});O.addEventListener("click",v.stopPropagation),O.appendChild(k);var N,T,w,S=null,M=null,j=null,P={},_=!1,B=!1,q=null,H=0,D=0,U=0,z=null,I={},X=[],Q=!1,V=[],W=null,F=null,Y=!1,G=!1;u.customToggle?S=v.getElements(u.customToggle):(S=[v.createElement("a",{href:"#"},v.createElement("span"))],t.insertAdjacentElement("afterend",S[0])),S&&S.length&&S.forEach(function(e){e.addEventListener("click",g(e)),e.setAttribute("role","button"),e.setAttribute("aria-label",(u.ariaLabels||{}).open),e.setAttribute("aria-controls",L),e.setAttribute("aria-expanded",!1),e.addEventListener("keydown",function(e){"Enter"!==e.key&&13!==e.keyCode||setTimeout(function(){K(0,0)},0)})});var K=function(e,t,n){var a,i,s;"number"!=typeof t||"number"!=typeof e&&!V.length||(s=Array.prototype.filter.call(k.querySelectorAll(".nav-wrapper"),function(e){return e.getAttribute("data-level")==t&&("number"!=typeof n||"number"==typeof n&&e.getAttribute("data-index")==n)})[0],s=v.children(s,".nav-content")[0],s=v.children(s,"ul"),s=v.children(s,"li"),s=v.children(s,":not(.nav-wrapper)"),s=Array.prototype.map.call(s,function(e){return Array.prototype.slice.call(e.querySelectorAll('[tabindex="0"], a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select'))}).flat(),(s=Array.prototype.filter.call(s,function(e){return"-1"!==e.getAttribute("tabindex")}))&&(O.classList.add("user-is-tabbing"),a=s[0],i=s[s.length-1],"number"==typeof e?s[e].focus():(V[V.length-1].focus(),V.pop()),r.removeEventListener(x),r.addEventListener(x,function(e){"Tab"!==e.key&&9!==e.keyCode||(e.shiftKey?r.activeElement===a&&(e.preventDefault(),i.focus()):r.activeElement===i&&(e.preventDefault(),a.focus()))})))},$=function(){r.removeEventListener(x),M&&setTimeout(function(){M.focus()},T)},J=function(){k.style.transition="none",O.style.display="block";var t=v.formatSizeVal(D=k.offsetWidth),n=v.formatSizeVal(U=k.offsetHeight);A.add(".hc-offcanvas-nav."+L+".nav-position-left .nav-container","transform: translate3d(-"+t+", 0, 0)"),A.add(".hc-offcanvas-nav."+L+".nav-position-right .nav-container","transform: translate3d("+t+", 0, 0)"),A.add(".hc-offcanvas-nav."+L+".nav-position-top .nav-container","transform: translate3d(0, -"+n+", 0)"),A.add(".hc-offcanvas-nav."+L+".nav-position-bottom .nav-container","transform: translate3d(0, "+n+", 0)"),A.insert(),O.style.display="",k.style.transition="",N=e.getComputedStyle(k).transitionProperty,T=v.toMs(e.getComputedStyle(k).transitionDuration),w=e.getComputedStyle(k).transitionTimingFunction,u.pushContent&&j&&N&&A.add(v.getElementCssTag(j),"transition: "+N+" "+T+"ms "+w),A.insert()},R=function(t){var n=!!S&&e.getComputedStyle(S[0]).display,a=!!u.disableAt&&"max-width: "+(u.disableAt-1)+"px",i=v.formatSizeVal(u.width),s=v.formatSizeVal(u.height),c=v.formatSizeVal(u.levelSpacing);!v.isNumeric(i)&&-1===i.indexOf("px")||(D=parseInt(i)),!v.isNumeric(s)&&-1===s.indexOf("px")||(U=parseInt(s)),l(["disableAt","position"])&&A.reset(),A.add(".hc-offcanvas-nav."+L,"display: block",a),A.add(".hc-nav-original."+L,"display: none",a),n&&A.add(".hc-nav-trigger."+L,"display: "+(n&&"none"!==n?n:"block"),a),-1!==["left","right"].indexOf(u.position)?A.add(".hc-offcanvas-nav."+L+" .nav-container","width: "+i):A.add(".hc-offcanvas-nav."+L+" .nav-container","height: "+s),A.add(".hc-offcanvas-nav."+L+".nav-position-left .nav-container","transform: translate3d(-"+i+", 0, 0);"),A.add(".hc-offcanvas-nav."+L+".nav-position-right .nav-container","transform: translate3d("+i+", 0, 0);"),A.add(".hc-offcanvas-nav."+L+".nav-position-top .nav-container","transform: translate3d(0, -"+s+", 0);"),A.add(".hc-offcanvas-nav."+L+".nav-position-bottom .nav-container","transform: translate3d(0, "+s+", 0);"),A.add(".hc-offcanvas-nav."+L+".nav-levels-overlap.nav-position-left li.level-open > .nav-wrapper","transform: translate3d(-"+c+", 0, 0)",a),A.add(".hc-offcanvas-nav."+L+".nav-levels-overlap.nav-position-right li.level-open > .nav-wrapper","transform: translate3d("+c+", 0, 0)",a),A.add(".hc-offcanvas-nav."+L+".nav-levels-overlap.nav-position-top li.level-open > .nav-wrapper","transform: translate3d(0, -"+c+", 0)",a),A.add(".hc-offcanvas-nav."+L+".nav-levels-overlap.nav-position-bottom li.level-open > .nav-wrapper","transform: translate3d(0, "+c+", 0)",a),A.insert(),t&&!l("pushContent")||(j=u.pushContent?v.getElements(u.pushContent)[0]:null),k.style.transition="none",a=O.classList.contains(o),a=["hc-offcanvas-nav",u.navClass||"",L,"nav-levels-"+(u.levelOpen||"none"),"nav-position-"+u.position,u.disableBody?"disable-body":"",v.isIos?"is-ios":"",v.isTouchDevice?"touch-device":"",a?o:"",u.rtl?"rtl":"",!0!==u.insertClose||u.labelClose?"":"nav-close-button-empty"].join(" ").trim().replace(/  +/g," "),O.removeEventListener("click"),O.className=a,O.setAttribute("aria-hidden",!0),r.documentElement.style.setProperty("--nav-level-spacing",u.levelSpacing+"px"),u.disableBody&&O.addEventListener("click",b),t?J():setTimeout(J,0)},Z=function(){P=function e(t,n){var a=[];return Array.prototype.forEach.call(t,function(t){var i;("UL"===t.tagName||t instanceof HTMLHeadingElement)&&(i={tagName:t.tagName,id:n,htmlClass:t.getAttribute("class")||null,items:[]},t instanceof HTMLHeadingElement?i.content=v.clone(t,!1,!0):(null!==t.getAttribute("data-nav-active")&&(q=n,t.removeAttribute("data-nav-active")),Array.prototype.forEach.call(t.children,function(t){var n=null!==t.getAttribute("data-nav-custom-content"),a=n?t.children:Array.prototype.filter.call(t.children,function(e){return"UL"!==e.tagName&&!e.querySelector("ul")}).concat(t.children.length?[]:[t.firstChild]),s=n?[]:Array.prototype.slice.call(t.querySelectorAll("ul")),o=s.length?[].concat(Array.prototype.filter.call(s[0].parentNode.children,function(e){return"UL"===e.tagName||e instanceof HTMLHeadingElement})):[];s=null;if(!a.length){for(var l="",c=0;c<t.childNodes.length;c++)t.childNodes[c].nodeType===Node.TEXT_NODE&&(l+=t.childNodes[c].textContent.trim());a=[r.createTextNode(l)]}o.length&&(v.data(t,"hc-uniqid")?s=v.data(t,"hc-uniqid"):(s=Math.random().toString(36).substr(2),v.data(t,"hc-uniqid",s))),null!==t.getAttribute("data-nav-active")&&(q=s,t.removeAttribute("data-nav-active")),i.items.push({id:s,htmlClass:t.getAttribute("class")||"",content:a,custom:n,subnav:o.length?e(o,s):[],highlight:null!==t.getAttribute("data-nav-highlight")})})),a.push(i))}),a}("UL"===t.tagName?[t]:Array.prototype.filter.call(t.children,function(e){return"UL"===e.tagName||e instanceof HTMLHeadingElement}),null)},ee=function(t){if(t){for(;k.firstChild;)k.removeChild(k.firstChild);I={}}!function t(a,i,s,o,l,d){var p=v.createElement("div",{class:"nav-wrapper nav-wrapper-"+s,"data-level":s,"data-index":l||0}),f=v.createElement("div",{class:"nav-content"});p.addEventListener("click",v.stopPropagation),p.appendChild(f),i.appendChild(p),o&&(0===s||0<s&&"overlap"===u.levelOpen)&&(i="string"==typeof o?o:v.clone(e.jQuery&&o instanceof e.jQuery&&o.length?o[0]:o,!0,!0),f.insertBefore(v.createElement("div",{class:0===s?"nav-title":"level-title"},i),f.firstChild),0===s&&"string"==typeof o&&O.setAttribute("aria-labelledby",L+"-nav-title"));var h,m,g,y=-1;a.forEach(function(e,i){var l;"UL"===e.tagName?(y++,l=v.createElement("ul",{id:e.id?1<a.length?"menu-"+e.id+"-"+y:"menu-"+e.id:null,role:"menu","aria-level":s+1}),f.appendChild(l),u.keepClasses&&e.htmlClass&&l.classList.add.apply(l.classList,e.htmlClass.split(" ")),e.items.forEach(function(e,a){var i=e.content;if(e.custom){var d=v.createElement("li",{class:"nav-item nav-item-custom"},v.createElement("div",{class:"nav-custom-content"},Array.prototype.map.call(i,function(e){return v.clone(e,!0,!0)})));return u.keepClasses&&e.htmlClass&&d.classList.add.apply(d.classList,e.htmlClass.split(" ")),void l.appendChild(d)}var f,h=Array.prototype.filter.call(i,function(e){return"A"===e.tagName||e.nodeType!==Node.TEXT_NODE&&e.querySelector("a")})[0];h?(f=v.clone(h,!1,!0)).classList.add("nav-item-link"):f=v.createElement(e.subnav.length?"a":"span",{class:"nav-item-link"},Array.prototype.map.call(i,function(e){return v.clone(e,!0,!0)})),"A"===f.tagName&&(f.setAttribute("tabindex","0"),f.setAttribute("role","menuitem"),f.getAttribute("href")||f.setAttribute("href","#")),h&&f.addEventListener("click",function(e){e.stopPropagation(),v.hasListener(h,"click")&&h.click()}),"#"===f.getAttribute("href")&&f.addEventListener("click",v.preventDefault),u.closeOnClick&&(c()?"A"!==f.tagName||"false"===f.dataset.navClose||null!==f.getAttribute("disabled")&&"false"!==f.getAttribute("disabled")||e.subnav.length&&(!f.getAttribute("href")||"#"===f.getAttribute("href").charAt(0))||f.addEventListener("click",b):"A"!==f.tagName||"false"===f.dataset.navClose||null!==f.getAttribute("disabled")&&"false"!==f.getAttribute("disabled")||f.addEventListener("click",b));var m,g,y,A,x,C=v.createElement("li",{class:"nav-item"});C.appendChild(f),l.appendChild(C),u.keepClasses&&e.htmlClass&&C.classList.add.apply(C.classList,e.htmlClass.split(" ")),e.highlight&&C.classList.add("nav-highlight"),v.wrap(f,v.createElement("div",{class:"nav-item-wrapper"})),e.subnav.length&&(m=s+1,g=e.id,y="",I[m]||(I[m]=0),C.classList.add("nav-parent"),c()?(A=I[m],(x=v.createElement("input",{type:"checkbox",id:L+"-"+m+"-"+A,class:"hc-chk",tabindex:-1,"data-level":m,"data-index":A,value:g})).addEventListener("click",v.stopPropagation),x.addEventListener("change",n),C.insertBefore(x,C.firstChild),d=function(t){t.addEventListener("click",function(e){e.stopPropagation(),x.setAttribute("checked","true"!==x.getAttribute("checked")),"createEvent"in r&&((e=r.createEvent("HTMLEvents")).initEvent("change",!1,!0),x.dispatchEvent(e))}),t.addEventListener("keydown",function(e){"Enter"!==e.key&&13!==e.keyCode||(Q=!0,V.push(this))}),t.setAttribute("aria-controls",1<e.subnav.length?e.subnav.filter(function(e){return"UL"===e.tagName}).map(function(e,t){return"menu-"+e.id+"-"+t}).join(" "):"menu-"+g),t.setAttribute("aria-haspopup","overlap"===u.levelOpen),t.setAttribute("aria-expanded",!1)},-1!==X.indexOf(g)&&(p.classList.add("sub-level-open"),p.addEventListener("click",function(){return E(m,A)}),C.classList.add("level-open"),x.setAttribute("checked",!0)),y=!0===u.levelTitles?i[0].textContent.trim():"",f.getAttribute("href")&&"#"!==f.getAttribute("href")?((i=v.createElement("a",{href:"#",class:"nav-next","aria-label":(u.ariaLabels||{}).submenu+": "+y,role:"menuitem",tabindex:0},v.createElement("span"))).addEventListener("click",v.preventClick()),d(i),u.rtl?f.parentNode.appendChild(i):f.parentNode.insertBefore(i,f.nextSibling)):(f.appendChild(v.createElement("span",{class:"nav-next"},v.createElement("span"))),d(f))):f.setAttribute("aria-expanded",!0),I[m]++,t(e.subnav,C,m,y,I[m]-1,"string"==typeof o?o:""))})):f.appendChild(e.content)}),s&&void 0!==l&&!1!==u.insertBack&&"overlap"===u.levelOpen&&(h=v.children(f,"ul"),d=u.levelTitleAsBack&&d||u.labelBack||"",g=v.createElement("a",{href:"#",class:"nav-back-button",role:"menuitem",tabindex:0},[d,v.createElement("span")]),!0===u.insertBack||0===u.insertBack?(d=v.createElement("div",{class:"nav-back"},g),f.insertBefore(d,v.children(f,":not(.level-title)")[0])):(m=v.createElement("li",{class:"nav-item nav-back"},g),v.insertAt(m,!0===u.insertBack?0:u.insertBack,h)),m=function(){return E(s,l)},v.wrap(g,v.createElement("div",{class:"nav-item-wrapper"})),g.addEventListener("click",v.preventClick(m)),g.addEventListener("keydown",function(e){"Enter"!==e.key&&13!==e.keyCode||(Q=!0)})),0===s&&!1!==u.insertClose&&((h=v.createElement("a",{href:"#",class:"nav-close-button"+(u.labelClose?" has-label":""),role:"menuitem",tabindex:0,"aria-label":u.labelClose?"":(u.ariaLabels||{}).close},[u.labelClose||"",v.createElement("span")])).addEventListener("click",v.preventClick(b)),h.addEventListener("keydown",function(e){"Enter"!==e.key&&13!==e.keyCode||$()}),o&&!0===u.insertClose?f.insertBefore(v.createElement("div",{class:"nav-close"},h),f.children[1]):!0===u.insertClose?f.insertBefore(v.createElement("div",{class:"nav-close"},h),f.firstChild):(m=v.children(f,"ul"),g=v.createElement("li",{class:"nav-item nav-close"},h),v.wrap(h,v.createElement("div",{class:"nav-item-wrapper"})),v.insertAt(g,u.insertClose,m)))}(P,k,0,u.navTitle)},te=function(e){return function(t){"left"!==u.position&&"right"!==u.position||(W=t.touches[0].clientX,F=t.touches[0].clientY,"doc"===e?G||(r.addEventListener("touchmove",re,v.supportsPassive),r.addEventListener("touchend",ie,v.supportsPassive)):(G=!0,k.addEventListener("touchmove",se,v.supportsPassive),k.addEventListener("touchend",oe,v.supportsPassive)))}},ne=function(t,n){e.addEventListener("touchmove",v.preventDefault,v.supportsPassive),O.style.visibility="visible",k.style[v.browserPrefix("transition")]="none",v.setTransform(k,t,u.position),j&&(j.style[v.browserPrefix("transition")]="none",v.setTransform(j,n,u.position))},ae=function(t,n,a,r){void 0===n&&(n=!0),void 0===a&&(a=!1),void 0===r&&(r=!1),e.removeEventListener("touchmove",v.preventDefault,v.supportsPassive),k.style[v.browserPrefix("transition")]="",v.setTransform(k,a,u.position),j&&(j.style[v.browserPrefix("transition")]="",v.setTransform(j,r,u.position)),"open"===t?m():(b(),n?setTimeout(function(){O.style.visibility=""},T):O.style.visibility="")},re=function(e){var t=0-(W-e.touches[0].clientX);e="overlap"===u.levelOpen?f()*u.levelSpacing:0,e=D+e,t="left"===u.position?Math.min(Math.max(t,0),e):Math.abs(Math.min(Math.max(t,-e),0));("left"===u.position&&W<50||"right"===u.position&&W>r.body.clientWidth-50)&&(Y=!0,ne(0-(D-t),Math.abs(t)))},ie=function e(t){var n;r.removeEventListener("touchmove",re),r.removeEventListener("touchend",e),Y&&(n=t.changedTouches[t.changedTouches.length-1],t=0-(W-n.clientX),n="overlap"===u.levelOpen?f()*u.levelSpacing:0,n=D+n,(t="left"===u.position?Math.min(Math.max(t,0),n):Math.abs(Math.min(Math.max(t,-n),0)))?ae(70<t?"open":"close"):ae("close",!1),F=W=null,Y=!1)},se=function(e){var t=0-(W-e.touches[0].clientX),n=0-(F-e.touches[0].clientY);Math.abs(t)<Math.abs(n)||(e="overlap"===u.levelOpen?f()*u.levelSpacing:0,n=D+e,t="left"===u.position?Math.min(Math.max(t,-n),0):Math.min(Math.max(t,0),n),("left"===u.position&&t<0||"right"===u.position&&0<t)&&(Y=!0,ne(-Math.abs(t)+e,n-Math.abs(t))))},oe=function e(t){var n,a;k.removeEventListener("touchmove",se),k.removeEventListener("touchend",e),G=!1,Y&&(n=t.changedTouches[t.changedTouches.length-1],a=0-(W-n.clientX),t="overlap"===u.levelOpen?f()*u.levelSpacing:0,n=D+t,(a="left"===u.position?Math.abs(Math.min(Math.max(a,-n),0)):Math.abs(Math.min(Math.max(a,0),n)))===n?ae("close",!1):50<a?ae("close"):ae("open",!0,t,n),F=W=null,Y=!1)};R(),Z(),ee(),!0===u.removeOriginalNav?t.parentNode.removeChild(t):t.classList.add("hc-nav-original",L),"prepend"===u.bodyInsert?r.body.insertBefore(O,r.body.firstChild):"append"===u.bodyInsert&&r.body.appendChild(O),!0===u.expanded&&(B=!0,m()),u.swipeGestures&&(k.addEventListener("touchstart",te("nav"),v.supportsPassive),r.addEventListener("touchstart",te("doc"),v.supportsPassive)),u.closeOnEsc&&r.addEventListener("keydown",function(e){!_||"Escape"!==e.key&&27!==e.keyCode||(0===(e=f())?(b(),$()):(E(e,h()),K(null,e-1)))}),te=v.debounce(J,500),e.addEventListener("resize",te,v.supportsPassive);var le=function(e,t,n){var a,i,s=r.querySelector("#"+L+"-"+e+"-"+t);s&&(a=s.value,t=(i=s.parentNode).closest(".nav-wrapper"),s.setAttribute("checked",!1),t.classList.remove("sub-level-open"),i.classList.remove("level-open"),i.querySelectorAll("[aria-controls]")[0].setAttribute("aria-expanded",!1),-1!==X.indexOf(a)&&X.splice(X.indexOf(a),1),n&&"overlap"===u.levelOpen&&(t.removeEventListener("click"),t.addEventListener("click",v.stopPropagation),v.setTransform(k,(e-1)*u.levelSpacing,u.position),j&&(t="x"===v.getAxis(u.position)?D:U,v.setTransform(j,t+(e-1)*u.levelSpacing,u.position))))};return O.on=function(e,t){O.addEventListener(e,t)},O.off=function(e,t){O.removeEventListener(e,t)},O.getSettings=function(){return Object.assign({},u)},O.isOpen=p,O.open=m,O.close=b,O.toggle=g(null),O.update=function(e,t){if(d=[],"object"==typeof e){for(var n in e)u[n]!==e[n]&&d.push(n);u=Object.assign({},u,e)}!0===e||!0===t?u.removeOriginalNav?console.warn("%c! HC Offcanvas Nav:%c Can't update because original navigation has been removed. Disable `removeOriginalNav` option.","color: #fa253b","color: default"):(R(!0),Z(),ee(!0)):(R(!0),ee(!0))},O}console.error("%c! HC Offcanvas Nav:%c Navigation must contain <ul> element.","color: #fa253b","color: default")}if(a=a||{},!(n="string"==typeof n?"#"===n.charAt(0)&&-1===n.indexOf(" ")?r.querySelector(n):r.querySelectorAll(n):n))return!1;var v=t.Helpers;void 0!==a.maxWidth&&(v.deprecated("maxWidth","disableAt","option"),a.disableAt=a.maxWidth);var u=Object.assign({},{width:280,height:"auto",disableAt:!1,pushContent:null,swipeGestures:!0,expanded:!1,position:"left",levelOpen:"overlap",levelSpacing:40,levelTitles:!0,closeOpenLevels:!0,closeActiveLevel:!1,navTitle:null,navClass:"",disableBody:!0,closeOnClick:!0,closeOnEsc:!0,customToggle:null,activeToggleClass:null,bodyInsert:"prepend",keepClasses:!0,removeOriginalNav:!1,rtl:!1,insertClose:!0,insertBack:!0,levelTitleAsBack:!0,labelClose:"",labelBack:"Back"},a);u.ariaLabels=Object.assign({},{open:"Open Menu",close:"Close Menu",submenu:"Submenu"},a.ariaLabels);var d=[];if(Array.isArray(n)||n instanceof NodeList){for(var p=[],f=0;f<n.length;f++)p.push(c(n[f]));return 1<p.length?p:p[0]}return c(n)}var n,a,r=e.document,i=r.getElementsByTagName("html")[0],s=0,o="nav-open";return void 0!==e.jQuery&&(n=e.jQuery,a="hcOffcanvasNav",n.fn.extend({hcOffcanvasNav:function(e){return this.length?this.each(function(){var r=n.data(this,a);r?r.update(e):(r=new t(this,e),n.data(this,a,r))}):this}})),e.hcOffcanvasNav=e.hcOffcanvasNav||t,t}),function(e){function t(e){return!isNaN(parseFloat(e))&&isFinite(e)}function n(e){return"auto"===e?"100%":t(e)&&0!==e?e+"px":e}function a(e){var t=["Webkit","Moz","Ms","O"],n=(l.body||l.documentElement).style,a=e.charAt(0).toUpperCase()+e.slice(1);if(void 0!==n[e])return e;for(var r=0;r<t.length;r++)if(void 0!==n[t[r]+a])return t[r]+a;return!1}function r(e,t){if(e instanceof Element)return t?Array.prototype.filter.call(e.children,function(e){return e.matches(t)}):e.children;var n=[];return Array.prototype.forEach.call(e,function(e){n=t?n.concat(Array.prototype.filter.call(e.children,function(e){return e.matches(t)})):n.concat(Array.prototype.slice.call(e.children))}),n}function i(e,t,n){void 0===t&&(t={});var a,r=l.createElement(e);for(a in t)"class"!==a?!t[a]&&0!==t[a]||r.setAttribute(a,t[a]):r.className=t[a];if(n){Array.isArray(n)||(n=[n]);for(var i=0;i<n.length;i++)if("object"==typeof n[i]&&n[i].length&&!n[i].nodeType)for(var s=0;s<n[i].length;s++)r.appendChild(n[i][s]);else r.appendChild("string"==typeof n[i]?l.createTextNode(n[i]):n[i])}return r}function s(e){return-1!==["left","right"].indexOf(e)?"x":"y"}var o=e.hcOffcanvasNav,l=e.document;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),a=1;a<arguments.length;a++){var r=arguments[a];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n},writable:!0,configurable:!0}),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(Element.prototype.matches.call(t,e))return t}while(null!==(t=t.parentElement||t.parentNode)&&1===t.nodeType);return null}),Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function e(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,function(n,a){return Array.isArray(a)?n.push.apply(n,e.call(a,t-1)):n.push(a),n},[]):Array.prototype.slice.call(this)},writable:!0}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector);var c=!1;try{var v=Object.defineProperty({},"passive",{get:function(){c={passive:!1}}});e.addEventListener("testPassive",null,v),e.removeEventListener("testPassive",null,v)}catch(o){}var u=(/iPad|iPhone|iPod/.test(navigator.userAgent)||!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))&&!e.MSStream,d="ontouchstart"in e||navigator.maxTouchPoints||e.DocumentTouch&&l instanceof DocumentTouch,p=function(e){var t=Node.prototype[e+"EventListener"];return function(n,a,r){if(this){var i=n.split(".")[0];if(this._eventListeners=this._eventListeners||{},"add"===e){this._eventListeners[n]=this._eventListeners[n]||[];var s={fn:a};r&&(s.options=r),this._eventListeners[n].push(s),t.call(this,i,a,r)}else if("function"==typeof a)for(var o in t.call(this,i,a,r),this._eventListeners)this._eventListeners[o]=this._eventListeners[o].filter(function(e){return e.fn!==a}),this._eventListeners[o].length||delete this._eventListeners[o];else if(this._eventListeners[n]){for(var l=this._eventListeners[n].length;l--;)t.call(this,i,this._eventListeners[n][l].fn,this._eventListeners[n][l].options),this._eventListeners[n].splice(l,1);this._eventListeners[n].length||delete this._eventListeners[n]}}}};Node.prototype.addEventListener=p("add"),Node.prototype.removeEventListener=p("remove"),v=function e(t){return"string"==typeof t?t:t.getAttribute("id")?"#"+t.getAttribute("id"):t.getAttribute("class")?t.tagName.toLowerCase()+"."+t.getAttribute("class").replace(/\s+/g,"."):e(t.parentNode)+" > "+t.tagName.toLowerCase()},a("transform"),p=function(e,t,a){!1===t||""===t?e.style.transform="":"x"===s(a)?e.style.transform="translate3d("+n("left"===a?t:-t)+",0,0)":e.style.transform="translate3d(0,"+n("top"===a?t:-t)+",0)"},o.Helpers={supportsPassive:c,isIos:u,isTouchDevice:d,isNumeric:t,formatSizeVal:n,toMs:function(e){return parseFloat(e)*(/\ds$/.test(e)?1e3:1)},stopPropagation:function(e){return e.stopPropagation()},preventDefault:function(e){return e.preventDefault()},preventClick:function(e){return function(t){t.preventDefault(),t.stopPropagation(),"function"==typeof e&&e()}},browserPrefix:a,children:r,wrap:function(e,t){e.parentNode.insertBefore(t,e),t.appendChild(e)},data:function(e,t,n){if(e.hcOffcanvasNav=e.hcOffcanvasNav||{},void 0===n)return e.hcOffcanvasNav[t];e.hcOffcanvasNav[t]=n},clone:function(e,t,n){var a=e.cloneNode(n||!1),r=e instanceof Element?[e].concat(Array.prototype.slice.call(e.getElementsByTagName("*"))):[];e=a instanceof Element?[a].concat(Array.prototype.slice.call(a.getElementsByTagName("*"))):[];return t||(r.shift(),e.shift()),n&&function(e,t){for(var n=0;n<e.length;n++)if(e[n]._eventListeners)for(var a in e[n]._eventListeners)for(var r=0;r<e[n]._eventListeners[a].length;r++)t[r].addEventListener(a,e[n]._eventListeners[a][r].fn,e[n]._eventListeners[a][r].options)}(r,e),a},customEventObject:function(e,t,n,a){return new function(e){for(var r in this.bubbles=!1,this.cancelable=!1,this.composed=!1,this.currentTarget=n,this.data=a?{}:null,this.defaultPrevented=!1,this.eventPhase=0,this.isTrusted=!1,this.target=t,this.timeStamp=Date.now(),this.type=e,a)this.data[r]=a[r]}(e)},hasListener:function(e,t){return(t?(e._eventListeners||{})[t]:e._eventListeners)||!1},debounce:function(e,t,n){var a;return function(){var r=this,i=arguments,s=n&&!a;clearTimeout(a),a=setTimeout(function(){a=null,n||e.apply(r,i)},t),s&&e.apply(r,i)}},createElement:i,getElements:function(t){var n=null;return"string"==typeof t?n=l.querySelectorAll(t):e.jQuery&&t instanceof e.jQuery&&t.length?n=t.toArray():t instanceof Element&&(n=[t]),n},getElementCssTag:v,printStyle:function(e){function t(e){return";"!==e.substr(-1)&&(e+=";"!==e.substr(-1)?";":""),e}var n=i("style",{id:e}),a={},r={};return l.head.appendChild(n),{reset:function(){a={},r={}},add:function(e,n,i){e=e.trim(),n=n.trim(),i?(i=i.trim(),r[i]=r[i]||{},r[i][e]=t(n)):a[e]=t(n)},remove:function(e,t){e=e.trim(),t?(t=t.trim(),void 0!==r[t][e]&&delete r[t][e]):void 0!==a[e]&&delete a[e]},insert:function(){var e,t,i="";for(e in r){for(var s in i+="@media screen and ("+e+") {\n",r[e])i+="  "+s+" { "+r[e][s]+" }\n";i+="}\n"}for(t in a)i+=t+" { "+a[t]+" }\n";n.innerHTML=i}}},insertAt:function(e,t,n){var a=r(n),i=a.length;i=-1<(t="last"===(t="first"===t?0:t)?i:t)?Math.max(0,Math.min(t,i)):Math.max(0,Math.min(i+t,i));0===i?n[0].insertBefore(e,n[0].firstChild):a[i-1].insertAdjacentElement("afterend",e)},getAxis:s,setTransform:p,deprecated:function(e,t,n){console.warn("%cHC Off-canvas Nav:%c "+n+"%c '"+e+"'%c is now deprecated and will be removed in the future. Use%c '"+t+"'%c option instead. See details about plugin usage at https://github.com/somewebmedia/hc-offcanvas-nav.","color: #fa253b","color: default","color: #5595c6","color: default","color: #5595c6","color: default")}}}(window);