var VOXUS_DEBUG=false;try{var usubida_domain='//api-dsp.voxus.tv';var usubidaPages=["/orderPlaced"];var clientDomain='www.hoperesort.com.br';var clientDomainWl=JSON.parse('["www.hoperesort.com.br"]');var subusubidaPages=["checkout","cart","pedido"];var igpgs=[];var usubidaFBPixels=[];var voxus_key='voxusmediamanager';var voxus_keypip='appclustervoxuskey';var client_id='2742';var sgotasd=[["/shipping",1819],["/profile",1819],["/p",1819],["/fitness",1819],["/page=2",1819],["/lancamentos",1819],["/beachwear",1819],["/email",1819],["/calca-bailarina-cinza-speed-0hf33340",1819],["/payment",1819],["//",1819],["/outlet-hr",1819],["/bermuda-biker-basic-cinza-speed-hf300340",1819],["/bermuda-biker-basic-vermelho-guava-hf300340",1819],["/top-fitness-costas-nadador-preto-hf252000",1819],["/bermudas",1819],["/black-friday",1819],["/bermuda-biker-basic-azul-marinho-dark-hf300340",1819],["/account",1819],["/wishlist",1819],["/regata-cropped-rose-retro-0hf22990",1819],["/checkout",1819],["/roupas",1819],["/top-comfort-decote-reto-sem-costura-marrom-carvalho-hfs20010",1819],["/legging",1819],["/shorts-fit-cos-alto-sem-costura-marrom-carvalho-hfs30010",1819],["/cart",1819],["/page=3",1819],["/calca-legging",1819],["/macaquinho-alcas-finas-sem-costura-preto-hfs40010",1819],["/body-e-maio",1819],["/sale",1819],["/calca-legging-cos-alto-sem-costura-marrom-cafe-bahamas-hfs30030",1819],["/calcas",1819],["/tops",1819],["/maio-regata-decote-reto-canelado-azul-malibu-hr703450",1819],["/page=4",1819],["/t-shirt-gola-v-fraldada-marrom-wood-hf200340",1819],["/top-bojo-comfort-marrom-wood-hf212340",1819],["/calcinha-biquini-canelada-cos-dobravel-off-white-hr962640",1819],["/casacos-e-jaquetas",1819],["/kit-calcinha",1819],["/livelo",1819],["/bermuda-biker-basic-rose-retro-hf300340",1819],["/calca-legging-tapa-bumbum-verde-fresh-hf360340",1819],["shipping",159],["payment",48],["cart",133],["portinari",147],["aquecedor",84],["review",31],["prateleiras",20],["sasazaki",142],["conexoes",142],["popular",113],["delta",27],["bronzearte",70],["tinta",181],["tigre",152],["caixa",144],["massa",26],["piso-45x45-a-vivence-140016-pei4-art-cx204-incopisos",98],["cozimax",142],["banqueta",179],["pisos",110],["busca",102],["banheiro",181],["iluminacao",152]];var logglyloadvoxus=false;var lastDataLoggly=null;var thisip=null;var getip=null;var getIP=function(){};var axel=Math.random()+"";var a=axel*10000000000000;var sgarq=function(){};var intervalDocumentOnloadVoxusDsp=null;var sgarq=function(){} var voxusAnalyticsValidation=function(){} var sgarqRun=true;var checkEnterprise=function(){};var dataExcludeValidated=false;var intervalDataExcludeValidated;var interPixel=false;var interConversion=false;var igvxtst=false;var igvxgtst=false;var kopid=false;var adinter=false;var sent_usubida=false;var sentloggly=false;var alihuadsa=false;var alihuadsanw=false;var fromOther=false;var pipcluster=false;var converted=false;var converted_gl=0;var retroative=0;var cookie_id=null;var ismobile=false;var creativekaoq=false;var ___vx__runCVL=(0==1?true:false);var sgotasdkaoq=false;var kopidCooked=false;var totalSes=0;var isicgt=false;var enterpriseId=0;var urlsToBloq=[];var redir=0;var imp=1;var attmob=1;var alcm=null;var alcc=null;var isChrome=false;var kiphouYiasO=[];var alvx2=null;var alvx1=null;var alvx3=null;var lswf=false;var dc=false;var tfAdvId=0;var tfCpgId=0;var tfDsName='';var tfDsTid='';var dsName='';var tID='';var advCtmzs=JSON.parse("{\"ds_hit\":true,\"ga_hit\":true,\"ga4_reset_session\":true,\"custom_pixels\":true,\"new_user_reset\":true,\"cd-attr\":true,\"other_v2\":true}");var adsWithCustomData=JSON.parse("[]");var advWithCustomUtm=JSON.parse("[]");var advCustomPixels=JSON.parse("{\"session_time\":[{\"pixel_id\":\"38599305\",\"minimum_time\":120}]}");var customData=JSON.parse("{}");var wppTriggered=false;var appointmentTriggered=false;var trackedElements={};var observerController={observers:{},observedDomains:{},observedRequests:{},};var tagVersion='20260205_172816';var tagSemanticVersion='1.0.331';var cachedVerifyRequest={'queue':{},'resolved':{}};var indexNckVersion='1.0.10';var fromOtherv2=false;var vxAttrStatus={gaNotSent:null,recentConv:false};var algs=null;var analyticsAttributionHitsSentOnPage={ga:false,ds:false,tfDs:false};var noNewUserResetReason=null;if(enterpriseId==0||client_id==98){var VOXUS_RTDT_DATA=encodeURIComponent("client=Hope Resort&website_id=2742&obj=238b5637f41f33387ecb9ff9fb2f3e47238b5637f41f33387ecb9ff9fb2f3e47238b5637f41f33387ecb9ff9fb2f3e47238b5637f41f33387ecb9ff9fb2f3e47238b5637f41f33387ecb9ff9fb2f3e47238b5637f41f33387ecb9ff9fb2f3e47&type=pageview");}else{var VOXUS_RTDT_DATA=encodeURIComponent("client=Hope Resort&website_id=0&obj=238b5637f41f33387ecb9ff9fb2f3e47238b5637f41f33387ecb9ff9fb2f3e47238b5637f41f33387ecb9ff9fb2f3e47238b5637f41f33387ecb9ff9fb2f3e47238b5637f41f33387ecb9ff9fb2f3e47238b5637f41f33387ecb9ff9fb2f3e47&type=pageview");} const VOXUS_API_BASE_URL='https://api.voxus.tv';class VxLogger{debug(...args){if(VOXUS_DEBUG){console.debug(...args);}} trace(...args){if(VOXUS_DEBUG){console.trace(...args);}}} const vxLogger=new VxLogger();class VxAsyncWrapper{static setTimeout(callback,delay,...args){return setTimeout(()=>{try{callback?.(...args);}catch(error){vxLogger.debug("Error in `setTimeout` for advertiser: ",client_id,error);vxLogger.trace(error.stack);}},delay);} static setInterval(callback,delay,...args){return setInterval(()=>{try{callback?.(...args);}catch(error){vxLogger.debug("Error in `setInterval` for advertiser: ",client_id,error);vxLogger.trace(error.stack);}},delay);} static sleep(delay){return new Promise((resolve)=>{VxAsyncWrapper.setTimeout(resolve,delay);});}} class UtmParamsHandler{static getDefaultVxSourceParameters(){return[alcs,'voxus'];} static getDefaultVxCampaign(){if(advWithCustomUtm?.['utm_campaign']){return advWithCustomUtm?.['utm_campaign'];} if(typeof sgotasd==='undefined'){return'campaign_vx';} const segmentValue=sgotasd?.[0]?.[1];if(segmentValue){return`campaign_${client_id}_${segmentValue}`;}}} class VxPageCache{constructor(){this._storage={};} _getOrCreateStorageByKey(key){if(!this._storage[key]){this._storage[key]={lastUrl:null,data:undefined};} return this._storage[key];} hasChangedPageByKey(key){const slot=this._getOrCreateStorageByKey(key);const current=window.location.href;if(slot.lastUrl!==current){slot.lastUrl=current;slot.data=null;return true;} return false;} getCacheData(key){return this._getOrCreateStorageByKey(key).data;} setCacheData(key,value){this._getOrCreateStorageByKey(key).data=value;}} const vxPageCache=(window.vxPageCache||=new VxPageCache());class VxAttrOnClickUtmHandler{static identifyPaidMediaOnQueryString(){const currentUrl=window.location.href;const cacheKey='paid_media_qs';if(vxPageCache.hasChangedPageByKey(cacheKey)){const paidMediaOnQs=this._extractPaidMediaFromQueryString(currentUrl);vxPageCache.setCacheData('paid_media_qs',paidMediaOnQs);} return vxPageCache.getCacheData(cacheKey);} static _extractPaidMediaFromQueryString(currentUrl){const url=new URL(currentUrl);const params=url.searchParams;const urlSource=params.get('utm_source');if(urlSource){const vxSources=UtmParamsHandler.getDefaultVxSourceParameters();if(vxSources.includes(urlSource)){return{'source':'voxus','value':urlSource};} if(urlSource==='LIVELOHOPE'){CookiesVx.set(voxus_key+'_block_full','true',{expires:addDaysToDate(new Date,1)});} return{'source':'other_utm','value':urlSource};} const interIdParams=VxAttrOnClickUtmHandler.getBlockedUtmParameters();for(const p of interIdParams){const matchedParam=this._findQueryStringParamLike(p,params);const value=params.get(matchedParam);if(matchedParam&&value)return{'source':p,'value':value};} return{'source':'none','value':null};} static getBlockedUtmParameters(){return['fbclid','gclid','wbraid','gbraid','source','partner','parceiro','origem','affiliate','afiliado'];} static isVxPaidMediaOnQueryString(){const paidMedia=this.identifyPaidMediaOnQueryString();return paidMedia.source==='voxus'&&paidMedia.value!=='';} static isOtherPaidMediaOnQueryString(){const paidMedia=this.identifyPaidMediaOnQueryString();return paidMedia.source!=='none'&&paidMedia.value!==''&&!this.isVxPaidMediaOnQueryString();} static _findQueryStringParamLike(name,params){for(const key of params.keys()){if(key.includes(name))return key;} return null;}} class VxOtherV2Attr{static ATTRIBUTION_WINDOW_HOURS=24;static ATTR_OTHER_MEDIA_COOLDOWN_WINDOW_MINUTES=30;static _getOtherMediaCooldownCookieKey(){return`${voxus_key}_ot_block_window`;} static setOtherMediaCooldownCookie(date){const cookieName=this._getOtherMediaCooldownCookieKey();const halfHourExpiryDate=addMinutesToDate(date,this.ATTR_OTHER_MEDIA_COOLDOWN_WINDOW_MINUTES);CookiesVx.set(cookieName,true,{domain:'.'+__domain__,expires:halfHourExpiryDate});} static isOtherMediaCooldownActive(){const cookieName=this._getOtherMediaCooldownCookieKey();return Boolean(CookiesVx.get(cookieName));} static async isVxLastPaidMedia(advertiserId=null){const active=await this.getActivePaidMedia(advertiserId);if(!active)return false;return active.source===this._getVxAttributionEntryName();} static async isOtherMediaLastPaidMedia(){const active=await this.getActivePaidMedia();if(!active)return false;return active.source===this._getOtherAttributionEntryName();} static async isVxLastPaidMediaOnAnyAdvertiser(){const advertiserIds=this.getAttrScopeAdvertiserIds();const results=await Promise.allSettled(advertiserIds.map(id=>this.isVxLastPaidMedia(id)));return results.some(r=>r.status==='fulfilled'&&r.value===true);} static async getActivePaidMedia(advertiserId=null){this.storePaidMediaIfExists();if(!advertiserId)advertiserId=client_id;const otherActivePaidMedia=this._getOtherPaidMedia();const vxImpression=await VxImpHandler.getVxLastImpression(advertiserId);const activeMedias=[];const otherAttributionEntryName=this._getOtherAttributionEntryName();const otherAttributionSource=this._buildAttributionEntry(otherAttributionEntryName,otherActivePaidMedia);if(otherAttributionSource)activeMedias.push(otherAttributionSource);const vxAttributionEntryName=this._getVxAttributionEntryName();const vxAttributionSource=this._buildAttributionEntry(vxAttributionEntryName,vxImpression);if(vxAttributionSource)activeMedias.push(vxAttributionSource);if(activeMedias.length===0)return null;activeMedias.sort((a,b)=>b.time-a.time);return activeMedias[0];} static storePaidMediaIfExists(){const cookieKey=this._getOtherCookieKey();const cacheKey=`s_:${cookieKey}`;if(!vxPageCache.hasChangedPageByKey(cacheKey))return;vxPageCache.setCacheData(cacheKey,true);if(VxAttrOnClickUtmHandler.isVxPaidMediaOnQueryString()){this._expireOtherCookie();return;} if(VxAttrOnClickUtmHandler.isOtherPaidMediaOnQueryString()){const now=Math.floor(Date.now()/1000);const paidMedia=VxAttrOnClickUtmHandler.identifyPaidMediaOnQueryString();const data={...paidMedia,time:now};CookiesVx.set(cookieKey,JSON.stringify(data),{domain:'.'+__domain__,expires:addDaysToDate(new Date(),1).toGMTString()});}} static async expireIgnoreOtherCookieWhenVoxusLastPaidMedia(){const cacheKey='expired_ignoreot';vxPageCache.hasChangedPageByKey(cacheKey);const hasExpired=!!vxPageCache.getCacheData(cacheKey);if(hasExpired)return false;const isVoxus=await this.isVxLastPaidMedia(client_id);if(!isVoxus)return false;if(this.isOtherMediaCooldownActive())return false;this._expireOtherCookie();vxPageCache.setCacheData(cacheKey,true);return true;} static getAttrScopeAdvertiserIds(){const advertiserIds=hasCustomization('multi_adv_same_adv')&&typeof associatedAdvData!=='undefined'?Object.keys(associatedAdvData):[];advertiserIds.push(client_id);return advertiserIds;} static reloadFromOtherV2VariableState(){this.isOtherMediaLastPaidMedia().then(v=>{fromOtherv2=!!v;}).catch(()=>{fromOtherv2=null;});} static _expireOtherCookie(){CookiesVx.expire(voxus_key+"_ignore");CookiesVx.expire(voxus_key+"_ignoreot_full");const otherV2CookieKey=this._getOtherCookieKey();CookiesVx.expire(otherV2CookieKey);} static _getOtherPaidMedia(){const cookieKey=this._getOtherCookieKey();const cacheKey=`g_:${cookieKey}`;if(!vxPageCache.hasChangedPageByKey(cacheKey))return vxPageCache.getCacheData(cacheKey);const storedDataJSON=CookiesVx.get(cookieKey);if(!storedDataJSON){vxPageCache.setCacheData(cacheKey,null);return null;} try{const parsed=JSON.parse(storedDataJSON);vxPageCache.setCacheData(cacheKey,parsed);return parsed;}catch(e){vxLogger.debug("Error in `_getOtherPaidMedia` for advertiser: ",client_id,e);vxLogger.trace(e.stack);CookiesVx.expire(cookieKey);return null;}} static _buildAttributionEntry(sourceName,obj){const now=Math.floor(Date.now()/1000);const windowSeconds=this.ATTRIBUTION_WINDOW_HOURS*60*60;if(!obj||typeof obj.time!=='number'||!Number.isFinite(obj.time))return null;const age=now-obj.time;if(age<0)return null;if(age>windowSeconds)return null;const expiresAt=obj.time+windowSeconds;return{source:sourceName,time:obj.time,expiresAt,remainingSeconds:Math.max(0,expiresAt-now),raw:obj};} static _getOtherCookieKey(){return'other_v2';} static _getVxAttributionEntryName(){return voxus_key;} static _getOtherAttributionEntryName(){return'other';}} class VxImpHandler{static setLastImpressionTimestampCookie(timestamp){const normalizedTimestamp=normalizeTimestampInSeconds(timestamp);if(!normalizedTimestamp)return;const cookieKey='voxus_last_impression_timestamp_'+client_id;const thirtyDays=60*60*24*30;CookiesVx.set(cookieKey,normalizedTimestamp,{domain:'.'+__domain__,expires:thirtyDays});} static getCookieLastAdSeenInformation(advertiserId=null){if(!advertiserId)advertiserId=client_id;const raw=CookiesVx.get(`${voxus_key}_kopid_pip`);const timeRaw=CookiesVx.get(`voxus_last_impression_timestamp_${advertiserId}`);const parsed=Number.parseInt(timeRaw,10);const time=Number.isFinite(parsed)?parsed:null;let creative='',campaign='';if(raw&&typeof raw==='string'){const[p0='',p1='']=raw.trim().split('-',2).map(s=>s.trim());creative=p0;campaign=p1;} const rawSegSeen=CookiesVx.get(`${voxus_key}_seg_kaoq`);const adPlacementDomain=CookiesVx.get(`${voxus_key}_ad_placement_domain`);const kopidPlataform=CookiesVx.get(`${voxus_key}_kopid_plataform`);let allCampaigns='';if(rawSegSeen&&typeof rawSegSeen==='string')allCampaigns=rawSegSeen.split(',');return{time,creative,campaign,'campaigns':allCampaigns,'ad_placement_domain':adPlacementDomain,'kopid_plataform':kopidPlataform};} static getVerifyTrackData(advertiserId,cookieId,isIpa){const nsKey=`verify:${advertiserId}`;let store=vxPageCache.getCacheData(nsKey);if(vxPageCache.hasChangedPageByKey(nsKey)||store===undefined){store={queue:{},resolved:{}};vxPageCache.setCacheData(nsKey,store);} const{queue,resolved}=store;const cacheKey=isIpa?'ipa_true':'ipa_false';if(resolved[cacheKey])return Promise.resolve(resolved[cacheKey]);if(queue[cacheKey])return queue[cacheKey];const pending=this._fetchVerifyTrackingData(advertiserId,cookieId,isIpa).then(resp=>{const val=Object.freeze(resp||{});resolved[cacheKey]=val;delete queue[cacheKey];vxPageCache.setCacheData(nsKey,store);return val;}).catch(err=>{delete queue[cacheKey];vxLogger.debug("Error in `getVerifyTrackData` (cached path): ",client_id,err);vxLogger.trace(err.stack);const empty=Object.freeze({});resolved[cacheKey]=empty;vxPageCache.setCacheData(nsKey,store);return empty;});queue[cacheKey]=pending;vxPageCache.setCacheData(nsKey,store);return pending} static async getVxLastImpression(advertiserId){if(ismobile){return this._getIPAddressLastImpression(advertiserId);} const ipResult=await this._getIPAddressLastImpression(advertiserId);if(ipResult)return ipResult;return this._getCookiesLastImpression(advertiserId);} static async hasSeenAdInLastHours(hours,advertiserId=null){const impression=await this.getVxLastImpression(advertiserId);if(!impression?.time)return false;const nowSeconds=Math.floor(Date.now()/1000);const hoursInSeconds=hours*60*60;return(nowSeconds-impression.time){const xhr=new XMLHttpRequest();const url=`${VOXUS_API_BASE_URL}/verify/?adv_id=${advertiserId}&ck_id=${cookieId}${isIpa?"&ipa=true":""}`;xhr.open("GET",url,true);xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");xhr.onreadystatechange=function(){if(xhr.readyState===4){if(xhr.status>=200&&xhr.status<300){try{const jsonResponse=JSON.parse(xhr.responseText);resolve(jsonResponse);}catch(e){vxLogger.debug("Error in `fetchVerifyTrackingData` for advertiser: ",client_id,e);vxLogger.trace(e.stack);reject(new Error("Erro ao parsear JSON"));}}else{vxLogger.debug("Error in `fetchVerifyTrackingData` with bad HTTP status code for advertiser: ",client_id,xhr.status);reject(new Error(`Erro HTTP:${xhr.status}`));}}};xhr.onerror=function(){vxLogger.debug("Network error in `fetchVerifyTrackingData` for advertiser: ",client_id);reject(new Error("Erro de rede"));};xhr.send();});} static _getCookiesLastImpression(advertiserId){const adSeenCookieInfo=this.getCookieLastAdSeenInformation(advertiserId);if(!adSeenCookieInfo.time)return null;return adSeenCookieInfo;} static async _getIPAddressLastImpression(advertiserId){const response=await this.getVerifyTrackData(advertiserId,cookie_id,false);if(!response||!response.data||response.data.length===0){return null;} const latestItem=response.data.reduce((latest,current)=>{const latestDate=new Date(latest?.date);const currentDate=new Date(current?.date);if(isNaN(currentDate.getTime()))return latest;if(isNaN(latestDate.getTime()))return current;return currentDate>latestDate?current:latest;});const allCampaigns=response.data.map(item=>item.campaign).filter(Boolean);const adSeenPlataform='adse'+'en_plataform';return{'time':Math.floor(new Date(latestItem.dateTz||latestItem.date).getTime()/1000),'campaign':latestItem.campaign,'creative':latestItem.crtv,'campaigns':allCampaigns,'ad_placement_domain':latestItem.ad_placement_domain||null,'kopid_plataform':latestItem[adSeenPlataform]||null};} static setAdSeenCookies(impressionData){const{impressionTime,lastSeenCreative,lastSeenCampaign,lastSeenCampaigns,adPlacementDomain='',adSeenPlatform=''}=impressionData;const impressionDate=new Date(impressionTime*1000);const expiresDate=addHoursToDate(impressionDate,24);const adSeenValue=`${lastSeenCreative}-${lastSeenCampaign}-apnx`;const campaignsValue=Array.isArray(lastSeenCampaigns)?lastSeenCampaigns.join(','):lastSeenCampaigns;CookiesVx.set(voxus_key+"_kopid_pip",adSeenValue,{domain:'.'+__domain__,expires:expiresDate});CookiesVx.set(voxus_key+"_seg_kaoq",campaignsValue,{domain:'.'+__domain__,expires:expiresDate});if(adPlacementDomain){CookiesVx.set(voxus_key+"_ad_placement_domain",adPlacementDomain,{domain:'.'+__domain__,expires:expiresDate});} if(adSeenPlatform){CookiesVx.set(voxus_key+"_kopid_plataform",adSeenPlatform,{domain:'.'+__domain__,expires:expiresDate});} this.setLastImpressionTimestampCookie(impressionTime);}} class VxAdobeAttr{static sendAdobeHit(params){const ADOBE_PAGE_PARAM2="eVar90";const ADOBE_UTM_PARAM="eVar14";const ADOBE_JUMP_PARAM="eVar15";const utmString=":"+ params["medium"]+":"+ params["source"]+":"+ params["name"]+":";const url=new URL(window.location.href);url.searchParams.set("utm_campaign",params.name);url.searchParams.set("utm_source",params.source);url.searchParams.set("utm_medium",params.medium);if(params.jumpid){url.searchParams.set("jumpid",params.jumpid);} if(typeof alloy!=='function'){return;} alloy("sendEvent",{xdm:{web:{webPageDetails:{URL:url.toString(),pageViews:{value:1}}},_experience:{analytics:{customDimensions:{eVars:{[ADOBE_PAGE_PARAM2]:url.toString(),[ADOBE_UTM_PARAM]:utmString,[ADOBE_JUMP_PARAM]:params.jumpid,props:{prop40:"pageView"}}}}},documentUnloading:true,eventType:"web.webpagedetails.pageViews",}});}} class VxNemuAttr{static sendNemuHit(params){if(!window.trackingNemu){return;} const searchParams=new URLSearchParams();searchParams.append('utm_campaign',params.name);searchParams.append('utm_source',params.source);searchParams.append('utm_medium',params.medium);window.trackingNemu.nemuUtms=searchParams;CookiesVx.set("nemuUtmsTrack",searchParams.toString(),{domain:'',secure:true,samesite:'Lax',expires:addMinutesToDate(new Date,30),});localStorage.setItem("nemu:utmsTrack",searchParams.toString());}} class VxResetLookupWindow{static MAX_RESETS_PER_WINDOW=1;static RESET_WINDOW_DAYS=30;static setOtherPaidMediaCookie(){this._setLastPaidMediaCookie(this._getOtherLastPaidMediaCookieValue());} static setVxPaidMediaCookie(){this._setLastPaidMediaCookie('vx');} static async resetLookupWindow(){if(!this.hasLookupCustomization())return;if(this._hasOtherLastPaidMediaCookie())return;if(!this._canResetLookupWindow())return;if(await VxImpHandler.hasSeenAdInLastHours(VxOtherV2Attr.ATTRIBUTION_WINDOW_HOURS))return;const cookieBeforeReset=getGaCookie();const measurementIds=getMeasurementIds();for(const measurementId of measurementIds){VxGA4Attr.sendNewUser(measurementId,{});} sendToLoggly({type:"reset_lookup_window",pageview:window.location.href,cookie_id:cookie_id,old_ugi_cookie:cookieBeforeReset,new_ugi_cookie:getGaCookie(),measurementIds:getMeasurementIds(),is_mobile:ismobile});this._incrementResetCount();} static _canResetLookupWindow(){if(!this.hasLookupCustomization())return false;const currentCount=this.getResetCount();return currentCount{if(!item||typeof item!=="object")return false;if("0"in item&&"1"in item)return false;return!!(item.ecommerce?.purchase);},delay:500,onMatch:(item)=>this._sendPurchaseEvent(item)});} static _isEnabled(){return client_id===VxManualPurchaseAttribution.ADV_ID;} static _extractPurchaseFromDataLayer(item){const action=item?.ecommerce?.purchase?.actionField;if(!action?.id)return null;const transaction_id=String(action.id);const value=Number(action.revenue);const currency=item?.ecommerce?.currencyCode||"BRL";if(!Number.isFinite(value))return null;return{transaction_id,value,currency};} static _getMeasurementId(){return customData?.ga4?.measurementId;}} class VxGA4Attr{static sendDefaultPageViewAnalyticsHit(measurementIds=null,params=null,skipSetAttributionGa=false,customPayload={}){const sent=this._sendAnalyticsEventHit(params,measurementIds,'page_view',customPayload);if(!skipSetAttributionGa||!sent)analyticsAttributionHitsSentOnPage.ga=true;return sent;} static sendPurchaseAnalyticsHit(measurementIds=null,params=null,customPayload={}){return this._sendAnalyticsEventHit(params,measurementIds,'purchase',customPayload);} static _sendAnalyticsEventHit(params=null,measurementIds=null,eventName=null,customPayload={}){if(!eventName)return false;if(!params)params=getUtmParametersToSend(alcs,alcm,alcn);const defaultPayload={campaign:params,send_to:measurementIds||getMeasurementIds()};const finalPayload={...defaultPayload,...customPayload};initializeInternalGtag();algs('event',eventName,finalPayload);return true;} static setUserScopedCustomDimensionProperty(dimensionName,value='voxus_user'){initializeInternalGtag();algs('set','user_properties',{[dimensionName]:value});} static sendEventScopedCustomDimensionProperty(dimensionName,value='voxus_user'){initializeInternalGtag();algs('event','page_view',{'send_to':getMeasurementIds(),[dimensionName]:value});} static resetSession(measurementIds){if(!measurementIds||!measurementIds.length){return;} const newTimestamp=Math.floor(addHoursToDate(new Date,-6).getTime()/1000);const voxusGaSessionResetedCookieKey=voxus_key+"_session_reseted";const voxusGaSessionResetQtCookieKey=voxus_key+'_session_reset_qt';const resetCap=hasCustomization('measurement_protocol_fix')?3:1;const isSessionReseted=Boolean(CookiesVx.get(voxusGaSessionResetedCookieKey));const rawValue=CookiesVx.get(voxusGaSessionResetQtCookieKey);const amountOfResets=isNaN(Number(rawValue))?0:Number(rawValue);if(isSessionReseted&&amountOfResets>=resetCap){return;} for(const measurementId of measurementIds){modifyGa4SessionCookie({measurementId,newTimestamp,});} CookiesVx.set(voxusGaSessionResetedCookieKey,true,{domain:'.'+__domain__,expires:addMinutesToDate(new Date,30).toGMTString()});CookiesVx.set(voxusGaSessionResetQtCookieKey,amountOfResets+1,{domain:'.'+__domain__,expires:addMinutesToDate(new Date,30).toGMTString()});} static async sendNewUserToAllGaIds(utmParams){if(!areFunctionsAvailable('getMeasurementIds','isNewUser')){return;} const alreadyResetNewUser=CookiesVx.get(voxus_key+'_already_reset_user');if(alreadyResetNewUser==='true'){noNewUserResetReason='already_reset';return;} const ids=getMeasurementIds();if(!ids?.length){noNewUserResetReason='no_measurement_ids';return;} if(!isNewUser()){noNewUserResetReason='not_new_user';return;} const resetFeatActivationTime='2025-04-10T16:44:08+00:00';if(!shouldResetUserByFeatureActivationDate(resetFeatActivationTime)){noNewUserResetReason='time_restricted';return;} const promises=ids.map(measurementId=>{return this.sendNewUser(measurementId,utmParams);});await Promise.all(promises);const ONE_DAY=24*60*60;CookiesVx.set(voxus_key+'_already_reset_user',true,{domain:'.'+__domain__,expires:ONE_DAY});noNewUserResetReason='sent';} static sendNewUser(measurementId,utmParams){if(!measurementId){measurementId=getFixedMeasurementId();} const gaUrl='https://www.google-analytics.com/g/collect';const clientId=generateNewCid();updateClientGaCookie(clientId);const sessionId=generateSid();updateCookieSessionId(sessionId,measurementId);let currentPageUrl=window.location.href;const utmParamsName=["utm_source","utm_campaign","utm_medium","utm_term"];const hasUtmParam=utmParamsName.some(utmParam=>currentPageUrl.includes(utmParam));const hasUtmValues=utmParams&&(utmParams.source||utmParams.name||utmParams.medium||utmParams.term);if(!hasUtmParam&&hasUtmValues){const completeUtmParams=utmsToString(utmParams);if(currentPageUrl.includes('?')){currentPageUrl+=`&${completeUtmParams}`;} else{currentPageUrl+=`?${completeUtmParams}`;}} const encodedCurrentPageUrl=encodeURIComponent(currentPageUrl);const payload={v:2,tid:measurementId,npa:0,dma:0,tag_exp:0,cid:clientId,ul:navigator.language.toLowerCase(),sr:window.screen.availWidth+'x'+window.screen.availHeight,uaa:"x86",uab:"64",uafvl:getGAUserAgent(),uamb:0,uam:"",uap:navigator.userAgentData?.platform??"unknown",uapv:"15.0.0",uaw:0,are:1,frm:0,pscdl:"noapi",_eu:"AAAI",_s:1,sid:sessionId,sct:1,seg:0,dl:encodedCurrentPageUrl,dt:document.title,en:"page_view",_fv:1,_nsi:1,_ss:1,tfd:generateRandomTfd()};const queryString=Object.keys(payload).map(key=>key+'='+payload[key]).join('&');const finalUrl=gaUrl+'?'+queryString;fetch(finalUrl,{method:'GET'}).then(response=>{}).catch(error=>{vxLogger.debug("Error in `sendNewUser` for advertiser: ",client_id,error);vxLogger.trace(error.stack);});}} class VxVtexIOAttr{static isAvailable(){try{return localStorage.getItem('analytics:session')!==null;}catch(e){return false;}} static handleAttribution(utmSource,utmMedium,utmCampaign){if(!this.isAvailable())return;const locationWithUtms=window.location.origin+'/?utm_source='+utmSource +'&utm_medium='+utmMedium+'&utm_campaign='+utmCampaign;this._overwriteAnalyticsSession(locationWithUtms,utmSource);window.dataLayer.push({'originalLocation':locationWithUtms});} static _overwriteAnalyticsSession(locationWithVoxusUtm,utmSource){if(!this.isAvailable())return;let currentCache=localStorage.getItem('analytics:session');const alreadyHasVoxus=currentCache.indexOf('utm_source='+utmSource)!==-1;if(alreadyHasVoxus)return;currentCache=JSON.parse(currentCache);currentCache.location=locationWithVoxusUtm;localStorage.setItem('analytics:session',JSON.stringify(currentCache));}} class VxVtexAttr{static hasVtexJS(){return typeof vtexjs!=='undefined';} static getSessionCookie(){if(typeof CookiesVx==='undefined')return null;return CookiesVx.get('VtexRCSessionIdv7')||null;} static getConversionId(){const url=new URL(window.location.href);if(!url.pathname.includes('orderPlaced')){return;} return url.searchParams.get('og');} static isOnCheckout(){return this.hasVtexJS()&&window.location.pathname.includes('checkout');} static async cleanCheckout(){if(!this.hasVtexJS())return;const form=await vtexjs?.checkout?.getOrderForm();const marketingData=form?.marketingData;if(!marketingData?.utmSource?.includes('voxus'))return;sendToLoggly({type:'vtex_clean',marketingData});marketingData.utmSource='';marketingData.utmMedium='';marketingData.utmCampaign='';await vtexjs?.checkout?.sendAttachment('marketingData',marketingData);} static async handleAttribution(params){if(!this.hasVtexJS())return;if(this.isOnCheckout()){await this._sendUtmsToCheckout(params);} await this._sendUtmsToSession(params);} static async _sendUtmsToCheckout(utms){const form=await vtexjs?.checkout?.getOrderForm();if(!form)return;const currentMarketingData=form.marketingData||{};const marketingData={...currentMarketingData,utmSource:utms.source,utmMedium:utms.medium,utmCampaign:utms.name,};await vtexjs?.checkout?.sendAttachment('marketingData',marketingData);} static async _sendUtmsToSession(params){try{await fetch('/api/sessions',{method:'PATCH',headers:{'Content-Type':'application/json',},body:JSON.stringify({"public":{"utm_campaign":{"value":params.name},"utm_medium":{"value":params.medium},"utm_source":{"value":params.source}}}),});}catch(e){vxLogger.debug("Error in `VxVtexAttr._sendUtmsToSession` for advertiser: ",client_id,e);vxLogger.trace(e.stack);}}} class VxPlausibleAttr{static hasPlausible(){return typeof plausible=='function';} static handleAttribution(params){if(!this.hasPlausible())return;const url=new URL(window.location.href);url.searchParams.set('utm_campaign',params.name);url.searchParams.set('utm_medium',params.medium);url.searchParams.set('utm_source',params.source);plausible('pageview',{url:url.toString()});}} class VxAdPlacementDomainTracking{static async _buildUrlWithParams(isConversionHit,isNewUser){const baseUrl=`${VOXUS_API_BASE_URL}/track_channel`;const vxLastImpression=await VxImpHandler.getVxLastImpression(client_id);const kopidPlataform='adse'+'en_plataform';const isConversion='is_conv'+'ersion';const params={'action':'save','adv_id':client_id,'ad_placement_domain':vxLastImpression['ad_placement_domain']??'not_tracked',[kopidPlataform]:vxLastImpression['kopid_plataform']??'not_tracked','is_new_user':isNewUser,[isConversion]:isConversionHit?1:0};const urlParams=new URLSearchParams(params);return baseUrl+'?'+urlParams.toString();} static _hasAttributionHit(newUser){const key='last_ad_placement_domain';const adPlacement=VxImpHandler.getCookieLastAdSeenInformation().ad_placement_domain;if(newUser){localStorage.setItem(key,adPlacement);return false;} if(localStorage.getItem(key)!==null&&localStorage.getItem(key)===adPlacement){return true;} localStorage.setItem(key,adPlacement);return false;} static _hasConversionHit(){const hasConvertedBefore=CookiesVx.get(voxus_key+'_usubida_tracking');return hasConvertedBefore==='true';} static async sendHit(isConversionHit=false){const newUser=isNewUser();if(!hasCustomization('send_channel_tracking')){return;} const hasHit=isConversionHit?this._hasConversionHit():this._hasAttributionHit(newUser);if(hasHit||!await VxOtherV2Attr.isVxLastPaidMedia()){return;} const url=await this._buildUrlWithParams(isConversionHit,newUser);fetch(url,{method:'GET'}).then(response=>{}).catch(error=>{vxLogger.debug("Error in `sendChannelTrackingHit` for advertiser: ",client_id,error);vxLogger.trace(error.stack);});}} class VxDataLayerObserver{static DEFAULT_DELAY=1000;static matchers={ga4Event:(eventName)=>(item)=>item?.event===eventName||item?.[1]===eventName,};static observe({matcher,onMatch=null,delay=null,dataLayerName=null}){const dlName=dataLayerName||this._resolveDataLayerName();const pollDelay=delay||this.DEFAULT_DELAY;if(!dlName){vxLogger.debug("VxDataLayerObserver: Could not find dataLayer");return Promise.resolve(null);} return this._listenUntil(matcher,pollDelay,dlName).then((item)=>{if(item&&onMatch)onMatch(item);return item;});} static observeGA4Event(eventName,{onMatch,delay=null,dataLayerName=null}){return this.observe({matcher:this.matchers.ga4Event(eventName),onMatch,delay,dataLayerName});} static trackPurchaseUrl(){const storageKey='vx_purchase_url_logged';if(localStorage.getItem(storageKey))return;this.observeGA4Event("purchase",{onMatch:()=>{sendToLoggly({type:"purchase_url",cookie_id:cookie_id,pageview:window.location.href,});localStorage.setItem(storageKey,'true');}});} static _resolveDataLayerName(){const msIds=getMeasurementIds();if(msIds?.length>0){return findDataLayer(msIds.at(0))||'dataLayer';} return'dataLayer';} static _listenUntil(eventCheckCallback,delay=1000,dataLayerName='dataLayer'){window[dataLayerName]=window[dataLayerName]||[];let originalSize=window[dataLayerName].length;const previousDataLayerItem=getDataLayerItemWith(eventCheckCallback,dataLayerName);if(previousDataLayerItem)return Promise.resolve(previousDataLayerItem);return new Promise((resolve,reject)=>{function checkDataLayer(){try{if(window[dataLayerName].length===originalSize){VxAsyncWrapper.setTimeout(checkDataLayer,delay);return;} const itemFound=window[dataLayerName].find(eventCheckCallback);if(itemFound){resolve(itemFound);return;} originalSize=window[dataLayerName].length;VxAsyncWrapper.setTimeout(checkDataLayer,delay);}catch(error){vxLogger.debug("Error in `VxDataLayerObserver._listenUntil` for advertiser: ",client_id,error);vxLogger.trace(error.stack);reject(error);}} checkDataLayer();});}} function fallBackLocalstorage(){if(window.localStorage){return;} window.localStorage={getItem:()=>{},setItem:()=>{},};} fallBackLocalstorage();function getDataLayerItemWith(eventCheckCallback,dataLayerName='dataLayer'){for(const dataLayerItem of window[dataLayerName]){if(eventCheckCallback(dataLayerItem)){return dataLayerItem;}} return null;} function isFromOther(){if(typeof CookiesVx==='undefined')return false;if(typeof voxus_key!=='string'||!voxus_key.length)return false;const isOther=CookiesVx.get(voxus_key+'_ignoreot_full');return typeof isOther!=='undefined'&&isOther?.trim().toLowerCase()==='true';} function setisicgt(i){isicgt=i;} var fs=window.RequestFileSystem||window.webkitRequestFileSystem;if(!fs){}else{fs(window.TEMPORARY,100,setisicgt.bind(setisicgt,false),setisicgt.bind(setisicgt,true));} if(navigator!=null){if(navigator.userAgent!=null){if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ismobile=true;}}} var __domain__=(function(){var i=0,domain=document.domain,p=domain.split('.'),s='_gd'+(new Date()).getTime();while(i<(p.length-1)&&document.cookie.indexOf(s+'='+s)==-1){domain=p.slice(-1-(++i)).join('.');document.cookie=s+"="+s+";domain="+domain+";";} document.cookie=s+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain="+domain+";";return domain;})();function hasCustomization(customizationType){return typeof(advCtmzs[customizationType])!='undefined'&&advCtmzs[customizationType]===true;} function addMinutesToDate(date,minutes){return new Date(date.getTime()+minutes*60000);} function addHoursToDate(date,hours){const newDate=new Date(date.getTime());newDate.setHours(newDate.getHours()+hours);return newDate;} function addDaysToDate(date,days){const newDate=new Date(date.getTime());newDate.setDate(newDate.getDate()+days);return newDate;} function minutesFromTimestamp(earlierTimestamp){return Math.floor((Math.floor(Date.now()/1000)-earlierTimestamp)/60);} function getHardCodedMeasurementIds(){const manualClientTrackingMap=new Map([['2726',['G-JPJPRSDB9K']],['1852',['G-ZM0BG28WWR']],['2859',['G-ZQG965CFCJ']],['2783',['G-NM6XDMNB2W']],['1985',['G-SZ828V6WSK']],['2701',['DC-11379620','G-WCFX1FQ26K','AW-804145559']],['1948',['G-78EPY23H13','G-7HNMFXJ8J5','G-B0521B3853','G-HMCQCM5KQ1','G-NY5NGVZ1KQ','G-S02H216ES2']],['1879',['G-PYGGC1W2VQ']],['2900',['G-4CZX459Q1Q','G-G5LR3WEXK4']],['1598',['corebiz_google_app','G-TCKVZX1BJB','G-HN1RYJHPJ7']],]);return manualClientTrackingMap.get(client_id)||[];} function getMeasurementIdsFromGtm(){if(typeof google_tag_manager==='undefined'){return[];} const allOptions=Object.keys(google_tag_manager);if(allOptions.length===0){return[];} return allOptions.filter(option=>{return option.substring(0,2)==='G-';});} function getMeasurementIdsFromGtmDestination(){if(typeof google_tag_data==='undefined'||!google_tag_data?.tidr?.destination){return[];} const mainDestinations=Object.keys(google_tag_data.tidr.destination).filter((item)=>item.startsWith('G-'));const secondDestinations=Object.keys(google_tag_data.tidr.destinationArray).filter((item)=>item.startsWith('G-'));return mainDestinations.concat(secondDestinations);} function getMeasurementIds(){if(!hasCustomization('ga_hit')){return[];} const mIdsSet=new Set([...getHardCodedMeasurementIds(),...getMeasurementIdsFromGtm(),...getMeasurementIdsFromGtmDestination()]);return[...mIdsSet];} function getFixedMeasurementId(){let fixedMeasurementId=CookiesVx.get('measurement_id');if(!isMeasurementIdValid(fixedMeasurementId)){fixedMeasurementId=getMeasurementIds()?.[0];if(!fixedMeasurementId) return null;} CookiesVx.set('measurement_id',fixedMeasurementId) return fixedMeasurementId;} function isMeasurementIdValid(measurementId){if(!measurementId){return false;} const validMeasurementIds=getMeasurementIds();if(!validMeasurementIds||validMeasurementIds?.length===0){return false;} return validMeasurementIds.includes(measurementId);} function parseGaMainCookie(){const key='_'+'ga';const fullCookie=CookiesVx.get(key);if(!fullCookie){return null;} const splited=fullCookie.split('.');const userId=`${splited[2]}.${splited[3]}`;return{key,value:fullCookie,timestamp:splited[3],userId,};} function getGaSessionCookieData(measurementId){if(!measurementId){return null;} const key='_'+'ga_'+measurementId.slice(2);const fullCookie=CookiesVx.get(key);if(!fullCookie){return null;} const mainCookie=parseGaMainCookie();if(!mainCookie){return null;} const isSessionCookieNewVersion=isGS2Implementation(fullCookie);return{key,value:fullCookie,userId:mainCookie.userId,userTimestamp:mainCookie.timestamp,sessionId:getGaCookieSessionId(isSessionCookieNewVersion,fullCookie),sessionLastInteraction:getSessionLastInteraction(isSessionCookieNewVersion,fullCookie),sessionCount:getSessionCount(isSessionCookieNewVersion,fullCookie),newUser:getSessionNewUser(isNewGaSessionCookie,fullCookie)};} function isGS2Implementation(fullCookie){return fullCookie.startsWith('GS2');} function getGaCookieSessionId(isNewVersion,fullCookie){if(isNewVersion){const splited=fullCookie.split('$');const sessionIdPart=splited.find(p=>p.includes('.s'));return sessionIdPart?sessionIdPart.split('.s')[1]:null} return fullCookie.split('.')[2];} function getSessionLastInteraction(isNewVersion,fullCookie){if(isNewVersion){const splited=fullCookie.split('$');return splited.find(p=>p.startsWith('t'))?.substring(1)||null} return fullCookie.split('.')[5];} function getSessionCount(isNewVersion,fullCookie){if(isNewVersion){const splited=fullCookie.split('$');const sessionCountPart=splited.find(p=>p.startsWith('o'));return sessionCountPart?sessionCountPart.substring(1):null;} return fullCookie.split('.')[3];} function getSessionNewUser(isNewVersion,fullCookie){if(isNewVersion){const splited=fullCookie.split('$');const newUserPart=splited.find(p=>p.startsWith('o'));return newUserPart?newUserPart.substring(1)==='1':false;} return fullCookie.split('.')[3]==='1';} function expireCookie(cookieKey){CookiesVx.set(cookieKey,'',{expires:new Date(0).toGMTString(),});} function isNewGaSessionCookie(measurementId){const gaCookieData=getGaSessionCookieData(measurementId) if(!gaCookieData) return false;return gaCookieData.sessionCount==='1'&&gaCookieData.newUser;} function isNewUser(){const mainCookie=parseGaMainCookie();if(!mainCookie){return false;} const isNewUserByTime=minutesFromTimestamp(Number(mainCookie.timestamp))<=1;const measurementIds=getMeasurementIds();if(!measurementIds||measurementIds?.length===0){return false;} const isNewUserByAnySession=measurementIds.some((measurementId)=>isNewGaSessionCookie(measurementId));return isNewUserByTime||isNewUserByAnySession;} function resetGa4User(measurementId){const gaCookiedata=getGaSessionCookieData(measurementId);if(isNewUser()){expireCookie(gaCookiedata.key);}} function modifyGa4SessionCookie({measurementId,newTimestamp}){const gaCookiedata=getGaSessionCookieData(measurementId);if(!gaCookiedata){return;} if(!gaCookiedata.sessionLastInteraction){return;} const oldLastInteraction=`t${gaCookiedata.sessionLastInteraction}`;const newLastInteraction=`t${newTimestamp}`;const newGaSessionCookie=gaCookiedata.value.replace(oldLastInteraction,newLastInteraction);CookiesVx.set(gaCookiedata.key,newGaSessionCookie,{domain:'.'+__domain__,expires:addDaysToDate(new Date,729).toGMTString()});} function getLastDataLayerEventName(){if(!Array.isArray(window.dataLayer)||window.dataLayer.length===0){return;} const lastEvent=window.dataLayer.at(-1);if(!lastEvent){return;} return lastEvent[1]??lastEvent.event;} async function sendToLoggly(data){try{return await fetch("https://logs-01.loggly.com/inputs/27cf9a30-eb89-41a7-ba82-3280d33fb2cf/tag/https/",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8",},body:JSON.stringify(data),});}catch(error){vxLogger.debug("Error in `sendToLoggly` for advertiser: ",client_id,error);vxLogger.trace(error.stack);}} function getUserSessionData(measurementId=null){if(!measurementId){measurementId=getMeasurementIds()[0];} let vxSessionId=CookiesVx.get('vx_session_id');let gaSessionData=getGaSessionCookieData(measurementId);if(!gaSessionData) return null;let gaCurrentSession=gaSessionData.userId;if(typeof vxSessionId=='undefined'||vxSessionId!=gaCurrentSession){refreshVoxusSession(gaSessionData);} let currentEpochTime=parseInt(Date.now()/1000);let sessionTime=currentEpochTime-CookiesVx.get('vx_session_start');let vxSessionPagesQt=parseInt(CookiesVx.get('vx_session_pages_qt'));vxSessionPagesQt=vxSessionPagesQt+1;CookiesVx.set('vx_session_pages_qt',parseInt(vxSessionPagesQt));return{'vx_session_id':vxSessionId,'session_time':sessionTime,'vx_session_pages_qt':vxSessionPagesQt}} function refreshVoxusSession(gaSessionData){let user_id=gaSessionData.userId;let session_id=gaSessionData.sessionId;CookiesVx.set('vx_session_id',user_id);CookiesVx.set('vx_session_start',session_id);CookiesVx.set('vx_session_pages_qt',0);} function addPixel(url,isReferrerPolicy=false){const px=document.createElement('img');px.src=url;px.width=1;px.height=1;px.style='display:none;visibility:hidden';if(isReferrerPolicy){px.referrerPolicy="unsafe-url";} const body=document.getElementsByTagName('body')[0];if(body){body.appendChild(px);}else{document.addEventListener('DOMContentLoaded',()=>{document.body.appendChild(px);});}} function addXandrPixel(pixelId){const domain=window.location.protocol.indexOf('https:')===-1?'http://ib.adnxs.com/seg?add=':'https://secure.adnxs.com/seg?add=';addPixel(domain+pixelId+'&t=2');} function addMediaMathPixel(advertiser_id){const mediaMathAdvertiserTags={'2321':'https://pixel.mathtag.com/event/js?mt_id=1655596&mt_adid=430561&mt_exem=&mt_excl=&v1=&v2=&v3=&s1=&s2=&s3=','1421':'https://pixel.mathtag.com/event/js?mt_id=1655610&mt_adid=430575&mt_exem=&mt_excl=&v1=&v2=&v3=&s1=&s2=&s3=','2653':'https://pixel.mathtag.com/event/js?mt_id=1657731&mt_adid=431376&mt_exem=&mt_excl=&v1=&v2=&v3=&s1=&s2=&s3='};addPixel(mediaMathAdvertiserTags[advertiser_id]);} function addStackAdaptPixelId(pixelId){const stackAdaptBasePixelUrl='https://tags.srv.stackadapt.com/rt?sid=';addPixel(stackAdaptBasePixelUrl+pixelId);} function addStackAdaptPixelIdIfOnSegmentPage({pixelId,segmentName}){if(location.href.includes(segmentName)){addStackAdaptPixelId(pixelId);}} function addMetaPixel(pixelId){addPixel('https://www.facebook.com/tr?id='+pixelId+'&ev=PageView&noscript=1');} function updateSessionTime(sessionTime){let vxSessionId=CookiesVx.get('vx_session_id');if(typeof vxSessionId=='undefined') return;let sessions=typeof CookiesVx.get('vx_user_sessions')!=="undefined"?JSON.parse(CookiesVx.get('vx_user_sessions')):{};const currentTime=Math.floor(Date.now()/1000);sessions[vxSessionId]={sessionTime:sessionTime,timestamp:currentTime};removeExpiredFromUserSessionTime(sessions)} function removeExpiredFromUserSessionTime(sessions){const days=4;const SESSION_TTL=days*24*60*60;const currentTime=Math.floor(Date.now()/1000);Object.keys(sessions).forEach(id=>{if(currentTime-sessions[id].timestamp>=SESSION_TTL){delete sessions[id];}});CookiesVx.set('vx_user_sessions',JSON.stringify(sessions));} function getTotalSessionTime(){let sessions=typeof CookiesVx.get('vx_user_sessions')!=="undefined"?JSON.parse(CookiesVx.get('vx_user_sessions')):{};removeExpiredFromUserSessionTime(sessions) return Object.values(sessions).reduce((sum,session)=>{return sum+(session.sessionTime||0);},0);} function addExcludePixel(){if(client_id=='2581'){addXandrPixel('37611661');}} function addForceIncludePixel(pixelId){addXandrPixel(pixelId);} function manageUserSession(){addExcludePixel();const totalSessionTime=getTotalSessionTime();const mediaMathPixels={'1218':'https://pixel.mathtag.com/event/js?mt_id=1657744&mt_adid=430709&mt_exem=&mt_excl=&v1=&v2=&v3=&s1=&s2=&s3=','2776':'https://pixel.mathtag.com/event/js?mt_id=1657745&mt_adid=430892&mt_exem=&mt_excl=&v1=&v2=&v3=&s1=&s2=&s3=','1774':'https://pixel.mathtag.com/event/js?mt_id=1657746&mt_adid=431230&mt_exem=&mt_excl=&v1=&v2=&v3=&s1=&s2=&s3=','2673':'https://pixel.mathtag.com/event/js?mt_id=1657747&mt_adid=431009&mt_exem=&mt_excl=&v1=&v2=&v3=&s1=&s2=&s3=','2249':'https://pixel.mathtag.com/event/js?mt_id=1657748&mt_adid=430883&mt_exem=&mt_excl=&v1=&v2=&v3=&s1=&s2=&s3='};if(mediaMathPixels.hasOwnProperty(client_id)&&totalSessionTime>=120){let requestUrl=mediaMathPixels[client_id];let px=document.createElement('img');px.src=requestUrl;px.async=true;px.width=1;px.height=1;px.frameborder=0;px.style='display:none;visibility:hidden';px.marginheight=0;px.marginwidth=0;px.frameBorder=0;px.scrolling="No";px.hspace=0;px.vspace=0;let bd=document.getElementsByTagName('body')[0].lastChild;bd.parentNode.insertBefore(px,bd);} if(typeof advCustomPixels==='undefined'||!advCustomPixels.hasOwnProperty('session_time')||advCustomPixels.length===0){return;} advCustomPixels['session_time'].forEach(function(sessionTimeItem){if(totalSessionTime>=sessionTimeItem['minimum_time']){addForceIncludePixel(sessionTimeItem['pixel_id']);}});} function manageUserCart(){const advertisersWithCustomCartPixel={'2321':'37800557','1454':'37800555','1416':'37913220'};if(client_id in advertisersWithCustomCartPixel&&hasItemsInDataLayerCart()){addXandrPixel(advertisersWithCustomCartPixel[client_id])}} function manageUser(retries=5,time=1000) {manageUserCart();let gaUserSessionData=getUserSessionData();if(gaUserSessionData){updateSessionTime(gaUserSessionData.session_time);manageUserSession();}else if(retries>0){VxAsyncWrapper.setTimeout(()=>{manageUser(retries-1,time);},time);}} function checkCartItems(dataLayerItem){if(dataLayerItem){if(checkEcommerceItems(dataLayerItem)){return true;} if(checkAddToCartItems(dataLayerItem)){return true;} if(checkSubscriptionEvent(dataLayerItem)){return true;}} return false;} function checkEcommerceItems(dataLayerItem){const validEvents=['add_to_cart','view_cart','begin_checkout'];if(dataLayerItem.ecommerce){if(validEvents.includes(dataLayerItem.event)){const cartItems=dataLayerItem.ecommerce.items;if(cartItems&&cartItems.length>0){return true;}}} return false} function checkAddToCartItems(dataLayerItem){const validEvents=['cart'];if(dataLayerItem.cartProducts){if(validEvents.includes(dataLayerItem.event)){const cartItems=dataLayerItem.cartProducts;if(cartItems&&cartItems.length>0){return true;}}} return false} function checkSubscriptionEvent(dataLayerItem) {const validEventLabels=['formulario:inscricao:inscricao'];if(dataLayerItem.event==='event'&&dataLayerItem.eventLabel){return(validEventLabels.includes(dataLayerItem.eventLabel))} return false;} function hasItemsInDataLayerCart(){return getDataLayerItemWith(checkCartItems)!==null;} function findDataLayer(gtagId){if(!gtagId){return null;} const gtagScripts=document.querySelectorAll('script[src^="https://www.googletagmanager.com/gtag/js"]');for(const tag of gtagScripts){if(!tag.src){continue;} const tagSrc=new URL(tag.src);if(!tagSrc.search.includes(gtagId)){continue;} const dataLayer=tagSrc.searchParams.get('l');if(dataLayer){return dataLayer;}} return null;} function isPageNotRestricted(){if(client_id!=2276||CookiesVx.get(voxus_key+"custom_is_allowed")){return true;} const allowedUrls=['https://www.smiles.com.br/mfe/emissao-passagem','https://www.smiles.com.br/passagens','https://www.smiles.com.br/home',];const currentUrl=window.location.href;const isAllowed=allowedUrls.some(url=>currentUrl.startsWith(url));if(isAllowed){const oneDay=60*60*24 CookiesVx.set(voxus_key+"custom_is_allowed",true,{domain:'.'+__domain__,expires:oneDay});} return isAllowed;} function getCustomUtmFromAssociatedAdvertisers(associatedAdvData,originalSource,originalCampaign,originalMedium){let response={source:originalSource,campaign:originalCampaign,medium:originalMedium};if(typeof associatedAdvData=='undefined'){return response;} Object.values(associatedAdvData).forEach(({kaoq,source,campaign,medium})=>{if(kaoq===true){if(typeof source!='undefined'){response.source=source;} if(typeof campaign!='undefined'){response.campaign=campaign;} if(typeof medium!='undefined'){response.medium=medium;}}});return response;} function getAdvertiserCustomGlobalUtm(advertiser_id,alcs,alcn,alcm){let response={source:alcs,campaign:alcn,medium:alcm,content:'',term:''};if(Object.keys(advWithCustomUtm).length>0){response.source=advWithCustomUtm['utm_source'];response.campaign=advWithCustomUtm['utm_campaign'];response.medium=advWithCustomUtm['utm_medium'];response.content=advWithCustomUtm['utm_content'];response.term=advWithCustomUtm['utm_term'];} return response;} function getUtmParametersToSend(alcs,alcm,alcn){let customUtm=getAdvertiserCustomGlobalUtm(client_id,alcs,alcn,alcm);alcs=customUtm.source;alcn=customUtm.campaign;alcm=customUtm.medium;if(typeof associatedAdvData!=='undefined'&&associatedAdvData!==null){customUtm=getCustomUtmFromAssociatedAdvertisers(associatedAdvData,alcs,alcn,alcm);alcs=customUtm.source;alcn=customUtm.campaign;alcm=customUtm.medium;} const additionalCustomParameters={};const customParams=advWithCustomUtm['custom_params'];if(customParams&&Object.keys(customParams).length>0){for(const[key,value]of Object.entries(customParams)){additionalCustomParameters[key]=value;}} const lastAdSeen=VxImpHandler.getCookieLastAdSeenInformation().creative;if(Object.keys(adsWithCustomData).length===0||lastAdSeen===''||typeof(adsWithCustomData[lastAdSeen])=='undefined'){return{'source':alcs,'medium':alcm,'name':alcn,'content':customUtm.content,'term':customUtm.term,...additionalCustomParameters};}else{return{'source':adsWithCustomData[lastAdSeen].source!=''?adsWithCustomData[lastAdSeen].source:alcs,'medium':adsWithCustomData[lastAdSeen].medium!=''?adsWithCustomData[lastAdSeen].medium:alcm,'name':adsWithCustomData[lastAdSeen].name!=''?adsWithCustomData[lastAdSeen].name:alcn,'content':adsWithCustomData[lastAdSeen].content,'term':adsWithCustomData[lastAdSeen].term!=''?adsWithCustomData[lastAdSeen].term:'',...additionalCustomParameters}}} function gtagFunctionFactory(){const tagIds=getMeasurementIds()||[];const dataLayers=["dataLayer"];for(const tagId of tagIds){const dataLayerName=findDataLayer(tagId);if(dataLayerName){dataLayers.push(dataLayerName);}} const uniqueDataLayers=[...new Set(dataLayers)];for(const dataLayerName of uniqueDataLayers){window[dataLayerName]=window[dataLayerName]||[];} return function(){for(const dataLayerName of uniqueDataLayers){window[dataLayerName].push(arguments);}};} function getPageIdentifier(){let pageIdentifier=parseInt(CookiesVx.get('vx_identifier'));if(isNaN(pageIdentifier)){pageIdentifier=1;} return pageIdentifier;} function getAndIncrementPageIdentifier(){const updatedPageIdentifier=getPageIdentifier()+1;CookiesVx.set('vx_identifier',updatedPageIdentifier,{expires:addDaysToDate(new Date,30).toGMTString()});return updatedPageIdentifier;} function observeRequests(domain,callback){if(typeof PerformanceObserver==='undefined'||typeof observerController!=='object'){return null;} if(observerController.observers[domain]){return observerController.observers[domain];} observerController.observedDomains[domain]=false;observerController.observedRequests[domain]=[];observerController.observers[domain]={getRequests:()=>[...observerController.observedRequests[domain]],stop:()=>{let attempts=0;const maxAttempts=10;const interval=setInterval(()=>{if(observerController.observers[domain]?.observerInstance){observerController.observers[domain].observerInstance.disconnect();delete observerController.observers[domain];clearInterval(interval);}else{attempts++;if(attempts>=maxAttempts){clearInterval(interval);}}},100);},observerInstance:null};performance.getEntriesByType("resource").forEach((entry)=>{if((entry.initiatorType==="xmlhttprequest"||entry.initiatorType==="fetch")&&entry.name.includes(domain)){processObservedRequest(entry.name,domain,callback);}});const observer=new PerformanceObserver((list)=>{list.getEntries().forEach((entry)=>{if(entry.initiatorType==="xmlhttprequest"||entry.initiatorType==="fetch"){processObservedRequest(entry.name,domain,callback);}});});observer.observe({entryTypes:["resource"]});observerController.observers[domain].observerInstance=observer;return observerController.observers[domain];} function processObservedRequest(urlString,domain,callback){if(typeof observerController==='undefined'){return;} try{if(urlString.includes(domain)){observerController.observedRequests[domain].push(urlString);observerController.observedDomains[domain]=true;if(typeof callback==="function"){callback(urlString,observerController.observers[domain]);}}}catch(error){vxLogger.debug("Error in ``processObservedRequest` for advertiser: ",client_id,error);vxLogger.trace(error.stack);}} function generateRandomTfd(){return Math.floor(1000+Math.random()*9000);} function generateNewCid(){const timestamp=Math.floor(Date.now()/1000);const randomPart=Math.floor(100000000+Math.random()*900000000);return randomPart+'.'+timestamp;} function generateSid(){return Math.floor(Date.now()/1000);} function getGAUserAgent(){const userAgent=navigator.userAgent;const uaData=navigator.userAgentData;const chromeVersionMatch=userAgent.match(/Chrome\/(\d+\.\d+\.\d+\.\d+)/);const chromeFullVersion=chromeVersionMatch?chromeVersionMatch[1]:'unknown';return uaData.brands.map(brand=>{if(brand.brand==='Google Chrome'){return`${brand.brand};${chromeFullVersion}`;}else if(brand.brand==='Not A;Brand'){return`Not%3BA%3DBrand;${brand.version}.0.0.0`;}else{return`${brand.brand};${brand.version}.0.6613.138`;}}).join('|')} function getGaCookieKey(){return'_'+'g'+'a';} function getGaCookie(){return CookiesVx.get(getGaCookieKey());} function updateClientGaCookie(newClientId){const originalClientId=getGaCookie();if(typeof originalClientId==='undefined'){return;} const newGaCookie=originalClientId.split('.').slice(0,2).concat(newClientId).join('.');CookiesVx.set(getGaCookieKey(),newGaCookie);} function updateCookieSessionId(sessionId,measurementId){if(!measurementId){return;} const originalSessionCookieId=getGaSessionCookieData(measurementId)?.value;if(!originalSessionCookieId){return;} const gaString='_'+'g'+'a';const gaCookieName=measurementId.replace('G-',gaString+'_');let newSessionCookieId;if(isGS2Implementation(originalSessionCookieId)){const parts=originalSessionCookieId.split('$');const sessionNumber=1;const sessionEngaged=0;const joinTimer=0;const[prefix]=parts[0].split('.s');parts[0]=`${prefix}.s${sessionId}`;const updatedParts=parts.map((part,index)=>{if(index===0){return part;} if(part.startsWith('o')){return`o${sessionNumber}`;} if(part.startsWith('g')){return`g${sessionEngaged}`;} if(part.startsWith('t')){return`t${sessionId}`;} if(part.startsWith('j')){return`j${joinTimer}`;} return part;});newSessionCookieId=updatedParts.join('$');}else{const cookieParts=originalSessionCookieId.split('.');cookieParts[2]=sessionId;cookieParts[3]='1';cookieParts[4]='0';cookieParts[5]=sessionId;cookieParts[6]='0';newSessionCookieId=cookieParts.join('.');} CookiesVx.set(gaCookieName,newSessionCookieId);} function utmsToString(utmParams={}){return new URLSearchParams({'utm_source':utmParams.source||alcs,'utm_campaign':utmParams.name||alcn,'utm_medium':utmParams.medium||'cpl','utm_term':utmParams.term||'',}).toString();} function shouldResetUserByFeatureActivationDate(initialDate,options={}){const{duration=30,baseProb=0.17,maxProb=1,forceResetAfter=30}=options;const MS_PER_DAY=1000*60*60*24;const start=new Date(initialDate).getTime();if(!start)return true;const now=Date.now();const daysPassed=Math.floor((now-start)/MS_PER_DAY);if(daysPassed>=forceResetAfter)return true;const growthPerDay=(maxProb-baseProb)/(duration-1);const prob=baseProb+(growthPerDay*Math.min(daysPassed,duration-1));return Math.random()sendSessionStartMpHit(advertiserId),200);return;} const observedRequests=observerController.observedRequests[domain];if(observedRequests.length===0){return;} let params=getUrlParams(observedRequests[0]);params._s=1;params._ss=1;const queryString=Object.keys(params).map(key=>key+'='+params[key]).join('&');const url='https://'+domain+'?'+queryString;fetch(url,{method:'GET',mode:'no-cors'}).catch((error)=>{vxLogger.debug("Error in `sendSessionStartMpHit` for advertiser:",client_id,error);vxLogger.trace(error.stack);});CookiesVx.set(voxus_key+'ss_sent',true,{domain:'.'+__domain__,expires:addMinutesToDate(new Date,30).toGMTString()});} function getUrlParams(urlString){const url=new URL(urlString);const params=new URLSearchParams(url.search);const paramsObject={};params.forEach((value,key)=>{paramsObject[key]=value;});return paramsObject;} function sessionChanged(currentSessionId){try{if(localStorage.getItem('sessionId')!==currentSessionId){localStorage.setItem('sessionId',currentSessionId);return true;} return false;}catch(e){vxLogger.debug("Error in `sessionChanged` for advertiser: ",client_id,e);vxLogger.trace(e.stack);return false;}} function getSearchParam(paramName){try{const params=new URL(window.location.href).searchParams;return params.get(paramName);}catch(error){vxLogger.debug("Error in `getSearchParam` for advertiser: ",client_id,error);vxLogger.trace(error.stack);return null;}} function getOSDetails(){let userAgent=navigator.userAgent;let platform=navigator.platform;let iosPlatforms=['iPhone','iPad','iPod'];let os="Unknown";let version="Unknown";if(/Android/.test(userAgent)){os="Android";let match=userAgent.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))?/);if(match){version=`${match[1]}.${match[2]||0}.${match[3]||0}`;}}else if(iosPlatforms.indexOf(platform)!==-1||/iPad|iPhone|iPod/.test(userAgent)){os="iOS";let match=userAgent.match(/OS (\d+)(?:_(\d+))?(?:_(\d+))?/);if(match){version=`${match[1]}.${match[2]||0}.${match[3]||0}`;}}else if(/Mac/.test(platform)){os="MacOS";}else if(/Win/.test(platform)){os="Windows";}else if(/Linux/.test(platform)){os="Linux";} return{os,version};} function areFunctionsAvailable(...functionNames){return functionNames.every(fn=>typeof window[fn]==='function');} function getDatalayerTransactionId(datalayerName='dataLayer'){const gaEvent=window[datalayerName]?.find((item)=>item?.event==='purchase');if(!gaEvent){return;} return gaEvent?.['ecommerce']?.transaction_id;} function listenUrlChangesUntil(targetPath,callback){if(!targetPath||!callback){return;} if(window.location.pathname===targetPath){callback();} window.addEventListener('popstate',function(){if(window.location.pathname===targetPath){callback();}});} function normalizeTimestampInSeconds(timestamp){timestamp=Number(timestamp);if(!Number.isFinite(timestamp))return null;const MS_THRESHOLD=1e12;if(timestamp>MS_THRESHOLD){timestamp=Math.floor(timestamp/1000);} return timestamp;} function initializeInternalGtag(){if(algs!=null){return;} if(typeof gtag!="undefined"){algs=gtag;}else if(hasCustomization('multi_data_layer')){algs=gtagFunctionFactory();}else{window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);} algs=gtag;}} async function repeatWithDelay(count,delayMs,sendFn,extraDelays=[]){for(let i=0;isetTimeout(resolve,delay));}}} function sendAdobeHit(params){const ADOBE_PAGE_PARAM2="eVar90";const ADOBE_UTM_PARAM="eVar14";const ADOBE_JUMP_PARAM="eVar15";const utmString=":"+ params["medium"]+":"+ params["source"]+":"+ params["name"]+":";const url=new URL(window.location.href);url.searchParams.set("utm_campaign",params.name);url.searchParams.set("utm_source",params.source);url.searchParams.set("utm_medium",params.medium);if(params.jumpid){url.searchParams.set("jumpid",params.jumpid);} if(typeof alloy!=='function'){return;} alloy("sendEvent",{xdm:{web:{webPageDetails:{URL:url.toString(),pageViews:{value:1}}},_experience:{analytics:{customDimensions:{eVars:{[ADOBE_PAGE_PARAM2]:url.toString(),[ADOBE_UTM_PARAM]:utmString,[ADOBE_JUMP_PARAM]:params.jumpid,props:{prop40:"pageView"}}}}},documentUnloading:true,eventType:"web.webpagedetails.pageViews",}});} function getSessionId(measurementId=null){if(client_id==='2961'){return CookiesVx.get('rl_session')} const gaData=measurementId?getGaSessionCookieData(measurementId):null;let session=gaData?.sessionId||null;if(!session){session=VxVtexAttr.getSessionCookie();} return session;} function getUserId(measurementId=null){const gaData=measurementId?getGaSessionCookieData(measurementId):null;if(gaData){return gaData?.userId;} return thisip;} function setupConversionPixelHook(){const pixelId=customData?.conv_pixel?.pixelId;const button=document.querySelector(customData?.conv_pixel?.querySelector);if(!button){return;} button.addEventListener("clic"+"k",function(){!function(s,a,e,v,n,t,z){if(s.saq)return;n=s.saq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!s._saq)s._saq=n;n.push=n;n.loaded=!0;n.version='1.0';n.queue=[];t=a.createElement(e);t.async=!0;t.src=v;z=a.getElementsByTagName(e)[0];z.parentNode.insertBefore(t,z)}(window,document,'script','https://tags.srv.stackadapt.com/events.js');saq('conv',pixelId);},{once:true});} function setupUniversalPixel(){const pixelId=customData?.universal_pixel?.pixelId if(!pixelId){return;} !function(s,a,e,v,n,t,z){if(s.saq)return;n=s.saq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!s._saq)s._saq=n;n.push=n;n.loaded=!0;n.version='1.0';n.queue=[];t=a.createElement(e);t.async=!0;t.src=v;z=a.getElementsByTagName(e)[0];z.parentNode.insertBefore(t,z)}(window,document,'script','https://tags.srv.stackadapt.com/events.js');saq('ts',pixelId);} function decodeURLComponentEscaped(url){return decodeURIComponent(escape(url));} (function(global,undefined){'use strict';var factory=function(window){if(typeof window.document!=='object'){throw new Error('CookiesVx.js requires a `window` with a `document` object');} var CookiesVx=function(key,value,options){return arguments.length===1?CookiesVx.get(key):CookiesVx.set(key,value,options);};CookiesVx._document=window.document;CookiesVx._cacheKeyPrefix='cookey.';CookiesVx._maxExpireDate=new Date('Fri, 31 Dec 9999 23:59:59 UTC');CookiesVx.defaults={path:'/',secure:true,samesite:'None'};CookiesVx.get=function(key){if(CookiesVx._cachedDocumentCookie!==CookiesVx._document.cookie){CookiesVx._renewCache();} var value=CookiesVx._cache[CookiesVx._cacheKeyPrefix+key];return value===undefined?undefined:decodeURIComponent(value);};CookiesVx.set=function(key,value,options){options=CookiesVx._getExtendedOptions(options);options.expires=CookiesVx._getExpiresDate(value===undefined?-1:options.expires);CookiesVx._document.cookie=CookiesVx._generateCookieString(key,value,options);return CookiesVx;};CookiesVx.expire=function(key,options){return CookiesVx.set(key,undefined,options);};CookiesVx._getExtendedOptions=function(options){const newOptions={path:options&&options.path||CookiesVx.defaults.path,domain:options&&options.domain||CookiesVx.defaults.domain,expires:options&&options.expires||CookiesVx.defaults.expires,secure:options&&options.secure!==undefined?options.secure:CookiesVx.defaults.secure,samesite:options&&options.samesite!==undefined?options.samesite:CookiesVx.defaults.samesite};if(options?.domain===''){newOptions.domain=options.domain;} return newOptions;} CookiesVx._isValidDate=function(date){return Object.prototype.toString.call(date)==='[object Date]'&&!isNaN(date.getTime());};CookiesVx._getExpiresDate=function(expires,now){now=now||new Date();if(typeof expires==='number'){expires=expires===Infinity?CookiesVx._maxExpireDate:new Date(now.getTime()+expires*1000);}else if(typeof expires==='string'){expires=new Date(expires);} if(expires&&!CookiesVx._isValidDate(expires)){throw new Error('`expires` parameter cannot be converted to a valid Date instance');} return expires;};CookiesVx._generateCookieString=function(key,value,options){key=key.replace(/[^#$&+\^`|]/g,encodeURIComponent);key=key.replace(/\(/g,'%28').replace(/\)/g,'%29');value=(value+'').replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent);options=options||{};var cookieString=key+'='+value;cookieString+=options.path?';path='+options.path:'';cookieString+=options.domain?';domain='+options.domain:'';cookieString+=options.expires?';expires='+options.expires.toUTCString():'';cookieString+=options.secure?';secure':'';function shouldSendSameSiteNone(useragent){return!isSameSiteNoneIncompatible(useragent);} function isSameSiteNoneIncompatible(useragent){return hasWebKitSameSiteBug(useragent)||dropsUnrecognizedSameSiteCookies(useragent);} function hasWebKitSameSiteBug(useragent){return isIosVersion(12,useragent)||(isMacosxVersion(10,14,useragent)&&(isSafari(useragent)||isMacEmbeddedBrowser(useragent)));} function dropsUnrecognizedSameSiteCookies(useragent){if(isUcBrowser(useragent)){return!isUcBrowserVersionAtLeast(12,13,2,useragent);} return isChromiumBased(useragent)&&isChromiumVersionAtLeast(51,useragent)&&!isChromiumVersionAtLeast(67,useragent);} function isIosVersion(major,useragent){const regex=/\(iP.+; CPU .*OS (\d+)[_\d]*.*\) AppleWebKit\//g;const match=useragent.match(regex);return match&&match[0]==major;} function isMacosxVersion(major,minor,useragent){const regex=/\(Macintosh;.*Mac OS X (\d+)_(\d+)[_\d]*.*\) AppleWebKit\//g;const match=useragent.match(regex);return match&&(match[0]==major)&&(match[1]==minor);} function isSafari(useragent){const safari_regex=/Version\/.* Safari\//g;return safari_regex.test(useragent)&&!isChromiumBased(useragent);} function isMacEmbeddedBrowser(useragent){const regex=/^Mozilla\/[\.\d]+ \(Macintosh;.*Mac OS X [_\d]+\) AppleWebKit\/[\.\d]+ \(KHTML, like Gecko\)$/g;return regex.test(useragent);} function isChromiumBased(useragent){const regex=/Chrom(e|ium)/g;return regex.test(useragent);} function isChromiumVersionAtLeast(major,useragent){const regex=/Chrom[^ \/]+\/(\d+)[\.\d]* /g;const version=useragent.match(regex)[0];return version>=major;} function isUcBrowser(useragent){const regex=/UCBrowser\//g;return regex.test(useragent);} function isUcBrowserVersionAtLeast(major,minor,build,useragent){const regex=/UCBrowser\/(\d+)\.(\d+)\.(\d+)[\.\d]* /g;const major_version=useragent.match(regex)[0];const minor_version=useragent.match(regex)[1];const build_version=useragent.match(regex)[2];if(major_version!=major){return major_version>major;} if(minor_version!=minor){return minor_version>minor;} return build_version>=build;} if(shouldSendSameSiteNone(window.navigator.userAgent)){cookieString+=';SameSite='+options.samesite+'';} return cookieString;};CookiesVx._getCacheFromString=function(documentCookie){var cookieCache={};var cookiesArray=documentCookie?documentCookie.split('; '):[];for(var i=0;i>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(f>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=vxencd._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/rn/g,"n");var t="";for(var n=0;n127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}} var alcs='voxusmediamanager';var alcn='voxus';var alsd='cpl';if(CookiesVx.get(voxus_key+'_campaign_')!=null){alcn='campaign_'+client_id+'_'+CookiesVx.get(voxus_key+'_campaign_');} function getParameterByNameVx__(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return results===null?"":decodeURIComponent(results[1].replace(/\+/g," "));} CookiesVx.defaults={path:'/',domain:'.'+__domain__,samesite:'None',secure:true};if(redir==null){var acsBef=CookiesVx.get(voxus_key+"_acs");CookiesVx.set(voxus_key+"_acs","true",{domain:'.'+__domain__,expires:30*24*60*60});} var u15PixelsApip=[[7,10273278,10273279],[283,10273280,10273281],[298,10273288,10273289],[246,10273290,10273291],[275,10273294,10273295],[270,10273296,10273297],[244,10273298,10273299],[327,10273301,10273302],[279,10273303,10273304],[329,10372032,10372034],[352,10273096,10273247],[246,10372012,10372013],[275,10372014,10372015],[270,10372018,10372019],[279,10372020,10372021],[283,10372023,10372024],[298,10372026,10372028],[327,10372029,10372030],[352,10372035,10372037],[244,10372038,10372039]];var utmInThisPage=false;var otnoreal=false;if(getParameterByNameVx__('utm_source')=='voxus'){CookiesVx.set(voxus_key+"_adinter_pip",'true',{domain:'.'+__domain__,expires:24*60*60});adinter=true;utmInThisPage=true;if(getParameterByNameVx__("utm_campaign").length>0){if(getParameterByNameVx__("utm_campaign").split('_').length==3){CookiesVx.set(voxus_key+"_campaign_",getParameterByNameVx__("utm_campaign").split('_')[2],{domain:'.'+__domain__,expires:Infinity});} else{CookiesVx.set(voxus_key+"_campaign_",'-1',{domain:'.'+__domain__,expires:Infinity});}}} if(getParameterByNameVx__('utm_source')=='voxusmediamanager'){CookiesVx.set(voxus_key+"_adinter_pip",'true',{domain:'.'+__domain__,expires:24*60*60});adinter=true;utmInThisPage=true;if(getParameterByNameVx__("utm_campaign").length>0){if(getParameterByNameVx__("utm_campaign").split('_').length==3){CookiesVx.set(voxus_key+"_campaign_",getParameterByNameVx__("utm_campaign").split('_')[2],{domain:'.'+__domain__,expires:Infinity});} else{CookiesVx.set(voxus_key+"_campaign_",'-1',{domain:'.'+__domain__,expires:Infinity});}}} if(getParameterByNameVx__('utm_medium')!=""){localStorage.setItem(voxus_key+"_medium",getParameterByNameVx__("utm_medium"));} if(getParameterByNameVx__('utm_source')!=""){localStorage.setItem(voxus_key+"_source",getParameterByNameVx__("utm_source"));} if(getParameterByNameVx__('utm_content')!=""){localStorage.setItem(voxus_key+"_content",getParameterByNameVx__("utm_content"));} if(getParameterByNameVx__('utm_campaign')!=""){localStorage.setItem(voxus_key+"_campaign",getParameterByNameVx__("utm_campaign"));} if(getParameterByNameVx__('utm_source')!=""||getParameterByNameVx__('gclid')){if(typeof CookiesVx.get(voxus_key+"_kopid_pip")!="undefined"&&CookiesVx.get(voxus_key+"_kopid_pip")!=""){for(var u15I=0;u15I-1){igvxtst=true;} if(isFromOther()){igvxtst=true;fromOther=true;}else{if(___vx__runCVL==true){if(typeof CookiesVx.get(voxus_key+"_cvl")=="undefined"){var __v=(Math.floor(Math.random()*10)+1);CookiesVx.set(voxus_key+"_cvl",__v,{domain:'.'+__domain__,expires:60*60*24*15});}} if(typeof CookiesVx.get(voxus_key+"_id")!="undefined"){cookie_id=CookiesVx.get(voxus_key+"_id");} if(CookiesVx.get(voxus_keypip+"_pipcluster")!=""&&typeof CookiesVx.get(voxus_keypip+"_pipcluster")!="undefined"){pipcluster=CookiesVx.get(voxus_keypip+"_pipcluster");} if(CookiesVx.get(voxus_key+"_voxus_testing")=="true"){igvxtst=true;} if(CookiesVx.get(voxus_key+"_converted_gl")=="true"){converted_gl=client_id*12;} if(CookiesVx.get(voxus_key+"_kopid_pip")!=""&&typeof CookiesVx.get(voxus_key+"_kopid_pip")!="undefined"){if(CookiesVx.get(voxus_key+"_inter_view")!="true"){} kopid=true;kopidCooked=true;creativekaoq=VxImpHandler.getCookieLastAdSeenInformation().creative;var sgotasdkaoqsplit=creativekaoq.split("-");if(sgotasdkaoqsplit.length>1){sgotasdkaoq=sgotasdkaoqsplit[1];}} if(CookiesVx.get(voxus_key+"_adinter_pip")=="true"){adinter=true;} if(CookiesVx.get(voxus_key+"_ignore_full_ugi")=="true"){sent_usubida=true;} if(getParameterByNameVx__('voxus_testing')==1){CookiesVx.set(voxus_key+"_voxus_testing",'true',{domain:'.'+__domain__,expires:43200*60*24*365*20});igvxtst=true;} if(CookiesVx.get(voxus_key+"_ignore")=="true"){igvxtst=true;} function setIgnore(){CookiesVx.set(voxus_key+"_ignore",'true',{domain:'.'+__domain__,expires:60*60*24});CookiesVx.set(voxus_key+"_ignoreot_full",'true',{domain:'.'+__domain__,expires:60*60*24});igvxtst=true;fromOther=true;kopid=false;CookiesVx.expire(voxus_key+"_at_pg_ok");VxResetLookupWindow.setOtherPaidMediaCookie();} const ipBlockMap=new Map([['1759',['179.136.39.119','45.190.109.158','23.22.146.56']],['2383',['200.183.70.50','200.170.210.162','187.92.77.116']],]);thisip=thisip||CookiesVx.get(voxus_key+"_ip");if(ipBlockMap.has(client_id)&&thisip&&ipBlockMap.get(client_id).includes(thisip)){setIgnore();} if(VxAttrOnClickUtmHandler.isOtherPaidMediaOnQueryString()){const now=new Date();const oneDayExpiryDate=addDaysToDate(now,1);CookiesVx.set(`${voxus_key}_ignore`,true,{domain:'.'+__domain__,expires:oneDayExpiryDate});CookiesVx.set(`${voxus_key}_ignoreot_full`,true,{domain:'.'+__domain__,expires:oneDayExpiryDate});VxOtherV2Attr.setOtherMediaCooldownCookie(now);CookiesVx.expire(`${voxus_key}_at_pg_ok`);igvxtst=true;fromOther=true;kopid=false;} for(var i=0;i0)||enterpriseId!=0)&&alihuadsanw==false&&!isOnGaHitDelay&&isicgt==false&&lswf==false&&isUserAllowedByType&&!isBlocked);async function checkVxIsActualLastPaidMedia(){if(await VxOtherV2Attr.isVxLastPaidMediaOnAnyAdvertiser())return true;const activeOtherPaidMedia=await VxOtherV2Attr.getActivePaidMedia();if(!activeOtherPaidMedia?.time)return true;const advertiserIds=VxOtherV2Attr.getAttrScopeAdvertiserIds();const vxImpsResults=await Promise.allSettled(advertiserIds.map(id=>VxImpHandler.getVxLastImpression(id)));const vxImpsByAdv=advertiserIds.map((id,index)=>({advertiserId:id,impression:vxImpsResults[index].status==='fulfilled'?vxImpsResults[index].value:null}));sendToLoggly({type:'expire_hit_v3_r',pageview:window.location.href,activePaidMedia:activeOtherPaidMedia,cookie_id,ads:kopid,hasIgnore:CookiesVx.get(voxus_key+"_ignoreot_full"),timestampCookie:vxImpsByAdv});const now=Math.floor(Date.now()/1000);const twentyFourHoursAttrWindowInSeconds=24*60*60;const timePassed=now-activeOtherPaidMedia.time;const timeLeft=twentyFourHoursAttrWindowInSeconds-timePassed;if(timeLeft<=0)return false;CookiesVx.set(voxus_key+'_ignoreot_full','true',{domain:'.'+__domain__,expires:timeLeft});return false;} checkVxIsActualLastPaidMedia().then(isVxLastPaidMedia=>{if(!isVxLastPaidMedia){forceEmptySgarq();return;} if(sendHit)return tryVxAttr();else forceEmptySgarq();});function tryVxAttr(){alcn=UtmParamsHandler.getDefaultVxCampaign();var urlOk=true;if(CookiesVx.get(voxus_key+"_at_pg_ok")!="true"){for(var pgok=0;pgok0){return;}}else{var hasUtms=false;var campaignsUtms=CAMPAIGNS_ENTERPRISE;if(typeof campaignsUtms!="undefined"&&campaignsUtms!=null){var campaignId=CookiesVx.get(voxus_key+"_cp_ent");for(i in campaignsUtms){if(i==campaignId){alcn=campaignsUtms[i].utm_campaign;alcs=campaignsUtms[i].utm_source;alcm=campaignsUtms[i].utm_medium;alcc=campaignsUtms[i].utm_content;hasUtms=true;}}} if(!hasUtms){return false;}} sgarqRun=false;kiphouYiasO=[];var urlTrackerVx2=VOXUS_API_BASE_URL+'/verify/c.php?adv_id='+client_id;var httptrk2=new XMLHttpRequest();httptrk2.open("GET",urlTrackerVx2,true);httptrk2.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");httptrk2.send();httptrk2.onreadystatechange=function(){if(httptrk2.readyState!=4||httptrk2.status!=200){vxAttrStatus.gaNotSent=`http-state-readyState:${httptrk2.readyState}-status:${httptrk2.status}`;return;} var response=JSON.parse(httptrk2.responseText);if(response==null||response.cv==null||response.cv!==false){vxAttrStatus.gaNotSent='response.cv';if(response?.date){const secondsSinceConv=Math.floor((Date.now()-new Date(response.date).getTime())/1000);vxAttrStatus.recentConv=secondsSinceConv>120;} return;} vxAttrStatus.gaNotSent=null;CookiesVx.set(voxus_key+"_assigned",'true',{domain:'.'+__domain__,expires:addMinutesToDate(new Date,30)});VxAdPlacementDomainTracking.sendHit();VxVtexIOAttr.handleAttribution(alcs,alcm,alcn);if(hasCustomization('ga4_reset_session')){VxGA4Attr.resetSession(getMeasurementIds());} if(hasCustomization("conv_skip")&&isConversionPage()){sendToLoggly({type:"conv_skip",pageview:window.location.href.replace("#",""),tp:thisip});vxAttrStatus.gaNotSent='conv-skip';return;} let params=getUtmParametersToSend(alcs,alcm,alcn);if(hasCustomization('new_user_reset')){VxGA4Attr.sendNewUserToAllGaIds(params);} if(hasCustomization('ga_hit')){if(hasCustomization('multiple-ga-hits-with-delay')){sendMultipleAnalyticsHitsWithDelays(()=>VxGA4Attr.sendDefaultPageViewAnalyticsHit());}else{VxGA4Attr.sendDefaultPageViewAnalyticsHit();} alihuadsa=true;alihuadsanw=true;VxResetLookupWindow.setVxPaidMediaCookie();if(hasCustomization("conv_skip")){sendToLoggly({type:"conv_not_skip",pageview:window.location.href.replace("#",""),tp:thisip,});return;} if(!hasCustomization('ga-hits-with-no-delay')){CookiesVx.set(voxus_key+"_ignore_full_ugi",'true',{domain:'.'+__domain__,expires:addMinutesToDate(new Date,1)});}} if(hasCustomization('nemu_hit')){VxNemuAttr.sendNemuHit(params);} if(hasCustomization('mtm_hit')&&_paq){const url=new URL(window.location.href);url.searchParams.append('utm_campaign',params.name);url.searchParams.append('utm_source',params.source);url.searchParams.append('utm_medium',params.medium);_paq.push(['setCustomUrl',url.toString()]);_paq.push(['trackPageView']);} VxVtexAttr.handleAttribution(params);VxPlausibleAttr.handleAttribution(params);if(hasCustomization('amp_hit')&&typeof amplitude==='object'){const identifyObj=new amplitude.Identify();identifyObj.set('utm_campaign',params.name);identifyObj.set('utm_medium',params.medium);identifyObj.set('utm_source',params.source);amplitude.identify(identifyObj);} if(hasCustomization('adobe_hit')){VxAdobeAttr.sendAdobeHit(params);}} function sendMultipleAnalyticsHitsWithDelays(sendFn,delays=[2000,2000,5000,10000]){(async()=>{await repeatWithDelay(delays.length+1,2000,sendFn,delays);})();} function isConversionPage(){const allConversionPaths=subusubidaPages.concat(usubidaPages).map((page)=>page.replace("/",""));return allConversionPaths.some((path)=>window.location.pathname.includes(path));} function getCustomUtmFromAssociatedAdvertisers(associatedAdvData,originalSource,originalCampaign,originalMedium){let response={source:originalSource,campaign:originalCampaign,medium:originalMedium};if(typeof associatedAdvData=='undefined'){return response;} Object.values(associatedAdvData).forEach(({kaoq,source,campaign,medium})=>{if(kaoq===true){if(typeof source!='undefined'){response.source=source;} if(typeof campaign!='undefined'){response.campaign=campaign;} if(typeof medium!='undefined'){response.medium=medium;}}});return response;} function getAdvertiserCustomGlobalUtm(advertiser_id,alcs,alcn,alcm){const response={source:alcs,campaign:alcn,medium:alcm,content:'',term:''};if(Object.keys(advWithCustomUtm).length>0){response.source=advWithCustomUtm['utm_source'];response.campaign=advWithCustomUtm['utm_campaign'];response.medium=advWithCustomUtm['utm_medium'];response.content=advWithCustomUtm['utm_content'];response.term=advWithCustomUtm['utm_term'];} return response;} function getUtmParametersToSend(alcs,alcm,alcn){let customUtm=getAdvertiserCustomGlobalUtm(client_id,alcs,alcn,alcm);alcs=customUtm.source;alcn=customUtm.campaign;alcm=customUtm.medium;if(typeof associatedAdvData!=='undefined'&&associatedAdvData!==null){customUtm=getCustomUtmFromAssociatedAdvertisers(associatedAdvData,alcs,alcn,alcm);alcs=customUtm.source;alcn=customUtm.campaign;alcm=customUtm.medium;} const aditionalCustomParameters={};const customParams=advWithCustomUtm['custom_params'];if(customParams&&Object.keys(customParams).length>0){for(const[key,value]of Object.entries(customParams)){aditionalCustomParameters[key]=value;}} const lastAdSeen=VxImpHandler.getCookieLastAdSeenInformation().creative;if(Object.keys(adsWithCustomData).length===0||lastAdSeen===''||typeof(adsWithCustomData[lastAdSeen])=='undefined'){return{'source':alcs,'medium':alcm,'name':alcn,'content':customUtm.content,'term':customUtm.term,...aditionalCustomParameters};}else{return{'source':adsWithCustomData[lastAdSeen].source!=''?adsWithCustomData[lastAdSeen].source:alcs,'medium':adsWithCustomData[lastAdSeen].medium!=''?adsWithCustomData[lastAdSeen].medium:alcm,'name':adsWithCustomData[lastAdSeen].name!=''?adsWithCustomData[lastAdSeen].name:alcn,'content':adsWithCustomData[lastAdSeen].content,'term':adsWithCustomData[lastAdSeen].term!=''?adsWithCustomData[lastAdSeen].term:'',...aditionalCustomParameters}}} forceEmptySgarq();} function forceEmptySgarq(){sgarq=function(){};}} checkStatisticsConvUser();}}} if(!hasCustomization('disable_set_interval')){VxAsyncWrapper.setInterval(verifyPage,1000);} if(isFromOther()){return false;} sgarq=function() {var creativesUtms=[];if(clientDomainWl.length==0){clientDomain=clientDomain.replace("www.","");if(window.location.href.toLowerCase().indexOf(clientDomain.toLowerCase())===-1){return;}}else{var domainBlocked=true;for(bl=0;bl0)||enterpriseId!=0)&&alihuadsanw==false&&!isOnGaHitDelay&&isicgt==false&&lswf==false&&isUserAllowedByType&&!isBlocked);async function checkVxIsActualLastPaidMedia(){if(await VxOtherV2Attr.isVxLastPaidMediaOnAnyAdvertiser())return true;const activeOtherPaidMedia=await VxOtherV2Attr.getActivePaidMedia();if(!activeOtherPaidMedia?.time)return true;const advertiserIds=VxOtherV2Attr.getAttrScopeAdvertiserIds();const vxImpsResults=await Promise.allSettled(advertiserIds.map(id=>VxImpHandler.getVxLastImpression(id)));const vxImpsByAdv=advertiserIds.map((id,index)=>({advertiserId:id,impression:vxImpsResults[index].status==='fulfilled'?vxImpsResults[index].value:null}));sendToLoggly({type:'expire_hit_v3_r',pageview:window.location.href,activePaidMedia:activeOtherPaidMedia,cookie_id,ads:kopid,hasIgnore:CookiesVx.get(voxus_key+"_ignoreot_full"),timestampCookie:vxImpsByAdv});const now=Math.floor(Date.now()/1000);const twentyFourHoursAttrWindowInSeconds=24*60*60;const timePassed=now-activeOtherPaidMedia.time;const timeLeft=twentyFourHoursAttrWindowInSeconds-timePassed;if(timeLeft<=0)return false;CookiesVx.set(voxus_key+'_ignoreot_full','true',{domain:'.'+__domain__,expires:timeLeft});return false;} checkVxIsActualLastPaidMedia().then(isVxLastPaidMedia=>{if(!isVxLastPaidMedia){forceEmptySgarq();return;} if(sendHit)return tryVxAttr();else forceEmptySgarq();});function tryVxAttr(){alcn=UtmParamsHandler.getDefaultVxCampaign();var urlOk=true;if(CookiesVx.get(voxus_key+"_at_pg_ok")!="true"){for(var pgok=0;pgok0){return;}}else{var hasUtms=false;var campaignsUtms=CAMPAIGNS_ENTERPRISE;if(typeof campaignsUtms!="undefined"&&campaignsUtms!=null){var campaignId=CookiesVx.get(voxus_key+"_cp_ent");for(i in campaignsUtms){if(i==campaignId){alcn=campaignsUtms[i].utm_campaign;alcs=campaignsUtms[i].utm_source;alcm=campaignsUtms[i].utm_medium;alcc=campaignsUtms[i].utm_content;hasUtms=true;}}} if(!hasUtms){return false;}} sgarqRun=false;kiphouYiasO=[];var urlTrackerVx2=VOXUS_API_BASE_URL+'/verify/c.php?adv_id='+client_id;var httptrk2=new XMLHttpRequest();httptrk2.open("GET",urlTrackerVx2,true);httptrk2.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");httptrk2.send();httptrk2.onreadystatechange=function(){if(httptrk2.readyState!=4||httptrk2.status!=200){vxAttrStatus.gaNotSent=`http-state-readyState:${httptrk2.readyState}-status:${httptrk2.status}`;return;} var response=JSON.parse(httptrk2.responseText);if(response==null||response.cv==null||response.cv!==false){vxAttrStatus.gaNotSent='response.cv';if(response?.date){const secondsSinceConv=Math.floor((Date.now()-new Date(response.date).getTime())/1000);vxAttrStatus.recentConv=secondsSinceConv>120;} return;} vxAttrStatus.gaNotSent=null;CookiesVx.set(voxus_key+"_assigned",'true',{domain:'.'+__domain__,expires:addMinutesToDate(new Date,30)});VxAdPlacementDomainTracking.sendHit();VxVtexIOAttr.handleAttribution(alcs,alcm,alcn);if(hasCustomization('ga4_reset_session')){VxGA4Attr.resetSession(getMeasurementIds());} if(hasCustomization("conv_skip")&&isConversionPage()){sendToLoggly({type:"conv_skip",pageview:window.location.href.replace("#",""),tp:thisip});vxAttrStatus.gaNotSent='conv-skip';return;} let params=getUtmParametersToSend(alcs,alcm,alcn);if(hasCustomization('new_user_reset')){VxGA4Attr.sendNewUserToAllGaIds(params);} if(hasCustomization('ga_hit')){if(hasCustomization('multiple-ga-hits-with-delay')){sendMultipleAnalyticsHitsWithDelays(()=>VxGA4Attr.sendDefaultPageViewAnalyticsHit());}else{VxGA4Attr.sendDefaultPageViewAnalyticsHit();} alihuadsa=true;alihuadsanw=true;VxResetLookupWindow.setVxPaidMediaCookie();if(hasCustomization("conv_skip")){sendToLoggly({type:"conv_not_skip",pageview:window.location.href.replace("#",""),tp:thisip,});return;} if(!hasCustomization('ga-hits-with-no-delay')){CookiesVx.set(voxus_key+"_ignore_full_ugi",'true',{domain:'.'+__domain__,expires:addMinutesToDate(new Date,1)});}} if(hasCustomization('nemu_hit')){VxNemuAttr.sendNemuHit(params);} if(hasCustomization('mtm_hit')&&_paq){const url=new URL(window.location.href);url.searchParams.append('utm_campaign',params.name);url.searchParams.append('utm_source',params.source);url.searchParams.append('utm_medium',params.medium);_paq.push(['setCustomUrl',url.toString()]);_paq.push(['trackPageView']);} VxVtexAttr.handleAttribution(params);VxPlausibleAttr.handleAttribution(params);if(hasCustomization('amp_hit')&&typeof amplitude==='object'){const identifyObj=new amplitude.Identify();identifyObj.set('utm_campaign',params.name);identifyObj.set('utm_medium',params.medium);identifyObj.set('utm_source',params.source);amplitude.identify(identifyObj);} if(hasCustomization('adobe_hit')){VxAdobeAttr.sendAdobeHit(params);}} function sendMultipleAnalyticsHitsWithDelays(sendFn,delays=[2000,2000,5000,10000]){(async()=>{await repeatWithDelay(delays.length+1,2000,sendFn,delays);})();} function isConversionPage(){const allConversionPaths=subusubidaPages.concat(usubidaPages).map((page)=>page.replace("/",""));return allConversionPaths.some((path)=>window.location.pathname.includes(path));} function getCustomUtmFromAssociatedAdvertisers(associatedAdvData,originalSource,originalCampaign,originalMedium){let response={source:originalSource,campaign:originalCampaign,medium:originalMedium};if(typeof associatedAdvData=='undefined'){return response;} Object.values(associatedAdvData).forEach(({kaoq,source,campaign,medium})=>{if(kaoq===true){if(typeof source!='undefined'){response.source=source;} if(typeof campaign!='undefined'){response.campaign=campaign;} if(typeof medium!='undefined'){response.medium=medium;}}});return response;} function getAdvertiserCustomGlobalUtm(advertiser_id,alcs,alcn,alcm){const response={source:alcs,campaign:alcn,medium:alcm,content:'',term:''};if(Object.keys(advWithCustomUtm).length>0){response.source=advWithCustomUtm['utm_source'];response.campaign=advWithCustomUtm['utm_campaign'];response.medium=advWithCustomUtm['utm_medium'];response.content=advWithCustomUtm['utm_content'];response.term=advWithCustomUtm['utm_term'];} return response;} function getUtmParametersToSend(alcs,alcm,alcn){let customUtm=getAdvertiserCustomGlobalUtm(client_id,alcs,alcn,alcm);alcs=customUtm.source;alcn=customUtm.campaign;alcm=customUtm.medium;if(typeof associatedAdvData!=='undefined'&&associatedAdvData!==null){customUtm=getCustomUtmFromAssociatedAdvertisers(associatedAdvData,alcs,alcn,alcm);alcs=customUtm.source;alcn=customUtm.campaign;alcm=customUtm.medium;} const aditionalCustomParameters={};const customParams=advWithCustomUtm['custom_params'];if(customParams&&Object.keys(customParams).length>0){for(const[key,value]of Object.entries(customParams)){aditionalCustomParameters[key]=value;}} const lastAdSeen=VxImpHandler.getCookieLastAdSeenInformation().creative;if(Object.keys(adsWithCustomData).length===0||lastAdSeen===''||typeof(adsWithCustomData[lastAdSeen])=='undefined'){return{'source':alcs,'medium':alcm,'name':alcn,'content':customUtm.content,'term':customUtm.term,...aditionalCustomParameters};}else{return{'source':adsWithCustomData[lastAdSeen].source!=''?adsWithCustomData[lastAdSeen].source:alcs,'medium':adsWithCustomData[lastAdSeen].medium!=''?adsWithCustomData[lastAdSeen].medium:alcm,'name':adsWithCustomData[lastAdSeen].name!=''?adsWithCustomData[lastAdSeen].name:alcn,'content':adsWithCustomData[lastAdSeen].content,'term':adsWithCustomData[lastAdSeen].term!=''?adsWithCustomData[lastAdSeen].term:'',...aditionalCustomParameters}}} forceEmptySgarq();} function forceEmptySgarq(){sgarq=function(){};}} intervalDocumentOnloadVoxusDsp=VxAsyncWrapper.setInterval(function(){if(document.body==null){return;} clearInterval(intervalDocumentOnloadVoxusDsp);var objclk=null;var random=Math.random()*10000000000000000000;checkStatisticsConvUser();if(typeof window.onpopstate=='function'){var onpopstatefunctionvx=window.onpopstate;window.onpopstate=function(){sdloggly(true);checkStatisticsConvUser();onpopstatefunctionvx();}} if(typeof window.addEventListener=='function'){window.addEventListener('hashchange',function(){sdloggly(true);if(typeof reloadPixels=='function'){reloadPixels();} checkStatisticsConvUser();if(typeof checkEnterprise=="function"){checkEnterprise();} for(var i=0;i{try{const url=new URL(request);return url.searchParams.has('en')&&url.searchParams.get('en')==='page_view';}catch(error){vxLogger.debug("Error while searching params in `stopObservingAfterPageViewEvent` for advertiser: ",client_id,error);vxLogger.trace(error.stack);return false;}});if(event){observerController.stop();}}catch(error){vxLogger.debug("Error in `stopObservingAfterPageViewEvent` for advertiser: ",client_id,error);vxLogger.trace(error.stack);}} customClickChecking();let previousDataLayerLength=0;function trackClickElements(newDataLayerItem,trackingClickElements){if(!Array.isArray(trackingClickElements)){return;} if(typeof trackedElements['cliques']==='undefined') trackedElements['cliques']={};const trackedElement=newDataLayerItem['gtm.element'];trackingClickElements.forEach(function(trackingElement){if(trackedElement.closest(trackingElement)){if(typeof trackedElements['cliques'][trackingElement]==='undefined'||!trackedElements['cliques'][trackingElement]){trackedElements['cliques'][trackingElement]=true;sdloggly(true);}}});} function dataLayerTracking(trackingElements){if(dataLayer.length===previousDataLayerLength){return{};} const newDataLayerItems=dataLayer.slice(previousDataLayerLength);newDataLayerItems.forEach(function(newDataLayerItem){if(trackingElements['cliques']&&newDataLayerItem.event===('gtm.'+'cli'+'ck')&&typeof newDataLayerItem['gtm.element']!=='undefined'){trackClickElements(newDataLayerItem,trackingElements['cliques'])} if(trackingElements['scroll']&&newDataLayerItem.event==='gtm.scrollDepth'){trackedElements['scroll']=true;sdloggly(true);}});previousDataLayerLength=dataLayer.length;} function startDataLayerTracking() {const trackingElements=JSON.parse("{}");initializeTrackedElements(trackingElements);VxAsyncWrapper.setInterval(()=>dataLayerTracking(trackingElements),2000);} function initializeTrackedElements(trackingElements) {for(const key in trackingElements){if(trackingElements.hasOwnProperty(key)){if(Array.isArray(trackingElements[key])){trackedElements[key]={};trackingElements[key].forEach(element=>{trackedElements[key][element]=false;});}else{trackedElements[key]=false;}}}} if(hasCustomization('custom_tracking')){startDataLayerTracking();} function checkStatisticsConvUser(page){if(typeof page=="undefined"){page=false;} if(CookiesVx.get(voxus_key+"_converted")!="true"&&(kopid==true||adinter==true)){sgarq();} if(CookiesVx.get(voxus_key+"_converted")!="true"&&(kopid==true||adinter==true)&&alihuadsa){var objclk=null;if(page===false){page=window.location.href;} for(var i=0;i1){objclk=document.getElementById(idobjclk[1]);}}}} if(objclk!=null){objclk.addEventListener("inter",function(){if(interConversion==false){interConversion=true;sgarq();for(var i=0;i-1){ignoreThis=true;}} if(ignoreThis){return;} if(hasCustomization('ga_hit')&&!getFixedMeasurementId()){VxAsyncWrapper.setTimeout(()=>sdlogglyinter(eventClick,md5Event),200);return;} let observedRequests='';if(hasCustomization('analytics_observer')&&typeof observerController==='object'&&observerController.observedDomains&&observerController.observedRequests){const isAllDomainsReady=Object.values(observerController.observedDomains).every(status=>status===true);if(!isAllDomainsReady){VxAsyncWrapper.setTimeout(()=>sdloggly(force),200);return;} observedRequests=Object.values(observerController.observedRequests).flat().join(',')||"";} alihuadsa=alihuadsanw;if(alihuadsa==true){alihuadsa=1;}else{alihuadsa=0;} var dateLoggly=new Date();var yearString=dateLoggly.getUTCFullYear()+"";var monthString=(dateLoggly.getUTCMonth()+1)+"";if(monthString.length==1){monthString="0"+monthString;} var dayString=dateLoggly.getUTCDate()+"";if(dayString.length==1){dayString="0"+dayString;} var hourString=dateLoggly.getUTCHours()+"";if(hourString.length==1){hourString="0"+hourString;} var minuteString=dateLoggly.getUTCMinutes()+"";if(minuteString.length==1){minuteString="0"+minuteString;} var secondString=dateLoggly.getUTCSeconds()+"";if(secondString.length==1){secondString="0"+secondString;} var dateLogglyString=yearString+"-"+monthString+"-"+dayString+" "+hourString+":"+minuteString+":"+secondString;var liftStudy=0;if(___vx__runCVL==true){if(typeof CookiesVx.get(voxus_key+"_cvl")!="undefined"){if(CookiesVx.get(voxus_key+"_cvl")==1){liftStudy=1;}}} const measurementId=getFixedMeasurementId();var data={};data.typeinter=eventClick;data.button=md5Event;data.version=sayswho();data.tp=thisip;if(hasCustomization('user_behavior')){let userGaSessionData=getUserSessionData(measurementId);data.session_time=userGaSessionData?userGaSessionData.session_time:-1;data.vx_session_pages_qt=userGaSessionData?userGaSessionData.vx_session_pages_qt:-1;data.has_items_in_cart=hasItemsInDataLayerCart();} data.lftst=liftStudy;data.pageview=window.location.href.replace("#","");data.data=dateLogglyString;data.action='mediamanager';data.usubidaimpression=totalSes;data.kopidcooked=kopidCooked;data.usubidainter=adinter;data.kopidpip=kopid;data.sgotasdkaoq=sgotasdkaoq;data.creative=creativekaoq;data.other=isFromOther();data.otherv2=fromOtherv2;data.recent_conv=vxAttrStatus.recentConv;data.ga=alihuadsa;data.ds_hit_sent=analyticsAttributionHitsSentOnPage.ds;data.tf_ds_hit_sent=analyticsAttributionHitsSentOnPage.tfDs;data.ga_not_sent_reason=vxAttrStatus.gaNotSent;data.new_user_not_reset_reason=noNewUserResetReason;data.lftst=analyticsAttributionHitsSentOnPage.ga?1:0;data.pipcluster=pipcluster;data.cookie_id=cookie_id;data.mobile=ismobile;data.ignore=igvxtst;data.creative=creativekaoq;if(hasCustomization('analytics_observer')&&observedRequests){data.analytics_requests=observedRequests;} var protocol=window.location.protocol.replace(":","");var token='27cf9a30-eb89-41a7-ba82-3280d33fb2cf';var urlLoggly=protocol+"://logs-01.loggly.com/inputs/"+token+"/tag/"+protocol+"/";var httploggly=new XMLHttpRequest();httploggly.open("POST",urlLoggly,true);httploggly.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");httploggly.send(JSON.stringify(data));httploggly.onreadystatechange=function(){if(httploggly.readyState==4){if(httploggly.status!=200){sdloggly(false);}else{var response=JSON.parse(httploggly.responseText);if(response==null||typeof response.response=="undefined"||response.response!="ok"){sdloggly(false);}}}}} function getOperatingSystem(){let userAgent=navigator.userAgent;let platform=navigator.platform;let macosPlatforms=['Macintosh','MacIntel','MacPPC','Mac68K'];let windowsPlatforms=['Win32','Win64','Windows','WinCE'];let iosPlatforms=['iPhone','iPad','iPod'];let os=null;if(macosPlatforms.indexOf(platform)!==-1){os='Mac OS';}else if(iosPlatforms.indexOf(platform)!==-1){os='iOS';}else if(windowsPlatforms.indexOf(platform)!==-1){os='Windows';}else if(/Android/.test(userAgent)){os='Android';}else if(!os&&/Linux/.test(platform)){os='Linux';} else{os="Unidentified"} return os;} async function sdloggly(force) {var ignoreThis=false;for(it=0;it-1){ignoreThis=true;}} if(ignoreThis){return;} if(hasCustomization('ga_hit')&&!getFixedMeasurementId()){VxAsyncWrapper.setTimeout(()=>sdloggly(force),200);return;} let observedRequests='';if(hasCustomization('analytics_observer')&&typeof observerController==='object'&&observerController.observedDomains&&observerController.observedRequests){const isAllDomainsReady=Object.values(observerController.observedDomains).every(status=>status===true);if(!isAllDomainsReady){VxAsyncWrapper.setTimeout(()=>sdloggly(force),200);return;} observedRequests=Object.values(observerController.observedRequests).flat().join(',')||"";} totalLogglys++;if(totalLogglys>=10){return;} logglyloadvoxus=true;if(typeof force=="undefined"){force=false;} alihuadsa=alihuadsanw;if(alihuadsa==true){alihuadsa=1;}else{alihuadsa=0;} if(alihuadsa==0){if(CookiesVx.get(voxus_key+"_ignore_full_ugi")=="true"){alihuadsa=1;}} var dateLoggly=new Date();var yearString=dateLoggly.getUTCFullYear()+"";var monthString=(dateLoggly.getUTCMonth()+1)+"";if(monthString.length==1){monthString="0"+monthString;} var dayString=dateLoggly.getUTCDate()+"";if(dayString.length==1){dayString="0"+dayString;} var hourString=dateLoggly.getUTCHours()+"";if(hourString.length==1){hourString="0"+hourString;} var minuteString=dateLoggly.getUTCMinutes()+"";if(minuteString.length==1){minuteString="0"+minuteString;} var secondString=dateLoggly.getUTCSeconds()+"";if(secondString.length==1){secondString="0"+secondString;} var dateLogglyString=yearString+"-"+monthString+"-"+dayString+" "+hourString+":"+minuteString+":"+secondString;var typeWindow=3;if(window.opener){typeWindow=1;}else if(window.top!==window.self){typeWindow=2;}else{typeWindow=3;} var widthAnalysis=800;var heightAnalysis=800;if(typeof document!="undefined"&&typeof document.documentElement!="undefined"){widthAnalysis=document.documentElement.clientWidth;heightAnalysis=document.documentElement.clientHeight;} var liftStudy=0;if(___vx__runCVL==true){if(typeof CookiesVx.get(voxus_key+"_cvl")!="undefined"){if(CookiesVx.get(voxus_key+"_cvl")==1){liftStudy=1;}}} const measurementId=getFixedMeasurementId();var data={};data.os=getOperatingSystem();if(typeof isNewUser!="undefined"){data.new_user=isNewUser();} if(hasCustomization('custom_conv_id')&&typeof getConvIdForAdvertiser!='undefined'){const conv_id=getConvIdForAdvertiser();if(conv_id){data.conv_id=conv_id;}} const voxus_last_impression_timestamp=VxImpHandler.getCookieLastAdSeenInformation();if(voxus_last_impression_timestamp?.time){data.voxus_last_impression_timestamp=voxus_last_impression_timestamp.time;data.voxus_user_return_timestamp=Math.floor(Date.now()/1000);data.voxus_last_entry_before_impression=CookiesVx.get('voxus_last_entry_before_impression');}else{const thirtyDays=60*60*24*30;CookiesVx.set('voxus_last_entry_before_impression',Math.floor(Date.now()/1000),{domain:'.'+__domain__,expires:thirtyDays})} data.index_nck_version=indexNckVersion;if(typeof tagVersion!=='undefined'){data.tag_version=tagVersion;} if(typeof tagSemanticVersion!=='undefined'){data.tag_semversion=tagSemanticVersion;} data.assigned=CookiesVx.get(voxus_key+"_assigned")=='true';if(typeof getUtmParametersToSend==='function'){const utms=getUtmParametersToSend();data.source=utms.source;data.medium=utms.medium;data.campaign=utms.name;} data.width=widthAnalysis;data.height=heightAnalysis;data.tp=thisip;if(hasCustomization('user_behavior')){let userGaSessionData=getUserSessionData(measurementId);data.session_time=userGaSessionData?userGaSessionData.session_time:-1;data.vx_session_pages_qt=userGaSessionData?userGaSessionData.vx_session_pages_qt:-1;data.has_items_in_cart=hasItemsInDataLayerCart();} if(hasCustomization('custom_tracking')&&typeof trackedElements!=='undefined'){data.custom_tracking=trackedElements;} data.pageview=window.location.href.replace("#","");data.data=dateLogglyString;data.action='mediamanager';data.usubidainter=adinter;data.lftst=liftStudy;data.kopidpip=kopid;data.category=CookiesVx.get(voxus_key+"_seg_kaoq");data.sgotasdkaoq=sgotasdkaoq;data.creative=creativekaoq;data.other=isFromOther();data.otherv2=fromOtherv2;data.recent_conv=vxAttrStatus.recentConv;data.ga=alihuadsa;data.ds_hit_sent=analyticsAttributionHitsSentOnPage.ds;data.tf_ds_hit_sent=analyticsAttributionHitsSentOnPage.tfDs;data.ga_not_sent_reason=vxAttrStatus.gaNotSent;data.new_user_not_reset_reason=noNewUserResetReason;data.lftst=analyticsAttributionHitsSentOnPage.ga?1:0;data.cookie_id=cookie_id;if(hasCustomization('2753_custom_track')){data.wpp_triggered=wppTriggered;data.appointment_triggered=appointmentTriggered;} const session=getSessionId(measurementId);data.mobile=ismobile;data.creative=creativekaoq;data.dimension=false;data.session=session;data.user_id=getUserId(measurementId);data.sessionChanged=sessionChanged(session);data.sessionReseted=CookiesVx.get(voxus_key+"_session_reseted");data.actv_paid_media=await VxOtherV2Attr.getActivePaidMedia();if(VxResetLookupWindow.hasLookupCustomization()){data.lookup_w_rst=VxResetLookupWindow.getResetCount();} if(hasCustomization('analytics_observer')&&observedRequests){data.analytics_requests=observedRequests;} if(typeof getPageIdentifier==='function'){data.page_identifier=getPageIdentifier();} if(hasCustomization('register_first_page')){data.first_page=CookiesVx.get(voxus_key+"_registered_first_page")!="true";} if(CookiesVx.get(voxus_key+"_dimension")=="true"){data.dimension=true;} if(typeof CookiesVx.get(voxus_key+"_lkaoq")!="undefined"&&CookiesVx.get(voxus_key+"_lkaoq")!=""){data.lkaoq=CookiesVx.get(voxus_key+"_lkaoq");} if(CookiesVx.get(voxus_key+"_lrf")!=""){data.lref=CookiesVx.get(voxus_key+"_lrf");} if(typeof CookiesVx.get(voxus_key+"_cp_ent")!='undefined'){data.campaign_id=CookiesVx.get(voxus_key+"_cp_ent");} var protocol=window.location.protocol.replace(":","");var token='27cf9a30-eb89-41a7-ba82-3280d33fb2cf';var urlLoggly=protocol+"://logs-01.loggly.com/inputs/"+token+"/tag/"+protocol+"/";var httploggly=new XMLHttpRequest();httploggly.open("POST",urlLoggly,true);httploggly.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");httploggly.send(JSON.stringify(data));lastDataLoggly=data;var iNew=document.createElement('img');iNew.id='inserted_log_27c';iNew.style="border-style:none;visibility:hidden;position:absolute;z-index:-1;display:none";iNew.width=iNew.height=1;document.body.appendChild(iNew);httploggly.onreadystatechange=function(){if(httploggly.readyState!=4){return;} if(httploggly.status!=200){sdloggly(false);return;} if(hasCustomization('register_first_page')){CookiesVx.set(voxus_key+"_registered_first_page",'true',{domain:window.location.hostname.replace('www',''),expires:addDaysToDate(new Date,1).toGMTString()});} var response=JSON.parse(httploggly.responseText);if(response==null||typeof response.response=="undefined"||response.response!="ok"){sdloggly(false);}}} VxAsyncWrapper.setTimeout(function(){logglyOnloadVoxusDsp=VxAsyncWrapper.setInterval(function(){if(document.body==null){return;} if(logglyloadvoxus){clearInterval(logglyOnloadVoxusDsp);return;} if(document.getElementById('lgvx')!=null){clearInterval(logglyOnloadVoxusDsp);return;} if(__domain__.indexOf('vtexcommercestable.com.br')>-1){clearInterval(logglyOnloadVoxusDsp);return;} sdloggly();clearInterval(logglyOnloadVoxusDsp);},3000);},3000);var inputs,index;inputs=document.getElementsByTagName('input');function sdconv() {sgarqRun=true;var data=new FormData();data.append('client',client_id);data.append('campaign',CookiesVx.get(voxus_key+"_campaign_"));var typeConversion=0;if(kopid==true&&adinter=="true"){typeConversion=1;}else if(kopid==true){typeConversion=2;}else if(adinter==true){typeConversion=1;} var xmlhttp=new XMLHttpRequest();CookiesVx.set(voxus_key+"_converted","true",{domain:'.'+__domain__,expires:60*60});CookiesVx.set(voxus_key+"_converted_gl","true",{domain:'.'+__domain__,expires:60*60});CookiesVx.expire(voxus_key+"_adinter_pip");CookiesVx.expire(voxus_key+"_kopid_pip");var axel=Math.random()+"";var a=axel*10000000000000;var pipscript2=document.createElement('img');pipscript2.src="https://secure.adnxs.com/seg?add=10100757:"+(client_id*12)+"&t=2";pipscript2.frameborder=0;pipscript2.async=true;pipscript2.width=pipscript2.height=1;pipscript2.style='display:none;visibility:hidden';pipscript2.height=0;pipscript2.width=0;pipscript2.hspace="0";pipscript2.vspace="0";pipscript2.marginheight="0";pipscript2.marginwidth="0";pipscript2.frameBorder="0";pipscript2.scrolling="No";var s=document.getElementsByTagName('body')[0].lastChild;s.parentNode.insertBefore(pipscript2,s);var urlTrackerVx=VOXUS_API_BASE_URL+"/track.png?adv_id="+client_id+"&cv=true";var httptrk=new XMLHttpRequest();httptrk.open("GET",urlTrackerVx,true);httptrk.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");httptrk.send();VxAdPlacementDomainTracking.sendHit(true);CookiesVx.set(voxus_key+"_usubida_tracking",true,{domain:'.'+__domain__,expires:60*60*24*7});} function getConvIdForAdvertiser(){if(VxVtexAttr.getConversionId()){return VxVtexAttr.getConversionId();} const msIds=getMeasurementIds();if(!msIds||msIds.length===0){return;} return getDatalayerTransactionId(findDataLayer(msIds.at(0)));} function sdinterv() {} function __voxusTrackConversion(){if(CookiesVx.get(voxus_key+"_converted")!="true"&&(kopid=="true"||adinter=="true")){if(converted==true){return;} sgarqRun=true;sgarq();if(CookiesVx.get(voxus_key+"_campaign_")==null){for(var i=0;isdloggly(true)});} if(hasCustomization('track_conv_url')){listenUrlChangesUntil(usubidaPages[0],()=>sdloggly(true));} reloadPixels();} checkEnterprise=function(){function getCustomDimensionRtgAttributionDays(){return client_id==='2753'?1:30;} function getTopFunnelLiftCampaigns(mainCpgId){let ids=[];if(tfAdvId===2797){ids=[27372121,27372348];} ids.push(mainCpgId);return ids;} async function processSecondaryDimension(){if(!hasCustomization('ds_hit')){return;} const isIpa=CookiesVx.get(voxus_key+"_acs")!="true";const response=await VxImpHandler.getVerifyTrackData(client_id,cookie_id,isIpa);var acsBef=CookiesVx.get(voxus_key+"_acs");CookiesVx.set(voxus_key+"_acs","true",{domain:'.'+__domain__,expires:30*24*60*60});if(!response||!response.data||response.data.length===0){return;} var hasLookalike=false;const secondaryDimensionCampaigns=[];for(var q=0;q(24*0)){continue;} hasLookalike=true;secondaryDimensionCampaigns.push(sdCpgId);}else if(sdCpgId=='11393'){if((diffDate/1000/60/60)>(24*0)){continue;} hasLookalike=true;secondaryDimensionCampaigns.push(sdCpgId);}else{const rtgDays=getCustomDimensionRtgAttributionDays();if((diffDate/1000/60/60)>(24*rtgDays)){continue;} hasLookalike=true;secondaryDimensionCampaigns.push(sdCpgId);}} if(secondaryDimensionCampaigns.length>0){VxGA4Attr.sendEventScopedCustomDimensionProperty(dsName);analyticsAttributionHitsSentOnPage.ds=true;}} async function processTopFunnelSecondaryDimension(){if(!hasCustomization('tf_ds_hit')||(tfAdvId==0||tfAdvId==undefined||tfAdvId==null||tfCpgId==0||tfCpgId==undefined||tfCpgId==null)){return;} const response=await VxImpHandler.getVerifyTrackData(tfAdvId,cookie_id,false);var acsBef2=CookiesVx.get(voxus_key+"_acs2");CookiesVx.set(voxus_key+"_acs2","true",{domain:'.'+__domain__,expires:30*24*60*60});if(!response||!response.data||response.data.length===0){return;} var hasLookalike=false;const tfSecondaryDimensionCampaigns=[];const tfIds=getTopFunnelLiftCampaigns(0);for(var q=0;q(24*0)){continue;} hasLookalike=true;tfSecondaryDimensionCampaigns.push(kaoqCpgId);}else if(kaoqCpgId=='11393'){if((diffDate/1000/60/60)>(24*0)){continue;} hasLookalike=true;tfSecondaryDimensionCampaigns.push(kaoqCpgId);}else if(tfIds.includes(kaoqCpgId)){if((diffDate/1000/60/60)>(24*0)){continue;} hasLookalike=true;tfSecondaryDimensionCampaigns.push(kaoqCpgId);}else{if((diffDate/1000/60/60)>(24*30)){continue;} hasLookalike=true;tfSecondaryDimensionCampaigns.push(kaoqCpgId);}} if(tfSecondaryDimensionCampaigns.length>0){VxGA4Attr.sendEventScopedCustomDimensionProperty(tfDsName);analyticsAttributionHitsSentOnPage.tfDs=true;}} if(1==0||2==0){processSecondaryDimension();processTopFunnelSecondaryDimension();}} async function checkAdvertiserImpressionByIP(){const advertiserIds=VxOtherV2Attr.getAttrScopeAdvertiserIds();for(const id of advertiserIds){const isVxLastPaidMedia=await VxOtherV2Attr.isVxLastPaidMedia(id);if(!isVxLastPaidMedia){continue;} await VxOtherV2Attr.expireIgnoreOtherCookieWhenVoxusLastPaidMedia();const activePaidMedia=await VxOtherV2Attr.getActivePaidMedia(id);kopid=true;VxImpHandler.setAdSeenCookies({impressionTime:activePaidMedia.time,lastSeenCreative:activePaidMedia.raw.creative,lastSeenCampaign:activePaidMedia.raw.campaign,lastSeenCampaigns:activePaidMedia.raw.campaigns,adPlacementDomain:activePaidMedia.raw.ad_placement_domain||'',adSeenPlatform:activePaidMedia.raw.kopid_plataform||'',});if(hasCustomization('multi_adv_same_adv')&&associatedAdvData?.[advertiserId]){associatedAdvData[advertiserId].kaoq=true;} break;}} checkAdvertiserImpressionByIP();var sgotasdExists=false;function reloadPixels(){var pixelsApip=[[1,38271856],[2,38271857],[3,38271858],[4,38271859],[5,38271860],[6,38271861],[7,38271862],[8,38271863],[9,38271865],[10,38271866],[11,38271867],[12,38493945],[1,38599305],[13,39040006],[14,39040008],[15,39040012],[16,39040013],[17,39040016],[18,39040070],[19,39357400],[20,39357401],[21,39705818],[22,39705819],[23,39705830],[24,40135718],[25,40135719],[26,40135720],[27,40135721],[28,40455387],[29,40455472],[30,40790610],[31,40790611],[32,40790612],[33,41098481],[34,41098525],[35,41098665],[36,41432750],[37,41432752],[38,41535348],[39,41535350],[40,41535351],[41,41669998],[42,41778917],[43,41778918],[44,42109899],[45,42109905]];var canRenderPixels=true;if(___vx__runCVL==true){if(typeof CookiesVx.get(voxus_key+"_cvl")!="undefined"){if(CookiesVx.get(voxus_key+"_cvl")==1){canRenderPixels=false;}}} if(canRenderPixels){const mediaMathTestAdvertiserIds=['2321','1421','2653'];if(mediaMathTestAdvertiserIds.includes(client_id)&&typeof addMediaMathPixel==='function'){addMediaMathPixel(client_id);} const stackAdaptAdvertiserToPixelMap=new Map([['1218','XrOxkvdN7Gnbq9fRvXpEOF'],['2776','MHHgGFhx90wTomt4jLYsLL'],['2673','glB7BKWD1wsagVLd1fxh2V'],['2249','xYhXiz6NHllrU2VQIf1QQm'],['1774','wf7nQXdSPkx8AnamLnB63o'],['2423','QK3jiqJh0KLHOuUN6oxYib'],['2383','pO4IxVpweITCRWPYcrJlw9'],['2761','LentFLoceyxd3XhrqxbQla'],['2321','r2hrDs8S17BM6pIyIAnI3e'],['2992','bVlgmRhi13QTZbFjd4W2V9'],['2619','PGuC9wiZondDITElaWsHbW'],['2994','hWZQkdWC5QgZor1LpsVPrU'],['2979','PyqnHAJweBE3ocnGbZFxCV'],['3024','kjhBjgmaRgYnmyCWaK6ozF'],['2839','kgHvfOTxxZz6XbeVkn3JLL']]);if(stackAdaptAdvertiserToPixelMap.has(client_id)&&typeof addStackAdaptPixelId==='function'){addStackAdaptPixelId(stackAdaptAdvertiserToPixelMap.get(client_id));} const stackAdaptAdvertiserToSegmentedPixelMap=new Map([['1774',{pixelId:'ZXCpAtD7VNsLAdR3hJoWfM',segmentName:'/checkout'}],['2673',{pixelId:'Y3YuZeH9IN8AIm2YYF3IcB',segmentName:'/checkout'}],['1218',{pixelId:'HV8b0Q1iLcNNDkfOz50eLp',segmentName:'/carrinho'}],['2249',{pixelId:'m5ZZdMMSaNs3tJQSTLz8wq',segmentName:'checkout.colombo.com.br'}],['2321',{pixelId:'g0RnrwdgRUdY01d9tXtFWW',segmentName:'/checkout'}],['2761',{pixelId:'GAHXPtdy40svT3MIE6HACj',segmentName:'/checkout'}],['2383',{pixelId:'ISMxhQWbobrUv5stxA9IGc',segmentName:'/checkout'}],['2423',{pixelId:'Jvmqsd8lmuDbgbmCkAJ3Lb',segmentName:'/checkout'}],['2776',{pixelId:'1hQG5kFT7OCrHYYG2USzN4',segmentName:'/checkout'}],['1464',{pixelId:'1P5PFlhv09sro2Md2VBZWO',segmentName:'/checkout'}],['1401',{pixelId:'fh2UyvuexnLeG7WEqK8VbT',segmentName:'/checkout'}],['2775',{pixelId:'nZIJQ8jqhc99L88Dafqgq0',segmentName:'/checkout'}],['386',{pixelId:'mOoN8LEM2GVjFbYCa3ll3B',segmentName:'/checkout'}],['2328',{pixelId:'qMX16SnLx0rPF0yPnhwR8y',segmentName:'/preco'}],['2703',{pixelId:'j2DHQCBWw1gKcWdqI0V8oq',segmentName:'/checkout'}],['1859',{pixelId:'5Ef8dikGyx0oFTSlfffnbg',segmentName:'/checkout'}],['2610',{pixelId:'LQiyg0TbuJLoamVwdpJtBl',segmentName:'checkout'}],['2596',{pixelId:'c2JbMrWvav49xY1inbK3V7',segmentName:'checkout'}],['2163',{pixelId:'3GYtthDmBTkoRBA2HhAxlJ',segmentName:'checkout'}],['1672',{pixelId:'QpWblpfCYO2n6m5Yr4ZrkV',segmentName:'/checkout'}],['385',{pixelId:'D7jMHssxbbfbmyBk1XzXcR',segmentName:'/checkout'}],['1039',{pixelId:'QYlhCWmMiIwFWnbHOjTbRH',segmentName:'/checkout'}],['1082',{pixelId:'m6UWavHrYf9MsZM6MFpi6D',segmentName:'/checkout'}],['1125',{pixelId:'cn6Xsn8QsjQeOfhqPjSH8M',segmentName:'/checkout'}],['1373',{pixelId:'IcL2q3xx2TL1SfDPqEQqRG',segmentName:'/checkout'}],['1377',{pixelId:'mOlYgazwhSttdIttc2jcXe',segmentName:'/checkout'}],['1421',{pixelId:'eRQYzM2BWDrtj5OTi3S0dI',segmentName:'/carrinho'}],['1430',{pixelId:'C2a05cQ87ilH8ql0xXL4nC',segmentName:'/checkout'}],['1454',{pixelId:'DXE3tQVn42CNkj6tGXOxXZ',segmentName:'/checkout'}],['1477',{pixelId:'XUkKgtGh70gTxnhg2ML65G',segmentName:'/checkout'}],['1589',{pixelId:'jWVX7DAtVmB2QQ3Jhch1Fe',segmentName:'/checkout'}],['1598',{pixelId:'mVgJ2VCffW19KF3oArxEey',segmentName:'/checkout'}],['1699',{pixelId:'0RgphMr6KKII7pIdHkndCA',segmentName:'/checkout'}],['1761',{pixelId:'C3qTeiCuHmMb89cXmgatoi',segmentName:'/checkout'}],['1852',{pixelId:'tQgJ6e2Z3G6Dpy54tuVjbs',segmentName:'/carrinho'}],['1878',{pixelId:'jsRRkUXg1FMxQyavupPe8o',segmentName:'/checkout'}],['1948',{pixelId:'WCbBcvHPH5YYfKz0jAxkfx',segmentName:'/checkout'}],['2003',{pixelId:'CxUqsZSEdSqejyMRC9J9BF',segmentName:'/carrinho'}],['2018',{pixelId:'D87njg02PHF2bgZRsyDyKg',segmentName:'/checkout'}],['2063',{pixelId:'np3G4MiorQjL9yKOOqVbZa',segmentName:'/checkout'}],['2347',{pixelId:'l9B5hwafQX9Jp0vJhmDIN4',segmentName:'/checkout'}],['2367',{pixelId:'VKwaAs0FHPp7H8NogcPVbj',segmentName:'/checkout'}],['2388',{pixelId:'wqJvop0G7bXkDlYBVbKq2V',segmentName:'/checkout'}],['2528',{pixelId:'va3L23UzX0E43pZoXMdScl',segmentName:'/checkout'}],['2624',{pixelId:'MSfrZ5eRyefRLkhB4MXC2N',segmentName:'/checkout'}],['2638',{pixelId:'rxAd9Mpeuz1TabH2lX5KeT',segmentName:'/checkout'}],['2643',{pixelId:'tgAwSF2VwkwpuLwUVyKzUs',segmentName:'/checkout'}],['2702',{pixelId:'ggWYzMDRek6Re9AvEEohBh',segmentName:'/checkout'}],['2723',{pixelId:'TQSnmw6nn61ofeKie9w5n2',segmentName:'/checkout'}],['2732',{pixelId:'fMRQqBCIdiI2BcleRC0i8Y',segmentName:'/checkout'}],['2738',{pixelId:'HAdBBachnz3F1DbjQsodSe',segmentName:'/checkout'}],['2748',{pixelId:'qBtzAsK8hOP0hMCgRXMj7P',segmentName:'/checkout'}]]);if(stackAdaptAdvertiserToSegmentedPixelMap.has(client_id)&&typeof addStackAdaptPixelIdIfOnSegmentPage=='function'){addStackAdaptPixelIdIfOnSegmentPage(stackAdaptAdvertiserToSegmentedPixelMap.get(client_id))} if(client_id==='2579'){addXandrPixel(40874045);} if(client_id==='2839'&&typeof addMetaPixel==='function'){addMetaPixel('2136470616846984');} for(var i=0;i{return encodeURIComponent(key)+'='+encodeURIComponent(data[key])}).join('&');var urlTrackerVx=VOXUS_API_BASE_URL+"/track.png?"+queryString;var httptrk=new XMLHttpRequest();httptrk.open("GET",urlTrackerVx,true);httptrk.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");httptrk.send();VxAdPlacementDomainTracking.sendHit(true);CookiesVx.set(voxus_key+"_usubida_tracking",true,{domain:'.'+__domain__,expires:60*60*24*7});}}} targetingOnload=VxAsyncWrapper.setInterval(function(){if(document.body==null){return;} if(document.getElementById('_VOXUS___TARGETING___DATA')!=null){clearInterval(targetingOnload);return;} clearInterval(targetingOnload);var script=document.createElement('iframe');const indexNckFile=hasCustomization('multi_adv_same_adv')?'index_nckv5':'index_nckv4';script.src='https://targeting.voxus.tv/a/'+indexNckFile+'.html?12943a233&'+VOXUS_RTDT_DATA+"&v=5"+`&nckV=${indexNckVersion}`;script.id='_VOXUS___TARGETING___DATA';script.frameborder=0;script.async=true;script.width=script.height=1;script.style='display:none;visibility:hidden';script.onload=function(){var e=this;e.contentWindow.postMessage({type:'voxus_dmp',url:window.location.href,html:document.head.outerHTML+document.body.outerHTML,dataType:'publisher'},"*");};var vxeventMethod=window.addEventListener?"addEventListener":"attachEvent";var vxeventer=window[vxeventMethod];var vxmessageEvent=vxeventMethod=="attachEvent"?"onmessage":"message";vxeventer(vxmessageEvent,function(e){if(typeof e.data!='object'){return;} if(e.data.type=='dataexclude'){if(e.data.exclude=='true'){CookiesVx.set(voxus_key+"_dataexclude","true",{domain:'.'+__domain__,expires:Infinity});}else{CookiesVx.expire(voxus_key+"_dataexclude");} dataExcludeValidated=true;} if(e.data.type=='user'){cookie_id=e.data.user_id;CookiesVx.set(voxus_key+"_id",cookie_id,{domain:'.'+__domain__,expires:60*60});if(typeof checkEnterprise=='function'){checkEnterprise();}} if(e.data.type=='voxus_kopid'){handleAdSeenMessage(e).catch(()=>{});}else if(hasCustomization('multi_adv_same_adv')&&typeof e.data.type!='undefined'&&e.data.type.startsWith("voxus_kopid_")){const tokensLimit=3;const eventTypeTokens=e.data.type.split("_",tokensLimit);if(eventTypeTokens.length===tokensLimit){handleAssociatedAdvertiserEvent(eventTypeTokens,tokensLimit);}} function handleAssociatedAdvertiserEvent(eventTypeTokens,tokensLimit){const associatedAdvertiserId=eventTypeTokens[tokensLimit-1];if(typeof associatedAdvData=='undefined'){return;} const data=associatedAdvData[associatedAdvertiserId];if(!data)return;handleAdSeenMessage(e).then(resp=>{if(resp?.kopid){data.kaoq=true;}}).catch(()=>{});} async function handleAdSeenMessage(e){const response={kopid:false,kopidck:false,creativekaoq:null};const cv_lift_ids=e.data.cv_lift_ids;if(Array.isArray(cv_lift_ids)&&cv_lift_ids.length>0){CookiesVx.set(`${voxus_key}_cv_lift_cpg`,cv_lift_ids.join(","),{domain:`.${__domain__}`,expires:60*60*24*30});} if(e.data.voxus_kopid!=null&&e.data.voxus_kopid!=''){kopid=true;response.kopid=true;const isVxLastPaidMedia=await VxOtherV2Attr.isVxLastPaidMedia();if(isVxLastPaidMedia){let expiredNow=false;try{expiredNow=await VxOtherV2Attr.expireIgnoreOtherCookieWhenVoxusLastPaidMedia();}catch(_){expiredNow=false;} const adSeenParts=e.data.voxus_kopid.split('-');const lastSeenCreative=adSeenParts[0]||'';const lastSeenCampaign=adSeenParts[1]||'';const impressionTime=e.data.lastImpressionTimestamp?parseInt(e.data.lastImpressionTimestamp,10):null;VxImpHandler.setAdSeenCookies({impressionTime:impressionTime,lastSeenCreative:lastSeenCreative,lastSeenCampaign:lastSeenCampaign,lastSeenCampaigns:e.data.segkaoq||'',adPlacementDomain:e.data.ad_placement_domain||'',adSeenPlatform:e.data.kopid_plataform||'',});creativekaoq=e.data.voxus_kopid;response.creativekaoq=e.data.voxus_kopid;if(expiredNow&&alihuadsa==false)sgarq();}} if(e.data.voxus_kopidck=="1"){CookiesVx.set(voxus_key+"_kopidck_pip","true",{domain:'.'+__domain__,expires:60*60});response.kopidck=true;} return response;}},false);var s=document.getElementsByTagName('body')[0].lastChild;s.parentNode.insertBefore(script,s);},1000);if(typeof intervalDataExcludeValidated=='undefined'){intervalDataExcludeValidated=VxAsyncWrapper.setInterval(function(){if(dataExcludeValidated==false)return;dataExcludeValidated=true;clearInterval(intervalDataExcludeValidated);if(typeof CookiesVx.get(voxus_key+"_dataexclude")=="undefined"){__voxMainProc();}},100);}}catch(error){if(VOXUS_DEBUG){console.trace(error);}}