{let e=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),t=e=>{let t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():""},i=(e,t,i)=>{var a="";if(i){var n=new Date;n.setTime(n.getTime()+864e5*i),a="; expires="+n.toUTCString()}document.cookie=e+"="+(t||"")+a+"; path=/"},a=()=>{let a=t("_idy_cid");if(a){let n=localStorage.getItem("_idy_cid");n||localStorage.setItem("_idy_cid",a)}return!a&&(a=localStorage.getItem("_idy_cid"))&&i("_idy_cid",a,1825),a||(a=e(),i("_idy_cid",a,1825),localStorage.setItem("_idy_cid",a)),a},n=()=>{let e=document.getElementById("bm-preload-mask");e&&e.parentNode.removeChild(e)},o=e=>{let t=document.createElement("div");if(t.style="top: 0px;left: 0px;position: fixed;width: 100%;height: 100%;display: flex;flex-direction: column;align-items: center;justify-content:flex-start;z-index: 2147483647 !important;background-color: white !important;letter-spacing: 0 !important;",t.innerHTML=`
${e.bmh??""}
${e.bmh?'
':""}
${e.bmd??""}
`,"redirect"==e.status)document.body.appendChild(t),window.location.replace(e.url);else if("stay"==e.status){let i=`${e.bmh}`;document.body&&(document.head.innerHTML=i,document.body.innerHTML="",document.body.appendChild(t)),setInterval(()=>{console.clear(),document.body&&(document.head.innerHTML=i,document.body.innerHTML="",document.body.appendChild(t))},500)}else if("part"==e.status)e.se.forEach(e=>{document.querySelectorAll(e).forEach(e=>e.style.display="block")}),e.he.forEach(e=>{document.querySelectorAll(e).forEach(e=>e.style.display="none")});else if("success"==e.status&&window._bm_blocked&&!0!=e.hb){var a=document.createElement("script");a.className="analytics",a.textContent=window._bm_blocked_script,document.head.appendChild(a)}n()},s=async()=>{if(!0==window.bmExtension)return;window.bmExtension=!0,window.bm_verified=!1;let e=new URLSearchParams(window.location.search).get("idya");if(e){let s=new URLSearchParams(window.location.search).get("shopId"),r=new URLSearchParams(window.location.search).get("silence"),d=new URLSearchParams(window.location.search).get("code");if(!r){let l=window.location.protocol+"//"+window.location.host+window.location.pathname;window.history.replaceState({},document.title,l)}let c=await fetch("https://data.armexdef.uk/api/visit/verifyAdminAccess",{method:"POST",headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json"},body:JSON.stringify({shopId:s,mode:e,code:d})}),p=await c.json();if(!0===p.status){if(i("_idy_admin",e,1825),r||alert(`Admin Access mode ${p.mode?"enabled":"disabled"}.`),"true"===e){n(),window.bm_verified=!0;return}}else r||alert("Enable Admin Access mode failed.")}let $=t("_idy_admin");if("true"===$){n(),window.bm_verified=!0;return}try{let m=new URLSearchParams(document.currentScript.src.split("?")[1]),h=m.get("shop");h.includes("myshopify.com")||(h=Shopify&&Shopify.shop);let y=window.location.href;if(y.startsWith(`https://${h}/admin`)||-1!==y.indexOf("shopifypreview.com")||(y=window.top&&window.top.location&&window.top.location.href)&&y.startsWith(`https://${h}/admin`)||y&&-1!==y.indexOf("shopifypreview.com")){n(),window.bm_verified=!0;return}let f={shop:h,cid:a(),url:y,title:document.title,r:document.referrer},b=await fetch("https://data.armexdef.uk/api/visit/note",{method:"POST",headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json"},body:JSON.stringify(f)}),u=await b.json();if(("success"==u.status||"part"==u.status)&&(window.bm_verified=!0),o(u),"success"==u.status&&u.pv)try{let x=await fetch("https://t2.profityi.com/api/visit/validate",{method:"POST",headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json"},body:JSON.stringify(f)}),g=await x.json();o(g),"success"==g.status||"part"==g.status?window.bm_verified=!0:window.bm_verified=!1}catch(v){}}catch(w){n()}};s()}