/*! swap.js | Copyright © 2011-2024 CallRail Inc. | License: www.callrail.com/legal */!function(){"use strict";var Wrappers=function(){function e(){}return e.documentReferrer=function(){return document.referrer},e.documentURL=function(){return document.URL},e.documentCookie=function(e){return e?document.cookie=e:document.cookie},e.isDebug=function(){return Debug._isDebug||!1},e.windowLocation=function(){return window.location},e}(),Debug=function(){function e(){}return e._debugEnabled=function(){return!!Wrappers.windowLocation().href.match(/crl?dbg/)},e.doneSwaps={},e.foundTargets=[],e}(),Performance=function(){function o(){}return o.networkPerfData=function(){if(o._networkPerfData)return o._networkPerfData;if(o._networkPerfData={},window.performance)try{var e=window.performance.getEntriesByType("resource").filter(function(e){return e.name.match(/swap\.js/)})[0];if(e){var r=0=r&&a[0].startTime>window.performance.now()-6e4)return this._runtimePerfData[e+"_throttling"]=1,!0}var n=window.performance.now();t();var o=window.performance.now()-n;return a.push({startTime:n,duration:o}),a.length>r&&a.shift(),this._runtimePerfData[e]=o,!1},o._runtimePerfData={},o._throttleQueue={},o}(),Polyfills=function(){function t(){}return t.jsonify=function(e){var r=Array.prototype.toJSON;if(!r)return JSON.stringify(e);delete Array.prototype.toJSON;var t=JSON.stringify(e);return Array.prototype.toJSON=r,t},t.contains=function(e,r){return-1>r/4).toString(16)}):"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var r=16*Math.random()|0;return("x"==e?r:3&r|8).toString(16)})},l.hasWordpressCookies=function(){return 1<=window.crwpVer},l.wpProxy=function(){return 2===window.crwpVer},l.proxyPath=function(e){var r;try{r=new URL(e)}catch(t){(r=document.createElement("a")).href=e}return"/index.php?rest_route=/calltrk/sessions"+r.pathname},l.crossSubdomain=function(){var ns=CallTrk.firstNamespace();return ns&&ns.cross_subdomain},l.cookieDuration=function(){return CallTrk.firstNamespace().cookie_duration},l.isMulti=function(){return!!CallTrk.firstNamespace().multiswap_id},l.namespaceIds=function(){var e=[];return CallTrk.eachNamespace(function(ns){return e.push(ns.id)}),e},l.nearestTLD=function(){if(CallTrkSwap._nearestTLD)return CallTrkSwap._nearestTLD;var e=Wrappers.documentCookie(),r=Wrappers.windowLocation().hostname,t=r.split(".");if(""===r)return"";for(var a=t.length-1;0<=a;--a){var n=t.slice(a).join(".");if(l.createCookie("calltrk_nearest_tld",n,3600,n),e!==Wrappers.documentCookie())return l.eraseCookie("calltrk_nearest_tld",n),CallTrkSwap._nearestTLD=n}},l.createCookie=function(e,r,t,a){var n="";if(null==t&&(t=l.cookieDuration()),t){var o=new Date;o.setTime(o.getTime()+24*t*60*60*1e3),n="; expires="+o.toUTCString()}var i=e+"="+escape(r)+n+"; path=/";l.crossSubdomain()&&!1!==a&&!a&&(a=l.nearestTLD()),a&&(i+="; domain="+a),i+="; samesite=Lax";var s=Storage.getItem(e);return s&&s==r?Wrappers.documentCookie(i):Storage.hasCookie(i)?Storage.setItem(e,r):(Storage.setItem(e,r),Wrappers.documentCookie(i)),i},l.eraseCookie=function(e,r){l.createCookie(e,"",-1,r),Storage.removeItem(e)},l.crDeleteOldCookies=function(){l.eraseCookie("calltrk_referrer"),l.eraseCookie("calltrk_landing"),l.eraseCookie("calltrk_session_id");var e=document.cookie.match(/calltrk_session_swap_numbers_(\d+)=/g);if(e)for(var r=0;re)&&(this.setIntegrationTTL(r),!0)},IntegrationData.setIntegrationTTL=function(e){var r=18e5,t=e.getTime()+r;return Storage.setItem("integration-data-ttl",t),t},IntegrationData}(),Replacer=function(){function f(){}return f.standardReplace=function(e,r,t){if(f._numberRegexCache||(f._numberRegexCache={}),!f._numberRegexCache[r]){var a=r.substring(0,3),n=r.substring(3,6),o=r.substring(6,10),i="(\\(?)"+a+"(\\))?"+f.CHAR_SEP+n+f.CHAR_SEP+o,s="$1"+t.substring(0,3)+"$2$3"+t.substring(3,6)+"$4"+t.substring(6,10);f._numberRegexCache[r]=[o,new RegExp(i,"g"),s]}var l=f._numberRegexCache[r];if(-1