rss-bridge/themes/daux/js/daux.min.js

3 lines
4.7 KiB
JavaScript

(function(){"use strict";function e(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}function t(e,t){var n=document.getElementsByTagName("head")[0],r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=t,n.appendChild(r)}function n(e){var t=document.getElementsByTagName("head")[0],n=document.createElement("link");n.rel="stylesheet",n.href=e,t.appendChild(n)}var r="daux_code_blocks_hidden";function a(e,t){for(var n=0;n<e.length;n++)e[n].classList.toggle("CodeToggler--hidden",t);try{localStorage.setItem(r,t)}catch(e){}}function o(e,t){var n=e.querySelector(".CodeToggler__button--main");n.addEventListener("change",(function(e){a(t,!e.target.checked)}),!1);var o=!1;try{o=localStorage.getItem(r),"false"===o?o=!1:"true"===o&&(o=!0),o&&(a(t,!0),n.checked=!1)}catch(e){}}function i(e,t){if(!e)return;if("string"===typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=i(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0;var a=function(){};return{s:a,n:function(){if(r>=e.length)return{done:!0};return{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){c=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function s(e){var t=function e(t){"0px"!==t.target.style.height&&(t.target.style.height="auto"),t.target.removeEventListener("transitionend",e)};e.addEventListener("transitionend",t)}function d(e){var t=e;while((t=t.parentNode)&&9!==t.nodeType)if(1===t.nodeType&&t.classList.contains("Nav__item"))return t;throw new Error("Could not find a NavItem...")}function u(e){var t=void 0!==e.preventDefault;t&&e.preventDefault();var n=d(e.target);var r=n.querySelector("ul.Nav");t&&n.classList.contains("Nav__item--open")?(r.style.height="".concat(r.scrollHeight,"px"),r.style.transitionDuration="150ms",r.style.height="0px",n.classList.remove("Nav__item--open")):t?(r.style.transitionDuration="150ms",s(r),r.style.height="".concat(r.scrollHeight,"px"),n.classList.add("Nav__item--open")):r.style.height="auto"}e((function(){var e=document.querySelectorAll(".s-content pre");var t=document.querySelector(".CodeToggler");if(!t)return;e.length?o(t,e):t.classList.add("CodeToggler--hidden")})),e((function(){var e=document.querySelector(".Collapsible__trigger");if(e){var t=document.querySelector(".Collapsible__content");e.addEventListener("click",(function(n){t.classList.contains("Collapsible__content--open")?(t.style.height=0,t.classList.remove("Collapsible__content--open"),e.setAttribute("aria-expanded","false")):(e.setAttribute("aria-expanded","true"),t.style.transitionDuration="150ms",t.style.height="".concat(t.scrollHeight,"px"),t.classList.add("Collapsible__content--open"))}))}})),e((function(){var e=document.querySelectorAll("pre > code:not(.hljs, .katex)");e.length&&t("".concat(window.base_url,"daux_libraries/highlight.pack.js"),(function(){[].forEach.call(e,window.hljs.highlightBlock)}))})),e((function(){var e=document.querySelectorAll("pre > code.katex");e.length&&(n("".concat(window.base_url,"daux_libraries/katex.min.css")),t("".concat(window.base_url,"daux_libraries/katex.min.js"),(function(){[].forEach.call(e,(function(e){var t=e.innerHTML;var n=document.createElement("p");var r=document.createElement("span");n.className="katex-display",n.appendChild(r);var a=e.parentElement;a.parentElement.insertBefore(n,a),a.parentElement.removeChild(a),window.katex.render(t,r,{throwOnError:!1})}))})))})),e((function(){var e=document.querySelectorAll("div.mermaid");e.length&&t("".concat(window.base_url,"daux_libraries/mermaid.min.js"),(function(){window.mermaid.initialize({startOnLoad:!0})}))})),e((function(){var e=document.querySelectorAll(".Nav__item.has-children i.Nav__arrow");for(var t,n=e.length-1;n>=0;n--)t=e[n],t.addEventListener("click",u),t.parentNode.parentNode.classList.contains("Nav__item--open")&&u({target:t});var r=document.querySelectorAll(".Nav__item__link--nopage");var a,o=c(r);try{for(o.s();!(a=o.n()).done;){var i=a.value;i.addEventListener("click",u)}}catch(e){o.e(e)}finally{o.f()}}))})();
//# sourceMappingURL=daux.min.js.map