!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(t){function e(t){return t.replace(/(:|\.|\/)/g,"\\$1")}var o={},l=function(e){var o=[],l=!1,s=e.dir&&"left"===e.dir?"scrollLeft":"scrollTop";return this.each(function(){var e=t(this);if(this!==document&&this!==window)return!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(e[s]()>0?o.push(this):(e[s](1),l=e[s]()>0,l&&o.push(this),e[s](0))):(o.push(document.scrollingElement),!1)}),o.length||this.each(function(){"BODY"===this.nodeName&&(o=[this])}),"first"===e.el&&o.length>1&&(o=[o[0]]),o};t.fn.extend({scrollable:function(t){var e=l.call(this,{dir:t});return this.pushStack(e)},firstScrollable:function(t){var e=l.call(this,{el:"first",dir:t});return this.pushStack(e)},smoothScroll:function(o,l){if("options"===(o=o||{}))return l?this.each(function(){var e=t(this),o=t.extend(e.data("ssOpts")||{},l);t(this).data("ssOpts",o)}):this.first().data("ssOpts");var s=t.extend({},t.fn.smoothScroll.defaults,o),n=function(o){var l=this,n=t(this),i=t.extend({},s,n.data("ssOpts")||{}),c=s.exclude,a=i.excludeWithin,r=0,h=0,u=!0,d={},p=t.smoothScroll.filterPath(location.pathname),f=t.smoothScroll.filterPath(l.pathname),m=location.hostname===l.hostname||!l.hostname,g=i.scrollTarget||f===p,_=e(l.hash);if(i.scrollTarget||m&&g&&_){for(;u&&r<c.length;)n.is(e(c[r++]))&&(u=!1);for(;u&&h<a.length;)n.closest(a[h++]).length&&(u=!1)}else u=!1;u&&(i.preventDefault&&o.preventDefault(),t.extend(d,i,{scrollTarget:i.scrollTarget||_,link:l}),t.smoothScroll(d))};return null!==o.delegateSelector?this.undelegate(o.delegateSelector,"click.smoothscroll").delegate(o.delegateSelector,"click.smoothscroll",n):this.unbind("click.smoothscroll").bind("click.smoothscroll",n),this}}),t.smoothScroll=function(e,l){if("options"===e&&"object"==typeof l)return t.extend(o,l);var s,n,i,c,a=0,r="offset",h="scrollTop",u={},d={};"number"==typeof e?(s=t.extend({link:null},t.fn.smoothScroll.defaults,o),i=e):(s=t.extend({link:null},t.fn.smoothScroll.defaults,e||{},o)).scrollElement&&(r="position","static"===s.scrollElement.css("position")&&s.scrollElement.css("position","relative")),h="left"===s.direction?"scrollLeft":h,s.scrollElement?(n=s.scrollElement,/^(?:HTML|BODY)$/.test(n[0].nodeName)||(a=n[h]())):n=t("html, body").firstScrollable(s.direction),s.beforeScroll.call(n,s),i="number"==typeof e?e:l||t(s.scrollTarget)[r]()&&t(s.scrollTarget)[r]()[s.direction]||0,u[h]=i+a+s.offset,"auto"===(c=s.speed)&&(c=Math.abs(u[h]-n[h]())/s.autoCoefficient),d={duration:c,easing:s.easing,complete:function(){s.afterScroll.call(s.link,s)}},s.step&&(d.step=s.step),n.length?n.stop().animate(u,d):s.afterScroll.call(s.link,s)},t.smoothScroll.version="1.6.0",t.smoothScroll.filterPath=function(t){return(t=t||"").replace(/^\//,"").replace(/(?:index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},t.fn.smoothScroll.defaults={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0}}),jQuery.cookie=function(t,e,o){if(arguments.length>1&&"[object Object]"!==String(e)){if(o=jQuery.extend({},o),null==e&&(o.expires=-1),"number"==typeof o.expires){var l=o.expires,s=o.expires=new Date;s.setDate(s.getDate()+l)}return e=String(e),document.cookie=[encodeURIComponent(t),"=",o.raw?e:encodeURIComponent(e),o.expires?"; expires="+o.expires.toUTCString():"",o.path?"; path="+o.path:"",o.domain?"; domain="+o.domain:"",o.secure?"; secure":""].join("")}var n,i=(o=e||{}).raw?function(t){return t}:decodeURIComponent;return(n=new RegExp("(?:^|;)"+encodeURIComponent(t)+"=([^;]*)").exec(document.cookie))?i(n[1]):null},jQuery(document).ready(function(t){if("undefined"!=typeof tocplus){if(t.fn.shrinkTOCWidth=function(){t(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&t(this).css("width","")},1==tocplus.smooth_scroll){var e=hostname=pathname=qs=hash=null;t(document).on("click","#toc_container a, ul.toc_widget_list a",function(o){if(hostname=t(this).prop("hostname"),pathname=t(this).prop("pathname"),qs=t(this).prop("search"),hash=t(this).prop("hash"),pathname.length>0&&"/"!=pathname.charAt(0)&&(pathname="/"+pathname),window.location.hostname==hostname&&window.location.pathname==pathname&&window.location.search==qs&&""!==hash){var l=hash.replace(/([ !"$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g,"\\$1");t(l).length>0?e=hash:(anchor=hash,anchor=anchor.replace("#",""),e='a[name="'+anchor+'"]',0==t(e).length&&(e="")),void 0!==tocplus.smooth_scroll_offset?offset=-1*tocplus.smooth_scroll_offset:t("#wpadminbar").length>0&&t("#wpadminbar").is(":visible")?offset=-30:offset=0,e&&t.smoothScroll({scrollTarget:e,offset:offset})}})}if(void 0!==tocplus.visibility_show){var o,l=void 0!==tocplus.visibility_hide_by_default,s=!!t.cookie&&!!t.cookie("tocplus_hidetoc"),n=l?!s:s,i=void 0!==tocplus.toggle_style?tocplus.toggle_style:"brackets",c=n?tocplus.visibility_show:tocplus.visibility_hide;o="brackets"===i?' <span class="toc_toggle toc_toggle_brackets"><span class="toc_brackets">[</span><a href="#">'+c+'</a><span class="toc_brackets">]</span></span>':' <span class="toc_toggle toc_toggle_icon toc_toggle_'+i+'"><a href="#" role="button" aria-label="'+c+'"><span class="toc_toggle_indicator" aria-hidden="true"></span></a></span>',t("#toc_container .toc_title").append(o),n&&(t("ul.toc_list").hide(),t("#toc_container").addClass("contracted").shrinkTOCWidth()),t("span.toc_toggle a").click(function(e){e.preventDefault();var o,s=!t("#toc_container").hasClass("contracted"),n=s?tocplus.visibility_show:tocplus.visibility_hide;"brackets"===i?t(this).html(n):t(this).attr("aria-label",n),o=s,t.cookie&&(t.cookie("tocplus_hidetoc",null,{path:"/"}),o!=l?t.cookie("tocplus_hidetoc","1",{expires:30,path:window.location.pathname}):t.cookie("tocplus_hidetoc",null,{path:window.location.pathname})),s?(t("ul.toc_list").hide("fast"),t("#toc_container").addClass("contracted").shrinkTOCWidth()):(t("#toc_container").css("width",tocplus.width).removeClass("contracted"),t("ul.toc_list").show("fast"))})}}});