PageSourceSearch

https://www.therabody.com.au/cdn/shop/t/7/assets/sign-in-prompt-modal.js?v=75618777209720998031778605547

js therabody.com.au collected 2026-10-08 03:24:59 UTC 3,837 bytes, 2 lines download raw bytes

1(function(){const SESSION_KEY="tb-sign-in-prompt-dismissed";function readConfig(){const el=document.getElementById("SignInPromptConfig");if(!el||!el.textContent.trim())return null;try{return JSON.parse(el.textContent)}catch{return null}}function isAuthAccountLandingPath(pathname){const p=(pathname||"").split("?")[0].replace(/\/+$/,"")||"/";return/(^|\/)account\/login$/.test(p)||/(^|\/)account\/register$/.test(p)}function pathExcluded(path,raw){if(!raw||typeof raw!="string")return!1;const normalizedPath=(path||"").replace(/\/+$/,"")||"/",pathVariants=[normalizedPath],localePathMatch=normalizedPath.match(/^\/([a-z]{2}(?:-[a-z]{2})?)(\/.*)?$/i);localePathMatch&&pathVariants.push(localePathMatch[2]||"/");const lines=raw.split(/\r?\n/).map(l=>l.trim()).filter(Boolean);for(const exclusionPath of lines){const prefix=exclusionPath.replace(/\/+$/,"")||"/";for(const candidatePath of pathVariants)if(candidatePath===prefix||prefix!=="/"&&candidatePath.startsWith(prefix+"/"))return!0}return!1}function init(){const modal=document.getElementById("SignInPromptModal"),accountLink=document.getElementById("HeaderAccountIcon");if(!modal||!accountLink||modal.dataset.signInPromptInitialized==="true")return;modal.dataset.signInPromptInitialized="true";const cfg=readConfig()||{},storageKey=cfg.sessionStorageKey||SESSION_KEY,rawExclusions=cfg.excludedPathPrefixesRaw||"",suppressAuthPages=cfg.suppressAutoshowOnAuthPages===!0||isAuthAccountLandingPath(window.location.pathname);if(pathExcluded(window.location.pathname,rawExclusions)){modal.remove(),document.getElementById("SignInPromptConfig")?.remove(),accountLink.classList.remove("header__icon--account-prompt");return}function isDismissedNow(){try{return sessionStorage.getItem(storageKey)==="1"}catch{return!1}}function persistDismissal(){try{sessionStorage.setItem(storageKey,"1")}catch{}}function showModal(opener){modal.openedBy=opener,modal.setAttribute("open",""),modal.setAttribute("aria-hidden","false")}function hideModal(restoreFocus){modal.removeAttribute("open"),modal.setAttribute("aria-hidden","true"),restoreFocus&&modal.openedBy&&modal.openedBy.focus()}function dismissModal(){persistDismissal(),hideModal(!0)}const desktopMq=window.matchMedia(`(min-width: ${typeof cfg.desktopMinWidth=="number"?cfg.desktopMinWidth:parseInt(cfg.desktopMinWidth||"1200",10)||1200}px)`);function applyViewportModalDefault(){if(isDismissedNow()||suppressAuthPages){hideModal(!1);return}const accountEl=modal.openedBy||document.getElementById("HeaderAccountIcon")||accountLink;desktopMq.matches?(modal.openedBy=accountEl||accountLink,modal.setAttribute("open",""),modal.setAttribute("aria-hidden","false")):hideModal(!1)}modal.show=showModal,modal.hide=function(){dismissModal()};function openModal(opener){modal.show(opener||accountLink)}document.addEventListener("click",e=>{if(e.target.closest("#ModalClose-sign-in-prompt")){e.preventDefault(),e.stopPropagation(),dismissModal();return}modal.hasAttribute("open")&&(e.target.closest("#SignInPromptModal")||e.target.closest("#HeaderAccountIcon")||dismissModal())},!0),document.addEventListener("keyup",e=>{e.key==="Escape"&&modal.hasAttribute("open")&&dismissModal()}),accountLink.addEventListener("click",e=>{accountLink.getAttribute("data-customer-logged-in")!=="true"&&(isAuthAccountLandingPath(window.location.pathname)||(e.preventDefault(),openModal(accountLink)))});const onDesktopMqChange=()=>applyViewportModalDefault();typeof desktopMq.addEventListener=="function"?desktopMq.addEventListener("change",onDesktopMqChange):typeof desktopMq.addListener=="function"&&desktopMq.addListener(onDesktopMqChange),applyViewportModalDefault()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init()})();
2//# sourceMappingURL=/cdn/shop/t/7/assets/sign-in-prompt-modal.js.map?v=75618777209720998031778605547

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.