jQuery(function($){if(typeof ezTOC!='undefined'){function ezTOCInit(){var affix=$('.ez-toc-widget-container.ez-toc-affix');if(0!==affix.length){var affixOffset=30;if(typeof ezTOC.scroll_offset!='undefined'){affixOffset=parseInt(ezTOC.scroll_offset);} $(ezTOC.affixSelector).stick_in_parent({inner_scrolling:false,offset_top:affixOffset})} $.fn.shrinkTOCWidth=function(){$(this).css({width:'auto',display:'table'});if(/MSIE 7\./.test(navigator.userAgent)) $(this).css('width','');};if(typeof ezTOC.visibility_hide_by_default!='undefined'){var toggles=$('.ez-toc-toggle:not(.ez-toc-loaded),.ez-toc-widget-sticky-toggle:not(.ez-toc-loaded)');var invert=ezTOC.visibility_hide_by_default;$.each(toggles,function(i,obj){var toggle=$(this);$(toggle).addClass('ez-toc-loaded');var toc=$(toggle).parents('#ez-toc-container,#ez-toc-widget-container,#ez-toc-widget-sticky-container').find('ul.ez-toc-list,ul.ez-toc-widget-sticky-list');if($(toc).hasClass('eztoc-toggle-hide-by-default')){invert=1;} if(typeof Cookies!=="undefined"){if(Cookies){Cookies.get('ezTOC_hidetoc-'+i)==1?$(toggle).data('visible',false):$(toggle).data('visible',true);Cookies.remove('ezTOC_hidetoc-'+i)}else{$(toggle).data('visible',true);Cookies.remove('ezTOC_hidetoc-'+i);}} if(invert){$(toggle).data('visible',false)} if(!$(toggle).data('visible')){toc.hide();} $(toggle).on('click',function(event){event.preventDefault();const main=document.querySelector("#ez-toc-container");if(main){main.classList.toggle("toc_close");} else {const side=document.querySelector(".ez-toc-widget-container,.ez-toc-widget-sticky-container");side.classList.toggle("toc_close");} if($(this).data('visible')){$(this).data('visible',false);if(typeof Cookies!=="undefined"){if(Cookies){if(invert) Cookies.set('ezTOC_hidetoc-'+i,null,{path:'/'});else Cookies.set('ezTOC_hidetoc-'+i,'1',{expires:30,path:'/'});}} toc.hide('fast');}else{$(this).data('visible',true);if(typeof Cookies!=="undefined"){if(Cookies){if(invert) Cookies.set('ezTOC_hidetoc-'+i,'1',{expires:30,path:'/'});else Cookies.set('ezTOC_hidetoc-'+i,null,{path:'/'});}} toc.show('fast');}});});} var headings=$('span.ez-toc-section').toArray();var headingToListElementLinkMap=getHeadingToListElementLinkMap(headings);var listElementLinks=$.map(headingToListElementLinkMap,function(value,key){return value});var scrollOffset=getScrollOffset();activateSetActiveEzTocListElement();function setActiveEzTocListElement(){var activeHeading=getActiveHeading(scrollOffset,headings);if(activeHeading){var activeListElementLink=headingToListElementLinkMap[activeHeading.id];removeStyleFromNonActiveListElement(activeListElementLink,listElementLinks);setStyleForActiveListElementElement(activeListElementLink);}} function activateSetActiveEzTocListElement(){if(headings.length>0&&$('.ez-toc-widget-container').length){$(window).on('load resize scroll',setActiveEzTocListElement);}} function deactivateSetActiveEzTocListElement(){$(window).off('load resize scroll',setActiveEzTocListElement);} function getEzTocListElementLinkByHeading(heading){return $('.ez-toc-widget-container .ez-toc-list a[href="#'+$(heading).attr('id')+'"]');} function getHeadingToListElementLinkMap(headings){return headings.reduce(function(map,heading){map[heading.id]=getEzTocListElementLinkByHeading(heading);return map;},{});} function getScrollOffset(){var scrollOffset=5;if(typeof ezTOC.smooth_scroll!='undefined'&&parseInt(ezTOC.smooth_scroll)===1){scrollOffset=(typeof ezTOC.scroll_offset!='undefined')?parseInt(ezTOC.scroll_offset):30;} var adminbar=$('#wpadminbar');if(adminbar.length){scrollOffset+=adminbar.height();} return scrollOffset;} function getActiveHeading(topOffset,headings){var scrollTop=$(window).scrollTop();var relevantOffset=scrollTop+topOffset+1;var activeHeading=headings[0];var closestHeadingAboveOffset=relevantOffset-$(activeHeading).offset().top;headings.forEach(function(section){var topOffset=relevantOffset-$(section).offset().top;if(topOffset>0&&topOffset'+content+'');var listItem=$('#ez-toc-height-test');var height=listItem.height();listItem.remove();return height-($listElement.children('ul').first().height()||0);} function addListElementBackgroundColorHeightStyleToHead(listElementHeight){$('.ez-toc-widget-container ul.ez-toc-list li.active').css('height',listElementHeight+'px');} function setStyleForActiveListElementElement(activeListElementLink){var activeListElement=activeListElementLink.parent();if(!activeListElement.hasClass('active')){activeListElement.addClass('active');} correctActiveListElementBackgroundColorHeight(activeListElement);}} if($('#ez-toc-container').length){if(!$('#ez-toc-container .ez-toc-toggle label span').html()){$('#ez-toc-container .ez-toc-toggle label').html(ezTOC.fallbackIcon);}} ezTOC.init=function(){ezTOCInit();} ezTOCInit();if(typeof ezTOC.ajax_toggle!='undefined'&&parseInt(ezTOC.ajax_toggle)===1){$(document).ajaxComplete(function(){ezTOCInit();});}} $(document).on('click','#ez-toc-open-sub-hd',function(e){$(this).attr("id","ez-toc-open-sub-hd-active");e.preventDefault();});$(document).on('click','#ez-toc-open-sub-hd-active',function(e){$(this).attr("id","ez-toc-open-sub-hd");e.preventDefault();});$("#ez-toc-more-links-enabler").click(function(){$(".ez-toc-more-link").show();$("#ez-toc-more-links-enabler").hide();$("#ez-toc-more-links-disabler").attr("style","display:inline-block");});$("#ez-toc-more-links-disabler").click(function(){$(".ez-toc-more-link").hide();$("#ez-toc-more-links-enabler").show();$("#ez-toc-more-links-disabler").hide();});});