/*! * Chirpy v6.3.0 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/ */ !function(){"use strict";const o=$(".mode-toggle");function t(o,t,s){return(t=function(o){var t=function(o,t){if("object"!=typeof o||null===o)return o;var s=o[Symbol.toPrimitive];if(void 0!==s){var e=s.call(o,t||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(o)}(o,"string");return"symbol"==typeof t?t:String(t)}(t))in o?Object.defineProperty(o,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[t]=s,o}const s=$("body"),e="sidebar-display";class a{static toggle(){!1===a.isExpanded?s.attr(e,""):s.removeAttr(e),a.isExpanded=!a.isExpanded}}t(a,"isExpanded",!1);const r=$("#sidebar-trigger"),l=$("#search-trigger"),n=$("#search-cancel"),i=$("#main-wrapper>.container>.row"),c=$("#topbar-title"),f=$("search"),d=$("#search-result-wrapper"),u=$("#search-results"),p=$("#search-input"),b=$("#search-hints"),g=$("html,body"),m="loaded",C="unloaded",v="input-focus",h="d-flex";class w{static on(){w.offset=window.scrollY,g.scrollTop(0)}static off(){g.scrollTop(w.offset)}}t(w,"offset",0),t(w,"resultVisible",!1);class y{static on(){r.addClass(C),c.addClass(C),l.addClass(C),f.addClass(h),n.addClass(m)}static off(){n.removeClass(m),f.removeClass(h),r.removeClass(C),c.removeClass(C),l.removeClass(C)}}class k{static on(){w.resultVisible||(w.on(),d.removeClass(C),i.addClass(C),w.resultVisible=!0)}static off(){w.resultVisible&&(u.empty(),b.hasClass(C)&&b.removeClass(C),d.addClass(C),i.removeClass(C),w.off(),p.val(""),w.resultVisible=!1)}}function T(){return n.hasClass(m)}const x=$(".collapse");$(".code-header>button").children().attr("class"),function(){const o=$(window),t=$("#back-to-top");o.on("scroll",(()=>{o.scrollTop()>50?t.fadeIn():t.fadeOut()})),t.on("click",(()=>{o.scrollTop(0)}))}(),[...document.querySelectorAll('[data-bs-toggle="tooltip"]')].map((o=>new bootstrap.Tooltip(o))),0!==o.length&&o.off().on("click",(o=>{const t=$(o.target);let s=t.prop("tagName")==="button".toUpperCase()?t:t.parent();modeToggle.flipMode(),s.trigger("blur")})),$("#sidebar-trigger").on("click",a.toggle),$("#mask").on("click",a.toggle),l.on("click",(function(){y.on(),k.on(),p.trigger("focus")})),n.on("click",(function(){y.off(),k.off()})),p.on("focus",(function(){f.addClass(v)})),p.on("focusout",(function(){f.removeClass(v)})),p.on("input",(()=>{""===p.val()?T()?b.removeClass(C):k.off():(k.on(),T()&&b.addClass(C))})),x.on("hide.bs.collapse",(function(){const o="h_"+$(this).attr("id").substring(2);o&&($("#".concat(o," .far.fa-folder-open")).attr("class","far fa-folder fa-fw"),$("#".concat(o," i.fas")).addClass("rotate"),$("#".concat(o)).removeClass("hide-border-bottom"))})),x.on("show.bs.collapse",(function(){const o="h_"+$(this).attr("id").substring(2);o&&($("#".concat(o," .far.fa-folder")).attr("class","far fa-folder-open fa-fw"),$("#".concat(o," i.fas")).removeClass("rotate"),$("#".concat(o)).addClass("hide-border-bottom"))}))}();