1const i=['[data-testid="not-logged-in-login-link"]',".c7-user-nav__account__login",'a[href*="/profile/login"]'].join(", ");function n(t){if(!t||!t.firstElementChild)return null;if(t.querySelector(i))return!1;const e=(t.textContent||"").trim();return/^log\s*in$/i.test(e)?!1:/^hello\b/i.test(e)||/\blog\s*out\b/i.test(e)}function s(){return{loggedIn:!1,resolved:!1,observer:null,fallbackTimer:null,accountEl:null,syncLoginState:null,init(){if(this.accountEl=document.getElementById("c7-account"),!this.accountEl){this.resolved=!0;return}this.syncLoginState=()=>{const t=n(this.accountEl);t!==null&&(this.loggedIn=t,this.resolved=!0,this.fallbackTimer&&(window.clearTimeout(this.fallbackTimer),this.fallbackTimer=null))},this.observer=new MutationObserver(this.syncLoginState),this.observer.observe(this.accountEl,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),window.addEventListener("c7:user:login",this.syncLoginState),window.addEventListener("c7:user:logout",this.syncLoginState),this.syncLoginState(),this.fallbackTimer=window.setTimeout(()=>{this.resolved=!0},5e3)},destroy(){var t;(t=this.observer)==null||t.disconnect(),this.fallbackTimer&&window.clearTimeout(this.fallbackTimer),this.syncLoginState&&(window.removeEventListener("c7:user:login",this.syncLoginState),window.removeEventListener("c7:user:logout",this.syncLoginState))}}}export{n as g,s as p};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.