Files
2026-11-16 01:39:59 +07:00

2 lines
13 KiB
Plaintext

!function(){var e,n,t;VWO.v_t="7.0.314",e=function(){return VWO&&VWO._&&VWO._.libLoaded},n=function(){!function(){var E={TRACK_PAGE_COOKIE_NAME:"_vwo_p",FUNNEL_EXPIRY:100,INITIAL_PRICING_VERSION:0,FEATURE_BUCKET_INDEX:1,SAMPLING_VERSION_INDEX:2,TRACK_GLOBAL_COOKIE_EXPIRY_STATE_INDEX:3,FUNNEL_INFORMATION_INDEX:2,GOAL_INFORMATION_INDEX:3,ANALYZE_INFORMATION_INDEX:4,CRO_START_TIMESTAMP_INDEX:5,PAGE_ID_INFORMATION_INDEX:1,ANALYSE_SERVER_NAME_INDEX:2,TRACK_PAGE_ID_INFORMATION_INDEX:3};function n(){var e=d.getDataStore();e&&((e=e.split(":"))[E.ANALYZE_INFORMATION_INDEX]=function(e){for(var n=a.getKeys(e),t=n.length,i="";t--;)i+=n[t]+"_"+e[n[t]]+(0===t?"":",");return i}(t.analyze),d.setDataStore(e.join(":")))}VWO._.commonUtil.extend(E,VWO._.CookieEnum);var e,a=VWO._.commonUtil,t={analyze:{}},o=0,d={init:function(){var e,n;t.analyze=(n={},(e=d.getDataStore())&&(n=function(e){var n,t,i,a={};if(!e)return a;for(e=e.split(","),o=0;o<e.length;o++)t=(n=e[o].split("_"))[0],i=n[1],a[t]=i;return a}(e.split(":")[E.ANALYZE_INFORMATION_INDEX])),n)},includeAnalyzeCampaign:function(e){t.analyze[e]="1",n()},excludeAnalyzeCampaign:function(e){t.analyze[e]="0",n()},isAnalyzeCampaignIncluded:function(e){if("1"===t.analyze[e]||1===t.analyze[e])return"1"},isAnalyzeCampaignExcluded:function(e){return"0"===t.analyze[e]||0===t.analyze[e]}};VWO._.commonUtil.extend(d,VWO._.commonCookieHandler);var r,_,s,g,N,O,f,u,l,i,I,A,S,c,V,p,R,T,C,m,v,w,F,G,D,L=VWO.TRACK_SESSION_COOKIE_EXPIRY_CUSTOM||1/48,k=VWO.TRACK_GLOBAL_COOKIE_EXPIRY_CUSTOM||window.VWO.data.rp||90;(e={})._vis_opt_test_cookie=0,e._vwo_ds=k,e._vwo_sn=L,e._vwo_referrer=18e-5,e._vwo_uuid=3650,e._vwo_uuid_v2=366,e._vwo_ssm=3650,window.___vwo=1,VWO._.track.loaded||(r=VWO._.utils,_=VWO._.CampaignEnum,s=VWO._.GoalsEnum,g=VWO._.libUtils,N=VWO._.cookies,O=VWO._.EventsEnum,f=VWO._.triggerEvent,u=VWO._.commonUtil,l=VWO._.coreLib,i=VWO._.vwoLib,VWO._.campaign,I=VWO._.listener,A=VWO._.sessionInfoService,S=VWO._.tags,c=VWO._.localStorageService,V=window._vwo_acc_id,p=window._vwo_exp,R=window._vwo_exp_ids,E.FUNNEL_EXPIRY=VWO.FUNNEL_EXPIRY_CUSTOM||100,T={setUp:function(){T.preProcessData()},init:function(){return T.initiated||g.doesUuidCookiesExist()||(N.erase(E.TRACK_SESSION_COOKIE_NAME),N.erase(E.TRACK_GLOBAL_COOKIE_NAME)),T.expireGlobalCookie(),T.expireGoals(),T.createGlobalCookieReturnEligibility()?(T.isUserBucketed()?T.startSession():f(O.RECORDING_NOT_ELIGIBLE,"USER_NOT_BUCKETED"),T.expireFunnels(u.getServerStartTimestamp(!0)),d.init(),T.initiated=!0,!(T.visitorRetracked=!1)):(f(O.RECORDING_NOT_ELIGIBLE,"URL_NOT_MATCHING"),!1)},preProcessData:function(){VWO.data.url=VWO.data.url||{},VWO.data.url.i=VWO.data.url.i||".*"},isUserEligible:function(){return l.compareUrlWithIncludeExcludeRegex(l.getCurrentUrl(),VWO.data.url.i,VWO.data.url.e).didMatch},expireGlobalCookie:function(){T.shouldExpireGlobalCookie()&&(N.erase(E.TRACK_GLOBAL_COOKIE_NAME),N.erase(E.TRACK_SESSION_COOKIE_NAME))},getLatestSamplingVersion:function(){return window.VWO.data.pvn||E.INITIAL_PRICING_VERSION},getCpt:function(){return window.VWO.data.cpt||0},updateTrackPageId:function(){var e=T.getTrackPageId()+1;return T.markTrackPageId(e),e},getTrackPageId:function(){var e=A.getSNCookieValueByIndex(E.TRACK_PAGE_ID_INFORMATION_INDEX);return e?parseInt(e,10):0},markTrackPageId:function(e){A.setSNCookieValueByIndex(E.TRACK_PAGE_ID_INFORMATION_INDEX,e)},getCroStartTimestamp:function(){return d.getDataInfoByIndex(E.CRO_START_TIMESTAMP_INDEX)},setCroStartTimestamp:function(){var e=u.getCurrentTimestamp(!0)-A.getFirstSessionId();d.setDataInfoByIndex(E.CRO_START_TIMESTAMP_INDEX,e)},shouldExpireGlobalCookie:function(){var e=d.getDataStore(),n=d.getMetaInfoByIndex(E.TRACK_GLOBAL_COOKIE_EXPIRY_STATE_INDEX);if(e){var t=u.getServerStartTimestamp(!0),i=A.getFirstSessionId(),a=T.getCroStartTimestamp();if(24*E.TRACK_GLOBAL_COOKIE_EXPIRY*60*60+a+i<t)return!A.getSessionStore()||(n||d.setMetaInfoByIndex(E.TRACK_GLOBAL_COOKIE_EXPIRY_STATE_INDEX,1),!1);if(i<T.getCpt())return!0;var o=T.getLatestSamplingVersion(),r=d.getMetaInfoByIndex(E.SAMPLING_VERSION_INDEX)||E.INITIAL_PRICING_VERSION;if(!(r<o)&&Math.abs(r)<Math.abs(o)&&T.isUserBucketed())return!0}return!1},_markFunnelValue:function(e,n,t){this._markFeatureValue(E.FUNNEL_INFORMATION_INDEX,e,[n,t,A.getRelativeSessionId(),p[e].v])},_isFunnelValue:function(e,n,t){return this._isFeatureValue(E.FUNNEL_INFORMATION_INDEX,e,[n,t])},expireFunnels:function(e){var n,t,i,a,o,r,_=d.getDataStore(),s=A.getFirstSessionId();if(_){for(t=(n=(_=_.split(":"))[E.FUNNEL_INFORMATION_INDEX].split(",")).length;t--;)a=(i=n[t].split("_"))[0],o=+i[3]+24*E.FUNNEL_EXPIRY*60*60+s,r=+i[4],(o<e||p[a]&&p[a].v>r)&&n.splice(t,1);_[E.FUNNEL_INFORMATION_INDEX]=n.join(","),_=_.join(":"),d.setDataStore(_)}},expireGoals:function(){A.getSessionStore()&&!T.visitorRetracked||d.deleteDataStoreInfoByIndex(E.GOAL_INFORMATION_INDEX)},getSessionIdOfFunnel:function(e){var n=d.getDataStore().match(new RegExp("[:,]"+e+"_[^_]*_._([^_]*)_[^,:]*"));return n&&n[1]?+n[1]+A.getFirstSessionId():0},_markFeatureValue:function(e,n,t,i){var a=i?d.getMetaStore():d.getDataStore(),o=a.split(":"),r=n,_=o[e],s=o.length;if(!_)for(;s<=e;)o[s]="",s++;var u=(_=o[e]).match(new RegExp("(?:^|,)("+n+"_[^,]+)"));void 0===t&&(t=[]),t instanceof Array||(t=[t]);for(var l=0;l<t.length;l++)r+="_"+t[l];o[e]=u?o[e].replace(new RegExp("(^|,)("+n+"_[^,]+)"),"$1"+r):o[e]+(0===o[e].length?"":",")+r,a=o.join(":"),i?d.setMetaStore(a):d.setDataStore(a)},_isFeatureValue:function(e,n,t,i){var a,o,r=(i?d.getMetaStore():d.getDataStore()).split(":")[e];return void 0===t&&(t=[]),t instanceof Array||(t=[t]),!!(e===E.FUNNEL_INFORMATION_INDEX?(o=t[1],a=(a=t[0])||"[^_]*",o=null==o?".":o,new RegExp("(,|^)"+n+"_"+a+"_"+o)):(o=null==(o=t[0])?".":o,new RegExp("(,|^)"+n+"_"+o))).test(r)&&"1"},_markGoalValue:function(e,n){this._markFeatureValue(E.GOAL_INFORMATION_INDEX,e,n)},_isGoalValue:function(e,n){return this._isFeatureValue(E.GOAL_INFORMATION_INDEX,e,n)},isCroEnabled:function(){if(!N.get(E.TRACK_GLOBAL_COOKIE_NAME))return!1;var e=d.getMetaStore().split(":")||[];return!(!e[E.FEATURE_BUCKET_INDEX]&&!e[E.SAMPLING_VERSION_INDEX])||void 0},createGlobalCookieReturnEligibility:function(){if(!T.isCroEnabled()){if(!T.isUserEligible())return!1;N.get(E.TRACK_GLOBAL_COOKIE_NAME)||(g.createUUIDCookie(),A.createGlobalCookie()),T.setCroStartTimestamp()}return T.markFeatureLevelBucketing(),T.setSamplingVersion(),!0},markFeatureLevelBucketing:function(){for(var e=A.getPcTraffic(),n=window._vwo_pc_custom||window.VWO.data.pc,t=u.getKeys(n),i=t.length;i--;)T._isFeatureValue(E.FEATURE_BUCKET_INDEX,t[i],null,1)&&!VWO.data.eFSFI||T._markFeatureValue(E.FEATURE_BUCKET_INDEX,t[i],+(e<n[t[i]]),!0)},setSamplingVersion:function(){d.setMetaInfoByIndex(E.SAMPLING_VERSION_INDEX,T.getLatestSamplingVersion())},isUserBucketed:function(){for(var e=window.VWO.data.pc,n=u.getKeys(e),t=n.length;t--;)if(T.isFeatureBucketed(n[t]))return!0},isFeatureBucketed:function(e){return!e||T._isFeatureValue(E.FEATURE_BUCKET_INDEX,e,1,!0)},excludeFunnel:function(e){T._markFunnelValue(e,0,0)},includeFunnel:function(e){T._markFunnelValue(e,0,1)},includeAnalyzeCampaign:function(e){d.includeAnalyzeCampaign(e)},excludeAnalyzeCampaign:function(e){d.excludeAnalyzeCampaign(e)},excludeGoal:function(e){T._markGoalValue(e,0)},includeGoal:function(e){T._markGoalValue(e,1)},shouldAddGoalInFunnel:function(e,n){n=parseInt(n,10);var t,i=T.getGoalIndexInFunnel(e,n);if(i<0)return!1;for(var a,o,r,_=p[e].g[0].id===n,s=d.getDataStore().split(":")[E.FUNNEL_INFORMATION_INDEX].split(","),u=s.length;u--;)if((a=s[u].split("_"))[0]===e){if(r=!0,o=+a[1],!+a[2])return!1;t=T.getGoalIndexInFunnel(e,o)+1===i}return _&&!r&&(l.runCampaigns({keepElementLoadedRunning:!1,expIds:[e],isManual:!0},null,null,!0),T.isFunnelIncluded(e)&&(t=!0)),t},getGoalIndexInFunnel:function(e,n){for(var t=0;t<p[e].g.length;t++)if(p[e].g[t].id===n)return t;return-1},getGoalsString:function(e){for(var n="",t=0;t<e.length;t++)n=n+e[t].id+("REVENUE_TRACKING"===e[t].type?"_1":"")+(t===e.length-1?"":",");return n},getGtAndF:function(e){for(var n,t,i=R.length,a={};i--;)n=R[i],p[n].type===_.FUNNEL_CAMPAIGN&&this.shouldAddGoalInFunnel(n,e)&&(T._markFunnelValue(n,e,1),a[n]=this.getGoalsString(p[n].g)+":"+T.getSessionIdOfFunnel(n));return t=u.getKeys(a),"&gt="+ +!T.isGoalTriggered(e)+"_"+t.join(",")+"&f="+r.jsonStringify(a)},startSession:function(){var e,n,t,i,a,o,r,_,s=document.URL,u="s.gif?account_id="+V+g.getUUIDString(g.createUUIDCookie()),l=1;if(A.isSessionInfoSynced())A.updateAndSyncPageId(),o=T.updateTrackPageId(),e=S.getTags(),n=S.getEgTags(),a=A.getSessionId(),l=VWO._.pageId,i=a>A.getFirstSessionId(),u=u+"&s="+a+"&p="+l,window._vis_debug||g.sendCall(u+(e?"&tags="+e:"")+(n?"&eg="+n:"")+"&update=1&cq=1");else if(l=1,S.refresh(),e=S.getTags(),n=S.getEgTags(),A.getSessionStore()?(A.updateAndSyncPageId(),l=VWO._.pageId,A.setSNCookieValueByIndex(E.SESSION_SYNCED_STATE_INDEX,1)):(t=A.getRelativeSessionTimestamp(this),A.initializeSession(t+":"+l+":::1"),VWO._.pageId=l),o=T.updateTrackPageId(),u=u+"&s="+(a=A.getSessionId())+"&p="+l,i=a>A.getFirstSessionId(),!window._vis_debug){var d=g.extraData(!0),I=encodeURIComponent(d),c=u+"&ed="+I+"&cu="+encodeURIComponent(A.getInfo().cu||s)+(e?"&tags="+e:"")+(n?"&eg="+n:"")+"&r="+ +i+"&cq=1";g.sendCall(c);try{JSON.parse(decodeURIComponent(I)).lt}catch(e){window.VWO._.customError&&window.VWO._.customError({msg:"extraData(ed) is not a JSON string [while sending call for 's.gif']",url:"track-lib.ts",lineno:688,colno:5,source:JSON.stringify({extraData:d,lt:(new Date).getTime(),referrer:document.referrer,requestURL:c})})}}(isNaN(a)||isNaN(l))&&window.VWO._.customError&&(r={_vwo_sn:N.get("_vwo_sn"),_vwo_ds:N.get("_vwo_ds")},_="Error while sending s.gif: ",isNaN(a)&&(_+="Session Id is NaN"),isNaN(l)&&(_=_?_+", ":_,_+="Page Id is NaN",r.pageId=l),window.VWO._.customError({msg:_,url:"track-lib.ts",source:JSON.stringify(r),lineno:640,colno:641})),A.setVisitorInformation(),T.setAnalyzeServerName(),f(O.TRACK_SESSION_CREATED,a,l,i,1===o,o),A.updateSession()},setAnalyzeServerName:function(){var e=A.getSNCookieValueByIndex(E.ANALYSE_SERVER_NAME_INDEX);e?window.VWO.data.asn=e:(window.VWO.data.as&&A.setSNCookieValueByIndex(E.ANALYSE_SERVER_NAME_INDEX,window.VWO.data.as),window.VWO.data.asn=window.VWO.data.as||"dev.visualwebsiteoptimizer.com")},isGoalIncluded:function(e){return this._isGoalValue(e,1)||this._isGoalValue(e,2)},isGoalExcluded:function(e){return this._isGoalValue(e,0)},isAnalyzeCampaignExcluded:function(e){return d.isAnalyzeCampaignExcluded(e)},isAnalyzeCampaignIncluded:function(e){return d.isAnalyzeCampaignIncluded(e)},isFunnelIncluded:function(e){return T._isFunnelValue(e,void 0,1)},isFunnelExcluded:function(e){return T._isFunnelValue(e,void 0,0)},markGoalTriggered:function(e,n){var t=p[e].goals[n];T._markGoalValue(n,2),t.type===s.SEPARATE_PAGE&&(t.pageVisited=1)},isGoalTriggered:function(e){return T._isGoalValue(e,2)},shouldTriggerGoal:function(e,n){var t=p[e].goals[n],i=!1;if(T._isGoalValue(n,0))return!1;if(T._isGoalValue(n,1)&&(i=!t.pageVisited),T._isGoalValue(n,2)&&(i=!1),!t.pageVisited&&!i)for(var a,o=R.length;o--;)a=R[o],p[a].type===_.FUNNEL_CAMPAIGN&&this.shouldAddGoalInFunnel(a,n)&&(i=!0);return t.type===s.SEPARATE_PAGE&&(t.pageVisited=!0),i},loaded:!0,initiated:!1},u.extend(VWO._.track,T),T=VWO._.track,C=function(){3===VWO.data.tcVersion&&!F||(T.setUp(),T.init()&&l.runCampaigns({keepElementLoadedRunning:!1,expIds:u.filter(R,function(e){return g.isSessionBasedCampaign(e)}),isManual:!1},null,null,!0))},m=function(){VWO._.ac&&VWO._.ac.cInstJS?VWO._.addConsentTrigger(C):C()},v=function(){try{var e="_vwo_track_data_"+window._vwo_acc_id,n=c.get(e);if(n)for(var t=r.jsonParse(n),i=Object.keys(t),a=i.length;a--;)window.VWO.push([t[i[a]][0],t[i[a]][1]]);c.remove(e)}catch(e){var o="[JSLIB_TRACK] Error - Check for persisited track data.";window.VWO._.customError&&window.VWO._.customError({msg:o,url:"track-lib.ts",source:encodeURIComponent(o)})}},w=function(){(3!==VWO.data.tcVersion||F)&&G&&(T.initiated||(v(),m(),i.init("track")&&(T.vwoLibInitiated=!0)))},D=function(){T.visitorRetracked=!0,T.init(),l.runCampaigns(!1,u.filter(R,function(n){try{window._vwo_exp[n].combination_chosen}catch(e){window.VWO._.customError&&window.VWO._.customError({msg:"LOGGING: experiment id "+n+"not found in "+window._vwo_exp_ids,url:"track-lib.ts",lineno:879,colno:9})}return window._vwo_exp&&window._vwo_exp[n]?g.isSessionBasedCampaign(n)&&(window._vwo_exp[n].combination_chosen=void 0,1):g.isSessionBasedCampaign(n)}),null,!0),T.visitorRetracked=!1},I.onEventReceive(O.RETRACK_VISITOR,function(){VWO._.ac&&VWO._.ac.cInstJS?VWO._.addConsentTrigger(D):D()}),I.onEventReceive(O.NEW_SESSION_CREATED,function(){T.visitorRetracked=!0}),I.onEventReceive(O.POST_URL_CHANGE,function(){m(),T.vwoLibInitiated||(v(),i.init("track"))}),I.onEventReceive(O.NOT_REDIRECTING,function(){G||(G=!0,w())}),I.onEventReceive(O.UPDATE_SETTINGS_CALL,function(){F||(F=!0,w())}))}()},(t=function(){e()?n():setTimeout(t,100)})()}();