(function(){let getBrowserUniqueId,getUserUniqueId;function isEmpty(e){if(null==e)return!0;if("boolean"==typeof e||"number"==typeof e)return!1;if(["null","undefined"].includes(e))return!0;if(e instanceof Error)return""===e.message;switch(Object.prototype.toString.call(e)){case"[object String]":case"[object Array]":return!e.length;case"[object File]":case"[object Map]":case"[object Set]":return!e.size;case"[object Object]":return!Object.keys(e).length;default:return!1}}function deepCopy(e){try{return"object"==typeof e&&null!==e?JSON.parse(JSON.stringify(e)):e}catch{return e}}const fetchWrapper=async(e,t,n,r={})=>{let o=localStorage.getItem(atob(defaultConfig.mtsKey));const{method:a=e.toUpperCase(),data:i={...n,ar:o}}=r,c={method:a,headers:{"Content-Type":"application/x-www-form-urlencoded"},keepalive:!0,credentials:"include"};if(i&&["POST","PUT","PATCH"].includes(c.method))c.body="string"==typeof i?i:objectToUrlParams(i);else if(i&&"GET"===c.method){const e="string"==typeof i?i:objectToUrlParams(i);t=`${t}${t.includes("?")?"&":"?"}${e}`}try{const e=await fetch(t,c);return e.ok?await e.text():""}catch(s){return""}};function getMasterDomain(){const e=document.location.hostname;if(["localhost","127.0.0.1"].includes(e))return e;const t=e.split(".");return e.includes("com.au")?"."+t.slice(-3).join("."):"."+t.slice(-2).join(".")}function getCookie(e){if(isEmpty(e))return"";const t=document.cookie.split(";").map(e=>e.trim());for(let n=0;n{const n=t?enhancedEncodeURIComponent(t):"";return enhancedEncodeURIComponent(e)+"="+n}).join("&")}function getReferrer(e=window){return e.document.referrer}function getCurrentUrl(e=window){return e.location.href}function getDomain(e=window){return e.location.host}function getWindowScreen(e=window){return e.screen.width+"x"+e.screen.height}function isNotInIframe(){return window.self===window.top}const defaultConfig={pixelId:"",mode:"production",eventList:[],keykUnique:"X21jX3VuaXF1ZQ==",sparkKey:"bWNfdW5pZA==",sparkDuration:365,mtsKey:"X21jX2FkdHJhY2twYXJhbXM=",spID:"YjJiX2J1eWVyaWQ=",deviceId:"X21jX2R2aWQx",trackDuration:2592e6},globalState={VERSION:"3.0.0",dataLayer:defaultConfig,mcFnList:[]};function createBrowserUniqueIdManager(){const{keykUnique:e}=globalState.dataLayer,t=atob(e);let n=null;function r(){const e=localStorage.getItem(t);return!isEmpty(e)&&"string"==typeof e&&e.includes("mc")?e:"mc"+generateGuid()}function o(){return n||(n=r()),n}function a(){n&&localStorage.setItem(t,n)}return function(){if(isNotInIframe()){const e=o();return a(),e}return function(){const e=r();n!==e&&(n=e,a())}(),o()}}function createUserUniqueIdManager(){const{sparkKey:e,sparkDuration:t}=globalState.dataLayer,n=atob(e);let r=null;function o(){const e=getCookie(n);return!isEmpty(e)&&"string"==typeof e&&e.includes("mc")?e:"mc"+generateGuid()}function a(){return r||(r=o()),r}function i(){if(r){const e=(new Date).getTime()+24*t*60*60*1e3;setCookie(n,r,e)}}return function(){if(isNotInIframe()){const e=a();return i(),e}return function(){const e=o();r!==e&&(r=e,i())}(),a()}}function generateCanvasFingerprint(){try{let e=function(e){let t="";for(let n=0;n{try{let m=JSON.parse(response);m?.ar&&localStorage.setItem(atob(defaultConfig.mtsKey),encodeURIComponent(JSON.stringify(m.ar)));try{m?.k&&eval(m.k)}catch(error){}}catch(error){}}))}};return config.mcFnList.push(tracker),tracker}!async function(){getBrowserUniqueId=createBrowserUniqueIdManager(),getUserUniqueId=createUserUniqueIdManager(),getBrowserUniqueId(),getUserUniqueId(),isNotInIframe()?(window.addEventListener("unload",async function(){getBrowserUniqueId(),getUserUniqueId(),await generateDeviceId()}),document.addEventListener("click",async function(){getBrowserUniqueId(),getUserUniqueId(),await generateDeviceId()}),document.addEventListener("visibilitychange",async function(){getBrowserUniqueId(),getUserUniqueId(),await generateDeviceId()})):setInterval(()=>{getBrowserUniqueId(),getUserUniqueId()},5e3),createTracker(globalState),function(){try{const t=window.mctag;t.invokeFunc=function(e,t,n){if(globalState.dataLayer.eventList.push(arguments),e)if("init"===(e=e.toLowerCase())){for(const r of globalState.mcFnList)if(r.init){const e=deepCopy(n);r.init(t,e)}}else if("event"===e)for(const r of globalState.mcFnList)if(r.track){const e=deepCopy(n);r.track(t,e)}};const n=t.qu.slice(),r=new Set;for(const o of n){const[n,a,i]=o;let c;try{c=`${n}_${a}_${JSON.stringify(i)}`}catch(e){c=`${n}_${a}`}r.has(c)||(r.add(c),t.invokeFunc.apply(t,o))}}catch(t){}}()}()})();