!function(){var o,l,n,e,g,m=function(t,e){var i,n={};for(i in t)n[i]=t[i];for(i in e)n[i]=e[i];return n},t=function(t){return t},c=(o={duration:300,action:"close",startTime:null,startHeight:null,endHeight:null,easing:t},l=function(e,i){cancelAnimationFrame(e.getAttribute("data-lwptoc-animation-request-id")),e.setAttribute("data-lwptoc-animation-request-id",window.requestAnimationFrame(function(t){n(e,i,t)}))},n=function(t,e,i){e.startTime||(e.startTime=i);var n,o=i-e.startTime;o<e.duration?(t.style.height=((e.endHeight-e.startingHeight)*e.easing(o/e.duration)+e.startingHeight).toFixed(2)+"px",l(t,e)):("close"===e.action&&(t.style.display="none"),"open"===e.action&&(t.style.display="block"),(n=t).style.height=null,n.style.overflow=null)},function(t,e){if(window.requestAnimationFrame){var i=m(o,{});i.action=e,t.style.height?i.startingHeight=parseFloat(t.style.height):i.startingHeight="close"===e?t.scrollHeight:0,(n=t).style.display="block",n.style.overflow="hidden",i.endHeight="close"===e?0:(t.style.height="0px",t.scrollHeight),l(t,i)}else t.style.display="close"===e?"none":"block";var n}),a=function(t){for(var e,i=document.querySelectorAll('[id="'+t+'"]'),n=0;n<i.length;n++)if((e=i[n]).offsetWidth||e.offsetHeight||e.getClientRects().length)return i[n];return null},i=(e={offset:0,duration:500,easing:t,onComplete:function(t,e){}},g=function(t,e){var i=t.getBoundingClientRect().top+window.pageYOffset-e;return i<0?0:i},function(o,t){var l,a=m(e,t);if(window.requestAnimationFrame&&"smooth"!==window.getComputedStyle(document.getElementsByTagName("HTML")[0]).scrollBehavior){var r,s,c=window.pageYOffset,d=null,u=function(t){l=g(o,a.offset),r=l-c;var e=window.pageYOffset;if(!s||!(0<r&&e<s||r<0&&s<e)){s=e,d||(d=t-1);var i=t-d,n=((l-c)*a.easing(i/a.duration)+c).toFixed();window.scroll(0,n),i<a.duration?window.requestAnimationFrame(u):(window.scroll(0,l),a.onComplete(0,l))}};window.requestAnimationFrame(u)}else l=g(o,a.offset),window.scroll(0,l),a.onComplete(0,l)}),u={scrollTo:function(t,e){i(t,e)},registerScrollTrigger:function(t,i){for(var e=0;e<t.length;e++)t[e].addEventListener("click",function(t){t.preventDefault();var e=this.getAttribute("href"),c=e.substring(1),d=a(c);d&&(e!==document.location.hash&&(i.onComplete=function(t,e){var i,n,o,l,a,r,s;d.setAttribute("id",""),i=c,n=t,o=e,(s=document.createElement("a")).setAttribute("id",i),s.setAttribute("style","position:absolute;visibility:hidden;left:"+n+"px;top:"+o+"px;"),l=document.body,a=s,l.prepend?l.prepend(a):l.insertBefore(a,l.firstChild),document.location.hash=i,(r=s).remove?r.remove():r.parentNode.removeChild(r),d.setAttribute("id",c)}),u.scrollTo(d,i))})},init:function(t){if("1"!==t.getAttribute("data-lwptoc-initialized")){t.setAttribute("data-lwptoc-initialized","1");var a,r=t.getElementsByClassName("lwptoc_toggle_label")[0],s=t.getElementsByClassName("lwptoc_items")[0];if(r)r.addEventListener("click",function(t){var e,i,n,o,l;t.preventDefault(),a=r.getAttribute("data-label"),r.setAttribute("data-label",r.innerHTML),r.innerHTML=a,l="lwptoc_items-visible",-1<(" "+s.className+" ").indexOf(" "+l+" ")?(o="lwptoc_items-visible",(n=s).className=(" "+n.className+" ").replace(" "+o+" ","").trim(),c(s,"close")):(i="lwptoc_items-visible",(e=s).className=e.className.trim()+" "+i,c(s,"open"))});"1"===t.getAttribute("data-smooth-scroll")&&u.registerScrollTrigger(s.getElementsByTagName("A"),{offset:t.getAttribute("data-smooth-scroll-offset")})}},globalInit:function(){for(var t=document.getElementsByClassName("lwptoc"),e=0;e<t.length;e++)u.init(t[e])}};window.lwptoc=u,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",u.globalInit):u.globalInit()}();