!function(e,t){"use strict";const n=e.ArraySubsCheckoutSessionGuard||{},s=n.refreshParam||"arraysubs_checkout_session_refresh",r="arraysubs.checkoutSessionRefresh",a=async()=>{if(!n.ajaxUrl)return;const a=await e.fetch(n.ajaxUrl,{method:"POST",credentials:"same-origin",cache:"no-store",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:new URLSearchParams({action:"arraysubs_checkout_session_state",_:String(Date.now())})});if(!a.ok)return;const o=await a.json();(s=>!!s?.loggedIn&&(!!((()=>{const s=Number(e.wcSettings?.currentUserId||0);return s>0?s:t.body?.classList?.contains("logged-in")?Number(n.currentUserId||0):0})()<=0||(()=>{const e=t.body?.innerText||"";return/\bLog in\b/.test(e)&&e.includes("Contact information")})())||Boolean(t.querySelector('.wc-block-components-spinner, .components-spinner, [aria-busy="true"]')&&!(t.body?.innerText?.includes("Place Order")||t.body?.innerText?.includes("Payment options")))))(o?.success?o.data:o)&&(()=>{const t=new URL(e.location.href);if("1"!==t.searchParams.get(s)&&"1"!==e.sessionStorage?.getItem(r)){try{e.sessionStorage?.setItem(r,"1")}catch(e){}t.searchParams.set(s,"1"),t.searchParams.set("_",String(Date.now())),e.location.replace(t.toString())}})()},o=()=>{a().catch(()=>{}),e.setTimeout(()=>{a().catch(()=>{})},3e3)};"loading"===t.readyState?t.addEventListener("DOMContentLoaded",o):o()}(window,document);