(()=>{(function(){"use strict";let d=0,l=!1,u=100,i=!1,n=document.getElementById("dock"),c=document.getElementById("dock-float-trigger");if(!n)return;let f=n.dataset.dockMode||"scroll";function k(){let t=window.pageYOffset||document.documentElement.scrollTop;switch(tu?a():(!l||t<=u)&&s();break;case"always":a();break;case"float":i&&t>d&&s();break}d=t}function a(){n.classList.remove("translate-y-24","opacity-0","pointer-events-none"),n.classList.add("translate-y-0","opacity-100","pointer-events-auto"),i=!0}function s(){n.classList.remove("translate-y-0","opacity-100","pointer-events-auto"),n.classList.add("translate-y-24","opacity-0","pointer-events-none"),i=!1}function p(){i?s():a()}function y(t,e){let o;return function(){let r=arguments,E=this;o||(t.apply(E,r),o=!0,setTimeout(()=>o=!1,e))}}if(window.addEventListener("scroll",y(k,16)),c&&f==="float"){let t;c.addEventListener("click",function(e){e.preventDefault(),p()}),c.addEventListener("mouseenter",function(){clearTimeout(t),t=setTimeout(()=>{i||a()},150)}),c.addEventListener("mouseleave",function(){clearTimeout(t),setTimeout(()=>{i&&!n.matches(":hover")&&s()},200)}),n.addEventListener("mouseenter",function(){clearTimeout(t)}),n.addEventListener("mouseleave",function(){setTimeout(()=>{i&&!c.matches(":hover")&&s()},200)}),document.addEventListener("click",function(e){i&&!n.contains(e.target)&&!c.contains(e.target)&&s()}),n.addEventListener("click",function(e){e.stopPropagation()})}let w=document.getElementById("dock-back");w&&w.addEventListener("click",function(t){t.preventDefault();try{if(window.history.length>1&&document.referrer){let e=new URL(document.referrer),o=new URL(window.location.href);if(e.origin===o.origin){window.history.back(),console.log("\u8FD4\u56DE\u6309\u94AE\u70B9\u51FB - \u6D4F\u89C8\u5668\u8FD4\u56DE");return}}window.location.href="/",console.log("\u8FD4\u56DE\u6309\u94AE\u70B9\u51FB - \u8DF3\u8F6C\u9996\u9875")}catch(e){console.warn("\u8FD4\u56DE\u529F\u80FD\u51FA\u9519\uFF0C\u8DF3\u8F6C\u5230\u9996\u9875:",e),window.location.href="/"}});let m=document.getElementById("dock-navigation");m&&m.addEventListener("click",function(t){t.preventDefault();function e(o=5){window.Navigation&&window.Navigation.initialized?(window.Search&&window.Search.isVisible&&window.Search.isVisible()&&window.Search.hide(),window.Navigation.toggle()):window.Navigation&&!window.Navigation.initialized&&o>0?setTimeout(()=>e(o-1),200):!window.Navigation&&o>0&&setTimeout(()=>e(o-1),200)}e()});let g=document.getElementById("dock-search");g&&g.addEventListener("click",function(t){t.preventDefault();function e(o=5){window.Search?(window.Navigation&&window.Navigation.initialized&&window.Navigation.isVisible&&window.Navigation.isVisible()&&window.Navigation.hide(),window.Search.isVisible&&window.Search.isVisible()?window.Search.hide():window.Search.show()):o>0&&setTimeout(()=>e(o-1),200)}e()});let h=document.getElementById("dock-comments");h&&h.addEventListener("click",function(t){t.preventDefault();try{let e=["#comments",".comments","#giscus-container",".giscus","#disqus_thread",".disqus","#utterances",".utterances","#waline",".waline","[data-comments]",".comment-section",".post-comments"],o=null;for(let r of e)if(o=document.querySelector(r),o){console.log(`\u627E\u5230\u8BC4\u8BBA\u533A\u57DF: ${r}`);break}o?(o.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),console.log("\u8BC4\u8BBA\u6309\u94AE\u70B9\u51FB - \u6EDA\u52A8\u5230\u8BC4\u8BBA\u533A\u57DF")):(window.scrollTo({top:document.documentElement.scrollHeight,behavior:"smooth"}),console.log("\u8BC4\u8BBA\u6309\u94AE\u70B9\u51FB - \u672A\u627E\u5230\u8BC4\u8BBA\u533A\u57DF\uFF0C\u6EDA\u52A8\u5230\u9875\u9762\u5E95\u90E8"))}catch(e){console.warn("\u6EDA\u52A8\u5230\u8BC4\u8BBA\u533A\u57DF\u5931\u8D25:",e),window.scrollTo({top:document.documentElement.scrollHeight,behavior:"smooth"})}});let v=document.getElementById("dock-top");switch(v&&v.addEventListener("click",function(){window.scrollTo({top:0,behavior:"smooth"})}),f){case"always":a();break;case"float":s(),c&&(c.style.opacity="1");break;default:s();break}(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1")&&console.log("Dock initialized successfully - positioned at perfect center bottom")})();})();