UNPKG

@mlikiowa/nanaeo

Version:
3 lines (2 loc) 30.7 kB
"use strict";function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _regenerator(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function i(n,o,r,i){var s=o&&o.prototype instanceof l?o:l,c=Object.create(s.prototype);return _regeneratorDefine2(c,"_invoke",function(n,o,r){var i,l,s,c=0,u=r||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return i=t,l=0,s=e,f.n=n,a}};function m(n,o){for(l=n,s=o,t=0;!d&&c&&!r&&t<u.length;t++){var r,i=u[t],m=f.p,v=i[2];n>3?(r=v===o)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=m&&((r=n<2&&m<i[1])?(l=0,f.v=o,f.n=i[1]):m<v&&(r=n<3||i[0]>o||o>v)&&(i[4]=n,i[5]=o,f.n=v,l=0))}if(r||n>1)return a;throw d=!0,o}return function(r,u,v){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,v),l=u,s=v;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(f.n=-1),m(l,s)):f.n=s:f.v=s);try{if(c=2,i){if(l||(r="next"),t=i[r]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i["return"])&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),l=1);i=e}else if((t=(d=f.n<0)?s:n.call(o,f))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,r,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][o]?t(t([][o]())):(_regeneratorDefine2(t={},o,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,_regeneratorDefine2(e,r,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,_regeneratorDefine2(d,"constructor",c),_regeneratorDefine2(c,"constructor",s),s.displayName="GeneratorFunction",_regeneratorDefine2(c,r,"GeneratorFunction"),_regeneratorDefine2(d),_regeneratorDefine2(d,r,"Generator"),_regeneratorDefine2(d,o,function(){return this}),_regeneratorDefine2(d,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:i,m:f}})()}function _regeneratorDefine2(e,t,n,o){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}_regeneratorDefine2=function(e,t,n,o){function i(t,n){_regeneratorDefine2(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},_regeneratorDefine2(e,t,n,o)}function asyncGeneratorStep(e,t,n,o,r,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(o,r)}function _asyncToGenerator(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var i=e.apply(t,n);function a(e){asyncGeneratorStep(i,o,r,a,l,"next",e)}function l(e){asyncGeneratorStep(i,o,r,a,l,"throw",e)}a(void 0)})}}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=i.call(n)).done)&&(l.push(o.value),l.length!==t);s=!0);}catch(e){c=!0,r=e}finally{try{if(!s&&null!=n["return"]&&(a=n["return"](),Object(a)!==a))return}finally{if(c)throw r}}return l}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _createForOfIteratorHelper(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}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 i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(l)throw i}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}document.addEventListener("DOMContentLoaded",function(){volantis.requestAnimationFrame(function(){VolantisApp.init(),VolantisApp.subscribe(),VolantisFancyBox.init(),highlightKeyWords.startFromURL(),locationHash(),volantis.pjax.push(function(){VolantisApp.pjaxReload(),VolantisFancyBox.init(),sessionStorage.setItem("domTitle",document.title),highlightKeyWords.startFromURL()},"app.js"),volantis.pjax.send(function(){volantis.dom.switcher.removeClass("active"),volantis.dom.header.removeClass("z_search-open"),volantis.dom.wrapper.removeClass("sub"),volantis.EventListener.remove()},"app.js")})});var locationHash=function(){if(window.location.hash){var e=decodeURI(window.location.hash.split("#")[1]).replace(/\ /g,"-"),t=document.getElementById(e);t&&setTimeout(function(){window.location.hash.startsWith("#fn")?volantis.scroll.to(t,{addTop:-volantis.dom.header.offsetHeight-5,behavior:"instant",observer:!0}):volantis.scroll.to(t,{addTop:5,behavior:"instant",observer:!0})},1e3)}};Object.freeze(locationHash);var VolantisApp=function(){var e={},t=80;e.init=function(){volantis.dom.header&&(t=volantis.dom.header.clientHeight+16),window.onresize=function(){document.documentElement.clientWidth<500?volantis.isMobile=1:volantis.isMobile=0,volantis.isMobile!=volantis.isMobileOld&&(e.setGlobalHeaderMenuEvent(),e.setHeader(),e.setHeaderSearch())},volantis.scroll.push(e.scrollEventCallBack,"scrollEventCallBack")},e.event=function(){var t;null===(t=volantis.dom.$(document.getElementById("scroll-down")))||void 0===t||t.on("click",function(){e.scrolltoElement(volantis.dom.bodyAnchor)});var n=document.querySelector("#l_side");n&&(n.querySelectorAll("section").length||document.querySelector("#l_main").classList.add("no_sidebar"));if(volantis.GLOBAL_CONFIG.sidebar.for_page.includes("webinfo")||volantis.GLOBAL_CONFIG.sidebar.for_post.includes("webinfo")){var o=volantis.GLOBAL_CONFIG.sidebar.webinfo.lastupd;document.getElementById("last-update-show")&&o.enable&&o.friendlyShow&&(document.getElementById("last-update-show").innerHTML=e.utilTimeAgo(volantis.GLOBAL_CONFIG.lastupdate))}if(document.getElementById("webinfo-runtime-count")){var r=new Date(volantis.GLOBAL_CONFIG.sidebar.webinfo.runtime.data),i=(new Date).getTime()-r.getTime(),a=Math.floor(i/864e5);document.getElementById("webinfo-runtime-count").innerHTML="".concat(a," ").concat(volantis.GLOBAL_CONFIG.sidebar.webinfo.runtime.unit)}document.body.oncopy=function(){e.messageCopyright()}},e.restData=function(){t=volantis.dom.header?volantis.dom.header.clientHeight+16:80},e.setIsMobile=function(){document.documentElement.clientWidth<500?(volantis.isMobile=1,volantis.isMobileOld=1):(volantis.isMobile=0,volantis.isMobileOld=0)},e.scrolltoElement=function(e){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;volantis.scroll.to(e,{top:e.offsetTop-n})},e.scrollEventCallBack=function(){var e=volantis.dom.bodyAnchor.offsetTop-t,n=volantis.scroll.getScrollTop();volantis.dom.topBtn&&(n>volantis.dom.bodyAnchor.offsetTop?(volantis.dom.topBtn.addClass("show"),volantis.scroll.del>0?volantis.dom.topBtn.removeClass("hl"):volantis.dom.topBtn.addClass("hl")):volantis.dom.topBtn.removeClass("show").removeClass("hl")),volantis.dom.header&&(n-e>-1?volantis.dom.header.addClass("show"):volantis.dom.header.removeClass("show")),pdata.ispage&&volantis.dom.wrapper&&(volantis.scroll.del>0&&n>100?volantis.dom.wrapper.addClass("sub"):volantis.scroll.del<0&&volantis.dom.wrapper.removeClass("sub")),volantis.isMobile&&(pdata.ispage&&volantis.dom.tocTarget&&volantis.dom.toc&&(volantis.dom.tocTarget.removeClass("active"),volantis.dom.toc.removeClass("active")),volantis.dom.mPhoneList&&volantis.dom.mPhoneList.forEach(function(e){volantis.dom.$(e).hide()}))},e.setScrollAnchor=function(){volantis.dom.topBtn&&volantis.dom.bodyAnchor&&volantis.dom.topBtn.click(function(t){t.preventDefault(),t.stopPropagation(),e.scrolltoElement(volantis.dom.bodyAnchor),t.stopImmediatePropagation()})},e.setHeader=function(){pdata.ispage&&(volantis.dom.wrapper.find(".nav-sub .title").html(document.title.split(" - ")[0]),volantis.dom.comment=volantis.dom.$(document.getElementById("s-comment")),volantis.dom.commentTarget=volantis.dom.$(document.querySelector("#l_main article#comments")),volantis.dom.commentTarget?volantis.dom.comment.click(function(t){t.preventDefault(),t.stopPropagation(),e.scrolltoElement(volantis.dom.commentTarget),t.stopImmediatePropagation()}):volantis.dom.comment.style.display="none",volantis.isMobile&&(volantis.dom.toc=volantis.dom.$(document.getElementById("s-toc")),volantis.dom.tocTarget=volantis.dom.$(document.querySelector("#l_side .toc-wrapper")),volantis.dom.tocTarget?(volantis.dom.toc.click(function(e){e.stopPropagation(),volantis.dom.tocTarget.toggleClass("active"),volantis.dom.toc.toggleClass("active")}),volantis.dom.$(document).click(function(e){e.stopPropagation(),volantis.dom.tocTarget&&volantis.dom.tocTarget.removeClass("active"),volantis.dom.toc.removeClass("active")})):volantis.dom.toc.style.display="none"))},e.setHeaderMenuSelection=function(){volantis.dom.headerMenu=volantis.dom.$(document.querySelectorAll("#l_header .navigation,#l_cover .navigation,#l_side .navigation")),volantis.dom.headerMenu.forEach(function(e){var t=volantis.dom.$(e).find("li a.active");t&&t.removeClass("active");var n=volantis.dom.$(e).find("div a.active");n&&n.removeClass("active")});var e=location.pathname.replace(/\/|%|\./g,"");0==e.length&&(e="home");var t=e.match(/page\d{0,}$/g);t&&(t=t[0],e=e.split(t)[0]);var n=e.match(/index.html/);n&&(n=n[0],e=e.split(n)[0]),(e=e.replace(/(\[|\]|~|#|@)/g,"\\$1"))&&volantis.dom.headerMenu&&volantis.dom.headerMenu.forEach(function(t){var n=t.querySelector("[active-action=action-"+e+"]");n&&volantis.dom.$(n).addClass("active")})},e.setGlobalHeaderMenuEvent=function(){volantis.isMobile?document.querySelectorAll("#l_header .m-phone li").forEach(function(e){e.querySelector(".list-v")&&volantis.dom.$(e).click(function(e){e.stopPropagation();var t="";if(Array.from(e.currentTarget.children).some(function(e){e.classList.contains("s-menu")?t="menu":e.classList.contains("menuitem")&&(t="item")}),"item"===t){e.currentTarget.parentElement.childNodes.forEach(function(e){"[object HTMLLIElement]"==Object.prototype.toString.call(e)&&e.childNodes.forEach(function(e){"[object HTMLUListElement]"==Object.prototype.toString.call(e)&&volantis.dom.$(e).hide()})});for(var n=e.currentTarget.children,o=0;o<n.length;o++){var r=n[o];"menu"===volantis.dom.$(r).title?volantis.dom.$(r).style.display="flex":volantis.dom.$(r).show()}}else{var i=document.querySelector(".switcher .menu-phone");"none"===window.getComputedStyle(i).display?volantis.dom.$(i).show():(volantis.dom.$(i).hide(),document.querySelector(".switcher .menu-phone").childNodes.forEach(function(e){"[object HTMLLIElement]"==Object.prototype.toString.call(e)&&e.childNodes.forEach(function(e){"[object HTMLUListElement]"==Object.prototype.toString.call(e)&&volantis.dom.$(e).hide()})}))}},0)}):document.querySelectorAll("#wrapper .m-pc li > a[href]").forEach(function(e){volantis.dom.$(e.parentElement).click(function(e){e.stopPropagation(),e.target.origin==e.target.baseURI&&document.querySelectorAll("#wrapper .m-pc .list-v").forEach(function(e){volantis.dom.$(e).hide()})},0)}),e.setPageHeaderMenuEvent()},e.setPageHeaderMenuEvent=function(){volantis.isMobile&&volantis.dom.$(document).click(function(e){volantis.dom.mPhoneList.forEach(function(e){volantis.dom.$(e).hide()})})},e.setHeaderSearch=function(){volantis.isMobile&&volantis.dom.switcher&&(volantis.dom.switcher.click(function(e){e.stopPropagation(),volantis.dom.header.toggleClass("z_search-open"),volantis.dom.switcher.toggleClass("active")},!1),volantis.dom.$(document).click(function(e){volantis.dom.header.removeClass("z_search-open"),volantis.dom.switcher.removeClass("active")},!1),volantis.dom.search.click(function(e){e.stopPropagation()},!1))},e.setTabs=function(){var e=document.querySelectorAll("#l_main .tabs .nav-tabs");e&&e.forEach(function(e){e.querySelectorAll("a").forEach(function(e){volantis.dom.$(e).on("click",function(e){e.preventDefault(),e.stopPropagation();var t=volantis.dom.$(e.target.parentElement.parentElement.parentElement);return t.find(".nav-tabs .active").removeClass("active"),volantis.dom.$(e.target.parentElement).addClass("active"),t.find(".tab-content .active").removeClass("active"),t.find(e.target.className).addClass("active"),!1})})})},e.footnotes=function(){var e=document.querySelectorAll("#l_main .footnote-backref, #l_main .footnote-ref > a");e.forEach(function(t,n){e[n].click=function(){},volantis.dom.$(t).on("click",function(e){e.stopPropagation(),e.preventDefault();var t=decodeURI(e.target.hash.split("#")[1]).replace(/\ /g,"-"),n=document.getElementById(t);n&&volantis.scroll.to(n,{addTop:-volantis.dom.header.offsetHeight-5,behavior:"instant"})})})},e.utilCopyCode=function(t){document.querySelectorAll(t).forEach(function(t){t.insertAdjacentHTML("beforebegin",'<button class="btn-copy" data-clipboard-snippet=""><i class="fa-solid fa-copy"></i><span>COPY</span></button>');var n=t.previousSibling;n.onclick=function(o){o.stopPropagation();var r=n.querySelector("i"),i=n.querySelector("span");t.focus();var a=new Range;a.selectNodeContents(t),document.getSelection().removeAllRanges(),document.getSelection().addRange(a);var l=document.getSelection().toString();e.utilWriteClipText(l).then(function(){e.messageCopyright(),n.classList.add("copied"),r.classList.remove("fa-copy"),r.classList.add("fa-check-circle"),i.innerText="COPIED",setTimeout(function(){r.classList.remove("fa-check-circle"),r.classList.add("fa-copy"),i.innerText="COPY"},2e3)})["catch"](function(e){VolantisApp.message("系统提示",e,{icon:"fa fa-exclamation-circle red"}),n.classList.add("copied-failed"),r.classList.remove("fa-copy"),r.classList.add("fa-exclamation-circle"),i.innerText="COPY FAILED",setTimeout(function(){r.classList.remove("fa-exclamation-circle"),r.classList.add("fa-copy"),i.innerText="COPY"})})}})},e.utilWriteClipText=function(e){return navigator.clipboard.writeText(e).then(function(){return Promise.resolve()})["catch"](function(t){var n=document.createElement("textarea");n.setAttribute("readonly","readonly"),document.body.appendChild(n),n.innerHTML=e,n.select();try{var o=document.execCommand("copy");return document.body.removeChild(n),o&&"unsuccessful"!==o?Promise.resolve():Promise.reject("复制文本失败!")}catch(t){return document.body.removeChild(n),Promise.reject("当前浏览器不支持复制功能,请检查更新或更换其他浏览器操作!")}})},e.utilTimeAgo=function(e){var t=6e4,n=36e5,o=24*n,r=7*o,i=30*o,a=(new Date).getTime()-e,l=a/t,s=a/n,c=a/o,u=a/r,d=a/i;if(a<0)result="";else if(d>=1&&d<7)result=" "+parseInt(d)+" 月前";else if(u>=1&&u<4)result=" "+parseInt(u)+" 周前";else if(c>=1&&c<7)result=" "+parseInt(c)+" 天前";else if(s>=1&&s<24)result=" "+parseInt(s)+" 小时前";else if(l>=1&&l<60)result=" "+parseInt(l)+" 分钟前";else if(a>=0&&a<=t)result="刚刚";else{var f=new Date;f.setTime(e);var m=f.getFullYear(),v=f.getMonth()+1<10?"0"+(f.getMonth()+1):f.getMonth()+1,g=f.getDate()<10?"0"+f.getDate():f.getDate();f.getHours()<10?f.getHours():f.getHours(),f.getMinutes()<10?f.getMinutes():f.getMinutes(),f.getSeconds()<10?f.getSeconds():f.getSeconds();result=m+"-"+v+"-"+g}return result},e.message=function(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},o=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;function r(e,t,n,o){var r=n.icon,i=n.time,a=n.position,l=n.transitionIn,s=n.transitionOut,c=n.messageColor,u=n.titleColor,d=n.backgroundColor,f=n.zindex,m=n.displayMode;iziToast.show(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({layout:"2",icon:"Fontawesome",closeOnEscape:"true",displayMode:m||"replace",transitionIn:l||volantis.GLOBAL_CONFIG.plugins.message.transitionIn,transitionOut:s||volantis.GLOBAL_CONFIG.plugins.message.transitionOut,messageColor:c||volantis.GLOBAL_CONFIG.plugins.message.messageColor,titleColor:u||volantis.GLOBAL_CONFIG.plugins.message.titleColor,backgroundColor:d||volantis.GLOBAL_CONFIG.plugins.message.backgroundColor,zindex:f||volantis.GLOBAL_CONFIG.plugins.message.zindex},"icon",r||volantis.GLOBAL_CONFIG.plugins.message.icon["default"]),"timeout",i||volantis.GLOBAL_CONFIG.plugins.message.time["default"]),"position",a||volantis.GLOBAL_CONFIG.plugins.message.position),"title",e),"message",t),"onClosed",function(){o&&o()}))}"undefined"==typeof iziToast?(volantis.css(volantis.GLOBAL_CONFIG.plugins.message.css),volantis.js(volantis.GLOBAL_CONFIG.plugins.message.js,function(){r(e,t,n,o)})):r(e,t,n,o)},e.question=function(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},o=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null,r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null,i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:null;function a(e,t,n,o,r,i){var a=n.icon,l=n.time,s=(n.position,n.transitionIn,n.transitionOut),c=n.messageColor,u=n.titleColor,d=n.backgroundColor,f=n.zindex;iziToast.question(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({id:"question",icon:"Fontawesome",close:!1,overlay:!0,displayMode:"once",position:"center",messageColor:c||volantis.GLOBAL_CONFIG.plugins.message.messageColor,titleColor:u||volantis.GLOBAL_CONFIG.plugins.message.titleColor,backgroundColor:d||volantis.GLOBAL_CONFIG.plugins.message.backgroundColor,zindex:f||volantis.GLOBAL_CONFIG.plugins.message.zindex},"icon",a||volantis.GLOBAL_CONFIG.plugins.message.icon.quection),"timeout",l||volantis.GLOBAL_CONFIG.plugins.message.time.quection),"title",e),"message",t),"buttons",[["<button><b>是</b></button>",function(e,t){e.hide({transitionOut:s||"fadeOut"},t,"button"),o&&o(e,t)}],["<button><b>否</b></button>",function(e,t){e.hide({transitionOut:s||"fadeOut"},t,"button"),r&&r(e,t)}]]),"onClosed",function(e,t,n){i&&i(e,t,n)}))}"undefined"==typeof iziToast?(volantis.css(volantis.GLOBAL_CONFIG.plugins.message.css),volantis.js(volantis.GLOBAL_CONFIG.plugins.message.js,function(){a(e,t,n,o,r,i)})):a(e,t,n,o,r,i)},e.hideMessage=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null,t=document.querySelector(".iziToast");function n(e){iziToast.hide({},t),e&&e()}t?"undefined"==typeof iziToast?(volantis.css(volantis.GLOBAL_CONFIG.plugins.message.css),volantis.js(volantis.GLOBAL_CONFIG.plugins.message.js,function(){n(e)})):n(e):e&&e()};var n=0;return e.messageCopyright=function(){volantis.GLOBAL_CONFIG.plugins.message.enable&&volantis.GLOBAL_CONFIG.plugins.message.copyright.enable&&n<1&&(n++,VolantisApp.message(volantis.GLOBAL_CONFIG.plugins.message.copyright.title,volantis.GLOBAL_CONFIG.plugins.message.copyright.message,{icon:volantis.GLOBAL_CONFIG.plugins.message.copyright.icon,transitionIn:"flipInX",transitionOut:"flipOutX",displayMode:1}))},{init:function(){e.init(),e.event()},subscribe:function(){e.setIsMobile(),e.setHeader(),e.setHeaderMenuSelection(),e.setGlobalHeaderMenuEvent(),e.setHeaderSearch(),e.setScrollAnchor(),e.setTabs(),e.footnotes()},pjaxReload:function(){e.event(),e.restData(),e.setHeader(),e.setHeaderMenuSelection(),e.setPageHeaderMenuEvent(),e.setScrollAnchor(),e.setTabs(),e.footnotes(),document.querySelector("#l_header .nav-main").querySelectorAll(".list-v:not(.menu-phone)").forEach(function(e){e.removeAttribute("style")}),document.querySelector("#l_header .menu-phone.list-v").removeAttribute("style"),n=0},utilCopyCode:e.utilCopyCode,utilWriteClipText:e.utilWriteClipText,utilTimeAgo:e.utilTimeAgo,message:e.message,question:e.question,hideMessage:e.hideMessage,messageCopyright:e.messageCopyright,scrolltoElement:e.scrolltoElement}}();Object.freeze(VolantisApp);var VolantisFancyBox=function(){var e={loadFancyBox:function(e){volantis.css(volantis.GLOBAL_CONFIG.plugins.fancybox.css),volantis.js(volantis.GLOBAL_CONFIG.plugins.fancybox.js).then(function(){e&&e()})},init:function(){var t=!(arguments.length>0&&arguments[0]!==undefined)||arguments[0],n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:e.groupBind;!document.querySelector(".md .gallery img, .fancybox")&&t||("undefined"==typeof Fancybox?e.loadFancyBox(n):n())},elementHandling:function(e,t){document.querySelectorAll(e).forEach(function(e){if(!e.hasAttribute("fancybox")){e.setAttribute("fancybox","");var n=document.createElement("a");n.setAttribute("href",e.src),n.setAttribute("data-caption",e.alt),n.setAttribute("data-fancybox",t),n.classList.add("fancybox"),n.append(e.cloneNode()),e.replaceWith(n)}})},bind:function(t){e.init(!1,function(){Fancybox.bind(t,{groupAll:!0,Hash:!1,hideScrollbar:!1,Thumbs:{autoStart:!1},caption:function(e,t,n){return n.$trigger.alt||null}})})},groupBind:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null,t=new Set;document.querySelectorAll(".gallery").forEach(function(e){e.querySelector("img")&&t.add(e.getAttribute("data-group")||"default")}),e&&t.add(e);var n,o=_createForOfIteratorHelper(t);try{for(o.s();!(n=o.n()).done;){var r=n.value;Fancybox.unbind('[data-fancybox="'+r+'"]'),Fancybox.bind('[data-fancybox="'+r+'"]',{Hash:!1,hideScrollbar:!1,Thumbs:{autoStart:!1}})}}catch(i){o.e(i)}finally{o.f()}}};return{init:e.init,bind:e.bind,groupBind:function(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"default";try{e.elementHandling(t,n),e.init(!1,function(){e.groupBind(n)})}catch(o){console.error(o)}}}}();Object.freeze(VolantisFancyBox);var highlightKeyWords=function(){var e={markNum:0,markNextId:-1,startFromURL:function(){var t=decodeURI(new URL(location.href).searchParams.get("keyword")),n=t?t.split(" "):[],o=document.querySelector("#l_main");1==n.length&&"null"==n[0]||(e.start(n,o),e.scrollToFirstHighlightKeywordMark())},scrollToFirstHighlightKeywordMark:function(){volantis.cleanContentVisibility(),e.scrollToNextHighlightKeywordMark("0")||volantis.requestAnimationFrame(e.scrollToFirstHighlightKeywordMark)},scrollToNextHighlightKeywordMark:function(t){var n=t||(e.markNextId+1)%e.markNum;e.markNextId=parseInt(n);var o=document.getElementById("keyword-mark-"+e.markNextId);return o||(e.markNextId=(e.markNextId+1)%e.markNum,o=document.getElementById("keyword-mark-"+e.markNextId)),o&&volantis.scroll.to(o,{addTop:-volantis.dom.header.offsetHeight-5,behavior:"instant"}),o},scrollToPrevHighlightKeywordMark:function(t){var n=t||(e.markNextId-1+e.markNum)%e.markNum;e.markNextId=parseInt(n);var o=document.getElementById("keyword-mark-"+e.markNextId);return o||(e.markNextId=(e.markNextId-1+e.markNum)%e.markNum,o=document.getElementById("keyword-mark-"+e.markNextId)),o&&volantis.scroll.to(o,{addTop:-volantis.dom.header.offsetHeight-5,behavior:"instant"}),o},start:function(t,n){if(e.markNum=0,t.length&&n&&(1!=t.length||"null"!=t[0])){console.log(t);for(var o=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,null),r=[];o.nextNode();)o.currentNode.parentNode.matches("button, select, textarea")||r.push(o.currentNode);r.forEach(function(n){var o=_slicedToArray(e.getIndexByWord(t,n.nodeValue),1)[0];if(o.length){var r=e.mergeIntoSlice(0,n.nodeValue.length,o);e.highlightText(n,r,"keyword"),e.highlightStyle()}})}},getIndexByWord:function(e,t){var n=arguments.length>2&&arguments[2]!==undefined&&arguments[2],o=[],r=new Set;return e.forEach(function(e){var i=document.createElement("div");i.innerText=e;var a=(e=i.innerHTML).length;if(0!==a){var l=0,s=-1;for(n||(t=t.toLowerCase(),e=e.toLowerCase());(s=t.indexOf(e,l))>-1;)o.push({position:s,word:e}),r.add(e),l=s+a}}),o.sort(function(e,t){return e.position!==t.position?e.position-t.position:t.word.length-e.word.length}),[o,r]},mergeIntoSlice:function(e,t,n){for(var o=n[0],r=o,i=r.position,a=r.word,l=[],s=new Set;i+a.length<=t&&0!==n.length;){s.add(a),l.push({position:i,length:a.length});var c=i+a.length;for(n.shift();0!==n.length&&(i=(o=n[0]).position,a=o.word,c>i);)n.shift()}return{hits:l,start:e,end:t,count:s.size}},highlightText:function(t,n,o){var r,i=t.nodeValue,a=n.start,l=[],s=_createForOfIteratorHelper(n.hits);try{for(s.s();!(r=s.n()).done;){var c=r.value,u=c.position,d=c.length,f=document.createTextNode(i.substring(a,u));a=u+d;var m=document.createElement("mark");m.className=o,(m=e.highlightStyle(m)).appendChild(document.createTextNode(i.substr(u,d))),l.push(f,m)}}catch(v){s.e(v)}finally{s.f()}t.nodeValue=i.substring(a,n.end),l.forEach(function(e){t.parentNode.insertBefore(e,t)})},highlightStyle:function(t){if(t)return t.id="keyword-mark-"+e.markNum,e.markNum++,t.style.background="transparent",t.style["border-bottom"]="1px dashed #ff2a2a",t.style.color="#ff2a2a",t.style["font-weight"]="bold",t},cleanHighlightStyle:function(){document.querySelectorAll(".keyword").forEach(function(e){e.style.background="transparent",e.style["border-bottom"]=null,e.style.color=null,e.style["font-weight"]=null})}};return{start:function(t,n){e.start(t,n)},startFromURL:function(){e.startFromURL()},scrollToNextHighlightKeywordMark:function(t){e.scrollToNextHighlightKeywordMark(t)},scrollToPrevHighlightKeywordMark:function(t){e.scrollToPrevHighlightKeywordMark(t)},cleanHighlightStyle:function(){e.cleanHighlightStyle()}}}();Object.freeze(highlightKeyWords);var DOMController={visible:function(e){var t=!(arguments.length>1&&arguments[1]!==undefined)||arguments[1];e&&(e.style.display=!0===t?"block":"none")},remove:function(e){document.querySelectorAll(e).forEach(function(e){e.remove()})},removeList:function(e){e.forEach(function(e){DOMController.remove(e)})},setAttribute:function(e,t,n){document.querySelectorAll(e).forEach(function(e){e.setAttribute(t,n)})},setAttributeList:function(e){e.forEach(function(e){DOMController.setAttribute(e[0],e[1],e[2])})},setStyle:function(e,t,n){document.querySelectorAll(e).forEach(function(e){e.style[t]=n})},setStyleList:function(e){e.forEach(function(e){DOMController.setStyle(e[0],e[1],e[2])})},fadeIn:function(e){if(e)return e.style.visibility="visible",e.style.opacity=1,e.style.display="block",e.style.transition="all 0.5s linear",e},fadeOut:function(e){if(e)return e.style.visibility="hidden",e.style.opacity=0,e.style.display="none",e.style.transition="all 0.5s linear",e},fadeToggle:function(e){if(e)return e="hidden"==e.style.visibility?DOMController.fadeIn(e):DOMController.fadeOut(e)},fadeToggleList:function(e){e.forEach(function(e){DOMController.fadeToggle(e)})},hasClass:function(e,t){if(e)return e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))},addClass:function(e,t){if(e)return e.classList.add(t),e},removeClass:function(e,t){if(e)return e.classList.remove(t),e},toggleClass:function(e,t){if(e)return DOMController.hasClass(e,t)?DOMController.removeClass(e,t):DOMController.addClass(e,t),e},toggleClassList:function(e){e.forEach(function(e){DOMController.toggleClass(e[0],e[1])})}};Object.freeze(DOMController);var VolantisRequest={timeoutFetch:function(e,t,n){var o,r=new AbortController;null===(o=n.signal)||void 0===o||o.addEventListener("abort",function(){return r.abort()});var i=fetch(e,_objectSpread(_objectSpread({},n),{},{signal:r.signal}));if(t>0){var a=setTimeout(function(){return r.abort()},t);i["finally"](function(){clearTimeout(a)})}return i=i["catch"](function(t){throw"AbortError"===(t||{}).name?new Error("Fetch timeout: ".concat(e)):t})},Fetch:function(){var e=_asyncToGenerator(_regenerator().m(function t(e,n){var o,r,i,a=arguments;return _regenerator().w(function(t){for(;;)switch(t.n){case 0:return o=a.length>2&&a[2]!==undefined?a[2]:15e3,t.n=1,VolantisRequest.timeoutFetch(e,o,n);case 1:if((r=t.v).ok){t.n=2;break}throw new Error("Fetch error: ".concat(e," | ").concat(r.status));case 2:return t.n=3,r.json();case 3:if((i=t.v).success){t.n=4;break}throw i;case 4:return t.a(2,i)}},t)}));return function(t,n){return e.apply(this,arguments)}}(),POST:function(){var e=_asyncToGenerator(_regenerator().m(function t(e,n){var o,r,i;return _regenerator().w(function(t){for(;;)switch(t.n){case 0:return o={method:"POST"},n&&(r=new FormData,Object.keys(n).forEach(function(e){return r.append(e,String(n[e]))}),o.body=r),t.n=1,VolantisRequest.Fetch(e,o);case 1:return i=t.v,t.a(2,i.data)}},t)}));return function(t,n){return e.apply(this,arguments)}}(),Get:function(){var e=_asyncToGenerator(_regenerator().m(function t(e,n){return _regenerator().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,VolantisRequest.Fetch(e+(n?"?".concat(new URLSearchParams(n)):""),{method:"GET"});case 1:t.v;case 2:return t.a(2)}},t)}));return function(t,n){return e.apply(this,arguments)}}()};Object.freeze(VolantisRequest); //# sourceMappingURL=../maps/js/app.js.map