/*! For license information please see page.js.LICENSE.txt */
(globalThis.webpackChunksakurairo_scripts=globalThis.webpackChunksakurairo_scripts||[]).push([[2530],{865:()=>{window.grin=function(e,t,n,o){const a=document.getElementById("comment");if(!a||"textarea"!=a.type)return!1;switch(t){case"custom":e=n+e+o;break;case"Img":e="[img]"+e+"[/img]";break;case"Math":e=" {{"+e+"}} ";break;case"tieba":e=" ::"+e+":: ";break;default:e=" :"+e+": "}if(a.selectionStart||"0"==a.selectionStart){let t=a.selectionStart,n=a.selectionEnd,o=n;a.value=a.value.substring(0,t)+e+a.value.substring(n,a.value.length),o+=e.length,a.focus(),a.selectionStart=o,a.selectionEnd=o}else a.value+=e,a.focus()}},9316:(e,t,n)=>{n(5130),n(5636),n(8509),n(7332),n(6555),n(3296),n(4594);var o=n(4237),a=n(7156),r=n(6564);let s;function i(){!function(){const e=document.getElementsByClassName("collapseButton");if(e.length>0){const t=e=>{(0,a.mf)(e.target.parentNode.parentNode.parentNode.querySelector(".xContent"))};for(const n of e)n.addEventListener("click",t)}}(),async function(){if(_iro.baguetteBoxON){s||(s=(0,o.loadCSS)((0,r.o)("dist/baguetteBox.min.css","baguettebox.js","1.11.1")));const{default:e}=await n.e(6136).then(n.t.bind(n,6136,23));e.run(".entry-content",{captions:function(e){return e.getElementsByTagName("img")[0].alt},ignoreClass:"fancybox"})}else if(_iro.fancybox){if(s||(s=(0,o.loadCSS)((0,r.o)("dist/jquery.fancybox.min.css","@fancyapps/fancybox"))),!(window.jQuery instanceof Function||window.$ instanceof Function))if(_iro.ext_shared_lib)(0,r.J)("dist/jquery.slim.min.js","jquery");else{const{default:e}=await n.e(7569).then(n.t.bind(n,7569,23));window.$=e,window.jQuery=e}_iro.ext_shared_lib?(0,r.J)("dist/jquery.fancybox.min.js","@fancyapps/fancybox"):n.e(7639).then(n.t.bind(n,7639,23))}else if(_iro.lightGallery){const{default:e}=await Promise.all([n.e(2091),n.e(9160)]).then(n.bind(n,2091));e()}}(),async function(){if(document.getElementsByTagName("math").length>0||document.querySelector("article > div.entry-content")?.textContent.match(/(?:\$|\\\(|\\\[|\\begin\{.*?})/)){const e={tex:{inlineMath:[["$","$"],["\\(","\\)"]]},startup:{typeset:!1},chtml:{fontURL:(0,r.o)("es5/output/chtml/fonts/woff-v2","mathjax"),mathmlSpacing:!0}};"MathJax"in window||(window.MathJax=e),await n.e(4247).then(n.t.bind(n,4247,23)),window.MathJax.typesetPromise()}}()}var l=n(2821),c=n(7925),u=(n(865),n(5892)),m=n.n(u);const d=(e,t=80)=>"https://"+_iro.gravatar_url+"/"+m()(e)+".jpg?s="+t+"&d=mm";function g(){let e=!1;const t=document.querySelector("input#author"),n=document.querySelector("input#qq"),o=document.querySelector("input#email"),r=document.querySelector("input#url"),s=document.querySelector(".qq-check"),i=document.querySelector(".gravatar-check"),l=document.querySelector("div.comment-user-avatar img");if(null==t)return;localStorage.getItem("user_qq")||localStorage.getItem("user_qq_email")||localStorage.getItem("user_author")||(n.value=t.value=o.value=r.value=""),localStorage.getItem("user_avatar")&&localStorage.getItem("user_qq")&&localStorage.getItem("user_qq_email")&&(l.setAttribute("src",localStorage.getItem("user_avatar")),t.value=localStorage.getItem("user_author"),o.value=localStorage.getItem("user_qq")+"@qq.com",n.value=localStorage.getItem("user_qq"),_iro.qzone_autocomplete&&(r.value="https://user.qzone.qq.com/"+localStorage.getItem("user_qq")),n.value&&(s.style.display="block",i.style.display="none"));let c=o.value;t.addEventListener("blur",(()=>{const u=t.value;if(/^[1-9]\d{4,9}$/.test(u)){const m=()=>{n.value="",s.style.display="none",i.style.display="block",l.setAttribute("src",d(o.value,80)),localStorage.setItem("user_qq",""),localStorage.setItem("user_email",o.value),localStorage.setItem("user_avatar",d(o.value,80))};fetch((0,a.tG)(_iro.qq_api_url,{qq:u})).then((async a=>{if(a.ok)try{const m=await a.json();t.value=m.name,o.value=u.trim()+"@qq.com",_iro.qzone_autocomplete&&(r.value="https://user.qzone.qq.com/"+u.trim()),l.setAttribute("src","https://q2.qlogo.cn/headimg_dl?dst_uin="+u+"&spec=100"),e=!0,n.value=u.trim(),n.value&&(s.style.display="block",i.style.display="none"),localStorage.setItem("user_author",m.name),localStorage.setItem("user_qq",u),localStorage.setItem("is_user_qq","yes"),localStorage.setItem("user_qq_email",u+"@qq.com"),localStorage.setItem("user_email",u+"@qq.com"),c=o.value,l.setAttribute("src",m.avatar),localStorage.setItem("user_avatar",m.avatar)}catch(e){console.warn(e),m()}else m()}))}})),localStorage.getItem("user_avatar")&&localStorage.getItem("user_email")&&"no"==localStorage.getItem("is_user_qq")&&!localStorage.getItem("user_qq_email")&&(l.setAttribute("src",localStorage.getItem("user_avatar")),o.value=localStorage.getItem("user_mail"),n.value="",n.value||(s.style.display="none",i.style.display="block")),o.addEventListener("blur",(function(){let t=o.value;0!=e&&c==t||""==t||(l.setAttribute("src",d(t,80)),localStorage.setItem("user_avatar",d(t,80)),localStorage.setItem("user_email",t),localStorage.setItem("user_qq_email",""),localStorage.setItem("is_user_qq","no"),n.value="",n.value||(s.style.display="none",i.style.display="block"))})),localStorage.getItem("user_url")&&(r.value=localStorage.getItem("user_url")),r.addEventListener("blur",(function(){let e=r.value;r.value=e,localStorage.setItem("user_url",e)})),localStorage.getItem("user_author")&&(t.value=localStorage.getItem("user_author")),t.addEventListener("blur",(function(){let e=t.value;t.value=e,localStorage.setItem("user_author",e)}))}const f={respondId:"",moveForm:function(e,t,n){const o=document.getElementById(e),a=document.getElementById(n),r=document.getElementById("cancel-comment-reply-link"),s=document.getElementById("comment_parent");if(this.respondId=n,!document.getElementById("wp-temp-form-div")){const e=document.createElement("div");e.id="wp-temp-form-div",e.style.display="none",a.parentNode.insertBefore(e,a)}if(o)o.parentNode.insertBefore(a,o.nextSibling);else{const e=document.getElementById("wp-temp-form-div");document.getElementById("comment_parent").value="0",e.parentNode.insertBefore(a,e),e.remove()}const i=document.getElementById("respond");window.scrollTo({top:i.getBoundingClientRect().top+window.pageYOffset-i.clientTop-100,behavior:"smooth"}),s.value=t,r.style.display="",r.onclick=function(e){const t=f,n=document.getElementById("wp-temp-form-div"),o=document.getElementById(t.respondId);return document.getElementById("comment_parent").value="0",n&&o&&(n.parentNode.insertBefore(o,n),n.remove()),this.style.display="none",this.onclick=null,!1};try{document.getElementById("comment").focus()}catch(e){}return!1}},p=f;var y=n(4351);const h=e=>{const t=e.target;if(t===document.querySelector("#bangumi-pagination a")){if(e.preventDefault(),e.stopPropagation(),t.classList.contains("loading"))return;t.classList.add("loading"),t.textContent="",fetch(t.dataset.href+"&_wpnonce="+_iro.nonce,{method:"POST"}).then((async e=>{const t=await e.json();if(!e.ok)throw Error(`Error,Status:${e.status}`);document.getElementById("bangumi-pagination").remove(),document.querySelector(".row").insertAdjacentHTML("beforeend",t),(0,l.A)()})).catch((e=>{console.error(e),(0,c.I)(e),t.classList.remove("loading"),t.innerHTML=' ERROR '}))}};function v(){const e=document.getElementsByTagName("section");let t=!1;for(let n=0;n{document.querySelector(".emotion-toggle-off").classList.toggle("emotion-hide"),document.querySelector(".emotion-toggle-on").classList.toggle("emotion-show"),document.querySelector(".emotion-box").classList.toggle("emotion-box-show")}));const t=document.querySelector(".emotion-box>table tr");t&&t.addEventListener("click",(e=>{if("TH"===e.target.tagName)for(const n of t.querySelectorAll("th")){const t=document.querySelector(`.${n.className.match(/(\S+)-bar/)[1]}-container`);n===e.target?(n.classList.add("on-hover"),t.style.display="block"):(n.classList.remove("on-hover"),t.style.display="none")}}))}function b(){document.getElementsByClassName("comment_inline_img").length&&document.getElementsByClassName("comments-main")[0].addEventListener("click",(function(e){e.target.classList.contains("comment_inline_img")&&window.open(e.target.src)}))}function w(){document.getElementsByClassName("emoji-item").length&&document.querySelector(".menhera-container").addEventListener("click",(function(e){e.target.classList.contains("emoji-item")&&grin(e.target.innerText,"custom","`","` ")}))}function q(){const e="commentwrap",t=document.getElementById("commentform");if(t){let n=!1;t.addEventListener("submit",(function(t){if(t.stopPropagation(),t.preventDefault(),n)return;const o=(0,c.I)((0,y.__)("提交中...."),!0),a=new FormData(this);a.append("action","ajax_comment"),n=!0,fetch(_iro.ajaxurl,{method:this.attributes.method.value,body:a}).then((async t=>{const n=await t.text();if(t.ok){Array.from(document.getElementsByTagName("textarea")).forEach((e=>e.value=""));const t=document.getElementById("cancel-comment-reply-link"),o=document.getElementById("wp-temp-form-div"),a=document.getElementById(p.respondId);"0"!=document.getElementById("comment_parent").value?document.getElementById("respond").insertAdjacentHTML("beforebegin",''+n+"
"):document.getElementsByClassName(e).length?"asc"==_iro.order?document.getElementsByClassName("commentwrap")[1].insertAdjacentHTML("beforeend",n):document.getElementsByClassName("commentwrap")[1].insertAdjacentHTML("afterbegin",n):"bottom"==_iro.formpostion?document.getElementById("respond").insertAdjacentHTML("beforebegin",''+n+"
"):document.getElementById("respond").insertAdjacentHTML("afterend",''+n+"
"),(0,c.I)((0,y.__)("提交成功")),document.dispatchEvent(new CustomEvent("ajax_comment_complete")),t.style.display="none",t.onclick=null,document.getElementById("comment_parent").value="0",o&&a&&(o.parentNode.insertBefore(a,o),o.remove())}else(0,c.I)(n||"HTTP"+t.status+":"+t.statusText)})).catch((e=>{(0,c.I)(e)})).finally((()=>{o.remove(),n=!1}))}))}}function I(){let e=document.getElementsByClassName("sm"),t=document.querySelector(".comments-main");e.length&&t&&(t.addEventListener("click",(function(e){if(e.target.classList.contains("comment-reply-link")){e.preventDefault(),e.stopPropagation();let t=e.target.getAttribute("data-commentid");p.moveForm("comment-"+t,t,"respond",this.getAttribute("data-postid"))}})),t.addEventListener("click",(e=>{let t=e.target.parentNode;if(t.classList.contains("sm")){let e=(0,y.__)("您真的要设为私密吗?");if(1==confirm(e)){if(t.classList.contains("private_now"))return alert((0,y.__)("您之前已设过私密评论")),!1;{t.classList.add("private_now");let e=t.getAttribute("data-idp"),n=t.getAttribute("data-actionp"),o=t.getElementsByClassName("has_set_private")[0],a="action=siren_private&p_id="+e+"&p_action="+n,r=new XMLHttpRequest;return r.onreadystatechange=function(){4==this.readyState&&200==this.status&&(o.innerHTML=r.responseText)},r.open("POST",_iro.ajaxurl,!0),r.setRequestHeader("Content-type","application/x-www-form-urlencoded"),r.send(a),!1}}}})))}function E(){const e=document.querySelector(".toc-container"),t=document.querySelector(".site-content");if(e&&t){const n=()=>{e.style.height=Math.min(t.getBoundingClientRect().height,document.documentElement.offsetHeight-e.offsetTop)+"px"};n(),window.addEventListener("resize",function(e,t=166){let n;function o(...o){clearTimeout(n),n=setTimeout((()=>{e.apply(this,o)}),t)}return o.clear=()=>{clearTimeout(n)},o}(n),{passive:!0}),document.addEventListener("scroll",function(e,t,n){let o=null,a=Date.parse(new Date);return function(){null!==o&&clearTimeout(o);let r=Date.parse(new Date);r-a>=n?(e(),a=r):o=setTimeout(e,t)}}(n,200,1e3))}}function B(e){if(!(document.body.clientWidth<=1200))if(document.querySelector("div.have-toc")||document.querySelector("div.has-toc")){if(e&&document.getElementsByClassName("toc").length>0){n.e(1726).then(n.bind(n,1726)).then((({default:t})=>{t.init({tocSelector:".toc",contentSelector:[".entry-content",".links"],headingSelector:"h1,h2,h3,h4,h5",headingsOffset:e-window.innerHeight/2,onClick:null})}));const e="sakurairo"==_iro.entry_content_style?document.querySelector("article.type-post")?document.querySelector("div.pattern-attachment")?-75:200:375:window.innerHeight/2,t=document.querySelectorAll(".entry-content,.links"),o=new Set;let a=1;for(let e=0;e