(function(){"use strict";async function c(t,r){try{r.searchParams.set("payload",t);const e=await fetch(r.toString(),{credentials:"include"});return e.ok?await e.json():Promise.reject(Error(e.statusText))}catch{throw new Error("Network error occurred!")}}function i(t){const r=new TextEncoder().encode(t);return btoa(Array.from(new Uint8Array(r),e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function s(t,r){let e=!1;return r.forEach(h=>{t.searchParams.has(h)&&(e=!0)}),e}function f(){return["cjevent","transaction_id","offer_id","utm_source","utm_medium","utm_campaign","a_aid","a_bid","a_cid","chan","data1","data2","visitorId"]}function o(t){return["www.","prod."].some(r=>t.hostname.startsWith(r))}function l(t){return{info:r=>{o(t)||console.log(r)},warn:r=>{o(t)||console.warn(r)}}}function u(t){return["localhost","127.0.0.1","local.srv.hostpapa"].some(r=>t.hostname.startsWith(r))}const n=new URL(window.location.href),d="tch/",a=l(n);if(window.fetch&&s(n,f())){const t=i(n.toString()),r=new URL(d,n.origin);u(n)&&(r.port="8787"),c(t,r).then(e=>a.info(e)).catch(e=>a.warn(e))}})();
