(()=>{var t={774:()=>{$(document).ready((function(){document.body.addEventListener("touchstart",(function(){}),{passive:!0});var t=$(".g-nav"),e=$("meta[property='og:baseurl']").attr("content"),a=$("meta[property='og:lang']").attr("content"),o=$(".g-logo"),n=$(".g-banner").attr("data-theme");if(o.css({background:"url("+e+"/assets/icons/"+n+".svg) no-repeat center","background-size":"100% 100%"}),u("cookieconsent_status")?$(".cookie-tip").removeClass("active"):$(".cookie-tip").addClass("active"),$("#accept-tos").on("click",(function(){p("cookieconsent_status","allow",365),$(".cookie-tip").removeClass("active")})),$("table").wrap("
"),$("#menu-toggle").on("click",(function(e){t.slideToggle(200),$(document).on("click",(function(){t.slideUp(200)})),e.stopPropagation()})),t.on("click",(function(t){t.stopPropagation()})),$(".g-nav li.dropdown").on("click",(function(){$(".g-nav li.dropdown").not($(this)).children("ul.dropdown-menu").removeClass("show"),$(".g-nav li.dropdown").not($(this)).children("a.dropdown-toggle").removeClass("show"),$(this).children("a.dropdown-toggle").toggleClass("show"),$(this).children("ul.dropdown-menu").toggleClass("show")})),$(document).on("click",(function(){$(".g-nav li.dropdown").children("a.dropdown-toggle").removeClass("show"),$(".g-nav li.dropdown").children("ul.dropdown-menu").removeClass("show")})),$(window).width()>695){var s=(c=$(".g-header")).outerHeight(),i=t.find("a"),l=$(document).scrollTop();o=$(".g-logo"),n=$(".g-banner").attr("data-theme"),$(document).scroll((function(){var a=$(this).scrollTop(),r="nav-"+n;a>s?(a>3*s&&c.addClass("headerUp"),c.css({"background-color":"rgba(255, 255, 255, .98)","box-shadow":"0 1px 12px rgba(0, 0, 0, .08)"}),o.css({background:"url("+e+"/assets/icons/"+n+".svg) no-repeat center","background-size":"100% 100%"}),i.addClass("color-f-gray"),t.addClass(r)):(c.removeClass("headerUp"),$("#bttb").removeClass("active"),c.css({"background-color":"transparent","box-shadow":"none"}),o.css({background:"url("+e+"/assets/icons/"+n+".svg) no-repeat center","background-size":"100% 100%"}),i.removeClass("color-f-gray"),t.removeClass(r)),l>a?(c.addClass("headerDown"),c.hasClass("headerUp")&&$("#bttb").addClass("active")):(c.removeClass("headerDown"),$("#bttb").removeClass("active")),l=a}))}else{var c;s=(c=$(".g-header")).outerHeight(),l=$(document).scrollTop(),$(document).scroll((function(){var t=$(this).scrollTop();t<100&&$("#bttb").removeClass("active"),l>t&&l>5?$("#bttb").addClass("active"):$("#bttb").removeClass("active"),l=t}))}function r(){$(".table-of-contents").toggleClass("active"),$("#tools .tool.toc .b1").toggleClass("active"),$("#tools .tool.toc .b2").toggleClass("active"),$(".submenu").removeClass("active"),$("#tools .tool.collection .b1").addClass("active"),$("#tools .tool.collection .b2").removeClass("active")}function d(){$(".submenu").toggleClass("active"),$("#tools .tool.collection .b1").toggleClass("active"),$("#tools .tool.collection .b2").toggleClass("active"),$(".table-of-contents").removeClass("active"),$("#tools .tool.toc .b1").addClass("active"),$("#tools .tool.toc .b2").removeClass("active")}function h(){var t,e,a,o=$("#search_input"),n=$(".search_result");o.focus((function(){$(".icon-search").css("color","#3199DB"),n.show()})),o.keyup((t=this.autoComplete,e=e||120,function(){var o=this,n=arguments;clearTimeout(a),a=setTimeout((function(){t.apply(o,n)}),e)})),$(document).click((function(t){"search_input"!==t.target.id&&"search_result"!==t.target.className&&"search_item"!==t.target.className&&($(".icon-search").css("color","#CAD3DC"),n.hide())}))}function g(){var t=$("article :header"),e=$(".table-of-contents").find("a"),a=$(window).scrollTop();a>0&&$(".g-header").addClass("headerUp");for(var o=0;o0&&DISQUS.reset({reload:!0}),$(".g-nav li.mode .icon").toggleClass("active"),$("#mode-toggle .icon").toggleClass("active"),$(".icon.up.day").toggleClass("active"),$(".icon.up.night").toggleClass("active"),"visible"==$(".table-of-contents").css("visibility")?($(".icon.exit.day").toggleClass("active"),$(".icon.exit.night").toggleClass("active")):($(".icon.list.day").toggleClass("active"),$(".icon.list.night").toggleClass("active"))}$("#tools .tool.toc").bind("click",(function(){r()})),$("#tools .tool.collection").bind("click",(function(){d()})),$(".table-of-contents").on("click",(function(){r()})),$(".submenu").on("click",(function(){d()})),$(".bttb").bind("click",(function(){$("html,body").animate({scrollTop:0},(function(){$("#bttb").removeClass("active")}))})),$(".read-next-item section").each((function(){var t=$(this).height(),e=$(".read-next-item").height();$(this).css("margin-top",(e-t)/2+"px"),$(this).fadeIn()})),$(".read-next-item img").each((function(){!function(t,e){t.width(),e.width();var a=t.height(),o=e.height();if(a0&&1!==n?o+=''+n+"":1===n&&(o+=''+n+"");o+=''+e+"";for(var s=e+1;s<=e+3;s++)s<=t&&(o+=''+s+"");$("#page-link-container").html(o)}(),h.prototype.autoComplete=function(){var t=this.value.toLowerCase();t.length?$(".icon-search").css("color","#3199DB"):$(".icon-search").css("color","#CAD3DC");var a=e+"/assets/search.json";$.getJSON(a).done((function(e){var a="";for(var o in e){var n=e[o],s=n.title,i=n.tags;n.url,""!==t&&(s+i).toLowerCase().indexOf(t)>=0&&(a+=''+n.title+"")}$(".search_result").html(a)}))},new h,"true"===$("#nm-switch").val()&&function(){$("body");var t=(new Date).getHours();""==u("mode")&&(t<=6||t>=18)&&p("mode","night",1)}(),$(".post-content").on("mouseup",(function(t){var e,a=window.getSelection();a.toString().length>=30&&(e=a,e+="\n\n著作权归作者所有。\n商业转载请联系作者获得授权,非商业转载请注明出处。\n原文: "+location.href,$(".post-content").on("copy",(function(t){(window.clipboardData||t.originalEvent.clipboardData).setData("text/plain",e),t.preventDefault()})))})),g(),$(window).bind("scroll",g),"night"==u("mode")?($(".g-nav li.mode .night").addClass("active"),$("#mode-toggle .icon-night").addClass("active"),$("body").addClass("night-mode"),$(".icon.up.night").toggleClass("active"),$(".icon.list.night").toggleClass("active")):($(".g-nav li.mode .day").addClass("active"),$("#mode-toggle .icon-day").addClass("active"),$("body").removeClass("night-mode"),$(".icon.up.day").toggleClass("active"),$(".icon.list.day").toggleClass("active")),$(".g-nav li.mode").click((function(){m()})),$("#mode-toggle").click((function(){m()})),$("pre").each((function(t){var e="codeblock"+(t+1);$(this).attr("id",e);var a=$(this).attr("class").split(" ")[1].substring(9).toUpperCase();if("ERS"==a)if("MERMAID2"==(a=$(this).attr("class").split(" ")[0].substring(9).toUpperCase()))text=$(this).text(),$(this).before(''),$(this).after(''+text+"
");else{$(this).wrap(''),$(this).parent().wrap(''),$(this).addClass("highlight");var o=''+a+'
';$(this).before(o)}else o=''+a+'
',$(this).before(o)})),new ClipboardJS(".btn").on("success",(function(t){t.clearSelection()})),$(".markdown-body .btn").hover((function(){$(this).find(".tooltip.unfinish").addClass("active")}),(function(){$(this).find(".tooltip.unfinish").removeClass("active")})),$(".markdown-body .btn").click((function(){$(this).find(".tooltip.unfinish").removeClass("active");var t=$(this).find(".tooltip.finish");t.addClass("active"),setTimeout((function(){t.removeClass("active")}),500)})),$("summary").click((function(t){var e=$(this).next().children().text();$(".modal .modal-content .container").html(''+e+"
"),mermaid.init(void 0,$(".modal .modal-content .mermaid2")),$(".modal").css("visibility","visible"),$(".modal .modal-content").click((function(t){t.target.classList.contains("close")&&$(".modal").css("visibility","hidden"),t.stopPropagation()})),t.stopPropagation()})),$(document).click((function(){$(".modal").css("visibility","hidden")})),document.addEventListener("error",(function(t){"IMG"==t.target.nodeName&&(t.target.src=e+"/assets/img/placeholder.webp")}),!0);var v=$(".alivetime_days"),f=$(".alivetime_hours"),b=$(".alivetime_minutes"),y=$(".alivetime_seconds");if(function t(){var e=$("meta[name='alivestart']").attr("content");window.setTimeout(t,1e3),BirthDay=new Date(e),today=new Date,timeold=today.getTime()-BirthDay.getTime(),secondsold=Math.floor(timeold/1e3),e_daysold=timeold/864e5,daysold=Math.floor(e_daysold),e_hrsold=24*(e_daysold-daysold),hrsold=Math.floor(e_hrsold),e_minsold=60*(e_hrsold-hrsold),minsold=Math.floor(e_minsold),seconds=Math.floor(60*(e_minsold-minsold)),v.html(daysold),f.html(hrsold),b.html(minsold),y.html(seconds)}(),today=new Date,year=today.getFullYear(),month=today.getMonth()+1,day=today.getDate(),endDay=year+"-"+("0"+month).slice(-2)+"-"+("0"+day).slice(-2),locales={"zh-Hans":"zh","zh-Hant":"zh-tw",en:"en",ja:"ja"},$("#cal-heatmap").length>0){const t=new CalHeatmap;axios.get(e+"/stats.json").then((e=>{stats_data=e.data,t.paint({itemSelector:"#cal-heatmap",domain:{type:"month",gutter:5,label:{text:"MMM",textAlign:"start",position:"top"}},subDomain:{type:"ghDay",gutter:5,width:13,height:13,radius:3,label:null},date:{start:new Date(dayjs(endDay).subtract(2,"month")),max:new Date(endDay),highlight:[new Date(endDay)],locale:locales[a]},range:3,data:{source:stats_data.calendar,x:"date",y:"count"},scale:{color:{type:"threshold",range:["#9be9a8","#40c463","#30a14e","#216e39"],domain:[4,6,8]}}},[[Tooltip,{text:function(t,e,a){return 1==e?e+" contribution on "+a.format("YYYY-MM-DD"):(e?e+" contributions":"No contribution")+" on "+a.format("YYYY-MM-DD")}}],[LegendLite,{includeBlank:!0,itemSelector:"#ex-ghDay-legend",radius:3,width:10,height:10,gutter:2}],[CalendarLabel,{width:30,textAlign:"start",text:()=>dayjs.weekdaysShort().map(((t,e)=>e%2==0?"":t)),padding:[25,0,0,0]}]]),$("#ex-ghDay-prev").on("click",(function(e){e.preventDefault(),t.previous()})),$("#ex-ghDay-next").on("click",(function(e){e.preventDefault(),t.next()})),$("#ex-ghDay-today").on("click",(function(e){e.preventDefault(),t.jumpTo(new Date(endDay))}))}))}if($("#archive-heatmap").length>0){postWidth=$(".post-content").width(),postWidth>=633?month=12:postWidth>=400?month=8:postWidth>=300?month=6:month=3;const t=new CalHeatmap;axios.get(e+"/stats.json").then((e=>{stats_data=e.data,t.paint({itemSelector:"#archive-heatmap",domain:{type:"month",gutter:2,label:{text:"MMM",textAlign:"start",position:"top"}},subDomain:{type:"ghDay",gutter:2,width:9,height:9,radius:2},date:{start:new Date(dayjs(endDay).subtract(month-1,"month")),max:new Date(endDay),highlight:[new Date(endDay)],locale:locales[a]},range:month,data:{source:stats_data.calendar,x:"date",y:"count"},scale:{color:{type:"threshold",range:["#9be9a8","#40c463","#30a14e","#216e39"],domain:[4,6,8]}}},[[Tooltip,{text:function(t,e,a){return 1==e?e+" contribution on "+a.format("YYYY-MM-DD"):(e?e+" contributions":"No contribution")+" on "+a.format("YYYY-MM-DD")}}],[LegendLite,{includeBlank:!0,itemSelector:"#ex-ghDay-legend2",radius:3,width:10,height:10,gutter:2}],[CalendarLabel,{width:30,textAlign:"start",text:()=>dayjs.weekdaysShort().map(((t,e)=>e%2==0?"":t)),padding:[25,0,0,0]}]]),$("#ex-ghDay-prev2").on("click",(function(e){e.preventDefault(),t.previous()})),$("#ex-ghDay-next2").on("click",(function(e){e.preventDefault(),t.next()})),$("#ex-ghDay-today2").on("click",(function(e){e.preventDefault(),t.jumpTo(new Date(endDay))}))}))}}))}},e={};function a(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,a),s.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var o in e)a.o(e,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";a(774)})()})();