var __webpack_modules__={771:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{D:function(){return Base64}});function Base64(){var _PADCHAR="=",_ALPHA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_VERSION="1.0";const _getbyte64=(s,i)=>{var idx=_ALPHA.indexOf(s.charAt(i));if(idx===-1)throw"Cannot decode base64";return idx};function _decode(s){var pads=0,i,b10,imax=s.length,x=[];s=String(s);if(imax===0)return s;if(imax%4!==0)throw"Cannot decode base64";if(s.charAt(imax-1)===_PADCHAR){pads=1;if(s.charAt(imax-2)===_PADCHAR)pads=2;imax-=4}for(i=0;i<imax;i+=4){b10=_getbyte64(s,i)<<18|_getbyte64(s,i+1)<<12|_getbyte64(s,i+2)<<6|_getbyte64(s,i+3);x.push(String.fromCharCode(b10>>16,b10>>8&255,b10&255))}switch(pads){case 1:b10=_getbyte64(s,i)<<18|_getbyte64(s,i+1)<<12|_getbyte64(s,i+2)<<6;x.push(String.fromCharCode(b10>>16,b10>>8&255));break;case 2:b10=_getbyte64(s,i)<<18|_getbyte64(s,i+1)<<12;x.push(String.fromCharCode(b10>>16));break}return x.join("")}function _getbyte(s,i){var x=s.charCodeAt(i);if(x>255)throw"INVALID_CHARACTER_ERR: DOM Exception 5";return x}function _encode(s){if(arguments.length!==1)throw"SyntaxError: exactly one argument required";s=String(s);var i,b10,x=[],imax=s.length-s.length%3;if(s.length===0)return s;for(i=0;i<imax;i+=3){b10=_getbyte(s,i)<<16|_getbyte(s,i+1)<<8|_getbyte(s,i+2);x.push(_ALPHA.charAt(b10>>18));x.push(_ALPHA.charAt(b10>>12&63));x.push(_ALPHA.charAt(b10>>6&63));x.push(_ALPHA.charAt(b10&63))}switch(s.length-imax){case 1:b10=_getbyte(s,i)<<16;x.push(_ALPHA.charAt(b10>>18)+_ALPHA.charAt(b10>>12&63)+_PADCHAR+_PADCHAR);break;case 2:b10=_getbyte(s,i)<<16|_getbyte(s,i+1)<<8;x.push(_ALPHA.charAt(b10>>18)+_ALPHA.charAt(b10>>12&63)+_ALPHA.charAt(b10>>6&63)+_PADCHAR);break}return x.join("")}return{base64decode:_decode,base64encode:_encode,VERSION:_VERSION}}},263:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Z:function(){return init}});function executeScript(connectionString){!function(T,l,y){var S=T.location,k="script",D="instrumentationKey",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w="crossOrigin",N="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"5",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),iKey:e,name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,u,p,l;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;a<n.length;a++){var i=n[a].split("=");2===i.length&&(e[i[0][b]()]=i[1])}if(!e[C]){var r=e.endpointsuffix,o=r?e.location:null;e[C]="https://"+(o?o+".":"")+"dc."+(r||"services.visualstudio.com")}return e}(),c=s[D]||d[D]||"",u=s[C],p=u?u+"/v2/track":d.endpointUrl,(l=[]).push((n="SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details)",a=t,i=p,(o=(r=v(c,"Exception")).data).baseType="ExceptionData",o.baseData.exceptions=[{typeName:"SDKLoadFailed",message:n.replace(/\./g,"-"),hasFullStack:!1,stack:n+"\nSnippet failed to load ["+a+"] -- Telemetry is disabled\nHelp Link: https://go.microsoft.com/fwlink/?linkid=2128109\nHost: "+(S&&S.pathname||"_unknown_")+"\nEndpoint: "+i,parsedStack:[]}],r)),l.push(function(e,t,n,a){var i=v(c,"Message"),r=i.data;r.baseType="MessageData";var o=r.baseData;return o.message='AI (Internal): 99 message:"'+("SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details) ("+n+")").replace(/\"/g,"")+'"',o.properties={endpoint:a},i}(0,0,t,p)),function(e,t){if(JSON){var n=T.fetch;if(n&&!y.useXhr)n(t,{method:N,body:JSON.stringify(e),mode:"cors"});else if(XMLHttpRequest){var a=new XMLHttpRequest;a.open(N,t),a.setRequestHeader("Content-type","application/json"),a.send(JSON.stringify(e))}}}(l,p))}function i(e,t){f||setTimeout((function(){!t&&m.core||a()}),500)}var e=function(){var n=l.createElement(k);n.src=h;var e=y[w];return!e&&""!==e||"undefined"==n[w]||(n[w]=e),n.onload=i,n.onerror=a,n.onreadystatechange=function(e,t){"loaded"!==n.readyState&&"complete"!==n.readyState||i(0,t)},n}();y.ld<0?l.getElementsByTagName("head")[0].appendChild(e):setTimeout((function(){l.getElementsByTagName(k)[0].parentNode.appendChild(e)}),y.ld||0)}try{m.cookie=l.cookie}catch(p){}function t(e){for(;e.length;)!function(t){m[t]=function(){var e=arguments;g||m.queue.push((function(){m[t].apply(m,e)}))}}(e.pop())}var n="track",r="TrackPage",o="TrackEvent";t([n+"Event",n+"PageView",n+"Exception",n+"Trace",n+"DependencyData",n+"Metric",n+"PageViewPerformance","start"+r,"stop"+r,"start"+o,"stop"+o,"addTelemetryInitializer","setAuthenticatedUserContext","clearAuthenticatedUserContext","flush"]),m.SeverityLevel={Verbose:0,Information:1,Warning:2,Error:3,Critical:4};var s=(d.extensionConfig||{}).ApplicationInsightsAnalytics||{};if(!0!==d[I]&&!0!==s[I]){var c="onerror";t(["_"+c]);var u=T[c];T[c]=function(e,t,n,a,i){var r=u&&u(e,t,n,a,i);return!0!==r&&m["_"+c]({message:e,url:t,lineNumber:n,columnNumber:a,error:i}),r},d.autoExceptionInstrumented=!0}return m}(y.cfg);function a(){y.onInit&&y.onInit(n)}(T[t]=n).queue&&0===n.queue.length?(n.queue.push(a),n.trackPageView({})):a()}(window,document,{src:"https://js.monitor.azure.com/scripts/b/ai.2.min.js",crossOrigin:"anonymous",cfg:{connectionString:connectionString}})}function init(connectionString){executeScript(connectionString)}}};var __webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(cachedModule!==void 0)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={exports:{}};__webpack_modules__[moduleId](module,module.exports,__webpack_require__);return module.exports}!function(){__webpack_require__.d=function(exports,definition){for(var key in definition)if(__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key))Object.defineProperty(exports,key,{enumerable:true,get:definition[key]})}}();!function(){__webpack_require__.o=function(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}();var __webpack_exports__={};!function(){var _Base64_ts__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(771);var _appInsights__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(263);function _defineProperty(obj,key,value){if(key in obj)Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});else obj[key]=value;return obj}window.Inq=function(siteFcnStr,rulesEngineDataStr,loadedMbuRuleDataFuns,programRulesConf){var jsonAPIData=v3Lander.jsonAPIData;var isInqInitialized=false;var jsSDKEnabled=v3Lander.isJSSDK;var startedTime=Date.now();if(jsSDKEnabled)var initSiteData=siteFcnStr;else{eval("var initSiteData = ".concat(siteFcnStr.toString()));eval("var programRulesConfig = "+programRulesConf.toString())}var site=initSiteData();var vanityUrl=site.vanityDomainName;var one2ManyChatrouterDomain=site.oneToManyChatrouterDomain||"api.inq.com";var one2ManyChat=false;var isConversationActive=false;var isWebSDK=v3Lander.isWebSDK;function getConversationActive(){return isConversationActive}function setConversationActive(value){isConversationActive=value}function isFireC2cRulesOnChatClose(){return site.fireC2CRulesOnChatClose}var JSLoggingDisabled=site.JSLoggingDisabled;var disableLogToServer=site.disableLogToServer;try{if(JSLoggingDisabled)JSLoggingDisabled=!window.localStorage.getItem("enableJSLogging")}catch(e){}var dataReady=false;var persistentCustomerID=null;var authenticatedUser=null;var secureWithCustToken=false;var win,doc;if(isWebSDK){win=self;site.noJSHosting=false}else win=self.parent;doc=win.document;var domObserver;var initRule={};var openerData={};var isChatProgressInSDK=false;var deviceDetails=null;var evaluateLegacySettingsWarnNeeded=true;var KEY_ENGAGEMENT_ID_STRING="engagementID";var KEY_CUSTOMER_ID_STRING="customerID";var KEY_WINDOW_ID_STRING="windowId";var COOKIE_PC_NAME="inqPc";var COOKIE_COBROWSE="cobrowse";var DEFERRED_START_OF_MANAGERS_KEY="DEFERRED_START_OF_MANAGERS";var DEFAULT_INITIAL_TIMEOUT=120;var RIGHT="r";var BOTTOM="b";var PERSISTENT_COOKIE_ALLOWED="pc";(function initializeFacade(){window.getParentElByIDTFacade=function(id){if(isWebSDK)return window.document.getElementById(id);return window.parent.document.getElementById(id)};window.getParentElsByTNTFacade=function(tname){if(isWebSDK)return window.document.getElementsByTagName(tname);return window.parent.document.getElementsByTagName(tname)};window.buildNuanceModalWindow=function(){};window.toggleNuanceModalWindow=function(isModal){};window.removeNuanceModalWindow=function(){}})();(function overRideDomainsIfAny(){var v3Config=v3LanderConfig;if(isWebSDK)return;else if(v3LanderConfig.parent)if(v3LanderConfig.parent.opener)v3Config=v3LanderConfig.parent.opener;else v3Config=v3LanderConfig.parent;site.chatRouterVanityDomain=(v3Config.crVanityDomain||site.chatRouterVanityDomain).replace(/(^\w+:|^)\/\//,"");site.vanityDomainName=v3Config.vanityDomain||site.vanityDomainName;site.cobrowseURL=v3Config.cbVanityDomain||site.cobrowseURL;site.clientStaticUrl=v3Config.clientStaticUrl||site.clientStaticUrl;site.mediaServer=v3Config.mediaUrl||site.mediaServer;site.xformsVanityDomain=(v3Config.xformsUrl||site.xformsVanityDomain).replace(/(^\w+:|^)\/\//,"");site.psHosturlList=v3Config.psHostedFileUrl||site.psHosturlList})();(function(name,context,definition){if(typeof context[name]!="undefined")context[name+"Nuance"]=definition();else context[name]=definition()})("Fingerprint",this,(function(){"use strict";var Fingerprint=function(options){var nativeForEach,nativeMap;nativeForEach=Array.prototype.forEach;nativeMap=Array.prototype.map;this.each=function(obj,iterator,context){if(obj===null)return;if(nativeForEach&&obj.forEach===nativeForEach)obj.forEach(iterator,context);else if(obj.length===+obj.length){for(var i=0,l=obj.length;i<l;i++)if(iterator.call(context,obj[i],i,obj)==={})return}else for(var key in obj)if(obj.hasOwnProperty(key))if(iterator.call(context,obj[key],key,obj)==={})return};this.map=function(obj,iterator,context){var results=[];if(obj==null)return results;if(nativeMap&&obj.map===nativeMap)return obj.map(iterator,context);this.each(obj,(function(value,index,list){results[results.length]=iterator.call(context,value,index,list)}));return results};if(typeof options=="object"){this.hasher=options.hasher;this.screen_resolution=options.screen_resolution;this.screen_orientation=options.screen_orientation;this.canvas=options.canvas;this.ie_activex=options.ie_activex}else if(typeof options=="function")this.hasher=options};Fingerprint.prototype={get:function(){var keys=[];keys.push(navigator.userAgent);keys.push(navigator.language);keys.push(screen.colorDepth);if(this.screen_resolution){var resolution=this.getScreenResolution();if(typeof resolution!=="undefined")keys.push(resolution.join("x"))}keys.push((new Date).getTimezoneOffset());keys.push(this.hasSessionStorage());keys.push(this.hasLocalStorage());keys.push(!!window.indexedDB);if(document.body)keys.push(typeof document.body.addBehavior);else keys.push(typeof void 0);keys.push(typeof window.openDatabase);keys.push(navigator.cpuClass);keys.push(navigator.platform);keys.push(navigator.doNotTrack);keys.push(this.getPluginsString());if(this.canvas&&this.isCanvasSupported())keys.push(this.getCanvasFingerprint());if(this.hasher)return this.hasher(keys.join("###"),31);else return this.murmurhash3_32_gc(keys.join("###"),31)},murmurhash3_32_gc:function(key,seed){var remainder,bytes,h1,h1b,c1,c2,k1,i;remainder=key.length&3;bytes=key.length-remainder;h1=seed;c1=3432918353;c2=461845907;i=0;while(i<bytes){k1=key.charCodeAt(i)&255|(key.charCodeAt(++i)&255)<<8|(key.charCodeAt(++i)&255)<<16|(key.charCodeAt(++i)&255)<<24;++i;k1=(k1&65535)*c1+(((k1>>>16)*c1&65535)<<16)&4294967295;k1=k1<<15|k1>>>17;k1=(k1&65535)*c2+(((k1>>>16)*c2&65535)<<16)&4294967295;h1^=k1;h1=h1<<13|h1>>>19;h1b=(h1&65535)*5+(((h1>>>16)*5&65535)<<16)&4294967295;h1=(h1b&65535)+27492+(((h1b>>>16)+58964&65535)<<16)}k1=0;switch(remainder){case 3:k1^=(key.charCodeAt(i+2)&255)<<16;case 2:k1^=(key.charCodeAt(i+1)&255)<<8;case 1:k1^=key.charCodeAt(i)&255;k1=(k1&65535)*c1+(((k1>>>16)*c1&65535)<<16)&4294967295;k1=k1<<15|k1>>>17;k1=(k1&65535)*c2+(((k1>>>16)*c2&65535)<<16)&4294967295;h1^=k1}h1^=key.length;h1^=h1>>>16;h1=(h1&65535)*2246822507+(((h1>>>16)*2246822507&65535)<<16)&4294967295;h1^=h1>>>13;h1=(h1&65535)*3266489909+(((h1>>>16)*3266489909&65535)<<16)&4294967295;h1^=h1>>>16;return h1>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(e){return true}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(e){return true}},isCanvasSupported:function(){var elem=document.createElement("canvas");return!!(elem.getContext&&elem.getContext("2d"))},isIE:function(){if(navigator.appName==="Microsoft Internet Explorer")return true;else if(navigator.appName==="Netscape"&&/Trident/.test(navigator.userAgent))return true;return false},getPluginsString:function(){if(this.isIE()&&this.ie_activex)return this.getIEPluginsString();else return this.getRegularPluginsString()},getRegularPluginsString:function(){return this.map(navigator.plugins,(function(p){var mimeTypes=this.map(p,(function(mt){return[mt.type,mt.suffixes].join("~")})).join(",");return[p.name,p.description,mimeTypes].join("::")}),this).join(";")},getIEPluginsString:function(){if(window.ActiveXObject){var names=["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"];return this.map(names,(function(name){try{new ActiveXObject(name);return name}catch(e){return null}})).join(";")}else return""},getScreenResolution:function(){var resolution;if(this.screen_orientation)resolution=screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height];else resolution=[screen.height,screen.width];return resolution},getCanvasFingerprint:function(){var canvas=document.createElement("canvas");var ctx=canvas.getContext("2d");var txt="http://valve.github.io";ctx.textBaseline="top";ctx.font="14px 'Arial'";ctx.textBaseline="alphabetic";ctx.fillStyle="#f60";ctx.fillRect(125,1,62,20);ctx.fillStyle="#069";ctx.fillText(txt,2,15);ctx.fillStyle="rgba(102, 204, 0, 0.7)";ctx.fillText(txt,4,17);return canvas.toDataURL()}};return Fingerprint}));if(!document.querySelectorAll)document.querySelectorAll=function(selectors){var style=document.createElement("style"),elements=[],element;document.documentElement.firstChild.appendChild(style);document._qsa=[];style.styleSheet.cssText=selectors+"{x-qsa:expression(document._qsa && document._qsa.push(this))}";window.scrollBy(0,0);style.parentNode.removeChild(style);while(document._qsa.length){element=document._qsa.shift();element.style.removeAttribute("x-qsa");elements.push(element)}document._qsa=null;return elements};if(!document.querySelector)document.querySelector=function(selectors){var elements=document.querySelectorAll(selectors);return elements.length?elements[0]:null};if(!Function.prototype.bind)Object.defineProperty(Function.prototype,"bind",{value:function(oThis){if(typeof this!=="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var aArgs=Array.prototype.slice.call(arguments,1),fToBind=this,fNOP=function(){},fBound=function(){return fToBind.apply(this instanceof fNOP?this:oThis,aArgs.concat(Array.prototype.slice.call(arguments)))};if(this.prototype)fNOP.prototype=this.prototype;fBound.prototype=new fNOP;return fBound},configurable:true,enumerable:false});if(!Array.prototype.filter)Object.defineProperty(Array.prototype,"filter",{value:function(fun){"use strict";if(this===void 0||this===null)throw new TypeError;var t=Object(this);var len=t.length>>>0;if(typeof fun!=="function")throw new TypeError;var res=[];var thisArg=arguments.length>=2?arguments[1]:void 0;for(var i=0;i<len;i++)if(i in t){var val=t[i];if(fun.call(thisArg,val,i,t))res.push(val)}return res},configurable:true,enumerable:false});if(!Array.prototype.forEach)Object.defineProperty(Array.prototype,"forEach",{value:function(callback,thisArg){var T,k;if(this==null)throw new TypeError(" this is null or not defined");var O=Object(this);var len=O.length>>>0;if(typeof callback!=="function")throw new TypeError(callback+" is not a function");if(arguments.length>1)T=thisArg;k=0;while(k<len){var kValue;if(k in O){kValue=O[k];callback.call(T,kValue,k,O)}k++}},configurable:true,enumerable:false});if(!Array.isArray)Array.isArray=function(arg){return Object.prototype.toString.call(arg)==="[object Array]"};if(!Date.now)Date.now=function now(){return(new Date).getTime()};if(!String.prototype.includes)Object.defineProperty(String.prototype,"includes",{value:function(){"use strict";return String.prototype.indexOf.apply(this,arguments)!==-1},configurable:true,enumerable:false});if(!Array.prototype.includes)Object.defineProperty(Array.prototype,"includes",{value:function(searchElement,fromIndex){if(this==null)throw new TypeError('"this" is null or not defined');var o=Object(this);var len=o.length>>>0;if(len===0)return false;var n=fromIndex|0;var k=Math.max(n>=0?n:len-Math.abs(n),0);function sameValueZero(x,y){return x===y||typeof x==="number"&&typeof y==="number"&&isNaN(x)&&isNaN(y)}while(k<len){if(sameValueZero(o[k],searchElement))return true;k++}return false},configurable:true,enumerable:false});if(!Array.prototype.map)Object.defineProperty(Array.prototype,"map",{value:function(callback){var T,A,k;if(this==null)throw new TypeError("this is null or not defined");var O=Object(this);var len=O.length>>>0;if(typeof callback!=="function")throw new TypeError(callback+" is not a function");if(arguments.length>1)T=arguments[1];A=new Array(len);k=0;while(k<len){var kValue,mappedValue;if(k in O){kValue=O[k];mappedValue=callback.call(T,kValue,k,O);A[k]=mappedValue}k++}return A},configurable:true,enumerable:false});if(!Object.keys)Object.keys=function(){"use strict";var hasOwnProperty=Object.prototype.hasOwnProperty,hasDontEnumBug=!{toString:null}.propertyIsEnumerable("toString"),dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dontEnumsLength=dontEnums.length;return function(obj){if(typeof obj!=="function"&&(typeof obj!=="object"||obj===null))throw new TypeError("Object.keys called on non-object");var result=[],prop,i;for(prop in obj)if(hasOwnProperty.call(obj,prop))result.push(prop);if(hasDontEnumBug)for(i=0;i<dontEnumsLength;i++)if(hasOwnProperty.call(obj,dontEnums[i]))result.push(dontEnums[i]);return result}}();function getParentPageElById(id,doc){if(doc==window.parent.document)return getParentElByIDTFacade(id);return document.getElementById(id)}function log(s,severity){if(!JSLoggingDisabled)if(typeof console!="undefined"){if(typeof severity!="string")severity="log";else severity=severity.toLowerCase();if(console[severity])console[severity](s);else if(console.log)console.log(severity.toUpperCase()+": "+s)}}function isC2PActive(siteC2P){if(inu1(siteC2P))throw new Error("siteC2P parameter missing");var chatData=CHM.getChatData().getChatData();if(!!chatData&&!inu1(chatData["c2cToPersistent"]))return chatData["c2cToPersistent"];return siteC2P}function fireCustomEvent(eventName,data,rule){try{EVM.fireCustomEvent(eventName,rule,data)}catch(err){let12("External custom event("+eventName+") fire failure:"+cf21(err))}}function let12(errMsg,addLoggingContext){lmt12(errMsg,LOG_LEVELS.ERROR,null,addLoggingContext)}function lwt12(warnMsg){lmt12(warnMsg,LOG_LEVELS.WARN,null,true)}function logInfoToTagServer(message,addLoggingContext,logToConsole){const logLevel=LOG_LEVELS.INFO;const callback=null;const consoleLogLevel=void 0;lmt12(message,logLevel,callback,addLoggingContext!==null&&addLoggingContext!==void 0?addLoggingContext:true,consoleLogLevel,logToConsole)}function logDebugToTagServer(message){lmt12(message,LOG_LEVELS.INFO,null,true,LOG_LEVELS.DEBUG)}function logErrorInPostToTagServer(errMsg){log(errMsg,LOG_LEVELS.ERROR);ROM.postToServer(urls.logJsPostURL,{level:LOG_LEVELS.ERROR,line:trimMsg(errMsg)})}function logWarnInPostToTagServer(warnMsg){log(warnMsg,LOG_LEVELS.WARN);ROM.postToServer(urls.logJsPostURL,{level:LOG_LEVELS.WARN,line:trimMsg(warnMsg)})}function lmt12(msg,logLevel,callback,addLoggingContext,consoleLogLevel,logToConsole){if(msg){if(addLoggingContext)msg=plc1(msg);if(logToConsole!==false){if(!consoleLogLevel)consoleLogLevel=logLevel;log(msg,consoleLogLevel)}ROM.post(urls.loggingURL,{level:logLevel,line:trimMsg(msg)},null,false,callback)}}var LOG_LEVELS={FATAL:"FATAL",ERROR:"ERROR",WARN:"WARN",INFO:"INFO",DEBUG:"DEBUG"};var JS_LOG_LEVELS={FATAL:5,ERROR:4,WARN:3,INFO:2,DEBUG:1};function isValidLogLevel(value){for(var logLevel in LOG_LEVELS)if(LOG_LEVELS[logLevel]==value)return true;return false}function isValidBaseFunctionality(){try{validateUrlConstructor()}catch(e){logWarnInPostToTagServer("Chat can't be started because of "+e+" SiteId: "+getSiteID()+" URL: "+location.href.split("?")[0]+" userAgent: "+window.navigator.userAgent);return false}return true}function validateUrlConstructor(){if(typeof URL!=="function")return;var testUrl="https://test-url.nuance.com/test";var url=new URL(testUrl);if(url.hash===void 0||url.host===void 0||url.hostname===void 0||url.href===void 0||url.origin===void 0||url.password===void 0||url.pathname===void 0||url.port===void 0||url.protocol===void 0||url.search===void 0||url.username===void 0||typeof url.searchParams!=="object")throw"Invalid URL constructor."}function sendMessageToTagServer(msg,msgLogLevel,svrLogLevel){log(msg);if(!JSLoggingDisabled){if(inu1(msgLogLevel)||!isValidLogLevel(msgLogLevel))msgLogLevel=LOG_LEVELS.INFO;if(inu1(svrLogLevel)||!isValidLogLevel(svrLogLevel))svrLogLevel=msgLogLevel;if(JS_LOG_LEVELS[msgLogLevel]>=JS_LOG_LEVELS[gc7("JS_LOG_LEVEL")])ROM.post(urls.loggingURL,{level:svrLogLevel,line:trimMsg(msg)})}}function logActionErr(e,rule,msg){var errMsg=cf21(e);var errStr="Error in "+rule+(inu1(msg)?".":" msg="+msg);log(errStr+" ChatID = "+CHM.getChatID()+". CustomerID = "+getCustID());let12(errStr+" \n"+errMsg)}function isPersistentWindow(){try{if((window.parent.name=="_inqPersistentChat"||win.location.hostname+win.location.pathname===location.hostname+location.pathname)&&!isCEAPIPostChatSurveyMode())return true}catch(err){return false}}function rand(low,high,roundToNearestIntegerFlag){if(high<low)throw"Incorrect bounds for random generator: low = "+low+", high = "+high;var delta=high-low;var res=!!roundToNearestIntegerFlag?Math.floor(Math.random()*(delta+1))+low:Math.random()*delta+low;return res}function typeOf(value){var s=typeof value;if(s==="object")if(value){if(typeof value.length==="number"&&!value.propertyIsEnumerable("length")&&typeof value.splice==="function")s="array"}else s="null";return s}function getElementsByClassName(classname,node,winCtxt){if(!node){winCtxt=!!winCtxt?winCtxt:win;node=winCtxt.document.getElementsByTagName("body")[0]}var a;if(node.getElementsByClassName)a=node.getElementsByClassName(classname);else{a=[];var re=new RegExp("\\b"+classname+"\\b");var els=node.getElementsByTagName("*");for(var i=0,j=els.length;i<j;i++)if(re.test(els[i].className))a.push(els[i])}return a}function e9(o,dfltOnError,logOnError){try{var val=o;if(typeof o=="function")val=o();return typeof val!="undefined"&&val!=null}catch(err){if(!!logOnError)logActionErr(err,rule,"JS eval error on expression "+o.toString());return dfltOnError}}function inu1(val){return val==null||typeof val=="undefined"}function isIE(){return window.navigator.appName=="Microsoft Internet Explorer"||window.navigator.userAgent.indexOf("Trident")>=0}function isFF(){return window.navigator.userAgent.indexOf("Firefox")>=0}function isIOS(){return/(iPad|iPhone|iPod)/g.test(window.navigator.userAgent)}function isIOS9(){return/(iPad|iPhone|iPod).*OS 9/i.test(window.navigator.userAgent)}function isOpera(){return window.navigator.userAgent.indexOf("Opera")>=0}function isChrome(){return(window.navigator.userAgent.indexOf("Chrome")>=0||window.navigator.userAgent.indexOf("CriOS")>=0)&&!isAndroidWebView()&&!isEdge()}function isAndroidWebView(){var pattern=new RegExp("Android.*?(wv|Version\\/[.0-9]+).*?Chrome\\/[0-9]{2}","i");return pattern.test(window.navigator.userAgent)}function getIOSNativeSDKInstance(){if(isWebSDK)return;var wk=window.parent.webkit;return wk&&wk.messageHandlers&&wk.messageHandlers.NuanIJSFBridge}function getFormInIOSSDKInstance(){if(isWebSDK)return;var wk=window.parent.webkit;return wk&&wk.messageHandlers&&wk.messageHandlers.NuanSurvey}function getPostSurveyInIOSSDKInstance(){if(isWebSDK)return;var wk=window.parent.webkit;return wk&&wk.messageHandlers&&wk.messageHandlers.NuanPCSurvey}function isSafari(){return(window.navigator.userAgent.indexOf("Safari")>=0||isIOSWebView())&&!isChrome()&&!isEdge()}function isIOSWebView(){var pattern=new RegExp("(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)","i");return pattern.test(window.navigator.userAgent)||isIPadWebViewInDesktopMode()}function isIPadWebViewInDesktopMode(){var pattern=new RegExp("(Macintosh).*AppleWebKit(?!.*Safari)","i");return pattern.test(window.navigator.userAgent)&&!isChrome()}function isEdge(){return window.navigator.userAgent.indexOf("Edge")>=0||window.navigator.userAgent.indexOf("Edg")>=0}function isMobileDevice(){return d8t("Phone")||d8t("Tablet")}function getClientBrowserType(){if(isIE())return"IE";else if(isEdge())return"EDGE";else if(isFF())return"FF";else if(isChrome())return"CHROME";else if(isOpera())return"OPERA";else if(isSafari())return"SAFARI";else return"OTHER"}function getBrowserTypeAndVersion(){var nvg=window.navigator.appName;var userAgt=window.navigator.userAgent;var temp;var matches=userAgt.match(/android(?!.*chrome)/i);if(matches&&(temp=userAgt.match(/version\/([\.\d]+)/i))!=null)matches=["Android Browser",temp[1]];else{matches=userAgt.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);if(matches&&(temp=userAgt.match(/version\/([\.\d]+)/i))!=null)matches[2]=temp[1];if(userAgt.indexOf("Chrome")>=0&&(temp=userAgt.match(/(edge|edg)\/?\s*(\.?\d+(\.\d+)*)/i))){matches[1]=temp[1];matches[2]=temp[2]}matches=matches?[matches[1],matches[2]]:[nvg,window.navigator.appVersion,"-?"]}return matches}function cbtv1(){var browserTypeAndVersion=getBrowserTypeAndVersion();var ua=window.navigator.userAgent;if(ua.indexOf("Trident")>=0){var matches=ua.match(/(trident)\/?\s*(\.?\d+(\.\d+)*)/i);var tridentVersion=new Number(matches[2]);if(tridentVersion>=4)return tridentVersion+4+".0"}return browserTypeAndVersion[1]}function compareVersions(a,b){var v1=a.split(".");var v2=b.split(".");for(var i=0;i<Math.min(v1.length,v2.length);i++){var res=v1[i]-v2[i];if(res!=0)return res}return 0}function getOSType(){var os="Unknown";var platform=window.navigator.platform;var ua=window.navigator.userAgent;if(/Android/.test(ua))os="Android";else if(/iPhone/.test(ua)||/iPad/.test(ua)||/iPod/.test(ua))os="iOS";else if(/Win/.test(platform))os="Windows";else if(/Linux/.test(platform))os="Linux";else if(/Mac/.test(platform))os="Mac OS";return os}function getFullBrowserInfo(){return getOSType()+" "+getClientBrowserType()+" "+cbtv1()}function getBrowserMajorVer(compatibilityOnly){var ver=0;if(isIE()){var ua=window.navigator.userAgent;var tridentInd=ua.indexOf("Trident");if(tridentInd>=0)ver=parseInt(ua.substring(tridentInd+8))+4;else{var ind=ua.indexOf("MSIE ");ver=parseInt(ua.substring(ind+5))}if(compatibilityOnly)if(document.documentMode&&document.documentMode<ver)ver=document.documentMode}return ver}var COOKIE_SIZE_LIMITS={IE8:5118,IE9:5118,IE10:5118,IE11:5118,FF:4097,SAFARI:4093,CHROME:4095,OTHER:4093};var COOKIE_TOTAL_SIZE_LIMITS={IE8:10236,IE9:10236,IE10:10236,IE11:10236,FF:614550,SAFARI:8186,CHROME:732280,OTHER:8186};function csl11(){var browserType=getClientBrowserType();var limit=COOKIE_SIZE_LIMITS[browserType];if(inu1(limit))limit=COOKIE_SIZE_LIMITS[browserType+getBrowserMajorVer()];return limit}function ctl12(){var browserType=getClientBrowserType();var limit=COOKIE_TOTAL_SIZE_LIMITS[browserType];if(inu1(limit))limit=COOKIE_TOTAL_SIZE_LIMITS[browserType+getBrowserMajorVer()];return limit}function plc1(msg,chatID,custID,custIP,siteID,pageID,windowID){var result=msg;if(!result)result="";result+=" ";var o={};try{o["chatID"]=inu1(chatID)?""+CHM.getChatID():chatID}catch(e){}try{o["custID"]=inu1(custID)?getCustID():custID}catch(e){}try{o["custIP"]=inu1(custIP)?getCustIP():custIP}catch(e){}try{o["siteID"]=inu1(siteID)?getSiteID():siteID}catch(e){}try{o["pageID"]=inu1(pageID)?LDM.getPageID():pageID}catch(e){}try{o["windowID"]=inu1(windowID)?CHM.getWindowId():windowID}catch(e){}o["codeVersion"]=v3Lander.codeVersion;for(var itm in o)try{result+=itm+": "+o[itm]+"; "}catch(e){result+=itm+": "+formatArgument(o[itm])+"; "}return result}function cf21(err){try{var desc="\t";if(err&&err.message)desc+=err.message+". ";else desc+="Throw while processing. ";desc+=plc1();desc+="\n\t"+getStackTrace(err);return encodeURIComponent(desc)}catch(e){return""}}function getParamsFromURL(url){var params={};if(typeof url==="string"){var startIndex=url.indexOf("?");if(startIndex>=0){var paramsArray=url.slice(startIndex+1).split("&");var keyValuePair;for(var i=0;i<paramsArray.length;i++){keyValuePair=paramsArray[i].split("=");params[keyValuePair[0]]=keyValuePair[1]}}}return params}function s7(id,dflt,sendErrorToTagServer){if(id)try{var o=evaluateLegacySettings(id,win);return safeResult(o)}catch(err){if(sendErrorToTagServer)let12(cf21(err))}return dflt}function getDataFromParentByName(name){try{return safeResult(win[name])}catch(err){let12(cf21(err),false)}}function safeResult(o){if(inu1(o))return o;else if(typeOf(o)=="array")return Array.clone(o);else if(o.getTime){if(!o.equals)MI8.prepare(o).im13(DateMixIn)}else if(o.toExponential)if(!o.inRange)MI8.prepare(o).im13(NumberMixIn);return o}function objectEquals(obj1,obj2){if(typeof obj1!==typeof obj2)return false;if(typeof obj1==="function")return obj1.toString()===obj2.toString();if(obj1 instanceof Object&&obj2 instanceof Object){if(countProps(obj1)!==countProps(obj2))return false;var flag=true;for(var key in obj1){flag=objectEquals(obj1[key],obj2[key]);if(!flag)return false}return true}else return obj1===obj2;function countProps(obj){var count=0;for(var prop in obj)if(obj.hasOwnProperty(prop))count++;return count}}function processReceivedExternalDataThrows(id,dflt){return s7(id,dflt,true)}function isEmptyObject(obj){for(var i in obj)return false;return true}function secureProtocol(url){var URL_REGEXP_IS_CONTAINS_PROTOCOL=new RegExp("^[0-9A-z\\.\\+\\-]*:|^//");if(url==null||url.length==0)return url;url=url.trim();if(url.match(URL_REGEXP_IS_CONTAINS_PROTOCOL))return url.replace(/^HTTPS?:/i,"https:");else return"https://"+url}function secureHTTP(httpURL){return httpURL?httpURL.replace(/^http:/i,"https:"):httpURL}function objectAsLogString(obj,encodingRequired){if(!obj)return null;var string="";for(var a in obj)if(!inu1(obj[a])&&obj[a]!==""){var encodedPair=encodingRequired?encodeURIComponent(a)+","+encodeURIComponent(obj[a]):a+","+obj[a];string+=!!string?";"+encodedPair:encodedPair}return string}function productionFilter(hostedFileList,_productionFilter){if(_productionFilter){var filters=_productionFilter.split(",");var listItems=hostedFileList.split(",");var filteredListItems=[];var regexProduction=new RegExp(filters[0],"i");var production=regexProduction.test(isWebSDK?window.pageUrl:inqFrame.parent.location.href);if(production){for(var i=0;i<listItems.length;i++){var item=listItems[i];if(regexProduction.test(item))filteredListItems.push(item)}return filteredListItems.join(",")}else if(filters.length>1){var walledGarden;var filter;for(i=1;i<filters.length;i++){filter=filters[i];walledGarden=filter.indexOf("-")==0;var regexSilo=new RegExp(walledGarden?filter.substr(1):filter,"i");var silo=regexSilo.test(isWebSDK?window.pageUrl:inqFrame.parent.location.href);if(silo){for(i=0;i<listItems.length;i++){var item=listItems[i];if(regexSilo.test(item)||!walledGarden&&regexProduction.test(item))filteredListItems.push(item)}return filteredListItems.join(",")}}}}return hostedFileList}function attachListener(target,type,listener,useCapture){if(!useCapture)useCapture=false;if(target.addEventListener)target.addEventListener(type,listener,useCapture);else if(target.attachEvent)target.attachEvent("on"+type,listener)}function detachListener(target,type,listener,useCapture){if(!useCapture)useCapture=false;if(target.removeEventListener)target.removeEventListener(type,listener,useCapture);else if(target.attachEvent)target.detachEvent("on"+type,listener)}function firstExisting(method){for(var i=1;i<arguments.length;i++){var obj=arguments[i];if(obj&&obj[method])return obj[method].call(obj)}return null}function getDefaultValueIfNull(val,def){return inu1(val)?def:val}function storageAvailable(type){try{var storage=window[type];var x="__storage_test__";storage.setItem(x,x);var result=storage.getItem(x)==x;storage.removeItem(x);return!!storage&&result}catch(e){return false}}function isElementInViewport(el){if(!el)return false;var rect=el.getBoundingClientRect();var vpHeight=window.top.innerHeight;var vpWidth=window.top.innerWidth;return rect.top>=0&&rect.left>=0&&rect.bottom<=vpHeight&&rect.right<=vpWidth}function attributeMapToString(mapArray){var nameEqualValueFormatter=function(val){return name+"="+val};var result="";if(!inu1(mapArray)){var name;Object.keys(mapArray).forEach((function(key){name=key;var arr=mapArray[name];var nvArr=arr.map(nameEqualValueFormatter);if(result.length>0)result+=",";result+=nvArr.join(",")}))}return result}function attributesStringToMap(attrs){function split2(str,sep){var index=str.indexOf(sep);if(index<0)return[str,""];else return[str.substring(0,index),str.substring(index+sep.length)]}var map={};var delimiter="=";if(!!attrs){var attrsArray=attrs.split(",");for(var i=0;i<attrsArray.length;i++){var nameValue=split2(attrsArray[i],delimiter);if(!map[nameValue[0]])map[nameValue[0]]=[];map[nameValue[0]].push(nameValue[1])}}return map}function trimMsg(sourceMsg){var maxLogLineLength=gc7("MAX_LOG_LINE_LENGTH");if(sourceMsg&&sourceMsg.length&&sourceMsg.length>maxLogLineLength)return sourceMsg.substring(0,maxLogLineLength)+"... Message was trimmed to "+maxLogLineLength+" symbols, original size is:"+sourceMsg.length;else return sourceMsg}function prefetchResource(path,errorHandler){var resource=win.document.createElement("link");resource.rel="prefetch";resource.as="script";resource.href=path;resource.onerror=function(){if(typeof errorHandler==="function")errorHandler()};win.document.head.appendChild(resource)}function isPersistentChatLaunchingLimited(){return isPersistentWindow()&&(isIE()||isEdge())}function debounce(func,wait,immediate){var timeout;return function(){var context=this,args=arguments;var later=function(){timeout=null;if(!immediate)func.apply(context,args)};var callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow)func.apply(context,args)}}function isACIFLoadedFromBR(){return!!gc7("ACIF_VERSION",null)}function isPreassignedChat(){return!Application.application.isConnected()&&!CHM.getAgentID()}function createScriptElement(){var script=document.createElement("script");script.type="text/javascript";script.language="javascript";script.setAttribute("language","javascript");script.setAttribute("type","text/javascript");script.charset="utf-8";return script}function generateRequestId(key){return key+Math.floor(Math.random()*1000001)}function sendBeacon(url,data){url+="&timestamp="+(new Date).getTime();if(navigator.sendBeacon)navigator.sendBeacon(url,data);else sendBeaconByXHR(url,data)}function sendBeaconByXHR(url,data){var xHR=new XMLHttpRequest;xHR.open("POST",url,false);xHR.setRequestHeader("Content-Type","text/plain;charset=UTF-8");xHR.send(data)}function isValidHttpUrl(string){let url;try{url=parseUrl(string)}catch(_){return false}return url.protocol==="http:"||url.protocol==="https:"}function parseUrl(str){if(typeof URL==="function")return new URL(str);else return customParseUrl(str)}function customParseUrl(str){var result;var m=str.match(/^(https?:)\/\/([^\/:]+)(:?(\d*))/);var protocol="";var hostname="";var port="";var origin="";if(m){protocol=m[1];hostname=m[2];port=m[4]?m[4]:"";origin=protocol+"//"+hostname;if(port!==""&&(port!=="80"||protocol!=="http:")&&(port!=="443"||protocol!=="https:"))origin+=":"+port}result={origin:origin,href:str,protocol:protocol,hostname:hostname,port:port};return result}function getStackTrace(err){try{var callstack=[];if(arguments&&arguments.callee&&arguments.callee.caller){var fnctn=arguments.callee.caller;while(fnctn){if(callstack.length>32)break;var fn=fnctn.toString();var fnameIx=fn.indexOf("function ")+9;var fnameEnd=fn.indexOf("(",fnameIx);var fname=fn.substring(fnameIx,fnameEnd)||"anonymous function";var args="";if(fnctn.arguments.length)for(var ix=0;ix<fnctn.arguments.length;ix++){var arg=fnctn.arguments[ix];args+=(args.length!=0?",":"")+formatArgument(arg)}callstack.push(fname+"("+args+")");fnctn=fnctn.caller}var errorStackTrace;try{errorStackTrace="error stack trace: "+err.stack}catch(error){errorStackTrace="Failed to retrieve error object's stacktrace."}var callerStackTrace="caller stack trace:\n\t\t"+callstack.join("\n\t\t");return callerStackTrace+"\n"+errorStackTrace}}catch(e){}return""}function formatArgument(arg){try{return customJSONStringify(arg)}catch(customJSONStringifyError){try{return customFormatArgument(arg)}catch(customFormatArgumentError){return"[argument]"}}}function customJSONStringify(arg){var stringifiedArgument=JSON.stringify(arg);var valueWasConvertedToNull=arg!==null&&stringifiedArgument==="null";if(valueWasConvertedToNull)throw new Error("JSON.stringify converted"+arg+" to null");var valueWasConvertedToUndefined=arg!==void 0&&stringifiedArgument===void 0;if(valueWasConvertedToUndefined)throw new Error("JSON.stringify converted"+arg+" to undefined");if(arg===void 0)throw new Error("Can not stringify undefined value");return stringifiedArgument}function customFormatArgument(arg){var type="[unknown]";try{type=typeof arg=="object"?arg["constructor"]!=null?arg.constructor.toString():""+arg:"("+typeof arg+")"}catch(e){type=""+arg}if(type.indexOf("function")!=-1)type=type.split("\n").join(" ").replace(/^\s*function (\w+)\s*\(\)[^\n]*/g,"[object $1]");if(type=="(boolean)"||type=="[object Boolean]")type=arg?"true":"false";if(type=="(string)"||type=="[object String]")type=arg;if(type=="(number)")type=""+arg;if(type=="(array)"||type=="[object Array]"){type="";for(var ix=0;ix<arg.length;ix++){type+=(type.length!=0?",":"")+customFormatArgument(arg[ix]);if(type.length>128)break}if(type.length>128)type=type.substr(0,128-3)+"...";return"["+type+"]"}return type}function getInqFrameURL(){var port="";if(inqFrame.location.port!="")port=":"+inqFrame.location.port;return inqFrame.location.protocol+"//"+inqFrame.location.hostname+port+inqFrame.location.pathname}function setParamToObject(obj,paramName,value,createOnly){var params=paramName.split(".");var currObj=obj;for(var i=0;i<params.length-1;i++){if(inu1(currObj[params[i]]))currObj[params[i]]={};currObj=currObj[params[i]]}if(currObj[params[params.length-1]]===void 0||!createOnly)currObj[params[params.length-1]]=value}function setParamToObjectIfParamAbsent(obj,paramName,value){setParamToObject(obj,paramName,value,true)}function TimeoutIncrement(increment,maxDelay){this.delayTimeout=0;this.increment=increment;this.maxDelay=maxDelay}TimeoutIncrement.prototype.getNextTimeout=function(){if(this.delayTimeout<this.maxDelay)this.delayTimeout+=this.increment;return this.delayTimeout};TimeoutIncrement.prototype.reset=function(){this.delayTimeout=0};(function(){if(typeof window.XMLHttpRequestFacade!="undefined")return;if(!!window["XMLHttpRequest"])if("FACADE"in window.XMLHttpRequest){if("console"in window)console.error("XF: ERROR: Inconsistent xform window state detected")}else window.XMLHttpRequestOriginal=XMLHttpRequest;window.XMLHttpRequestFacade=function(){this._impl=XMLHttpRequestFacade._factory();this._impl._subclass=this;this.log=function(s){if("console"in window)console.log("XHRF: "+s)};this.error=function(s,ex){if("console"in window)console.log("XHRF: "+s,ex)};this.debug=function(s,ex){if("console"in window&&this._debug)console.log("XHRF: "+s,ex)};this.onabort=null;this.onerror=null;this.onload=null;this.onloadend=null;this.onloadstart=null;this.onprogress=null;this.onreadystatechange=null;this._debug=false;this.readyState=0;this.response="";this.responseText="";this.responseBody="";this.responseType="";this.responseXML=null;this.status=0;this.statusText=0;this._impl.onabort=function(event){this._subclass._syncupFromImpl();if(null!=this._subclass.onabort)this._subclass.onabort(event)};this._impl.setOnError((function(event){this._subclass._syncupFromImpl();if(null!=this._subclass.onerror)this._subclass.onerror(event)}));this._impl.setOnLoad((function(event){this._subclass._syncupFromImpl();if(null!=this._subclass.onload)this._subclass.onload(event)}));this._impl.onloadend=function(event){this._subclass._syncupFromImpl();if(null!=this._subclass.onloadend)this._subclass.onloadend(event)};this._impl.onloadstart=function(event){this._subclass._syncupFromImpl();if(null!=this._subclass.onloadstart)this._subclass.onloadstart(event)};this._impl.onprogress=function(event){this._subclass._syncupFromImpl();if(null!=this._subclass.onprogress)this._subclass.onprogress(event)};this._impl.onreadystatechange=function(event){this._subclass._syncupFromImpl();if(null!=this._subclass.onreadystatechange)this._subclass.onreadystatechange(event)};this.addEventListener=function(type,listener,useCapture){this.debug("addEventListener: "+type);if(!useCapture)useCapture=false;if("addEventListener"in this._impl)this._impl.addEventListener(type,listener,useCapture)};this.removeEventListener=function(type,listener){if("removeEventListener"in this._impl)this._impl.removeEventListener(type,listener,useCapture)};this.abort=function(){if("abort"in this._impl)this._impl.abort();else this.error("abort: Not implemented")};this.getAllResponseHeaders=function(){if("getAllResponseHeaders"in this._impl)return this._impl.getAllResponseHeaders()};this.getResponseHeader=function(headerString){if("getResponseHeader"in this._impl)return this._impl.getResponseHeader(headerString)};this.open=function(methodString,methodUrl,asyncFlag,userString,userPassword){if(asyncFlag==null)asyncFlag=true;var domain=this.constructor.defaultServerDomain;var proto=this.constructor.defaultServerProtocol;if(domain==null)domain="";if(proto==null)proto="";if(proto.length>0)if(proto.indexOf(":")==-1)proto+=":";var rx=new RegExp('((http://|https://|//|/|#){0,1}[^"]*)',"i");var parts=rx.exec(methodUrl);var url="";switch(parts[2]){case"http://":case"https://":case"#":url=parts[1];break;case"//":url=proto+parts[1];break;case"/":url=proto+"//"+domain+parts[1];break;default:url=path+"/"+parts[1];break}methodUrl=url;var jsessionid=this.constructor.jsessionid;if(jsessionid!=null&&jsessionid.length>0){parts=methodUrl.split("?");parts[0]+=";jsessionid="+jsessionid;methodUrl=parts.join("?")}if(arguments.length<4)this._impl.open(methodString,methodUrl,asyncFlag);else if(arguments.length<5)this._impl.open(methodString,methodUrl,asyncFlag,userString);else this._impl.open(methodString,methodUrl,asyncFlag,userString,userPassword)};this.overrideMimeType=function(mimeString){this.debug("override: "+mimeString);if("overrideMimeType"in this._impl)return this._impl.overrideMimeType(mimeString)};this.send=function(data){this.debug("send");if("send"in this._impl)if(!!data)return this._impl.send(data);else return this._impl.send()};this.setRequestHeader=function(headerString,valueString){this.debug("setRequestHeader: "+headerString+": "+valueString);try{if("setRequestHeader"in this._impl)return this._impl.setRequestHeader(headerString,valueString)}catch(e){this.error("setRequestHeader: Error",e)}};this._syncupFromImpl=function(){this.debug("sync readyState");this.readyState=this._impl.readyState;this.response=this._impl.response;this.responseText=this._impl.responseText;try{this.responseBody=this._impl.responseBody}catch(X){}this.responseType=this._impl.responseType;try{this.responseXML=this._impl.responseXML}catch(X){}try{this.status=this._impl.status}catch(X){}try{this.statusText=this._impl.statusText}catch(X){}};return this};XMLHttpRequestFacade._factory=function(){if(typeof window.XMLHttpRequestOriginal!="undefined"){var impl=new XMLHttpRequestOriginal;if("withCredentials"in impl){impl.setOnLoad=function(handler){this.onload=handler};impl.setOnError=function(handler){this.onerror=handler};return impl}}if(window.Inq&&window.Inq.FlashPeer&&typeof window.Inq.FlashPeer.logErrorToServer=="function")window.Inq.FlashPeer.logErrorToServer("XMLHttpRequestOriginal "+" or withCredentials parameter is absent."+" Factory function will return empty object.");return{}};try{window.XMLHttpRequestFacade.name="XMLHttpRequest"}catch(e){}window.XMLHttpRequestFacade.DONE=4;window.XMLHttpRequestFacade.LOADING=3;window.XMLHttpRequestFacade.HEADERS_RECEIVED=2;window.XMLHttpRequestFacade.OPENED=1;window.XMLHttpRequestFacade.UNSENT=0;window.XMLHttpRequestFacade.defaultServerDomain=null;window.XMLHttpRequestFacade.defaultServerProtocol="";window.XMLHttpRequestFacade.jsessionid="";window.XMLHttpRequestFacade.FACADE=true})();Object.defineProperty(Date.prototype,"roll",{value:function(rollTimeInMS){this.setTime(this.getTime()+rollTimeInMS);return this},configurable:true,enumerable:false});Object.defineProperty(Date.prototype,"diff",{value:function(otherDate){return otherDate?this.getTime()-otherDate.getTime():0},configurable:true,enumerable:false});Object.defineProperty(Date.prototype,"before",{value:function(otherDate){return otherDate?this.getTime()<otherDate.getTime():0},configurable:true,enumerable:false});Object.defineProperty(Date.prototype,"after",{value:function(otherDate){return otherDate?this.getTime()>otherDate.getTime():0},configurable:true,enumerable:false});Object.defineProperty(Date.prototype,"equals",{value:function(otherDate){if(otherDate)return this.getTime()==otherDate.getTime();return false},configurable:true,enumerable:false});var DateMixIn=function(){return{equals:Date.prototype.equals,roll:Date.prototype.roll,diff:Date.prototype.diff,before:Date.prototype.before,after:Date.prototype.after}}();Object.defineProperty(Array.prototype,"contains",{value:function(item,equalsFcn){for(var idx=0;idx<this.length;idx++)if(equalsFcn&&equalsFcn(this[idx],item)||!inu1(item)&&item.equals&&item.equals(this[idx])||this[idx]==item)return true;return false},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"containsAll",{value:function(_arr){for(var idx=0;idx<_arr.length;idx++)if(!this.contains(_arr[idx]))return false;return true},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"isEmpty",{value:function(){if(this.length)return false;return true},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"append",{value:function(a){if(!!a&&!!a.length)for(var i=0;i<a.length;i++)this.push(a[i]);return this},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"prepend",{value:function(a){for(var i=0;i<a.length;i++)this.unshift(a[a.length-1-i]);return this},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"indexOf",{value:function(el){var ind=-1;for(var i=0;i<this.length;i++)if(this[i]==el){ind=i;break}return ind},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"constrain",{value:function(len){if(len&&len>0&&this.length>len)this.length=len;return this},configurable:true,enumerable:false});Array.clone=function(_arr){if(_arr){var rv=[];if(typeOf(_arr)=="array"){for(var idx=0;idx<_arr.length;idx++)rv[idx]=_arr[idx];return rv}}return _arr};Date.roll=function(date,rollTimeInMS){if(date&&date instanceof Date){if(rollTimeInMS&&!isNaN(rollTimeInMS))date.setTime(date.getTime()+rollTimeInMS);return date}return new Date(0)};Date.diff=function(firstDate,secondDate){if(firstDate instanceof Date&&secondDate instanceof Date)return firstDate.diff(secondDate);return 0};Object.defineProperty(Array.prototype,"_assertNumType",{value:function(){if(this.length>0&&typeof this[0]!="number")throw"OperationNotSupported: can't sum on a non-numerical list"},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"sum",{value:function(){this._assertNumType();if(!this.length)return 0;else return this[0]+this.slice(1).sum()},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"std_dev",{value:function(){this._assertNumType();var sum=this.sum();var mean=sum/this.length;for(var i=0,variance=0;i<this.length;i++)variance+=Math.pow(this[i]-mean,2);variance/=this.length;return Math.sqrt(variance)},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"average",{value:function(){this._assertNumType();var sum=0;for(var i=0;i<this.length;i++)sum+=this[i];return sum/this.length},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"size",{value:function(){return this.length},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"_visit",{value:function(o,bFcn,bool){for(var i=0;i<this.length;i++)if(bFcn(this[i],o)!=bool)return false;return true},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"after",{value:function(d){return this._visit(d,(function(d1,d2){return d1.after(d2)}),true)},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"before",{value:function(d){return this._visit(d,(function(d1,d2){return d1.before(d2)}),true)},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"remove",{value:function(index){if(index<0||index>this.length)return;for(var i=index;i+1<this.length;i++)this[i]=this[i+1];this.length=this.length-1},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"keys",{value:function(){var out=new Array;for(var index=0;index<this.length;index++){var entry=this[index];out.push(entry.key)}return out},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"values",{value:function(){var out=new Array;for(var index=0;index<this.length;index++){var entry=this[index];out.push(entry.value)}return out},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"findEntry",{value:function(key){for(var index=0;index<this.length;index++)if(this[index].key==key)return this[index];return null},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"get",{value:function(key){var entry=this.findEntry(key);if(entry)return entry.value;return null},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"set",{value:function(key,value,findEntry){var entry=null;if(typeof findEntry=="undefined"||findEntry==true)entry=this.findEntry(key);if(entry)entry.value=value;else{entry={key:key,value:value};this.push(entry)}},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"unset",{value:function(key){for(var index=0;index<this.length;index++)if(this[index].key==key){this.remove(index);break}},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"clear",{value:function(){this.length=0},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"collect",{value:function(fnc){if(typeof fnc!="function")return null;var out=[];for(var index=0;index<this.length;index++){var entry=this[index];if(entry.key&&entry.value)out.push(fnc(entry.key,entry.value));else out.push(fnc(entry))}return out},configurable:true,enumerable:false});Object.defineProperty(Array.prototype,"each",{value:function(fnc){if(typeof fnc!="function")return;for(var index=0;index<this.length;index++){var entry=this[index];fnc(entry.key,entry.value,this)}},configurable:true,enumerable:false});if(!Array.prototype.forEach)Object.defineProperty(Array.prototype,"forEach",{value:function(callback,thisArg){for(var i=0,n=this.length;i<n;i++)if(i in this)callback.call(thisArg,this[i],i,this)},configurable:true,enumerable:false});Array.prepareMapToSerialize=function(map){var out={};for(var i=0;i<map.length;i++){var element=map[i];out[element.key]=element.value}return out};Object.defineProperty(Number.prototype,"inRange",{value:function(low,high){if(high<low)throw"Incorrect range bounds: low = "+low+", high = "+high;if(this>=low&&this<=high)return true;else return false},configurable:true,enumerable:false});var NumberMixIn=function(){return{inRange:Number.prototype.inRange}}();Object.defineProperty(String.prototype,"contains",{value:function(searchString,bIgnoreCase,isRegexp){if(inu1(searchString))return false;if(!isRegexp){var str1;var str2;if(bIgnoreCase){str1=this.toLowerCase();str2=searchString.toLowerCase()}else{str1=this;str2=searchString}var ind=str1.indexOf(str2);return ind!=-1}else{var reFlags="";if(bIgnoreCase)reFlags="i";var re=new RegExp(searchString,reFlags);return re.test(this)}},configurable:true,enumerable:false});Object.defineProperty(String.prototype,"startsWith",{value:function(searchString,bIgnoreCase,isRegexp){if(inu1(searchString))return false;if(!isRegexp){var str1;var str2;if(bIgnoreCase){str1=this.toLowerCase();str2=searchString.toLowerCase()}else{str1=this;str2=searchString}var ind=str1.indexOf(str2);return ind==0}else{var reFlags="";if(bIgnoreCase)reFlags="i";if(searchString.charAt(0)!="^")searchString="^"+searchString;var re=new RegExp(searchString,reFlags);return re.test(this)}},configurable:true,enumerable:false});Object.defineProperty(String.prototype,"endsWith",{value:function(searchString,bIgnoreCase,isRegexp){if(inu1(searchString))return false;if(!isRegexp){var str1;var str2;if(bIgnoreCase){str1=this.toLowerCase();str2=searchString.toLowerCase()}else{str1=this;str2=searchString}var ind=str1.lastIndexOf(str2);return ind!=-1&&ind==str1.length-str2.length}else{var reFlags="";if(bIgnoreCase)reFlags="i";if(searchString.charAt(searchString.length-1)!="$")searchString+="$";var re=new RegExp(searchString,reFlags);return re.test(this)}},configurable:true,enumerable:false});Object.defineProperty(String.prototype,"equals",{value:function(searchString,bIgnoreCase,isRegexp){if(inu1(searchString))return false;if(!isRegexp){var str1;var str2;if(bIgnoreCase){str1=this.toLowerCase();str2=searchString.toLowerCase()}else{str1=this;str2=searchString}return str1==str2}else{var reFlags="";if(bIgnoreCase)reFlags="i";if(searchString.charAt(0)!="^")searchString="^"+searchString;if(searchString.charAt(searchString.length-1)!="$")searchString+="$";var re=new RegExp(searchString,reFlags);return re.test(this)}},configurable:true,enumerable:false});Object.defineProperty(String.prototype,"hashCode",{value:function(){var hash=0;for(var i=0;i<this.length;i++){var char=this.charCodeAt(i);hash=(hash<<5)-hash+char;hash<<=0}return hash},configurable:true,enumerable:false});if(!String.prototype.trim)Object.defineProperty(String.prototype,"trim",{value:function(){return this.replace(/^\s+|\s+$/g,"")},configurable:true,enumerable:false});if(!String.prototype.replaceAll)String.prototype.replaceAll=function(pattern,replacement){if(Object.prototype.toString.call(pattern).toLowerCase()==="[object regexp]")return this.replace(pattern,replacement);return this.replace(new RegExp(pattern,"g"),replacement)};function DataExporter(){}DataExporter.prototype.getData=function(){};var MI8=function(){function _throwNoImpl(){throw this.getID()+": "+arguments.callee.name+" requires override."}function wrapWithTryCatch(code){return"try{"+code+"}catch(e){if(window.console)window.console.error('ERROR:' + e.message);};\n"}var XJA3={absorb:function(absorbee,agregateFlag){if(absorbee)for(var name in absorbee)if(typeOf(this[name])=="object"&&typeOf(absorbee[name])=="object"&&agregateFlag){MI8.mixAbsorber(this[name]);this[name].absorb(absorbee[name])}else this[name]=absorbee[name];return this}};var RC54={onRemoteCallback:_throwNoImpl,callRemote:function(url,data){ROM.doRemoteCall(url,data,this)},send:function(){ROM.send.apply(ROM,arguments)}};var Resource={_resource:function(id){this._rsrcID=id},write:_throwNoImpl,read:_throwNoImpl,_serialize:_throwNoImpl,_deserialize:_throwNoImpl,getResourceID:function(){return this._rsrcID}};var DataReadyListener={agrtyer:_throwNoImpl};var Persistable={getPersistentID:_throwNoImpl,load:_throwNoImpl,save:_throwNoImpl,agrtyer:_throwNoImpl};var FM2={_frameworkModule:function(id){this._id=id},getID:function(){return this._id},init:_throwNoImpl,start:_throwNoImpl,reset:_throwNoImpl};var Observable=function(){var retval={addListeners:function(_arr){for(var idx=0;idx<_arr.length;idx++)this.addListener(_arr[idx])},_observable:function(){this._listeners=[];this.observable=true},clearListeners:function(){this._listeners=[]},_fireEvt:function(vfcn,evt){for(var idx=0;idx<this._listeners.length;idx++){var listener=this._listeners[idx];vfcn(listener,evt);if(typeof listener.onAnyEvent=="function")listener.onAnyEvent(evt)}},addListener:function(l){if(l&&(this.isListener(l)||l.onAnyEvent))this._listeners.push(l)},removeListener:function(name){for(var idx=0;idx<this._listeners.length;idx++)if(typeof this._listeners[idx][name]=="function")this._listeners.splice(idx--,1)},removeListenerByReference:function(listener){let onKeys=Object.keys(listener).filter((key=>/^on/.test(key)));onKeys.forEach((key=>{this._listeners=this._listeners.filter((_listener=>_listener[key]!==listener[key]))}))},isListener:_throwNoImpl};return retval}();var _JSON;if(jsSDKEnabled===false)_JSON=function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Object.defineProperty(Date.prototype,"toJSON",{value:function(key){return this.getTime()},configurable:true,enumerable:false});Object.defineProperty(String.prototype,"toJSON",{value:function(key){return this.valueOf()},configurable:true,enumerable:false});Object.defineProperty(Number.prototype,"toJSON",{value:function(key){return this.valueOf()},configurable:true,enumerable:false});Object.defineProperty(Boolean.prototype,"toJSON",{value:function(key){return this.valueOf()},configurable:true,enumerable:false})}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapeable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapeable.lastIndex=0;return escapeable.test(string)?'"'+string.replace(escapeable,(function(a){var c=meta[a];if(typeof c==="string")return c;return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function")value=value.toJSON(key);if(typeof rep==="function")value=rep.call(holder,key,value);switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value)return"null";gap+=indent;partial=[];if(typeof value.length==="number"&&!value.propertyIsEnumerable("length")){length=value.length;for(i=0;i<length;i+=1)partial[i]=str(i,value)||"null";v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v)partial.push(k+(gap?": ":":")+v)}}}else for(k in value)if(k!="")try{if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v)partial.push(k+(gap?": ":":")+v)}}catch(e){var eMsg="Exception at Object.hasOwnProperty.call("+value+", "+k+") ";eMsg+=cf21(e)+" in JSON.str("+key+", "+holder+")";ROM.post(urls.loggingURL,{level:"WARN",line:eMsg})}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}function clone(object){return parse(stringify(object))}function stringify(value,replacer,space){if(typeof value=="undefined"||value==null)return null;var i;gap="";indent="";if(typeof space==="number")for(i=0;i<space;i+=1)indent+=" ";else if(typeof space==="string")indent=space;rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number"))throw new Error("_JSON.stringify");return str("",{"":value})}function parse(text,reviver){if(!text)return null;if(useNativeJson())try{return JSON.parse(text)}catch(e){try{var formattedJSON=text.replace(/([{,])([\w\\.]+)(:)/g,'$1"$2"$3');return JSON.parse(formattedJSON)}catch(e){e.message="Error while parsing JSON: "+e.message+". Input JSON: "+text;throw e}}else{var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object")for(k in value)if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==void 0)value[k]=v;else delete value[k]}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text))text=text.replace(cx,(function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));try{j=evaluateLegacySettings("("+text+")")}catch(e){e.message="Error while parsing JSON: "+e.message+". Input JSON: "+text;throw e}return typeof reviver==="function"?walk({"":j},""):j}}var retval={clone:clone,stringify:stringify,parse:parse};return retval}();else{_JSON=window.JSON;var oParse=_JSON.parse;_JSON.parse=function(text,reviver){if(!text)return null;return oParse(text,reviver)};_JSON.clone=function(object){return JSON.parse(JSON.stringify(object))}}var Cloneable=function(){var retval={clone:function(){return JSON.parse(JSON.stringify(this))}};return retval}();var im13=function(mixable){if(mixable)for(var name in mixable)if(!this[name])if(this.prototype)this.prototype[name]=mixable[name];else this[name]=mixable[name];return this};function prepare(_class){if(_class)_class.im13=im13;return _class}function mixAbsorber(o){if(!o)o={};o.absorb=XJA3.absorb;return o}function clonize(o){if(!!o&&typeOf(o)=="object")o.clone=function(){return JSON.parse(JSON.stringify(this))};return o}function mixSettable(o){if(inu1(o))o={};if(!!o&&typeOf(o)=="object"){o.set=function(n,v){if(!!n||n===0||n==="")this[n]=v;else{var error=new Error;log("Settable: Unable to set n,v=("+n+","+v+") on "+this.toString()+". \n"+error.stack)}return this};o.setIfNotEmpty=function(name,value){if(!!value)return this.set(name,value);else return this}}return o}function mixRemovable(o){if(inu1(o))o={};if(!!o&&typeOf(o)=="object")o.remove=function(n){if(!!n||n===0||n==="")delete this[n];return this};return o}function mixRenamable(o){if(inu1(o))o={};if(!!o&&typeOf(o)=="object")o.rename=function(on,nn){if((!!on||on===0||on==="")&&(!!nn||nn===0||nn==="")){var v=this[on];if(!!v||v===0)delete this[on];this[nn]=v}return this};return o}function unmixMutatable(o){delete o.rename;delete o.remove;delete o.set;delete o.setIfNotEmpty;return o}function mixMutatable(o){o=mixRemovable(o);o=mixSettable(o);o=mixRenamable(o);return o}function unmix(o){o=unmixMutatable(o);delete o.absorb;delete o.im13;return o}return{prepare:prepare,Observable:Observable,JSON:_JSON,mixMutatable:mixMutatable,unmixMutatable:unmixMutatable,mixAbsorber:mixAbsorber,XJA3:XJA3,Resource:Resource,Persistable:Persistable,FM2:FM2,RC54:RC54,clonize:clonize,Cloneable:Cloneable,wrapWithTryCatch:wrapWithTryCatch,unmix:unmix}}();function DMgr(){}DMgr.let12=function(module,message){if(DMgr.Modules[module])let12(message,true)};DMgr.lwt12=function(module,message){if(DMgr.Modules[module])lwt12(message)};DMgr.logInfoToTagServer=function(module,message){if(DMgr.Modules[module])logInfoToTagServer(message)};DMgr.logDebugToTagServer=function(module,message){if(DMgr.Modules[module])logDebugToTagServer(message)};DMgr.switchForModule=function(name,value){if(DMgr.Modules.hasOwnProperty(name)&&typeof value==="boolean"){DMgr.Modules[name]=value;log("DMgr: debug for "+name+" switched to "+value);return true}else{log("DMgr: debug for "+name+" wasn't enabled, because this"+" module is absent or value isn't boolean",LOG_LEVELS.WARN);return false}};DMgr.Modules={VA_DATA_PASS:false};class LR45{constructor(){if(!LR45.init)LR45.init=LR45._init()}static _init(){if(window.addEventListener)window.addEventListener("message",LR45.handleResponse,false);else if(window.attachEvent)window.attachEvent("onmessage",LR45.handleResponse);else window.onmessage=LR45.handleResponse;const postToServerHtmPath=LR45.getP2sPath();const postToServerHtmPathIncludedSiteID=LR45.getP2sPath(true);LR45.putItemToP2sStorage(urls.vanityURL,"/tagserver/".concat(postToServerHtmPathIncludedSiteID));LR45.putItemToP2sStorage(urls.cobrowseURL,"/cobrowse/".concat(postToServerHtmPath));LR45.putItemToP2sStorage(urls.mediaRootURL,"/tagserver/".concat(postToServerHtmPathIncludedSiteID));return true}static getP2sPath(includeSiteID){var _v3Lander;const CODE_VERSION_PARAM_NAME="codeVersion";const requestParameters={};const codeVersion=((_v3Lander=v3Lander)===null||_v3Lander===void 0?void 0:_v3Lander.codeVersion)||Date.now();const postToServerHtmName=site.JSDebugMode?"postToServer.dev.htm":"postToServer.min.htm";if(includeSiteID)requestParameters.siteID=getSiteID();requestParameters[CODE_VERSION_PARAM_NAME]=codeVersion;return"".concat(postToServerHtmName,"?").concat(ROM.toParamString(requestParameters,true,false))}static putItemToP2sStorage(url,p2pPath){const{hostname:hostname}=parseUrl(url);LR45.p2sStorage[hostname]=hostname+p2pPath}static handleResponse(event){if(!event.data)return false;if(event.data.error)LR45.handleError(event);else LR45.handleSuccess(event)}static handleSuccess(event){var _data;let{data:data}=event;const{origin:origin}=event;if(typeof data==="string")data=LR45.convertStrToArray(data);if((_data=data)!==null&&_data!==void 0&&_data[0]){const id=data[0];const context=LR45.getContext(id);if(context){if(!LR45.frameStorage[origin]){let12("LR45.handleSuccess. Origin doesn't match the message came from so event ".concat(JSON.stringify(event)," ignored."),true);return}context.origin=origin;const cmd=data[1];context.id=id;if(data.length>2){[,,context.responseStatus,context.responseHeaderCacheControl,context.contentType]=data;if(!context.contentType.includes("image/gif"))if(context.contentType.includes("application/json"))try{context.data=MI8.JSON.parse(cmd)}catch(e){logErrorInPostToTagServer("LR45.handleSuccess:".concat(cf21(e)))}else context.data=cmd}else try{if(cmd&&cmd.indexOf("{")===0)context.data=MI8.JSON.parse(cmd);else context.data=cmd}catch(e){logErrorInPostToTagServer(plc1("LR45.handleSuccess. cmd ".concat(JSON.stringify(cmd)," couldn't be parsed. ").concat(e.message)))}if(context.callbackFun)context.callbackFun.call(void 0,context);LR45.unregisterContext(id,origin)}}}static handleError({data:data,origin:origin}){const{id:id}=data;const context=LR45.getContext(id);if(typeof(context===null||context===void 0?void 0:context.callbackFunErr)==="function")context.callbackFunErr(data.error);else let12("LR45.handleError. Could not find context or error callback for data ".concat(JSON.stringify(data)," with origin ").concat(origin),true);LR45.unregisterContext(id,origin)}static handleIframeTimeout(key){const frameItem=LR45.frameStorage[key];if(!frameItem.loaded){const id=frameItem.reqQueue[0][1];const context=LR45.getContext(id);context.origin=key;if(typeof context.callbackFun==="function")context.callbackFun(context);LR45.unregisterContext(id,key)}}static registerContext(id,context,request){if(LR45.contexts[id])logErrorInPostToTagServer(plc1("Id: ".concat(id," same as in previous request. It will be overwritten by new request ").concat(JSON.stringify(request))));LR45.contexts[id]=context}static unregisterContext(id,key){LoadM.removeRequestFromPostedRequestsQueue(id,key);delete LR45.contexts[id]}static getContext(id){return LR45.contexts[id]}static convertStrToArray(str){return str.split("||").map((item=>decodeURIComponent(item)))}postRequestToIframeProxy(url,request,id,context){try{if(id&&context)LR45.registerContext(id,context,request);const{hostname:hostname,origin:origin,protocol:protocol}=parseUrl(url);const p2pPath=LR45.p2sStorage[hostname];let frameItem=LR45.frameStorage[origin];if(!frameItem){var _window$v3LanderConfi;const iframeId="post_box_".concat(++LR45.currFrameId);let src=p2pPath?"".concat(protocol,"//").concat(p2pPath):"".concat(url).concat(((_window$v3LanderConfi=window.v3LanderConfig)===null||_window$v3LanderConfi===void 0?void 0:_window$v3LanderConfi.iframeSrcParams)||"");if(getCustID())src="".concat(src,"&customerID=").concat(getCustID());frameItem={loaded:false,name:"",origin:origin,reqQueue:[],postedRequests:[]};LR45.frameStorage[origin]=frameItem;if(isWebSDK&&(!CM47.xdPsHelper.is1pcEnabled()||isAndroidWebView())&&window.bootstrap1PCSolution&&url.indexOf("?POST2SERVER")!=-1){frameItem.frameId=iframeId;FrameBridge.postMessageToBootStrap("1_PC_CREATE",{iframeId:iframeId,src:src,key:origin})}else{const iframe=createHiddenIFrame(iframeId,0,0,1,1,src);frameItem.frame=iframe;if(site.noJSHosting||isWebSDK)iframe.setAttribute("sandbox","allow-same-origin allow-scripts");if(window.addEventListener)iframe.addEventListener("load",this.iframeOnLoad.bind(this,frameItem,origin),false);document.getElementsByTagName("body")[0].appendChild(iframe);this.setIFrameTimeout(origin,iframe,p2pPath)}}if(frameItem.loaded)this.sendRequest(frameItem,request);else frameItem.reqQueue.push(request)}catch(e){logErrorInPostToTagServer(plc1("LR45.postRequestToIframeProxy: ".concat(e.message,".")))}}bootstrapFrameLoaded(key){const frameItem=LR45.frameStorage[key];frameItem.bootstrap=true;frameItem.loaded=true;this.iframeOnLoad(frameItem,key)}setIFrameTimeout(key,{src:src},p2pPath){if(p2pPath){const refreshIFrameTimeoutIncrement=new TimeoutIncrement(getRefreshIframeDelayIncrement(),getMaxRefreshIframeDelay());LR45.pendingIFrames[key]=setTimeout((()=>{this.refreshIFrame(key,src,refreshIFrameTimeoutIncrement)}),getRefreshIframeDelayIncrement())}else setTimeout((()=>{LR45.handleIframeTimeout(key)}),getRefreshIframeDelayIncrement())}refreshIFrame(key,src,refreshIFrameTimeoutIncrement){if(LR45.pendingIFrames[key]&&LR45.frameStorage[key]){const iframeItem=LR45.frameStorage[key];iframeItem.frame.contentWindow.location="".concat(src);LR45.pendingIFrames[key]=setTimeout((()=>{this.refreshIFrame(key,src,refreshIFrameTimeoutIncrement)}),refreshIFrameTimeoutIncrement.getNextTimeout())}}iFrameInitializationCallback({id:id,context:context}){if(id){const iframeItem=LR45.frameStorage[id];if(LR45.pendingIFrames[id]){clearTimeout(LR45.pendingIFrames[id]);delete LR45.pendingIFrames[id]}iframeItem.loaded=true;context.sendQueuedRequests(iframeItem)}}sendRequest(frameItem,request){try{if(frameItem.bootstrap){this.sendRequestToBootstrap(frameItem,request);return}const{origin:origin,frame:frame}=frameItem;const{contentWindow:win,id:id,src:src}=frame;if(win!=null)win.postMessage(request,origin);else log("LR45#sendRequest: can not post cross-window message: iframe.contentWindow is undefined. iframe id: ".concat(id,". frame source: ").concat(src),LOG_LEVELS.DEBUG)}catch(e){let12("LR45.sendRequest:".concat(cf21(e)))}}sendRequestToBootstrap({origin:origin,frameId:frameId},request){FrameBridge.postMessageToBootStrap("1_PC_MESSAGE",{requestData:request,origin:origin,frameId:frameId})}sendQueuedRequests(frameItem){while(frameItem.reqQueue.length>0){const shiftedReqQueue=frameItem.reqQueue.shift();frameItem.postedRequests.push(shiftedReqQueue);this.sendRequest(frameItem,shiftedReqQueue);if(!frameItem.loaded){log("LR45#sendRequest: iframe is not loaded. frame id: ".concat(frameItem.frame.id,". frame source: ").concat(frameItem.frame.src),LOG_LEVELS.DEBUG);break}}}iframeOnLoad(frameItem,key){while(frameItem.postedRequests.length>0){const transferredRequest=frameItem.postedRequests.pop();frameItem.reqQueue.unshift(transferredRequest)}this.initRequest(frameItem,key)}initRequest(frameItem,key){if(!LR45.getContext(key))LR45.registerContext(key,{id:key,callbackFun:this.iFrameInitializationCallback,context:this});const request=["ONLOAD",{rootDomainsList:getRootDomainsList(),id:key,JSLoggingDisabled:true},getSiteID()];if(frameItem.bootstrap)this.sendRequestToBootstrap(frameItem,request);else if(frameItem.frame){const{contentWindow:contentWindow}=frameItem.frame;if(contentWindow)contentWindow.postMessage(request,frameItem.origin)}else log("Warning! frameItem.frame is undefined")}removeRequestFromPostedRequestsQueue(id,key){const{postedRequests:postedRequests}=LR45.frameStorage[key];for(let i=0;i<postedRequests.length;i++)if(id===postedRequests[i][1]){postedRequests.splice(i,1);break}}}_defineProperty(LR45,"frameStorage",{});_defineProperty(LR45,"pendingIFrames",{});_defineProperty(LR45,"p2sStorage",{});_defineProperty(LR45,"contexts",{});_defineProperty(LR45,"currFrameId",0);_defineProperty(LR45,"ieVersion",getBrowserMajorVer(true));_defineProperty(LR45,"init",false);class NR7{constructor(){this.chatrouterRequestsBackup=[];this.requestsInProgress={}}doCommands(url,parameters,id,context){const command=parameters[0];switch(command){case"POSTASYNC":this.sendRequest(url,parameters,id,context,true);break;case"POSTCHAT":this.sendRequest(url,parameters,id,context,true,false,{errorHandler:this.errorHandlerForCR,successHandler:this.successHandlerForCR,addRequestInProgress:this.addRequestInProgressForCR});break;case"POSTJSON":this.sendRequest(url,parameters,id,context,true,true);break;case"POSTSYNC":this.sendRequest(url,parameters,id,context,false);break;case"ABORT":this.abortRequest(id);break;default:{const err=new Error("Syntax Error. Undefined Request for [".concat(command,"] command"));let12("NR7#doCommands: ".concat(err.message,". Command caller from ").concat(err.stack));break}}}process(url,data,id,sync,callbackFcn,errorCallback,timeout,postRequestData){if(getFlagSendDataToTSWithoutIframe()&&url.startsWith(urls.vanityURL)){const requestData=this.prepareRequestData(url,data,id,sync,callbackFcn,errorCallback,timeout);CommunicationMgr.doCommands(url,requestData.request,requestData.id,requestData.context)}else try{CM.postRequestToIframeProxy(postRequestData.request,postRequestData.id,postRequestData.callback,errorCallback)}catch(e){logErrorInPostToTagServer("ROM.post ERROR:".concat(cf21(e)))}}sendRequest(url,parameters,id,context,async,isJSON,handlers){try{const requestBody=parameters[5];const method=requestBody?"POST":"GET";const timeout=parseInt(parameters[6],10)||0;const protectionId=parameters[7];const request=new XMLHttpRequest;request.open(method,url,async);if(async)request.timeout=timeout;if(protectionId)request.setRequestHeader("X-Protection-Id",encodeURIComponent(protectionId));request.onreadystatechange=()=>{if(request.readyState===XMLHttpRequest.DONE)if(typeof(handlers===null||handlers===void 0?void 0:handlers.successHandler)==="function")handlers.successHandler.call(this,request,id);else this.successHandler(request,id)};if(typeof(handlers===null||handlers===void 0?void 0:handlers.addRequestInProgress)==="function")handlers.addRequestInProgress.call(this,url,id,request,context,parameters);else this.addRequestInProgress(id,request,context,0,parameters);if(method==="POST"){if(isJSON)request.setRequestHeader("Content-Type","application/json;charset=UTF-8");else request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");request.send(decodeURIComponent(requestBody))}else request.send()}catch(e){if(typeof(handlers===null||handlers===void 0?void 0:handlers.errorHandler)==="function")handlers.errorHandler.call(this,e,id);else this.errorHandler(e,id)}}abortRequest(id){const request=this.getRequest(id);this.deleteInProgressRequest(id);if(request)request.abort()}errorHandler(error,id){const context=this.getContext(id);this.abortRequest(id);if(typeof(context===null||context===void 0?void 0:context.callbackFunErr)==="function")context.callbackFunErr(error);let12("NR7.handleError. ".concat(JSON.stringify(error)))}errorHandlerForCR(error,id){this.errorHandler(error,id);this.sendNetworkBackup()}successHandler(response,id){const context=this.getContext(id);this.deleteInProgressRequest(id);if(typeof(context===null||context===void 0?void 0:context.callbackFun)==="function"){const responseData=this.prepareResponseData(id,response);context.callbackFun(responseData)}}successHandlerForCR(response,id){this.successHandler(response,id)}prepareResponseData(id,response){const responseData={};let contentType=response.getResponseHeader("Content-Type")||"";contentType=contentType.toLowerCase();responseData.id=id;responseData.responseStatus=response.status;responseData.responseHeaderCacheControl=response.getResponseHeader("Cache-Control")||"";if(contentType&&!contentType.includes("image/gif"))if(contentType.includes("application/json")&&response.responseText)responseData.data=JSON.parse(response.responseText);else responseData.data=response.responseText;if(typeof response.status==="unknown")responseData.responseStatus=0;return responseData}sendNetworkBackup(){const logDataList=this.chatrouterRequestsBackup.map((({request:request,id:id})=>({Id:id,Response:{readyState:request.readyState,responseURL:request.responseURL,status:request.status,timeout:request.timeout}})));let12("Something went wrong with CR communication, these logs should be investigated. Here all information about network activity with chatrouter. ".concat(JSON.stringify(logDataList)),true);this.resetNetworkBackup()}addRequestInProgressForCR(url,id,request,context,parameters){const timeout=parseInt(parameters[6],10)||0;const requestTimeout=timeout+1e4;if(typeof request.responseURL==="undefined")request.responseURL=url;this.chatrouterRequestsBackup.push({id:id,request:request});const timeoutId=setTimeout(this.errorHandlerForCR.bind(this,new Error("Native XMLHttpRequest timeout did not trigger. Triggering our own custom timeout."),id),requestTimeout);this.addRequestInProgress(id,request,context,timeoutId,parameters)}prepareRequestData(url,data,id,sync,callbackFcn,errorCallback,timeout){id=id||generateRequestId("vanity");const body=toParamString(data,true,true);const command=sync?"POSTSYNC":"POSTASYNC";const requestData=[command,id,"","",url,body,timeout];if(url.startsWith(vanityUrl))requestData.push(CHM.getFPSessionID());if(!callbackFcn)callbackFcn=resp=>{ROM.onRemoteCallback(resp.id,resp.data)};return{request:requestData,id:id,context:{callbackFun:callbackFcn,callbackFunErr:errorCallback}}}addRequestInProgress(id,request,context,timeoutId,parameters){if(id){if(this.requestsInProgress[id])let12("Id: ".concat(id," same as in previous request. Request parameters is ").concat(JSON.stringify(parameters)),true);this.requestsInProgress[id]={request:request,context:context,timeoutId:timeoutId}}else let12("Id is absent for parameters ".concat(JSON.stringify(parameters)),true)}getContext(id){var _this$requestsInProgr;return((_this$requestsInProgr=this.requestsInProgress[id])===null||_this$requestsInProgr===void 0?void 0:_this$requestsInProgr.context)||null}getRequest(id){var _this$requestsInProgr2;return((_this$requestsInProgr2=this.requestsInProgress[id])===null||_this$requestsInProgr2===void 0?void 0:_this$requestsInProgr2.request)||null}deleteInProgressRequest(id){const requestData=this.requestsInProgress[id];if(requestData)clearTimeout(requestData.timeoutId);delete this.requestsInProgress[id]}resetNetworkBackup(){this.chatrouterRequestsBackup.length=0}}class MM12{constructor(data){_defineProperty(this,"embeddedTheme",{prevWidth:0,prevHeight:0,isValid:null});_defineProperty(this,"handleEmbeddedDivResizeDebounce",debounce((()=>{const emdTh=MM.embeddedTheme;if(emdTh.isValid){const embeddedDiv=getParentElByIDTFacade(emdTh.clientDivId);if(embeddedDiv){const{h:embH,w:embW}=MM.getSizeOfEmbeddedDiv(embeddedDiv);if(embH>0&&embW>0&&(embH!==emdTh.prevHeight||embW!==emdTh.prevWidth)){inqFrame.Inq.FlashPeer.ciResizeStage(embW,embH);emdTh.prevHeight=embH;emdTh.prevWidth=embW}}}}),100));this._frameworkModule("mm");this.absorb(data);MM12.makeDataCloneable(data)}start(){}reset(){}init(){}static makeDataCloneable(data){Object.keys(data).forEach((n1=>{Object.keys(data[n1]).forEach((n2=>{MI8.clonize(data[n1][n2])}))}))}getC2CSpec(id,subtree){let val=this.c2cSpecs[id];if(inu1(val))throw"MM12-> no c2c spec for id=".concat(id);val=MI8.mixAbsorber(val.clone());if(subtree)val.absorb({c2cTheme:this.getC2CTheme(val.thId),chatSpec:this.getChatSpec(val.chSpId,subtree)});return val}getC2CTheme(id){const val=this.c2cThemes[id];if(inu1(val))throw"MM12-> no c2c theme for id=".concat(id);return MI8.mixAbsorber(val.clone())}getChatSpec(id,subtree){let val=this.chatSpecs[id];if(inu1(val))throw"MM12-> no chat spec for id=".concat(id);val=MI8.mixAbsorber(val.clone());if(subtree)val.absorb({chatTheme:this.getChatTheme(val.ctId)});return val}getChatTheme(id){const val=this.chatThemes[id];if(inu1(val))throw"MM12-> no chat theme for id=".concat(id);return MI8.mixAbsorber(val.clone())}mergeC2CTheme(c2cTheme){const val=c2cTheme.id?this.getC2CTheme(c2cTheme.id):this.getC2CThemeByName(c2cTheme.name);if(val)return val.absorb(c2cTheme);log("MM12 Error: c2cTheme not found for xml theme id=".concat(c2cTheme.id));return null}mergeChatTheme(chatTheme){const val=chatTheme.id?this.getChatTheme(chatTheme.id):this.getChatThemeByName(chatTheme.name);if(val){Object.keys(chatTheme).forEach((n=>{val[n]=chatTheme[n]}));return val}log("MM12 Error: chatTheme not found for xml theme ".concat(chatTheme.id?"id=".concat(chatTheme.id):"name=".concat(chatTheme.name)));return null}mergeChatSpec(chatSpec){const val=chatSpec.id?this.getChatSpec(chatSpec.id,true):this.getChatSpecByName(chatSpec.name,true);if(val){chatSpec=this.handleEmbeddedTheme(chatSpec);if(chatSpec.chatTheme)val.chatTheme=this.mergeChatTheme(chatSpec.chatTheme);Object.keys(chatSpec).forEach((n=>{if(n!=="chatTheme")val[n]=chatSpec[n]}));return val}log("MM12 Error: chatSpec not found for xml theme ".concat(chatSpec.id?"id=".concat(chatSpec.id):"name=".concat(chatSpec.name)));return null}handleEmbeddedTheme(chatSpec){try{if(chatSpec.embeddedTheme&&(inu1(chatSpec.embeddedTheme.isValid)||inu1(this.embeddedTheme.isValid))){const embeddedDiv=this.checkEmbeddedDivOnCI(chatSpec);if(embeddedDiv||isWebSDK&&window.embeddedFrameCreated){chatSpec.embeddedTheme.isValid=this.embeddedTheme.isValid=true;if(embeddedDiv){chatSpec.embeddedTheme.w=this.embeddedTheme.prevWidth=embeddedDiv.w;chatSpec.embeddedTheme.h=this.embeddedTheme.prevHeight=embeddedDiv.h}this.embeddedTheme.clientDivId=chatSpec.embeddedTheme.id;if(chatSpec.chatTheme.sv!==GR34.MODERN_CI_VERSION)window.parent.addEventListener("resize",this.handleEmbeddedDivResizeDebounce);if(chatSpec.embeddedTheme.chatTheme){if(chatSpec.chatTheme&&!chatSpec.embeddedTheme.origTheme)chatSpec.embeddedTheme.origTheme=chatSpec.chatTheme;chatSpec.chatTheme=chatSpec.embeddedTheme.chatTheme}}else{chatSpec.embeddedTheme.isValid=this.embeddedTheme.isValid=false;if(chatSpec.embeddedTheme.origTheme)chatSpec.chatTheme=chatSpec.embeddedTheme.origTheme}}}catch(msg){log("MM12 Error: handleEmbeddedTheme has error=".concat(msg))}return chatSpec}checkEmbeddedDivOnCI(chatSpec){let obj=null;try{const embeddedDiv=getParentElByIDTFacade(chatSpec.embeddedTheme.id);if(embeddedDiv){if(chatSpec.chatTheme.sv===GR34.MODERN_CI_VERSION){if(embeddedDiv.classList.contains("nuance-chat-floating-container"))return null;chatSpec.embeddedTheme.chatTheme.sv=chatSpec.chatTheme.sv}const{h:embH,w:embW}=this.getSizeOfEmbeddedDiv(embeddedDiv);if(embH>0&&embW>0)obj={h:embH,w:embW};else if(this.embeddedTheme.prevWidth>0&&this.embeddedTheme.prevHeight>0)obj={h:this.embeddedTheme.prevHeight,w:this.embeddedTheme.prevWidth};else if(chatSpec.embeddedTheme.chatTheme){const val=chatSpec.embeddedTheme.chatTheme.id?this.getChatTheme(chatSpec.embeddedTheme.chatTheme.id):this.getChatThemeByName(chatSpec.embeddedTheme.chatTheme.name);if(val)obj={h:val.dh,w:val.dw}}}}catch(msg){log("MM12 Error: checkEmbeddedDivOnCI has error=".concat(msg));obj=null}return obj}getSizeOfEmbeddedDiv(embeddedDiv){var _doc$defaultView;if((_doc$defaultView=doc.defaultView)!==null&&_doc$defaultView!==void 0&&_doc$defaultView.getComputedStyle){const compObj=doc.defaultView.getComputedStyle(embeddedDiv,"");return{h:parseInt(compObj.height,10),w:parseInt(compObj.width,10)}}return{h:embeddedDiv.clientHeight,w:embeddedDiv.clientWidth}}mergeC2CSpec(c2cSpec,excludeChatData){if(!inu1(c2cSpec)){let val;if(c2cSpec.id)val=this.getC2CSpec(c2cSpec.id,true);else if(c2cSpec.plugin)val={plugin:c2cSpec.plugin};else val=this.getC2CSpecByName(c2cSpec.name,true);if(excludeChatData)delete val.chatSpec;if(c2cSpec.c2cTheme)val.c2cTheme=this.mergeC2CTheme(c2cSpec.c2cTheme);if(c2cSpec.chatSpec&&!excludeChatData)val.chatSpec=this.mergeChatSpec(c2cSpec.chatSpec);Object.keys(c2cSpec).forEach((n=>{if(n!=="c2cTheme"&&n!=="chatSpec")val[n]=c2cSpec[n]}));return val}log("MM12 Error: bad c2cSpec passed. Check XML rule actions. ref=".concat(c2cSpec));return null}getModelIdByName(modelName,instanceName){for(const instance in this[modelName])if(this[modelName][instance].name===instanceName)return instance;throw"No media for name= ".concat(instanceName," found in list of ").concat(modelName)}getChatThemeByName(name){const id=this.getModelIdByName("chatThemes",name);return this.getChatTheme(id)}getChatSpecByName(name,subtree){const id=this.getModelIdByName("chatSpecs",name);return this.getChatSpec(id,subtree)}getC2CThemeByName(name){const id=this.getModelIdByName("c2cThemes",name);return this.getC2CTheme(id)}getC2CSpecByName(name,subtree){const id=this.getModelIdByName("c2cSpecs",name);return this.getC2CSpec(id,subtree)}}MI8.prepare(MM12).im13(MI8.XJA3).im13(MI8.FM2);class URI{constructor(uri){this._uri=uri;this.parseURI()}static parseURI(_uri){const obj={qMap:{}};const uriParts=new RegExp("^(?:([^:/?#.]+):)?(?://)?(([^:/?#]*)(?::(\\d*))?)?((/(?:[^?#](?![^?#/]*\\.[^?#/.]+(?:[\\?#]|$)))*/?)?([^?#/]*))?(?:\\?([^#]*))?(?:#(.*))?").exec(_uri);for(let i=0;i<URI.partNames.length;i++)obj[URI.partNames[i]]=uriParts[i]||"";if(obj.dirPath.length>0)obj.dirPath=obj.dirPath.replace(/\/?$/,"/");if(obj.query){const p=obj.query.split("&");for(let j=0;j<p.length;++j){const kvp=p[j].split("=");obj.qMap[kvp[0]]=kvp.length>1?unescape(kvp[1]):""}}if(obj.domain){obj.rootDomain=obj.domain;const arr=obj.domain.split(".");if(arr.length>2){for(let idx=0;idx<arr.length-2;idx++)arr.shift();obj.rootDomain=arr.join(".")}}return obj}parseURI(){this.absorb(URI.parseURI(this._uri))}getQ(q){const v=this.qMap[q];return inu1(v)?null:v}}_defineProperty(URI,"partNames",["source","protocol","authority","domain","port","path","dirPath","fileName","query","anchor"]);MI8.prepare(URI).im13(MI8.XJA3);class FcnMgr{constructor(namedFcns){this.fcns=namedFcns}getFcn(fcnOrFcnName){if(!fcnOrFcnName)throw"function name is null or undefined";switch(typeof fcnOrFcnName){case"string":case"function":break;default:throw"illegal parameter type: ".concat(typeof fcnOrFcnName)}const fcn=typeof fcnOrFcnName==="string"?this.fcns[fcnOrFcnName]:fcnOrFcnName;if(!fcn)throw"function is null or undefined";return fcn}ex8(fcnOrFcnName,...args){if(!window.self.parent.v3Lander){let12("window.self.parent.v3Lander is undefined, ex8 returns null",true);return null}const fcn=this.getFcn(fcnOrFcnName);const name=this.publish(fcn);let retval=null;try{retval=window.self.parent.v3Lander.FMProxy.getFcn(name).apply(window.self.parent,args)}catch(err){throw"function eval failed. err=".concat(err.toString())}this.unpublish(name);return retval}callExternalHelper(fcName,...args){if(isWebSDK)return this.callExternalHelperForWebSDK(fcName,args);if(!window.self.parent.v3Lander){let12("window.self.parent.v3Lander is undefined, callExternalHelper returns null",true);return null}try{return window.self.parent.v3Lander.FMProxy.getHelperFcn(fcName).apply(window.self.parent,args)}catch(err){throw"Error: Call external helper function failed.fcName: ".concat(fcName,". err=").concat(err.toString())}}callExternalHelperSafe(fcName,dflt,sendErrorToTagServer){try{const retval=this.callExternalHelper(fcName);return safeResult(retval)}catch(err){log(err,"log");if(sendErrorToTagServer)let12(cf21(err))}return dflt}callExternalHelperForWebSDK(fcName,args){try{return window.v3Lander.FMProxy.getHelperFcn(fcName).apply(window.self,args)}catch(err){throw"Error: Call helper function failed.fcName: ".concat(fcName,". err=").concat(err.toString())}}exec(fcnOrFcnName,...args){const fcn=this.getFcn(fcnOrFcnName);try{return fcn.apply(self,args)}catch(err){throw"function eval failed. err=".concat(err.toString())}}publish(fcn,name){name=name||"fcn_".concat(FcnMgr.idx++);window.self.parent.v3Lander.FMProxy.addFcn(name,fcn.toString());return name}unpublish(name){window.self.parent.v3Lander.FMProxy.removeFcn(name)}}_defineProperty(FcnMgr,"idx",0);function CM47(id,xd){this._frameworkModule(id);this.xd=xd;this.cookies={};this.JSON=MI8.JSON;this.version=3;this.initMessagingComplete=false;this.set3rdPartyCookieBusy=false;this.set3rdPartyCookieQueue=[];this.overflowLogged=false;this.trdPartyCookieCnt=0;this.isLSused=false;this.cntHandlerTried=0;this.cleaningDetected=false;this.resourcesType={};this.configureStorageListener()}MI8.prepare(CM47).im13(MI8.FM2).im13(MI8.RC54);CM47.CM=null;CM47.getInstance=function(xd){if(CM47.CM==null)CM47.CM=new CM47("CM",xd);return CM47.CM};CM47.prototype.init=function(){if(this.initialized)return;this.initialized=true;log(this.getID()+" initialized.");this.initMessagingComplete=this.initMessaging();this.initResourcesType();this.clearOutdatedCookies()};CM47.prototype.clearOutdatedCookies=function(){if(getClearOutdatedCookies()){var clearOutdatedCookiesRequest=["CLEARSTORAGE"];this.postRequestToIframeProxy(clearOutdatedCookiesRequest)}};CM47.prototype.initResourcesType=function(){for(var res in resources)try{if(typeof resources[res]["getName"]==="function")this.resourcesType[resources[res].getName()]=resources[res].getStorageType()}catch(e){log(e,"error")}};CM47.prototype.start=function(){if(this.started)return;this.started=true};CM47.prototype.getPeer=function(){return isSameOrigin()&&isPersistentWindow()?window.parent.opener.inqFrame.Inq.CM:null};CM47.prototype.r479m=function(cName,name,value,isJSON,update){if(!inu1(value))value=!!isJSON?MI8.JSON.parse(decodeURIComponent(value)):value;if(!update)if(isPersistentWindow()&&!this.cleaningDetected)try{var cmPeer=this.getPeer();if(!!cmPeer){if(cmPeer.persistentWindow!=win)cmPeer.persistentWindow=win;if(!inu1(value))cmPeer.r479m(cName,name,encodeURIComponent(MI8.JSON.stringify(value)),true,true);else cmPeer.r479m(cName,name,null,null,true)}}catch(err){log("Error propagating value to main window from Cookie manager.")}else try{if(!!this.persistentWindow&&!this.persistentWindow.closed){var cmPersistent=this.persistentWindow.inqFrame.Inq.CM;if(!!cmPersistent)if(!inu1(value))cmPersistent.r479m(cName,name,encodeURIComponent(MI8.JSON.stringify(value)),true,true);else cmPersistent.r479m(cName,name,null,null,true)}}catch(err){log("Error propagating value to persistent")}if(inu1(value)){if(this.cookies[cName])delete this.cookies[cName][name]}else{if(!this.cookies[cName])this.cookies[cName]={};this.cookies[cName][name]=value}};CM47.prototype.write=function(cRes,name,value,callback){var cObj=null;var cVal=null;var cName=cRes.getName();var cookieError=null;if(cName!=COOKIE_PC_NAME&&value!=void 0&&!this.isLSused){var predictedResult;try{predictedResult=this.pr11m(cRes,name,value)}catch(err){if(err.constructor===cdsm||err.constructor===CookieSizeError){cookieError=err;log(cookieError.toString());predictedResult=cookieError.getData().result}}if(!!cookieError&&predictedResult!=0){var overflowObject={_domain:"error",evt:"cookieoverflow",params:{custID:Inq.getCustID(),siteID:getSiteID(),resource:cName,varId:name,size:JSON.stringify(value).length,sessionId:getSessionID(),incAssignmentID:asi4(),incGroup:getIncGroupID()}};var msg="Cookie overflow!";if(cookieError.constructor==cdsm){var pruneSuccessful=this.pco12(predictedResult,cRes.getPurgePriority());msg+=" New cookie overflows domain limit";if(pruneSuccessful)log("ERROR: variable named '"+name+"' (size="+value.length+") write aborted and cookie (name="+cName+") overflowed and dropped. VER34: {"+name+':"'+value+'"');overflowObject["pruneSuccess"]=pruneSuccessful}else if(cookieError.constructor===CookieSizeError){msg+=" cookie is packed to limit. Data dropped.";log("WARNING: Cookie overflowed when writing variable. varId="+name+", cookieName="+cName+", varSize="+value.length+", attemptedValue="+value)}if(!this.overflowLogged){overflowObject["Log2ETL"]=true;overflowObject["params"]["msg"]=msg;let12(JSON.stringify(overflowObject));this.overflowLogged=true}if(cookieError.constructor===CookieSizeError){if(typeof callback==="function")callback();return}}}if(this.xd)this.r479m(cName,name,value);if(this.cleaningDetected){if(typeof callback==="function")callback();return}if(this.xd){this.checkCookieValidity();if(this.cleaningDetected){if(typeof callback==="function")callback();return}var oldValue=this.JSON.stringify(this.cookies[cName]);if(cRes.getResourceID()=="vital"){this.cookies[cName]["v"]=this.version;this.cookies[cName]["vcnt"]=this.trdPartyCookieCnt++;this.cookies[cName]["vtime"]=(new Date).getTime()}var newValue=this.JSON.stringify(this.cookies[cName]);try{if(cRes.getResourceID()=="vital"&&!inu1(oldValue)&&oldValue.indexOf("_iID")!=-1)if(inu1(newValue)||newValue.indexOf("_iID")==-1)ROM.send(urls.loggingURL,{level:"ERROR",line:"overriding the incrAssignmentID for siteID="+Inq.getSiteID()+" customerID="+Inq.getCustID()+"oldValue="+oldValue+"newValue ="+newValue})}catch(e){log("Error:overriding the valid incrAssignmentID for siteID"+Inq.getSiteID()+" customerID="+Inq.getCustID())}this.s3d("SCBR3_PM",getSiteID(),cName,this.cookies[cName],cRes.getLifetime(),null,callback)}else{var c=this._getCookie(cName);if(c==null)cObj={};else try{cObj=this.JSON.parse(c)}catch(e){cObj={}}if(cObj==null)cObj={};if(inu1(value))delete cObj[name];else cObj[name]=value;if(cRes.getResourceID()=="vital")cObj["v"]=this.version;cVal=this.JSON.stringify(cObj);this._setCookie(cRes,cVal);if(typeof callback==="function")callback()}};CM47.prototype.read=function(cRes,name){var cVal=null;var cName=cRes.getName();if(this.xd)try{if(!inu1(this.cookies[cName]))cVal=this.cookies[cName][name]}catch(e){log(e)}else{var c=this._getCookie(cName);var cObj=null;try{if(c){cObj=this.JSON.parse(c);if(cObj!=null)cVal=cObj[name]}}catch(e){log(e)}}return cVal};CM47.prototype.clear=function(cResId){var cRes=resources[cResId];var storage=cRes.getStorageType();if(this.xd){var cName=cRes.getName();delete this.cookies[cName];this.s3d("SCBR3_PM",siteID,cName,null,-1*864e5,storage);logInfoToTagServer("Clear cookie "+cName)}else if(storage)SM.clearStoredValue(cRes);else this.expireCookie(cResId)};CM47.prototype.dump=function(){if(this.xd){var boxID="box"+Math.floor(Math.random()*1000011);var postCookieRequest=["DUMP",boxID,"","",encodeURIComponent(secureHTTP(urls.loggingURL))];this.postRequestToIframeProxy(postCookieRequest,boxID)}};function CookieSizeError(cName,size,delta,limit,result){this.getData=function(){return{cookieName:cName,oldSize:size,delta:delta,limit:limit,result:result}};this.toString=function(){return"CookieSizeError: Cookie size violated, proposed size="+(size+delta)+", limit="+limit+", result="+result}}function cdsm(cName,size,delta,limit,result){this.getData=function(){return{cookieName:cName,oldSize:size,delta:delta,limit:limit,result:result}};this.toString=function(){return"cdsm: Cookie domain size violated, proposed size="+(size+delta)+", limit="+limit+", result="+result}}CM47.prototype.pr11m=function(cRes,name,value){var newObj={};newObj[name]=value;var newObjSize=encodeURIComponent(this.JSON.stringify(newObj)).length;var oldObjSize=0;var cName=cRes.getName();var cObj={};if(this.xd){if(this.cookies[cName])cObj=this.cookies[cName]}else{var c=this._getCookie(cName);if(c)try{cObj=this.JSON.parse(c)}catch(e){}}if(!inu1(cObj[name]))oldObjSize=encodeURIComponent(this.JSON.stringify(cObj[name])).length;var predictedDelta=newObjSize-oldObjSize;if(predictedDelta>0){var cResSize=this.getCookieSize(cRes);var cookieLimit=csl11();if(cookieLimit&&cResSize+predictedDelta>cookieLimit)throw new CookieSizeError(cName,cResSize,predictedDelta,cookieLimit,cResSize+predictedDelta-cookieLimit);else{var totalSize=this.getCookieSize();var cookieTotalLimit=ctl12();if(cookieTotalLimit&&totalSize+predictedDelta>cookieTotalLimit)throw new cdsm(cName,totalSize,predictedDelta,cookieTotalLimit,totalSize+predictedDelta-cookieTotalLimit)}}return 0};CM47.prototype.getCookieSize=function(cRes){var size=0;if(!cRes)if(this.xd){for(var res in resources)if(resources[res].constructor===CCD)size+=this.getCookieSize(resources[res])}else size=document.cookie.length;else{var cName=cRes.getName();var cVal;if(this.xd)cVal=this.JSON.stringify(this.cookies[cName]);else cVal=this._getCookie(cName);if(cVal)size=cName.length+1+encodeURIComponent(cVal).length}return size};CM47.prototype.pco12=function(byteCountToFree,currentCookiePriority){var cookiesToPrune=[];var bytesFreed=0;currentCookiePriority=inu1(currentCookiePriority)?0:currentCookiePriority;var _resources=Object.keys(resources).map((function(k){return resources[k]})).filter((function(a){return!inu1(a)&&a.constructor===CCD&&a.getPurgePriority()>currentCookiePriority}));_resources.sort(CCD.COOKIE_RESOURCE_PURGE_PRIORITY_SORT_FCN);for(var idx=0;idx<_resources.length;idx++){var resource=_resources[idx];log("************* "+resource.getResourceID()+" will be cleared.");bytesFreed+=this.getCookieSize(resource);cookiesToPrune.push(resource);if(bytesFreed>=byteCountToFree)break}if(bytesFreed<byteCountToFree&&currentCookiePriority==0){var stateRes=resources["state"];bytesFreed+=this.getCookieSize(stateRes);if(bytesFreed>=byteCountToFree)cookiesToPrune.push(stateRes);else if(!CHM.isChatInProgress()){var sesRes=resources["session"];bytesFreed+=this.getCookieSize(sesRes);if(bytesFreed>=byteCountToFree){cookiesToPrune.push(stateRes);cookiesToPrune.push(sesRes)}}}if(cookiesToPrune.length>0){var cookieNames=cookiesToPrune.collect((function(cres){return cres.getName()}));var msg="Cookie overflow! Trying to clear following cookie(s): "+cookieNames.join(",")+". ";if(!this.overflowLogged){let12(msg,true);this.overflowLogged=true}for(var i=0;i<cookiesToPrune.length;i++)this.clear(cookiesToPrune[i].getResourceID())}return bytesFreed>=byteCountToFree};CM47.prototype._setCookie=function(cRes,cVal,cLifetime){var name=cRes.getName();var lifetime=cRes.getLifetime();if(!!cLifetime)lifetime=cLifetime;var path=cRes.getPath();var domain=cRes.getDomain();var now=new Date;var expires_date=new Date(now.getTime()+lifetime);var update;domain=domain.replace(/(^\w+:|^)\/\//,"");if((name==COOKIE_PC_NAME||this.isPersistentCookiesAllowed())&&lifetime>0)update=name+"="+encodeURIComponent(cVal)+";expires="+expires_date.toGMTString()+(path?";path="+path:"")+(domain?";domain="+domain:"")+"; Secure";else update=name+"="+encodeURIComponent(cVal)+(path?";path="+path:"")+(domain?";domain="+domain:"")+"; Secure";document.cookie=update};CM47.prototype._getCookie=function(cName,data){var cookies=this._getCookies(data);if(!!cookies&&!!cookies[cName])return cookies[cName];return null};CM47.prototype._getCookies=function(data){var a_all_cookies=inu1(data)?document.cookie.split(COOKIE_DELIMITER):data.split(COOKIE_DELIMITER);var retval=null;a_all_cookies.forEach((function(cookie){var delim_index=cookie.indexOf("=");var cookie_name=(delim_index>0?cookie.substring(0,delim_index):cookie).replace(/^\s+|\s+$/g,"");var cookie_value="";if(delim_index>0&&delim_index<cookie.length-1)cookie_value=decodeURIComponent(cookie.substring(delim_index+1).replace(/^\s+|\s+$/g,""));if(retval==null)retval={};retval[cookie_name]=cookie_value}));return retval};CM47.prototype.setXDCookies=function(cookieData){this.cookies=cookieData;this.checkDataIntegrity();if(cookieData&&cookieData.pc&&cookieData.pc==2)this.isLSused=true};CM47.prototype.checkDataIntegrity=function(){var cacheCookiesInParentWin=openerCall("getCachedCookies");if(isFF()&&cacheCookiesInParentWin){var cacheCookiesKeys=Object.keys(cacheCookiesInParentWin);for(var i=0;i<cacheCookiesKeys.length;i++){var resourceName=cacheCookiesKeys[i];if(!this.cookies[resourceName]&&this.resourcesType[resourceName]==="sessionStorage")this.cookies[resourceName]=cacheCookiesInParentWin[resourceName]}}};CM47.prototype.getCachedCookies=function(){if(!this.cleaningDetected)return this.cookies;return null};CM47.prototype.onThirdPartyCookieQueueEmpty=null;CM47.prototype.onThirdPartyCookieQueueEmptyHandlers=[];CM47.prototype.on3rdPartyCookieCommittedHandler=null;CM47.prototype.isThirdPartyCookieQueueEmpty=function(){return 0==this.set3rdPartyCookieQueue.length&&!this.set3rdPartyCookieBusy};CM47.prototype.s3d=function(cmd,site,name,delta,expiry,storageType,callback){if(!expiry)expiry="";if(inu1(cmd)||inu1(site)||inu1(name))return;var boxID="box"+Math.floor(Math.random()*1000011);var sDelta="";if(!inu1(delta))if(typeof delta==="object")if(storageType)sDelta=this.JSON.stringify(delta);else sDelta=encodeURIComponent(this.JSON.stringify(delta));else sDelta=""+delta;var postCookie=[cmd,boxID,site,"",name,sDelta,storageType,expiry,true];for(var i=0;i<this.set3rdPartyCookieQueue.length;i++)if(this.set3rdPartyCookieQueue[i].name==name){this.set3rdPartyCookieQueue[i].postCookie=postCookie;this.set3rdPartyCookieQueue[i].callbacks.push(callback);break}if(this.set3rdPartyCookieQueue.length===i)this.set3rdPartyCookieQueue.push({name:name,postCookie:postCookie,callbacks:[callback]});if(this.set3rdPartyCookieBusy)return;this.set3rdPartyCookieBusy=true;this.set3rdPartyCookieFromQueue()};CM47.prototype.set3rdPartyCookieFromQueue=function(){var cookieQItem=this.set3rdPartyCookieQueue[0];var callback;if(this.set3rdPartyCookieQueue.length>0){var errorCallback=function(e){this.proxyError(e);this.set3rdPartyCookieFromQueue()}.bind(this);this.postRequestToIframeProxy(cookieQItem.postCookie,cookieQItem.postCookie[1],null,errorCallback)}else{this.set3rdPartyCookieBusy=false;if(this.onThirdPartyCookieQueueEmpty!=null)this.onThirdPartyCookieQueueEmpty()}if(!inu1(cookieQItem)){while(cookieQItem.callbacks&&cookieQItem.callbacks.length>0){callback=cookieQItem.callbacks.shift();if(typeof callback==="function")callback()}this.set3rdPartyCookieQueue.shift()}};CM47.prototype.whenCookiesCommitted=function(handler){if(this.xd)if(this.isThirdPartyCookieQueueEmpty())handler();else{this.onThirdPartyCookieQueueEmptyHandlers.push(handler);this.onThirdPartyCookieQueueEmpty=this.whenCookiesFireHandlers.bind(this);if(this.isThirdPartyCookieQueueEmpty())this.whenCookiesFireHandlers()}else handler()};CM47.prototype.setWhen3rdPartyCookieCommittedHandler=function(handler){if(this.xd)try{var boxID="box"+Math.floor(Math.random()*1000011);var postCookieRequest=["COMMITPOINT",boxID,getSiteID(),"",encodeURIComponent(urls.loggingURL)];if(handler)this.on3rdPartyCookieCommittedHandler={vcnt:this.cookies["inqVital"]["vcnt"],callback:handler};this.set3rdPartyCookieQueue.push({name:"inqCallBack"+Math.floor(Math.random()*1000011),postCookie:postCookieRequest,callbacks:[]});if(!this.set3rdPartyCookieBusy){this.set3rdPartyCookieBusy=true;this.set3rdPartyCookieFromQueue()}}catch(e){log("exception in setWhen3rdPartyCookieCommittedHandler(): "+e.message,"error")}else return false};CM47.prototype.when3rdPartyCookieCommitted=function(vcnt){if(null!=this.on3rdPartyCookieCommittedHandler)try{if(!this.isLSused||this.cntHandlerTried>=120||typeof vcnt!=="undefined"&&this.on3rdPartyCookieCommittedHandler["vcnt"]<=vcnt){this.on3rdPartyCookieCommittedHandler["callback"]();this.on3rdPartyCookieCommittedHandler=null;this.cntHandlerTried=0;this.set3rdPartyCookieFromQueue()}else{this.cntHandlerTried+=1;this.set3rdPartyCookieBusy=false;this.setWhen3rdPartyCookieCommittedHandler()}}catch(e){log("exception in CM47.prototype.when3rdPartyCookieCommitted: "+e.message,"error")}else this.set3rdPartyCookieFromQueue()};CM47.prototype.whenCookiesFireHandlers=function(){log("CM47.whenCookiesFireHandlers() entered: got "+this.onThirdPartyCookieQueueEmptyHandlers.length+" handler(s).");this.onThirdPartyCookieQueueEmpty=null;while(this.onThirdPartyCookieQueueEmptyHandlers.length>0){var handlerRoutine=this.onThirdPartyCookieQueueEmptyHandlers.shift();if(handlerRoutine)try{handlerRoutine()}catch(e){log("exception in whenCookiesFireHandlers(): "+e.message,"error")}}};CM47.prototype.postRequestToIframe=function(url,request,id,context){if(xdAutoSelect&&CM47.xdPsHelper.enabled&&CM47.xdPsHelper.hostFileURLUse)LoadM.postRequestToIframeProxy(CM47.xdPsHelper.hostFileURLUse+"?POST2SERVER",request,id,context);else if(xdAutoSelect&&CM47.chatSessionHelper.isEnabled&&CM47.xdPsHelper.hostFileURLUse)LoadM.postRequestToIframeProxy(CM47.xdPsHelper.hostFileURLUse+"?POST2SERVER",request,id,context);else LoadM.postRequestToIframeProxy(url,request,id,context)};CM47.prototype.postRequestToIframeProxy=function(request,id,callback,errorCallback){var context={};context["callbackFun"]=callback||CM47.processMessage;context["callbackFunErr"]=errorCallback||this.proxyError;this.postRequestToIframe(this.getIFrameBaseURL(),request,id,context)};CM47.prototype.getIFrameBaseURL=function(){if(typeof this._iFrameBaseURL=="undefined"){this._iFrameBaseURL=Inq.urls.baseURL.split("/",3).join("/");this._iFrameBaseURL=secureHTTP(this._iFrameBaseURL)}return this._iFrameBaseURL};CM47.processMessage=function(context){try{if(context.data&&context.data.action)if(context.data.action=="3rdPCQ")window.inqFrame.Inq.FlashPeer.set3rdPartyCookieFromQueue();else window.inqFrame.Inq.FlashPeer.when3rdPartyCookieCommitted(context.data.resp);else ROM.onRemoteCallback(context.id,context.data)}catch(fault){ROM.post(urls.loggingURL,{level:"ERROR",line:"CM47.processMessage>> "+cf21(fault)})}};CM47.prototype.submitPost2ServerProcessRequest=function(request,baseUrl,callBackFunction){var frameSrc=baseUrl+"?POST2SERVER";if(site.noJSHosting&&site.clientStaticUrl||isWebSDK)frameSrc+="&clientHosted=true";var context={};context["callbackFun"]=callBackFunction;var uniqueRequestId=request[1];LoadM.postRequestToIframeProxy(frameSrc,request,uniqueRequestId,context)};CM47.xdPsHelper={};CM47.xdPsHelper.hostFileURLUse="";CM47.xdPsHelper.enabled=false;CM47.xdPsHelper.isInFirstCookieProcess=false;CM47.xdPsHelper.checkedDomainsCount=0;CM47.xdPsHelper.errorCode=0;CM47.xdPsHelper.isIos7=function(uagent){return/(iPad|iPhone).*OS 7/i.test(uagent)};CM47.xdPsHelper.is1pcEnabled=function(){var COOKIE_PCTEST_NAME="inqPctest";if(typeof CM47.xdPsHelper.isUse1pcXdSolution.pc1Enabled=="undefined"){var value=Math.floor(Math.random()*101);var expiry=new Date((new Date).getTime()+366*24*3600*1e3).toGMTString();var isSecure=FP.getClientPageURL().startsWith("https:");document.cookie=COOKIE_PCTEST_NAME+"="+value+";"+(isSecure?" SameSite=None; Secure;":"")+"path=/; expires="+expiry+";";CM47.xdPsHelper.isUse1pcXdSolution.pc1Enabled=document.cookie.indexOf(COOKIE_PCTEST_NAME+"="+value)!==-1;document.cookie=COOKIE_PCTEST_NAME+"="+value+";"+(isSecure?" SameSite=None; Secure;":"")+"path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT"}return CM47.xdPsHelper.isUse1pcXdSolution.pc1Enabled};CM47.xdPsHelper.isUse1pcXdSolution=function(){var uiWebView=isIOSWebView();var androidWebview=/Android.*?(wv|Version\/[.0-9]+).*?Mobile/i.test(navigator.userAgent);if(androidWebview)if(/Android 4\.4\.2/i.test(navigator.userAgent))return false;if(isCEAPIPostChatSurveyMode())return false;var is1pcClient=uiWebView||androidWebview||isSafari()||site.noJSHosting;var is1pcClientEnabled=is1pcClient&&CM47.xdPsHelper.is1pcEnabled();return is1pcClientEnabled||isWebSDK&&!CM47.xdPsHelper.is1pcEnabled()};CM47.xdPsHelper.domains2Check=[];CM47.xdPsHelper.domains2Check.pushHostedFileUrl=function(hostedUrl){hostedUrl=hostedUrl.replace("*","");var ob=CM47.parseUrl(hostedUrl);if(ob!=null&&!this.contains(ob,(function(a,b){return a.hostname==b.hostname})))this.push(ob)};CM47.xdPsHelper.domains2Check.assignDataByOrigin=function(origin,context){for(var i=0;i<this.length;i++)if(origin.indexOf(this[i].origin)!==-1)this[i].context=context;return null};CM47.xdPsHelper.domains2Check.findEntryWithLatestCookie=function(){var date=null;var latestDate=null;var theobj=null;for(var i=0;i<this.length;i++){date=this[i]&&this[i].context&&this[i].context.data&&getDateFromData(this[i].context.data);if(!inu1(date)&&date>latestDate){theobj=this[i];latestDate=date}}if(inu1(theobj))for(var j=0;j<this.length;j++){if(isWebSDK&&this[j].domain===CM47.parseUrl(pageUrl).domain)theobj=this[j];if(this[j].domain==(inqFrame.location.domain?inqFrame.location.domain:CM47.parseUrl(inqFrame.location.href).domain))theobj=this[j]}return theobj;function getDateFromData(data){var date=null;var dateStr=decodeURIComponent(data);var dateReg=/vtime(\")?:([0-9]*)/i;if(dateReg.test(dateStr))date=dateReg.exec(dateStr)[2];return date}};CM47.xdPsHelper.requestSavedXdCookies=function(){if(!CM47.xdPsHelper.populateDomains2Check()){if(site.noJSHosting||isWebSDK){CM47.xdPsHelper.isUse1pcXdSolution.pc1Enabled=false;CM.requestCookie((function(context){Inq.IFrameProxyCallback(context.data)}))}return}CM47.xdPsHelper.enabled=true;CM47.xdPsHelper.isInFirstCookieProcess=true;for(var i=0;i<CM47.xdPsHelper.domains2Check.length;i++)CM47.xdPsHelper.callFirstPostRequestToIframeProxy(CM47.xdPsHelper.domains2Check[i].href)};CM47.xdPsHelper.callFirstPostRequestToIframeProxy=function(hostedURL){var boxID="box"+Math.floor(Math.random()*1000011);var postCookieRequest=["GCBR3",boxID,null,"","no action"];CM.submitPost2ServerProcessRequest(postCookieRequest,hostedURL,CM47.xdPsHelper.processSavedXdCookie)};CM47.xdPsHelper.populateDomains2Check=function(){var result=false;var hostedUrls=typeof urls.siteHostedFileURL==="string"?urls.siteHostedFileURL.split(","):[];var domainsList=urls.siteHostedFileDomains?urls.siteHostedFileDomains.split(","):[];if(hostedUrls.length>1||hostedUrls[0].trim()!=""){for(var j=0;j<hostedUrls.length;j++)CM47.xdPsHelper.domains2Check.pushHostedFileUrl(hostedUrls[j].trim());var parsedUrl;if(isWebSDK)parsedUrl=CM47.parseUrl(window.pageUrl);else parsedUrl=CM47.parseUrl(inqFrame.location.href);if(CM47.xdPsHelper.findHostFileURLByHost(parsedUrl)||CM47.xdPsHelper.findHostFileURLByDomain(parsedUrl,domainsList))result=true}if(inu1(CM47.xdPsHelper.hostFileURLUse)||CM47.xdPsHelper.hostFileURLUse==""){CM47.xdPsHelper.errorCode=2;result=false}return result};CM47.xdPsHelper.findHostFileURLByHost=function(parsedUrl){var domains2Check=CM47.xdPsHelper.domains2Check;for(var i=0;i<domains2Check.length;i++)if(CM47.xdPsHelper.isURLsMatch(domains2Check[i].hostname,parsedUrl.hostname)||CM47.xdPsHelper.isURLsMatch(parsedUrl.hostname,domains2Check[i].hostname)){CM47.xdPsHelper.hostFileURLUse=domains2Check[i].href;return true}return false};CM47.xdPsHelper.findHostFileURLByDomain=function(parsedUrl,domainsList){var domains2Check=CM47.xdPsHelper.domains2Check;var result=false;var currentDomain;var i;for(i=0;i<domainsList.length;i++)if(CM47.xdPsHelper.isURLsMatch(domainsList[i],parsedUrl.hostname)||CM47.xdPsHelper.isURLsMatch(parsedUrl.hostname,domainsList[i])){currentDomain=domainsList[i];result=true;break}if(!currentDomain)if(domainsList.length===0)currentDomain=parsedUrl.domain;else{lwt12("Domain of current url: "+parsedUrl.href+" doesn't contains in domain list");return result}for(i=0;i<domains2Check.length;i++)if(domains2Check[i].domain.lastIndexOf(currentDomain)>-1||currentDomain.lastIndexOf(domains2Check[i].domain)>-1){if(!result)logInfoToTagServer(parsedUrl.href+" url "+domains2Check[i].href+" will be use for host file, entry missing in ciSettings hostedFileDomains");CM47.xdPsHelper.hostFileURLUse=domains2Check[i].href;result=true;break}return result};CM47.xdPsHelper.isURLsMatch=function(firstURL,secondURL){if(!firstURL.endsWith(secondURL))return false;var wholeDomainMatched=firstURL.charAt(firstURL.lastIndexOf(secondURL)-1)===".";var domainsEquals=firstURL===secondURL;return wholeDomainMatched||domainsEquals};CM47.xdPsHelper.processSavedXdCookie=function(context){CM47.xdPsHelper.domains2Check.assignDataByOrigin(context.origin,context);var theob;CM47.xdPsHelper.checkedDomainsCount+=1;if(CM47.xdPsHelper.checkedDomainsCount>=CM47.xdPsHelper.domains2Check.length){theob=CM47.xdPsHelper.domains2Check.findEntryWithLatestCookie();var data=theob?theob.context.data:context.data;CM47.xdPsHelper.isInFirstCookieProcess=false;Inq.IFrameProxyCallback(data)}};CM47.firstRequestCookie=function(){if(CM47.xdPsHelper.isUse1pcXdSolution())if((site.noJSHosting||isWebSDK)&&isSafari())CM47.chatSessionHelper.startCachePersistentSolution();else CM47.xdPsHelper.requestSavedXdCookies();else if(window.forceFPCookie&&CM47.xdPsHelper.is1pcEnabled()||isWebSDK&&!CM47.xdPsHelper.is1pcEnabled())CM47.xdPsHelper.requestSavedXdCookies();else CM.requestCookie((function(context){Inq.IFrameProxyCallback(context.data)}))};CM47.prototype.requestCookie=function(callback,param){param=param||"";var boxID="box"+Math.floor(Math.random()*1000011);var postCookieRequest=["GCBR3",boxID,param,"","no action"];this.postRequestToIframeProxy(postCookieRequest,boxID,callback)};CM47.prototype.requestCookieSynchronously=function(callback,param){this.whenCookiesCommitted(this.requestCookie.bind(this,callback,param))};CM47.prototype.updateCACookie=function(callbackFunc){if(this.xd){var param="inqCA_"+Inq.siteID;var callback=function(context){var cObj=this._getCookies(context.data);this.setV3ActiveValue(cObj[param]);callbackFunc()};this.requestCookieSynchronously(callback.bind(this),param)}else callbackFunc()};CM47.prototype.requestSessionData=function(callbackFunc){if(this.xd)this.requestCookieSynchronously(this.updateChatData.bind(this,callbackFunc),"inqSession_"+getSiteID());else this.updateChatData(callbackFunc)};CM47.prototype.updateChatData=function(callbackFunc,context){var data={};if(this.xd)data=parseCookieData(this._getCookies(context.data));else data=parseCookieData(this._getCookies());var chatData=data["inqSession"]?data["inqSession"]["chat"]:null;CHM.updateChatData(chatData);callbackFunc()};CM47.prototype.initMessaging=function(){if(this.initMessagingComplete)return true;Inq["proxyError"]=this.proxyError;return true};CM47.prototype.proxyError=function(errorText){ROM.post(urls.loggingURL,{level:"ERROR",line:encodeURIComponent(errorText)})};CM47.prototype.onRemoteCallback=function(data){this.setXDCookies(data)};CM47.prototype.expireCookie=function(cookieResourceId){log('EXPIRING COOKIE "'+cookieResourceId+'"');var cRes=resources[cookieResourceId];this._setCookie(cRes,"",-1)};CM47.prototype.isPersistentCookiesAllowed=function(){if(inu1(this.isPersistentCookiesEnabled)){var pcVar=new VER34(PERSISTENT_COOKIE_ALLOWED,{},resources[PERSISTENT_COOKIE_ALLOWED]);pcVar.z3({});var enabled=!!this.read(resources[PERSISTENT_COOKIE_ALLOWED],PERSISTENT_COOKIE_ALLOWED);if(enabled)this.expireCookie(PERSISTENT_COOKIE_ALLOWED);this.isPersistentCookiesEnabled=enabled}return this.isPersistentCookiesEnabled};CM47.isSessionCookiesEnabled=null;CM47.isSessionCookiesAllowed=function(){if(CM47.isSessionCookiesEnabled==null){var c_value=Math.floor(Math.random()*1001),c_name="sPc";CM47.isSessionCookiesEnabled=false;document.cookie=c_name+"="+c_value;if(document.cookie.indexOf(c_name)!=-1&&document.cookie.indexOf(c_value)!=-1){CM47.isSessionCookiesEnabled=true;document.cookie=c_name+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"}}return CM47.isSessionCookiesEnabled};CM47.prototype.getV3ActiveValue=function(){return this.cookies["inqCA"]};CM47.prototype.setV3ActiveValue=function(value){if(!this.cleaningDetected)this.cookies["inqCA"]=value};CM47.prototype.configureStorageListener=function(){if(storageAvailable("localStorage")){this.setStorageTracker();attachListener(window,"storage",this.onStorageChange.bind(this),false)}};CM47.prototype.setStorageTracker=function(){if(localStorage.length==0)localStorage.setItem("inqTracking",0)};CM47.prototype.onStorageChange=function(e){this.checkCookieValidity();this.setStorageTracker()};CM47.prototype.checkCookieValidity=function(){if(!this.cleaningDetected&&CHM&&CHM.isChatInProgress())this.requestCookie(this.cookieValidationCallback.bind(this))};CM47.prototype.set3PCIfCookieMismatched=function(cookies){if(isPersistentWindow())openerCall("cookiesCleaningDetected");CHM.closeChatMonitor();var expiry=24*3600*1e3;for(var cName in this.cookies){if(cName=="inqCA"||cName=="inqLT")continue;if(cookies[cName])this.s3d("SCBR3_PM",getSiteID(),cName,cookies[cName],expiry,this.resourcesType[cName]);else this.s3d("SCBR3_PM",getSiteID(),cName,null,-1*expiry,this.resourcesType[cName])}lmt12("Detected clearing of cookies in the active chat.",LOG_LEVELS.WARN,null,true)};CM47.prototype.cookieValidationCallback=function(context){if(!this.cleaningDetected&&CHM.isChatInProgress()){var cookies={};var cookieSource=this._getCookies(context.data);for(var name in cookieSource){var value=cookieSource[name];if(value){var cookieName=name.replace(/_\d+$/,"");if(cookieName=="JSESSIONID"||cookieName==="inqCA"||cookieName==="inqLT")cookies[cookieName]=value;else try{cookies[cookieName]=MI8.JSON.parse(value)}catch(e){}}}if((getCustIDfromCookieObject(this.cookies)!=getCustIDfromCookieObject(cookies)||getChatIDfromCookieObject(cookies)&&getChatIDfromCookieObject(this.cookies)!=getChatIDfromCookieObject(cookies))&&!CHM.isAsyncChat()){this.cleaningDetected=true;CM47.chatSessionHelper.readServerSavedChatInfo(getCustIDfromCookieObject(cookies),(data=>{var _data$data,_data$data$engagement;if(!((_data$data=data.data)!==null&&_data$data!==void 0&&(_data$data$engagement=_data$data.engagement)!==null&&_data$data$engagement!==void 0&&_data$data$engagement.engagementID)||data.data.engagement.engagementID===getChatIDfromCookieObject(cookies))this.set3PCIfCookieMismatched(cookies)}))}}function getCustIDfromCookieObject(cookies){return cookies["inqVital"]&&cookies["inqVital"].INQ&&cookies["inqVital"].INQ.custID}function getChatIDfromCookieObject(cookies){return cookies["inqSession"]&&cookies["inqSession"].CHM&&cookies["inqSession"].CHM.chat&&cookies["inqSession"].CHM.chat.id}};var COOKIE_DELIMITER=";";CM47.chatSessionHelperIsChatInProgress=function(){return CM47.chatSessionHelper.isChatInProgress()};CM47.isCachePersistentEnabled=function(){return CM47.chatSessionHelper.isEnabled};CM47.prototype.cookiesCleaningDetected=function(){this.cleaningDetected=true};CM47.parseUrl=function(str){var url=customParseUrl(str);var host=url.hostname;url.domain=host.indexOf(".")>=0&&host.split(".").length>=3?host.split(".").slice(1).join("."):host;return url};CM47.chatSessionHelper={cookie1pcXdData:null,isEnabled:false,isPersistentChat:false,customerId:null,protectionId:null,isContinueChat:false,serverDataForCookiesMap:{agentGroupID:["inqSession.chat.agID","inqVital.CHM.lastChat.agentGroupID"],agentGroupName:["inqSession.chat.agName","inqVital.CHM.lastChat.agentGroupName"],businessRuleID:["inqSession.CHM.chat.ruleID","inqSession.chat.ruleID","inqVital.CHM.lastChat.brID"],businessUnitID:["inqSession.chat.buID","inqVital.CHM.lastChat.businessUnitID"],engagementID:["inqSession.CHM.chat.id","inqSession.chat.id","inqSession._ecID","inqSession._icID"],owningAgent:["inqSession.CHM.chat.aid","inqSession.chat.aid","inqSession.agID","inqVital.CHM.agentID"],persistent:["inqSession.pc","inqSession.chat.pC"],saleQualified:["inqVital._ss"]},startCachePersistentSolution:function(){log("Starting Cache Persistent solution");if(CM47.xdPsHelper.populateDomains2Check())this.read1SPC(CM47.xdPsHelper.hostFileURLUse);else log("No sibling domain available to use Cache Persistent solution")},initCustomerCachedId:function(callbackFunction){let url=urls.vanityURL+"/tagserver/launch/initCustCachedId";if(getSiteID())url+="?siteID="+getSiteID();ROM.get(url,generateRequestId("initCustomerCachedId"),45e3,callbackFunction)},readServerSavedChatInfo:function(customerId,callbackFunction){if(customerId!=null){var postUrlPath=urls.vanityURL+"/tagserver/launch/readChatOnCustomerCachedId";var dataPayload="custId="+customerId+"&siteId="+getSiteID();if(getFlagSendDataToTSWithoutIframe())ROM.post(postUrlPath,dataPayload,generateRequestId("readChatSession"),false,callbackFunction,null,45e3);else LoadM.postRequestToIframeProxy(urls.vanityURL,["POSTCHAT","readChatSession","","",postUrlPath,dataPayload,45e3],"readChatSession",{callbackFun:callbackFunction})}},read1SPCCallBack:function(ev){CM47.chatSessionHelper.cookie1pcXdData=ev.data;if(ev.data&&ev.data==="no-cookie"){log("Cookies are blocked and chat can't be offered");return}CM47.chatSessionHelper.initCustomerCachedId((function(data){CM47.chatSessionHelper.customerId=data.data.custId;CM47.chatSessionHelper.protectionId=data.data.protectionId;CM47.chatSessionHelper.readServerSavedChatInfo(CM47.chatSessionHelper.customerId,CM47.chatSessionHelper.readServerSavedChatInfoCallBack)}))},readServerSavedChatInfoCallBack:function(data){CM47.chatSessionHelper.isEnabled=true;Inq.IFrameTSCallback(data.data)},read1SPC:function(hostedURL){CM47.chatSessionHelper.isEnabled=true;var boxID="box"+Math.floor(Math.random()*1000011);var postCookieRequest=["GCBR3",boxID,null,"","no action"];CM.submitPost2ServerProcessRequest(postCookieRequest,hostedURL,CM47.chatSessionHelper.read1SPCCallBack)},parseDataFromServer:function(data){if(!data)return null;else return data.engagement},buildCookieFromAPI:function(currentCookiesObject,engagement){CM47.chatSessionHelper.isContinueChat=true;CM47.chatSessionHelper.setParametersFromServer(currentCookiesObject,engagement);CM47.chatSessionHelper.setParametersFromCookiesOrDefault(currentCookiesObject,engagement);var engagementKeys=[];for(var engagementKey in engagement)if(engagement.hasOwnProperty(engagementKey)&&!CM47.chatSessionHelper.serverDataForCookiesMap.hasOwnProperty(engagementKey))engagementKeys.push(engagementKey);if(engagementKeys.length>0)lwt12("Unexpected fields from server: "+JSON.stringify(engagementKeys)+" it won't be used anywhere."+" New ticket should be created for updating code.");return currentCookiesObject},setParametersFromCookiesOrDefault:function(currentCookiesObject,serverData){var _chatSpec$chatTheme,_chatSpec$chatTheme2,_chatSpec$chatTheme3;var sessionID=CM47.chatSessionHelper.customerId+"1";var brID=parseInt(serverData.businessRuleID,10);var chatSpec;if(jsSDKEnabled)chatSpec=this.getChatSpecFromBusinessRulesJsSDK(brID);else chatSpec=this.getChatSpecFromBusinessRules(brID);setParamToObjectIfParamAbsent(currentCookiesObject,"inqVital.INQ.custID",CM47.chatSessionHelper.customerId);setParamToObjectIfParamAbsent(currentCookiesObject,"inqVital._iID",sessionID);setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession._ssID",sessionID);setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.fpID",CM47.chatSessionHelper.protectionId);CM47.chatSessionHelper.setToCookies(currentCookiesObject,"engagementID",serverData.engagementID,true);CM47.chatSessionHelper.setToCookies(currentCookiesObject,"businessRuleID",brID,true);setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.chatType",getChatType(currentCookiesObject,brID));setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.ci.msgcnt",1);setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.aMsgCnt",0);setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.cMsgCnt",1);setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.ci.c",1);setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.ci.eng",true);setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.ci.cntOS",1);setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.ci.lf",Date.now());setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.xmlSpec.id",parseInt(chatSpec["id"],10));if(chatSpec.embeddedTheme)setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.xmlSpec.embeddedTheme",chatSpec.embeddedTheme);if((_chatSpec$chatTheme=chatSpec.chatTheme)!==null&&_chatSpec$chatTheme!==void 0&&_chatSpec$chatTheme.sv)setChatThemePropsInCookies("sv",chatSpec.chatTheme.sv);if((_chatSpec$chatTheme2=chatSpec.chatTheme)!==null&&_chatSpec$chatTheme2!==void 0&&_chatSpec$chatTheme2.id)setChatThemePropsInCookies("id",parseInt(chatSpec.chatTheme.id,10));else if((_chatSpec$chatTheme3=chatSpec.chatTheme)!==null&&_chatSpec$chatTheme3!==void 0&&_chatSpec$chatTheme3.name)setChatThemePropsInCookies("name",chatSpec.chatTheme.name);else if(chatSpec.ctId)setChatThemePropsInCookies("id",parseInt(chatSpec.ctId,10));function setChatThemePropsInCookies(prop,val){setParamToObjectIfParamAbsent(currentCookiesObject,"inqSession.chat.xmlSpec.chatTheme.".concat(prop),val)}function getChatType(currentCookiesObject,brID){var currentChatType=null;if(currentCookiesObject&&currentCookiesObject.inqSession&&currentCookiesObject.inqSession.chat)currentChatType=currentCookiesObject.inqSession.chat.chatType;var ruleType=BRM.rb41(brID)?BRM.rb41(brID).ruleType:null;var chatType=ruleType?ruleType:currentChatType;return chatType||"C2C"}},setParametersFromServer:function(currentCookiesObject,serverData){if(serverData.persistent==="true")CM47.chatSessionHelper.isPersistentChat=true;CM47.chatSessionHelper.setToCookies(currentCookiesObject,"businessUnitID",serverData.businessUnitID);if(serverData.agentGroupID){CM47.chatSessionHelper.setToCookies(currentCookiesObject,"agentGroupID",serverData.agentGroupID);CM47.chatSessionHelper.setToCookies(currentCookiesObject,"agentGroupName",serverData.agentGroupName)}CM47.chatSessionHelper.setToCookies(currentCookiesObject,"owningAgent",serverData.owningAgent);CM47.chatSessionHelper.setToCookies(currentCookiesObject,"persistent",CM47.chatSessionHelper.isPersistentChat);if(serverData.saleQualified==="true")CM47.chatSessionHelper.setToCookies(currentCookiesObject,"saleQualified","assisted")},setToCookies:function(currentCookiesObject,name,value,createOnly){var cookiesFields=CM47.chatSessionHelper.serverDataForCookiesMap[name];for(var i=0;i<cookiesFields.length;i++)setParamToObject(currentCookiesObject,cookiesFields[i],value,createOnly)},getChatSpecFromBusinessRulesJsSDK:function(businessRuleID){var chatSpec={};var isDataAvailable=jsSDKEnabled&&jsonAPIData["business-rules"]&&jsonAPIData["business-rules"].rules!==void 0;if(!isDataAvailable)return chatSpec;var rules=jsonAPIData["business-rules"].rules;for(var i=0;i<rules.length;i++){var ruleItem=rules[i];if(ruleItem.rule.id==businessRuleID&&ruleItem.rule.actions){chatSpec=this.getChatSpecFromBusinessRuleActionsJsSDK(ruleItem.rule.actions);break}}return chatSpec},getChatSpecFromBusinessRuleActionsJsSDK:function(businessRuleActions){var chatSpec;for(var i=0;i<businessRuleActions.length;i++){var actionItem=businessRuleActions[i];var chatSpecValObj=actionItem.chatSpec&&actionItem.chatSpec.value;if(chatSpecValObj){chatSpec=this.getChatSpecFromValueObject(chatSpecValObj);this.assignChatAndEmbeddedThemesJSSDK(chatSpecValObj,chatSpec);break}else if(actionItem.c2cSpec){var c2cChatSpecValObj=actionItem.c2cSpec["chat-spec"]&&actionItem.c2cSpec["chat-spec"].value;if(c2cChatSpecValObj){chatSpec=this.getChatSpecFromValueObject(c2cChatSpecValObj);this.assignChatAndEmbeddedThemesJSSDK(c2cChatSpecValObj,chatSpec);break}else if(actionItem.c2cSpec["c2c-spec-id"]){var c2cSpec=MM.getC2CSpec(actionItem.c2cSpec["c2c-spec-id"]);if(c2cSpec&&c2cSpec.chSpId){chatSpec=MM.getChatSpec(c2cSpec.chSpId);break}}}}return chatSpec||{}},getChatSpecFromValueObject:function(chatSpecValObj){var chatSpec={};if(chatSpecValObj.id)chatSpec=MM.getChatSpec(chatSpecValObj.id);else if(chatSpecValObj.name)chatSpec=MM.getChatSpecByName(chatSpecValObj.name);return chatSpec},assignChatAndEmbeddedThemesJSSDK:function(chatSpecValObj,chatSpec){var chatSpecEmbeddedTheme=chatSpecValObj.embeddedTheme;if(chatSpecEmbeddedTheme){chatSpec.embeddedTheme={id:chatSpecEmbeddedTheme.id.value};if(chatSpecEmbeddedTheme.chatTheme&&chatSpecEmbeddedTheme.chatTheme.value)chatSpec.embeddedTheme.chatTheme=chatSpecEmbeddedTheme.chatTheme.value}if(chatSpecValObj.chatTheme&&chatSpecValObj.chatTheme.value)chatSpec.chatTheme=chatSpecValObj.chatTheme.value},assignChatAndEmbeddedThemes:function(actionFcnStr,chatSpec){try{var themes=["embeddedTheme","chatTheme"];for(var i=0;i<themes.length;i++){var theme=themes[i];actionFcnStr=actionFcnStr.replace(/\s+/g,"");var themePos=actionFcnStr.indexOf(theme+":");if(themePos!==-1){var trimmedStr=actionFcnStr.substring(themePos+theme.length+1);var count=1,finalStr='{"',len=1;while(count!==0&&len<trimmedStr.length){var curr=trimmedStr[len];if(curr===":")finalStr+='"'+curr;else if(curr==="{"||curr===",")finalStr+=curr+'"';else finalStr+=curr;if(curr==="{")count++;else if(curr==="}")count--;len++}chatSpec[theme]=JSON.parse(finalStr)}}}catch(err){log("Error in getting chat theme and embedded theme from chat spec")}},getChatSpecFromBusinessRules:function(businessRuleID){var chatSpec;var af3="";var rule=BRM.rb41(businessRuleID);if(rule&&rule.af3)af3=rule.af3.toString();var chatSpecReg=/chatSpec:{(name|id):(.*?),/;var idReg=/{id:(\d*)/;try{if(chatSpecReg.test(af3)){var chatSpecIdOrName=chatSpecReg.exec(af3)[2];if(chatSpecIdOrName){chatSpec=MM.getChatSpec(chatSpecIdOrName)||MM.getChatSpecByName(chatSpecIdOrName);this.assignChatAndEmbeddedThemes(af3,chatSpec)}}else if(idReg.test(af3)){var c2cId=idReg.exec(af3)[1];if(c2cId){var chatSpecId=MM.getC2CSpec(c2cId).chSpId;if(chatSpecId)chatSpec=MM.getChatSpec(chatSpecId)}}}catch(e){let12("CM47#buildCookieFromAPI. Chat spec won't be set, because "+e+". Ticket for investigation this problem should be created.",true)}if(!chatSpec){chatSpec={};log("Chat spec is absent, chat won't be restored if it is absent in cookies",LOG_LEVELS.WARN)}return chatSpec},isChatInProgress:function(){return CM47.chatSessionHelper.isEnabled&&CM47.chatSessionHelper.isPersistentChat}};function StorageMgr(id,CM){this._frameworkModule(id);this.CM=CM;this.storageAvailability={localStorage:storageAvailable("localStorage"),sessionStorage:storageAvailable("sessionStorage")};this.initialized=false}var STORAGE_EXPIRE_PREFIX="LSCACHE-";StorageMgr.prototype=Object.create(CM47.prototype);StorageMgr.prototype.constructor=StorageMgr;StorageMgr.prototype.isStorageAvailable=function(storage){return!!storage&&this.storageAvailability[storage]};StorageMgr.prototype.init=function(){if(this.initialized)return;this.initialized=true;log(this.getID()+" initialized.")};StorageMgr.prototype._setStoredValue=function(res,value){var storage=res.getStorageType();if(this.isStorageAvailable(storage)){var today=Date.now();var lifetime=res.getLifetime();if(lifetime>0)window[storage].setItem(STORAGE_EXPIRE_PREFIX+res.getName(),today+lifetime);window[storage].setItem(res.getName(),value)}};StorageMgr.prototype._getStoredValue=function(res,cName){var storage=res.getStorageType();if(this.isStorageAvailable(storage)&&!this._isDataExpired(cName,storage))return window[storage].getItem(cName);else return null};StorageMgr.prototype._isDataExpired=function(cName,storage){var now=Date.now();var expired=window[storage].getItem(STORAGE_EXPIRE_PREFIX+cName);if(expired!=null){expired=parseInt(expired,10);if(!isNaN(expired)&&expired<now){window[storage].removeItem(cName);window[storage].removeItem(STORAGE_EXPIRE_PREFIX+cName);return true}}return false};StorageMgr.prototype.clearStoredValue=function(res){var storage=res.getStorageType();if(this.isStorageAvailable(storage)){window[storage].removeItem(STORAGE_EXPIRE_PREFIX+res.getName());window[storage].removeItem(res.getName())}};StorageMgr.prototype.write=function(cRes,name,value,callback){var cObj=null;var cVal=null;var cName=cRes.getName();if(this.CM.xd)this.r479m.call(this.CM,cName,name,value);if(this.CM.cleaningDetected){if(typeof callback==="function")callback();return}if(this.CM.xd){this.checkCookieValidity.call(this.CM);if(this.CM.cleaningDetected){if(typeof callback==="function")callback();return}this.s3d.call(this.CM,"SCBR3_PM",getSiteID(),cName,this.CM.cookies[cName],cRes.getLifetime(),cRes.getStorageType(),callback)}else{var c=this._getStoredValue(cRes,cName);try{cObj=MI8.JSON.parse(c)||{}}catch(e){cObj={}}if(inu1(value))delete cObj[name];else cObj[name]=value;cVal=MI8.JSON.stringify(cObj);this._setStoredValue(cRes,cVal);if(typeof callback==="function")callback()}};StorageMgr.prototype.read=function(cRes,name){var cVal=null;var cName=cRes.getName();if(this.CM.xd)try{if(!inu1(this.CM.cookies[cName]))cVal=this.CM.cookies[cName][name]}catch(e){log(e)}else{var c=this._getStoredValue(cRes,cName);var cObj=null;try{if(c){cObj=MI8.JSON.parse(c);if(cObj!=null)cVal=cObj[name]}}catch(e){log(e)}}return cVal};function StorageResource(manager,id){this.manager=manager;this._resource(id);this._observable()}MI8.prepare(StorageResource).im13(MI8.Resource).im13(MI8.JSON).im13(MI8.Observable);StorageResource.prototype.getName=function(){return null};StorageResource.prototype.getPath=function(){return null};StorageResource.prototype.getLifetime=function(){return null};StorageResource.prototype.getDomain=function(){return null};StorageResource.prototype.getPurgePriority=function(){return null};StorageResource.prototype.isListener=function(l){return!!(l&&l.onResourceReset&&typeof l.onResourceReset=="function")};StorageResource.prototype.fireResourceResetEvent=function(){function f(l,evt){try{if(!!l.onResourceReset)l.onResourceReset(evt)}catch(e){log("Error firing event ResourceReset on "+l.getName()+":"+e)}}var event={customerID:Inq.getCustID()};this._fireEvt(f,event)};StorageResource.prototype.write=function(name,value,callback){if(this.manager)this.manager.write(this,name,value,callback)};StorageResource.prototype.read=function(name){if(this.manager)return this.manager.read(this,name)};StorageResource.prototype._serialize=function(value){return this.stringify(value)};StorageResource.prototype._unserialize=function(value){return this.parse(value)};StorageResource.prototype.getResourceID=function(){return this._rsrcID};StorageResource.prototype.getStorageType=function(){return null};function CCD(id,name,path,lifetime,domain,overflowPriority,cm){StorageResource.call(this,cm,id);this.getName=function(){return name};this.getPath=function(){return path};this.getLifetime=function(){if(gc7("USE_SESSION_COOKIE_PERSISTENCE",false))return"";return lifetime};this.getDomain=function(){return domain};this.getPurgePriority=function(){return overflowPriority}}CCD.prototype=Object.create(StorageResource.prototype);CCD.prototype.constructor=CCD;CCD.COOKIE_RESOURCE_PURGE_PRIORITY_SORT_FCN=function(a,b){return b.getPurgePriority()-a.getPurgePriority()};CCD.prototype.setCookieMgr=function(cm){this.manager=cm};function WebResource(id,url,permissions,method){this._resource(id);this.url=url;this.permissions=permissions;this.method=method}MI8.prepare(WebResource).im13(MI8.Resource).im13(MI8.JSON).im13(MI8.RC54);WebResource.prototype.write=function(name,value){};WebResource.prototype.read=function(name){};WebResource.prototype._serialize=function(value){return value};WebResource.prototype._unserialize=function(value){return value};function JSResource(id,permissions){this._resource(id);this.data=[]}MI8.prepare(JSResource).im13(MI8.Resource);JSResource.prototype.write=function(name,value){this.data[name]=value};JSResource.prototype.read=function(name){try{return this.data[name]}catch(e){}return null};JSResource.prototype._serialize=function(value){return value};JSResource.prototype._unserialize=function(value){return value};function LocalStorageResource(id,name,lifetime,sessionStorage,storageMgr){StorageResource.call(this,storageMgr,id);this.getName=function(){return name};this.getLifetime=function(){return lifetime};this.isSessionStorage=function(){return!!sessionStorage}}LocalStorageResource.prototype=Object.create(StorageResource.prototype);LocalStorageResource.prototype.constructor=LocalStorageResource;LocalStorageResource.prototype.getStorageType=function(){if(this.isSessionStorage())return"sessionStorage";else return"localStorage"};function VER34(name,dfltValue,resource,shortName,fnCast,fnSer){this.name=name;this.resource=resource;this.dfltValue=dfltValue;this.shortName=shortName;if(typeof fnCast=="function")this._cast=fnCast;if(typeof fnSer=="function")this._serialize=fnSer;if(!inu1(resource)&&resource.observable)resource.addListener(this)}MI8.prepare(VER34).im13(MI8.XJA3);VER34.getInstanceFromData=function(data){var getResource=function(id){return id?resources[id]:null};switch(data.type){case"generic":return new VER34(data.name,data.defVal,getResource(data.rId),data.shName,data.fnCast,data.fnSer);case"String":return new StringVariable(data.name,data.defVal,getResource(data.rId),data.shName,data.fnCast,data.fnSer,data.maxSize);case"Date":return new DateVar(data.name,data.defVal,getResource(data.rId),data.shName);case"List":return new ListVariable(data.name,data.defVal,getResource(data.rId),data.shName,data.maxEntr);case"DateList":return new DateListVar(data.name,data.defVal,getResource(data.rId),data.shName,data.maxEntr);case"Map":return new MapVariable(data.name,data.defVal,getResource(data.rId),data.shName,data.maxEntr)}throw"ERROR: Cannot instantiate variable for data: name="+data.name+", type="+data.type};VER34.getInstancesFromData=function(datArray){var retArr=[];for(var i=0;i<datArray.length;i++)retArr[i]=VER34.getInstanceFromData(datArray[i]);return retArr};VER34.prototype.onResourceReset=function(evt){this.init()};VER34.prototype.getName=function(){return this.name};VER34.prototype.getShortName=function(){return this.shortName};VER34.prototype.getPersistentName=function(){if(inu1(this.getShortName()))return this.getName();else return this.getShortName()};VER34.prototype.getResource=function(){return this.resource};VER34.prototype.reset=function(){this.z3(this.dfltValue)};VER34.prototype.init=function(){if(this.z0()==null)this.z3(this.dfltValue)};VER34.prototype._cast=function(v){return v};VER34.prototype._serialize=function(v){return v};VER34.prototype.z0=function(){var r=this.getResource();var val=null;if(!!this.getShortName()&&this.getShortName()!=this.getName()){var valByName=r.read(this.getName());var valByPerName=r.read(this.getShortName());if(!inu1(valByName)){r.write(this.getName());if(!valByPerName&&!(valByPerName===0)){r.write(this.getShortName(),valByName);valByPerName=valByName}}val=valByPerName}else val=this.getResource().read(this.getPersistentName());return inu1(val)?null:this._cast(val)};VER34.prototype.getValueOrDefault=function(){var val=this.z0();return val==null?this.dfltValue:val};VER34.prototype.z3=function(newValue,callback){this.getResource().write(this.getPersistentName(),this._serialize(newValue),callback);return newValue};function ListVariable(name,dfltValue,resource,shortName,maxEntries){this.name=name;this.dfltValue=dfltValue;this.resource=resource;this.shortName=shortName;if(!!maxEntries)this.maxEntries=maxEntries}ListVariable.prototype=new VER34;ListVariable.prototype.constructor=ListVariable;ListVariable.prototype.append=function(arrayParam){var arr=this.z0();arr.append(arrayParam);arr.constrain(this.maxEntries);this.z3(arr)};ListVariable.prototype.prepend=function(arrayParam){var arr=this.z0();arr.prepend(arrayParam);arr.constrain(this.maxEntries);this.z3(arr)};function DateVar(name,dfltValue,resource,shortName){this.name=name;this.dfltValue=dfltValue;this.resource=resource;this.shortName=shortName}DateVar.prototype=new VER34;DateVar.prototype.constructor=DateVar;DateVar.prototype._serialize=function(o){return o&&o.constructor===Date?Math.floor(o.getTime()):o};DateVar.prototype._cast=function(o){return typeOf(o)=="number"?new Date(o):o};function DateListVar(name,dfltValue,resource,shortName,maxEntries){this.name=name;this.dfltValue=dfltValue;this.resource=resource;this.shortName=shortName;if(!!maxEntries)this.maxEntries=maxEntries}DateListVar.prototype=new ListVariable;DateListVar.prototype._serializeElement=DateVar.prototype._serialize;DateListVar.prototype._castElement=DateVar.prototype._cast;function MapVariable(name,dfltValue,resource,shortName,maxEntries){this.name=name;this.dfltValue=dfltValue;this.resource=resource;this.shortName=shortName;this.maxEntries=maxEntries}MapVariable.prototype=new VER34;MapVariable.prototype.constructor=MapVariable;MapVariable.prototype.set=function(key,value){var map=this.z0();if(map==null||typeof map!="object")map=[];if(this.maxEntries)if(this.maxEntries>Object.keys(map).length){map.set(key,value);this.z3(map)}else log("Can't add new entry to a map variable "+this.getPersistentName()+" , max entries number is "+this.maxEntries);else{map.set(key,value);this.z3(map)}};MapVariable.prototype.unset=function(key){var map=this.z0();map.unset(key);this.z3(map)};MapVariable.prototype.clear=function(){var map=this.z0();if(map!=null){map.clear();this.z3(map)}};MapVariable.prototype.each=function(fnc){var map=this.z0();map.each(fnc);this.z3(map)};function StringVariable(name,dfltValue,resource,shortName,fnCast,fnSer,maxSize){this.name=name;this.resource=resource;this.dfltValue=dfltValue;this.shortName=shortName;this.maxSize=maxSize;if(typeof fnCast=="function")this._cast=fnCast;if(typeof fnSer=="function")this._serialize=fnSer;if(!inu1(resource)&&resource.observable)resource.addListener(this)}StringVariable.prototype=new VER34;StringVariable.prototype.constructor=StringVariable;StringVariable.prototype.z3=function(newValue){if(!inu1(newValue)&&typeof newValue!="string"){log("StringVariable.z3: format of data to set is wrong, it will not be set, data = "+newValue);return newValue}else if(newValue&&this.maxSize&&this.maxSize<newValue.length){log(this.getPersistentName()+" cannot write value bigger that max size of "+this.maxSize+" and will be truncated");newValue=newValue.substring(0,this.maxSize)}this.getResource().write(this.getPersistentName(),this._serialize(newValue));return newValue};function X4334rtf(id,xd){this._frameworkModule(id);this.xd=xd;this._observable();this._vartable={};this.CM=CM47.getInstance(this.xd);this.getVar=function(varName,rule){var rv=this._vartable[varName+(rule?"_"+rule.getID():"")];if(!rv)rv=this._vartable[varName];return!!rv?rv:this.returnDefaultVarWhenCalledFromRule(varName,rule)};this.returnDefaultVarWhenCalledFromRule=function(varName,rule){if(rule)return this.getDefaultVariableInstance(varName);return null};this.getDefaultVariableInstance=function(varName){return new VER34(varName,0,resources["tmpVars"])};this.addVars=function(varArr){for(var i=0;i<varArr.length;i++)this.addVar(varArr[i])};this.addVar=function(v){this._vartable[v.getName()]=v};this.resetTmpVars=function(){var akey;var loc_site=initSiteData();var loc_businessVars;var loc_tmpVars={};if(loc_site)loc_businessVars=loc_site.businessVars();var endi=loc_businessVars?loc_businessVars.length:0;for(var i=0;i<endi;i++)if(loc_businessVars[i].rId==="tmpVars")loc_tmpVars[loc_businessVars[i].name]=loc_businessVars[i].defVal;for(akey in this._vartable)try{if(this._vartable[akey].resource._rsrcID==="tmpVars")this.getVar(akey).z3(loc_tmpVars&&loc_tmpVars.hasOwnProperty(akey)?loc_tmpVars[akey]:this._vartable[akey].dfltValue)}catch(err){}};this.fireDataReady=function(){for(var idx=0;idx<this._listeners.length;idx++)try{this._listeners[idx].agrtyer({})}catch(e){log(e)}};this.isListener=function(l){return l&&l.agrtyer?true:false};this.init=function(){if(this.initialized)return;this.initialized=true;for(var aVar in this._vartable)this._vartable[aVar].init();log(this.getID()+" initialized.")};this.reset=function(resourceID){if(!inu1(resourceID)){this.CM.clear(resourceID);var resource=resources[resourceID];if(!inu1(resource)){resource.fireResourceResetEvent();log("resource reset for resourceID : "+resourceID)}}};this.start=function(){if(this.started)return;this.started=true};this.getCookieMgr=function(){return this.CM}}X4334rtf.PM=null;X4334rtf.getInstance=function(xd){if(X4334rtf.PM==null)X4334rtf.PM=new X4334rtf("PM",xd);return X4334rtf.PM};MI8.prepare(X4334rtf).im13(MI8.Observable).im13(MI8.FM2);X4334rtf.im13(MI8.JSON).im13(MI8.XJA3);function toParamString(d,avoidRand,addCheckSum){var rv="";var dataArray=[];if(!d)return rv;var separator="&";if(!avoidRand)dataArray.push("_rand="+encodeURIComponent(randStr()));if(typeof d==="object"){for(var idx in d)if(typeof d[idx]!="function"&&!inu1(d[idx]))dataArray.push(encodeURIComponent(idx)+"="+encodeURIComponent(d[idx]))}else dataArray.push(d.toString());rv=dataArray.join(separator);if(addCheckSum)rv="checksum="+genCheckSumBy(rv)+separator+rv;return rv}function randStr(){return Math.round(Math.random()*1e12).toString(36)}function genCheckSumBy(parameters){var separator="&";var checkSum=0;if(parameters.length>0){var paramsArray=parameters.split(separator);for(var i=0;i<paramsArray.length;i++)checkSum+=decodeURIComponent(paramsArray[i]).hashCode()}return checkSum}function Channel(onComplete,onError){this.addCheckSum=true;if(typeof onComplete=="function")this.onComplete=onComplete;if(typeof onError=="function")this.onError=onError;this.resendCount=0;this.img=this._newImage()}Channel.prototype.getCallback=function(){return this.onComplete};Channel.prototype.getResendCount=function(){return this.resendCount};Channel.prototype.getUrl=function(){return this.url};Channel.prototype.getSrcUrl=function(){return this.img.src};Channel.prototype._newImage=function(){var img=new Image;img.channel=this;img.onload=function(evt){this.channel.done(evt)};img.onerror=function(e){this.channel.fail(e)};return img};Channel.prototype._resend=function(err){var maxResend=this.maxResendTimes?this.maxResendTimes:3;if(!!this.resendOnError&&++this.resendCount<maxResend){this.img=this._newImage();if(!!this.data)this.data["resendCount"]=this.resendCount;if(this.timeout){var _this=this;setTimeout((function(){_this.send(_this.url,_this.data,_this.noCacheBust,_this.resendOnError,_this.maxResendTimes,_this.timeout)}),_this.timeout)}else this.send(this.url,this.data,this.noCacheBust,this.resendOnError,this.maxResendTimes,this.timeout)}else if(typeof this.onComplete=="function"){var errObj={state:"ERROR",url:this.getFullUrl(),attempts:this.resendCount};if(err&&err["type"])errObj.evt={type:err["type"]};this.onComplete(errObj)}let12("Send Error: Could not send data to service. retry count="+this.resendCount+", url="+this.getFullUrl()+(this.resendCount>2?", Failed!":""),true)};Channel.prototype.getFullUrl=function(){return this.url+(!!this.data?"?"+this.toParamString(this.data,this.noCacheBust,this.addCheckSum):"")};Channel.prototype.send=function(url,data,noCacheBust,resendOnError,maxResendTimes,timeout){if(isLogToServerDisabled()&&url===urls.loggingURL)return;this.url=url;this.data=data;this.noCacheBust=noCacheBust;this.resendOnError=resendOnError;this.maxResendTimes=maxResendTimes;this.timeout=timeout;this.img.src=this.getFullUrl()};Channel.prototype.toParamString=toParamString;Channel.prototype.rand=randStr;Channel.prototype.done=function(evt){if(typeof this.onComplete=="function")this.onComplete({state:"SUCCESS",evt:evt,url:this.url})};Channel.prototype.fail=function(err){if(typeof this.onError=="function")this.onError({state:"ERROR",err:err});else this._resend(err)};function RM91(id,data){this._frameworkModule(id);this.waitingQ={};this.ch=[];this.i=0;this.pIdx=0;this.ridx=0;this.isIE=isIE();this.absorb(data);this.addCheckSum=true;this.transcriptRequestCount=0;this.transcriptRequestStartTime=0;this.isOversizeRemoteCall=function(url,data){this.pd1d(data,null);return this.isOversizeCall(url,data)};this.isVanityUrl=function(url){return url.indexOf(vanityUrl)===0};this.isTSUrl=function(url){return url.includes(urls.vanityURL)};this.isOversizeCall=function(url,data){var pstr=this.toParamString(data);pstr=(pstr&&pstr.length>0?"?":"")+pstr;var reqURL=url+pstr;return this.isIE&&reqURL.length>2048};this.send=function(url,data,logOnError,resendOnError,maxResendTimes,timeout,onSuccessCallback){if(isLogToServerDisabled()&&url===urls.loggingURL)return;var hasLogdata=url.indexOf("/logdata")!=-1;if(this.isTSUrl(url)&&hasLogdata&&data&&v3Lander)data["codeVersion"]=v3Lander.codeVersion;try{if(this.isTSUrl(url))return this.post(url,data,data.rid);if(this.isOversizeCall(url,data)){this.postToServer(url,data);return}var rom=this;var channel=new Channel((function(evt){if(evt.state==="ERROR"){if(logOnError)lmt12("Channel send failed: siteID="+Inq.getSiteID()+",customerID="+Inq.getCustID()+",url="+this.getFullUrl(),LOG_LEVELS.ERROR)}else if(typeof onSuccessCallback==="function")onSuccessCallback();rom.ch.remove(channel)}));channel.send(url,data,null,resendOnError,maxResendTimes,timeout);this.ch.push(channel)}catch(e){let12("RM91.send >> making HTTP Request. URL: "+url+cf21(e))}};this.post=function(url,data,id,sync,callbackFcn,errorCallback,timeout){if(isLogToServerDisabled()&&url===urls.loggingURL)return;if(url.indexOf("incrementality/onEvent")>-1&&(!data.siteID||!data.customerID))return;CommunicationMgr.process(url,data,id,sync,this.getCallbackForEvent(url,toParamString(data,true,true),callbackFcn),errorCallback,timeout,this.preparePostRequestData(url,data,id,sync,callbackFcn))};this.get=function(url,id,timeout,callbackFcn,errorCallback){id=id||generateRequestId("vanity");timeout=timeout||0;var postRequestData=["POSTCHAT",id,"","",url,null,timeout,CHM.getFPSessionID()];CommunicationMgr.process(url,null,id,false,this.getCallbackForEvent(url,toParamString(data,true,true),callbackFcn),errorCallback,timeout,{request:postRequestData,id:id,callback:callbackFcn})};this.sendToChatrouter=function(url,data,id,callbackFcn){data=this.toParamString(data,true,false);var requestData=["POSTCHAT",id,"","",url,data,0,CHM.getFPSessionID()];var callback=callbackFcn?{callbackFun:callbackFcn}:null;CommunicationMgr.doCommands(url,requestData,id,callback)};this.preparePostRequestData=function(url,data,id,sync,callbackFcn){try{var headers={};id=id?id:generateRequestId("vanity");var pstr=this.toParamString(data,true,this.addCheckSum);var command=sync?"POSTSYNC":"POSTBR30";var postCookieRequest=[command,id,"","",encodeURIComponent(url+"?"+pstr)];if(this.isVanityUrl(url))headers["X-Protection-Id"]=CHM.getFPSessionID();postCookieRequest.push(JSON.stringify(headers));return{request:postCookieRequest,id:id,callback:this.getCallbackForEvent(url,pstr,callbackFcn)}}catch(e){let12("ERROR while preparing post context:"+e.message,true)}return{}};this.getCallbackForEvent=function(url,pstr,callbackFcn){if(url.indexOf("onEvent")>-1||url.indexOf(urls.logDataURL)>-1||url.indexOf("surveyReport")>-1)return function(resp){ROM.onRemoteCallback(resp.id,resp.data);if(resp&&parseInt(resp.responseStatus)!==200)lwt12("RM91.post >> Bad response status: "+resp.responseStatus+". Params: "+url+"?"+pstr+" .");if(typeof callbackFcn=="function")callbackFcn()};return callbackFcn};this.postJson=function(url,data,sendAsBody=false){var id=generateRequestId("vanity");var pstr=JSON.stringify(data);var command="POSTJSON";var postRequestData;if(getFlagSendDataToTSWithoutIframe()&&this.isTSUrl(url)||sendAsBody){postRequestData=[command,id,"","",url,pstr];CommunicationMgr.doCommands(url,postRequestData,id)}else try{postRequestData=[command,id,"","",encodeURIComponent(url+"?"+pstr)];CM.postRequestToIframeProxy(postRequestData,id)}catch(e){logErrorInPostToTagServer("ROM.postJson ERROR:"+cf21(e))}};this.postToServer=function(action,data){if(inu1(data)||inu1(action))return;var idx=++this.pIdx;var divId="inqPostBox"+idx;var formId="aform"+idx;var iframeId="box"+idx;var iframeSrc="javascript:false";var div=createFloatingDiv(divId,0,0,1,1);var iframe=createHiddenIFrame(iframeId,0,0,1,1,iframeSrc);div.appendChild(iframe);var form=this.createFormToPost(action,data,iframeId,formId);div.appendChild(form);iframe.onload=function(){div.parentNode.removeChild(div)};form.submit()};this.sendAuthenticatedUser=function(authenticatedUser){var data={siteID:getSiteID(),customerID:Inq.getCustID(),engagementID:CHM.getChatID(),authenticatedUser:JSON.stringify(authenticatedUser),conversationChannel:"WEB"};this.post(urls.authUserURL,data)};this.sendDataToAgent=function(agentID,data){if(!data.siteID)data.siteID=Inq.getSiteID();if(CHM.isVAChat())data.customerID=CHM.getChat().getCustID();if(data!=null&&(getIOSNativeSDKInstance()||typeof NuanIJSFBridge!="undefined")){delete data["agentID"];delete data["siteID"];delete data["engagementID"];delete data["customerID"];if(getIOSNativeSDKInstance()){data["reqType"]="datapass";getIOSNativeSDKInstance().postMessage(JSON.stringify(data))}else NuanIJSFBridge.dataPass(JSON.stringify(data))}else if(agentID)this.post(urls.baseURL+"/tracking/agent",data)};this.sendCobrowseMessage=function(engagementID,agentID,customerId,cobrowseEvent,cobrowseMessageText,resendToClient,siteID){this.post(urls.baseURL+"/tracking/cobrowse",{engagementID:engagementID,agentID:agentID,customerId:customerId,cobrowseEvent:cobrowseEvent,cobrowseMessageText:cobrowseMessageText,visibility:top.document.visibilityState,resendToClient:!!resendToClient,siteID:siteID})};this.composeURL=function(url,data,avoidRand){var p=this.toParamString(data,avoidRand);var idx=url.indexOf("?");if(p.length>0){if(idx<0)p="?"+p;else if(idx<url.length-1)p="&"+p;return url+p}return url};this.pd1d=function(data,caller){if(inu1(caller))data.rid="r1234567890";else data.rid=this._queueCaller(caller)};this.doRemoteCall=function(url,data,caller){this.pd1d(data,caller);var pstr=this.toParamString(data);if(this.isTSUrl(url))this.post(url,pstr,data.rid);else{var fault=new Error("remote call to non-vanity domain");ROM.post(urls.loggingURL,{level:"ERROR",line:"VANITY DOMAIN ERROR: "+cf21(fault)})}};this.newRID=function(){return"r"+Math.floor(Math.random()*1000011)};this._queueCaller=function(caller){var rid=this.newRID();if(caller&&caller.onRemoteCallback)this.waitingQ[rid]=caller;else throw"caller null or not an instance of RC54";return rid};this._dequeueCaller=function(rid){var c=this.waitingQ[rid];if(c){delete this.waitingQ[rid];return c}return null};this.onRemoteCallback=function(rid,data){if(rid){var caller=this._dequeueCaller(rid);if(caller!=null)try{caller.onRemoteCallback(data)}catch(err){let12(err,true)}}};this.init=function(){if(this.initialized)return;this.initialized=true};this.start=function(){if(this.started)return;this.started=true}}MI8.prepare(RM91).im13(MI8.XJA3).im13(MI8.FM2);RM91.prototype.toParamString=toParamString;RM91.prototype.rand=randStr;RM91.toParamString=toParamString;RM91.prototype.Glk4=function(callback){this.transcriptRequestCount++;function callbackFcn(response){var transcriptRequestEndTime=Date.now();if(response.responseStatus<200||response.responseStatus>299){if(ROM.transcriptRequestCount>gc7("CONVERSATION_TRANSCRIPT_RETRY_COUNT")){ROM.transcriptRequestCount=0;callback();let12("Can't get conversation transcript, response status code: "+response.responseStatus,true)}else setTimeout(ROM.Glk4.bind(ROM,callback),gc7("CONVERSATION_TRANSCRIPT_RETRY_INTERVAL"),callback);return}if(window["Application"]&&typeof window["Application"]["processConversationTranscriptResponse"]=="function")if(Application.processConversationTranscriptResponse(response,callback)){CHM.fireTranscriptReceivedEvent({requestCount:ROM.transcriptRequestCount,responseTime:transcriptRequestEndTime-ROM.transcriptRequestStartTime});ROM.transcriptRequestCount=0;ROM.transcriptRequestStartTime=0}else let12("Can't parse conversation transcript ",true);else let12("Can't process conversation transcript, CI is unavailable ",true)}var url=urls.conversationTranscriptURL+"/getTranscript";var conversationTranscriptMode=CHM.getChat()&&CHM.getChat().getRule()?CHM.getChat().getRule().conversationTranscriptMode:null;var conversationTranscriptDays=CHM.getChat()&&CHM.getChat().getRule()?CHM.getChat().getRule().conversationTranscriptDays:null;var data=prepareBaseBodyForAsyncChatDataRequest();data.businessUnitID=CHM.getBusinessUnitID();if(CHM.getAgentGroupID())data.agentGroupID=CHM.getAgentGroupID();if(!CHM.getChat().isAsyncReconnect()||CHM.getChat().getCustMsgCnt()>0)data.excludeEngagementID=CHM.getChatID();if(conversationTranscriptMode)data.mode=conversationTranscriptMode.toLowerCase();if(conversationTranscriptDays)data.days=conversationTranscriptDays;CONVM.appendConversationIDsTo(data);if(this.transcriptRequestCount==1)this.transcriptRequestStartTime=Date.now();this.post(url,data,generateRequestId("getTranscript"),false,callbackFcn)};RM91.prototype.getActiveChatroomId=function(successCallback,errorCallback){function callbackFcn(response){if(response.responseStatus<200||response.responseStatus>299){let12("Error response when trying to get active async chatroom",true);errorCallback()}else if(response.data){var responseData=response.data;if(responseData.chatID){CHM.updateChat(responseData.chatID,true);if(responseData.customerID)setCustID(responseData.customerID,true)}else if(CHM.getChat().isAsyncReconnect()&&responseData.newChatID)CHM.updateChat(responseData.newChatID,false);successCallback(CHM.getChatID(),Inq.getCustID(),CHM.getChat().isAsyncReconnect())}else errorCallback()}var url=urls.getExistingChatDataForReconnectOrNewChatId;var data={siteID:getSiteID(),customerID:Inq.getCustID(),businessUnitID:CHM.getBusinessUnitID()};if(CHM.getAgentGroupID())data.agentGroupID=CHM.getAgentGroupID();if(getUserObject())data.user_object=JSON.stringify(getUserObject());if(getAuthUser())data.authenticatedUser=JSON.stringify(getAuthUser());if(getPersistCustID())data.persistentCustomerID=FP.getPersistentCustomerID();this.post(url,data,generateRequestId("getExistingChatDataForReconnectOrNewChatId"),false,callbackFcn)};RM91.prototype.hasActiveConversations=function(){function callbackFcn(response){if(response.responseStatus<200||response.responseStatus>299){let12("Error returned for active conversation request, status code "+response.responseStatus,true);CONVM.reset()}else if(response.data){var responseData=typeof response.data=="string"?JSON.parse(response.data):response.data;if(responseData.customerID)CONVM.setInitialCustomerID(responseData.customerID);var conversationsLength=responseData.conversations.length;setConversationActive(conversationsLength>0);if(conversationsLength>0)CONVM.setLastBusinessUnitAndAgentGroup(responseData.conversations[0]["lastBusinessUnitID"],responseData.conversations[0]["lastAgentGroupID"]);else CONVM.reset()}else{let12("Empty response returned for active conversation request",true);CONVM.reset()}if(!gc7(DEFERRED_START_OF_MANAGERS_KEY)||!isPersistentChatLaunchingLimited())startMgrs.call(Inq,mgrList)}var url=urls.conversationTranscriptURL+"/customerActiveConversations";var data=prepareBaseBodyForAsyncChatDataRequest();this.post(url,data,generateRequestId("customerActiveConversations"),false,callbackFcn)};RM91.prototype.logEventsToDW=function(rule,evts,url){if(inu1(rule)||inu1(evts)||inu1(url)){logErrorInPostToTagServer(plc1("'logEventsToDW' the rule, evts or url must be defined. rule:["+rule+"], evts: ["+evts+"] url:["+url+"]."));return}var cbFunction=evts.callback;var errorCallback=evts.errorCallback;var eventList=evts.eventList;if(!e9(eventList))eventList=[evts];var events=[];for(var i=0;i<eventList.length;i++){var augmentedEvent=this.prepareDataFieldsForETL(rule,eventList[i]);if(augmentedEvent!=null)events.push(augmentedEvent);else{logErrorInPostToTagServer(plc1("'logEventsToDW' custom event must contain both a '_domain'"+" property and an 'evt' (event name) property."));return}}this.post(url,{stringifiedDataArray:JSON.stringify(events)},generateRequestId("logEventsToDW"),true,cbFunction,errorCallback)};RM91.prototype.prepareDataFieldsForETL=function(rule,evt){if(e9(evt,false,true)&&e9(evt._domain,false,true)&&e9(evt.evt,false,true))return EDB.build(evt,rule);return null};RM91.prototype.createFormToPost=function(action,data,target,formId){var doc=document;var form=doc.createElement("form");form.setAttribute("name",formId);form.setAttribute("id",formId);form.setAttribute("action",action);form.setAttribute("method","POST");form.setAttribute("target",target);for(var name in data)if(typeof data[name]!=="function"&&!inu1(data[name])){var textArea=doc.createElement("textarea");textArea.setAttribute("name",name);textArea.value=data[name];form.appendChild(textArea)}return form};RM91.prototype.verifyToken=function(tokenID,onSuccessCb,onErrorCb){function callbackFcn(response){if(response.responseStatus===200){if(typeof onSuccessCb==="function")onSuccessCb();CONVM.setConversationIDs(response.data.conversationTokenID,response.data.conversationObjectID);CONVM.fireVerifyTokenSuccessEvent(response.data)}else{if(typeof onErrorCb==="function")onErrorCb();CONVM.setConversationIDs(null,null);CONVM.fireVerifyTokenErrorEvent(response.data)}}var data={siteID:getSiteID(),customerID:Inq.getCustID(),conversationTokenID:tokenID};this.post(urls.verifyTokenURL,data,generateRequestId("verifyToken"),false,callbackFcn)};function EXCBTT(cEvtData){this.absorb(cEvtData)}EXCBTT.prototype.supportsListener=function(l){if(l){var lFcn=l["on"+this.name];if(lFcn&&typeof lFcn=="function")return true;if(this.aliases&&this.aliases.length)for(var idx=0;idx<this.aliases.length;idx++){lFcn=l[this.aliases[idx].name];if(lFcn&&typeof lFcn=="function")return true}}return false};EXCBTT.prototype.getData=function(rule,evt){var data=this.getEvtData(rule,evt);if(this.evtDataSupplement){MI8.mixAbsorber(data);data.absorb(this.evtDataSupplement)}return data};EXCBTT.prototype.invoke=function(l,rule,evt){if(this.supportsListener(l)){var lFcn=l["on"+this.name];if(lFcn&&typeof lFcn=="function")l["on"+this.name](this.getData(rule,evt));if(this.aliases)for(var idx=0;idx<this.aliases.length;idx++){var aliasEvt=this.aliases[idx];lFcn=l[aliasEvt.name];if(lFcn&&typeof lFcn=="function")try{var s;var sName;if(isAliasesNoEvalToggleEnable()){s=aliasEvt.getEvtData(rule,evt);sName=aliasEvt.name;if(typeof sName==="string")l[sName](s);else lmt12("Failure in EXCBTT: Invalid name of aliasEvt: "+JSON.stringify(sName)+" RuleId: "+rule.id+" SiteId: "+getSiteID(),LOG_LEVELS.WARN)}else{s=MI8.JSON.stringify(aliasEvt.getEvtData(rule,evt));sName=MI8.JSON.stringify(aliasEvt.name);var label4l="_inq_el_"+Math.round(Math.random()*982451653).toString(36);win[label4l]=l;var code="(parent)."+label4l+"["+sName+"]("+s+")";evaluateLegacySettings(code);try{win[label4l]=null;delete win[label4l]}catch(e){}}lmt12("Alias was run. RuleId: "+rule.id+" SiteId: "+getSiteID()+" Alias name: "+aliasEvt.name+" aliasesNoEvalToggleEnable enabled: "+isAliasesNoEvalToggleEnable(),LOG_LEVELS.INFO)}catch(err){err["within"]="EXCBTT.invoke";var sErr=cf21(err);log("Error while calling the client side listeners"+decodeURIComponent(sErr));lmt12("Failure in EXCBTT invoke "+sErr,LOG_LEVELS.ERROR)}}}};EXCBTT.prototype.toString=function(){return"EXCBTT "+this.name};MI8.prepare(EXCBTT).im13(MI8.XJA3).im13(MI8.Cloneable);EXCBTT.prototype.clone=function(){return new EXCBTT(this)};function EMT5(id){this._frameworkModule(id);this._observable();this.initialized=false;this.observables=[];this.cEvts={};this.init=function(){if(!this.initialized)this.initialized=true};this.addObservables=function(o){if(o)for(var idx in o)if(o[idx].observable&&o[idx]!=this)this.observables.push(o[idx])};this.start=function(){if(this.started)return;this.started=true};this.addListeners=function(list){if(list&&list.length)for(var i=0;i<list.length;i++)this.addListener(list[i])};this.isListener=function(l){for(var cEvtName in this.cEvts){var cEvt=this.cEvts[cEvtName];if(cEvt.supportsListener(l))return true}return false}}EMT5.prototype.addCustomEvent=function(customEvt){if(customEvt&&!this.cEvts[customEvt.name])this.cEvts[customEvt.name]=customEvt};EMT5.prototype.addCustomEvents=function(customEvtsArr){if(customEvtsArr)for(var idx=0;idx<customEvtsArr.length;idx++)this.addCustomEvent(customEvtsArr[idx])};EMT5.prototype.getCustomEvent=function(name){return this.cEvts[name]};EMT5.prototype.removeCustomEvent=function(customEvt){if(customEvt)delete this.cEvts[customEvt.name]};EMT5.prototype.fireCustomEvent=function(eventName,rule,evt,evtDataSupplementFcn,context){if(!isInqInitialized)throw"MissedEventError: "+eventName;if(!!context&&CHM.isPersistentWindow())try{parent.opener.Inq.fireCustomEvent(eventName,evt,rule)}catch(err){log('failed to fire custom event "'+eventName+'" from persistent window: '+err)}else{var cEvt=this.cEvts[eventName];if(cEvt){if(evtDataSupplementFcn){cEvt=cEvt.clone();cEvt["evtDataSupplement"]=evtDataSupplementFcn(rule,evt)}this._fireEvt((function(l,evt){if(l)cEvt.invoke(l,rule,evt)}),evt);return}throw"UnsupportedEventError: "+eventName}};EMT5.prototype.fireManualInvocationEvent=function(rule){BRM.fireManualInvocationEvent(rule)};MI8.prepare(EMT5).im13(MI8.FM2).im13(MI8.Observable);EMT5.prototype.addListener=function(l){if(l){for(var i=0;i<this.observables.length;i++)this.observables[i].addListener(l);if(this.isListener(l))this._listeners.push(l)}};EMT5.prototype.removeListenerByReference=function(listener){for(var i=0;i<this.observables.length;i++)this.observables[i].removeListenerByReference(listener)};EMT5.prototype.toString=function(){return'EMT5("'+this._id+'")'};function LE12(id,data){this.lh=[];this._frameworkModule(id);this._observable();this.initialized=false;this.page=null;this.quickCGIndex={};var cgIndex=0;this.reinitialized=false;this.absorb(data);for(var cgId in this.contentGroups){this.contentGroups[cgId]=CG.c(this.contentGroups[cgId]);this.quickCGIndex[cgId]=cgIndex++}}MI8.prepare(LE12).im13(MI8.FM2).im13(MI8.XJA3).im13(MI8.Observable).im13(MI8.Persistable);LE12.prototype.getData=function(){var thisRef=this;return{pageMarker:this.getPageMarker(),pageID:this.getPageID(),pageURL:this.getCurrentPageURL(),landingHistory:this.getLandingHistory(),checkCG:function(cgID,optPgIdx){return thisRef.checkCG(cgID,optPgIdx)}}};LE12.prototype.init=function(doReinit){if(!!doReinit){this.page=null;this.reinitialized=true}if(!this.initialized){this.stateVar=new VER34(this.getID(),{lh:[]},resources["state"]);this.stateVar.init();this.load()}this.initialized=true;if(v3Lander.isRplMode){this.page=win.v3Lander.getPage();this.restorePagesByIds()}else this.overridePage();this.addPageToLH()};LE12.prototype.overridePage=function(){var orID=Inq.overridePageID;if(orID>0)this.page=this.pages[orID]?this.pages[orID]:null;else if(!v3Lander.isRplMode)this._resolvePage()};LE12.prototype.restorePagesByIds=function(){var visitedPages=[];this.lh.forEach((function(element){if(element.id!==-1&&!visitedPages.includes(element.id))visitedPages.push(element.id)}));if(this.page&&!visitedPages.includes(this.page.id))visitedPages.push(this.page.id);if(visitedPages.length>0){var data={pages:visitedPages,siteID:getSiteID(),url:document.URL,codeVersion:v3Lander.codeVersion};var url;if(isResolvePageServiceEnabled())url=urls.resolvePageWSURL;else url=urls.resolvePageURL;ROM.post(url,data,null,null,function(context){if(typeof context.data=="string")context.data=JSON.parse(context.data);if(context.data&&context.data.pages)this.pages=context.data.pages;this.onPageResolution()}.bind(this))}else this.onPageResolution()};LE12.prototype._resolvePage=function(){var pages=this.pages;var pageURL=isWebSDK?window.pageUrl:win.location.href;for(var i in pages){var re=pages[i].re;if(re==="")continue;var caseInsensitive=false;if(re.indexOf("(?i)")===0){re=re.substr(4);caseInsensitive=true}var r=new RegExp(re,caseInsensitive?"i":void 0);var mat=r.exec(pageURL);if(!!mat&&mat[0]==pageURL){this.page=pages[i];break}}};LE12.prototype.getCurrentPageURL=function(){if(isWebSDK)return CHM.isPersistentWindow()?o1p().pageUrl:window.pageUrl;else try{return CHM.isPersistentWindow()?top.opener.location.href:win.location.href}catch(e){return win.location.href}};LE12.prototype.getPageMarker=function(idx,evt){var p=null;if(CHM.isPersistentWindow())try{p=evt&&evt.page||openerData.page||openerCall("getPage",[idx]);this.getPageMarkerErrorLog=false}catch(err){if(!this.getPageMarkerErrorLog){lmt12("Can't get opener page marker data for ChatID = "+CHM.getChatID()+". CustomerID = "+getCustID(),LOG_LEVELS.WARN);this.getPageMarkerErrorLog=true}}if(!p)p=this.getPage(idx);return p?p.mID:"unmarked page"};LE12.prototype.getPageID=function(idx,evt){if(isCEAPIPostChatSurveyMode())return inu1(parent.CEAPI_POST_CHAT_SURVEY_DATA.pageID)?-1:parent.CEAPI_POST_CHAT_SURVEY_DATA.pageID;var p=null;if(CHM.isPersistentWindow())try{p=evt&&evt.page||openerData.page||openerCall("getPage",[idx]);this.getPageIdErrorLog=false}catch(err){if(!this.getPageIdErrorLog){lmt12("Can't get opener page id data for ChatID = "+CHM.getChatID()+". CustomerID = "+getCustID(),LOG_LEVELS.WARN);this.getPageIdErrorLog=true}}if(!p)p=this.getPage(idx);return p?p.id:-1};LE12.prototype.getPage=function(idx){var tempPage=null;if(inu1(idx))tempPage=this.page;else if(this.lh&&this.pages){var page=this.lh[idx];if(page)tempPage=this.pages[page.id]?this.pages[page.id]:{id:0,mID:"unmarked page",re:"(.*)"}}return tempPage};LE12.prototype.getPageMarkerById=function(id){var page=this.pages[id];if(page)return page.mID;else return"unmarked page"};LE12.prototype.addPageToLH=function(){var pageId=this.page?this.page.id:-1;var cgIdsArray;if(v3Lander.isRplMode&&win.v3Lander.getContentGroupIDs()&&win.v3Lander.page&&this.page&&win.v3Lander.page.mID===this.page.mID)cgIdsArray=this.getCorrespondedCGIndexes(win.v3Lander.getContentGroupIDs());else cgIdsArray=this.findCorrespondedCG(pageId);this.lh.unshift({id:pageId,cg:cgIdsArray});if(this.lh.length>this.qsize)this.lh.length=this.qsize>0?this.qsize:1;this.save()};LE12.prototype.load=function(){this.absorb(this.stateVar.z0())};LE12.prototype.save=function(){this.stateVar.z3({lh:this.lh})};LE12.prototype.getLandingHistory=function(){var retval=[];for(var idx=0;idx<this.lh.length;idx++)retval[idx]=this.getPageMarker(idx);return retval};LE12.prototype.start=function(){isInqInitialized=true;if(!v3Lander.isRplMode||isCEAPIPostChatSurveyMode()||this.postponedOnPageLanding){this.onPageResolution();this.postponedOnPageLanding=false}};LE12.prototype.onPageResolution=function(){if(!isInqInitialized){this.postponedOnPageLanding=true;return}if(isPersistentChatLaunchingLimited())this.fireOnPageLandingEventForPersistentWindow(this.page);else this.fireOnPageLandingEvent(this.page)};LE12.prototype.pageCheck=function(pageID){if(inu1(this.page))return false;else return this.page.id==pageID};LE12.prototype.reset=function(){};LE12.prototype.fireOnPageLandingEvent=function(dat){function onPageLanding(l,evt){try{if(l.onPageLanding)l.onPageLanding(evt)}catch(e){log(e)}}this._fireEvt(onPageLanding,{page:this.page,data:dat,reinitialized:this.reinitialized})};LE12.prototype.fireOnPageLandingEventForPersistentWindow=function(dat){function onPageLandingForPersistentWindow(listener,evt){try{if(listener.onPageLanding)if(listener instanceof BusinessRule||listener instanceof Rule&&listener.getID()>1e3);else listener.onPageLanding(evt)}catch(e){log(e)}}var skipRestoreChat=gc7(DEFERRED_START_OF_MANAGERS_KEY);this._fireEvt(onPageLandingForPersistentWindow,{page:this.page,data:dat,reinitialized:this.reinitialized,isChatLaunched:skipRestoreChat})};LE12.prototype.isListener=function(l){return l&&l.onPageLanding};LE12.prototype.getPersistentID=function(){return this.getID()};LE12.prototype.agrtyer=function(){log("LE12#agrtyer")};LE12.prototype.findCorrespondedCG=function(pgId){var out=[];var url=this.getCurrentPageURL();var index=0;for(var cgId in this.contentGroups){var cg=this.contentGroups[cgId];if(cg.contains(pgId,url,this.contentGroups))out[out.length]=index;index++}return out};LE12.prototype.getCorrespondedCGIndexes=function(cgIDs){var out=[];for(var i=0;i<cgIDs.length;i++)out.push(this.quickCGIndex[cgIDs[i]]);return out};LE12.prototype.checkCG=function(cgID,optPgIdx){var page=this.lh[optPgIdx&&optPgIdx<this.lh.length?optPgIdx:0];var cgIndex=this.quickCGIndex[cgID];if(inu1(cgIndex)||inu1(page))return false;var passedCG=page.cg;for(var index=0;index<passedCG.length;index++)if(passedCG[index]==cgIndex)return true;return false};LE12.prototype.getCGBusinessUnits=function(){var result=[];for(var cg in this.contentGroups){var buIDs=null;if(this.contentGroups[cg].contains(this.getPageID(),this.getCurrentPageURL(),this.contentGroups)){buIDs=this.contentGroups[cg].getBusinessUnits();if(buIDs)for(var i=0;i<buIDs.length;i++)result.push(buIDs[i])}}return result};function G3R3(id,data,disableMutationObservation){this._frameworkModule(id);this._observable();this._domRules=[];var rulesIndexes={};var onDomMutation=debounce((function onDomMutation(){BRM.refreshDomRules()}),100);if(!isWebSDK&&!!window.MutationObserver&&!disableMutationObservation){domObserver=new MutationObserver(onDomMutation);domObserver.observe(doc.body,{childList:true,subtree:true,attributes:true});doc.body.setAttribute("data-inq-observer","1")}if(data&&data.rules)for(var i=0;i<data.rules.length;i++){var r=data.rules[i];if(r.hasDomTrigger)this._domRules.push(r);var id=r.getID();var overridableRuleInd=rulesIndexes[id];if(overridableRuleInd==void 0)rulesIndexes[id]=i;else{data.rules[overridableRuleInd]=r;data.rules.splice(i,1);i--}}this.absorb(data);this._varTable={};this._rulesById={};this._ruleIds=[];this._bActionable=true;if(data&&data.rules)for(var j=0;j<data.rules.length;j++){var r1=data.rules[j];this._varTable[r1.getID()]=r1.getVars();this._rulesById[r1.getID()]=r1;this._ruleIds[j]=r1.getID()}this.getRules=function(){return this.rules};this.start=function(){if(this.started)return;this.started=true};this.init=function(reinitialize){if(this.initialized&&!reinitialize)return;for(var i=0;i<this.getRules().length;i++)this.getRules()[i].init();this.initialized=true;log(this.getID()+" initialized.")};this.load=function(){};this.save=function(){};this.agrtyer=function(){};this.reset=function(){for(var i=0;i<this.rules.length;i++)this.rules[i].reset()}}MI8.prepare(G3R3).im13(MI8.Persistable).im13(MI8.XJA3).im13(MI8.FM2);G3R3.im13(MI8.Observable);G3R3.prototype.getData=function(){updateDataFromOpener();var result={qBRs:this.getQualifiedBusinessRules(),rules:this.getRules()};clearDataFromOpener();return result};G3R3.prototype.resetForReinit=function(){for(var i=0;i<this.rules.length;i++){var triggers=this.rules[i].tt1(this.rules[i]);for(var j=0;j<triggers.length;j++){var trig=triggers[j];var elArray=[];var el;if(trig.domElementID){el=doc.getElementById(trig.domElementID);if(!!el)elArray[0]=el}else if(trig.domElements)for(var idx=0;idx<trig.domElements.length;idx++)elArray.append(trig.domElements[idx]);for(var k=0;k<elArray.length;k++){el=elArray[k];if(!inu1(el))el["tcRuleIDs"]=null}}}};G3R3.prototype.getPersistentID=function(){return this.getID()};G3R3.prototype.getQualifiedBusinessRules=function(){return this._collect((function(rule){if(rule.isBR()&&rule.areConditionalsMet())return rule}))};G3R3.prototype.refreshDomRules=function(){this._domRules.forEach((function(rule){rule.reattachDomTriggers()}))};G3R3.prototype._collect=function(fcn){var retcol=[];if(inu1(fcn)||typeOf(fcn)!="function")throw new Error("Illegal Argument: expected a function, got "+typeof fcn);for(var i=0;i<this.rules.length;i++){var rule=this.rules[i];var val=fcn(rule,i);if(!inu1(val))retcol[retcol.length]=val}return retcol};G3R3.prototype.getRuleVarTable=function(){return this._varTable};G3R3.prototype.getRuleByName=function(ruleName){var rule=null;for(var i=0;i<this.rules.length;i++)if(this.rules[i].getName()===ruleName){rule=this.rules[i];break}return rule};G3R3.prototype.rb41=function(ruleId){return this._rulesById[ruleId]};G3R3.prototype.setActionable=function(bActionable){this._bActionable=bActionable};G3R3.prototype.isControlGroup=function(){return!this._bActionable};G3R3.prototype.fireManualInvocationEvent=function(rule){var evt={};if(!inu1(rule)&&rule.onManualInvocation)rule.onManualInvocation(evt)};G3R3.prototype.fireRuleSatisfiedEvent=function(rule){var event={rule:rule};function f(l,evt){try{if(l.onRuleSatisfied)l.onRuleSatisfied(evt)}catch(e){log("Error firing event onRuleSatisfied on "+l.toString()+": \n"+e)}}this._fireEvt(f,event)};G3R3.prototype.fireServiceInvitationEvent=function(rule,serviceType){var event={rule:rule,serviceType:serviceType};function f(l,evt){try{if(l.onServiceInvitation)l.onServiceInvitation(evt)}catch(e){log("Error firing event onServiceInvitation on "+l.toString()+": \n"+e)}}this._fireEvt(f,event)};G3R3.prototype.fireServiceEngagedEvent=function(eventData){var outRule=null;try{outRule=this.rb41(eventData.brID)}catch(e){log("error "+e)}if(inu1(outRule))outRule={id:eventData.brID};var event={rule:outRule};function f(l,evt){try{if(l.onServiceEngaged)l.onServiceEngaged(evt)}catch(e){log("Error firing event onServiceEngaged on "+l.toString()+": \n"+e)}}this._fireEvt(f,event)};G3R3.prototype.fireServiceInteractedEvent=function(eventData){var event={rule:{id:eventData.brID}};function f(l,evt){try{if(l.onServiceInteracted)l.onServiceInteracted(evt)}catch(e){log("Error firing event onServiceInteracted on "+l.toString()+": \n"+e)}}this._fireEvt(f,event)};G3R3.prototype.fireServiceMissedEvent=function(rule,serviceType){var event={rule:rule,serviceType:serviceType};function f(l,evt){try{if(l.onServiceMissed)l.onServiceMissed(evt)}catch(e){log("Error firing event onServiceMissed on "+l.toString()+": \n"+e)}}this._fireEvt(f,event)};G3R3.prototype.fireExposureQualifiedEvent=function(eventData){function f(l,evt){try{if(l.onExposureQualified)l.onExposureQualified(evt)}catch(e){log("Error firing event onExposureQualified on "+l.toString()+": \n"+e)}}this._fireEvt(f,eventData)};G3R3.prototype.fireOnResetSession=function(){var onResetSession=function(l){if(l&&l.onResetSession)l.onResetSession()};this._fireEvt(onResetSession)};G3R3.prototype.isListener=function(l){var bListener=false;if(l&&(l.onRuleSatisfied||l.onServiceInvitation||l.onServiceEngaged||l.onServiceInteracted||l.onServiceMissed||l.onExposureQualified||l.onResetSession))bListener=true;return bListener};G3R3.prototype.logExposureResult=function(exposureData,chatType){var isReactive=!!(chatType==CHM.CHAT_TYPES.C2C);var agID=exposureData.agID?", agID="+exposureData.agID:"";var msgData="siteID="+exposureData.siteID+", custID="+exposureData.customerID+", pageID="+exposureData.pageID+", brID="+exposureData.brID+agID+", buID="+exposureData.buID;if(exposureData.result==this.EXPOSURE_QUALIFIED_RESULT.OUT_HOP)isReactive?log("Callback: MISSED OPP: Outside of business hours for C2C "+msgData):log("No Proactive Launch: Out of hours "+msgData);else if(exposureData.result==this.EXPOSURE_QUALIFIED_RESULT.NO_AVAILABILITY)log("No agents available "+msgData);else if(exposureData.result==this.EXPOSURE_QUALIFIED_RESULT.WILL_OFFER)log("Agents available "+msgData)};G3R3.prototype.EXPOSURE_QUALIFIED_RESULT={OUT_HOP:"out_hop",NO_AVAILABILITY:"no_availability",EXISTING_OFFER:"existing_offer",WILL_OFFER:"will_offer"};G3R3.prototype.getGlobalRuleAttributes=function(rule){if(this.globalRAtts&&this.globalRAtts.getGlobalRAtts&&rule){var applicable=true;if(this.globalRAtts.getRuleIDs&&this.globalRAtts.getRuleIDs().length>0)applicable=this.globalRAtts.getRuleIDs().contains(rule.id);else if(this.globalRAtts.getExcludedRuleIDs)applicable=!this.globalRAtts.getExcludedRuleIDs().contains(rule.id);if(applicable)return this.globalRAtts.getGlobalRAtts(rule)}return null};function Trigger(id,delayInMS,onlyInFocus){this.id=id;this.delayInMS=delayInMS?delayInMS:null;this.onlyInFocus=onlyInFocus}function Rule(data){this.constants={};this.evt={};this.absorbFields(data)}Rule.prototype.absorbFields=function(data){this.triggerMet=false;this.absorb(data);this.vtable={};if(data&&data.vars)for(var i=0;i<data.vars.length;i++){this.vars[i]=VER34.getInstanceFromData(data.vars[i]);this.vtable[this.vars[i].getName()]=this.vars[i]}this.doActions=this.af3};MI8.prepare(Rule).im13(MI8.JSON).im13(MI8.XJA3);Rule.create=function(data){return new Rule(data)};Rule.prototype.getID=function(){return this.id};Rule._delayedRules={};Rule._TIDX=0;Rule.prototype.setTimeout=function(delayInMS,onlyInFocus){var tidx=Rule._TIDX++;Rule._delayedRules[tidx]=this;this.timeoutStarted=new Date;this.tidx=tidx;this.win=win;this.stopTimeout=function(){Rule._stopTimeout(delayInMS,tidx)};this.resumeTimeout=function(){Rule._resumeTimeout(tidx)};if(onlyInFocus){attachListener(win,"blur",this.stopTimeout,false);attachListener(win,"focus",this.resumeTimeout,false)}return setTimeout((function(){Rule._timerCallback(tidx)}),delayInMS)};Rule._stopTimeout=function(delay,tidx){var rule=Rule._delayedRules[tidx];if(rule){var tid=rule.tid;if(tid){log("Timer stopped for delayed rule ID: "+rule.getID());clearTimeout(tid);rule.remainingTime=delay-(new Date-rule.timeoutStarted)}}};Rule._resumeTimeout=function(tidx){var rule=Rule._delayedRules[tidx];if(rule&&rule.remainingTime){log("Remaining time for rule ID: "+rule.getID()+", time:"+rule.remainingTime);rule.tid=window.setTimeout((function(){Rule._timerCallback(tidx)}),rule.remainingTime)}};Rule.prototype.clearTimeout=function(){if(this.tid){log("Timer resets for rule ID: "+this.getID());detachListener(this.win,"blur",this.stopTimeout,false);detachListener(this.win,"focus",this.resumeTimeout,false);this.remainingTime=0;clearTimeout(this.tid)}};Rule._timerCallback=function(tidx){var rule=Rule._popDelayedRule(tidx);if(rule)rule.timerCallback()};Rule._popDelayedRule=function(tidx){var rule=Rule._delayedRules[tidx];delete Rule._delayedRules[tidx];return rule?rule:null};Rule.prototype.sleep=function(delayInMS,onlyInFocus){this.tid=this.setTimeout(delayInMS,onlyInFocus)};Rule.prototype.reset=function(){this.clearTimeout();Rule._popDelayedRule(this.tidx)};Rule.prototype.fireRule=function(evt,delayInMS,onlyInFocus){this.evt=evt;this.triggerMet=true;if(delayInMS>0)this.sleep(delayInMS,onlyInFocus);else this.execute(evt)};Rule.prototype.getName=function(){return this.name};Rule.prototype.init=function(data){if(!this.tt1){log("ERROR: Rule+("+this.id+")["+this.name+"] was set without triggers. Rule will not execute.");return}else if(typeOf(this.tt1)=="function")this.triggers=this.tt1(this);for(var idx=0;idx<this.triggers.length;idx++){var trig=this.triggers[idx];if(trig.domElementID||trig.domElements){initRule[this.getID()]=true;this._processDomTrigger(trig,true)}else if(trig.serviceType)this._processSvcTrigger(trig);else this._processStdTrigger(trig)}};Rule.prototype.reattachDomTriggers=function(){var triggers=this.tt1(this);triggers.forEach((function(trig){this._processDomTrigger(trig,false)}),this)};Rule.prototype._processStdTrigger=function(trig){var atrig=trig;this[trig.id]=function(evt){this.fireRule(evt,atrig.delayInMS,atrig.onlyInFocus)}};Rule.prototype._processDomTrigger=function(trig,init){var elArray=[];if(isWebSDK){if(initRule[this.getID()])FrameBridge.registerDOMEvent(trig,this.getID())}else if(trig.domElementID){var el=doc.getElementById(trig.domElementID);if(!!el)elArray[0]=el}else if(trig.domElements)for(var idx=0;idx<trig.domElements.length;idx++)elArray.append(trig.domElements[idx]);if(elArray.length>0){var r=this;if(initRule[this.getID()])for(var i=0;i<elArray.length;i++){var el=elArray[i];if(!inu1(el)){if(inu1(el["tcRuleIDs"]))el["tcRuleIDs"]=[];var ruleIDs=el["tcRuleIDs"];if(init||!ruleIDs.contains(this.getID())){if(trig.id=="mousehover"){attachListener(el,"mouseover",(function(evt){var hoverTime=trig.hoverTime?trig.hoverTime:15e3;r.startHover=setTimeout((function(){r.fireRule(evt,trig.delayInMS)}),hoverTime)}));attachListener(el,"mouseout",(function(evt){window.clearTimeout(r.startHover)}))}else attachListener(el,trig.id,(function(evt){r.fireRule(evt,trig.delayInMS,trig.onlyInFocus)}));el["tcRuleIDs"].push(this.id)}}}}};Rule.prototype.log=function(msg,e){log("Rule #"+this.id+"("+this.name+"): "+msg+(e?"-> error="+e:""))};Rule.prototype._processSvcTrigger=function(trig){var svcTypes=this[trig.id+"_ServiceTypes"];var trigServiceType=trig.serviceType;if(inu1(svcTypes)){svcTypes=this[trig.id+"_ServiceTypes"]=[trigServiceType];this[trig.id]=function(evt){var evtServiceType=evt.chatType;if(svcTypes.contains(evtServiceType)||svcTypes.contains("ALL"))this.fireRule(evt,trig.delayInMS,trig.onlyInFocus)}}else if(!svcTypes.contains(trigServiceType)&&!svcTypes.contains("ALL"))svcTypes.push(trigServiceType)};Rule.prototype.isWithinDateRange=function(){var inRange=true;if(!!this.dates){var now=new Date;var start=!!this.dates.start?this.dates.start:new Date(0);var end=!!this.dates.end?this.dates.end:new Date(now.getTime()+1);inRange=now.after(start)&&now.before(end)}return inRange};Rule.prototype.areConditionalsMet=function(){return this.cc2(this,this.evt)&&this.triggerMet&&this.isWithinDateRange()};Rule.prototype.timerCallback=function(){this.pid=null;this.execute()};Rule.prototype.gc7=function(cID){if(inu1(this.constants[cID]))return constants[cID];return this.constants[cID]};Rule.prototype.execute=function(){try{if(this.active&&this.areConditionalsMet()){log("Executing: "+this.toString(),LOG_LEVELS.DEBUG);this.doActions(this,this.evt)}else log("Not executing, does not meet conditions: "+this.toString(),LOG_LEVELS.DEBUG)}catch(e){logActionErr(e,this)}};Rule.prototype.assertTrue=function(bfcn,testName,failmsg){var msg="ASSERT: "+this.getName()+" - "+testName+": ";try{var b=bfcn();msg+=b?"PASSED":"FAILED. "+failmsg;if(!b)msg="*** "+msg}catch(err){msg+="FAULT: "+err}ROM.send(urls.loggingURL,{level:"info",line:msg});log(msg)};Rule.prototype.getVars=function(){return this.vars};Rule.prototype.toString=function(){return"Rule "+this.getID()+' "'+this.name+'"'};Rule.prototype.isBR=function(){return false};function BusinessRule(data){this.constants={};this.absorbFields(data);if(!!this.ignoreFunnelLevel){this.constants["ifl"]=true;this.constants["fl"]=Number.NEGATIVE_INFINITY}else if(!inu1(this.funnelLevel))if(inu1(this.constants["fl"]))this.constants["fl"]=this.funnelLevel}BusinessRule.prototype=new Rule;BusinessRule.prototype.constructor=BusinessRule;BusinessRule.create=function(data){return new BusinessRule(data)};MI8.prepare(BusinessRule).im13(MI8.Observable).im13(MI8.RC54);BusinessRule.prototype.isBR=function(){return true};BusinessRule.prototype._isBlocked=function(){var hasRuleType=!!this.ruleType;if(!hasRuleType)return false;var ruleIsBlocked=hasRuleType&&getBlockedServicesList().contains(this.ruleType);var ruleTypeIsPopup=this.ruleType===CHM.CHAT_TYPES.POPUP||this.ruleType===CHM.CHAT_TYPES.POPUP_CALL;var ruleFunnelLevel=this.constants["fl"];var persistentFunnelLevel=PM.getVar("cfl").z0();var isBlocked=ruleIsBlocked||ruleTypeIsPopup&&ruleFunnelLevel>persistentFunnelLevel;return isBlocked};BusinessRule.prototype.execute=function(){try{if(!this.active||!this.areConditionalsMet()){log("Not executing, does not meet conditions: "+this.toString(),LOG_LEVELS.DEBUG);return}if(this._isBlocked()){log("Not executing, rule type blocked: "+this.toString(),LOG_LEVELS.DEBUG);return}log("Executing: "+this.toString(),LOG_LEVELS.DEBUG);BRM.fireRuleSatisfiedEvent(this);var incr_exclude=this.getRuleAttributeValue("incr_exclude")==="yes";if(!BRM.isControlGroup()||incr_exclude)this.doActions(this,this.evt);else{var dataMap={buID:this.getBusinessUnitID(),siteID:Inq.getSiteID(),brID:this.getID(),agentAttributes:MI8.JSON.stringify(this.getAgentAttributes())};var agentGroupID=this.getAgentGroupID();if(agentGroupID)dataMap.agID=agentGroupID;this.callRemote(Inq.urls.agentsAvailabilityCheckURL,dataMap)}}catch(e){logActionErr(e,this)}};BusinessRule.prototype.onRemoteCallback=function(jsonData){var result=null;if(jsonData.inHOP==="true")if(jsonData.availability==="true")result=BRM.EXPOSURE_QUALIFIED_RESULT.WILL_OFFER;else result=BRM.EXPOSURE_QUALIFIED_RESULT.NO_AVAILABILITY;else result=BRM.EXPOSURE_QUALIFIED_RESULT.OUT_HOP;try{var exposureData={siteID:Inq.getSiteID(),customerID:Inq.getCustID(),incrementalityID:asi4(),sessionID:getSessionID(),brID:this.id,group:PM.getVar("incGroup").z0(),businessUnitID:this.getBusinessUnitID(),result:result,rule:this};BRM.fireExposureQualifiedEvent(exposureData)}catch(e){let12("Error onRemoteCallback for control group customer : "+e)}};BusinessRule.prototype.toString=function(){return"BusinessRule "+this.getID()+' "'+this.name+'"'};Rule.prototype.getBusinessUnitID=function(){var buID;if(!inu1(this.bu8fr))buID=this.bu8fr();else if(!inu1(this.businessUnitID))buID=this.businessUnitID;else buID=getDefaultBusinessUnitID();log("Rule#getBusinessUnitId(ruleid="+this.getID()+"): business-unit-id="+buID,LOG_LEVELS.DEBUG);return buID};BusinessRule.prototype.attrNamesEqual=function(attr1,attr2){return attr1&&attr2&&attr1.name&&attr2.name&&attr1.name==attr2.name};BusinessRule.prototype.getAgentAttributes=function(){return this.getAAtts?this.getAAtts():[]};BusinessRule.prototype.setAgentAttributes=function(attribs){this.aAtts=attribs};BusinessRule.prototype.containsAgentAttribute=function(attribute){return this.getAgentAttributes().contains(attribute,BusinessRule.prototype.attrNamesEqual)};BusinessRule.prototype.addAgentAttribute=function(attribute){var attsArray=this.getAgentAttributes();var isRemove=attribute.value=="";if(isRemove){this.removeAgentAttribute(attribute);return}if(!this.containsAgentAttribute(attribute))attsArray.append([attribute]);else for(var idx=0;idx<attsArray.length;idx++)if(this.attrNamesEqual(attsArray[idx],attribute))attsArray[idx].value=attribute.value};BusinessRule.prototype.removeAgentAttribute=function(attribute){var attsArray=this.getAgentAttributes();if(this.containsAgentAttribute(attribute))for(var idx=0;idx<attsArray.length;idx++)if(this.attrNamesEqual(attsArray[idx],attribute)){attsArray.remove(idx);break}};BusinessRule.prototype.addAgentAttributes=function(attributes){for(var idx=0;idx<attributes.length;idx++)this.addAgentAttribute(attributes[idx])};BusinessRule.convertToAttributeString=function(data){if(inu1(data))return null;var out="";for(var index=0;index<data.length;index++){if(index>0)out+=";";out+=data[index].name+","+data[index].value}return out};BusinessRule.prototype.getAgentAttributesAsString=function(){if(!this.getAgentAttributes){log("Only BusinessRule can have agent attributes.");return null}return BusinessRule.convertToAttributeString(this.getAgentAttributes())};BusinessRule.prototype.ra1t=function(){if(!this.getRuleAttributes){log("Only BusinessRule can have rule attributes.");return null}return BusinessRule.convertToAttributeString(this.getRuleAttributes())};BusinessRule.prototype.getRuleAttributes=function(){var rAtts=Array.clone(this.getRuleAttributesAsArray());var globalRAtts=BRM.getGlobalRuleAttributes(this)||[];for(var i=0;i<globalRAtts.length;i++)if(!this.hasRuleAttribute(globalRAtts[i]))rAtts.push(globalRAtts[i]);return rAtts};BusinessRule.prototype.setRuleAttributes=function(attribs){var msg="Error: Rule "+this.id+"("+this.name+") calling deprecated BusinessRule.prototype.setRuleAttributes.";if(!this.setRuleAttributesErrorLoggedToServer){let12(msg);this.setRuleAttributesErrorLoggedToServer=true}else log(msg)};BusinessRule.prototype.getRuleAttributesAsArray=function(){return this.getRAtts?this.getRAtts():[]};BusinessRule.prototype.getRuleAttributeValue=function(attName){var rAtt=this.getRuleAttribute(attName);return!!rAtt&&!!rAtt.value?rAtt.value:null};BusinessRule.prototype.hasRuleAttribute=function(attribute){return this.getRuleAttributesAsArray()&&this.getRuleAttributesAsArray().contains(attribute,BusinessRule.prototype.attrNamesEqual)};BusinessRule.prototype.containsRuleAttribute=function(attribute){var result=this.hasRuleAttribute(attribute);if(!result){var globalRAtts=BRM.getGlobalRuleAttributes(this);if(globalRAtts&&globalRAtts.length>0)result=globalRAtts.contains(attribute,BusinessRule.prototype.attrNamesEqual)}return result};BusinessRule.prototype.getRuleAttribute=function(attName){var rAtts=this.getRuleAttributes();for(var ix=0;ix<rAtts.length;ix++)if(rAtts[ix].name==attName)return rAtts[ix];return null};BusinessRule.prototype.getPriority=function(){return this.priority};BusinessRule.prototype.getStartDate=function(){var start=null;if(this.dates&&this.dates.start)start=this.dates.start;return start};BusinessRule.prototype.getEndDate=function(){var end=null;if(this.dates&&this.dates.end)end=this.dates.end;return end};BusinessRule.prototype.getLanguage=function(){var language;if(!inu1(this._getLanguage))try{language=this._getLanguage(this)}catch(e){language=getDefaultLanguage();log("Error while getting language from the given Rule: \n"+e+"\n")}else language=getDefaultLanguage();return language};BusinessRule.prototype.getAgentGroupID=function(){var agentGroupID;if(!!this.getAgID)agentGroupID=this.getAgID();else if(!!this.agID)agentGroupID=this.agID;else agentGroupID=!!getDefaultAgentGroupId()?getDefaultAgentGroupId():void 0;return agentGroupID};BusinessRule.prototype.getUniqueAgentName=function(){var agentName=null;try{agentName=this.uniqueAgentName?this.uniqueAgentName:!!this.getAgentName&&!!this.getAgentName()?this.getAgentName():null}catch(e){let12("BusinessRule#Unable to get agent name. An error was made in the configuration of Business Rules.\n"+e,true)}return agentName};BusinessRule.prototype.setUniqueAgentName=function(uniqueAgentName){this.uniqueAgentName=uniqueAgentName};BusinessRule.prototype.setPublicAgentId=function(publicAgentId){this.publicAgentId=publicAgentId};BusinessRule.prototype.getUniqueAgentId=function(){return!!this.getAgentIdRef&&!!this.getAgentIdRef()?this.getAgentIdRef():null};BusinessRule.prototype.getUniquePublicAgentId=function(){return!!this.getPublicAgentId&&!!this.getPublicAgentId()?this.getPublicAgentId():null};BusinessRule.prototype.getFunnelLevel=function(){return this.funnelLevel};BusinessRule.prototype.getAutomatonParams=function(){return this.a8pm?this.a8pm():[]};BusinessRule.prototype.q6t=function(){return this.getRuleQueueThreshold?this.getRuleQueueThreshold():null};var Schedule=function(){function Schedule(id,periodStart,periodEnd,startTime,endTime,days,timezone){this.id=id;this.periodStart=periodStart;this.periodEnd=periodEnd;this.startTime=startTime;this.endTime=endTime;this.days=days;this.isScheduleMet=function(){return false};if(typeof timezone=="undefined")this.isScheduleMet=isScheduleMetCur;else{this.timezone=timezone;initData.scheduleTZs[this.timezone]=0;this.isScheduleMet=isScheduleMetNew}function isScheduleMetCur(dt,clientTimeLag,siteTzOfstMillis){var result=true;if(clientTimeLag)dt.roll(clientTimeLag);if(this.periodStart)result=dt.after(this.periodStart)||dt.equals(this.periodStart);if(result&&this.periodEnd)result=dt.before(this.periodEnd)||dt.equals(this.periodEnd);if(result&&this.days&&!this.days.isEmpty()){if(!siteTzOfstMillis)siteTzOfstMillis=0;var dtToGetSiteDay=new Date(dt.getTime()+dt.getTimezoneOffset()*6e4-siteTzOfstMillis);var currentDayAtSite=dtToGetSiteDay.getDay();result=this.days.contains(currentDayAtSite)}if(result&&(this.startTime||this.endTime)){var DAY_MILLISEC=24*60*60*1e3;var msSinceBOD,dtSrvTime=dt.getTime();if(!siteTzOfstMillis)siteTzOfstMillis=0;if(!this.startTime)this.startTime=new Date(siteTzOfstMillis);if(!this.endTime)this.endTime=new Date(this.startTime.getTime()+DAY_MILLISEC-siteTzOfstMillis);msSinceBOD=dtSrvTime%DAY_MILLISEC;if(this.endTime.getTime()>DAY_MILLISEC)if(msSinceBOD<=this.endTime.getTime()-DAY_MILLISEC)msSinceBOD+=DAY_MILLISEC;if(this.startTime)result=msSinceBOD>=this.startTime.getTime();if(result&&this.endTime)result=msSinceBOD<=this.endTime.getTime()}return result}function isScheduleMetNew(dt,clientTimeLag){var result=true;if(clientTimeLag)dt.roll(clientTimeLag);result=Schedule.checkPeriod(dt,this);if(result)if(this.days&&!this.days.isEmpty())result=Schedule.checkDays(dt,this);if(result)result=Schedule.checkTime(dt,this);return result}}Schedule.prototype.setScheduleDate=function(dt){this.scheduleDate=new Date(dt.getTime());this.scheduleDate.roll(Schedule.getOffsetDiff(this.tzOffset,Schedule.getTimezoneOffsetMilli(dt)))};Schedule.checkPeriod=function(dat,schedule){var result=true;if(schedule.periodStart&&typeof schedule.periodStart.getTime=="function")result=dat.after(schedule.periodStart)||dat.equals(schedule.periodStart);if(result&&schedule.periodEnd&&typeof schedule.periodEnd.getTime=="function")result=dat.before(schedule.periodEnd)||dat.equals(schedule.periodEnd);return result};Schedule.checkDays=function(dat,schedule){var result=true;schedule.setScheduleDate(dat);if(schedule.days){var scheduleDateLocalDay=schedule.scheduleDate.getDay();result=schedule.days.contains(scheduleDateLocalDay)}return result};Schedule.checkTime=function(dat,schedule){var result=true;schedule.setScheduleDate(dat);var scheduleTimeInSec=schedule.scheduleDate.getHours()*60*60+schedule.scheduleDate.getMinutes()*60+schedule.scheduleDate.getSeconds();schedule.scheduleTimeInMilSec=scheduleTimeInSec*1e3;if(result&&schedule.startTime)result=schedule.scheduleTimeInMilSec>=schedule.startTime;if(result&&schedule.endTime)result=schedule.scheduleTimeInMilSec<=schedule.endTime;return result};Schedule.getTimezoneOffsetMilli=function(dt){return-dt.getTimezoneOffset()*60*1e3};Schedule.getOffsetDiff=function(offsetSchedule,offsetLocal){return offsetSchedule-offsetLocal};return{createSchedule:function(id,periodStart,periodEnd,startTime,endTime,days,timezone){return new Schedule(id,periodStart,periodEnd,startTime,endTime,days,timezone)},checkPeriod:Schedule.checkPeriod,checkDays:Schedule.checkDays,checkTime:Schedule.checkTime,getTimezoneOffsetMilli:Schedule.getTimezoneOffsetMilli,getOffsetDiff:Schedule.getOffsetDiff}}();function C2C(mgr,rule,chatType,specDataFcn,c2p,adaCompliant,ariaEnhanced,ariaEnhancedChatAvailableMessage,adaAndroidC2cSupportDomains,useNative){this._mgr=mgr;this._rule=rule;this.chatType=chatType;this.c2cSpec=MM.mergeC2CSpec(specDataFcn(rule));this.specDataFcn=specDataFcn;this.adaCompliant=adaCompliant;this.ariaEnhanced=ariaEnhanced;this.ariaEnhancedChatAvailableMessage=ariaEnhancedChatAvailableMessage;this.adaAndroidC2cSupportDomains=adaAndroidC2cSupportDomains;EVM.addListener(this);this.idx=C2C.IDX++;this.clicked=false;this.c2p=c2p;this.useNative=useNative;this.pollCount=0;this.pollTime=0;this.oldState=null;this.newState=null;this.parentPositionStyle=null;this.positionChanged=false;this.listeners=[];this.timeout_id=C2C.INITIAL_TIMEOUT_ID}MI8.prepare(C2C).im13(MI8.XJA3).im13(MI8.RC54);C2C.IDX=0;C2C.c2CPageElementIDs=[];C2C.prototype.getIdx=function(){return this.idx};C2C.prototype.getXmlChatSpec=function(){if(inu1(this._rule))throw"C2C not ready: rule is undefined";var xmlC2cSpec=this.specDataFcn(this._rule);var c2cPlugin=this.getPlugin();if(!!xmlC2cSpec.chatSpec){if(c2cPlugin)xmlC2cSpec.chatSpec.pn=c2cPlugin;return xmlC2cSpec.chatSpec}var c2cSpec=MM.mergeC2CSpec(xmlC2cSpec);return{id:c2cSpec.chatSpec.id}};C2C.prototype.onRemoteCallback=function(dat){var setFocus=false;if(!!dat.c2cRedisplayed){BRM.fireRuleSatisfiedEvent(this.getRule());if(dat.c2cRedisplayed&&dat.c2cRedisplayed==true)setFocus=true}var exposureData={siteID:Inq.getSiteID(),pageID:inu1(LDM.getPageID())?-1:LDM.getPageID(),customerID:Inq.getCustID(),incrementalityID:asi4(),sessionID:getSessionID(),brID:this._rule.getID(),group:PM.getVar("incGroup").z0(),buID:this._rule.getBusinessUnitID(),agID:this._rule.getAgentGroupID(),result:dat.result,rule:this._rule};if(!this.repolled||this.repolled&&dat.result!=this.result){BRM.fireExposureQualifiedEvent(exposureData);BRM.logExposureResult(exposureData,CHM.CHAT_TYPES.C2C)}else this.skipExposed=true;this.absorb(dat);if(setFocus===true||typeof this.lastDat==="undefined"||this.lastDat.result!==dat.result||this.lastDat.launchable!==dat.launchable||!this.getDiv()||!this.getDiv().firstChild)if(this.isExtC2C||isWebSDK||this.shouldRenderPlugin())this.renderC2CbyClient(setFocus);else this.show(setFocus);this.checkPollCount();if(this.optDataPass&&!this.optDataPassListening){EVM.addListener({source:this,onAgentAssigned:this.optDataPass});this.optDataPassListening=true}if(this.serviceMissedEvent)BRM.fireServiceMissedEvent(this._rule,CHM.CHAT_TYPES.C2C);this.lastDat=dat;if(!dat.c2cRedisplayed)this._mgr.nextRequest(this)};C2C.prototype.showAgentsBusyIcon=function(){this.showImg(this.busyURL)};C2C.prototype.showIcon=function(name,clickable){if(this.c2cSpec.c2cTheme.renderAsHTML)this.showTextButton(name,clickable);else this.showImg(name,clickable);this.fixC2CLocation();this.updateContainerStyle()};C2C.prototype.showTextButton=function(name,clickable){var div=this.getDiv();if(!div){log("C2C container is missed on the page. Check the markup.");return}var eventName=isIE()&&getBrowserMajorVer()<=7?"onmouseup":"onclick";var c2cTheme=this.c2cSpec.c2cTheme[name];div.innerHTML="<div "+(isIOS()?' tabindex="0"':"")+">"+c2cTheme+"</div>";if(this.ariaEnhanced){var wrapper=document.createElement("div");wrapper.setAttribute("aria-live","polite");wrapper.setAttribute("tabindex","-1");wrapper.style.position="absolute";wrapper.style.top="-9999px";wrapper.style.width="1px";wrapper.style.height="1px";var defaultMessage="Chat available - open chat window by selecting button at end of window.";var message=this.ariaEnhancedChatAvailableMessage||defaultMessage;var messageElement=document.createElement("p");messageElement.innerHTML=message;div.appendChild(wrapper);setTimeout((function(){wrapper.appendChild(messageElement)}),200)}if(clickable){if(C2CM.IMAGETYPES.ready===name&&this._rule.asyncChat()&&this.c2cSpec.dispBadge)this.requestCustomerStatus();this.addEventHandlers(div,this.idx,eventName)}};C2C.prototype.showImg=function(img,clickable){var div=this.getDiv(),func=null;try{func=div["setSource"]}catch(e){func=null}var c2cModel=MM.getC2CSpec(this.c2cSpec.id);var altText=this.c2cSpec.c2cTheme[img+"alt"];if(typeof altText==="undefined"||altText==null||altText==="")altText=this.c2cSpec.altText?this.c2cSpec.altText:c2cModel.altText?c2cModel.altText:"Click To Chat";var eventName=isIOS()?"ontouchstart":isIE()&&getBrowserMajorVer()<=7?"onmouseup":"onclick";var onclicktxt=clickable?' alt="'+altText+'" tabindex="0"':'alt="'+altText+'"';if(!!func){var domain=div["iframeDomain"];onclicktxt="top.top.inqFrame.Inq.C2CM.agrty("+this.idx+', null, "C2C#showImg"); return false;';var mapAttributes={};mapAttributes["style"]="border-style: none; border-width: 0px;";mapAttributes["alt"]=altText;mapAttributes["tabindex"]="0";if(clickable){mapAttributes["style"]="border-style: none; border-width: 0px; cursor: pointer;";mapAttributes["onclick"]=onclicktxt}mapAttributes["src"]=urls.mediaSiteURL+"/images/"+this.c2cSpec.c2cTheme[img];mapAttributes["role"]="button";func(mapAttributes,domain)}else if((this.c2p||this.adaCompliant)&&clickable){div.innerHTML='<input type="image" role="button" src="'+urls.mediaSiteURL+"/images/"+this.c2cSpec.c2cTheme[img]+'"'+onclicktxt+(this.adaCompliant?' style="cursor:default" ':"")+"/>";if(C2C.DummyC2CBtn.checkCondition(this.adaCompliant,this.adaAndroidC2cSupportDomains)){if(C2C.talkBackDummyC2CBtnAdded==null)C2C.DummyC2CBtn.add(div);C2C.DummyC2CBtn.show(div)}if(clickable)this.addEventHandlers(div,this.idx,eventName);if(this.adaCompliant&&isIOS9())window.setTimeout((function(){var active=window.parent.document.activeElement;div.firstChild.focus();active.focus()}),500)}else{div.innerHTML='<img src="'+urls.mediaSiteURL+"/images/"+this.c2cSpec.c2cTheme[img]+'"'+onclicktxt+' style="cursor:default" '+(CHM&&CHM.chat&&CHM.chat._isVisible?'aria-hidden="true" tabindex="-1"':"")+"/>";if(clickable)this.addEventHandlers(div,this.idx,eventName);if(C2C.talkBackDummyC2CBtnAdded==true)C2C.DummyC2CBtn.hide(div)}};C2C.prototype.addEventHandlers=function(div,idx,eventName){var eventHandler=function(){C2CM.launchChat(idx);return false};var mouseoverHandler=function(e){e=e||window.event;var targ=e.target||e.srcElement;if(targ.nodeType==3)targ=targ.parentNode;var isAnchorTag=targ.tagName.toLowerCase()==="a";if(!isAnchorTag)targ.style.cursor="pointer"};window.setTimeout((function(){var element=div.firstChild;if(element){element[eventName]=eventHandler;element["onmouseover"]=mouseoverHandler}}),300)};C2C.prototype.showClickToCallHtml=function(urlHtml){var div=this.getDiv();var target=urls.mediaSiteURL+"/images/"+this.c2cSpec.c2cTheme["r"];if(div!=null&&div.firstChild&&target==div.firstChild["src"]){var frameSource=window.location.protocol+"//"+window.location.host+(window.location.port==""?"":":"+window.location.port)+inqFrame.Inq.v3framesrc;if(inqFrame.Inq.FlashPeer["showCallButton"]==null)inqFrame.Inq.FlashPeer.showCallButton=function(indx,source,left,top,number,show,giveFocus,title){inqFrame.Inq.C2CM.showCallButton(indx,source,left,top,number,show,giveFocus,title)};var iframeName=encodeURIComponent('{id: "'+this.idx+'", clientHtml: "'+frameSource+'"}');div.innerHTML='<iframe width="100%" height="100%" '+'name="'+iframeName+'" '+'border="0" '+'allowTransparency="true" '+'frameborder="0" scrolling="no" '+'src="'+urlHtml+'" '+'></iframe><input type="image" style="display: none;"></input>'}};C2C.prototype.showCallButton=function(source,left,top,number,showButton,giveFocus,title){var callBtnId="tcCallButton";if(giveFocus==null)giveFocus=true;if(title==null)title="Call "+number;if(giveFocus==null)giveFocus=false;if(showButton==null)showButton=true;var div=this.getDiv();div.style.position="relative";var form=document.createElement("form");var inputImage=null;if(inputImage==null&showButton==false)return;var inputImages=div.getElementsByTagName("INPUT");if(inputImages!=null&&inputImages.length>0)inputImage=inputImages[0];inputImage.id=callBtnId;inputImage.src=source;inputImage.idx=this.idx;inputImage.fone=number;inputImage.title=title;inputImage.style.cssText="display: "+(showButton?"":"none")+";position: absolute; left: "+left+"px; top: "+top+"px;";inputImage.onClick=inputImage.onclick=function(){var indx=this.idx;var fon=this.fone;C2CM.launchChat(indx,fon);return false};if(giveFocus&&showButton)if(inputImage["focus"]!=null)try{inputImage.focus()}catch(e){}};C2C.prototype.setClicked=function(isClicked){this.clicked=isClicked;if(!inu1(C2C.VirtualKeyboardOpenCloseHandler))C2C.VirtualKeyboardOpenCloseHandler.removeListener()};C2C.prototype.isClicked=function(){return this.clicked};C2C.prototype.forceGetDiv=function(){if(!inu1(this.c2cSpec.div))return this.c2cSpec.div;this.pageElementID=!!this.c2cSpec.peId?this.c2cSpec.peId:C2C.c2CPageElementIDs[this.id];var divId=this.pageElementID;return getParentPageElById(divId,win.document)};C2C.prototype.isDivOccupied=function(){var adiv=this.forceGetDiv();if(!adiv)return false;return!!adiv.occupied};C2C.prototype.getDiv=function(){if(isWebSDK)return;var div=this.forceGetDiv();div=!!div&&(!div.occupied||div.ruleID==this._rule.getID())?div:null;try{if(div!=null&&typeof this.c2cSpec.chatSpec.lang!="undefined")div.setAttribute("lang",this.c2cSpec.chatSpec.lang);if(this.adaCompliant&&!this.ariaEnhanced)div.setAttribute("aria-live","polite")}catch(err){}return div};C2C.prototype.clear=function(){var div=this.getDiv();if(div){div.occupied=false;div.innerHTML=""}};C2C.prototype.reset=function(){if(this.isExtC2C&&typeof this.specDataFcn().launchJS=="function")this.specDataFcn().launchJS({c2cIdx:this.idx,displayState:"reset"});this.stopC2CAgentCheckTimer();this.clear();this.clearListeners()};C2C.prototype.show=function(setFocus){if(inu1(C2CM.getC2C(this.idx))){log("No C2C will be shown, possibly reinitChat() was called before");return}var div=this.getDiv();if(!!this.c2cSpec.abs&&div){div.style.position="absolute";div.style.top=this.c2cSpec.abs.y;div.style.left=this.c2cSpec.abs.x}var image=this.image;if(CHM.isChatInProgress()||CM.cleaningDetected){this.launchable=false;image=this._mgr.IMAGETYPES.disabled}if(!!div){div.occupied=true;div.ruleID=this._rule.getID();div.idx=this.idx;this.showIcon(image,this.launchable);if(this.newState)this.oldState=this.newState;this.newState=C2CM.STATES[image];if(this.newState!==this.oldState)C2CM.fireC2CStateChanged({oldState:this.oldState,newState:this.newState,c2c:this,rule:this._rule,data:this.data});if(this.launchable&&!this.skipExposed){C2CM.fireC2CDisplayed({c2c:this,rule:this._rule,data:this.data});BRM.fireServiceInvitationEvent(this._rule,CHM.CHAT_TYPES.C2C);if(!inu1(C2C.VirtualKeyboardOpenCloseHandler))C2C.VirtualKeyboardOpenCloseHandler.addListener(this.pageElementID)}this.skipExposed=false;if(setFocus===true&&(!X43.lastusedC2CId&&X43.c2cBtnId==null&&div.idx===0||!X43.lastusedC2CId&&X43.c2cBtnId!=null&&X43.c2cBtnId==div.idx||X43.lastusedC2CId&&X43.lastusedC2CId===div.id)){var c2cDiv=getParentPageElById(div.id,win.document);var ignoreScrolling=this._rule.ignorePageScrollingOnC2CFocus?true:false;if(isMobileDevice()||!isMobileDevice()&&(c2cDiv.style.position==="fixed"||ignoreScrolling||isElementInViewport(c2cDiv)))window.setTimeout((function(){if(c2cDiv&&c2cDiv.firstChild){var c2cChild=C2C.getControlElement(c2cDiv.firstChild);if(c2cChild){var c2cChildIsAnchorTag=c2cChild.tagName.toLowerCase()==="a";if(!c2cChildIsAnchorTag&&!c2cChild.hasAttribute("tabindex"))c2cChild.setAttribute("tabindex",0);c2cChild.focus()}}X43.lastusedC2CId=null}),300)}else if(this.launchable&&!this.c2cSpec.c2cTheme.renderAsHTML)X43.c2cBtnId=this.idx}};C2C.prototype.renderC2CbyClient=function(setFocus){if(inu1(C2CM.getC2C(this.idx))){log("No C2C will be shown, possibly reinitChat() was called before");return}var image=this.image;if(CHM.isChatInProgress()||CM.cleaningDetected){this.launchable=false;this.image=image=this._mgr.IMAGETYPES.disabled}if(this.newState)this.oldState=this.newState;this.newState=C2CM.STATES[image];if(this.newState!==this.oldState)C2CM.fireC2CStateChanged({oldState:this.oldState,newState:this.newState,c2c:this,rule:this._rule,data:this.data});if(this.launchable&&!this.skipExposed){C2CM.fireC2CDisplayed({c2c:this,rule:this._rule,data:this.data});BRM.fireServiceInvitationEvent(this._rule,CHM.CHAT_TYPES.C2C)}this.skipExposed=false;if(isWebSDK||this.getPlugin()){var _this=this;var timeoutPer=this.newState!=="chatactive"?25:100;setTimeout((function(){C2CM.fireC2CReadyForSDK({c2c:_this,setFocus:setFocus})}),timeoutPer)}else{var lJs=this.specDataFcn().launchJS;var param={c2cIdx:this.idx,displayState:this.newState,ruleID:this._rule.getID(),isAsyncEngagement:this._rule.asyncChat(),launchable:this.launchable};if(setFocus===true)param["reDisplay"]=true;if(this.newState!=="chatactive")lJs&&lJs(param);else{var _this=this;setTimeout((function(){lJs&&lJs(param)}),100)}}};C2C.prototype.checkPollCount=function(){if(!this.c2cSpec.igaa&&!inu1(this.c2cSpec.aaci)){if(inu1(this.c2cSpec.aaciPollCount)&&inu1(this.c2cSpec.aaciMaxTime))this.c2cSpec.aaciPollCount=20;if(this.c2cSpec.aaci>this.c2cSpec.aaciMaxTime)log("The total-time-to-poll '"+this.c2cSpec.aaciMaxTime+"' "+"is configured to be less than the agent-availability-interval '"+this.c2cSpec.aaci+"'. The C2C agent check timer will not be set.",LOG_LEVELS.WARN);this.pollCount++;if(this.pollCount<this.c2cSpec.aaciPollCount||this.c2cSpec.aaciMaxTime&&this.c2cSpec.aaciMaxTime>this.pollTime)this.runC2CAgentCheckTimer()}};C2C.prototype.showDisabledIcon=function(){this.launchable=false;if(this.getDiv())this.showIcon(this._mgr.IMAGETYPES.disabled,this.launchable)};C2C.prototype.onChatLaunched=function(evt){this.showDisabled(evt);var isTablet=!inu1(inqFrame.Inq.FlashPeer.getDeviceType)&&inqFrame.Inq.FlashPeer.getDeviceType()==="Tablet";var isAndroid=getOSType()==="Android";var docElem;if(isTablet&&isAndroid){docElem=window.top.document.documentElement;if(docElem.style.zoom!=="")docElem.style.zoom=null}};C2C.prototype.showDisabled=function(evt){this.stopC2CAgentCheckTimer();this.oldState=this.newState;this.newState=C2CM.STATES.d;this.launchable=false;C2CM.fireC2CStateChanged({oldState:this.oldState,newState:this.newState,c2c:this,rule:this._rule,data:this.data});if(this.getDiv())this.showIcon(this._mgr.IMAGETYPES.disabled,this.launchable)};C2C.prototype.onChatClosed=function(evt){this.absorb(this.specDataFcn());this.clear();if(evt.evtType===CHM.EVTS.CLOSED){this.C2CRedisplayed=true;this.request()}this.C2CRedisplayed=null;this.setClicked(false)};C2C.prototype.request=function(){if(C2CM.isBlocked(this.getChatType())){this.reset();return}var rule=this.getRule();var data={siteID:siteID,brID:rule.getID(),brn:rule.getName(),pageID:LDM.getPageID(),chatType:this.chatType,priority:rule.getPriority(),qt:rule.q6t(),buID:rule.getBusinessUnitID(),custID:Inq.getCustID(),agID:rule.getAgentGroupID()};if(inu1(data.pageID))data.pageID=-1;if(!inu1(this.c2cSpec.igaa))data.igaa=this.c2cSpec.igaa;if(!inu1(this._rule.getRuleAttributes()))data.rAtts=this._rule.getRuleAttributes();if(!inu1(this._rule.getAgentAttributes()))data.aAtts=this._rule.getAgentAttributes();if(!!this.c2cSpec.chatSpec&&!inu1(this.c2cSpec.chatSpec.ignHOP))data.ignHOP=this.c2cSpec.chatSpec.ignHOP;if(CHM.isCallServiceType(this.chatType)&&CHM.getLastCallID())data.lastCallId=CHM.getLastCallID();if(!!this.C2CRedisplayed)data.c2cRedisplayed=this.C2CRedisplayed;var sData=MI8.JSON.stringify(data);this.callRemote(urls.requestC2CImageURL,{d:sData})};C2C.prototype.requestCustomerStatus=function(){var rule=this.getRule();if(typeof NuanIJSFBridge!="undefined")NuanIJSFBridge.checkConversationPlay(getSiteID(),rule.getBusinessUnitID(),rule.getAgentGroupID(),this.getIdx());else if(getIOSNativeSDKInstance()){var data={};data["reqType"]="checkConversation";data["siteID"]=getSiteID();data["agID"]=rule.getAgentGroupID();data["buID"]=rule.getBusinessUnitID();data["idx"]=this.getIdx();getIOSNativeSDKInstance().postMessage(JSON.stringify(data))}else{var data=prepareBaseBodyForAsyncChatDataRequest();data.businessUnitID=rule.getBusinessUnitID();var agentGroupID=rule.getAgentGroupID();if(agentGroupID)data.agentGroupID=agentGroupID;ROM.post(urls.requestCustomerStatus,data,null,null,this.customerStatusCallback.bind(this))}};C2C.prototype.customerStatusCallback=function(response){if(response.responseStatus===200&&response.data){var data=typeof response.data=="string"?JSON.parse(response.data):response.data;this.showUnreadMessageBubble(data)}};C2C.prototype.showUnreadMessageBubble=function(data){if(data["pendingMessagesCount"]&&data["pendingMessagesCount"]>0){var div=this.getDiv();var c2cBubble=div&&div.getElementsByClassName("c2c-bubble")[0];if(c2cBubble){c2cBubble.style.display="block";c2cBubble.innerText=data["pendingMessagesCount"]}}};C2C.prototype.getID=function(){return this.id};C2C.prototype.getC2cTheme=function(){return this.c2cSpec.c2cTheme};C2C.prototype.getChatSpec=function(){return this.c2cSpec.chatSpec};C2C.prototype.hasAbsolutePosition=function(){return!!this.c2cSpec.abs};C2C.prototype.getPosition=function(){return this.c2cSpec.position};C2C.prototype.getRule=function(){return this._rule};C2C.prototype.getChatType=function(){return this.chatType};C2C.prototype.getPlugin=function(){return this.c2cSpec.plugin};C2C.prototype.shouldRenderPlugin=function(){return this.getPlugin()&&!(this.getC2cTheme()&&this.getC2cTheme().renderAsHTML)};C2C.prototype.runC2CAgentCheckTimer=function(){var maxPollTime=Number.MAX_VALUE;if(this.c2cSpec.aaciMaxTime)maxPollTime=this.c2cSpec.aaciMaxTime;this.pollTime+=this.c2cSpec.aaci;if(!this.c2cSpec.igaa&&this.c2cSpec.aaci&&this.c2cSpec.aaci>0&&this.pollTime<maxPollTime){this.cancelC2CAgentCheckTimer();this.repolled=true;this.timeout_id=setTimeout(function(){C2CM.getC2C(this.getIdx()).request()}.bind(this),this.c2cSpec.aaci)}};C2C.prototype.stopC2CAgentCheckTimer=function(){this.cancelC2CAgentCheckTimer();this.repolled=false};C2C.prototype.cancelC2CAgentCheckTimer=function(){if(this.timeout_id)window.clearTimeout(this.timeout_id)};C2C.prototype.getPluginPath=function(){var spec=this.getChatSpec(),pn=this.getPlugin();if(spec&&pn){var fn=spec.chatTheme&&spec.chatTheme.fn;if(fn)return fn.replace(/\.(mxml|zip)$/,"")+"/"+pn+".js"}};C2C.prototype.parseStyle=function(styleText){var style={};var styleList=styleText.split(";");for(var i=0,item;i<styleList.length;i++){item=styleList[i].split(":");if(!item[0])continue;style[item[0].trim()]=item[1]?item[1].trim():""}return style};C2C.prototype.applyStyle=function(element,style){var stylePositionController={stylesMap:{},appliedProperty:[],addProperty:function(name){this.appliedProperty.push(name)},fixKnownStyleIssues:function(element){if(isIE()&&getBrowserMajorVer(true)<=6)if(this.stylesMap["position"]=="fixed"&&this.appliedProperty.indexOf("position")!=-1)element.style["position"]="absolute"},clearExcessivePropertyValue:function(element){for(var i=0;i<this.appliedProperty.length;i++)switch(this.appliedProperty[i]){case"top":if(this.appliedProperty.indexOf("bottom")==-1)element.style["bottom"]="";break;case"bottom":if(this.appliedProperty.indexOf("top")==-1)element.style["top"]="";break;case"left":if(this.appliedProperty.indexOf("right")==-1)element.style["right"]="";break;case"right":if(this.appliedProperty.indexOf("left")==-1)element.style["left"]="";break}}};if(typeof style=="string")style=this.parseStyle(style);stylePositionController.stylesMap=style;for(var prop in style){element.style[prop]=style[prop];stylePositionController.addProperty(prop)}stylePositionController.clearExcessivePropertyValue(element);stylePositionController.fixKnownStyleIssues(element)};C2C.prototype.isChangePositionNeeded=function(){var docEl=top.document.documentElement;var docRatio=docEl.scrollWidth/docEl.scrollHeight;var screenRatio=screen.width/screen.height;return docRatio>screenRatio};C2C.prototype.updateIconPositionToInitial=function(){this.applyStyle(this.getDiv(),this.parentPositionStyle);this.positionChanged=false;this.updateIconPositionAfterDelay()};C2C.prototype.updateIconPositionAfterDelay=function(){setTimeout(function(){this.updateIconPosition()}.bind(this),500)};C2C.prototype.updateIconPosition=function(){var element=this.getDiv();var style=copy(this.parentPositionStyle);var rollBackChanges=false;var styleChanged=false;var newTop;if(isAndroidWebView()){if(window.top.pageYOffset<=0){if(isElementOutsideOfViewport(0)){newTop=newTopPosition(0);styleChanged=true}}else if(this.positionChanged)rollBackChanges=true}else if(this.isChangePositionNeeded()){if(this.positionChanged){if(isElementOutsideOfViewport(0)){newTop=newTopPosition(0);styleChanged=true}}else if(style["bottom"]!=null&&style["top"]==null){var bottomPosition=parseInt(style["bottom"]);if(!isNaN(bottomPosition))if(isElementOutsideOfViewport(bottomPosition)){newTop=newTopPosition(bottomPosition);styleChanged=true}}}else if(this.positionChanged)rollBackChanges=true;if(styleChanged){style["top"]=newTop+"px";delete style["bottom"];this.applyStyle(element,style);this.positionChanged=true}else if(rollBackChanges){this.applyStyle(element,this.parentPositionStyle);this.positionChanged=false}function isElementOutsideOfViewport(bottom){return element.getBoundingClientRect().bottom+bottom>window.top.document.documentElement.scrollHeight}function newTopPosition(bottom){return window.top.document.documentElement.scrollHeight-element.offsetHeight-bottom}function copy(object){var out={};for(var k in object)out[k]=object[k];return out}};C2C.prototype.updateContainerStyle=function(){var element=this.getDiv();var child=element?element.children[0]:null;if(child){var styleText=child.getAttribute("data-parent-style");if(child.children[0]&&styleText==null||styleText=="")styleText=child.children[0].getAttribute("data-parent-style");if(styleText!=null&&styleText!=""){this.parentPositionStyle=this.parseStyle(styleText);this.applyStyle(element,this.parentPositionStyle);if("Android"==getOSType()&&styleText.contains("position")&&styleText.contains("fixed"))if(isAndroidWebView()){if(this.parentPositionStyle["bottom"]!=null&&this.parentPositionStyle["top"]==null){this.updateIconPosition();this.addListener(window.top,"scroll",this.updateIconPositionAfterDelay.bind(this))}this.addListener(window.top,"orientationchange",this.updateIconPositionToInitial.bind(this))}else if(isChrome()){if(this.isChangePositionNeeded()){var img=element.getElementsByTagName("img")[0];var inputEl=element.getElementsByTagName("input")[0];if(!img&&inputEl&&inputEl.type=="image")img=inputEl;if(img&&!img.complete){var onloadListener=img.onload;img.onload=function(){if(typeof onloadListener=="function")onloadListener();this.updateIconPosition()}.bind(this)}else this.updateIconPosition()}this.addListener(window.top,"orientationchange",this.updateIconPositionAfterDelay.bind(this))}}}};C2C.prototype.fixC2CLocation=function(){var isTablet=!inu1(inqFrame.Inq.FlashPeer.getDeviceType)&&inqFrame.Inq.FlashPeer.getDeviceType()==="Tablet";var isAndroid=getOSType()==="Android";var elem,style,clientWidth,vpWidth;var docElem;var zoom;if(isTablet&&isAndroid){elem=this.getDiv();style=getComputedStyle(elem);clientWidth=parseInt(style.left)+parseInt(style.width)+parseInt(style.right);vpWidth=window.top.innerWidth;if(!isNaN(clientWidth)&&clientWidth>vpWidth){docElem=window.top.document.documentElement;if(docElem.style.zoom===""){zoom=vpWidth/clientWidth*100;docElem.style.zoom=zoom+"%"}}}};C2C.prototype.addListener=function(target,type,listener){attachListener(target,type,listener);this.listeners.push({target:target,type:type,listener:listener})};C2C.prototype.clearListeners=function(){for(var i=this.listeners.length;i--;)detachListener(this.listeners[i].target,this.listeners[i].type,this.listeners[i].listener)};C2C.setC2CPageElementIDs=function(pageElementIDs){C2C.c2CPageElementIDs=pageElementIDs};C2C.getControlElement=function(element){if(element.tagName.toLowerCase()==="div")return C2C.getControlElement(element.firstElementChild);else if(element.tagName.toLowerCase()==="style")return C2C.getControlElement(element.nextElementSibling);return element};C2C.talkBackDummyC2CBtn=null;C2C.talkBackDummyC2CBtnAdded=null;C2C.VirtualKeyboardOpenCloseHandler={addListener:function(c2CElementId){if(!inu1(inqFrame.Inq.FlashPeer.getDeviceType)&&inqFrame.Inq.FlashPeer.getDeviceType()==="Phone"&&!inu1(isIOS)&&!isIOS()){var keyboardDetectionThreshhold=200;var c2cId=c2CElementId;this.c2cHandler=function(){var c2cBtn=getParentElByIDTFacade(c2cId);if(!inu1(c2cBtn)){var zoomRatio=window.top.screen.width/window.top.innerWidth;var innerHeight=window.top.innerHeight*zoomRatio;var screenHeight=window.top.screen.height;if(screenHeight-innerHeight>keyboardDetectionThreshhold)c2cBtn.style.display="none";else c2cBtn.style.display="block"}};window.top.addEventListener("resize",this.c2cHandler)}},removeListener:function(){if(!inu1(inqFrame.Inq.FlashPeer.getDeviceType)&&inqFrame.Inq.FlashPeer.getDeviceType()==="Phone"&&!inu1(isIOS)&&!isIOS())window.top.removeEventListener("resize",this.c2cHandler)}};C2C.DummyC2CBtn={checkCondition:function(adaCompliant,adaAndroidC2cSupportDomains){var result=false;try{if(adaCompliant!=true||typeof adaAndroidC2cSupportDomains=="undefined"||adaAndroidC2cSupportDomains.length==0)return;if(window.navigator.userAgent.toLowerCase().indexOf("android")>-1){var adaAndroidC2cSupportDomainsArr=adaAndroidC2cSupportDomains.split(",");for(var i=0;i<adaAndroidC2cSupportDomainsArr.length&&result==false;i++)if(parseUrl(inqFrame.location.href).hostname.toLowerCase()==adaAndroidC2cSupportDomainsArr[i].trim().toLowerCase()){result=true;break}}}catch(err){}return result},add:function(divC2C){try{C2C.talkBackDummyC2CBtn=divC2C.cloneNode(true);var divC2CImg=divC2C.getElementsByTagName("input")[0];divC2CImg.setAttribute("tabindex","-1");divC2CImg.setAttribute("aria-hidden","true");C2C.talkBackDummyC2CBtn.id=C2C.talkBackDummyC2CBtn.id+"_talkback";C2C.talkBackDummyC2CBtn.style.width="100%";var btnDummyHome;var footers=getParentElsByTNTFacade("footer");if(footers.length>0)btnDummyHome=footers[0];else btnDummyHome=top.document.body;btnDummyHome.appendChild(C2C.talkBackDummyC2CBtn);C2C.talkBackDummyC2CBtnAdded=true}catch(err){}},show:function(divC2C){if(C2C.talkBackDummyC2CBtn!=null)try{C2C.talkBackDummyC2CBtn.style.display="block";var btnC2CImg=divC2C.getElementsByTagName("input")[0];btnC2CImg.setAttribute("tabindex","-1");btnC2CImg.setAttribute("aria-hidden","true")}catch(err){}},hide:function(divC2C){if(C2C.talkBackDummyC2CBtn!=null)try{C2C.talkBackDummyC2CBtn.style.display="none";var btnC2CImg=divC2C.getElementsByTagName("input")[0];btnC2CImg.setAttribute("tabindex","0");btnC2CImg.removeAttribute("aria-hidden")}catch(err){}},remove:function(divC2C){if(C2C.talkBackDummyC2CBtn!=null)try{var btnC2CImg=divC2C.getElementsByTagName("input")[0];btnC2CImg.setAttribute("tabindex","0");btnC2CImg.removeAttribute("aria-hidden");C2C.talkBackDummyC2CBtn.parentNode.removeChild(C2C.talkBackDummyC2CBtn);C2C.talkBackDummyC2CBtn=null;C2C.talkBackDummyC2CBtnAdded=null}catch(err){}}};C2C.INITIAL_TIMEOUT_ID=-1;function GR34(id,data){this._frameworkModule(id);this._observable();this.pmor=false;this.absorb(data);this.popoutWindow=null;this.persistentWindow=null;this.chat=null;this._init=false;this.chatRequestQ=[];this.requestInProgress=false;this.hasEngaged=false;this.dataLoaded=false;this.evtIdx=0;this.lpt=0;this.earlyPopout=null;this.lastChat={};this.lastCallId=0;this._flashvarFcns=[];this._closeRetries=0;this.retryTimeout=null;this.startDateTimestamp=null;this.resetChatOnBrowserClose=gc7("RESET_CHAT_ON_BROWSER_CLOSE",false);this.onBeforeChatClosedFired=false;this.chatClosedFired=false;this.adblockOn=false;this.chatLaunchCounter=0;this.chatLaunchTimeoutIncrement=new TimeoutIncrement(this.REFRESH_NEW_EMBEDDED_CHAT_DELAY_INCREMENT,this.MAX_REFRESH_NEW_EMBEDDED_CHAT_DELAY)}GR34.CHM=null;GR34.persistentTarget="_inqPersistentChat";GR34.prototype.getInstance=GR34.getInstance=function(data){if(inu1(GR34.CHM))GR34.CHM=new GR34("CHM",data);return GR34.CHM};GR34.prototype.getData=function(){if(isCEAPIPostChatSurveyMode())return{id:parent.CEAPI_POST_CHAT_SURVEY_DATA.engagementID};if(this.isChatInProgress())return MI8.clonize(this.getChat().getChatData()).clone();return null};GR34.prototype.StopClosingChatFromPersistent=function(){if(this.retryTimeout!=null){clearTimeout(this.retryTimeout);this.retryTimeout=null}};GR34.prototype.getFPSessionID=function(){if(this.chat&&this.chat.cd)return this.chat.cd.fpID};GR34.prototype.getProtectionId=function(){if(CM47.chatSessionHelper.protectionId)return CM47.chatSessionHelper.protectionId;else{var cryptoObj=window.crypto||window.msCrypto;if(cryptoObj&&Uint32Array)return String(cryptoObj.getRandomValues(new Uint32Array(1))[0]);else{var browserFingerprint=(typeof window["FingerprintNuance"]!="undefined"?new FingerprintNuance({screen_resolution:true}).get():new Fingerprint({screen_resolution:true}).get())&1432354815;var randomPart=Math.floor(Math.random()*4095);randomPart=randomPart<<20&2862612480;return String(randomPart|browserFingerprint)}}};MI8.prepare(GR34).im13(MI8.FM2).im13(MI8.Observable).im13(MI8.XJA3).im13(MI8.Persistable).im13(MI8.RC54);GR34.prototype.log=function(msg){log("CHM: "+msg)};GR34.prototype.resetChatRequestsQueue=function(rule){if(this.chatRequestQ.length===0)this.chatRequestQ.push({rule:rule});this.drainRequestQ();this.requestInProgress=false};GR34.prototype.drainRequestQ=function(){for(var i=0;i<this.chatRequestQ.length;i++){var reqDat=this.chatRequestQ[i];var exposureData={siteID:Inq.getSiteID(),customerID:Inq.getCustID(),incrementalityID:asi4(),sessionID:getSessionID(),brID:reqDat.rule.id,group:PM.getVar("incGroup").z0(),businessUnitID:reqDat.rule.getBusinessUnitID(),result:"existing_offer",rule:reqDat.rule};BRM.fireExposureQualifiedEvent(exposureData)}this.chatRequestQ=[]};GR34.prototype.request=function(rule,chatType,xmlSpec,phoneNumber,c2cPersistent,idx,useNative,extChatJS,chatLaunchSource){var dat;var stackTrace;if(!rule&&this.chatRequestQ.length>0){dat=this.chatRequestQ.shift();rule=dat.rule;chatType=dat.chatType;xmlSpec=dat.xmlSpec;phoneNumber=dat.phoneNumber;c2cPersistent=dat.c2cPersistent;idx=dat.idx;this.log("De-queued data for "+rule)}if(this.requestInProgress){this.chatRequestQ.push({rule:rule,chatType:chatType,xmlSpec:xmlSpec,phoneNumber:phoneNumber,c2cPersistent:c2cPersistent,idx:idx});this.log("CHAT REQUEST ALREADY IN PROGRESS... waiting "+rule.toString());return}this.requestInProgress=true;this.log("Requesting chat for rule: "+rule.toString());if(custIdRegenerationInProgress){needToLaunchChat=true;this.pendingChatLaunchArgs=arguments;return}var c2cToPersistent=c2cPersistent?c2cPersistent:isC2cPersistent();this.chatData={ruleID:rule.getID(),chatType:chatType,xmlSpec:xmlSpec,pn:phoneNumber,pC:false,ci:{},aMsgCnt:0,cMsgCnt:0,c2cToPersistent:c2cToPersistent,buID:-1,fpID:this.getProtectionId(),launchNative:useNative,extChatJS:extChatJS};if(this.isBlocked(chatType))return;this.rule=rule;if(!!phoneNumber)this.rule["phoneNumber"]=phoneNumber;this.xmlSpec=xmlSpec;var incGroup=PM.getVar("incGroup").z0();this.chatType=chatType;this.c2cIdx=idx;var data={p:this.isPersistentWindow(),siteID:siteID,pageID:LDM.getPageID(),custID:Inq.getCustID(),chatSpec:MM.mergeChatSpec(xmlSpec),chatType:chatType,pmor:this.pmor,rule:{id:rule.getID(),name:rule.getName(),priority:rule.getPriority(),qt:rule.q6t(),aAtts:rule.getAgentAttributes(),ruleAttributes:rule.getRuleAttributes(),phoneNumber:phoneNumber,buID:rule.getBusinessUnitID(),agID:rule.getAgentGroupID(),async:rule.asyncChat()},incAssignmentID:asi4(),sessionID:getSessionID(),incGroup:incGroup,adblockEnabled:this.isAdblockOn()};if(getPersistCustID())data.persistentCustomerID=FP.getPersistentCustomerID();if(getUserObject())data.user_object=getUserObject();if(getAuthUser())data.authenticatedUser=JSON.stringify(getAuthUser());if(this.isCallServiceType(chatType)&&this.getLastCallID())data.lastCallId=this.getLastCallID();if(rule.getUniquePublicAgentId())data.puaid=rule.getUniquePublicAgentId();if(!chatLaunchSource)stackTrace=(new Error).stack.substring(0,1e3);data.chatState={chatLaunchSource:chatLaunchSource?chatLaunchSource:stackTrace,isChatInProgress:this.isChatInProgress(),isCEAPIPostChatSurveyMode:isCEAPIPostChatSurveyMode(),isV3Active:this.isV3Active(),isV3Continue:this.isV3Continue()};this.fireChatRequested(this,data);var sData=MI8.JSON.stringify(data);try{this.callRemote(urls.requestChatLaunchURL,{d:sData})}catch(e){this.log(e.message)}};GR34.prototype.launchDelayedChat=function(){if(this.pendingChatLaunchArgs){this.requestInProgress=false;this.request.apply(this,this.pendingChatLaunchArgs);this.pendingChatLaunchArgs=null}};GR34.prototype.launchChatForNativePostChatSurvey=function(ruleID,xmlSpec,npcsData){try{if(!isCEAPIPostChatSurveyMode())throw"Native Post Chat Survey is not supported in the current inqLaunch mode.";this.chatType="POPUP";setCustID(npcsData.customerID,false);var chatData={id:npcsData.engagementID,ruleID:ruleID,chatType:"POPUP",xmlSpec:xmlSpec,pC:false,ci:{},aid:npcsData.agentID,c2cToPersistent:false};this.chat=Chat.unmarshal(chatData).load();this.chat.show();this.chat.cd.agtAttrs=attributesStringToMap(npcsData.agentAttributes);this.chat.agentID=npcsData.agentID}catch(e){lmt12("Failure to Launch Chat for Post Chat Survey: "+cf21(e),LOG_LEVELS.WARN);log("Error parsing Chat Data: \n"+e+"\n"+chatData)}};GR34.prototype.init=function(){if(this._init)return;this.vitalVar=new VER34(this.getID(),{},resources["vital"]);this.stateVar=new VER34(this.getID(),{},resources["state"]);this.sessionVar=new VER34(this.getID(),{},resources["session"]);this.asyncUnauthUserVar=PM.getVar("asyncUnauthUser");if(!this.asyncUnauthUserVar){this.asyncUnauthUserVar=new VER34("asyncUnauthUser",0,resources["session"],"auu");PM.addVar(this.asyncUnauthUserVar)}this.setUpResetChatOnBrowserClose();this._init=true;return this};GR34.prototype.setUpResetChatOnBrowserClose=function(){if(this.resetChatOnBrowserClose||this.isAsyncUnauthUser()){this.cip=PM.getVar("cip");if(!this.cip){this.cip=new VER34("cip",null,resources["bses"],"_bses",(function(o){return parseFloat(o)}));PM.addVar(this.cip)}}};GR34.prototype.getChatRouterURL=function(){if(one2ManyChat)return urls.one2ManyVanityDomain;else return initData["connectionHubDomain"]||urls.chatRouterVanityDomain};GR34.prototype.getPersistentID=function(){};GR34.prototype.agrtyer=function(){if(this.dataLoaded||isCEAPIPostChatSurveyMode())return;this.dataLoaded=true;this.init();this.load();this.preloadInqFramework();if(!isWebSDK)AL.preload();if(this.isPersistentWindow()){openerCall("stopClosingChatFromPersistent");openerCall("registerPersistentWindowInOpener",[parent],false);this.setPersistentWindowActive(true)}if(gc7(DEFERRED_START_OF_MANAGERS_KEY)&&isPersistentChatLaunchingLimited())this.restoreChat({isChatLaunched:false})};GR34.prototype.updateChatData=function(chatData){if(chatData&&Chat.isChatDataValid(chatData))if(this.chat)this.chat.updateChatData(chatData);else this.chat=Chat.unmarshal(chatData)};GR34.prototype.urtvd3=function(isPersistent,protoDomain,transferURL,needNewOpener){if(isPersistent){var myProtoDomain=window.location.protocol+"//"+window.location.hostname;if(myProtoDomain!=protoDomain){if(Inq.multiHost){var myHash=transferURL.split("#");myHash.shift();transferURL=myProtoDomain+window.location.pathname+"#"+myHash.join("#")}this.againPopoutChat(transferURL,true)}if(needNewOpener&&myProtoDomain==protoDomain)this.againPopoutChat(transferURL,false)}else this.setPersistentWindowActive(false)};GR34.prototype.onRemoteCallback=function(chatData){this.requestInProgress=false;try{this.log("Request callback for rule: "+this.rule.toString());if(this.isPersistentWindow())if(!this.getChat().isPersistent()){var fault=new Error("chatData incorrect");fault.name="Launch Error";fault.funcName="onRemoteCallback";lmt12("Failure to Launch: "+cf21(fault),LOG_LEVELS.INFO)}var incGroup=PM.getVar("incGroup").z0();this.pmor=chatData.pmor;this.startDateTimestamp=chatData.startDateTimestamp;if(chatData.uniqueAgentName)this.rule.setUniqueAgentName(chatData.uniqueAgentName);if(chatData.publicAgentId)this.rule.setPublicAgentId(chatData.publicAgentId);if(chatData.customerID&&chatData.customerID!=Inq.getCustID()){logInfoToTagServer("Changing current customerID to existing in activeChatroom "+chatData.customerID);setCustID(chatData.customerID,true)}if(this.chatType==this.CHAT_TYPES.POPUP||this.chatType==this.CHAT_TYPES.POPUP_CALL||this.chatType==this.CHAT_TYPES.EXTERNAL_POPUP_CHAT){var exposureData={siteID:Inq.getSiteID(),customerID:Inq.getCustID(),incrementalityID:asi4(),sessionID:getSessionID(),brID:this.rule.id,buID:this.rule.getBusinessUnitID(),agID:this.rule.getAgentGroupID(),pageID:inu1(LDM.getPageID())?-1:LDM.getPageID(),group:incGroup,businessUnitID:this.rule.getBusinessUnitID(),result:chatData.result,rule:this.rule};BRM.fireExposureQualifiedEvent(exposureData);BRM.logExposureResult(exposureData,this.chatType)}if(inu1(chatData.chatID)){if(chatData.serviceMissedEvent)BRM.fireServiceMissedEvent(this.rule,this.chatData.chatType);if(this.chatType==this.CHAT_TYPES.EXTERNAL_CHAT){var cb=C2CM.getC2C(this.c2cIdx).extJSlaunchCb;cb&&cb({state:"missed"},chatData)}else if(this.chatType==this.CHAT_TYPES.EXTERNAL_POPUP_CHAT)if(isWebSDK)FrameBridge.postMessageToBootStrap("PROACTIVE_CHAT_LAUNCH",{state:"missed"});else fireCustomEvent("externalPopup",{state:"missed"},this.rule);this.save();return}this.chatData["id"]=chatData.chatID;this.chatData["v3TO"]=chatData.v3TO;this.chatData["dcTO"]=chatData.dcTO;this.chatData["qt"]=chatData.qt;if(chatData.reconnect)this.chatData["rec"]=true;if(!inu1(chatData.agentID))this.chatData["aid"]=chatData.agentID;this.chat=Chat.unmarshal(this.chatData).load();var launchTime=new Date;if(this.isImagePosition){this.getChatData().getChatSpec().chatTheme.pos="CENTER";this.getChatData().getChatSpec().chatTheme.lx=0;this.getChatData().getChatSpec().chatTheme.ly=0}this.lastChat={id:this.getChatID(),chatType:this.chat.getChatType(),timestamp:launchTime,businessUnitID:this.rule.getBusinessUnitID(),brID:this.rule.id,agentGroupID:this.rule.getAgentGroupID(),agtAttrs:this.chat.agtAttrs};if(this.isCallServiceType(this.getChatType()))this.lastCallId=this.getChatID();if(this.getChatType()==this.CHAT_TYPES.POPUP)this.lpt=(new Date).getTime();var iDFV=getInitialDFV();if(iDFV)if(isWebSDK)window.Inq.datapass=iDFV.toString();else window.parent.Inq.datapass=iDFV.toString();this.chat.inHOP=chatData.inHOP;this.setDisconnectFlag(0);this.launchChat(this.chat);if(this.getChatType()==this.CHAT_TYPES.MONITOR)this.closeChat();this.save();if(this.getChatType()==this.CHAT_TYPES.EXTERNAL_CHAT||this.getChatType()==this.CHAT_TYPES.C2C||this.getChatType()==this.CHAT_TYPES.C2CALL||this.getChatType()==this.CHAT_TYPES.C2WEBRTC)BRM.fireServiceEngagedEvent({brID:this.rule.id});SVYM.setSurveyShown(0)}catch(e){lmt12("Failure to Launch: "+cf21(e),LOG_LEVELS.INFO);log("Error parsing Chat Data: \n"+e+"\n"+chatData);if(this.earlyPopout)try{this.earlyPopout.close()}catch(e){}else if(isWebSDK)FrameBridge.closePeristentWindow(this.c2cIdx)}finally{if(!chatData)C2CM.getC2C(this.c2cIdx).setClicked(false);if(this.chatRequestQ.length>0)if(this.isChatInProgress())this.resetChatRequestsQueue();else{var chatLaunchSource=this.getID()+"#onRemoteCallback";this.request(null,null,null,null,null,null,null,null,chatLaunchSource)}}};GR34.prototype.reinitializeChatWithNewId=function(response){var jsonResponse=typeof response=="string"?JSON.parse(response):response;var chatId=jsonResponse.data["chatID"];this.chat.cd.id=chatId;this.chat.setAgentConfig(null,null,null,null);this.chat.cd.closed=0;this.chat.cd.rec=false;this.lastChat.id=chatId;log("Chat ID has been regenerated to "+chatId);this.setDisconnectFlag(0);var surveyData=SVYM.eventData;this.launchChat(this.chat,true,true);this.save();if(surveyData)SVYM.setEventDataForSurvey(surveyData)};GR34.prototype.requestChatId=function(){var data={siteID:Inq.getSiteID()};ROM.post(urls.getNewChatIdUrl,data,null,false,this.reinitializeChatWithNewId.bind(this))};GR34.prototype.resetStateAfterPersistentChat=function(){if(this.isPersistentChat()&&!this.isPersistentChatActive())this.removeChatInstance()};GR34.prototype.setDisconnectFlag=function(value,reason){var disconnectVar=PM.getVar("disconnect");if(!disconnectVar){disconnectVar=new VER34("disconnect",0,resources["state"],"_dcnt",(function(o){return parseInt(o)}));disconnectVar.init();disconnectVar.z3(value);PM.addVar(disconnectVar)}else disconnectVar.z3(value);if(value===1&&!inu1(reason))lmt12(plc1(reason),LOG_LEVELS.INFO)};GR34.prototype.onPageLanding=function(evt){if(!this.isChatInProgress())setCustID(CONVM.getInitialCustomerID(),true);this.restoreChat(evt)};GR34.prototype.restoreChat=function(evt){try{if(evt.isChatLaunched||!!evt.reinitialized&&this.isChatInProgress())return;if(this.isChatClosed()){this.removeChatInstance("Chat already closed");if(this.isPersistentChat()||this.isPersistentWindow())window.parent.close();return}var chatNotContinueLog="There is chat interface opened in other tabs, no c2c available or proactive will be displayed ";if(this.isPersistentChat()||this.isPersistentWindow())this.testForPersistentChat();else if(typeof NuanIJSFBridge!="undefined")if(NuanIJSFBridge.getChatProgressState())if(this.chat){this.chat.chatMgr=this;this.chat.monitorChatActive()}else{this.chatType="POPUP";var chatData={chatType:"POPUP",pC:false,ci:{},c2cToPersistent:false};this.chat=Chat.unmarshal(chatData);this.chat.monitorChatActive();setTimeout((function(){CHM.assignAgent("tmp_agent_name",true,false,{},"","")}),100)}else this.removeChatInstance("Native SDK chat isn't in progress");else if(getIOSNativeSDKInstance())if(isChatProgressInSDK)if(this.chat){this.chat.chatMgr=this;this.chat.monitorChatActive()}else{this.chatType="POPUP";var chatData={chatType:"POPUP",pC:false,ci:{},c2cToPersistent:false};this.chat=Chat.unmarshal(chatData);this.chat.monitorChatActive();setTimeout((function(){CHM.assignAgent("tmp_agent_name",true,false,{},"","")}),100)}else this.removeChatInstance("IOS Native SDK chat isn't in progress");else if(this.isV3Continue()){var chatInterfaceData=this.getChatInterfaceData();var isEngaged=chatInterfaceData.eng;if(this.getChat().isSecureWithCustToken()&&!isEngaged){this.removeChatInstance("Remove chat because secureWithCustToken is true,"+" but chat wasn't engaged before page reload");return}if(this.isResetChatRequiredOnBrowserClose()){this.setDisconnectFlag(1,CHM.chatCloseReason.TIMEOUT);this.removeChatInstance("".concat(CHM.chatCloseReason.RESET,": resetChatOnBrowserClose"))}else if(CM47.chatSessionHelper.isContinueChat==false&&(this.isEngagedChatTimedOut()||this.isNotEngagedChatTimedOut()||this.isMissingChatTimeoutCookies())){this.setDisconnectFlag(1,CHM.chatCloseReason.TIMEOUT);this.removeChatInstance("Chat has timed out")}else if(!this.isV3Active()&&!this.isPersistentChatActive())if(v3Lander.isBupMode&&inu1(this.getChat().getRule()))v3Lander.loadMbuDataForBU(this.getChat().getChatData().buID,(function(ruleData){CHM.continueChatting(ruleData)}));else this.continueChatting();else if(getOSType()==="iOS"||getOSType()==="Android")this.continueChatting();else if(this.isMultiChatSupported()&&MM.embeddedTheme.isValid)this.continueChatting();else if(isWebSDK){C2CM.removeListener("onC2CReadyForSDK");log(chatNotContinueLog)}}else if(this.isV3Active())log(chatNotContinueLog);else this.removeChatInstance("Ended chat was closed")}catch(e){lmt12("CHM failure on onPageLanding: "+cf21(e),LOG_LEVELS.ERROR)}};GR34.prototype.isEngagedChatTimedOut=function(){return!!this.getChat()&&this.getChat().isTimedOut()};GR34.prototype.isNotEngagedChatTimedOut=function(){var chatInterfaceData=this.getChatInterfaceData();var isEngaged=chatInterfaceData.eng;var initialTimeOut=chatInterfaceData.it||DEFAULT_INITIAL_TIMEOUT;var chatWindowAppeared=chatInterfaceData.cwa;var isChatShowTimedOut=Date.now()-chatWindowAppeared>initialTimeOut*1e3;return isChatShowTimedOut&&!isEngaged&&!this.isAsyncUnauthUser()};GR34.prototype.isMissingChatTimeoutCookies=function(){try{const chatWindowAppeared=this.getChatInterfaceData().cwa;const lastTouched=this.getChatInterfaceData().lt;const lastTouchedCrossDomain=CM.cookies["inqLT"];return chatWindowAppeared===void 0&&lastTouched===void 0&&lastTouchedCrossDomain===void 0}catch(error){lmt12("restoreChat: isMissingChatTimeoutCookies: "+cf21(error),LOG_LEVELS.WARN);return false}};GR34.prototype.isResetChatRequiredOnBrowserClose=function(){return(this.resetChatOnBrowserClose||this.isAsyncUnauthUser())&&inu1(this.cip.z0())};GR34.prototype.start=function(){if(this.started)return;this.started=true};GR34.prototype.load=function(){var stateData={};var sessionData={};function fixBlockedServicesData(){var blocked={};var sessionServices=sessionData["blocked"];if(!!sessionServices)for(var service in sessionServices)blocked[service]=sessionServices[service];var stateServices=stateData["blocked"];if(!!stateServices)for(var service in stateServices)blocked[service]=stateServices[service];return blocked}this.absorb(this.vitalVar.z0());this.absorb(this.stateVar.z0());this.absorb(this.sessionVar.z0());try{this.chat=Chat.unmarshal().load();if(!inu1(this.chat))lmt12("Chat instance was restored from cookies "+this.chat,LOG_LEVELS.INFO,null,true)}catch(e){this.chat=null;log(e)}if(!!this.chat)this.rule=this.chat.getRule();if(!!this.blocked){stateData=this.stateVar.z0();sessionData=this.sessionVar.z0();this.blocked=fixBlockedServicesData()}if(this.getLastChat()&&this.getLastChat().svyPrms)MI8.mixAbsorber(this.getLastChat().svyPrms);return this};GR34.prototype.save=function(callback){var stateData={};var sessionData={pmor:this.pmor,cb:this.cb};function prepareBlockedServicesData(services){for(var service in services)if(services[service]==0){if(!sessionData.blocked)sessionData.blocked={};sessionData.blocked[service]=services[service]}else if(services[service]==-2);else{if(!stateData.blocked)stateData.blocked={};stateData.blocked[service]=services[service]}}if(this.chat!=null){this.chat.save();sessionData.chat={id:this.getChatID(),ruleID:this.rule?this.rule.getID():this.chat.getRuleId(),aid:this.chat.getAgentID(),pC:this.chat.isPersistent()}}var vitalData={lpt:this.lpt,lastChat:this.lastChat,lastCallId:this.lastCallId};if(!!this.blocked)prepareBlockedServicesData(this.blocked);try{this.vitalVar.z3(vitalData)}catch(e){log("GR34.save vitalData: "+e,LOG_LEVELS.ERROR)}try{this.stateVar.z3(stateData)}catch(e){log("GR34.save stateData: "+e,LOG_LEVELS.ERROR)}try{this.sessionVar.z3(sessionData,callback)}catch(e){log("GR34.save sessionData: "+e,LOG_LEVELS.ERROR)}};GR34.prototype.isListener=function(l){if(l&&(l.onChatRequested||l.onChatLaunched||l.onChatShown||l.onChatClosed||l.onPersistentPush||l.onAgentMsg||l.onCustomerMsg||l.onAgentAssigned||l.onChatEngagedEvent||l.onChatEvent||l.onBeforeChatClosed||l.onAgentDataPass||l.onReceiveVADataPass||l.onChatroomReady||l.onQueueWaitMsg||l.onTranscriptReceived||l.onFrameworkReady||l.onConversationResolved))return true;return false};GR34.prototype.cloneChatInterfaceData=function(srcobj){if(srcobj==null||typeof srcobj!="object")return srcobj;var newobj=new srcobj.constructor;for(var key in srcobj)newobj[key]=this.cloneChatInterfaceData(srcobj[key]);return newobj};GR34.prototype.getChatInterfaceData=function(){return!!this.chat?this.chat.getCiData():{}};GR34.prototype.setChatInterfaceData=function(data){if(!this.chat)return;this.chat.setCiData(data);this.save()};GR34.prototype.getCiAutomatons=function(){var ciData=this.getChatInterfaceData();return ciData&&ciData.aut?ciData.aut:{}};GR34.prototype.setCiAutomatons=function(data){if(!this.chat)return;var ciData=this.chat.getCiData();ciData.aut=data;this.setChatInterfaceData(ciData)};GR34.prototype.wecv56=function(cT){var winTest=null;var url="",target=GR34.persistentTarget;var tools="toolbar=no,location=no,menubar=no,status=no,scrollbars=no"+",top="+cT.py+",left="+cT.px+",width="+cT.pw+",height="+cT.ph+",resizable=1";try{winTest=top.open(url,target,tools)}catch(e1){winTest=null}try{if(null!=winTest&&getOSType()==="iOS"&&window.focus)top.focus()}catch(e2){}this.earlyPopout=winTest};GR34.prototype.engagePersistentChat=function(xfr){var url=this.getChatRouterURL()+urls.isPersistentActive;var id=generateRequestId("isPersistentActive");var myProtoDomain=window.location.protocol+"//"+window.location.hostname;var callback=function(data){if(data.responseStatus!==200){if(this.getChat()&&!this.isAsyncChat())this.removeChatInstance("Persistent chat wasn't found on server")}else FP.whenIsPersistent(data)}.bind(CHM);var postData={engagementID:this.getChatID(),pd:myProtoDomain,xfr:xfr?xfr:false,customerID:Inq.getCustID(),siteID:getSiteID()};ROM.sendToChatrouter(url,postData,id,callback)};GR34.prototype.__againGetPersistentWindow=function(){var winTest=null;var tools="toolbar=no,location=no,menubar=no,status=no,scrollbars=no"+",top="+"-500"+",left="+"-500"+",width="+"0"+",height="+"0";try{winTest=win.open("",GR34.persistentTarget,tools);if(winTest!=null){var loc="err";try{loc=winTest.location.href}catch(e){loc="err"}if("about:blank"==loc||loc!="err"&&(!winTest.document||!winTest.document.body||""==winTest.document.body.innerHTML)){winTest.close();winTest=null}if(winTest==top||winTest==self)return null}}catch(e){}return winTest};GR34.prototype.againPopoutChat=function(transferURL){var url,target;var port=window.parent.document.location.port==""?"":":"+window.parent.document.location.port;url=Inq.v3framesrc.indexOf("/")==0?window.parent.document.location.protocol+"//"+window.parent.document.location.hostname+port+Inq.v3framesrc:Inq.v3framesrc;var ix=transferURL.indexOf("#");if(ix>=0)url=transferURL.substr(0,ix);else url=transferURL;if(""==url){log("GR34.prototype.againPopoutChat: ERROR: popup url is empty");return false}target=GR34.persistentTarget;var tools="toolbar=no,location=no,menubar=no,status=no,scrollbars=no"+",top="+"-500"+",left="+"-500"+",width="+"0"+",height="+"0";var winTest=this.__againGetPersistentWindow();if(winTest){try{winTest=window.parent.open(url,target,tools)}catch(e){winTest=Inq.win.open(url,target,tools)}if(!winTest)log("pop up blocker")}this.persistentWindow=winTest;if(winTest&&typeof winTest.focus=="function"){winTest.focus();return true}else return false};GR34.prototype.getPersistentChatSetting=function(){var pcVar=this.getPCVar(""+this.isPersistentWindow());return pcVar.z0()=="true"};GR34.prototype.setPersistentChatSetting=function(pc){pc=""+pc;var pcVar=this.getPCVar(pc);pcVar.z3(pc)};GR34.prototype.getPCVar=function(pc){var pcVar=PM.getVar("pc");if(inu1(pcVar)){pcVar=new VER34("pc",pc,resources["session"]);pcVar.init();PM.addVar(pcVar)}return pcVar};GR34.prototype.setPersistentWindowActive=function(status){if(!inu1(status))try{if(this.getChat())this.getChat().setPersistent(status);if(this.isPersistentWindow()){this.save();openerCall("setPersistentWindowActive",[status],true)}}catch(e){lmt12("Failure on setPersistentWindowActive: "+cf21(e),LOG_LEVELS.INFO)}};GR34.prototype.isPersistentChatActive=function(){return this.isPersistentChat()};GR34.prototype.isPersistentChat=function(){return this.getChat()&&this.getChat().isPersistent()};GR34.prototype.r11bv=function(){if(isPersistentWindow())return true;var toolsForTest="toolbar=no,location=no,menubar=no,status=no,scrollbars=no"+",top="+"-500"+",left="+"-500"+",width="+"0"+",height="+"0";try{if(this.popoutWindow&&this.popoutWindow.closed){this.popoutWindow=null;return null}if(!this.chat.popoutWindow)return null;if(this.earlyPopout)return null;if(isWebSDK)return null;var winTest=win.open("",GR34.persistentTarget,toolsForTest);if(winTest!=null){if("about:blank"==winTest.location.href||!winTest.document||!winTest.document.body||""===winTest.document.body.innerHTML){winTest.close();winTest=null}if(winTest==top||winTest==self)winTest=null}this.popoutWindow=winTest}catch(e){winTest=null}return winTest};GR34.prototype.testForPersistentChat=function(){if(this.isPersistentWindow()){this.testForContinueChatting();var isPersistentInitialization=false;if(FP.isInitializationRequired()==true){isPersistentInitialization=true;FP.resetInitializationFlag()}if(isPersistentInitialization)this.chat.transitionMessage(this.PERSISTENT.PERSISTENT_COMPLETE)}else if(this.isPersistentChat()&&!this.isEngagedChatTimedOut()&&this.isChatInProgress()&&!this.isResetChatRequiredOnBrowserClose())this.engagePersistentChat(false);else this.removeChatInstance("Persistent chat was closed")};GR34.prototype.testForContinueChatting=function(){var windowRef=isWebSDK?window:window.parent;if(this.isV3Continue())this.continueChatting();else{var chat=this.getChat();if(!chat)lmt12("Failure to Launch: persistent chat, missing Chat Object",LOG_LEVELS.INFO,(function(){windowRef.close()}),true);else if(chat.isClosed()){this.closeChat();windowRef.close()}else{var cd=MI8.JSON.clone(chat.cd);this.chat=Chat.unmarshal(cd).load();this.chat.show()}}};GR34.prototype.continueChatting=function(optRuleData){if(!inu1(optRuleData)){for(var idx=0;idx<optRuleData.rules.length;idx++){var rule=optRuleData.rules[idx];if(rule.getID()==this.getLastChat().brID){this.getChat().rule=rule;break}}if(inu1(this.getChat().getRule())){let12("Rule for BU not found. Chat lost.",true);throw"Rule for BU not found. Chat lost."}}this.chat.chatMgr=this;this.chat.show()};GR34.prototype.nnm89=function(chatID){if(inu1(chatID))chatID=this.getChatID();if(chatID!=="0"){var url=this.getChatRouterURL()+urls.exitChatURL;var data={engagementID:chatID,customerID:Inq.getCustID()};var id=generateRequestId("exitChat");ROM.sendToChatrouter(url,data,id,SVYM.fireNativeSurveyLaunchEvent)}};GR34.prototype.passNamedDataToAgent=function(name,value){var data=MI8.unmixMutatable(MI8.mixMutatable(MI8.mixAbsorber(MI8.mixMutatable()).absorb(isWebSDK?inqData:s7("inqData"))).set("agentID",this.getAgentID()).set("engagementID",this.getChatID()).set(name,value));ROM.sendDataToAgent(this.getAgentID(),data)};GR34.prototype.r345jjm=function(isConnected,conversationResolved){try{if(!isMobileDevice()||this._closeRetries++<20){var pw=this.persistentWindow;if(pw!=null&&!pw.closed){this.retryTimeout=setTimeout((function(){CHM.r345jjm(isConnected,conversationResolved)}),50);return}}else this._closeRetries=0}catch(e){log("Error in GR34.r345jjm: "+e)}clearTimeout(this.retryTimeout);this.retryTimeout=null;if(CM.persistentWindow)CM.persistentWindow=null;var isAsync=this.isAsyncChat();if(isAsync)this.updateConversationActiveFlagOnChatClose(conversationResolved);if(isWebSDK)window.Inq.datapass=null;else if(window.parent.Inq.datapass)window.parent.Inq.datapass=null;if(isConnected)this.nnm89();this.fireChatClosed();this.setPersistentWindowActive(false);this.removeChatInstance("GR34#r345jjm closing chat");if(isAsync)C2CM.relaunchC2cRules()};GR34.prototype.setSurveyAuxParams=function(params){if(this.getLastChat()){var svyPrms=this.getLastChat().svyPrms;if(!svyPrms)svyPrms=this.getLastChat().svyPrms=MI8.mixAbsorber({});svyPrms.absorb(params);this.save()}else log("Warning: setting survey params failed - last chat data object doesn't exist.")};GR34.prototype.getSurveyAuxParams=function(){if(this.getLastChat())return this.getLastChat().svyPrms;else return null};GR34.prototype.setClickStreamSent=function(isSent){if(this.getLastChat()){this.getLastChat().clkstr=isSent;this.save()}else log("Warning: setting ClickStreamSent flag failed - last chat data object doesn't exist.")};GR34.prototype.isClickStreamSent=function(){if(this.getLastChat())return this.getLastChat().clkstr;else return null};GR34.prototype.closePersistent=function(isConnected,conversationResolved){openerCall("CloseChatFromPersistent",[isConnected,conversationResolved],false)};GR34.prototype.inactivateChat=function(){if(this.chat==null)return;this.chat.setVisible(false);FP.closeChatInterface()};GR34.prototype.removeChatInstance=function(reason){if(this.getChat()){lmt12("Chat instance will be removed. Reason '"+reason+"'",LOG_LEVELS.INFO,null,true);this.chat.close();this.chat=null}this.save();setCustID(CONVM.getInitialCustomerID(),true);this.resetAsyncUnauthUser()};GR34.prototype.closeChat=function(isConnected){if(getFormInIOSSDKInstance())getFormInIOSSDKInstance().postMessage("hideSurvey");if(typeof SDKPushFormInterface!="undefined")SDKPushFormInterface.closeForm();if(isCEAPIPostChatSurveyMode()){if(typeof SDKPostSurveyInterface!="undefined")SDKPostSurveyInterface.closeChat();else if(getPostSurveyInIOSSDKInstance())getPostSurveyInIOSSDKInstance().postMessage("closeChat");return false}var isAsync=this.isAsyncChat();if(isAsync)this.updateConversationActiveFlagOnChatClose(SVYM.isConversationResolvedOrEmtpyStatus());if(this.isPersistentWindow())this.closePersistent(isConnected,SVYM.isConversationResolvedOrEmtpyStatus());else if(this.getChat()){if(!this.getChat().isPersistent())this.fireChatClosed();this.removeChatInstance("GR34#closeChat closing chat. Stack: "+(new Error).stack);if(isAsync)C2CM.relaunchC2cRules()}if(isWebSDK)window.Inq.datapass=null;else if(window.parent.Inq.datapass)window.parent.Inq.datapass=null};GR34.prototype.reset=function(){this.onBeforeChatClosedFired=false;this.chatClosedFired=false};GR34.prototype.updateConversationActiveFlagOnChatClose=function(isResolved){var notResolvedOrClosedByCustomer=!isResolved||!this.getChat().isAgentClosedChat();var conversationActiveOrAsyncChatWasEngaged=getConversationActive()||this.getChat()&&this.getChat().getCustMsgCnt()>0;var isActive=notResolvedOrClosedByCustomer&&conversationActiveOrAsyncChatWasEngaged;setConversationActive(isActive)};GR34.prototype.closeChatMonitor=function(){this.chat.closeChatMonitor()};GR34.prototype.endChatSession=function(chatID){if(this.getChatID()===chatID)this.chat.endChatSession()};GR34.prototype._assertChatInProgress=function(_inProgress){if(this.chat==null){if(_inProgress)throw Error("Chat "+(_inProgress?"not ":"")+"in progress")}else if(this.chat.isVisible()||this.isPersistentChat())if(!_inProgress)throw Error("Chat "+(_inProgress?"not ":"")+"in progress")};GR34.prototype.setOpacity=function(opac){if(this.chat)this.chat.setOpacity(opac)};GR34.prototype.showPersistentButton=function(x,y,w,h){this.chat.pb.setPosition(x,y,w,h);this.chat.pb.setVisible(true)};GR34.prototype.showTextInput=function(bShow,y,x,w,h){var o,offsetY;offsetY=this.chat.chatSpec.chatTheme.tbh;o=getParentPageElById("inqInput4Chat",win.document);if(o){o.style.display=bShow?"":"none";o.style.top=y+offsetY+"px";o.style.left=x+"px";o.style.width=w+"px";o.style.height=h+"px"}};GR34.prototype.hidePersistentButton=function(){this.chat.pb.setVisible(false)};GR34.prototype.setPersistentButtonDebugActive=function(active){this.chat.pb.setDebugActive(active)};GR34.prototype._resetChat=function(){this._assertChatInProgress(true);win.document.body.removeChild(this.chat.container);this.thankYouShown=!this.displayTYImage;this.removeChatInstance()};GR34.prototype.setChatVisible=function(_vis){this.chat.setVisible(_vis)};GR34.prototype.launchChat=function(chat,chatInProgress,reInitialize){try{this._assertChatInProgress(!!chatInProgress);if(this.chat!=chat){this.chat=chat;lmt12("Chat instance was changed to "+this.chat,LOG_LEVELS.INFO,null,true)}if(!(this.getChatType()==this.CHAT_TYPES.MONITOR)){var isCIV2Enabled=this.chat.isCIV2Skin()||isWebSDK;if(reInitialize&&isCIV2Enabled&&typeof Application!="undefined")this.chat.initAppliation();else{const asyncChatRule=this.chat.isAsyncChatRule();this.chat.setAsyncChat(asyncChatRule);this.chat.show()}}if(this.resetChatOnBrowserClose)this.cip.z3(1);this.fireChatLaunched(this.chat.getChatData());if(this.getChatType()==GR34.CHM.CHAT_TYPES.POPUP||this.getChatType()==GR34.CHM.CHAT_TYPES.POPUP_CALL||this.getChatType()==GR34.CHM.CHAT_TYPES.EXTERNAL_POPUP_CHAT)BRM.fireServiceInvitationEvent(this.chat.getRule(),this.getChatType())}catch(e){lmt12("Failure to Launch: "+cf21(e),LOG_LEVELS.INFO)}};GR34.prototype.getAgentID=function(){return this.chat?this.chat.getAgentID():null};GR34.prototype.getAgentName=function(){return this.chat?this.chat.getAgentName():null};GR34.prototype.getAgentAttributeValue=function(attrName){return this.chat?this.chat.getAgentAttributeValue(attrName):""};GR34.prototype.getAgentAttributesAsString=function(){return this.getChat()&&this.getChat().getChatData()?attributeMapToString(this.getChat().getChatData().agtAttrs):""};GR34.prototype.addAgentAttributesToEvent=function(evt){var attrList=PM.getVar("eventAgentAttributeList");if(attrList){var list=attrList.z0().split(",");for(var i=0,name;i<list.length;i++){name=list[i].trim();if(name!="")evt[name]=this.getAgentAttributeValue(name)}}};GR34.prototype.getCustomerName=function(){return this.chat?this.chat.getCustomerName():null};GR34.prototype.getWindowId=function(){return this.chat?this.chat.getWindowId():null};GR34.prototype.isPersistentWindow=function(){return isPersistentWindow()};GR34.prototype.getChat=function(){return this.chat||null};GR34.prototype.getBusinessUnitID=function(evt,rule){if(this.chat&&this.chat.getChatBusinessUnitID()>0)return this.chat.getChatBusinessUnitID();else if(this.chat&&this.chat.getBusinessUnitID())return this.chat.getBusinessUnitID();else if(evt&&evt.rule&&typeof evt.rule.getBusinessUnitID=="function")return evt.rule.getBusinessUnitID();else if(this.lastChat&&this.lastChat.businessUnitID)return this.lastChat.businessUnitID;else if(rule)return rule.getBusinessUnitID();return getDefaultBusinessUnitID()};GR34.prototype.getLastChat=function(){return this.lastChat?this.lastChat:null};GR34.prototype.getEmailSpecId=function(){var emailSpecId=0;var chat=this.getChat();if(!!chat)emailSpecId=chat.chatSpec.emSpId;return emailSpecId};GR34.prototype.getChatID=function(){var id="0";if(!!this.chat)try{id=this.chat.getChatID()}catch(e){}return id};GR34.prototype.updateChat=function(chatID,asyncReconnect){if(this.chat){this.chat.setChatID(chatID);this.chat.setAsyncReconnect(asyncReconnect);this.save()}};GR34.prototype.getLastChatID=function(){var id="0";if(!!this.lastChat&&!!this.lastChat.id)id=this.lastChat.id;return id};GR34.prototype.getLastAgentID=function(){var agentId="";if(!!this.lastChat&&!!this.lastChat.agentID)agentId=this.lastChat.agentID;return agentId};GR34.prototype.getLastAgentAttributesAsString=function(){var attr="";if(!!this.lastChat&&!!this.lastChat.agtAttrs)attr=attributeMapToString(this.lastChat.agtAttrs);return attr};GR34.prototype.getChatOrLastChatAgentAttributesString=function(){return this.getChat()&&this.getChat().getChatData()?this.getAgentAttributesAsString():this.getLastAgentAttributesAsString()};GR34.prototype.getLastCallID=function(){return this.lastCallId};GR34.prototype.getChatType=function(){return this.chat?this.chat.getChatType():null};GR34.prototype.getLastChatType=function(){return this.lastChat?this.lastChat.chatType:null};GR34.prototype.tryue=function(serviceType,period){if(serviceType!=GR34.CHM.CHAT_TYPES.POPUP&&serviceType!=GR34.CHM.CHAT_TYPES.POPUP_CALL)return;if(inu1(this.blocked))this.blocked={};if(inu1(this.blocked[serviceType])||!inu1(this.blocked[serviceType])&&this.blocked[serviceType]<(new Date).getTime()){if(period>0){var now=new Date;period+=now.getTime()}this.blocked[serviceType]=period;this.save()}};GR34.prototype.unblockService=function(serviceType){if(serviceType!=GR34.CHM.CHAT_TYPES.POPUP&&serviceType!=GR34.CHM.CHAT_TYPES.POPUP_CALL)return;if(!inu1(this.blocked)&&!inu1(this.blocked[serviceType]))delete this.blocked[serviceType];this.save()};GR34.prototype.setCobrowseFlag=function(flag){var val=flag?1:0;if(this.cb!=val){this.cb=val;this.save()}};GR34.prototype.getCobrowseFlag=function(){return!!this.cb?true:false};GR34.prototype.isBlocked=function(serviceType){var blockedValue=false;if(!inu1(this.blocked)&&!inu1(this.blocked[serviceType])){var now=new Date;var toDate=this.blocked[serviceType];if(toDate<=0)blockedValue=true;else blockedValue=toDate>=now.getTime()}return blockedValue};GR34.prototype.isAnyBlocked=function(){if(inu1(this.blocked))return false;return Object.keys(this.blocked).length>0};GR34.prototype.isProactiveExpired=function(){if(!this.lpt)return false;var expireTime=new Date(this.lpt).getTime()+Inq.rechatInterval*24*60*60*1e3;var now=(new Date).getTime();return now>expireTime};GR34.prototype.popOutChat=function(transition){if(!this.isPersistentChatActive())this._firePersistentPushEvt({});if(CM.xd){if(transition)this.chat.transitionMessage(this.PERSISTENT.PERSISTENT);CM.dump();if((null==this.earlyPopout||this.earlyPopout.closed)&&!isWebSDK)this.wecv56(this.chat.chatSpec.chatTheme);CM.setWhen3rdPartyCookieCommittedHandler((function(){inqFrame.Inq.CHM.relocateToHostedPage(5)}));return true}else{if(isMobileDevice())inqFrame.Inq.FlashPeer.closePopupChat();return this.chat.popOutChat(transition)}};GR34.prototype.relocateToHostedPage=function(retryCnt){try{if(isWebSDK)FrameBridge.pushPersistentWindowURL(Inq.v3framesrc,this.c2cIdx,this.chat.chatSpec.chatTheme);else{this.popoutWindow=this.earlyPopout;this.popoutWindow.location.href=Inq.v3framesrc;if(getOSType()==="iOS"&&this.popoutWindow.focus)try{this.popoutWindow.focus()}catch(errFocus){}this.earlyPopout=null}window.Inq.isPersistentInitialization=true}catch(err){err["this"]=this;err["popoutWindow"]=this.popoutWindow?this.popoutWindow:"undefined";err["earlyPopout"]=this.earlyPopout?this.earlyPopout:"undefined";err["popoutWindow_location"]=this.popoutWindow.location?this.popoutWindow.location:"undefined";if(retryCnt==0)err["PersistentFailure"]="Persistent Popout failed, all retries exhausted";lmt12("Failure to relocateToHostedPage("+retryCnt+"): "+cf21(err),LOG_LEVELS.INFO);if(retryCnt>0)setTimeout(function(){this.relocateToHostedPage(--retryCnt)}.bind(this),50);else{var wins=[this.earlyPopout,this.popoutWindow];while(wins.length){w=wins.shift();if(w)try{if(!w.closed)w.close()}catch(e){}}this.earlyPopout=this.popoutWindow=null}}};GR34.prototype.toString=function(){return"GR34: "+MI8.JSON.stringify(this)};GR34.prototype._addListener=function(_l,_lArr){if(!_l.id)_l.id=Math.random();_lArr.push(_l)};GR34.prototype.hasAlreadyChatted=function(chatData){if(!this.lastChat)return false;var lastChatTimeMS=new Date(this.lastChat.time).getTime();var nowMS=(new Date).getTime();var reChatTimeMS=lastChatTimeMS+Inq.rechatInterval*(24*60*60*1e3);return reChatTimeMS>=nowMS};GR34.prototype.clearAllChatListeners=function(){this._listeners=[]};GR34.prototype.assignAgent=function(aid,noSave,cobrowseEnabled,eventData,buID,agID){log("Agent Assigned: GR34.assignAgent("+aid+")");try{var agentAttrs;if(typeof eventData=="object")agentAttrs=eventData["agtAttrs"];var msg=plc1("Set agent config : agentID="+aid+",buID="+buID+",agID="+agID+",agentAttrs="+agentAttrs+". ");ROM.post(urls.loggingURL,{level:LOG_LEVELS.INFO,line:msg});this.chat.setAgentConfig(aid,buID,agID,agentAttrs);if(!noSave)this.save(this.assignAgentActions.bind(this,aid,cobrowseEnabled,eventData,buID,agID,noSave));else this.assignAgentActions(aid,cobrowseEnabled,eventData,buID,agID,noSave)}catch(er){log("FAILED ATTEMPT TO SET AGENT ID FROM FLASH: "+er,LOG_LEVELS.ERROR)}};GR34.prototype.assignAgentActions=function(aid,cobrowseEnabled,eventData,buID,agID,noSave){this.fireAgentAssigned(aid,cobrowseEnabled,eventData,buID,agID,!noSave);if(this.isPersistentWindow()&&Inq.isSameOrigin()){if(typeof eventData=="object")eventData=MI8.JSON.stringify(eventData);openerCall("assignAgent",[aid,true,cobrowseEnabled,eventData,buID,agID],true)}};GR34.prototype.getAgentGroupNameByID=function(agID){var agName;if(!inu1(agID)&&site.siteAgentGroups.hasOwnProperty(agID))agName=site.siteAgentGroups[agID];return agName};GR34.prototype.getAgentGroupDisplayNameByID=function(agID){var agDisplayName;if(!inu1(agID)&&site.siteAgentGroupsDisplayNames.hasOwnProperty(agID))agDisplayName=site.siteAgentGroupsDisplayNames[agID];return agDisplayName};GR34.prototype.getBusinessUnitNameByID=function(buID){var buName;if(!inu1(buID)&&site.siteBusinessUnitsNames.hasOwnProperty(buID))buName=site.siteBusinessUnitsNames[buID];return buName};GR34.prototype.getBusinessUnitDisplayNameByID=function(buID){var buDispName;if(!inu1(buID)&&site.siteBusinessUnitsDisplayNames.hasOwnProperty(buID))buDispName=site.siteBusinessUnitsDisplayNames[buID];return buDispName};GR34.prototype.isChatClosed=function(){if(this.getChat())return this.getChat().isClosed();else return false};GR34.prototype.isV3Continue=function(){var ciData=this.getChatInterfaceData();return ciData?ciData.c==1:false};GR34.prototype.isV3Active=function(){if(CM.xd)try{var activeFlag=CM.getV3ActiveValue();var activeCount;if(activeFlag==null)return false;if(isNaN(activeCount=parseInt(activeFlag)))return false;if(activeCount<=0)return false;return true}catch(e){log("Error detecting isV3Active:"+e);return false}else{var ciData=this.getChatInterfaceData();if(!!ciData)return ciData.a==true;return false}};GR34.prototype.isChatInProgress=function(){if(isCEAPIPostChatSurveyMode())return false;if(this.isV3Active()||CM47.chatSessionHelperIsChatInProgress())return true;if(this.isChatClosed())return false;else if(this.isPersistentChat())return this.isPersistentChatActive()&&(!CM.xd||this.isV3Active());else return this.isV3Continue()};GR34.prototype.isInlineChatInProgress=function(){return!!this.chat&&this.chat.isVisible()};GR34.prototype.isThankYouEnabled=function(){return this.thankYouEnabled};GR34.prototype.getChatData=function(){return this.getChat()};GR34.prototype.getLaunchPageId=function(){if(this.chat&&this.chat.getChatData())return this.chat.getChatData().launchPageId;else return""};GR34.prototype.onChatLaunched=function(evt){if(!CM.isPersistentCookiesAllowed()&&isIE()){var sesOnlyCookieMsg="Only Session Cookies are allowed for this chatID. "+this.getChatID();if(!JSLoggingDisabled){log(""+sesOnlyCookieMsg);lmt12(sesOnlyCookieMsg,LOG_LEVELS.INFO)}}};GR34.prototype._fireChatEvt=function(evt){this._fireEvt((function(l,evt){if(l.onChatEvent)l.onChatEvent(evt)}),evt)};GR34.prototype.fireAgentDataPassEvent=function(agentDataPass){if(inu1(this.chat)){let12("Error firing event onAgentDataPass: chat instance doesn't exist.",true);return}var event={customerID:getCustID(),chatID:this.getChatID(),agentDataPass:agentDataPass};this._fireEvt((function(l,event){try{if(typeof l.onAgentDataPass=="function")l.onAgentDataPass(event)}catch(e){let12("Error firing event onAgentDataPass on "+l.toString()+": \n"+cf21(e))}}),event);if(!this.isPersistentWindow()||!isIE())this.chat.save()};GR34.prototype.fireVADataPassEvent=function(vaDataPass){if(inu1(this.chat)){DMgr.let12("VA_DATA_PASS","Error firing event onReceiveVADataPass: chat instance doesn't exist.");return}this.chat.setVADataPass(vaDataPass);var event={vaDataPass:vaDataPass};this._fireEvt((function(l,event){try{if(typeof l.onReceiveVADataPass=="function"){DMgr.logDebugToTagServer("VA_DATA_PASS","Fires onReceiveVADataPass event");l.onReceiveVADataPass(event)}}catch(e){let12("Error firing event onReceiveVADataPass on "+l.toString()+". "+e,true)}}),event)};GR34.prototype.fireChatroomReadyEvent=function(evt){if(inu1(this.chat))return;var event={};this._fireEvt((function(l,event){try{if(typeof l.onChatroomReady=="function")l.onChatroomReady(event)}catch(e){log("Error firing event ChatroomReady on "+l.toString()+": \n"+e)}}),event)};GR34.prototype.fireAgentMsgEvent=function(evt){if(inu1(this.chat))return;this.chat.bumpAgtMsgCount();var event={customerID:Inq.getCustID(),chatID:this.getChatID(),custMsgCnt:this.chat.getCustMsgCnt(),agtMsgCnt:this.chat.getAgentMsgCnt(),textLine:evt.textLine};this._fireEvt((function(l,event){try{if(typeof l.onAgentMsg=="function")l.onAgentMsg(event);if(typeof l.onChatEvent=="function")l.onChatEvent(event)}catch(e){log("Error firing event onAgentMsg on "+l.toString()+": \n"+e)}}),event);if(!this.isPersistentWindow()||!isIE())this.chat.save()};GR34.prototype.fireCustomerMsgEvent=function(evt){if(inu1(this.chat))return;this.chat.bumpCustMsgCount();var event=MI8.mixAbsorber({customerID:Inq.getCustID(),chatID:this.getChatID(),custMsgCnt:this.chat.getCustMsgCnt(),agtMsgCnt:this.chat.getAgentMsgCnt(),textLine:evt.textLine.substring(0,50)});this._fireEvt((function(l,event){try{if(typeof l.onCustomerMsg=="function")l.onCustomerMsg(event);if(typeof l.onChatEvent=="function")l.onChatEvent(event)}catch(e){log("Error firing event onCustomerMsg on "+l.toString()+": \n"+e)}}),event);if(!this.isPersistentWindow()||!isIE())this.chat.save()};GR34.prototype.fireQueueWaitMsgEvent=function(){if(inu1(this.chat))return;var event=MI8.mixAbsorber({customerID:Inq.getCustID(),chatID:this.getChatID()});this._fireEvt((function(l,event){try{if(typeof l.onQueueWaitMsg=="function")l.onQueueWaitMsg(event)}catch(e){log("Error firing event onQueueWaitMsg on "+l.toString()+": \n"+e)}}),event)};GR34.prototype.fireChatRequested=function(src,evtData){var evt=MI8.mixAbsorber({});evt.absorb(evtData);evt.id=++this.evtIdx;evt.evtType=this.EVTS.REQUESTED;evt.timestamp=new Date;evt.src=src;this._fireEvt((function(l,evt){if(typeof l.onChatRequested=="function")l.onChatRequested(evt)}),evt)};GR34.prototype.fireTranscriptReceivedEvent=function(evtData){var evt=MI8.mixAbsorber({chatID:this.getChatID(),chatType:this.getChatType(),customerID:Inq.getCustID(),timestamp:(new Date).toString()});evt.absorb(evtData);this._fireEvt((function(l,evt){if(typeof l.onTranscriptReceived=="function")l.onTranscriptReceived(evt)}),evt)};GR34.prototype.fireFrameworkReadyEvent=function(evtData){var evt=MI8.mixAbsorber({timestamp:(new Date).toString()});evt.absorb(evtData);this._fireEvt((function(l,evt){if(typeof l.onFrameworkReady=="function")l.onFrameworkReady(evt)}),evt)};GR34.prototype.fireChatLaunched=function(chatData){if(chatData==null)chatData=this.chat.getChatData();var evt=MI8.mixAbsorber({id:++this.evtIdx,evtType:this.EVTS.LAUNCHED,src:this,chatID:chatData.id});evt.absorb(chatData).absorb({customerID:Inq.getCustID(),rule:this.rule});if(this.chat)evt.inHOP=this.chat.inHOP;var custEvt=MI8.mixAbsorber({customerID:Inq.getCustID(),chatID:chatData.id,evtType:this.EVTS.LAUNCHED,chatType:this.getChatType(),bizRuleName:this.rule.getName(),startDateTimestamp:this.startDateTimestamp});var buID=null;var agID=null;if(evt["buID"]){buID=evt["buID"];delete evt["buID"]}if(evt["agID"]){agID=evt["agID"];delete evt["agID"]}if(!(buID&&agID)||parseInt(buID)<=0||parseInt(agID)<=0){var rule=BRM.rb41(chatData.ruleID)?BRM.rb41(chatData.ruleID):this.rule;if(rule){buID=buID&&parseInt(buID)>0?buID:rule.getBusinessUnitID();agID=agID&&parseInt(agID)>0?agID:rule.getAgentGroupID()}}if(agID&&parseInt(agID)>0){custEvt.absorb({agentGroupID:agID});evt.absorb({agentGroupID:agID})}if(buID&&parseInt(buID)>0){custEvt.absorb({businessUnitID:buID});evt.absorb({businessUnitID:buID})}this._fireEvt((function(l,evt){var event=inu1(l.custApi)?evt:custEvt;try{if(typeof l.onChatLaunched=="function")l.onChatLaunched(event);if(typeof l.onChatEvent=="function")l.onChatEvent(event)}catch(e){log("Error firing event onChatLaunched on "+l.toString()+": \n"+e)}}),evt);if(this.isPersistentWindow())openerCall("fireChatLaunched",null,true)};GR34.prototype.fireChatShown=function(chatData){if(chatData==null)chatData=this.chat.getChatData();var evt=MI8.mixAbsorber({id:++this.evtIdx,evtType:this.EVTS.SHOWN,src:this,chatID:chatData.id});evt.absorb(chatData).absorb({customerID:Inq.getCustID(),rule:this.rule});if(this.chat)evt.inHOP=this.chat.inHOP;this._fireEvt((function(l,evt){try{if(typeof l.onChatShown=="function")l.onChatShown(evt);if(typeof l.onChatEvent=="function")l.onChatEvent(evt)}catch(e){log("Error firing event onChatShown on "+l.toString()+": \n"+e)}}),evt)};GR34.prototype.fireBeforeChatClosed=function(){if(!this.onBeforeChatClosedFired){this.onBeforeChatClosedFired=true;try{var chatData=this.chat.getChatData();var evt=MI8.mixAbsorber({id:++this.evtIdx,chatID:chatData.id,evtType:this.EVTS.BEFORE_CLOSED,timestamp:new Date,rule:this.rule,src:this});evt.absorb(chatData).absorb({customerID:Inq.getCustID(),agentID:this.getAgentID()});this._fireEvt((function(l,evt){try{if(typeof l.onBeforeChatClosed=="function")l.onBeforeChatClosed(evt);if(typeof l.onChatEvent=="function")l.onChatEvent(evt)}catch(e){log("Error firing event onBeforeChatClosed on "+l.toString()+": \n"+e)}}),evt)}catch(e){lmt12("Failure to fireBeforeChatClosed: "+cf21(e),LOG_LEVELS.INFO)}}};GR34.prototype.fireChatClosed=function(chatData){if(this.chatClosedFired)return;try{this.chatClosedFired=true;if(chatData==null)chatData=this.chat.getChatData();this.hasEngaged=false;var evt=MI8.mixAbsorber({id:++this.evtIdx,chatID:chatData.id,evtType:this.EVTS.CLOSED,timestamp:new Date,rule:this.rule,src:this});evt.absorb(chatData).absorb({customerID:Inq.getCustID(),agentID:this.getAgentID()});var buID=null;var agID=null;if(evt["buID"]){buID=evt["buID"];delete evt["buID"]}if(evt["agID"]){agID=evt["agID"];delete evt["agID"]}if(!(buID&&agID)||parseInt(buID)<=0||parseInt(agID)<=0){var rule=BRM.rb41(chatData.ruleID)?BRM.rb41(chatData.ruleID):this.rule;if(rule){buID=buID&&parseInt(buID)>0?buID:rule.getBusinessUnitID();agID=agID&&parseInt(agID)>0?agID:rule.getAgentGroupID()}}if(agID&&parseInt(agID)>0)evt.absorb({agentGroupID:agID});if(buID&&parseInt(buID)>0)evt.absorb({businessUnitID:buID});if(Date.now()-this.startDateTimestamp<this.MAX_REFRESH_NEW_EMBEDDED_CHAT_DELAY)this.chatLaunchCounter++;else{this.chatLaunchCounter=0;this.chatLaunchTimeoutIncrement.reset()}var custEvt={customerID:Inq.getCustID(),chatID:chatData.id,agentID:this.getAgentID(),bizRuleName:this.rule.getName(),businessUnitID:buID,agentGroupID:agID,evtType:this.EVTS.CLOSED,chatType:this.getChatType()};this._fireEvt((function(l,evt){var event=inu1(l.custApi)?evt:custEvt;try{if(typeof l.onChatClosed=="function")l.onChatClosed(event);if(typeof l.onChatEvent=="function")l.onChatEvent(event)}catch(e){log("Error firing event onChatClosed on "+l.toString()+": \n"+e)}}),evt)}catch(e){lmt12("Failure to fireChatClosed: "+cf21(e),LOG_LEVELS.INFO)}};GR34.prototype.fireChatEngaged=function(_src){if(this.hasEngaged)return;this.hasEngaged=true;var evt=MI8.mixAbsorber({evtType:this.EVTS.ENGAGED,timestamp:new Date,src:_src,chat:this.getChatData(),bizRuleName:this.rule.getName()});var chatData=this.getChatData();evt.absorb(chatData).absorb({chatID:this.getChatID(),chatType:this.getChatType(),customerID:Inq.getCustID(),agentID:this.getAgentID()});var custEvt=MI8.mixAbsorber({customerID:Inq.getCustID(),chatID:chatData.id,evtType:this.EVTS.LAUNCHED,chatType:this.getChatType(),bizRuleName:this.rule.getName()});var buID=null;var agID=null;if(evt["buID"]){buID=evt["buID"];delete evt["buID"]}if(evt["agID"]){agID=evt["agID"];delete evt["agID"]}if(!(buID&&agID)||parseInt(buID)<=0||parseInt(agID)<=0){var rule=BRM.rb41(chatData.ruleID)?BRM.rb41(chatData.ruleID):this.rule;if(rule){buID=buID&&parseInt(buID)>0?buID:rule.getBusinessUnitID();agID=agID&&parseInt(agID)>0?agID:rule.getAgentGroupID()}}if(agID&&parseInt(agID)>0){custEvt.absorb({agentGroupID:agID});evt.absorb({agentGroupID:agID})}if(buID&&parseInt(buID)>0){custEvt.absorb({businessUnitID:buID});evt.absorb({businessUnitID:buID})}this._fireEvt((function(l,evt){if(typeof l.onChatEngagedEvent=="function")l.onChatEngagedEvent(evt);if(typeof l.onChatEvent=="function")l.onChatEvent(evt)}),evt)};GR34.prototype.firePersistentPush=function(){this._fireChatEvt({id:++this.evtIdx,chatType:this.chat.getChatType(),evtType:this.EVTS.PERSISTENT_PUSH,chat:this.getChatData(),timestamp:new Date})};GR34.prototype._firePersistentPushEvt=function(evt){var chatData=null;var inh=null;if(this.chat){inh=this.chat.inHOP;chatData=this.chat.getChatData()}evt=MI8.mixAbsorber({id:++this.evtIdx,evtType:this.EVTS.PERSISTENT_PUSH,src:this,chatID:chatData?chatData.id:null,inHOP:inh});evt.absorb(chatData).absorb({customerID:Inq.getCustID(),rule:this.rule});this._fireEvt((function(l,_evt){if(l.onPersistentPush)l.onPersistentPush(_evt)}),evt)};GR34.prototype.fireAgentAssigned=function(_agtID,_cobrowseEnabled,eventData,buID,agID,save){try{this.evtIdx++;var evt=MI8.mixAbsorber({id:this.evtIdx,agentID:_agtID,cobrowseEnabled:!!_cobrowseEnabled,ruleID:this.chat.getRule().getID(),chatID:this.getChatID(),timestamp:new Date,businessUnitID:buID,startDateTimestamp:this.startDateTimestamp});if(agID)evt.agentGroupID=agID;this.addAgentAttributesToEvent(evt);this.getChat().resetReconnectFlag(save);if(typeof eventData=="object")evt.absorb(eventData);else if(typeof eventData=="string")evt.absorb(MI8.JSON.parse(eventData));this._fireEvt((function(l,evt){if(l&&typeof l.onAgentAssigned=="function")l.onAgentAssigned(evt)}),evt)}catch(e){ROM.post(urls.loggingURL,{level:LOG_LEVELS.WARN,line:"Failure to fireAgentAssigned: "+cf21(e)})}};GR34.prototype.isServiceSupported=function(chatType){return!!this.CHAT_TYPES[chatType]};GR34.prototype.onChatClosed=function(evt){if(MM.embeddedTheme.isValid){MM.embeddedTheme.isValid=null;var delay=1e3;if(this.chatLaunchCounter>this.MAX_NUMBER_OF_EMBEDDED_CHATS_WITHOUT_DELAY)delay=this.chatLaunchTimeoutIncrement.getNextTimeout();evt.rule.setTimeout(delay,false)}};GR34.prototype.isCallServiceType=function(chatType){return this.CHAT_TYPES.C2CALL==chatType||this.CHAT_TYPES.POPUP_CALL==chatType};GR34.prototype.isVAChat=function(){var ciData=this.getChatInterfaceData();return ciData?ciData.va==1:false};GR34.prototype.getConversionType=function(){if(!!this.chat){if(this.isVAChat())return"virtualAssistant";return this.isCallServiceType(this.getChatType())?"call":"chat"}else return null};GR34.prototype.isServiceInProgress=function(chatType){if(isCEAPIPostChatSurveyMode())return false;var inProgress=false;if(!!this.chat){var thisChatType=this.chat.getChatType();if(chatType=="ANY")return!inu1(thisChatType);if(!this.isServiceSupported(chatType))throw"ServiceTypeNotRecognized - not supported chat type provided: '"+chatType+"'";if(!inu1(chatType))if(this.isPersistentWindow()&&chatType==this.CHAT_TYPES.PERSISTENT)inProgress=true;else inProgress=chatType==thisChatType}return inProgress};GR34.prototype.registerFlashvarFcn=function(fcn){this._flashvarFcns.push(fcn)};GR34.prototype.preloadInqFramework=function(){var path=this.getInqFrameworkUrl();prefetchResource(path,(function(){lwt12("InqFramework wasn't able to preload from "+path)}))};GR34.prototype.getInqFrameworkUrl=function(){var src;var serverPath=urls.mediaLaunchCiURL;if(site.noJSHosting)serverPath=site.clientStaticUrl;var isExternalChat=this.getChatType()===CHM.CHAT_TYPES.EXTERNAL_CHAT;var isExternalChatPopup=this.getChatType()===CHM.CHAT_TYPES.EXTERNAL_POPUP_CHAT;var isThemeModernCIVersion=this.chat&&this.chat.isCIV2Skin();var isModernSkinNoChatInstance=!isWebSDK&&window.parent.v3Lander.modernSkin&&this.chat==null;if(isExternalChat||isExternalChatPopup||isWebSDK||isThemeModernCIVersion||isModernSkinNoChatInstance)src=serverPath+"/InqFrameworkService";else src=serverPath+"/InqFramework";src+=this.getObfuscationSuffix();src+=".js?codeVersion="+(v3Lander?encodeURIComponent(v3Lander.codeVersion):"undefined");return src};GR34.prototype.getObfuscationSuffix=function(){var suffix="";switch(getCiObfuscationLevel()){case 1:suffix="-w";break;case 2:suffix="-s";break;case 3:suffix=isJsLoggingActive()?"-a":"-qa";break;case 0:default:break}return suffix};GR34.prototype.endCobrowseSessionFromBanner=function(){try{var parentRef=window.parent;if(!this.isChatInProgress())parentRef=this.r11bv();parentRef.inqFrame.Application.application.customerEndsCobrowse()}catch(e){log("We have a cobrowse error"+e)}};GR34.prototype.getFlashVarData=function(){var retval=null;if(this._flashvarFcns.length>0){retval=MI8.mixAbsorber({});for(var idx=0;idx<this._flashvarFcns.length;idx++)retval.absorb(this._flashvarFcns[idx]())}return retval};GR34.prototype.getAgentGroupID=function(evt,agentAssignedStage){var agentGroupID=getDefaultAgentGroupId();if(this.getChat()&&this.getChat().getChatAgentGroupID())return this.getChat().getChatAgentGroupID();if(agentAssignedStage)return agentGroupID;if(this.getChat()&&this.getChat().getAgentGroupID())return this.getChat().getAgentGroupID();else if(evt&&evt.rule&&typeof evt.rule.getAgentGroupID=="function")return evt.rule.getAgentGroupID();else if(this.getLastChat()&&this.getLastChat().agentGroupID)return this.getLastChat().agentGroupID;return agentGroupID};GR34.prototype.setCABeacon=function(action,data){if(this.chat)this.chat.setCABeacon(action,data)};GR34.prototype.setActiveWindowId=function(){if(this.chat)this.chat.setActiveWindowId()};GR34.prototype.isMultiChatSupported=function(){return!!(this.getChat()&&this.getChat().getEmbeddedTheme())};GR34.prototype.q6t=function(){return this.getChat()?this.getChat().getChatData().qt:null};GR34.prototype.getFallbackAgentGroupEnabled=function(){var getFallbackAgentGroupEnabled=this.getChat()?this.getChat().getRule().getFallbackAgentGroupEnabled:void 0;return getFallbackAgentGroupEnabled?getFallbackAgentGroupEnabled():false};GR34.prototype.getQueueMessagingSpecId=function(){if(this.chat&&this.chat.chatSpec)return this.chat.chatSpec["qmspec"]};GR34.prototype.setAdblockOn=function(){this.adblockOn=true};GR34.prototype.setAdblockOff=function(){this.adblockOn=false};GR34.prototype.isAdblockOn=function(){return this.adblockOn};GR34.prototype.setEngagementAttributes=function(engAttrs){if(this.chat&&engAttrs.length>0){this.chat.setEngagementAttributes(engAttrs);var encodedValues=new Array(engAttrs.length);for(var i=0;i<engAttrs.length;i++)encodedValues[i]=encodeURIComponent(engAttrs[i].name)+","+encodeURIComponent(engAttrs[i].value)+",set";var data={_domain:"customer",evt:"customAttribute",attributeType:"engagementAttribute",siteID:siteID,customerID:Inq.getCustID(),chatID:CHM.getLastChatID(),attr:encodedValues.join(";")};ROM.send(urls.logDataURL,data)}};GR34.prototype.getEngagementAttributeValue=function(attrName){return this.chat?this.chat.getEngagementAttributeValue(attrName):null};GR34.prototype.getDisconnectionTimeout=function(){if(this.chat)return this.chat.getDisconnectionTimeout()};GR34.prototype.isAsyncChat=function(){var chat=this.getChat();if(chat)return chat.isAsyncChat();return false};GR34.prototype.isEnableAgentEncryptData=function(){return site.enableAgentEncryptedData};GR34.prototype.setSecureWithCustToken=function(isSecureWithCustToken){if(this.chat)this.chat.setSecureWithCustToken(isSecureWithCustToken)};GR34.prototype.asyncUnauthUser=function(){this.asyncUnauthUserVar.z3(1);this.setUpResetChatOnBrowserClose();this.cip.z3(1)};GR34.prototype.disableAsyncUnauthUser=function(){this.asyncUnauthUserVar.z3(0)};GR34.prototype.resetAsyncUnauthUser=function(){if(this.isAsyncUnauthUser())CONVM.resolveConversation()};GR34.prototype.resetAsyncUnauthUserVariables=function(){this.asyncUnauthUserVar.reset();this.cip.reset();CONVM.setConversationIDs(null,null)};GR34.prototype.isAsyncUnauthUser=function(){return!!this.asyncUnauthUserVar.getValueOrDefault()};GR34.prototype.onConversationResolved=function(){if(this.isAsyncUnauthUser())this.resetAsyncUnauthUserVariables()};GR34.prototype.EVTS={LAUNCHED:"LAUNCHED",PERSISTENT_PUSH:"PERSISTENT_PUSH",CLOSED:"CLOSED",REQUESTED:"REQUESTED",SHOWN:"SHOWN",ENGAGED:"ENGAGED",BEFORE_CLOSED:"BEFORE_CLOSED"};GR34.prototype.PERSISTENT={PERSISTENT:"persistent",PERSISTENT_COMPLETE:"persistent.complete"};GR34.prototype.TIMEOUT_LATENCY=3e4;GR34.prototype.chatCloseReason={TIMEOUT:"Chat was closed by timeout. ",DISCONNECTION:"Chat was closed due to the connection issues. ",RESET:"Chat was reset"};GR34.prototype.REFRESH_NEW_EMBEDDED_CHAT_DELAY_INCREMENT=5e3;GR34.prototype.MAX_REFRESH_NEW_EMBEDDED_CHAT_DELAY=6e4;GR34.prototype.MAX_NUMBER_OF_EMBEDDED_CHATS_WITHOUT_DELAY=2;GR34.MODERN_CI_VERSION=2;function X43(id,data){this._observable();this._frameworkModule(id);this.absorb(data);this._c2cList=[];this.stateVar=null;this.sessionVar=null;this.requestInProgress=false}MI8.prepare(X43).im13(MI8.XJA3).im13(MI8.FM2).im13(MI8.Persistable).im13(MI8.Observable);X43.prototype.getPersistentID=function(){return this.getID()};X43.prototype.init=X43.prototype.start=function(){};X43.prototype.reset=function(){for(var i=0;i<this._c2cList.length;i++)if(typeof this._c2cList[i]!=="undefined"){this._c2cList[i].reset();this._c2cList[i].onChatClosed=null;delete this._c2cList[i]}};X43.prototype.load=function(){var stateData={};var sessionData={};function fixBlockedServicesData(){var blocked={};var sessionServices=sessionData["blocked"];if(!!sessionServices)for(var sessionService in sessionServices)blocked[sessionService]=sessionServices[sessionService];var stateServices=stateData["blocked"];if(!!stateServices)for(var stateService in stateServices)blocked[stateService]=stateServices[stateService];return blocked}this.stateVar=new VER34(this.getID(),{},resources["state"]);this.sessionVar=new VER34(this.getID(),{},resources["session"]);stateData=this.stateVar.z0();this.absorb(stateData);sessionData=this.sessionVar.z0();this.absorb(sessionData);if(!!this.blocked)this.blocked=fixBlockedServicesData()};X43.prototype.save=function(){var stateData={};var sessionData={};function prepareBlockedServicesData(services){for(var service in services)if(services[service]==0){if(!sessionData.blocked)sessionData.blocked={};sessionData.blocked[service]=services[service]}else if(services[service]==-2);else{if(!stateData.blocked)stateData.blocked={};stateData.blocked[service]=services[service]}}if(!!this.blocked)prepareBlockedServicesData(this.blocked);try{this.stateVar.z3(stateData)}catch(e){log("X43.save stateData: "+e)}try{this.sessionVar.z3(sessionData)}catch(e){log("X43.save sessionData: "+e)}};X43.prototype.agrtyer=function(){this.load()};X43.prototype.tryue=function(serviceType,period){if(serviceType!=GR34.CHM.CHAT_TYPES.C2C&&serviceType!=GR34.CHM.CHAT_TYPES.C2CALL&&serviceType!=GR34.CHM.CHAT_TYPES.C2WEBRTC)return;if(inu1(this.blocked))this.blocked={};if(inu1(this.blocked[serviceType])||!inu1(this.blocked[serviceType])&&this.blocked[serviceType]<(new Date).getTime()){if(period>0){var now=new Date;period+=now.getTime()}this.blocked[serviceType]=period;this.save()}};X43.prototype.unblockService=function(serviceType){if(serviceType!=GR34.CHM.CHAT_TYPES.C2C&&serviceType!=GR34.CHM.CHAT_TYPES.C2CALL&&serviceType!=GR34.CHM.CHAT_TYPES.C2WEBRTC)return;if(!inu1(this.blocked)&&!inu1(this.blocked[serviceType]))delete this.blocked[serviceType];this.save()};X43.prototype.isBlocked=function(serviceType){var blockedValue=false;if(!inu1(this.blocked)&&!inu1(this.blocked[serviceType])){var now=new Date;var toDate=this.blocked[serviceType];if(toDate<=0)blockedValue=true;else blockedValue=toDate>=now.getTime()}return blockedValue};X43.prototype.isAnyBlocked=function(){if(inu1(this.blocked))return false;if(Object.keys(this.blocked).length>0)return true;return false};X43.prototype.launchChat=function(idx,callThisNumber){if(CM.cleaningDetected)this.showDisabledIcon();else CM.requestSessionData(function(){if(CHM.isChatInProgress()){var rule=this.getC2C(idx)?this.getC2C(idx).getRule():null;log("Chat already in progress... rule chat request ignored."+(rule?" Rule="+rule.toString():""));this.showDisabledIcon();CHM.resetChatRequestsQueue(rule)}else{var chatLaunchSource=this.getID()+"#launchChat";CHM.removeChatInstance(chatLaunchSource);this.agrty(idx,callThisNumber,chatLaunchSource)}}.bind(this))};X43.prototype.agrty=function(idx,callThisNumber,callerName){var c2c=this.getC2C(idx);if(!c2c){log("can't find c2c "+idx);return}delete c2c.lastDat;if(c2c.c2p&&c2c.getChatType()!=GR34.CHM.CHAT_TYPES.C2CALL||callThisNumber!=null&&!c2c.isClicked())if(!isWebSDK)CHM.wecv56(c2c.c2cSpec.chatSpec.chatTheme);if(!c2c.isClicked()){this.fireC2CClicked(c2c);CHM.request(c2c.getRule(),c2c.getChatType(),c2c.getXmlChatSpec(),callThisNumber||null,c2c.c2p,idx,c2c.useNative,null,callerName);c2c.setClicked(true);X43.lastusedC2CId=c2c.pageElementID;X43.c2cBtnId=null}else log("Ignored C2C double click")};X43.prototype.requestExtChat=function(idx,callback){this.getC2C(idx).extJSlaunchCb=callback;if(CM.cleaningDetected)callback({state:"disabled"});else CM.requestSessionData(function(){if(CHM.isChatInProgress()){var rule=this.getC2C(idx)?this.getC2C(idx).getRule():null;log("Chat already in progress... rule chat request ignored."+(rule?" Rule="+rule.toString():""));callback({state:"disabled"});CHM.resetChatRequestsQueue(rule)}else{var chatLaunchSource=this.getID()+"#requestExtChat";CHM.removeChatInstance(chatLaunchSource);this.agrty(idx,null,chatLaunchSource)}}.bind(this))};X43.prototype.showDisabledIcon=function(){for(var i=0;i<this._c2cList.length;i++)if(typeof this._c2cList[i]!=="undefined")this.getC2C(i).showDisabledIcon()};X43.prototype.getC2C=function(idx){return this._c2cList[idx]};X43.prototype.request=async function(rule,chatType,dataFcn,clickToPersistent,useNative){if(this.isBlocked(chatType))return;var c2c=new C2C(this,rule,chatType,dataFcn,clickToPersistent?clickToPersistent:isC2cPersistent(),this.adaCompliant,this.ariaEnhanced,this.ariaEnhancedChatAvailableMessage,this.adaAndroidC2cSupportDomains,useNative);if(c2c.shouldRenderPlugin()){if(CHM.isV3Continue()&&typeof c2cPlugin!="undefined"){log("Plugin already executed for rule: "+rule.getName());this.callC2CRequest(c2c,rule);return}var pPath=c2c.getPluginPath();if(pPath){this._c2cList[c2c.getIdx()]=c2c;if(!this.requestInProgress){this.requestInProgress=true;await injectScriptAsync(getSkinRootUrl(),pPath,pPath);c2c.request()}}}else if(isWebSDK||c2c.getDiv())this.callC2CRequest(c2c,rule);else{C2C.IDX--;if(c2c.isDivOccupied()){var exposureData={siteID:Inq.getSiteID(),customerID:Inq.getCustID(),incrementalityID:asi4(),sessionID:getSessionID(),brID:rule.id,group:PM.getVar("incGroup").z0(),businessUnitID:rule.getBusinessUnitID(),result:"existing_offer",rule:rule};BRM.fireExposureQualifiedEvent(exposureData);log("C2C div already occupied: "+rule.getName())}else log("C2C div not found for "+rule.getName())}};X43.prototype.callC2CRequest=function(c2c,rule){this._c2cList[c2c.getIdx()]=c2c;if(!this.requestInProgress){this.requestInProgress=true;c2c.request()}log('X43 request: {ruleName: "'+rule.getName()+'"}')};X43.prototype.requestExtLauncher=function(rule,chatType,dataFcn,clickToPersistent){if(this.isBlocked(chatType))return;var c2c=new C2C(this,rule,chatType,dataFcn,clickToPersistent?clickToPersistent:isC2cPersistent(),this.adaCompliant,this.ariaEnhanced,this.ariaEnhancedChatAvailableMessage,this.adaAndroidC2cSupportDomains);c2c.isExtC2C=true;this._c2cList[c2c.getIdx()]=c2c;if(!this.requestInProgress){this.requestInProgress=true;c2c.request()}};X43.prototype.nextRequest=async function(completedC2C){log("C2C request complete for "+completedC2C.getRule().getName());this.requestInProgress=false;var nextIdx=completedC2C.getIdx()+1;var nextC2C=this._c2cList[nextIdx];if(!!nextC2C&&nextC2C.timeout_id===C2C.INITIAL_TIMEOUT_ID){log("Issuing next C2C request for "+nextC2C.getRule().getName());this.requestInProgress=true;if(nextC2C.shouldRenderPlugin()&&typeof c2cPlugin=="undefined"){var pPath=nextC2C.getPluginPath();if(pPath){await injectScriptAsync(getSkinRootUrl(),pPath,pPath);nextC2C.request()}}else nextC2C.request()}};X43.prototype.showCallButton=function(indx,source,left,top,number,show,giveFocus,title){var c2c=this.getC2C(indx);if(c2c!=null)c2c.showCallButton(source,left,top,number,show,giveFocus,title)};X43.prototype.isListener=function(l){return!!(l&&(l.onC2CDisplayed||l.onC2CClicked||l.onC2CStateChanged||l.onC2CReadyForSDK))};X43.prototype.onChatClosed=function(){this.clicked=false};X43.prototype.fireC2CStateChanged=function(data){var evt={c2c:data.c2c,oldState:data.oldState,newState:data.newState,rule:data.rule,serviceType:CHM.CHAT_TYPES.C2C,customerID:Inq.getCustID(),data:data.data,bizRuleName:data.rule?data.rule.getName():null};function f(l,evt){try{if(!!l.onC2CStateChanged)l.onC2CStateChanged(evt)}catch(e){log("Error firing event fireC2CStateChanged on "+l.toString()+":"+e)}}this._fireEvt(f,evt)};X43.prototype.makeC2CEventParams=function(c2c){var evt=MI8.mixAbsorber({c2c:c2c,rule:c2c.getRule(),serviceType:CHM.CHAT_TYPES.C2C,customerID:Inq.getCustID(),data:c2c.data,bizRuleName:c2c.getRule()?c2c.getRule().getName():null});var buID=c2c.getRule()?c2c.getRule().getBusinessUnitID():null;var agID=c2c.getRule()?c2c.getRule().getAgentGroupID():null;if(agID&&parseInt(agID)>0)evt.absorb({agentGroupID:agID});if(buID&&parseInt(buID)>0)evt.absorb({businessUnitID:buID});return evt};X43.prototype.fireC2CDisplayed=function(data){var evt=this.makeC2CEventParams(data.c2c);function f(l,evt){try{if(!!l.onC2CDisplayed)l.onC2CDisplayed(evt)}catch(e){log("Error firing event C2CDisplayed on "+l.toString()+":"+e)}}this._fireEvt(f,evt)};X43.prototype.fireC2CReadyForSDK=function(data){var evt=this.makeC2CEventParams(data.c2c);evt.absorb({isFocus:data.setFocus});function f(l,evt){try{if(!!l.onC2CReadyForSDK)l.onC2CReadyForSDK(evt)}catch(e){log("Error firing event C2CReadyForSDK on "+l.toString()+":"+e)}}this._fireEvt(f,evt)};X43.prototype.fireC2CClicked=function(c2c){var evt=this.makeC2CEventParams(c2c);function f(l,evt){try{if(!!l.onC2CClicked)l.onC2CClicked(evt)}catch(e){log("Error firing event C2CClicked on "+l.toString()+":"+e)}}this._fireEvt(f,evt)};X43.prototype.relaunchC2cRules=function(){if(!isFireC2cRulesOnChatClose())return;this.reset();var rules=BRM.getRules();for(var i=0;i<rules.length;i++){var rule=rules[i];if(rule.active||typeof rule.tt1==="function"){var triggers=rule.tt1();var pageLandingRule=false;for(var j=0;j<triggers.length;j++)if(triggers[j].id==="onPageLanding")pageLandingRule=true;if(pageLandingRule&&(rule.ruleType===CHM.CHAT_TYPES.C2C||rule.ruleType===CHM.CHAT_TYPES.EXTERNAL_CHAT||rule.ruleType===CHM.CHAT_TYPES.C2CALL)){var page=LDM.getPage();rule.fireRule({page:page,data:page})}}}};X43.prototype.IMAGETYPES={disabled:"d",busy:"b",afterHours:"ah",ready:"r"};X43.prototype.STATES={d:"chatactive",b:"busy",ah:"outofhours",r:"ready"};X43.c2cBtnId=null;function af4(){var isACIFOptOut=gc7("ACIF_OPT_OUT",null);if(isACIFOptOut){this.preload=function(){};this.load=function(){};return}var ACIF_IFRAME_ID="nuance-acif";var ACIF_IFRAME_NAME="nuance-automaton-frame";var ACIF={};var isClientJSHostingEnabled=site.noJSHosting;var clientHostedJSRootPath=isClientJSHostingEnabled?site.clientStaticUrl:null;var doc=window.parent.document;var baseUrl=isClientJSHostingEnabled?site.clientStaticUrl:urls.mediaRootURL+"/media/launch";var acifIFrame=null;ACIF.preAcifJsUrl=(isClientJSHostingEnabled?site.clientStaticUrl:urls.vanityURL+"/tagserver/acif")+"/pre-acif.js";ACIF.baseUrl=baseUrl+"/acif";this.load=function(){if(!!getAcifFrame()||isACIFLoadedFromBR())return;ACIF.isLoadedNatively=true;win.inQ=win.inQ||{};win.inQ.ACIF=ACIF;addListeners();loadAcifIframe();loadAcifScripts()};this.preload=function(){var jsUrls=getAcifScriptsUrls();jsUrls.forEach((function(scriptUrl){prefetchResource(scriptUrl)}))};ACIF.EVM={queue:[]};function addListeners(){var events=["onSkinLoaded","onAgentMsg","onAgentDataPass","onChatClosed"];events.forEach((function(eventName){var eventRegistry={};eventRegistry[eventName]=function(){var args=Array.prototype.slice.call(arguments);if(typeof ACIF.EVM[eventName]!=="function")ACIF.EVM.queue.push({event:eventName,args:args})};EVM.addListener(eventRegistry)}))}function loadAcifIframe(){if(!getAcifFrame()){acifIFrame=doc.createElement("iframe");acifIFrame.name=ACIF_IFRAME_NAME;acifIFrame.id=ACIF_IFRAME_ID;acifIFrame.style.display="none";doc.body.appendChild(acifIFrame)}}function loadAcifScripts(){var iframeDoc=getAcifFrame().contentWindow.document;var jsUrls=getAcifScriptsUrls();var scripts=jsUrls.map((function(src){return"<script src='"+src+"' type='text/javascript' charset='UTF-8'><\/script>"})).join("\n");var html="<!doctype html>"+"<html>"+"<head>"+"</head>"+"<body>"+scripts+"</body>"+"</html>";iframeDoc.open();iframeDoc.write(html);iframeDoc.close()}function getAcifFrame(){return acifIFrame}function getAcifScriptsUrls(){return[ACIF.preAcifJsUrl,getAcifUrl(),getConfigsUrl()]}function getAcifUrl(){var version=getVersion("stable","acif");if(version==="local"){ACIF.baseUrl="https://localhost:4200";return ACIF.baseUrl+"/acif.js"}var filename=version==="debug"?"acif-debug.js":"acif.js";return ACIF.baseUrl+"/"+filename}function getConfigsUrl(){var configsVersion=getVersion(null,"configs");if(configsVersion==="local")return"https://localhost:8080/acif-configs.js";else if(isClientJSHostingEnabled)return ACIF.baseUrl+"/acif-configs.js";else{var cdnUrl=urls.mediaSiteURL;return cdnUrl+"/assets/automatons/acif-configs.js"}}function getVersion(defaultVersion,appName){var _top=window.parent;try{_top=window.top}catch(e){}var regex=new RegExp("nuance[-_]?"+appName+"[-_]?version=([^&]+)","i");var storageKey="nuance_"+appName+"_version";var version=(_top.location.href.match(regex)||[])[1]||_top[storageKey]||(sessionStorage?sessionStorage.getItem(storageKey):null)||(localStorage?localStorage.getItem(storageKey):null)||defaultVersion;if(version!==defaultVersion)sessionStorage.setItem(storageKey,version);return version}}function Chat(chatData){this.sesVar=new VER34("chat",{},resources["session"]);this._stage=getParentElByIDTFacade("inqChatStage");this._isVisible=false;this.dragHandleID="inqTitleBar";this.cd=MI8.clonize(chatData);this.rule=null;this.agID=null;this.agName=null;this.vaDataPass=null;this.disconnectionTimeout=0;this.BEACON_DATA="DATA";this.windowId=Math.round(Math.random()*1e8);this.agentClosedChat=false;this.beaconURL=null;this.beaconRequest=[];CHM.reset();SVYM.reset()}MI8.prepare(Chat).im13(MI8.XJA3);Chat.ASYNC_CHAT_FLAG="async";Chat.prototype.setSurvey=function(sdat){if(!!sdat&&sdat.id>0){this.cd.sid=sdat.id;this.save()}else log("chat.setSurvey(): Survey data set failed. sdat undefined or invalid sid"+sdat)};Chat.prototype.load=function(){var cd=this.cd;if(inu1(cd)){cd=MI8.clonize(this.sesVar.z0());if(inu1(cd))return null}if(!inu1(cd)){cd.aMsgCnt=inu1(cd.aMsgCnt)?0:cd.aMsgCnt;cd.cMsgCnt=inu1(cd.cMsgCnt)?0:cd.cMsgCnt;if(inu1(cd.launchPageId))cd.launchPageId=LDM.getPageID()}Chat.validate(cd);this.cd=cd;this.chatSpec=MM.mergeChatSpec(cd.xmlSpec);this.rule=BRM.rb41(cd.ruleID);this.setSecureWithCustToken(secureWithCustToken);return this};Chat.prototype.getCiData=function(){return!!this.cd?this.cd.ci:{}};Chat.prototype.setCiData=function(dat,doNotSave){if(this.cd){this.cd.ci=dat;if(!doNotSave)this.save()}};Chat.prototype.updateCiData=function(data){if(this.cd){for(var key in data)if(data.hasOwnProperty(key))this.cd.ci[key]=data[key];this.save()}};Chat.unmarshal=function(chatData){return new Chat(chatData)};Chat.prototype.bumpAgtMsgCount=function(){if(!!this.cd)this.cd.aMsgCnt+=1};Chat.prototype.bumpCustMsgCount=function(){if(!!this.cd)this.cd.cMsgCnt+=1};Chat.prototype.getAgentMsgCnt=function(){if(!!this.cd)return this.cd.aMsgCnt;return 0};Chat.prototype.getCustMsgCnt=function(){if(!!this.cd)return this.cd.cMsgCnt;return 0};Chat.prototype.getChatData=function(){try{return!!this.cd?this.cd.clone():null}catch(err){MI8.clonize(this.cd);return this.cd.clone()}};Chat.prototype.updateChatData=function(chatData){this.cd=chatData};Chat.prototype.updateV3TO=function(chatLayerTimeout){this.cd.v3TO=chatLayerTimeout;this.monitorChatActive()};Chat.prototype.save=function(){this.sesVar.z3(this.cd)};Chat.prototype.getCustID=function(){return getCustID()};Chat.prototype.getChatID=function(){if(!!this.cd)return this.cd.id;return null};Chat.prototype.setChatID=function(chatID){if(!!this.cd)this.cd.id=chatID};Chat.prototype.getChatType=function(){return this.cd.chatType};Chat.prototype.isC2cToPersistent=function(){return this.cd.c2cToPersistent};Chat.prototype.getLanguage=function(){var language;try{language=this.getRule().getLanguage()}catch(e){log("Error while getting language from Rule: \n"+e+"\n")}if(!language)language=getDefaultLanguage();return language};Chat.prototype.onLocalCallback=function(){try{this.show()}catch(e){log("Error in above code: \n"+e+"\n"+data)}};Chat.prototype.getRule=function(){return this.rule};Chat.prototype.getRuleId=function(){var ruleID=this.rule.getID();return!!ruleID?ruleID:""};Chat.prototype.getRuleName=function(){return this.rule.getName()};Chat.prototype.getWindowId=function(){return this.windowId};Chat.prototype.monitorChatActive=function(){if(CM.xd){CM.setV3ActiveValue(1);var request=["CHATACTIVE","CHATACTIVE",Inq.siteID,isPersistentWindow(),this.getChatData().v3TO,true];CM.postRequestToIframeProxy(request)}else this.updateCiData({a:true})};Chat.prototype.closeChatMonitor=function(){if(CM.xd){var request=["CHATDEACTIVATE","",Inq.siteID,true];CM.setV3ActiveValue(0);if(CM.cleaningDetected)request[1]="UNLOAD_HANDLER";CM.postRequestToIframeProxy(request)}else{var chatData={};chatData["a"]=false;chatData["lt"]=Date.now();this.updateCiData(chatData)}};Chat.prototype.setCABeacon=function(action,data){var beaconData={};beaconData[KEY_ENGAGEMENT_ID_STRING]=this.getChatID();beaconData[KEY_CUSTOMER_ID_STRING]=this.getCustID();if(action==this.BEACON_DATA&&data)for(var key in data)beaconData[key]=data[key];this.beaconURL=CHM.getChatRouterURL()+urls.pageUnloadURL;this.beaconURL+="?"+KEY_ENGAGEMENT_ID_STRING+"="+this.getChatID()+"&"+KEY_CUSTOMER_ID_STRING+"="+this.getCustID()+"&"+KEY_WINDOW_ID_STRING+"="+this.getWindowId();this.beaconRequest=["BEACON",action,MI8.JSON.stringify(beaconData),this.beaconURL];PSC.setBeaconData(this.beaconURL,action,this.beaconRequest[2])};Chat.prototype.setActiveWindowId=function(){if(CHM.isMultiChatSupported()){var data=KEY_ENGAGEMENT_ID_STRING+"="+this.getChatID()+"&"+KEY_CUSTOMER_ID_STRING+"="+this.getCustID();var url=CHM.getChatRouterURL()+urls.addActiveWindowIdURL+"?"+KEY_WINDOW_ID_STRING+"="+this.getWindowId();var id=generateRequestId("addActiveWindowId");ROM.sendToChatrouter(url,data,id)}};Chat.prototype.show=function(){var type=this.getChatType();if(CHM.resetChatOnBrowserClose)CHM.cip.z3(1);if(this.chatSpec!=null&&(type==CHM.CHAT_TYPES.C2C||type==CHM.CHAT_TYPES.C2WEBRTC||type==CHM.CHAT_TYPES.PERSISTENT)&&this.isC2cToPersistent())if(!CHM.r11bv()){CHM.popOutChat(true);return}if(this.cd.launchNative)if(type==CHM.CHAT_TYPES.C2C||type==CHM.CHAT_TYPES.POPUP)if(typeof NuanIJSFBridge!="undefined"||getIOSNativeSDKInstance()){FP.launchNativeSDK({});return}if(type!=CHM.CHAT_TYPES.C2C&&type!=CHM.CHAT_TYPES.PERSISTENT||!this.isC2cToPersistent()||isPersistentWindow()){var scriptObj=this.preloadChat();if(type==CHM.CHAT_TYPES.C2WEBRTC){var _pWin=window.parent;var isIOSusingSDK=_pWin.webkit&&_pWin.webkit.messageHandlers&&_pWin.webkit.messageHandlers.tcrtc;if(!isIOSusingSDK&&!window.parent.NuanRTCSDK)this.preloadVidyo()}this.monitorChatActive();FP.startChatInterface();var useCiv2Skin=this.isCIV2Skin();var c2c=C2CM.getC2C(CHM.c2cIdx);if(type==CHM.CHAT_TYPES.EXTERNAL_CHAT){var cb=c2c&&c2c.extJSlaunchCb;external.bind(this)(cb)}else if(type==CHM.CHAT_TYPES.EXTERNAL_POPUP_CHAT)if(isWebSDK)FrameBridge.postMessageToBootStrap("PROACTIVE_CHAT_LAUNCH",{state:"show"});else external.call(this,EVM.fireCustomEvent.bind(EVM,"externalPopup",this.rule));else if(isWebSDK||useCiv2Skin){var civ2ChatVisible=CHM.isV3Continue()||type==CHM.CHAT_TYPES.POPUP||c2c.getC2cTheme()&&c2c.getC2cTheme().renderAsHTML;var usePlugin=this.chatSpec.pn!==void 0;var pluginNotLoadedYet=typeof c2cPlugin=="undefined";if(useCiv2Skin&&civ2ChatVisible&&usePlugin&&pluginNotLoadedYet){var skinPath=getSkinRootUrl()+getThemeName();var embeddedFile="/"+this.chatSpec.pn+".js";loadScript(skinPath,embeddedFile,embeddedFile,function(){external.call(this)}.bind(this))}else external.call(this)}}function external(cb){var _that=this;if(typeof Application!=="undefined"){if(_that.initTimer)clearTimeout(_that.initTimer);setTimeout((function(){_that.setupCIAPIChat(cb)}),100)}else if(scriptObj){scriptObj.onload=function(){_that.setupCIAPIChat(cb)};scriptObj.onreadystatechange=function(){if(this.readyState==="complete"||this.readyState==="loaded")_that.setupCIAPIChat(cb)}}}};Chat.prototype.setupCIAPIChat=function(externalLaunchCb){var _that=this;_that.initAppliation();externalLaunchCb&&externalLaunchCb({state:"show"});if(!externalLaunchCb&&(isWebSDK||this.isCIV2Skin()))if(typeof window.messagingApp!="undefined")_that.initWebSKDCI();else{var sdkuiScript=_that.loadWebSDKCI();sdkuiScript.onload=function(){_that.initWebSKDCI()};sdkuiScript.onreadystatechange=function(){if(this.readyState==="complete"||this.readyState==="loaded")_that.initWebSKDCI()}}};Chat.prototype.initWebSKDCI=function(){var spec=this.getChatSpec();var pcID=spec&&spec.chatTheme.pcsID;if(isWebSDK)FrameBridge.positionMessagingWindow(pcID);else if(this.isCIV2Skin())window.messagingApp.showMessagingFrame(pcID)};Chat.prototype.isCIV2Skin=function(){return this.chatSpec.chatTheme.sv==GR34.MODERN_CI_VERSION};Chat.prototype.close=function(){this.setVisible(false);this.closeChatMonitor();FP.closeChatInterface();this.endChatSession();this.sesVar.z3(null);this.endCobrowseSession();CommunicationMgr.resetNetworkBackup()};Chat.prototype.endChatSession=function(){this.cd.closed=1;this.save()};Chat.prototype.isClosed=function(){return!!this.cd.closed};Chat.prototype.isVisible=function(){return this._isVisible};Chat.prototype.setVisible=function(vis){this._isVisible=vis};Chat.prototype.getDragHandle=function(){return this.dragHandleID};Chat.prototype.setDragHandle=function(handleElementID){this.dragHandleID=handleElementID};Chat.prototype.setResizable=function(){if(this._stage==null)this._stage=getParentElByIDTFacade("inqChatStage");var resizeHandleElem=getParentElByIDTFacade("inqDivResizeCorner");if(typeof Inq.Resize!="undefined"&&resizeHandleElem)Inq.Resize.__init(resizeHandleElem,this._stage)};Chat.prototype.setDragable=function(){if(this._stage==null)this._stage=getParentElByIDTFacade("inqChatStage");var dragHandleElem=getParentElByIDTFacade("inqTitleBar");try{if(typeof Inq.Drag!="undefined"&&dragHandleElem)Inq.Drag.__init(dragHandleElem,this._stage)}catch(e){}};Chat.prototype.transitionMessage=function(persistentState){var params={agentID:this.getAgentID(),chatID:this.getChatID(),customerID:this.getCustID(),transitioning:persistentState,siteID:getSiteID()};ROM.send(urls.baseURL+"/tracking/persistentMsg",params,false,true,20,5e3);if(persistentState.equals(CHM.PERSISTENT.PERSISTENT_COMPLETE)&&this.getCiData().eng){var data={engagementID:this.getChatID(),customerID:this.getCustID()};var url=CHM.getChatRouterURL()+urls.persistentComplete;var id=generateRequestId("persistentComplete");ROM.sendToChatrouter(url,data,id)}};Chat.prototype.popOutChat=function(transition,top,left,bottom,right){if(transition)this.transitionMessage(Inq.CHM.PERSISTENT.PERSISTENT);this.setPersistent(true);var winTest=CHM.earlyPopout;var sHeight=300;var sWidth=400;var sLeft=40;var sTop=20;var cdata=this.chatSpec;if(cdata&&cdata.chatTheme){sHeight=cdata.chatTheme.ph;sWidth=cdata.chatTheme.pw;sLeft=cdata.chatTheme.px;sTop=cdata.chatTheme.py}var url,target;url=Inq.v3framesrc;target="_inqPersistentChat";if(winTest!=null&&winTest.closed==false){CHM.earlyPopout=null;winTest.location=url}else{CHM.earlyPopout=null;var tools="toolbar=no,location=no,menubar=no,status=no,scrollbars=no"+",top="+sTop+",left="+sLeft+",width="+sWidth+",height="+sHeight+",resizable=1";try{winTest=window.parent.top.open(url,target,tools);if(winTest==top)winTest=null;cdata.pC=null!=winTest}catch(e){winTest=null}}CHM.popoutWindow=winTest;if(winTest){if(winTest.focus&&!isMobileDevice())try{winTest.focus()}catch(e){}cdata.pC=true;return true}else return false};Chat.prototype.toString=function(){var val="Chat: ";for(var n in this)if(typeof n!=="function"&&this.hasOwnProperty(n))try{val+=n+"="+JSON.stringify(this[n])+", "}catch(e){}return val};Chat.prototype.getFlashVars=function(){var sesVar=PM.getVar("sesID");var incVar=PM.getVar("incID");var launchPageId=this.getChatData().launchPageId;var launchPageMarker=LDM.getPageMarkerById(launchPageId);var visitorAttributes=encodeURIComponent(VAM.getCopyAsArray(true).join(";"));var externalCustomerIDs=encodeURIComponent(VAM.getExternalCustomerIdVisitorAttributesAsString());var flashvars="continued="+(CHM.isV3Continue()?"1":"0")+"&sessionID="+(sesVar?sesVar.z0():123456)+"&incAssignmentID="+(incVar?incVar.z0():123456)+"&businessUnitID="+this.getBusinessUnitID()+"&chatID="+this.getChatID()+"&customerID="+this.getCustID()+"&agentName="+encodeURIComponent(this.getAgentName())+"&overrideAgentAlias="+this.isAgentNameFinal()+"&enableAgentEncryptData="+CHM.isEnableAgentEncryptData()+"&scriptID="+this.getScriptID()+"&agentExitLine="+encodeURIComponent(this.getAgentExitLine())+"&siteID="+Inq.siteID+"&userName="+encodeURIComponent(this.getCustomerName())+"&chatTitle="+this.rule.name+"&crHost="+CHM.getChatRouterURL()+"&submitURL="+CHM.getChatRouterURL()+"&tagServerBaseURL="+urls.vanityURL+"&brID="+this.rule.id+"&agentAttributes="+encodeURIComponent(this.getAgentAttributesAsString())+"&ruleAttributes="+encodeURIComponent(this.ra1t())+"&deviceType="+getDeviceType()+"&browserType="+getClientBrowserType()+"&browserVersion="+cbtv1()+"&operatingSystemType="+getOSType()+"&visitorAttributes="+visitorAttributes+"&launchType="+this.getChatType()+"&language="+this.getLanguage()+"&launchPageMarker="+launchPageMarker+"&launchPageId="+launchPageId+"&asyncChat="+Number(this.isAsyncChat())+"&sendChatRequestOnDemand="+Number(this.isSendChatRequestOnDemand())+"&"+KEY_WINDOW_ID_STRING+"="+this.getWindowId()+"&qt="+CHM.q6t()+"&isCachePersistentUsed="+CM47.isCachePersistentEnabled()+"&config.fallback-agent-group-enabled="+CHM.getFallbackAgentGroupEnabled()+"&useAgentAlias="+this.chatSpec.uaa+"&overrideChatTheme="+this.chatSpec.oct;if(this.rule["phoneNumber"]!=null)flashvars+="&clickToPhone="+this.rule.phoneNumber;var automatonId=this.getAutomatonId();if(!inu1(automatonId)){flashvars+="&automatonId="+automatonId;var automatonFields=this.getAutomatonFields();if(!inu1(automatonFields))flashvars+="&automatonFields="+encodeURIComponent(JSON.stringify(automatonFields))}var automatonSpecData=this.getAutomatonSpecData();if(!inu1(automatonSpecData))flashvars+="&automatonSpecData="+encodeURIComponent(MI8.JSON.stringify(automatonSpecData));if(externalCustomerIDs)flashvars+="&externalCustomerIDs="+externalCustomerIDs;if(this.getOpenerName())flashvars+="&openerName="+this.getOpenerName();else flashvars+="&openerID="+this.getOpenerID();var agID=this.getAgentGroupID();if(!inu1(agID)){flashvars+="&agID="+agID;var agName=CHM.getAgentGroupNameByID(agID);if(!inu1(agName))flashvars+="&agName="+agName}var pushNotificationDeviceId=win.nuancePushNotificationDeviceId;if(!isWebSDK)pushNotificationDeviceId=pushNotificationDeviceId||window.top.nuancePushNotificationDeviceId||window.nuancePushNotificationDeviceId;if(pushNotificationDeviceId)flashvars+="&pushNotificationDeviceID="+pushNotificationDeviceId;var uniqueAgentName=this.getUniqueAgentName();if(!inu1(uniqueAgentName))flashvars+="&uniqueAgentName="+uniqueAgentName;var publicAgentId=this.getPublicAgentId();if(!inu1(publicAgentId))flashvars+="&publicUserId="+publicAgentId;var agentAutoOpenerId=this.getAgentAutoOpenerId();if(!inu1(agentAutoOpenerId))flashvars+="&agentAutoOpenerId="+agentAutoOpenerId;var routingAllocSpecs=this.getRule().gr0&&this.getRule().gr0()?String(this.getRule().gr0()):null;if(routingAllocSpecs)flashvars+="&routingAllocSpecs="+routingAllocSpecs;var asyncSurveySpecID=this.getAsyncSurveySpecID();if(!inu1(asyncSurveySpecID))flashvars+="&asyncSurveySpecID="+asyncSurveySpecID;var showOpenerForEndedConversation=CHM.getChat()&&typeof CHM.getChat().getRule().showOpenerForEndedConversation==="function"&&CHM.getChat().getRule().showOpenerForEndedConversation();if(showOpenerForEndedConversation)flashvars+="&showOpenerForEndedConversation="+showOpenerForEndedConversation;var ciEnabledOnResolve=CHM.getChat()&&typeof CHM.getChat().getRule().ciEnabledOnResolve==="function"&&CHM.getChat().getRule().ciEnabledOnResolve();if(ciEnabledOnResolve)flashvars+="&ciEnabledOnResolve="+ciEnabledOnResolve;var createNewConversation=this.isCreateNewConversation();if(createNewConversation)flashvars+="&createNewConversation="+createNewConversation;var conversationTranscriptMode=CHM.getChat()&&CHM.getChat().getRule().conversationTranscriptMode;if(conversationTranscriptMode)flashvars+="&conversationMode="+conversationTranscriptMode;var flashvarFcnsData=decodeURIComponent(Inq.ROM.toParamString(CHM.getFlashVarData()));if(flashvarFcnsData&&flashvarFcnsData.length>0)flashvars+="&"+flashvarFcnsData;if(secureWithCustToken){flashvars+="&secureWithCustToken=true";flashvars+="&secureCustToken="+FP.getPersistentCustomerID()}var asyncReconnect=this.isAsyncReconnect();if(asyncReconnect)flashvars+="&asyncReconnect="+asyncReconnect;if(getUserObject())flashvars+="&userObject="+encodeURIComponent(JSON.stringify(getUserObject()));flashvars=this._fixFlashVars(flashvars);return flashvars};Chat.prototype.getAgentAttributesAsString=function(){try{return this.getRule().getAgentAttributesAsString()}catch(e){log("Error getAgentAttributes "+e)}return null};Chat.prototype.ra1t=function(){try{return this.getRule().ra1t()}catch(e){log("Error getting rule attributes "+e)}return null};Chat.prototype.getSkin=function(){var format=getChatSkinFormat();return Inq.urls.skinURL+getThemeName()+"."+format};Chat.prototype.getImagePath=function(){return Inq.urls.mediaSiteURL+"/flash/"};Chat.prototype.preloadKMS=function(){if(getParentElByIDTFacade("tc_kms"))return;var script=createScriptElement();script.src=secureProtocol(urls.vanityURL)+"/tagserver/kms/kms.js";script.id="tc_kms";document.body.appendChild(script);script.onload=function(){var script=createScriptElement();script.src=secureProtocol(urls.vanityURL)+"/tagserver/kms/room-app.js";document.body.appendChild(script)}.bind(this)};Chat.prototype.preloadVidyo=function(){if(window.parent.document.getElementById("tc_connector"))return;var script=createScriptElement();script.src=secureProtocol(urls.vanityURL)+"/tagserver/vidyo/javascript/CallConnector.js";script.id="tc_connector";document.body.appendChild(script)};Chat.prototype.loadWebSDKCI=function(){var script=createScriptElement();var serverUrl=site.noJSHosting?site.clientStaticUrl:urls.mediaLaunchCiURL;script.src=serverUrl+this.getWebSDKPath();document.body.appendChild(script);return script};Chat.prototype.getWebSDKPath=function(){var wbsdkFileName="/websdkci";if(!site.JSDebugMode)wbsdkFileName+=".min";wbsdkFileName+=".js?codeVersion="+encodeURIComponent(v3Lander.codeVersion);return wbsdkFileName};Chat.prototype.preloadChat=function(){if(AL)AL.load();var _that=this;if(typeof Application!=="undefined")_that.initTimer=setTimeout((function(){_that.initAppliation()}),50);else{var script=createScriptElement();script.src=CHM.getInqFrameworkUrl();script.id="inqChatJs";script.onload=function(){_that.initAppliation()};script.onerror=function(){lwt12("InqFramework wasn't able to load from "+CHM.getInqFrameworkUrl())};document.body.appendChild(script)}if(isPersistentWindow()&&!window.parent.Inq.datapass&&isSameOrigin())window.parent.Inq.datapass=window.parent.opener.Inq.datapass;return script};Chat.prototype.initAppliation=function(){if(typeof Application!=="undefined"){as17.init(Application.fpInit);Application.main()}};Chat.prototype._fixFlashVars=function(fv){if(void 0==fv)return"";if(fv.indexOf("&clickStream=")>=0)return fv;var extraFlashVars="";var clickStreamData=null;try{var obj;if(CHM.isPersistentWindow())obj=openerCall("getAgentData");if(!obj)obj=FP.getAgentData();clickStreamData=decodeURIComponent(ROM.toParamString(obj,true))}catch(e){log(e)}if(clickStreamData!=null&&clickStreamData!="")extraFlashVars+="&clickStream="+encodeURIComponent(clickStreamData);if(navigator.userAgent)extraFlashVars+="&userAgent="+encodeURIComponent(navigator.userAgent);return fv+extraFlashVars};Chat.prototype.isPersistent=function(){return this.cd.pC};Chat.prototype.setPersistent=function(state){this.cd.pC=state};Chat.prototype.getBusinessUnitID=function(){var businessUnitID;try{businessUnitID=this.getRule().getBusinessUnitID()}catch(e){log("Error getting chat business unit id: \n"+e+"\n")}if(inu1(businessUnitID))businessUnitID=getDefaultBusinessUnitID();return businessUnitID};Chat.prototype.getAgentGroupID=function(){var _this$rule,_this$rule$getAgentGr;return((_this$rule=this.rule)===null||_this$rule===void 0?void 0:(_this$rule$getAgentGr=_this$rule.getAgentGroupID)===null||_this$rule$getAgentGr===void 0?void 0:_this$rule$getAgentGr.call(_this$rule))||null};Chat.prototype.getUniqueAgentName=function(){return this.rule==null?null:this.rule.getUniqueAgentName()};Chat.prototype.getPublicAgentId=function(){return this.rule&&this.rule.getUniquePublicAgentId()};Chat.prototype.getAgentName=function(){var agentName="";try{var chatSpecAgentName=this.chatSpec.an;var chatSpecAgentAlias=this.chatSpec.daa;var chatThemeBRAgentName=this.chatSpec.chatTheme.an;var chatThemePortalAgentName=MM.getChatTheme(this.chatSpec.chatTheme.id).an;if(this.chatSpec.oct)agentName=this.chatSpec.uaa?chatSpecAgentAlias:chatSpecAgentName;if(!agentName)agentName=chatThemeBRAgentName?chatThemeBRAgentName:chatThemePortalAgentName}catch(e){log(e)}return agentName};Chat.prototype.isAgentNameFinal=function(){var chatThemeOverridesAlias=!!this.chatSpec&&!!this.chatSpec.chatTheme&&!!this.chatSpec.chatTheme.oaa;var chatSpecOverridesChatTheme=!!this.chatSpec&&!!this.chatSpec.oct;var chatSpecWithNoDefaultAlias=chatSpecOverridesChatTheme&&!!this.chatSpec.uaa&&!this.chatSpec.daa;var chatSpecWithNoAgentName=chatSpecOverridesChatTheme&&!this.chatSpec.uaa&&!this.chatSpec.an;var chatSpecOverridesAlias=chatSpecOverridesChatTheme&&!chatSpecWithNoDefaultAlias&&!chatSpecWithNoAgentName&&!this.chatSpec.uaa;if(chatThemeOverridesAlias||chatSpecOverridesAlias)return true;return false};Chat.prototype.getAgentID=function(){return inu1(this.cd.aid)?"":this.cd.aid};Chat.prototype.setAgentConfig=function(aid,buID,agID,agentAttrs){var agName=CHM.getAgentGroupNameByID(agID);this.cd.aid=inu1(aid)?"":aid;this.cd.buID=buID;this.cd.agID=agID;this.cd.agName=agName;this.cd.agtAttrs=attributesStringToMap(agentAttrs);CHM.getLastChat().businessUnitID=buID;CHM.getLastChat().agentGroupID=agID;CHM.getLastChat().agentGroupName=agName;CHM.getLastChat().agentID=aid;CHM.getLastChat().agtAttrs=this.cd.agtAttrs};Chat.prototype.setEngagementAttributes=function(engAttrs){if(!this.cd.engAttrs)this.cd.engAttrs={};for(var i=0;i<engAttrs.length;i++)this.cd.engAttrs[engAttrs[i].name]=engAttrs[i].value;CHM.getLastChat().engAttrs=this.cd.engAttrs;this.save()};Chat.prototype.testAgentAttributesValue=function(name,testValue){var agentAttrs=this.cd.agtAttrs;var values=agentAttrs[name];if(values)for(var i=0;i<values.length;i++)if(values[i]==testValue)return true;return false};Chat.prototype.getChatBusinessUnitID=function(){if(this.cd&&!inu1(this.cd.buID))return this.cd.buID;return-1};Chat.prototype.getChatAgentGroupID=function(){if(this.cd&&!inu1(this.cd.agID))return this.cd.agID;return null};Chat.prototype.getChatAgentGroupName=function(){return inu1(this.cd.agName)?null:this.cd.agName};Chat.prototype.getScriptID=function(){var id=0;try{id=this.chatSpec.stId}catch(e){}return id};Chat.prototype.getAgentExitLine=function(){return!!this.chatSpec.ael?this.chatSpec.ael:""};Chat.prototype.getOpenerID=function(){var opener=0;try{opener=this.chatSpec.oId}catch(e){}return opener};Chat.prototype.getOpenerName=function(){return!!this.chatSpec&&!!this.chatSpec.oName?this.chatSpec.oName:null};Chat.prototype.getAgentAutoOpenerId=function(){return!!this.chatSpec&&!!this.chatSpec.aaoId?this.chatSpec.aaoId:null};Chat.prototype.getCustomerName=function(){var name="";try{name=this.chatSpec.chatTheme.cn;if(!name)name=MM.getChatTheme(this.chatSpec.chatTheme.id).cn}catch(e){}return name};Chat.prototype.getChatSpec=function(){return this.chatSpec};Chat.prototype.getAutomatonId=function(){try{if(!inu1(this.chatSpec.aId))return this.chatSpec.aId;else if(!inu1(this.chatSpec.aSpecId))return this.chatSpec.aSpecId}catch(e){}return null};Chat.prototype.getAutomatonFields=function(){var result=null;try{if(this.chatSpec&&this.chatSpec.aFields)result=this.chatSpec.aFields}catch(e){}return result};Chat.prototype.getAutomatonSpecData=function(){try{if(!inu1(this.chatSpec.aspecData))return this.chatSpec.aspecData}catch(e){}return null};Chat.prototype.endCobrowseSession=function(){if(Inq["CBM"])Inq.CBM.endCobrowse()};Chat.prototype.setDisconnectionTimeout=function(period,v3timeout){if(period==0)period=v3timeout+CHM.TIMEOUT_LATENCY/1e3;this.disconnectionTimeout=parseInt(period)*1e3};Chat.prototype.getDisconnectionTimeout=function(){if(!this.disconnectionTimeout){var chatData=this.getChatData();if(chatData)this.setDisconnectionTimeout(chatData.dcTO,chatData.v3TO)}return this.disconnectionTimeout};Chat.prototype.getAgentAttributeValue=function(attrName){var agentAttributes=this.cd.agtAttrs;if(typeof attrName=="string"||attrName.length!=0||agentAttributes[attrName])return agentAttributes[attrName][0];else return""};Chat.prototype.getEngagementAttributeValue=function(attrName){var engagementAttributes=this.cd.engAttrs||{};if(typeof attrName==="string"&&attrName.length!=0&&engagementAttributes[attrName])return engagementAttributes[attrName];else return null};Chat.validate=function(data){var inou=inu1;var cerr="Chat.constructor Err: ";if(inou(data))throw cerr+"chatData empty";if(!data.chatType)throw cerr+"chat type missing";if(!data.xmlSpec)throw cerr+"chat xml data missing";if(!data.ruleID)throw cerr+"ruleID missing";if(!data.id)throw cerr+"chatID missing";if(inou(data.pC))throw cerr+"persistent chat boolean missing";if(inou(data.aMsgCnt)||data.aMsgCnt<0||inou(data.cMsgCnt)||data.cMsgCnt<0)throw cerr+"agt/cust msg cnt not properly initialized";if(inou(data.ci))throw cerr+"ci data missing"};Chat.isChatDataValid=function(chatData){try{Chat.validate(chatData);return true}catch(e){log(e);return false}};Chat.prototype.setAsyncChat=function(asyncFlag){this.cd[Chat.ASYNC_CHAT_FLAG]=!!asyncFlag?1:0;this.save()};Chat.prototype.isAsyncChat=function(){return!!this.cd[Chat.ASYNC_CHAT_FLAG]};Chat.prototype.isAsyncChatRule=function(){return typeof this.getRule().asyncChat==="function"&&this.getRule().asyncChat()};Chat.prototype.getAsyncSurveySpecID=function(){if(typeof this.getRule().asyncSurveySpecID!=="function")return null;return this.getRule().asyncSurveySpecID()};Chat.prototype.isSendChatRequestOnDemand=function(){return this.getRule().sendChatRequestOnDemand};Chat.prototype.isCreateNewConversation=function(){return typeof this.getRule().createNewConversation==="function"&&this.getRule().createNewConversation()};Chat.prototype.setAgentClosedChat=function(agentClosedChat){this.agentClosedChat=agentClosedChat};Chat.prototype.isAgentClosedChat=function(){return this.agentClosedChat};Chat.prototype.isTimedOut=function(){var now=Date.now();var then=this.getCiData().lt;if(CM.xd){var unloadTime=Number(CM.cookies["inqLT"]);if(unloadTime&&then&&unloadTime>then)then=unloadTime}then=then?then+1e3*this.getChatData().v3TO:null;return then!=null&&then<now};Chat.prototype.getVADataPass=function(){return this.vaDataPass};Chat.prototype.setVADataPass=function(vaDataPass){this.vaDataPass=vaDataPass};Chat.prototype.isAsyncReconnect=function(){return!!(this.cd&&this.cd.rec)};Chat.prototype.setAsyncReconnect=function(asyncReconnect){if(!!this.cd)this.cd.rec=asyncReconnect};Chat.prototype.resetReconnectFlag=function(save){this.cd.rec=false;if(save)this.save()};Chat.prototype.setSecureWithCustToken=function(isSecureWithCustToken){if(this.cd&&isSecureWithCustToken===true){this.cd.swct=1;this.save()}};Chat.prototype.isSecureWithCustToken=function(){return!!(this.cd&&this.cd.swct)};Chat.prototype.getEmbeddedTheme=function(){return this.chatSpec.embeddedTheme||null};Chat.prototype.isEngaged=function(){return!!this.getCiData().eng};function FlashPeer(id,data){var postponedAcifCommands=[];var nativeTimeout;function isV3C2CPersistent(){return!!v3C2cPersistent}function closePopupChat(){CHM.inactivateChat()}as17.init=function(ciInit){ciInit(mc32)};function closePopupChatFromPersistent(){var result=openerCall("closePopupChat",null,true);if(!result)log("Could not close popup chat")}function isAutoFixPrechatSurvey(){var autoFix=gc7("AUTO_FIX_PRECHAT_SURVAY",null);if(autoFix===void 0)autoFix=true;return autoFix}function setData(data){FlashPeer.data=data}function resetStopChatClose(){CHM.setStopChatClose(false)}function fireCustomEvent(eventName,rule,evt,evtDataSupplementFcn){EVM.fireCustomEvent(eventName,rule,evt,evtDataSupplementFcn)}function fireCustomEvt(eventName,jsonData,dataFcn){var evt=jsonData;if(typeof jsonData=="string")evt=MI8.JSON.parse(jsonData);EVM.fireCustomEvent(eventName,null,evt,dataFcn)}function set3rdPartyCookieFromQueue(){CM.set3rdPartyCookieFromQueue()}function reinitializeChatWithNewId(){CHM.requestChatId()}function closeChat(isConnected){if(getIOSNativeSDKInstance()){isChatProgressInSDK=false;setTimeout((function(){CHM.closeChat(isConnected)}),2e3)}else{Inq.log("closeChat");CHM.closeChat(isConnected)}}function setSurveyAuxParams(surveyParams){CHM.setSurveyAuxParams(surveyParams)}function getSurveyAuxParams(){return CHM.getSurveyAuxParams()}function setClickStreamSent(isSent){CHM.setClickStreamSent(isSent)}function isClickStreamSent(){return CHM.isClickStreamSent()}function agentSurveyCall(specID){SVYM.showSurvey(specID,"",CHM.getSurveyAuxParams())}function launchNativePostChatSurvey(url){SVYM.launchNativePostChatSurvey(url)}function showTextInput(bShow,y,x,w,h){CHM.showTextInput(bShow,y,x,w,h)}function showPersistentButton(x,y,w,h){}function setDisconnectFlag(){CHM.setDisconnectFlag(1,CHM.chatCloseReason.DISCONNECTION)}function setPersistentButtonDebugActive(active){log("setPersistentButtonDebugActive()");CHM.setPersistentButtonDebugActive(active)}function hidePersistentButton(){log("hidePersistentButton()");CHM.hidePersistentButton()}function showThankyou(){log("showThankyou()");try{CHM.closeChat(this,null,"Flash thankyou.");return true}catch(e){log(e)}return false}function hideFramesetChat(){CHM.closeChat()}function postRequestToIframeProxy(serverPath,request,id,context){LoadM.postRequestToIframeProxy(serverPath,request,id,context)}function sendRequestToServer(serverPath,request,id,context){CommunicationMgr.doCommands(serverPath,request,id,context)}function updateFrameName(id,key){throw new Error("Browser is not supported. The function updateFrameName is outdated. Please use another implementation.")}function setChatBanished(){}function setAgentConfig(_agentID,cobrowseEnabled,eventDataStr,buID,agID){CHM.assignAgent(_agentID,false,cobrowseEnabled,eventDataStr,buID,agID)}function registerWDMClient(clientID,checkInterval,isAliveCallback,resetStateCallback){WDM.registerClient(clientID,checkInterval,isAliveCallback,resetStateCallback)}function unregisterWDMClient(clientID){WDM.unregisterClient(clientID)}function getAgentData(){var params=MI8.mixAbsorber({});try{if(typeof self.inqAgentData!="undefined")params.absorb(self.inqAgentData);if(!inu1(self.inqData))if(self.inqData instanceof Array)for(var i=0;i<self.inqData.length;i++)params["data"+i]=self.inqData[i];else if(self.inqData instanceof Object)params.absorb(self.inqData);params["markerHistory"]=LDM.getLandingHistory().join(", ");var launchPageId=CHM.getChatData().getChatData().launchPageId;params["launchPageMarker"]=LDM.getPageMarkerById(launchPageId)}catch(e){}return params}function onEngaged(event){Inq.CHM.fireChatEngaged(event);BRM.fireServiceEngagedEvent(event)}function onChatLoaded(){deferredStartMgrs()}function onChatShown(event){if(CHM&&CHM.getChat())CHM.getChat().setVisible(true);CHM.fireChatShown(null);if(CHM.needToCloseOnChatShown){CHM.closeChat();FP.closeChatInterface();window["Application"]=null;CHM.needToCloseOnChatShown=false}}function onBeforeChatClosed(){CHM.fireBeforeChatClosed()}function onInteracted(event){BRM.fireServiceInteractedEvent(event)}function onCustomerMsg(eventData){CHM.fireCustomerMsgEvent(eventData)}function onAgentDataPass(agentDataPass){CHM.fireAgentDataPassEvent(agentDataPass)}function onVADataPass(vaDataPass){CHM.fireVADataPassEvent(vaDataPass)}function onChatroomReady(eventData){CHM.fireChatroomReadyEvent(eventData)}function onAgentMsg(eventData){CHM.fireAgentMsgEvent(eventData)}function onQueueWaitMsg(){CHM.fireQueueWaitMsgEvent()}function getRemoveJSInMessages(){return site.removeJSInMessages}function onAssisted(){}function PushToFrameset(_sUrl,_sTarget,_fromClick){_sTarget=_sTarget!==""?_sTarget:"_self";if(_fromClick&&_sTarget!="_self"&&_sTarget!="_top"&&_sTarget!="_parent")if(!CM.isThirdPartyCookieQueueEmpty()){var winTarget=null;var tools="left=0,top=0,toolbar=1,location=1,menubar=1,status=1,scrollbars=1";winTarget=window.parent.top.open("about:blank",_sTarget,tools);if(null==winTarget)winTarget=window.parent.top.open("about:blank",_sTarget)}CM.whenCookiesCommitted((function(){doPushToFrameset(_sUrl,_sTarget)}))}function doPushToFrameset(_sUrl,_sTarget){try{if(isPersistentWindow())if(isWebSDK)o1p().FrameBridge.pushToFrameSet(_sUrl,_sTarget);else if("_self"==_sTarget)o1p().top.document.location.href=_sUrl;else{var winTarget=null;var tools="left=0,top=0,toolbar=1,location=1,menubar=1,status=1,scrollbars=1";winTarget=window.parent.top.open(_sUrl,_sTarget,tools);if(null==winTarget)winTarget=window.parent.top.open(_sUrl,_sTarget)}else if(isWebSDK)FrameBridge.pushToFrameSet(_sUrl,_sTarget);else if("_self"==_sTarget)window.parent.top.document.location.href=_sUrl;else if(CHM.chat&&CHM.chat.chatSpec&&CHM.chat.chatSpec.chatTheme&&CHM.chat.chatSpec.chatTheme.sv==GR34.MODERN_CI_VERSION)window.parent.top.open(_sUrl,_sTarget);else{var winTarget=null;winTarget=window.parent.top.open(_sUrl,_sTarget,"top=0;left=0");if(null==winTarget)winTarget=window.parent.top.open(_sUrl,_sTarget)}}catch(e){}}function browserHasFlash(){var flash_version;if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var desc=navigator.plugins["Shockwave Flash"].description;if(desc){var versionStr=desc.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var major=parseInt(versionStr.replace(/^(.*)\..*$/,"$1"));var build=parseInt(versionStr.replace(/^.*r(.*)$/,"$1"));flash_version=parseFloat(major+"."+build)}}else if(window.ActiveXObject)try{var flashObj=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");var desc=flashObj.GetVariable("$version");if(desc){var versionArr=desc.replace(/^\S+\s+(.*)$/,"$1").split(",");var major=parseInt(versionArr[0]);var build=parseInt(versionArr[2]);flash_version=parseFloat(major+"."+build)}}catch(e){}if(typeof flash_version!="undefined")return flash_version>=Inq.requiredFlashVersion;return false}function ForceFocus(){try{try{document.createElement("object").setAttribute("type","application/x-shockwave-flash")}catch(er){}var clnt=self.document.getElementById("client");var nclnt=self.document.getElementById("notclient");if(clnt){self.focus();clnt.focus();if(nclnt)nclnt.focus()}}catch(e){}}function requestTranscript(_emailAddress,customerName){var url=urls.vanityURL+"/tagserver/transcriptrequest/logTranscriptRequest";var _chatID=CHM.getChatID();var _emailSpecID=CHM.getEmailSpecId();var _customerName=customerName?customerName:CHM.getCustomerName();var _siteID=Inq.getSiteID();var _customerID=Inq.getCustID();var _fpSessionID=CHM.getFPSessionID();var map={chatID:_chatID,emailAddress:_emailAddress,emailSpecID:_emailSpecID,customerName:_customerName,siteID:_siteID,fpSessionID:_fpSessionID,customerID:_customerID};fireCustomEvent("ChatTranscriptEmailedToCustomer",CHM.getChatData().rule,map);ROM.send(url,map)}function captureEmailAddress(_emailAddress){var map={custID:Inq.getCustID(),chatID:CHM.getChatID(),emailAddress:_emailAddress};ROM.send(urls.vanityURL+"/tagserver/emailrequest/logEmailAddressCapture",map)}function startLaunches(isActive){if(!isActive)Inq.CHM.continueChatting()}function setDragable(){if(Inq.CHM.chat!=null)Inq.CHM.chat.setDragable()}function setResizable(){if(Inq.CHM.chat!=null)Inq.CHM.chat.setResizable()}function setV3Data(dictionary){CHM.setChatInterfaceData(dictionary)}function getV3Data(){return CHM.getChatInterfaceData()}function popOutChat(b,resizable){return Inq.CHM.popOutChat(b,resizable)}function getBaseURL(){return window.Inq.urls.baseURL}function getMediaBaseURL(){return window.Inq.urls.mediaBaseURL}function getXFormsDomain(){return window.Inq.urls.xFormsDomain}function getVanityUrl(){return urls.vanityURL}function getChatRouterVanityUrl(){return CHM.getChatRouterURL()}function getTitleBarHeight(){try{return Inq.CHM.chat.chatSpec.chatTheme.tbh}catch(e){}return 50}function setPopoutChatPosAndDim(x,y,w,h){if(!inu1(x))Inq.CHM.chat.chatSpec.chatTheme.px=x;if(!inu1(y))Inq.CHM.chat.chatSpec.chatTheme.py=y;if(!inu1(w))Inq.CHM.chat.chatSpec.chatTheme.pw=w;if(!inu1(h))Inq.CHM.chat.chatSpec.chatTheme.ph=h}function getPopupCloserWidth(){try{return Inq.CHM.chat.chatSpec.chatTheme.ciw}catch(e){}return 50}function getLocalizedMessage(key,ignoreUndefinedText){return Inq.getLocalizedMessage(key,ignoreUndefinedText)}function getCobrowseEnableMinimizeRestore(){return Inq.getCobrowseEnableMinimizeRestore()}function gkg23(){return CONVM.getConversationTokenID()}function gkh24(){return CONVM.getConversationObjectID()}function getSkinLocation(){try{return Inq.CHM.chat.chatSpec.chatTheme.pos}catch(e){}return"UPPER_LEFT"}function getSkinHeight(){try{return Inq.CHM.chat.chatSpec.chatTheme.dh}catch(e){}return 300}function getSkinWidth(){try{return Inq.CHM.chat.chatSpec.chatTheme.dw}catch(e){}return 400}function getSkinLeft(){try{return Inq.CHM.chat.chatSpec.chatTheme.lx}catch(e){}return 0}function getSkinTop(){try{return Inq.CHM.chat.chatSpec.chatTheme.ly}catch(e){}return 0}function fireNativeSurveyLaunchEvent(){try{return SVYM.fireNativeSurveyLaunchEvent()}catch(e){}}function getPersistentXPos(){try{return Inq.CHM.chat.chatSpec.chatTheme.px}catch(e){}return 0}function getPersistentYPos(){try{return Inq.CHM.chat.chatSpec.chatTheme.py}catch(e){}return 0}function getPersistentWidth(){try{return Inq.CHM.chat.chatSpec.chatTheme.pw}catch(e){}return 0}function getPersistentHeight(){try{return Inq.CHM.chat.chatSpec.chatTheme.ph}catch(e){}return 0}function _getCustGeoData(){return getCustGeoData()}function getFlashVars(){try{return Inq.CHM.chat.getFlashVars()}catch(e){log("Error obtaining flashvars from Chat object: "+e)}return""}function getSkin(){try{return Inq.CHM.chat.getSkin()}catch(e){}var ext=getChatSkinFmt();return"TouchCommerce."+ext}function getChatSkinFmt(){return getChatSkinFormat()}function getImagePath(){return Inq.CHM.chat.getImagePath()}function closePersistent(isConnected){CHM.closePersistent(isConnected)}function isThankYouEnabled(){return window.Inq.CHM.thankYouEnabled}function tryue(blockDetails){var serviceType="ALL";var period=-1;if(!inu1(blockDetails)){if(blockDetails.charAt(0)=="("&&blockDetails.charAt(blockDetails.length-1)==")")blockDetails=blockDetails.substr(1,blockDetails.length-2);var blockParams=MI8.JSON.parse(blockDetails);serviceType=blockParams.serviceType;period=blockParams.period}window.Inq.tryue(serviceType,period)}function wasSaleAction(){return window.Inq.wasSaleAction()}function setVisible(visible){try{var app=window["Application"];if(app&&app.application&&app.application.setVisible)app.application.setVisible(visible)}catch(e){log(e)}}function sendDTEvent(eventName,data){try{var app=window["Application"];if(app&&app.application&&app.application.sendDTEvent)app.application.sendDTEvent(eventName,data)}catch(e){log(e)}}function prepareDataAndSendDTEvent(eventName,button,data){return DT.sendDTEvent(eventName,button,data)}function _executeCustomCommand(params){executeCustomCommand(params)}function urtvd3(response){try{var data=JSON.parse(response.data);var inst=GR34.getInstance();inst.urtvd3(data.isActive,data.protoDomain,data.transferURL,data.needNewOpener)}catch(e){let12(plc1("Exception during urtvd3 response processing "+e))}}function registerPersistentWindow(){return openerCall("registerPersistentWindowInOpener",[parent],false)}function isPersistentChat(){return CHM.isPersistentChat()}function setPersistentWindowActive(state){var inst=GR34.getInstance();inst.setPersistentWindowActive(state)}function CloseChatFromPersistent(isConnected,conversationResolved){log("@@@CloseChatFromPersistent");CHM.r345jjm(isConnected,conversationResolved);return true}function bind(handler){var handlerContext={obj:this,method:handler,safeFunc:function(){var closure=arguments.callee.closure;return closure.method.apply(closure.obj,arguments)}};handlerContext.safeFunc.closure=handlerContext;return handlerContext.safeFunc}function getCBC(){var cbc=null;if(CHM.isPersistentWindow()){var opener=window.parent.opener;try{if(opener)if(opener.inqFrame&&opener.inqFrame.Inq&&opener.inqFrame.Inq["CBC"])cbc=opener.inqFrame.Inq["CBC"];else logInfo("opener.inqFrame.Inq['CBC'] is not accessible");else logInfo("No window opener")}catch(error){}}if(!cbc)if(window.Inq){if(window.Inq["CBC"])cbc=window.Inq["CBC"]}else if(window.inqFrame&&window.inqFrame.Inq&&window.inqFrame.Inq.CBC)cbc=window.inqFrame.Inq.CBC;return cbc}function acceptCobrowseInvitation(flagStartBenchmarkTest){if(site.enableCobrowse)inqFrame.com.inq.flash.client.chatskins.CoBrowseMgr.acceptCobInv(flagStartBenchmarkTest);else logError("Cobrowse is not available for this site")}function acceptCobrowseInvitationSafe(flagStartBenchmarkTest){if(site.enableCobrowse)if(Inq.CBM)Inq.CBM.startCobrowse(flagStartBenchmarkTest);else logError("Cobrowse Manager is not available");else logError("Cobrowse is not available for this site")}function acceptCobrowseShareControl(flagStartBenchmarkTest){if(site.enableCobrowse)if(Inq.CBM)Inq.CBM.startSharedCobrowse(flagStartBenchmarkTest);else logError("Cobrowse Manager is not available");else logError("Cobrowse is not available for this site")}function endCobrowseSession(){if(!site.enableCobrowse)return;if(Inq.CBM)Inq.CBM.stopCobrowseQuiet();else lmt12("CBM is not defined on endCobrowseSession() method call",LOG_LEVELS.WARN,null,true)}function endCobByEtlEvent(windowId){if(!site.enableCobrowse)return;if(Inq.CBM)Inq.CBM.stopByEtlEvent(windowId);else lmt12("CBM is not defined on endCobrowseSession() method call",LOG_LEVELS.WARN,null,true)}function isCobrowseEngaged(){var cbc=getCBC();return site.enableCobrowse&&cbc&&cbc.isCobrowseEngaged()}function isSharedControl(){var cbc=getCBC();return site.enableCobrowse&&cbc&&cbc.isSharedControl()}function logInfo(message){ROM.send(urls.loggingURL,{level:"INFO",line:message+" [chatID="+CHM.getChatID()+"]"})}function logData(url,data){ROM.send(url,data)}function logError(messagePrefix,e,chatId){var errorMessage=e?e.message:"";var errorDetails="";if(logError.caller)errorDetails+=" Caller: "+logError.caller.toString().split("{")[0];if(e&&e.stack)errorDetails+=" Stack: "+e.stack;sendMessageToTagServer(plc1(messagePrefix+errorMessage+errorDetails,chatId),"ERROR")}function logAcifError(message){if(message)let12(plc1(message))}function logErrorToServer(message){if(message)let12(message,true)}function logInfoToServer(message){if(message)logInfoToTagServer(message)}function sendText(){this.ciSendText(null)}function ciSendText(){throw"sendText is not defined"}function ciAcceptCobInv(flagStartBenchmarkTest){throw"ciAcceptCobInv is not defined"}function ciActionBtnCloseChat(){throw"ciActionBtnCloseChat is not defined"}function ciActionBtnCloseThankyou(){throw"ciActionBtnCloseThankyou is not defined"}function ciActionRestoreAndExitChat(){throw"ciActionRestoreAndExitChat is not defined"}function ciDeclineCobInv(){throw"ciDeclineCobInv is not defined"}function ciAcceptCobShareInv(flagStartBenchmarkTest){throw"ciAcceptCobShareInv is not defined"}function ciDeclineCobShareInv(){throw"ciDeclineCobShareInv is not defined"}function ciCheckCobrowseMgrAvalibility(){return false}function ciAgentEndsCob(){throw"ciAgentEndsCob is not defined"}function ciSendCobrowseEnded(){throw"ciSendCobrowseEnded is not defined"}function ciSendMessageQuietly(){throw"ciSendMessageQuietly is not defined"}function ciFocusCobEndBtn(){throw"ciFocusCobEndBtn is not defined"}function ciCobrowseSuppressedPage(){throw"ciCobrowseSuppressedPage is not defined"}function ciCobrowseFailHandler(){throw"ciCobrowseFailHandler is not defined"}function ciSendResultOfBenchmarkTest(){throw"ciSendResultOfBenchmarkTest is not defined"}function ciSetFocusOnChatInputField(){throw"ciSetFocusOnChatInputField is not defined"}function ciGetCobEndButtonID(){throw"ciGetCobEndButtonID is not defined"}function ciAcceptVideoInv(){throw"ciAcceptVideoInv is not defined"}function ciDeclineVideoInv(){throw"ciDeclineVideoInv is not defined"}function ciStopVideo(){throw"ciStopVideo is not defined"}function setCiFunction(fName,fBody){if(/^ci/.test(fName))this[fName]=fBody;else throw"Error: CI framework function name must start with ci"}function Glk4(callback){ROM.Glk4(callback)}function ciHideLayer(layerID){log("ciHideLayer: "+layerID);try{var hideLayer=window.inqFrame.com.inq.flash.client.control.XFrameWorker.hideLayer;if(!inu1(hideLayer))hideLayer(layerID)}catch(e){log("ciHideLayer: hideLayer function was not published in CI: "+e.message)}}function ciShowLayer(layerID){log("ciShowLayer: "+layerID);try{var showLayer=window.inqFrame.com.inq.flash.client.control.XFrameWorker.showLayer;if(!inu1(showLayer))showLayer(layerID)}catch(e){log("ciShowLayer: showLayer function was not published in CI: "+e.message)}}function ciGrowLayer(layerID){log("ciGrowLayer: "+layerID);try{var growLayer=window.inqFrame.com.inq.flash.client.control.XFrameWorker.grow;if(!inu1(growLayer))growLayer(layerID)}catch(e){log("ciGrowLayer: grow function was not published in CI: "+e.message)}}function ciShrinkLayer(layerID){log("ciShrinkLayer: "+layerID);try{var shrinkLayer=window.inqFrame.com.inq.flash.client.control.XFrameWorker.shrink;if(!inu1(shrinkLayer))shrinkLayer(layerID)}catch(e){log("ciShrinkLayer: shrink function was not published in CI: "+e.message)}}function ciMinimize(){try{var minimize=window.inqFrame.com.inq.flash.client.control.MinimizeManager.actionMinimize;if(!inu1(minimize))minimize()}catch(e){log("ciMinimize: actionMinimize function was not published in CI: "+e.message,"error")}}function ciRestore(){try{var restore=window.inqFrame.com.inq.flash.client.control.MinimizeManager.actionRestore;if(!inu1(restore))restore()}catch(e){log("ciRestore: actionRestore function was not published in CI: "+e.message,"error")}}function ciIsMinimized(){try{var isMinimized=window.inqFrame.com.inq.flash.client.control.MinimizeManager.isMinimized;if(!inu1(isMinimized))return isMinimized()}catch(e){log("ciIsMinimized: isMinimized function was not published in CI: "+e.message,"error")}return false}function isLoggingDisabled(){return JSLoggingDisabled}function preventChatClose(value){try{var app=window["Application"];if(app&&app.application&&app.application.setPreventChatClosed)app.application.setPreventChatClosed(value);else log("ERROR: setPreventChatClosed failed for layer ["+layerID+"]: app.application is not initialized")}catch(e){log(e)}}function createXFrame(div,url,businessUnitID,scrolling,data,initiator,location,initOnLoad,method){var ldr=new XFormsLoader;return ldr.createXFrame(div,url,businessUnitID,scrolling,data,null,initiator,location,initOnLoad,method)}function getClientPageURL(){if(isWebSDK)return window.pageUrl;return win.location.href}function updateXFrameFromBizRule(layerID,url,businessUnitID){try{var app=window["Application"];if(app&&app.application&&app.application.updateXFrameFromBizRule)app.application.updateXFrameFromBizRule(layerID,url,businessUnitID);else log("ERROR: update-xframe failed for layer ["+layerID+"]: app.application is not initialized")}catch(e){log(e)}}function showAutomaton(layerId,url,businessUnitId,initiator){try{var app=window["Application"];if(app&&app.application&&app.application.showAutomaton)app.application.showAutomaton(layerId,url,businessUnitId,initiator);else log("ERROR: showAutomaton failed for layer ["+layerId+"]: app.application is not initialized")}catch(e){log(e)}}function isInitializationRequired(){var o=o1p();if(o&&o.Inq.isPersistentInitialization)return o.Inq.isPersistentInitialization;return false}function resetInitializationFlag(){var o=o1p();if(o&&o.Inq.isPersistentInitialization)o.Inq.isPersistentInitialization=false}var URL_REGEXP_IS_FORM=/(^.*)(forms(v3)?\.inq\.com)/;function parseXFrameUrl(url){var pattern=new RegExp(URL_REGEXP_IS_FORM);if(url.search(URL_REGEXP_IS_FORM)>=0)url=url.replace(URL_REGEXP_IS_FORM,getXFormsDomain());else if(url.charAt(0)=="/"&&url.charAt(1)!="/")url=getXFormsDomain()+url;var res=url.split("?");var params={};if(res[1]!=null){var oldParams=res[1].split("&");for(var i=0;i<oldParams.length;i++){var nameValue=oldParams[i].split("=");params[nameValue[0]]=nameValue[1]}}return{url:res[0],params:params}}function getPageID(){return Inq.LDM.getPageID()}function isPortal(){return true}function getBusinessUnitID(){return CHM.getChat()?CHM.getChat().getBusinessUnitID():getDefaultBusinessUnitID()}function getChatOwnerBusinessUnitID(){return CHM.getChat()&&CHM.getChat().getChatData()&&CHM.getChat().getChatData().buID||""}function getCustID(){return Inq.getCustID()}function getSesID(){return getSessionID()}function getFPSessionID(){return CHM.getFPSessionID()}function getIncAsID(){return asi4()}function getPageMarker(){return LDM.getPageMarker()}function getAutomatonDataMap(){var automatonDataMap=PM.getVar("automatonDataMap");return automatonDataMap?automatonDataMap.z0():""}function getAutomatonDatapass(){var automatonDatapass=PM.getVar("automatonDatapass");return automatonDatapass?automatonDatapass.z0():""}function getPersistentCustomerID(){return objectAsLogString(getPersistCustID(),true)}function getAuthenticatedUser(){if(getAuthUser())return JSON.stringify(getAuthUser());return null}function getBrID(){return CHM.getChat().getRule().getID()}function getBrName(){return CHM.getChat().getRule().getName()}function getAgentID(){return CHM.getAgentID()}function getAgentGroupName(){return CHM.getChat()&&CHM.getChat().getChatData()&&CHM.getChat().getChatData().agName||""}function getAgentGroupDisplayName(){var agID=CHM.getChat()&&CHM.getChat().getChatData()&&CHM.getChat().getChatData().agID||void 0;return CHM.getAgentGroupDisplayNameByID(agID)}function getAgentGroupId(){return CHM.getChat()&&CHM.getChat().getChatData()&&CHM.getChat().getChatData().agID||void 0}function getBusinessUnitName(){var buID=CHM.getChat()&&CHM.getChat().getChatData()&&CHM.getChat().getChatData().buID||void 0;return CHM.getBusinessUnitNameByID(buID)}function getBusinessUnitDisplayName(){var buID=CHM.getChat()&&CHM.getChat().getChatData()&&CHM.getChat().getChatData().buID||void 0;return CHM.getBusinessUnitDisplayNameByID(buID)}function onCookiesCommitted(handler){var closure;if(typeof handler=="string"){lwt12("Handler was passed as a string"+" to onCookiesCommitted. Handler "+handler);closure=evaluateLegacySettings("function() {"+handler+"}")}else closure=handler;CM.whenCookiesCommitted(closure)}function when3rdPartyCookieCommitted(vcnt){CM.when3rdPartyCookieCommitted(vcnt)}function _getDeviceType(){var deviceType="Other";try{deviceType=getDeviceType()}catch(e){log("Error in getDeviceType: "+e)}return deviceType}function _isIOS(){return isIOS()}function _isAndroid(){return getOSType().toLowerCase()==="android"}function _isMobile(){return isMobileDevice()}function _isApplicationInitialised(){var app=window["Application"];if(app&&app.application)return true;else{log("ERROR: Application is not initialized");return false}}function isPhone(){return d8t("Phone")}function closePersistentWindowIfOpen(){if(!inu1(CHM.earlyPopout))CHM.earlyPopout.close();if(!inu1(CHM.popoutWindow))CHM.popoutWindow.close()}function getBuRuleAgentGroupID(brID){return BRM.rb41(brID).getAgentGroupID()}function startChatInterface(){window.launchWhenReady=true}function closeChatInterface(){var app=window["Application"];if(app&&app.application&&app.application.close)try{app.application.close()}catch(e){Inq.log("Could not close ChatInterface: "+e)}}function postponeAcifCommand(elementId,attributes,errorLogging){postponedAcifCommands.push({ID:elementId,ATTR:attributes,LOG:errorLogging})}function applyAcifCommands(){var tmpStorage=postponedAcifCommands.slice();postponedAcifCommands.length=0;for(var i=0;i<tmpStorage.length;i++)setElementPosition(tmpStorage[i].ID,tmpStorage[i].ATTR,tmpStorage[i].LOG)}function setElementPosition(elementId,attributes,errorLogging){errorLogging=typeof errorLogging!=="undefined"?errorLogging:true;var app=window["Application"];if(app&&app.application)if(app.application.getVisible())try{app.application.updateStyle(elementId,attributes)}catch(e){if(errorLogging)Inq.log("Cannot reposition element '"+elementId+"'. "+e)}else postponeAcifCommand(elementId,attributes,errorLogging);else if(errorLogging)Inq.log("Cannot reposition element '"+elementId+"'. CI is not active.")}function _getBrowserTypeAndVersion(){return getBrowserTypeAndVersion()}function _getBrowserMajorVer(compatibility){return getBrowserMajorVer(compatibility)}function restartTimer(){var app=window["Application"];var errMessage="Could not restart timer to close not started chat: ";if(app&&app.application&&app.application.restartTimer)try{app.application.restartTimer()}catch(e){Inq.log(errMessage+e)}else Inq.log(errMessage+"app.application.restartTimer is not initialized")}function ciActionBtnCloseChat(){throw"ciActionBtnCloseChat is not defined"}function fileTransferSize(){return fileUploadSize}function fileDelSetting(){return fileDeleteSetting}function fileTransferServerUrl(){return site.fileTransferUrl}function fileTransferExtensions(){return site.fileTransferExtensions}function fileTransferApiUrl(){return site.fileTransferApiUrl}function noJSHostingInTagserver(){return site.noJSHosting}function getClientStaticURL(){return site.clientStaticUrl}function noV3FrameChat(){return site.noChatV3Frame}function setCABeacon(action,data){CHM.setCABeacon(action,data)}function setActiveWindowId(){CHM.setActiveWindowId()}function closeChatMonitor(){CHM.closeChatMonitor()}function prefetchURL(path){prefetchResource(path)}function _isValidHttpUrl(str){return isValidHttpUrl(str)}function loadKMSlibraries(){Inq.CHM.chat.preloadVidyo()}function endWebRTCCall(closeOnEnd){window.inqFrame.com.inq.flash.client.control.WebRTCMgr.endCall(closeOnEnd)}function getQueueMessagingSpec(){return null}function getQueueMessagingSpecId(){return CHM.getQueueMessagingSpecId()}function getAgentsAvailabilityCheckUrl(){return urls.agentsAvailabilityCheckURL}function getAutomatonSpecData(){return CHM.getChat()&&CHM.getChat().getAutomatonSpecData()}function getChatRule(){return CHM.getChat()&&CHM.getChat().getRule()}function getVarValue(name){return PM.getVar(name)&&PM.getVar(name).z0()}function setVarValue(name,value){PM.getVar(name)&&PM.getVar(name).z3(value)}function addListener(listener){EVM.addListener(listener)}function isChatConnected(){try{var isChatConnected=window.inqFrame.com.inq.flash.client.control.XFrameWorker.isChatConnected;if(!inu1(isChatConnected))return isChatConnected()}catch(e){log("isChatConnected: isChatConnected function was not published in CI: "+e.message)}}function ciPreparingClosingChat(){try{var preparingClosingChat=window.inqFrame.com.inq.flash.client.control.XFrameWorker.preparingClosingChat;if(!inu1(preparingClosingChat))preparingClosingChat()}catch(e){log("preparingClosingChat: preparingClosingChat function was not published in CI: "+e.message)}}function ciCloseChat(){try{var closeChat=window.inqFrame.com.inq.flash.client.control.XFrameWorker.closeChat;if(!inu1(closeChat))return closeChat()}catch(e){log("closeChat: closeChat function was not published in CI: "+e.message)}}function ciEngageChat(chatParams){try{var engageChat=window.inqFrame.com.inq.flash.client.control.XFrameWorker.engageChat;if(!inu1(engageChat))engageChat(chatParams)}catch(e){log("engageChat: engageChat function was not published in CI: "+e.message)}}function expandChat(){if(_isApplicationInitialised()&&Application.expandChat)return Application.expandChat();else throw"ERROR: expandChat is not initialized"}function shrinkChat(){if(_isApplicationInitialised()&&Application.shrinkChat)return Application.shrinkChat();else throw"ERROR: shrinkChat is not initialized"}function ciSetEngageParameters(chatParams){try{var setEngageParameters=window.inqFrame.com.inq.flash.client.control.XFrameWorker.setEngageParameters;if(!inu1(setEngageParameters))setEngageParameters(chatParams)}catch(e){log("setEngageParameters: setEngageParameters function was not published in CI: "+e.message)}}function ciResizeStage(stageWidth,stageHeight){try{var resizeStage=window.inqFrame.com.inq.flash.client.control.XFrameWorker.resizeStage;if(!inu1(resizeStage))resizeStage(stageWidth,stageHeight)}catch(e){log("resizeStage: resizeStage function was not published in CI: "+e.message)}}function ciMoveStage(location,x,y){try{var moveStage=window.inqFrame.com.inq.flash.client.control.XFrameWorker.moveStage;if(!inu1(moveStage))moveStage(location,x,y)}catch(e){log("moveStage: moveStage function was not published in CI: "+e.message)}}function ciSetCircularModalWindow(div,firstEl,lastEl){try{var setCircularModalWindow=window.inqFrame.com.inq.flash.client.control.XFrameWorker.setCircularModalWindow;if(!inu1(setCircularModalWindow))return setCircularModalWindow(div,firstEl,lastEl)}catch(e){log("setCircularModalWindow: setCircularModalWindow function was not published in CI: "+e.message)}}function ciRemoveCircularModalWindow(){try{var removeCircularModalWindow=window.inqFrame.com.inq.flash.client.control.XFrameWorker.removeCircularModalWindow;if(!inu1(removeCircularModalWindow))removeCircularModalWindow()}catch(e){log("removeCircularModalWindow: removeCircularModalWindow function was not published in CI: "+e.message)}}function ciIsCircularTabbingEnabled(){try{var isCircularTabbingEnabled=window.inqFrame.com.inq.flash.client.control.XFrameWorker.isCircularTabbingEnabled;if(!inu1(isCircularTabbingEnabled))return isCircularTabbingEnabled()}catch(e){log("isCircularTabbingEnabled: isCircularTabbingEnabled function was not published in CI: "+e.message)}}function ciSetAutomatonDataMapXcd(json){try{var setAutomatonDataMapXcd=window.inqFrame.com.inq.flash.client.control.XFrameWorker.setAutomatonDataMapXcd;if(!inu1(setAutomatonDataMapXcd))setAutomatonDataMapXcd(json)}catch(e){log("setAutomatonDataMapXcd: setAutomatonDataMapXcd function was not published in CI: "+e.message)}}function ciTransitionPage(){try{var transitionPage=window.inqFrame.com.inq.flash.client.control.XFrameWorker.transitionPage;if(!inu1(transitionPage))transitionPage()}catch(e){log("transitionPage: transitionPage function was not published in CI: "+e.message)}}function isChatVisible(){return CHM.chat&&CHM.chat.isVisible()}function stopClosingChatFromPersistent(){CHM.StopClosingChatFromPersistent()}function registerPersistentWindowInOpener(persistentParent){CHM.persistentWindow=persistentParent;return true}function isPersistentWindowRegisteredInOpener(){return!!CHM.persistentWindow}function getInternalFunction(funcName){var closure={addVisitorAttributes:addVisitorAttributes,assignAgent:assignAgent,banVisitorAttributes:banVisitorAttributes,closePopupChat:closePopupChat,CloseChatFromPersistent:CloseChatFromPersistent,cookiesCleaningDetected:cookiesCleaningDetected,fireChatLaunched:fireChatLaunched,getAgentData:getAgentData,getCachedCookies:getCachedCookies,getChat:getChat,getPage:getPage,isPersistentWindowRegisteredInOpener:isPersistentWindowRegisteredInOpener,logData:logData,registerPersistentWindowInOpener:registerPersistentWindowInOpener,removeVisitorAttributes:removeVisitorAttributes,setPersistentWindowActive:setPersistentWindowActive,stopClosingChatFromPersistent:stopClosingChatFromPersistent,unbanVisitorAttributes:unbanVisitorAttributes};return closure[funcName]}function callFromPersistent(funcName,args,async){var _func=getInternalFunction(funcName);if(typeof _func=="function"){if(!Array.isArray(args)&&Object.prototype.toString.call(args)!=="[object Arguments]"){var aArgs=[];if(typeof args==="object"&&args&&args.length)for(var i=0;i<args.length;i++)aArgs.push(args[i]);args=aArgs}try{if(async)return setTimeout((function(){_func.apply(null,args)}),1);else return _func.apply(null,args)}catch(e){logErrorToServer("ERROR: Call function from persistent window failed"+", function="+funcName)}}else logErrorToServer("ERROR: Call function from persistent window failed"+", "+funcName+" is not a function.")}function cookiesCleaningDetected(){CM.cookiesCleaningDetected()}function getDisconnectionTimeout(){return CHM.getDisconnectionTimeout()}function isV3Continue(){return CHM.isV3Continue()}function getVisitorAttributes(){return VAM.getCopyAsArray(true).join(";")}function getCachedCookies(){return CM.getCachedCookies()}function addVisitorAttributes(visitorAttributes){VAM.add(visitorAttributes)}function removeVisitorAttributes(visitorAttributes,fromRemoveAll){VAM.remove(visitorAttributes,fromRemoveAll)}function banVisitorAttributes(visitorAttributes,duration){VAM.ban(visitorAttributes,duration)}function unbanVisitorAttributes(visitorAttributes){VAM.unban(visitorAttributes)}function sendSystemMessage(message,cssClass,context){if(inqFrame.com.inq.flash.client.control.sendSystemMessage)try{inqFrame.com.inq.flash.client.control.sendSystemMessage(message,cssClass,context)}catch(e){log(e)}}function _sendAutomatonMessage(msgType,message,cssClass,context){if(msgType==="datapass")ROM.sendDataToAgent(CHM.getAgentID(),message);else sendSystemMessage(message,cssClass,context)}function getChat(){return CHM.getChat()}function getPage(id){return LDM.getPage(id)}function endChatSession(chatID){CHM.endChatSession(chatID)}function getEmbeddedTheme(){return CHM.getChat()&&CHM.getChat().getEmbeddedTheme()}function isEmbeddedThemeValid(){var embeddedTheme=getEmbeddedTheme();if(embeddedTheme)return embeddedTheme.isValid;return false}function isMultiChatSupported(){return CHM.isMultiChatSupported()}function getSiteConstants(){return site.businessConstants()}function setIOSSDKProgress(progress){if(progress==true)isChatProgressInSDK=true;else isChatProgressInSDK=false;if(!Inq.initialized)init.call(Inq)}function setNativeSDKConversationPlayStatus(pendingMsg){if(pendingMsg)C2CM.showDisabledIcon()}function launchChatByC2CID(c2cIdx){if(c2cIdx>=0)C2CM.agrty(c2cIdx)}function getSDKInstance(){return{onC2CClicked:function(idx,callback){if(arguments.length!=2){logError("Missing arguments, needs c2cid and a callback to continue");return}C2CM.requestExtChat(idx,callback)},chatDisplayed:function(displayedParams,isRebindngCallbacks){if(typeof displayedParams!="object")return;window.inqFrame.Application.application.chatUIRendered(displayedParams,isRebindngCallbacks)},engageChat:function(initialMessage,callback){window.inqFrame.Application.application.engage(initialMessage,false,null,callback)},autoEngage:function(autoText,engageParams,callback){window.inqFrame.Application.application.engage(autoText,true,engageParams,callback)},getMessages:function(callback){window.inqFrame.Application.application.getMessages(callback)},closeChat:function(){window.inqFrame.Application.application.closeEngagement()},sendMessage:function(msg){window.inqFrame.Application.application.sendMessage(msg)},sendActivityMessage:function(type){window.inqFrame.Application.application.sendChatActivity(type)},requestEmailTranscript:function(emailAddress){window.inqFrame.Application.application.requestTranscript(emailAddress)},isChatInProgress:function(){if(window.inqFrame.Application)return window.inqFrame.Application.application.isChatInProgress();else return CHM.isChatInProgress()},getOpenerScripts:function(responseCb,openerID,errorCb){if(typeof responseCb!="function")return;if(window.inqFrame.Application)window.inqFrame.Application.application.getOpeners(responseCb);else if(openerID)ROM.get(urls.baseURL+"/scripts/getScript?js=yes&siteID="+getSiteID()+"&scriptID="+openerID,generateRequestId("getScript"),0,(function(resp){if(resp.responseStatus==200)responseCb(resp.data);else errorCb(resp)}),errorCb)},setOpeners:function(openers,agentAlias){window.inqFrame.Application.application.setOpeners(openers,agentAlias)},isVirtualAgent:function(){return window.inqFrame.Application.application.isVirtualAgent()},isAsyncChat:function(){return window.inqFrame.Application.application.isAsyncChat()},isConnected:function(){return window.inqFrame.Application.application.isConnected()},getAsyncChatMode:function(){return window.inqFrame.Application.application.getAsyncChatMode()},showOpenerForEndedConv:function(){return window.inqFrame.Application.application.showOpenerForEndedConv()},getPersistenceManager:function(){return window.inqFrame.Application.application.getPersistenceManager()},getPersistedData:function(key,defaultValue){return window.inqFrame.Application.application.getPersistedValue(key,defaultValue)},setPersistedData:function(key,value){window.inqFrame.Application.application.setPersistedValue(key,value)},removePersistedDataByKey:function(key){window.inqFrame.Application.application.removePersistedValue(key)},startCobrowseSession:function(shared){if(shared)FP.ciAcceptCobShareInv(true);else FP.ciAcceptCobInv(true)},declineCobrowseInvite:function(shared){if(shared)FP.ciDeclineCobShareInv();else FP.ciDeclineCobInv()},sendVALinkMessage:function(event,customerMsgCB,linkClickCb,engagedCb){window.inqFrame.Application.application.sendVALinkClicked(event,customerMsgCB,linkClickCb,engagedCb)},sendVAMessage:function(msgObj){window.inqFrame.Application.application.sendVAMessage(msgObj)},sendDataPass:function(dpObject){if(typeof dpObject!="object"){logError("sendDataPass only accepts Object as its argument.");return}else if(!getAgentID()){logError("sendDataPass can be invoked only afer an agent is assigned.");return}dpObject["engagementID"]=CHM.getChatID();dpObject["agentID"]=getAgentID();ROM.sendDataToAgent(getAgentID(),dpObject)},getPreviousAsyncTranscript:function(callback){Glk4((function(response){callback(response)}))},isLastConversationActive:function(){return isConversationActive},sendRichContentMessage:function(text,data,engagedCallback){if(typeof data=="object")data=JSON.stringify(data);window.inqFrame.Application.application.sendRichContentMessage(text,data,engagedCallback)},getAsyncUnReadMsgCount:function(ruleID,callback){var rule=BRM.rb41(ruleID);var data=prepareBaseBodyForAsyncChatDataRequest();data.businessUnitID=rule.getBusinessUnitID();ROM.post(urls.requestCustomerStatus,data,null,null,callback)},getImagePath:function(){return window.inqFrame.Application.application.getImagePath()},getSkinDynamicAssetsPath:function(){return getSkinRootUrl()+getThemeName()+"/"},checkIfMinimized:function(){var embeddedTheme=getEmbeddedTheme();if(window.inqFrame.Application){var app=window.inqFrame.Application.application;var isValidEmbedded=embeddedTheme&&embeddedTheme.isValid;var isMinimized=app.isMinimized();if(isMinimized&&isValidEmbedded){this.sendActivityMessage("restore");return{state:false}}return{state:isMinimized,count:app.getMinimizedCount()}}return{state:false}},resetMinimizedCount:function(){window.inqFrame.Application.application.resetMinimizedCount()},ACTIVITY_STATE:{MINIMIZED:"minimize",RESTORED:"restore",START_TYPING:"startTyping",STOP_TYPING:"stopTyping"},isChatQueued:function(){return window.inqFrame.Application.application.isChatQueued()},isPersistentWindow:function(){return window.inqFrame.Application.application.isPersistentWindow()},getDeviceType:function(){return window.inqFrame.Application.application.getDeviceType()},getThemeInfo:function(){var app=window.inqFrame.Application.application;var theme={};theme["skinWidth"]=getSkinWidth();theme["skinHeight"]=getSkinHeight();theme["skinPosition"]=getSkinLocation();theme["skinLeft"]=getSkinLeft();var skinRight=app.getPersistedValue(RIGHT,-1);var skinBottom=app.getPersistedValue(BOTTOM,-1);if(skinRight)theme["skinRightSaved"]=skinRight;theme["skinTop"]=getSkinTop();if(skinBottom)theme["skinBottomSaved"]=skinBottom;theme["titleBarHeight"]=getTitleBarHeight();theme["deviceType"]=getDeviceType();theme["dragAreaOffset"]=getPopupCloserWidth();theme["imagePath"]=this.getImagePath();theme["skinPath"]=Inq.urls.skinURL+getThemeName()+"/";theme["minimized"]=this.checkIfMinimized();var embeddedTheme=getEmbeddedTheme();if(embeddedTheme&&embeddedTheme.isValid)theme["embedded"]=embeddedTheme;return theme},saveWindowPosition:function(bottom,right){var oPos={};oPos[RIGHT]=right;oPos[BOTTOM]=bottom;window.inqFrame.Application.application.setPersistedValues(oPos)},getChatParams:function(){var params=window.inqFrame.Application.application.getChatParams();params.agentID=getAgentID();params.countryCode=_getCustGeoData().country_code;params.regionCode=_getCustGeoData().region_code;params.chatType=CHM.getChatType();params.agentGroupName=getAgentGroupName();params.businessUnitName=getBusinessUnitName();return params},logEventToDW:function(evtList){ROM.post(urls.logDataEvtListURL,{stringifiedDataArray:JSON.stringify(evtList.eventList)})},logCIDVVEvent:function(data,eventType){const url="".concat(urls.logCiEvent,"?domain=chat&event=").concat(eventType);ROM.postJson(url,data,true)},submitNativePostChatSurvey:function(data){if(CHM.isPersistentWindow()){var sdk=isWebSDK?o1p().FrameBridge.Inq.SDK:window.parent.opener.Inq.SDK;sdk.submitNativePostChatSurvey(data)}else submitNativePostChatSurvey(data)},checkAgentAvailability:function(buId,agID,agentAttrs,qt,callback){var data={siteID:Inq.getSiteID(),buID:buId};if(agID)data.agID=agID;if(agentAttrs)data.agentAttributes=agentAttrs;if(qt)data.queueThreshold=qt;ROM.post(urls.agentsAvailabilityCheckURL,data,null,null,(function(resp){if(resp.responseStatus==200)callback&&callback(resp.data);else callback&&callback(null)}))},setCustomerName:function(name){if(name)window.inqFrame.Application.application.setCustomerName(name)},getCustomerName:function(){return window.inqFrame.Application.application.getCustomerName()},uploadFile:function(file,statusCallback,engagedCallback){return window.inqFrame.Application.application.uploadFile(file,statusCallback,engagedCallback)},sendSystemMessage:function(text){window.inqFrame.Application.application.sendSystemMsg(text)},isContinued:function(){return window.inqFrame.Application.application.isContinued()},isOnlyPostChatSurvey:function(){return isCEAPIPostChatSurveyMode()},getPostChatSurveyData:function(){return parent.CEAPI_POST_CHAT_SURVEY_DATA},logError:function(errorMessage){logError(errorMessage)},fireCustomEvent:function(eventName,eventData){fireCustomEvt(eventName,eventData)},getRemoveJSInMessages:getRemoveJSInMessages,updateV3TO:function(chatLayerTimeout){CHM.getChat().updateV3TO(chatLayerTimeout)}}}function enableOne2ManyChat(){one2ManyChat=true}function isOne2ManyChatEnabled(){return one2ManyChat}function setAgentClosedChat(agentClosedChat){var chat=CHM.getChat();if(chat)chat.setAgentClosedChat(agentClosedChat);else logError("Chat was not found, survey can be not displayed.")}function getEngageParams(chatparams){var agID=chatparams["agentGroupId"]||CHM.getChat().getAgentGroupID();var buID=chatparams["businessUnitID"]||getBusinessUnitID();var priority=CHM.getChat().rule.getPriority();var script=chatparams["scriptTreeId"]||CHM.getChat().getScriptID();var engageParams={siteID:""+Inq.getSiteID(),agID:""+agID,buID:""+buID,brID:""+getBrID(),brName:getBrName(),pageID:""+getPageID(),custID:""+CHM.getChat().getCustID()};if(script)engageParams["scriptID"]=""+script;if(priority)engageParams["priority"]=""+priority;if(CHM.q6t())engageParams["qt"]=""+CHM.q6t();if(CHM.getQueueMessagingSpecId()!=null)engageParams["qmSpecID"]=""+CHM.getQueueMessagingSpecId();if(CHM.getChat().getAutomatonId()>0||chatparams["automatonId"])engageParams["autoID"]=""+(chatparams["automatonId"]||CHM.getChat().getAutomatonId());if(chatparams["clientOutcome"])engageParams["openerText"]=chatparams["clientOutcome"];else if(CHM.getChat().getOpenerName())engageParams["opName"]=CHM.getChat().getOpenerName();else if(CHM.getChat().getOpenerID())engageParams["opID"]=""+CHM.getChat().getOpenerID();if(chatparams["custName"])engageParams["customerName"]=chatparams["custName"];if(chatparams["agentOutcome"])engageParams["agentOutcome"]=chatparams["agentOutcome"];if(CHM.getEmailSpecId())engageParams["emailSpecID"]=""+CHM.getEmailSpecId();engageParams["tagUrl"]=urls.vanityURL;if(chatparams["agentAttrs"]){var aAttrs=chatparams["agentAttrs"].split(",");chatparams["agentAttrs"]="";var l=0;for(var i=0;i<aAttrs.length;i++){var pp=aAttrs[i].split("=");if(pp.length>1&&pp[1]){if(l>0)chatparams["agentAttrs"]+=";";chatparams["agentAttrs"]+=pp[0]+","+pp[1];l++}}}if(chatparams["wCall"]){engageParams["callType"]=chatparams["wCall"];if(chatparams["closeOnEnd"])engageParams["closeOnEnd"]="true"}if(chatparams["vidyoHost"]){engageParams["host"]=chatparams["vidyoHost"];engageParams["appKeyID"]=chatparams["appKeyId"]}var automatonDatapass=getAutomatonDatapass();if(automatonDatapass){var arr={};for(var ix=0;ix<automatonDatapass.length;ix++)arr[automatonDatapass[ix].key]=automatonDatapass[ix].value;engageParams["autoDataPass"]=JSON.stringify({datapass:arr})}var automatonSpecData=getAutomatonSpecData();var automatonDataMap=automatonSpecData?automatonSpecData:getAutomatonDataMap();if(automatonDataMap)engageParams["autoDataMap"]=automatonDataMap;if(CHM.getChat().ra1t())engageParams["brAttributes"]=CHM.getChat().ra1t();if(CHM.getChat().isAsyncChat())engageParams["isAsyncEngagement"]=true;var mode=CHM.getChat().getRule().conversationTranscriptMode;if(mode)engageParams["asyncMode"]=mode;var days=CHM.getChat().getRule().conversationTranscriptDays;if(days)engageParams["asyncDays"]=days;return engageParams}function launchNativeSDK(chatparams){var agID=chatparams["agentGroupId"]||CHM.getChat().getAgentGroupID();var buID=chatparams["businessUnitID"]||getBusinessUnitID();CHM.assignAgent("tmp_agent_name",true,false,{},buID,agID);var engageParams=getEngageParams(chatparams);CHM.getChat().monitorChatActive();if(typeof NuanIJSFBridge!="undefined")NuanIJSFBridge.startChat(JSON.stringify(engageParams),chatparams["agentAttrs"]||CHM.getChat().getAgentAttributesAsString());else{engageParams["reqType"]="engagement";if(chatparams["agentAttrs"]||CHM.getChat().getAgentAttributesAsString())engageParams["attributes"]=chatparams["agentAttrs"]||CHM.getChat().getAgentAttributesAsString();if(nativeTimeout)clearTimeout(nativeTimeout);nativeTimeout=setTimeout((function(){getIOSNativeSDKInstance().postMessage(JSON.stringify(engageParams))}),200)}}function onChatMinimize(){CBM.onChatMinimize()}function submitNativePostChatSurvey(data){ROM.postJson(urls.nativePostChatSurveyURL,data)}function getInitialTimeout(){return DEFAULT_INITIAL_TIMEOUT}function isAdblockEnabled(){return CHM.isAdblockOn()}function setEventDataForSurvey(eventData){SVYM.setEventDataForSurvey(eventData)}function getVAList(){return site.vaList}function fireChatLaunched(chatData){CHM.fireChatLaunched(chatData)}function resetConversationManager(){CONVM.reset()}function fireConversationResolvedEvent(){CONVM.fireConversationResolvedEvent()}function fireCustomerAuthenticatedEvent(){CONVM.fireCustomerAuthenticated()}function fireVerifyTokenSuccessEvent(){CONVM.fireVerifyTokenSuccessEvent()}function fireVerifyTokenErrorEvent(){CONVM.fireVerifyTokenErrorEvent()}function ciSendAutomatonDataAsCustomerMessage(text){throw"ciSendMessageAsCustomer: sendMessageAsCustomer function was not published in CI"}function getActiveChatroomId(successCallback,errorCallback){ROM.getActiveChatroomId(successCallback,errorCallback)}function setAsyncChat(value){CHM.getChat().setAsyncChat(value)}function _isHideJsonTranscriptMessages(){return isHideJsonTranscriptMessages()}function assignAgent(aid,noSave,cobrowseEnabled,eventData,buID,agID){CHM.assignAgent(aid,noSave,cobrowseEnabled,eventData,buID,agID)}function debugLogErrorToTagServer(module,message){DMgr.let12(module,message)}function debugLogWarnToTagServer(module,message){DMgr.lwt12(module,message)}function debugLogInfoToTagServer(module,message){DMgr.logInfoToTagServer(module,message)}function debugLogDebugToTagServer(module,message){DMgr.logDebugToTagServer(module,message)}function debugSwitchForModule(name,value){return DMgr.switchForModule(name,value)}function verifyToken(tokenID){ROM.verifyToken(tokenID,function(){CHM.asyncUnauthUser();CONVM.createConversationVars()}.bind(this))}function isAsyncUnauthUser(){return CHM.isAsyncUnauthUser()}function sendNetworkBackup(){return CommunicationMgr.sendNetworkBackup()}function FPJSONParse(JSONString,suppressError){var parseResult=null;try{parseResult=MI8.JSON.parse.apply(MI8.JSON,[JSONString])}catch(e){if(suppressError)log("MI8.JSON.parse error suppressed");else log(e,LOG_LEVELS.ERROR)}return parseResult}var mc32=[];mc32[0]=Glk4;mc32[1]=gkh24;mc32[2]=gkg23;return{acceptCob:acceptCobrowseInvitation,acceptCobSafe:acceptCobrowseInvitationSafe,acceptCobShare:acceptCobrowseShareControl,addListener:addListener,agentSurveyCall:agentSurveyCall,applyAcifCommands:applyAcifCommands,blockTheService:tryue,browserHasFlash:browserHasFlash,callFromPersistent:callFromPersistent,captureEmailAddress:captureEmailAddress,closeChat:closeChat,closeChatInterface:closeChatInterface,closeChatMonitor:closeChatMonitor,closePersistent:closePersistent,closePersistentWindowIfOpen:closePersistentWindowIfOpen,closePopupChat:closePopupChat,closePopupChatFromPersistent:closePopupChatFromPersistent,createXFrame:createXFrame,debugLogErrorToTagServer:debugLogErrorToTagServer,debugLogDebugToTagServer:debugLogDebugToTagServer,debugLogInfoToTagServer:debugLogInfoToTagServer,debugLogWarnToTagServer:debugLogWarnToTagServer,debugSwitchForModule:debugSwitchForModule,doPushToFrameset:doPushToFrameset,enableOne2ManyChat:enableOne2ManyChat,isAsyncUnauthUser:isAsyncUnauthUser,isOne2ManyChatEnabled:isOne2ManyChatEnabled,endChatSession:endChatSession,endCob:endCobrowseSession,endCobByEtlEvent:endCobByEtlEvent,endWebRTCCall:endWebRTCCall,executeCustomCommand:_executeCustomCommand,expandChat:expandChat,fireConversationResolvedEvent:fireConversationResolvedEvent,fireCustomerAuthenticatedEvent:fireCustomerAuthenticatedEvent,fireCustomEvent:fireCustomEvent,fireCustomEvt:fireCustomEvt,fileDeleteSetting:fileDelSetting,fireNativeSurveyLaunchEvent:fireNativeSurveyLaunchEvent,fileTransferExtensions:fileTransferExtensions,fileTransferSize:fileTransferSize,fileTransferServerUrl:fileTransferServerUrl,fileTransferApiUrl:fileTransferApiUrl,ForceFocus:ForceFocus,formsLoader:XFormsLoader,getActiveChatroomId:getActiveChatroomId,getAgentData:getAgentData,getAgentGroupDisplayName:getAgentGroupDisplayName,getAgentGroupName:getAgentGroupName,getAgentID:getAgentID,getAgentsAvailabilityCheckUrl:getAgentsAvailabilityCheckUrl,getAuthenticatedUser:getAuthenticatedUser,getAutomatonDataMap:getAutomatonDataMap,getAutomatonDatapass:getAutomatonDatapass,getAutomatonSpecData:getAutomatonSpecData,getBaseURL:getBaseURL,getBrID:getBrID,getBrName:getBrName,getBrowserMajorVer:_getBrowserMajorVer,getBrowserTypeAndVersion:_getBrowserTypeAndVersion,getBuRuleAgentGroupID:getBuRuleAgentGroupID,getBusinessUnitDisplayName:getBusinessUnitDisplayName,getBusinessUnitID:getBusinessUnitID,getBusinessUnitName:getBusinessUnitName,getCBC:getCBC,getChatOwnerBusinessUnitID:getChatOwnerBusinessUnitID,getChatRouterVanityUrl:getChatRouterVanityUrl,getChatRule:getChatRule,getChatSkinFmt:getChatSkinFmt,getClientPageURL:getClientPageURL,getSDKInst:getSDKInstance,getSDKInstance:getSDKInstance,getCobrowseEnableMinimizeRestore:getCobrowseEnableMinimizeRestore,getCustGeoData:_getCustGeoData,getCustID:getCustID,getDeviceType:_getDeviceType,getDisconnectionTimeout:getDisconnectionTimeout,getEmbeddedTheme:getEmbeddedTheme,getFlashVars:getFlashVars,getFPSessionID:getFPSessionID,getImagePath:getImagePath,asi4:getIncAsID,getInitialTimeout:getInitialTimeout,getLocalizedMessage:getLocalizedMessage,getMediaBaseURL:getMediaBaseURL,getPageID:getPageID,getPageMarker:getPageMarker,getPersistentCustomerID:getPersistentCustomerID,getPersistentHeight:getPersistentHeight,getPersistentWidth:getPersistentWidth,getPersistentXPos:getPersistentXPos,getPersistentYPos:getPersistentYPos,getPopupCloserWidth:getPopupCloserWidth,getQueueMessagingSpec:getQueueMessagingSpec,getQueueMessagingSpecId:getQueueMessagingSpecId,getSessionID:getSesID,getSiteConstants:getSiteConstants,getSkin:getSkin,getSkinHeight:getSkinHeight,getSkinLeft:getSkinLeft,getSkinLocation:getSkinLocation,getSkinTop:getSkinTop,getSkinWidth:getSkinWidth,getSurveyAuxParams:getSurveyAuxParams,getTitleBarHeight:getTitleBarHeight,getV3Data:getV3Data,getVAList:getVAList,getVanityUrl:getVanityUrl,getVarValue:getVarValue,getVisitorAttributes:getVisitorAttributes,getXFormsDomain:getXFormsDomain,hideFramesetChat:hideFramesetChat,hidePersistentButton:hidePersistentButton,isAdblockEnabled:isAdblockEnabled,isAndroid:_isAndroid,isAutoFixPrechatSurvey:isAutoFixPrechatSurvey,isCEAPIPostChatSurveyMode:isCEAPIPostChatSurveyMode,isChatConnected:isChatConnected,isChatVisible:isChatVisible,isClickStreamSent:isClickStreamSent,isCobEngaged:isCobrowseEngaged,isCobShared:isSharedControl,isEmbeddedThemeValid:isEmbeddedThemeValid,isInitializationRequired:isInitializationRequired,isIOS:_isIOS,isHideJsonTranscriptMessages:_isHideJsonTranscriptMessages,isLoggingDisabled:isLoggingDisabled,isMobile:_isMobile,isMultiChatSupported:isMultiChatSupported,isPersistentChat:isPersistentChat,isPersistentWindow:isPersistentWindow,isPhone:isPhone,isPolishNotationEnabled:isPolishNotationEnabled,isPortal:isPortal,isThankYouEnabled:isThankYouEnabled,isV3C2CPersistent:isV3C2CPersistent,isV3Continue:isV3Continue,JSONParse:FPJSONParse,launchNativePostChatSurvey:launchNativePostChatSurvey,launchNativeSDK:launchNativeSDK,loadKMSlibraries:loadKMSlibraries,logAcifError:logAcifError,logData:logData,logInfo:logInfo,logError:logError,logErrorToServer:logErrorToServer,logInfoToServer:logInfoToServer,logWarningToServer:lwt12,evaluateLegacySettings:evaluateLegacySettings,onAgentDataPass:onAgentDataPass,onAgentMsg:onAgentMsg,onQueueWaitMsg:onQueueWaitMsg,getRemoveJSInMessages:getRemoveJSInMessages,onAssisted:onAssisted,onBeforeChatClosed:onBeforeChatClosed,onChatLoaded:onChatLoaded,onChatMinimize:onChatMinimize,onChatroomReady:onChatroomReady,onChatShown:onChatShown,onCookiesCommitted:onCookiesCommitted,onCustomerMsg:onCustomerMsg,onEngaged:onEngaged,onInteracted:onInteracted,onVADataPass:onVADataPass,parseXFrameUrl:parseXFrameUrl,prefetchURL:prefetchURL,isValidHttpUrl:_isValidHttpUrl,postRequestToIframeProxy:postRequestToIframeProxy,popOutChat:popOutChat,prepareDataAndSendDTEvent:prepareDataAndSendDTEvent,preventChatClose:preventChatClose,PushToFrameset:PushToFrameset,reinitializeChatWithNewId:reinitializeChatWithNewId,registerPersistentWindow:registerPersistentWindow,registerWDMClient:registerWDMClient,requestTranscript:requestTranscript,resetConversationManager:resetConversationManager,resetInitializationFlag:resetInitializationFlag,restartTimer:restartTimer,sendAutomatonMessage:_sendAutomatonMessage,getFlagSendDataToTSWithoutIframe:getFlagSendDataToTSWithoutIframe,sendDTEvent:sendDTEvent,sendNetworkBackup:sendNetworkBackup,sendRequestToServer:sendRequestToServer,sendText:sendText,setActiveWindowId:setActiveWindowId,setAgentClosedChat:setAgentClosedChat,setAgentConfig:setAgentConfig,setAsyncChat:setAsyncChat,setCABeacon:setCABeacon,setChatBanished:setChatBanished,setCiFunction:setCiFunction,setClickStreamSent:setClickStreamSent,setData:setData,setDisconnectFlag:setDisconnectFlag,setDragable:setDragable,setElementPosition:setElementPosition,setEventDataForSurvey:setEventDataForSurvey,setPersistentButtonDebugActive:setPersistentButtonDebugActive,setPersistentWindowActive:setPersistentWindowActive,setPopoutChatPosAndDim:setPopoutChatPosAndDim,setResizable:setResizable,setSurveyAuxParams:setSurveyAuxParams,setVarValue:setVarValue,setVisible:setVisible,setV3Data:setV3Data,set3rdPartyCookieFromQueue:set3rdPartyCookieFromQueue,setIOSSDKProgress:setIOSSDKProgress,setNativeSDKCPStatus:setNativeSDKConversationPlayStatus,onC2CEventFromNativeSDK:launchChatByC2CID,showAutomaton:showAutomaton,showPersistentButton:showPersistentButton,showTextInput:showTextInput,showThankyou:showThankyou,shrinkChat:shrinkChat,startChatInterface:startChatInterface,startLaunches:startLaunches,submitNativePostChatSurvey:submitNativePostChatSurvey,updateFrameName:updateFrameName,unregisterWDMClient:unregisterWDMClient,updateXFrameFromBizRule:updateXFrameFromBizRule,verifyToken:verifyToken,wasSaleAction:wasSaleAction,whenIsPersistent:urtvd3,when3rdPartyCookieCommitted:when3rdPartyCookieCommitted,ciAcceptCobInv:ciAcceptCobInv,ciAcceptCobShareInv:ciAcceptCobShareInv,ciAcceptVideoInv:ciAcceptVideoInv,ciActionBtnCloseChat:ciActionBtnCloseChat,ciActionBtnCloseThankyou:ciActionBtnCloseThankyou,ciAgentEndsCob:ciAgentEndsCob,ciCheckCobrowseMgrAvalibility:ciCheckCobrowseMgrAvalibility,ciCloseChat:ciCloseChat,ciCobrowseFailHandler:ciCobrowseFailHandler,ciCobrowseSuppressedPage:ciCobrowseSuppressedPage,ciDeclineCobInv:ciDeclineCobInv,ciDeclineCobShareInv:ciDeclineCobShareInv,ciDeclineVideoInv:ciDeclineVideoInv,ciEngageChat:ciEngageChat,ciFocusCobEndBtn:ciFocusCobEndBtn,ciGetCobEndButtonID:ciGetCobEndButtonID,ciGrowLayer:ciGrowLayer,ciHideLayer:ciHideLayer,ciIsCircularTabbingEnabled:ciIsCircularTabbingEnabled,ciIsMinimized:ciIsMinimized,ciMinimize:ciMinimize,ciMoveStage:ciMoveStage,ciPreparingClosingChat:ciPreparingClosingChat,ciRemoveCircularModalWindow:ciRemoveCircularModalWindow,ciResizeStage:ciResizeStage,ciRestore:ciRestore,ciSendCobrowseEnded:ciSendCobrowseEnded,ciSendAutomatonDataAsCustomerMessage:ciSendAutomatonDataAsCustomerMessage,ciSendMessageQuietly:ciSendMessageQuietly,ciSendResultOfBenchmarkTest:ciSendResultOfBenchmarkTest,ciSendText:ciSendText,ciSetAutomatonDataMapXcd:ciSetAutomatonDataMapXcd,ciSetCircularModalWindow:ciSetCircularModalWindow,ciSetEngageParameters:ciSetEngageParameters,ciSetFocusOnChatInputField:ciSetFocusOnChatInputField,ciStopVideo:ciStopVideo,ciTransitionPage:ciTransitionPage,ciShowLayer:ciShowLayer,ciShrinkLayer:ciShrinkLayer,getAgentGroupId:getAgentGroupId,getIsBuilder:noop,getIsSkinLocal:noop,noJSHostingInTagserver:noJSHostingInTagserver,getClientStaticURL:getClientStaticURL,noV3FrameChat:noV3FrameChat,getEngageParams:getEngageParams,noop:noop};function noop(){}}function Resize(){this.obj=null;this.win=window.parent;this.doc=window.parent.document;this.width=0;this.height=0;this.__init=function(o,oRoot,minX,maxX,minY,maxY,bSwapHorzRef,bSwapVertRef,fXMapper,fYMapper,_win){if(typeof o=="undefined"||o==null)return;Inq.Resize.win=null==_win?this.win:_win;Inq.Resize.doc=Inq.Resize.win.document;o.box=getParentElByIDTFacade("inqResizeBox");doc=window.parent.document;o.onmousedown=Inq.Resize.__start;o.hmode=bSwapHorzRef?false:true;o.vmode=bSwapVertRef?false:true;o.root=oRoot&&oRoot!=null?oRoot:o;Inq.Resize.width=o.root.clientWidth;Inq.Resize.height=o.root.clientHeight;if(o.hmode&&isNaN(parseInt(o.root.style.left)))o.root.style.left="0px";if(o.vmode&&isNaN(parseInt(o.root.style.top)))o.root.style.top="0px";if(!o.hmode&&isNaN(parseInt(o.root.style.right)))o.root.style.right="0px";if(!o.vmode&&isNaN(parseInt(o.root.style.bottom)))o.root.style.bottom="0px";o.minX=typeof minX!="undefined"?minX:null;o.minY=typeof minY!="undefined"?minY:null;o.maxX=typeof maxX!="undefined"?maxX:null;o.maxY=typeof maxY!="undefined"?maxY:null;o.xMapper=fXMapper?fXMapper:null;o.yMapper=fYMapper?fYMapper:null;o.root.onDragStart=function(){};o.root.onDragEnd=function(){};o.root.onDrag=function(){}};this.__start=function(e){var o=Inq.Resize.obj=this;e=Inq.Resize.fixE(e);var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);o.root.onDragStart(x,y);if(o.box!=null){o.box.style.top=o.root.style.top;o.box.style.left=o.root.style.left;o.box.style.width=o.root.style.width;o.box.style.height=o.root.style.height;o.box.style.border="thin dotted rgb(32,32,32)";o.box.style.display="";o.style.top=parseInt(o.root.style.top)+parseInt(o.root.style.height)-16+"px";o.style.left=parseInt(o.root.style.left)+parseInt(o.root.style.width)-16+"px"}o.lastMouseX=e.clientX;o.lastMouseY=e.clientY;if(o.hmode){if(o.minX!=null)o.minMouseX=e.clientX-x+o.minX;if(o.maxX!=null)o.maxMouseX=o.minMouseX+o.maxX-o.minX}else{if(o.minX!=null)o.maxMouseX=-o.minX+e.clientX+x;if(o.maxX!=null)o.minMouseX=-o.maxX+e.clientX+x}if(o.vmode){if(o.minY!=null)o.minMouseY=e.clientY-y+o.minY;if(o.maxY!=null)o.maxMouseY=o.minMouseY+o.maxY-o.minY}else{if(o.minY!=null)o.maxMouseY=-o.minY+e.clientY+y;if(o.maxY!=null)o.minMouseY=-o.maxY+e.clientY+y}Inq.Resize.doc.onmousemove=Inq.Resize.resize;Inq.Resize.doc.onmouseup=Inq.Resize.end;var newWidth=parseInt(Inq.Resize.obj.style.left)+16;var newHeight=parseInt(Inq.Resize.obj.style.top)+16;var oDiv=getParentPageElById("inqTitleBar",Inq.Resize.doc);newWidth-=24;oDiv.style.width=newWidth+"px";return false};this.resize=function(e){e=Inq.Resize.fixE(e);var o=Inq.Resize.obj;var ey=e.clientY;var ex=e.clientX;var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);var nx,ny;if(o.minX!=null)ex=o.hmode?Math.max(ex,o.minMouseX):Math.min(ex,o.maxMouseX);if(o.maxX!=null)ex=o.hmode?Math.min(ex,o.maxMouseX):Math.max(ex,o.minMouseX);if(o.minY!=null)ey=o.vmode?Math.max(ey,o.minMouseY):Math.min(ey,o.maxMouseY);if(o.maxY!=null)ey=o.vmode?Math.min(ey,o.maxMouseY):Math.max(ey,o.minMouseY);nx=x+(ex-o.lastMouseX)*(o.hmode?1:-1);ny=y+(ey-o.lastMouseY)*(o.vmode?1:-1);if(o.xMapper)nx=o.xMapper(y);else if(o.yMapper)ny=o.yMapper(x);nx=ex-o.lastMouseX;ny=ey-o.lastMouseY;var _top=parseInt(Inq.Resize.obj.style["top"]);var _left=parseInt(Inq.Resize.obj.style["left"]);Inq.Resize.obj.style["left"]=_left+nx+"px";Inq.Resize.obj.style["top"]=_top+ny+"px";Inq.Resize.obj.style[o.hmode?"left":"right"]=nx+_left+"px";Inq.Resize.obj.style[o.vmode?"top":"bottom"]=ny+_top+"px";Inq.Resize.obj.lastMouseX=ex;Inq.Resize.obj.lastMouseY=ey;Inq.Resize.obj.root.onDrag(nx,ny);if(Inq.Resize.obj.box){var height=ny+_top-parseInt(Inq.Resize.obj.box.style.top)+16;var width=nx+_left-parseInt(Inq.Resize.obj.box.style.left)+16;if(width>=16&&height>=16){Inq.Resize.obj.box.style.width=width+"px";Inq.Resize.obj.box.style.height=height+"px"}}return false};this.end=function(){Inq.Resize.doc.onmousemove=null;Inq.Resize.doc.onmouseup=null;var newWidth=parseInt(Inq.Resize.obj.style.left)-parseInt(Inq.Resize.obj.root.style.left)+16;var newHeight=parseInt(Inq.Resize.obj.style.top)-parseInt(Inq.Resize.obj.root.style.top)+16;if(Inq.Resize.obj.box)Inq.Resize.obj.box.style.display="none";Inq.Resize.obj.root.onDragEnd(parseInt(Inq.Resize.obj.root.style[Inq.Resize.obj.hmode?"left":"right"]),parseInt(Inq.Resize.obj.root.style[Inq.Resize.obj.vmode?"top":"bottom"]));if(newWidth<16||newHeight<16){newWidth=parseInt(Inq.Resize.obj.root.style.width);newHeight=parseInt(Inq.Resize.obj.root.style.height)}Application.ResizeStage(newWidth,newHeight);Inq.Resize.obj=null};this.fixE=function(e){if(typeof e=="undefined")e=Inq.Resize.win.event;if(typeof e.layerX=="undefined")e.layerX=e.offsetX;if(typeof e.layerY=="undefined")e.layerY=e.offsetY;return e}}function Drag(){this.obj=null;this.win=window.parent;this.doc=window.parent.document;this.__init=function(o,oRoot,minX,maxX,minY,maxY,bSwapHorzRef,bSwapVertRef,fXMapper,fYMapper,_win){Inq.Drag.win=null==_win?this.win:_win;Inq.Drag.doc=Inq.Drag.win.document;if(typeof o=="undefined"||o==null)return;o.onmousedown=Inq.Drag.__start;o.hmode=bSwapHorzRef?false:true;o.vmode=bSwapVertRef?false:true;o.root=oRoot&&oRoot!=null?oRoot:o;if(o.hmode&&isNaN(parseInt(o.root.style.left)))o.root.style.left="0px";if(o.vmode&&isNaN(parseInt(o.root.style.top)))o.root.style.top="0px";if(!o.hmode&&isNaN(parseInt(o.root.style.right)))o.root.style.right="0px";if(!o.vmode&&isNaN(parseInt(o.root.style.bottom)))o.root.style.bottom="0px";o.minX=typeof minX!="undefined"?minX:null;o.minY=typeof minY!="undefined"?minY:null;o.maxX=typeof maxX!="undefined"?maxX:null;o.maxY=typeof maxY!="undefined"?maxY:null;o.xMapper=fXMapper?fXMapper:null;o.yMapper=fYMapper?fYMapper:null;o.corner=getParentElByIDTFacade("inqDivResizeCorner");o.root.onDragStart=function(){};o.root.onDragEnd=function(){};o.root.onDrag=function(){}};this.__start=function(e){var o=Inq.Drag.obj=this;e=Inq.Drag.fixE(e);var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);o.root.onDragStart(x,y);if(o.corner)o.corner.style.display="none";o.lastMouseX=e.clientX;o.lastMouseY=e.clientY;if(o.hmode){if(o.minX!=null)o.minMouseX=e.clientX-x+o.minX;if(o.maxX!=null)o.maxMouseX=o.minMouseX+o.maxX-o.minX}else{if(o.minX!=null)o.maxMouseX=-o.minX+e.clientX+x;if(o.maxX!=null)o.minMouseX=-o.maxX+e.clientX+x}if(o.vmode){if(o.minY!=null)o.minMouseY=e.clientY-y+o.minY;if(o.maxY!=null)o.maxMouseY=o.minMouseY+o.maxY-o.minY}else{if(o.minY!=null)o.maxMouseY=-o.minY+e.clientY+y;if(o.maxY!=null)o.minMouseY=-o.maxY+e.clientY+y}Inq.Drag.doc.onmousemove=Inq.Drag.drag;Inq.Drag.doc.onmouseup=Inq.Drag.end;return false};this.drag=function(e){e=Inq.Drag.fixE(e);var o=Inq.Drag.obj;var ey=e.clientY;var ex=e.clientX;var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);var nx,ny;if(o.minX!=null)ex=o.hmode?Math.max(ex,o.minMouseX):Math.min(ex,o.maxMouseX);if(o.maxX!=null)ex=o.hmode?Math.min(ex,o.maxMouseX):Math.max(ex,o.minMouseX);if(o.minY!=null)ey=o.vmode?Math.max(ey,o.minMouseY):Math.min(ey,o.maxMouseY);if(o.maxY!=null)ey=o.vmode?Math.min(ey,o.maxMouseY):Math.max(ey,o.minMouseY);nx=x+(ex-o.lastMouseX)*(o.hmode?1:-1);ny=y+(ey-o.lastMouseY)*(o.vmode?1:-1);if(o.xMapper)nx=o.xMapper(y);else if(o.yMapper)ny=o.yMapper(x);Inq.Drag.obj.style[o.hmode?"left":"right"]=nx+"px";Inq.Drag.obj.style[o.vmode?"top":"bottom"]=ny+"px";Inq.Drag.obj.root.style[o.hmode?"left":"right"]=nx+"px";Inq.Drag.obj.root.style[o.vmode?"top":"bottom"]=ny+"px";Inq.Drag.obj.lastMouseX=ex;Inq.Drag.obj.lastMouseY=ey;Inq.Drag.obj.root.onDrag(nx,ny);return false};this.end=function(){Inq.Drag.doc.onmousemove=null;Inq.Drag.doc.onmouseup=null;var newLeft=parseInt(Inq.Drag.obj.root.style["left"]);var newTop=parseInt(Inq.Drag.obj.root.style["top"]);Inq.Drag.obj.root.onDragEnd(parseInt(Inq.Drag.obj.root.style[Inq.Drag.obj.hmode?"left":"right"]),parseInt(Inq.Drag.obj.root.style[Inq.Drag.obj.vmode?"top":"bottom"]));Inq.Drag.obj=null;if(Application)Application.MoveStage(newLeft,newTop)};this.fixE=function(e){if(typeof e=="undefined")e=Inq.Drag.win.event;if(typeof e.layerX=="undefined")e.layerX=e.offsetX;if(typeof e.layerY=="undefined")e.layerY=e.offsetY;return e}}function SM19(surveyDataMap){var NATIVE_SURVEY_EVENT="LoadPostChatSurvey";this.nativePostChatSurveyCall=null;this.isAsyncSurveyCalled=false;this.asyncSurveyData={};this._observable();this.defaultWindowSpec="statusbar=0, scrollbars=1, resizable=1, toolbar=0, menubar=0, copyhistory=0";this.poppedWindows={};this.eventData=null;function getAltSurveyURL(data,evt){try{var brName=BRM.rb41(CHM.getLastChat().brID).getName()}catch(err){brName="NO BR Name Available"}data["BRName"]=brName;data["agentID"]=CHM.getAgentID()?CHM.getAgentID():CHM.getLastAgentID();data["agentGroupID"]=CHM.getAgentGroupID(evt);return ROM.composeURL(data.altURL,data)}function composeURL(url,data){return ROM.composeURL(url,data)}this.getSurveySpec=function(specID){if(inu1(specID))throw new Error("Survey spec is null or undefined.");return surveyDataMap[specID]};this.popwindow=function(webResourceID,winName,data,winSpecDataStr){var webResource=resources[webResourceID];if(!!webResource)if(!!winName)if(webResource.method=="POST"){try{var lwin=this.poppedWindows[winName]=win.open("",winName,winSpecDataStr);var div=lwin.document.createElement("div");var formName="TCSurveyWin"+SM19.IDX++;var formStr="<form id='"+formName+"' name='"+formName+"' action='"+webResource.url+"' method='POST' target='"+winName+"'>\n";for(var name in data){if(typeof data[name]=="function")continue;formStr+="\t<input type='hidden' id='"+name+"' name='"+name+"' value='"+data[name]+"'>\n"}formStr+="</form>";div.style.cssText="position:absolute;top:0px;left:0px;width:1px;height:1px;";div.innerHTML=formStr;lwin.document.body.appendChild(div);div.firstChild.submit()}catch(e){log(e)}lwin.document.removeChild(div)}else this.poppedWindows[winName]=win.open(ROM.composeURL(webResource.url,data),winName,!!winSpecDataStr?winSpecDataStr:this.defaultWindowSpec);else log("Popout Window Error: winName is required but not provided.");else log("Popout Window Error: Web resource not found for popout window for resource ID = "+webResourceID)};this.parseSurveyIdFromURL=function(surveyURL,defaultID){try{if(surveyURL){var found=surveyURL.match(/http.*\/(\d+)\/[a-fA-F0-9]+\/.*/);if(found&&found.length>1)return parseInt(found[1])}}catch(err){log("Survey spec lookup error: Survey URL '"+surveyURL+"' parse failure. err="+err)}return defaultID};this.launchNativePostChatSurvey=function(url){this.asyncSurveyData=getParamsFromURL(url);if(!isEmptyObject(this.asyncSurveyData)){this.isAsyncSurveyCalled=true;this.nativePostChatSurveyCall={data:{surveyId:this.asyncSurveyData["surveyID"]},rule:CHM.getChat().getRule()};this.fireNativeSurveyLaunchEvent()}else let12("Cannot display native post chat survey due to incorrect survey config: "+url,true)};this.fireNativeSurveyLaunchEvent=function(){if(this.richPostChatSurveyCall&&window.messagingApp){this.setSurveyShown(1);window.messagingApp.showPostChatSurvey(this.richPostChatSurveyCall.data.surveyId,this.richPostChatSurveyCall.data)}else if(this.nativePostChatSurveyCall){var data=this.nativePostChatSurveyCall.data;fireCustomEvent(NATIVE_SURVEY_EVENT,data,this.nativePostChatSurveyCall.rule);this.nativePostChatSurveyCall=null;this.setSurveyShown(1);if(isPostChatSurveyLogsEnabled())lmt12("Native post chat survey was shown. Survey id "+data.surveyId,LOG_LEVELS.INFO,null,true)}else if(isPostChatSurveyLogsEnabled())lwt12("Post chat survey won't be shown, "+"because survey data is absent.")};this.onChatLaunched=function(){this.setEventDataForSurvey(null)};this.showSurvey=function(surveySpecID,rule,brSurveySpecOverride,preSurveyDataPass,windowFeatures,surveyUrlOverride,surveyReporting,nativePostChat,evt,richPostChat){if(isPostChatSurveyLogsEnabled())lmt12("showSurvey was called.",LOG_LEVELS.INFO,null,true);this.isAsyncSurveyCalled=false;var windowSpec=", "+(windowFeatures||this.defaultWindowSpec)+",";var chat=CHM.getChat();var chatID=chat?chat.getChatID():CHM.getLastChatID();var lastChat=CHM.getLastChat();var brID=chat?chat.getRuleId():lastChat?lastChat.brID:"";var ruleEvt=rule.evt||evt;var openSurveyCnt=0;if(nativePostChat||richPostChat){if(chat&&(!chat.isAsyncChat()||chat.isAgentClosedChat()))FP.preventChatClose(true);if(isNonAsyncChatOrValidAsyncSurvey(chat,this.eventData)){buildFormData(evt,rule);if(richPostChat){buildAdditionalData();this.richPostChatSurveyCall={data:preSurveyDataPass,rule:rule}}else this.nativePostChatSurveyCall={data:preSurveyDataPass,rule:rule};preSurveyDataPass.surveyId=surveySpecID;var resName="tcSrv_"+getSiteID();var callback=function showSurveyRequestCookieCallback(context){var currentChat=CHM.getChat();var cObj=parseCookieData(CM._getCookies(context.data))["tcSrv"];if(cObj&&!cObj["_surv"]){if(currentChat&&currentChat.isAgentClosedChat())this.fireNativeSurveyLaunchEvent();else if(isPostChatSurveyLogsEnabled())lwt12("Native Survey Launched event "+"won't be fired in SM19#showSurvey, "+"because chat wasn't closed by agent")}else{if(isPostChatSurveyLogsEnabled())lwt12("Chat will be closed without showing post chat survey, "+"because by data in cookies it was already shown.");CHM.closeChat()}}.bind(this);CM.requestCookie(callback,resName)}else{if(isPostChatSurveyLogsEnabled())lwt12("Async chat will be closed, "+"because conversation wasn't resolved by agent.");if(chat.isAgentClosedChat())CHM.closeChat()}}else{var data=this.getSurveySpec(surveySpecID);if(surveyUrlOverride)windowURL=surveyUrlOverride;if(data){MI8.mixAbsorber(data);if(brSurveySpecOverride)data.absorb(brSurveySpecOverride);var surveyURL=surveyUrlOverride||data.altURL;if(!surveyURL){let12("Survey processing error: altURL parameter isn't set.",true);return}try{if(inu1(chatID)||chatID=="0")throw"ChatID is null or undefined.";if(surveyReporting){var surveyID=this.parseSurveyIdFromURL(surveyURL,surveySpecID);var automatonID="SAT_"+surveyID;var surveyName=data.name?data.name:automatonID;buildFormData(evt,rule);var automatonStartedData={_domain:"automaton",evt:"started",automatonID:automatonID,automatonStartedBy:"BR,"+(CHM.getChat()?CHM.getChat().getRuleId():(evt&&evt.rule?evt.rule.id:rule.getID()).toString()),automatonName:surveyName,startedIn:"div",automatonType:"satisfactionSurvey",businessUnitID:CHM.getBusinessUnitID(),chatID:chatID,customerID:Inq.getCustID(),initialCustomerID:CONVM.getInitialCustomerID(),conversationID:CONVM.getConversationID(),incAssignmentID:asi4(),sessionID:getSessionID(),siteID:getSiteID(),pageID:CHM.getLaunchPageId(),businessRuleID:brID,deviceType:getDeviceType(),operatingSystemType:getOSType(),browserType:getClientBrowserType(),browserVersion:cbtv1(),agentGroupID:CHM.getAgentGroupID(ruleEvt),visitorAttributes:VAM.getCopyAsArray(true).join(";"),brAttributes:firstExisting("ra1t",CHM.getChat(),rule),agentID:CHM.getAgentID()?CHM.getAgentID():CHM.getLastAgentID(),availableAgentAttributes:CHM.getChatOrLastChatAgentAttributesString(),countryCode:FP.getCustGeoData()?FP.getCustGeoData().country_code:"",regionCode:FP.getCustGeoData()?FP.getCustGeoData().region_code:""};logAutomatonStartedEvent(automatonStartedData);var w=635;var h=650;var x=data.x?data.x:0;var y=data.y?data.y:0;var uiWebView=isAndroidWebView()||isIOSWebView();if(data&&!inu1(data.w))w=data.w;if(data&&!inu1(data.h))h=data.h;try{if(uiWebView)SVYM.surveyWindow=window.parent;else SVYM.surveyWindow=win.open("",getRandomTitle(),windowFeatures?windowFeatures:"left="+x+",top="+y+",width="+w+",height="+h+",scrollbars=yes,resizable=yes")}catch(e){let12("Can't launch survey window :"+e,true)}}else{var logData=null;if(!!lastChat){logData={_domain:"chat",evt:"surveyPresented",siteID:Inq.getSiteID(),businessUnitID:rule.getBusinessUnitID(),chatID:lastChat.id,customerID:Inq.getCustID(),sessionID:getSessionID(),incAssignmentID:asi4(),stage:"post-chat",surveyID:surveySpecID};if(lastChat.svyPrms){MI8.mixAbsorber(logData);logData.absorb(lastChat.svyPrms)}ROM.send(urls.logDataURL,logData)}data["customerID"]=logData.customerID;data["businessUnitID"]=logData.businessUnitID;data["busUnitID"]=logData.businessUnitID;data["sessionID"]=logData.sessionID;data["stage"]=logData.stage;data["incAssignmentID"]=logData.incAssignmentID;data["siteID"]=logData.siteID;data["surveyContent"]="";data["ClientID"]=logData.siteID;data["clientID"]=logData.siteID;data["chatID"]=logData.chatID;data["override"]=1;data["custID"]=data.customerID;if(lastChat.svyPrms){MI8.mixAbsorber(data);data.absorb(lastChat.svyPrms)}var windowURL=surveyUrlOverride?surveyUrlOverride:data.altURL.length>0?getAltSurveyURL(data,ruleEvt):ROM.composeURL(surveyURL,data);this.surveyWindow=win.open(windowURL,"SurveyWindow"+getRandomTitle(),"top="+(data.y?data.y:0)+", left="+(data.x?data.x:0)+windowSpec+" width="+(data.w?data.w:0)+", height="+(data.h?data.h:0))}}catch(e){lwt12("Survey processing error: "+e)}}else let12("Survey Error: no survey spec found. surveySpecID="+surveySpecID,true)}function getRandomTitle(){var s=""+Math.random();if(s.indexOf(".")!=-1)s=s.substring(s.indexOf(".")+1,s.length);return s}function logAutomatonStartedEvent(loggingData){var url=urls.baseURL+"/survey/surveyReport";ROM.post(url,loggingData,null,true,submitFormToSurveyWindow);if(isPersistentWindow())FP.preventChatClose(true)}function submitFormToSurveyWindow(){openSurveyCnt++;if(!inu1(SVYM.surveyWindow)&&SVYM.surveyWindow.document&&(SVYM.surveyWindow.document.readyState==="complete"||SVYM.surveyWindow.document.readyState==="uninitialized")){surveyURL=prepareURLForPostRequest(surveyURL);if(uiWebView)surveyURL=surveyURL+"?gbURL="+window.parent.location.href.replace("#","_");var survForm=SVYM.surveyWindow.document.createElement("form");survForm.name="surveyForm";survForm.id="inqSurveyForm";survForm.action=surveyURL;survForm.method="POST";survForm.style.display="none";for(var k in preSurveyDataPass){if(typeof preSurveyDataPass[k]==="function"||typeof preSurveyDataPass[k]==="object"||k=="height"||k=="width")continue;if(k=="agentAttr")getAAforKeySurvey(preSurveyDataPass[k],SVYM.surveyWindow);else addInput(k,preSurveyDataPass[k],SVYM.surveyWindow)}if(!SVYM.surveyWindow.document.body){var surveyWindow=SVYM.surveyWindow;setTimeout((function(){surveyWindow.document.body.appendChild(survForm);surveyWindow=null;survForm.submit()}),1)}else{SVYM.surveyWindow.document.body.appendChild(survForm);survForm.submit()}SVYM.surveyWindow=null;log("Survey URL: "+surveyURL);if(isPersistentWindow()){FP.closeChatInterface();FP.closeChat();window.parent.close()}}else{if(openSurveyCnt>100){openSurveyCnt=0;let12("Survey window was not shown,"+" possibly bad connection or popup blocker works.",true);return}setTimeout(submitFormToSurveyWindow,100)}function addInput(name,value,sWin){var input=sWin.document.createElement("input");input.type="hidden";input.name=name;input.value=value;survForm.appendChild(input)}function getAAforKeySurvey(aa,sWin){var aaObj=MI8.JSON.parse(aa);for(var i in aaObj)if(aaObj.hasOwnProperty(i))for(var j in aaObj[i])if(aaObj[i].hasOwnProperty(j))addInput(i,aaObj[i][j].replace(/\s+/g,""),sWin)}}function isNonAsyncChatOrValidAsyncSurvey(chat,eventData){return!chat||!chat.isAsyncChat()||eventData&&eventData.conversationResolved}function prepareURLForPostRequest(url){return secureHTTP(url.replace(/\?[^\/]*$/,"").replace("keysurvey.com","keysurvey.com/votingmodule/s180"))}function buildFormData(evt,rule){var ruleByID=BRM.rb41(brID);var formDataAddition={chatID:chatID,customerID:Inq.getCustID(),agentID:CHM.getAgentID()?CHM.getAgentID():CHM.getLastAgentID(),custID:Inq.getCustID(),initialCustomerID:CONVM.getInitialCustomerID(),conversationID:CONVM.getConversationID(),incAssignmentID:asi4(),sessionID:getSessionID(),visitorAttributes:VAM.getCopyAsArray(false).join(";"),automatonAttributes:"",siteID:getSiteID(),clientID:getSiteID(),pageID:LDM.getPageID(),businessUnitID:CHM.getBusinessUnitID(evt,rule),businessRuleID:brID,busUnitID:CHM.getBusinessUnitID(evt,rule),BRName:ruleByID?encodeURIComponent(ruleByID.getName()):""};var agentGroupId=CHM.getAgentGroupID(ruleEvt);if(agentGroupId)formDataAddition.agentGroupID=agentGroupId;var badValues=[];var coreData=["siteID","customerID","businessUnitID"];getDefaultAgentGroupId()&&coreData.push("agentGroupID");for(var i=0;i<coreData.length;i++)inu1(formDataAddition[coreData[i]])&&badValues.push(coreData[i]);if(badValues.length>0){lwt12("Some core fields are empty for survey datapass : "+String(badValues));return}if(preSurveyDataPass){for(var key in preSurveyDataPass)inu1(preSurveyDataPass[key])&&!inu1(formDataAddition[key])&&delete preSurveyDataPass[key];MI8.mixAbsorber(preSurveyDataPass).absorb(formDataAddition)}else preSurveyDataPass=formDataAddition}function buildAdditionalData(){preSurveyDataPass.availableAgentAttributes=CHM.getChatOrLastChatAgentAttributesString();preSurveyDataPass.brAttributes=firstExisting("ra1t",CHM.getChat(),rule);preSurveyDataPass.countryCode=FP.getCustGeoData()?FP.getCustGeoData().country_code:"";preSurveyDataPass.regionCode=FP.getCustGeoData()?FP.getCustGeoData().region_code:"";preSurveyDataPass.deviceType=getDeviceType();preSurveyDataPass.operatingSystemType=getOSType();preSurveyDataPass.browserType=getClientBrowserType();preSurveyDataPass.browserVersion=cbtv1();preSurveyDataPass.preAssigned=isPreassignedChat()}};this.reset=function(){this.isAsyncSurveyCalled=false;this.nativePostChatSurveyCall=null};this.setEventDataForSurvey=function(eventData){this.eventData=eventData}}MI8.prepare(SM19).im13(MI8.Observable).im13(MI8.XJA3);SM19.IDX=0;SM19.prototype.isListener=function(l){return!!l&&(l.onSurveyLaunchEvent||l.fireSurveySubmitted||l.onChatLaunched)};SM19.prototype.fireSurveyLaunched=function(chatdata,_src){var evt=MI8.mixAbsorber({id:++this.evtIdx,evtType:this.TYPES.SLAUNCHED,timestamp:new Date,src:_src});evt.absorb({chatID:chatdata.chatID,ruleID:chatdata.ruleID,customerID:mockCustID});var buID=chatdata["buID"]?chatdata["buID"]:null;var agID=chatdata["agID"]?chatdata["agID"]:null;if(!(agID&&buID)||parseInt(buID)<=0||parseInt(agID)<=0){var rule=BRM.rb41(chatdata.ruleID);if(rule){buID=buID&&parseInt(buID)>0?buID:rule.getBusinessUnitID();agID=agID&&parseInt(agID)>0?agID:rule.getAgentGroupID()}}if(agID&&parseInt(agID)>0)evt.absorb({agentGroupID:agID});if(buID&&parseInt(buID)>0)evt.absorb({businessUnitID:buID});this._fireEvt((function(l,evt){if(typeof l.onSurveyLaunchEvent=="function")l.onSurveyLaunchEvent(evt)}),evt)};SM19.prototype.fireSurveySubmitted=function(chatdata,_src){};SM19.prototype.setSurveyShown=function(value){var surveyShown=PM.getVar("surveyShown");if(!surveyShown){surveyShown=new VER34("surveyShown",0,resources["surveyShown"],"_surv",(function(o){return parseFloat(o)}));surveyShown.init();surveyShown.z3(value);PM.addVar(surveyShown)}else surveyShown.z3(value)};SM19.prototype.getSurveyShown=function(){var variable=new VER34("surveyShown",0,resources["surveyShown"],"_surv",(function(o){return parseFloat(o)}));return!!variable.z0()};SM19.prototype.TYPES=SM19.TYPES={SLAUNCHED:"SLAUNCHED",SSUBMIT:"SSUBMIT"};SM19.prototype.launchCEAPINativePostChatSurvey=function(rule){var isACIFReady=PM.getVar("isACIFReady").z0();if(!isACIFReady&&isACIFLoadedFromBR()){var cRule=rule;window.setTimeout((function(){log("Waiting for ACIF Ready when StorageReady custom event is fired.");SVYM.launchCEAPINativePostChatSurvey(cRule)}),100)}else{var npcsData=parent.CEAPI_POST_CHAT_SURVEY_DATA;var chatSpec=JSON.parse(npcsData.surveyChatSpecJSON);var chatSpecField="survey_post_chat_standard";if(isMobileDevice())chatSpecField="survey_post_chat_"+getDeviceType().toLowerCase();if(inu1(chatSpec)||inu1(chatSpec[chatSpecField])||!e9(chatSpec[chatSpecField].id,false)||!e9(chatSpec[chatSpecField].chatThemeId,false)){var msg=plc1("Unable to launch the post chat survey. Invalid Post-Chat Survey settings configurations.",npcsData.engagementID,npcsData.customerID,null,npcsData.siteID,"-1");let12(msg,false)}else{var chatSpec={id:chatSpec[chatSpecField].id,oId:-1,igaa:true,ignHOP:true,chatTheme:{id:chatSpec[chatSpecField].chatThemeId}};if(parent.CEAPI_POST_CHAT_SURVEY_DATA.skinVersion=="civ2")chatSpec.chatTheme.sv=GR34.MODERN_CI_VERSION;CHM.launchChatForNativePostChatSurvey(rule.getID(),chatSpec,npcsData)}}};SM19.prototype.isConversationResolvedOrEmtpyStatus=function(){return inu1(this.eventData)||this.eventData.conversationResolved};SM19.prototype.createCEAPIPostChatSurveyRule=function(id){var npcsData=parent.CEAPI_POST_CHAT_SURVEY_DATA;return Rule.create({id:id,name:"CEAPI-Post-Chat-Survey",tt1:function(){return[{id:"onPageLanding"}]},cc2:function(){return isCEAPIPostChatSurveyMode()},getBusinessUnitID:function(){return npcsData.businessUnitID},getAgentGroupID:function(){return npcsData.agentGroupID},af3:function(rule){SVYM.launchCEAPINativePostChatSurvey(rule)},getAutomatonParams:function(){return[{automatonID:npcsData.surveyID,context:"ci",location:"center"}]},active:true})};function reinitChat(pageID,dat){if(!isInqInitialized){lmt12("Reject reinitChat request since tcFramewor is initating a chat.",LOG_LEVELS.INFO);return}try{try{var caller=((arguments.callee?arguments.callee.caller:null)+"").substring(0,100)}catch(e){caller="<unavailable - seems to be a strict mode caller>"}try{lmt12("Reinit Framework: "+plc1()+"Caller: "+caller,LOG_LEVELS.INFO)}catch(e){}Inq.overridePageID=void 0;win.inqSiteID=pageID;var data=dat&&dat.constructor==String?MI8.JSON.parse(dat):dat;if(!CHM.isPersistentWindow())if(isWebSDK)executeReinitCall(window.v3Lander,pageID,data);else executeReinitCall(window.parent.v3Lander,pageID,data)}catch(e){let12("Error on reinitChat call."+cf21(e))}}function executeReinitCall(v3LanderObj,pageID,data){var isAnotherPage=!v3LanderObj.page||v3LanderObj.page&&v3LanderObj.page.id!==pageID;if(v3Lander.isRplMode&&isAnotherPage){v3LanderObj.reInitChatData={pageID:pageID,data:data};v3LanderObj.resolvePage()}else reinitChatV3Callback(pageID,data)}function reinitChatV3Callback(pageID,data){try{if(Inq.CBC&&Inq.CBC.reset)Inq.CBC.reset();if(data)if(data["pass"])win.inqData=data["pass"];else if(data["data"])win.inqData=data["data"];if(data&&data.sale){var s=data.sale;var w=win;w.inqSalesProducts=s.products;w.inqSalesPrices=s.prices;w.inqSalesQuantities=s.quantities;w.inqTestOrder=s.test;w.inqClientOrderNum=s.ordernum;w.inqClientTimeStamp=s.timestamp;w.inqCustomerName=s.customerName;w.inqOtherInfo=s.otherInfo}if(pageID&&pageID>0)Inq.overridePageID=pageID;updateSessionData((function(){resetManagers(pageID)}))}catch(e){let12("Error on reinitChatV3Callback call."+cf21(e));v3Lander.reInitChatData=null}}function updateSessionData(callbackFunc){if(CHM.isInlineChatInProgress())callbackFunc();else CM.requestSessionData(callbackFunc)}function resetManagers(pageID){C2CM.reset();LDM.init(true);BRM.reset();BRM.resetForReinit();BRM.init(true);BRM.start();if(!pageID&&LDM.getPageID()===-1)LDM._resolvePage();Inq.PM.resetTmpVars();Inq.unblockService("ALL");LDM.start();if(Inq.CBC)Inq.CBC.resetHtmlFilter()}function resetObserver(){if(isWebSDK)return;if(doc.body.getAttribute("data-inq-observer")=="1"){win.Inq.observer.disconnect();doc.body.setAttribute("data-inq-observer","0")}}function launchChatNowByPageID(ruleID){var rule=BRM.rb41(ruleID);if(rule!=null)EVM.fireManualInvocationEvent(rule)}function launchChatNow(ruleName){var rule=BRM.getRuleByName(ruleName);if(rule!=null)EVM.fireManualInvocationEvent(rule)}function setChatSuppressedForSession(){Inq.tryue("ALL",0)}function blockChat(scope){switch(scope){case"page":break;case"session":Inq.tryue("ALL",0);break;default:break}}function getSaleID(){var saleID=-1;try{var saleIdVar=PM.getVar("saleID");if(!!saleIdVar){var sid=saleIdVar.z0();saleID=inu1(sid)?-1:sid}}catch(err){saleID=-1}return saleID}function getChatID(){var chatID=-1;try{if(!!CHM.getChatID())chatID=CHM.getChatID()}catch(err){chatID=-1}return chatID}function showClickToCallHtml(index,html){C2CM.getC2C(index).showClickToCallHtml(html)}function getData(){try{var dataMap=getMgrData(mgrList);dataMap["cdnURL"]=urls.cdnURL;return dataMap}catch({message:message}){let12("Error in getData(): ".concat(message),true)}}function getCDNUrl(){return urls.cdnURL}function getEngagementId(){return CHM.getChatID()}function APIGetter(tokenId){switch(tokenId){case"cdnUrl":return getCDNUrl();break;case"engagementId":return getEngagementId();break;case"staticClientURL":return site.clientStaticUrl;break;case"noJSHostingEnabled":return site.noJSHosting;break;case"conversationId":return CONVM.getConversationID();default:if(tokenId)var err=new Error("Unknown property "+tokenId+" requested");else var err=new Error("Parameter required");throw err}}function getMgrData(list){var retval={};for(var idx=0;idx<list.length;idx++){var mgr=list[idx];if(!!mgr.getData&&typeof mgr.getData=="function")retval[mgr.getID()]=mgr.getData()}return retval}function closeChat(){if(window.inqFrame)try{if(typeof window.inqFrame.closeChat==="function")window.inqFrame.closeChat()}catch(e){}}function sendAutomatonMessage(msgType,message){var misspelledContext=false;var cssClass=null;var context=null;if(arguments.length>2)switch(arguments.length){case 3:if(arguments[2]==="agentInterface"||arguments[2]==="customerInterface")context=arguments[2];else cssClass=arguments[2];break;case 4:default:cssClass=arguments[2];context=arguments[3];if(context!=="agentInterface"&&context!=="customerInterface"){lmt12(plc1("No automaton message will be sent because of misspelled context="+context+". Expecting 'agentInterface' or 'customerInterface' "));misspelledContext=true}break}if(!misspelledContext)FP.sendAutomatonMessage(msgType,message,cssClass,context)}function publishAPI(apiString,varid,ruleID,_win){var winObj=isWebSDK?FrameBridge:_win||window.top;if(!apiString||apiString.constructor!==String||!winObj){lmt12(plc1("Cannot publish API function, it is null or incorrect String "+apiString+" or window object is null or undefined"));return false}try{var osa=String(apiString).split(".");var fcn=function(){var varRef=PM.getVar(varid,BRM.rb41(ruleID));return varRef?varRef.z0():null};for(var idx=0;idx<osa.length;idx++){var token=osa[idx];if(!token)continue;if(idx===osa.length-1)winObj[token]=fcn;else if(inu1(winObj[token])||typeof winObj[token]!=="object")winObj[token]={};winObj=winObj[token]}}catch(e){lmt12(plc1("Cannot publish API function "+apiString+", error occurred during processing "+e.message));return false}return true}function stop_CBC(){if(Inq&&Inq.CBM)Inq.CBM.endCobrowse();else let12("CBM is not defined on Inq.CBM.endCobrowse call.",true)}function toggleMenuBoxForCobBanner_CBC(){if(Inq.CBM&&Inq.CBM.banner)Inq.CBM.banner.toggleMenuBoxForCobBannerRef();else let12("CBM is not defined on Inq.CBM.toggleMenuBoxForCobBanner call",true)}function toggleTermsAndConditionDivForCobBanner_CBC(){if(Inq.CBM&&Inq.CBM.banner)Inq.CBM.banner.toggleTermsAndConditionDivForCobBannerRef();else let12("CBM is not defined on Inq.CBM.toggleTermsAndConditionDivForCobBannerRef call",true)}function getTermsAndConditions_CBC(flag){if(Inq.CBM&&Inq.CBM.banner)Inq.CBM.banner.termsAndConditions(flag);else let12("CBM is not defined on Inq.CBM.termsAndConditions call",true)}function sendText(){FP.ciSendText()}function declineCobShareInv(){FP.ciDeclineCobShareInv()}function declineCobInv(){FP.ciDeclineCobInv()}function expandChat(){return FP.expandChat()}function shrinkChat(){return FP.shrinkChat()}function exposeCustomerApi(){var win=isWebSDK?window.FrameBridge:window.parent;if(inu1(win.Inq)){win.Inq={};win.Inq.SaleMgr={}}if(inu1(win.Inq.CBC)&&site.enableCobrowse)win.Inq.CBC={};if(inu1(win.Inq.API))win.Inq.API={};win.Inq.launchChatNowByPageID=launchChatNowByPageID;win.Inq.launchChatNow=launchChatNow;win.Inq.setChatSupressedForSession=setChatSuppressedForSession;win.Inq.setChatSuppressedForSession=setChatSuppressedForSession;win.Inq.blockChat=blockChat;win.Inq.reinitChat=reinitChat;win.Inq.reinitChatV3Callback=reinitChatV3Callback;win.Inq.reinit=reinitChat;win.Inq.SaleMgr={getSaleID:getSaleID,getChatID:getChatID};win.Inq.showClickToCallHtml=showClickToCallHtml;win.Inq.fireCustomEvent=fireCustomEvent;win.Inq.getData=getData;win.Inq.sendAutomatonMessage=sendAutomatonMessage;win.Inq.observer=domObserver;win.Inq.closeChat=closeChat;win.Inq.DMgr={switchForModule:DMgr.switchForModule};if(site.enableCobrowse){win.Inq.CBC.stop=stop_CBC;win.Inq.CBC.toggleMenuBoxForCobBanner=toggleMenuBoxForCobBanner_CBC;win.Inq.CBC.toggleTermsAndConditionDivForCobBanner=toggleTermsAndConditionDivForCobBanner_CBC;win.Inq.CBC.termsAndConditions=getTermsAndConditions_CBC;win.Inq.CBC.ciDeclineCobShareInv=declineCobShareInv;win.Inq.CBC.ciDeclineCobInv=declineCobInv}win.Inq.SDK=FP.getSDKInstance();win.Inq.ciSendText=sendText;win.Inq.isInqInitialized=isInitialized;win.Inq.API.get=APIGetter;win.Inq.API.CI={};win.Inq.API.CI.expandChat=expandChat;win.Inq.API.CI.shrinkChat=shrinkChat}function CG(includeIds,includeCGIds,includeURLFunction,excludeIds,excludeCGIds,excludeURLFunction,businessUnits){var _lut={};var _includeIds=includeIds?includeIds:[];var _includeCGIds=includeCGIds?includeCGIds:[];var _includeURLFunction=includeURLFunction;var _excludeIds=excludeIds?excludeIds:[];var _excludeIdQuick={};var _excludeURLFunction=excludeURLFunction;var _excludeCGIds=excludeCGIds?excludeCGIds:[];this.length=_includeIds.length;for(var idx=0;idx<_includeIds.length;idx++)_lut[_includeIds[idx]]=_includeIds[idx];for(var i=0;i<_excludeIds.length;i++)_excludeIdQuick[_excludeIds[i]]=_excludeIds[i];var buIDs=businessUnits;this.contains=function(pgID,url,contentGroups){if(typeof _excludeIdQuick[pgID]=="number")return false;if(this.isInCGList(_excludeCGIds,pgID,url,contentGroups))return false;if(url&&_excludeURLFunction&&_excludeURLFunction(url))return false;if(typeof _lut[pgID]=="number")return true;if(this.isInCGList(_includeCGIds,pgID,url,contentGroups))return true;return url&&_includeURLFunction&&_includeURLFunction(url)};this.isInCGList=function(cgList,pgID,url,contentGroups){for(var i=0;i<cgList.length;i++){var cg=contentGroups[cgList[i]];if(!cg)continue;if(cg.contains(pgID,url,contentGroups))return true}return false};this.getBusinessUnits=function(){return buIDs?buIDs:null}}CG.c=function(d){return new CG(d[0],d[1],d[2],d[3],d[4],d[5],d[6])};function CRMT(callback){this.absorb(callback)}MI8.prepare(CRMT).im13(MI8.XJA3).im13(MI8.RC54).im13(MI8.JSON);CRMT.create=function(callback){return new CRMT(callback)};CRMT.prototype.onRemoteCallback=function(dstr){var data=typeof dstr=="string"?this.parse(dstr):dstr;this.doCallbackActions(data)};function SL1(d){this.absorb(d);this.data=d}MI8.prepare(SL1).im13(MI8.XJA3);SL1.c=function(data){return new SL1(data)};SL1.prototype.request=function(){if(this.data.onAgentAssigned)EVM.addListener(this.data);if(this.flashvarFcn)CHM.registerFlashvarFcn(this.flashvarFcn);if(this.data.agtid)this.chatSpec.aid=this.data.agtid;if(this.fabPlugin)this.chatSpec.pn=this.fabPlugin;if(CHM.popoutWindow!=null&&!CHM.isChatInProgress()){if(CHM.persistentWindow)return;CHM.popoutWindow.close()}this.launchChat()};SL1.prototype.launchChat=function(){CM.requestSessionData(function(){if(CHM.isChatInProgress()){log("Chat already in progress... rule chat request ignored."+(this.rule?" Rule="+this.rule.toString():""));C2CM.showDisabledIcon();CHM.resetChatRequestsQueue(this.rule)}else{var chatLaunchSource="SL1#launchChat";CHM.removeChatInstance(chatLaunchSource);CHM.request(this.rule,this.chatType,this.chatSpec,"",null,null,this.useNative,this.extChatJS,chatLaunchSource)}}.bind(this))};function DFV(i,f,v,initial){this.id=i;this.f=f;this.v=v;this.initial=initial}DFV.c=function(i,f,v,initial){return new DFV(i,f,v,initial)};DFV.prototype.toString=function(dflt){var result=dflt;try{if(isWebSDK)result=this.f();else result=s7("("+this.f.toString()+")()",{})}catch(err){log("DFV ["+this.id+"] execution failed:"+err)}var template=this.v;for(var name in result){var s=result[name];template=template.replace("${"+name+"}",s)}return template};window.XFormsLoader=function(){var INITIATOR="_$initiator";var LOCATION="_$location";var PERSISTENT_CUSTOMER_ID="_persistCustId";var INITIAL_CUSTOMER_ID="_initialCustId";var CONVERSATION_ID="_conversationId";var SESSION_DURATION=30*60*1e3;var _JSON=MI8.JSON;function stringify(obj){return _JSON.stringify(obj)}function parse(str){return _JSON.parse(str)}function log(text){if(Inq&&Inq.log)Inq.log("XF: "+text);else if(window.console)window.console.log("XF: "+text)}function logError(e){log("Error: "+e.message);if(e.origin)log("   at "+e.origin);else if(logError.caller!=null)log("   at "+logError.caller.toString().split("{")[0]);return function(value){log("   trace:["+value+"]")}}var XFormsLoader=function(){this._xhr=null;this._dtid="";this._source="";this._xframe=null;var headerData={};this.index=XFormsLoader.instances.length;XFormsLoader.instances.push(this);function getQuery(data){var query="";try{for(var key in data)query+="&"+key+"="+encodeURIComponent(data[key])}catch(e){logError(e)}return query}function getLBStickyAsFirstParameter(){return"?customerID="+Inq.getCustID()}this.createXFrame=function(div,url,businessUnitID,scrolling,data,overrideRule,initiator,location,initOnLoad,method){var chat=CHM.getChat();var rule=overrideRule?overrideRule:chat?chat.getRule():null;headerData={url:url,siteID:Inq.getSiteID(),workerPath:"window.com.inq.flash.client.control.XFrameWorker",clientHtml:getHostedFileUrl(),_chatID:CHM.getChatID()?CHM.getChatID():"",_agentID:CHM.getAgentID()?CHM.getAgentID():"",_businessUnitID:getBusinessUnitId(businessUnitID),_siteID:Inq.getSiteID(),_customerID:Inq.getCustID(),_sessionID:FP.getSessionID(),_incAssignmentID:FP.asi4(),_clientPageURL:FP.getClientPageURL(),_pageMarker:LDM.getPageMarker(),_pageID:initOnLoad?CHM.getLaunchPageId():LDM.getPageID(),_language:rule?rule.getLanguage():Inq.getDefaultLanguage(),_visitorAttributes:VAM.getCopyAsArray(true).join(";"),_brAttributes:rule?rule.ra1t():"",_browserType:getClientBrowserType(),_browserVersion:cbtv1(),_operatingSystemType:getOSType(),_deviceType:getDeviceType(),_qt:CHM.q6t()?CHM.q6t():"",_externalCustomerIDs:VAM.getExternalCustomerIdVisitorAttributesAsString(),_countryCode:FP.getCustGeoData().country_code,_regionCode:FP.getCustGeoData().region_code};if(chat&&chat.getAutomatonSpecData())try{headerData._automatonDataMap=stringify(chat.getAutomatonSpecData())}catch(e){logError(e)("automatonDataMap is malformed for rule "+rule.getID()+" siteID="+Inq.getSiteID()+" customerID="+Inq.getCustID())}else{var automatonDataMap=PM.getVar("automatonDataMap");if(automatonDataMap){var value=automatonDataMap.z0();if(value)headerData._automatonDataMap=prepareAutomatonDataMap(value)}}var brId="";if(rule){headerData._brName=rule.getName();headerData._brId=brId=rule.getID()}headerData[INITIATOR]=stringify(initiator?initiator:{type:"br",id:brId});headerData[LOCATION]=location?stringify(location):"";var agID=getAgentGroupId(location,rule,chat);if(agID)headerData._agentGroupID=agID;var persistentCustomerID=FP.getPersistentCustomerID();if(persistentCustomerID)headerData[PERSISTENT_CUSTOMER_ID]=persistentCustomerID;var initialCustomerID=CONVM.getInitialCustomerID();if(initialCustomerID)headerData[INITIAL_CUSTOMER_ID]=initialCustomerID;var conversationID=CONVM.getConversationID();if(conversationID)headerData[CONVERSATION_ID]=conversationID;for(var field in data)if(!headerData[field])headerData[field]=data[field];var nameIFrame=encodeURIComponent(MI8.JSON.stringify(headerData));if(!scrolling)scrolling="no";div.innerHTML='<IFRAME width="100%" height="100%" class="inqChatFoo" frameborder="0" scrolling="'+scrolling+'" '+'name="'+nameIFrame+'" ></IFRAME>';this._xframe=div.getElementsByTagName("IFRAME")[0];if(checkForOutdatedAutomaton(chat,location,data.dtid))return this._xframe;this._xframe.headerData=headerData;if(url){this._source=url;this._dtid=data.dtid;if(!!method&&method=="POST")ROM.post(url,headerData);else this.loadForm(url)}return this._xframe};function prepareAutomatonDataMap(value){if(typeof value!=="string"){value=stringify(value);lwt12("The 'automatonDataMap' contains incorrect value type: "+value+". Converted to JSON format.")}return isAutomatonDataMapValid(value)?value:""}function isAutomatonDataMapValid(value){var obj;try{obj=parse(value)}catch(e){let12("The 'automatonDataMap' value is not correct JSON string: "+value+". "+cf21(e));return false}if(typeof obj==="object"&&obj!==null&&!Array.isArray(obj))return true;else{let12("The 'automatonDataMap' value is not an Object: "+value+". ",true);return false}}function checkForOutdatedAutomaton(chat,location,dtid){var skipLoad=false;if(chat&&location&&location.type!="div"){var automatons=CHM.getCiAutomatons();var now=(new Date).getTime();if(automatons[location.id]&&automatons[location.id].dt==dtid&&automatons[location.id].time+SESSION_DURATION<now){log("This automaton: "+dtid+" was already initialized at this chat session, possibly cache expired or this chat is old");skipLoad=true}else{automatons[location.id]={time:now,dt:dtid};CHM.setCiAutomatons(automatons)}}return skipLoad}function getAgentGroupId(location,rule,chat){if(chat&&location&&location.type=="chat"){var chatAgID=chat.getChatAgentGroupID();if(chatAgID)return chatAgID;else return chat.getAgentGroupID()}else return rule?rule.getAgentGroupID():null}function getBusinessUnitId(businessUnitIdOverride){var chat=CHM.getChat();var buID;if(chat&&chat.getChatBusinessUnitID()!=-1)buID=chat.getChatBusinessUnitID();else buID=businessUnitIdOverride?businessUnitIdOverride:FP.getBusinessUnitID();return buID}this.loadForm=function(automatonRequestUrl){XFormsLoader.requestQueue.push(this);if(!XFormsLoader.isGetSessionIdInProgress)XFormsLoader.getJavaSessionId(automatonRequestUrl,1)};XFormsLoader.getSessionIdUrl=function(automatonRequestUrl){var parts=automatonRequestUrl.split("/");var protocol=parts[0];var domain=parts[2];return protocol+"//"+domain+"/"+parts[3]+"/jsid/getSessionId"+getLBStickyAsFirstParameter()};XFormsLoader.getJavaSessionId=function(automatonRequestUrl,attemptNumber){try{if(window.top==window.parent&&window==window.top.inqFrame){var sessionId=XFormsLoader.initJsid();XMLHttpRequestFacade.jsessionid=!!sessionId?sessionId:null;var xhr=new XMLHttpRequestFacade;var urlGetSessionId=XFormsLoader.getSessionIdUrl(automatonRequestUrl);xhr.open("GET",urlGetSessionId,true);xhr.onreadystatechange=function(){if(xhr.readyState==XMLHttpRequestFacade.DONE){if(xhr.status==200){XFormsLoader.obtainedSessionId(xhr.response);XFormsLoader.isGetSessionIdInProgress=false}else if(xhr.status==404){let12("XFormsLoader.getJavaSessionId: Can't get JSESSIONID. "+"attempts=["+attemptNumber+"] status=["+xhr.status+"] response=["+xhr.response+"]",true);XFormsLoader.isGetSessionIdInProgress=false;XFormsLoader.continueLoadingForms()}else if(xhr.status==0&&attemptNumber<XFormsLoader.MAX_ATTEMPTS_COUNT)setTimeout((function(){XFormsLoader.getJavaSessionId(automatonRequestUrl,attemptNumber+1)}),1e3);else{XFormsLoader.isGetSessionIdInProgress=false;let12("XFormsLoader.getJavaSessionId: Can't get JSESSIONID. "+"attempts=["+attemptNumber+"] status=["+xhr.status+"] response=["+xhr.response+"]",true)}xhr.onreadystatechange=null;xhr=null}};XFormsLoader.isGetSessionIdInProgress=true;xhr.send()}else XFormsLoader.continueLoadingForms()}catch(e){logError(e)("getJavaSessionId")}};XFormsLoader.obtainedSessionId=function(jSessionId){if(jSessionId.length>0){XMLHttpRequestFacade.jsessionid=jSessionId;XFormsLoader.persistJsid(jSessionId)}XFormsLoader.continueLoadingForms()};XFormsLoader.continueLoadingForms=function(){for(var i=0;i<XFormsLoader.requestQueue.length;i++)XFormsLoader.requestQueue[i].continueLoadingForm();XFormsLoader.requestQueue=[]};this.continueLoadingForm=function(){this._xhr=new XMLHttpRequestFacade;var XFormsLoaderInst=this;this._xhr.onreadystatechange=function(){var xhr=this;if(xhr.readyState==XMLHttpRequestFacade.DONE){XFormsLoaderInst.obtainedSourceHtml(xhr.response);XFormsLoaderInst=null}};var url=this._source+getLBStickyAsFirstParameter()+getQuery(headerData);this._xframe["href"]=url;this._xhr.open("GET",url,true);this._xhr.send();return false};function fixDocumentRewriteBug(html,win,locationHost,documentDomain){try{win.DOCUMENT_REWRITE_BUG=true}catch(e){logActionErr(e,this)}locationHost=locationHost||window.location.host;documentDomain=documentDomain||document.domain;html=html.replace("</head>",'<script type="text/javascript">if (typeof DOCUMENT_REWRITE_BUG != "undefined") {top.inqFrame.Inq.FlashPeer.formsLoader.resetGlobalVars(window);}<\/script></head>');var host=locationHost.replace(/:\d+$/,"");if(host!=documentDomain)html=html.replace(/(<\s*body\b[^>]*>)/gi,'\n$1\n<script type="text/javascript">try{document.domain="'+documentDomain+'";}catch(er){}<\/script>\n');return html}this.fixDocumentRewriteBug=fixDocumentRewriteBug;this.obtainedSourceHtml=function(response){this._html=normalizeHtml(response,this._source);var assignDomain=function(){try{var domainName=document.domain;var temp=domainName.split(".");var tempwindow;for(var i=0;i<temp.length;i++)try{tempwindow=window.parent;if(document.domain==tempwindow.document.domain)break;else{temp.shift();document.domain=temp.join(".")}}catch(ee){temp.shift();document.domain=temp.join(".")}}catch(e){}};if(!this._xframe.src){var haveDocAccess=true;try{var x=this._xframe.contentDocument}catch(e){haveDocAccess=false}if(!haveDocAccess){var assignDomainFunctionAsString=assignDomain.toString();assignDomainFunctionAsString=assignDomainFunctionAsString.split("\n").join("").split("\t").join("").split("\r").join("").split("\\'").join("'").split("'").join("\\'");var selfExecutingFunction="("+assignDomainFunctionAsString+";})();";var source='javascript:\'\x3c!-- DOCTYPE html --\x3e<html><body><script type="text/javascript" charset="utf-8">'+selfExecutingFunction+"<\/script></body></html>'";this._xframe.src=source}}var needToWaitForLoad=true;try{var doc=this._xframe.contentDocument?this._xframe.contentDocument:this._xframe.contentWindow.document;if(doc.readyState=="complete"||doc.readyState=="loaded")needToWaitForLoad=false}catch(e){needToWaitForLoad=true}if(needToWaitForLoad){var xframe=this._xframe;var myThis=this;this._xframe.onload=function(){xframe.onload=null;myThis.writeObtainedHtml()};this._xframe.onreadystatechange=function(){if(xframe.readyState=="complete"||xframe.readyState=="loaded"){xframe.onreadystatechange=null;myThis.writeObtainedHtml()}}}else this.writeObtainedHtml()};this.writeObtainedHtml=function(){this._xframe.onreadystatechange=null;this._xframe.onload=null;this._html=fixDocumentRewriteBug(this._html,this._xframe.contentWindow);if(this._xframe.contentDocument)writeForm(this._xframe.contentDocument,this._html);else if(this._xframe.contentWindow)writeForm(this._xframe.contentWindow.document,this._html);else logError({origin:"writeObtainedHtml",message:"Target document not found"})};function writeForm(doc,html){doc.open();doc.write(html);doc.close();XFormsLoader.instances[this.index]=null;XFormsLoader.instances.splice(this.index,1)}function normalizeHtml(html,source){var srcParts=source.split("/");var proto=srcParts[0];var domain=srcParts[2];srcParts.pop();var path=srcParts.join("/");var x=new RegExp('(href|src|action)="((inq://|http://|https://|//|/|#){0,1}[^"]*)"',"gi");var matches=html.match(x);if(matches!=null)for(var ix=0;ix<matches.length;ix++)try{var fix=matches[ix];x=new RegExp('(href|src|action)="((inq://|javascript:|http://|https://|//|/|#){0,1}([a-zA-Z0-9._-]+)([^"]*)")',"gi");var parts=x.exec(fix);if(parts!=null){var url;switch(parts[3].toLowerCase()){case"inq://":if(parts.length>4){switch(parts[4]){case"agentsAvailabilityCheckURL":url=Inq.urls.agentsAvailabilityCheckURL;break;case"baseURL":url=Inq.urls.baseURL;break;case"chatRouterVanityDomain":url=Inq.FlashPeer.getChatRouterVanityUrl();break;case"pageUnloadURL":url=Inq.urls.pageUnloadURL;break;case"cobrowseURL":url=Inq.urls.cobrowseURL;break;case"getSiteTzOffsetURL":url=Inq.urls.getSiteTzOffsetURL;break;case"initFrameworkURL":url=Inq.urls.initFrameworkURL;break;case"logDataURL":url=Inq.urls.logDataURL;break;case"logJsPostURL":url=Inq.urls.logJsPostURL;break;case"loggingURL":url=Inq.urls.loggingURL;break;case"mediaBaseURL":url=Inq.urls.mediaBaseURL;break;case"mediaRootURL":url=Inq.urls.mediaRootURL;break;case"mediaSiteURL":url=Inq.urls.mediaSiteURL;break;case"requestC2CImageURL":url=Inq.urls.requestC2CImageURL;break;case"requestChatLaunchURL":url=Inq.urls.requestChatLaunchURL;break;case"siteHostedFileURL":url=Inq.urls.siteHostedFileURL;break;case"skinURL":url=Inq.urls.skinURL;break;case"vanityURL":url=urls.vanityURL;break;case"addActiveWindowIdURL":url=Inq.urls.addActiveWindowIdURL;break;case"xFormsDomain":default:url=Inq.urls.xFormsDomain;break}url+=parts[5]}break;case"http://":case"https://":case"javascript:":case"#":url=parts[2];break;case"//":url=proto+parts[2];break;case"/":url=proto+"//"+domain+parts[2];break;default:url=path+"/"+parts[2];break}url=parts[1]+'="'+url+'"';if(url!=fix)html=html.replace(fix,url)}}catch(e){}return html}this.fixFormSubmit=function(xwin,headerData){function collectFormData(form){var data=[];for(var i=0;i<form.length;i++){var child=form[i];if(child.nodeName=="INPUT"||child.nodeName=="BUTTON")if(child.name)data.push(encodeURIComponent(child.name)+"="+encodeURIComponent(child.value))}return data.join("&")}function overrideSubmit(){var method=this.method.toUpperCase();var url=headerData.srcurl?headerData.srcurl+"&cbust="+Math.floor(Math.random()*1000011):this.action;var data=collectFormData(this);var callback=function(){if(this.readyState==XMLHttpRequestFacade.DONE&&this.status==200){this.onreadystatechange=null;var html=normalizeHtml(this.responseText,url);html=fixDocumentRewriteBug(html,xwin);writeForm(xwin.document,html)}};var xdr=new XMLHttpRequestFacade;if(method=="POST"){xdr.open(method,url,true);xdr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xdr.setRequestHeader("Content-Length",data.length);xdr.setRequestHeader("Connection","keep-alive");xdr.onreadystatechange=callback;xdr.send(data)}else{xdr.open(method,url+="?"+data,true);xdr.onreadystatechange=callback;xdr.send()}return true}var forms=xwin.document.getElementsByTagName("FORM");for(var i=0;i<forms.length;i++)forms[i].submit=overrideSubmit}};XFormsLoader.instances=[];XFormsLoader.JSESSIONID="ji";XFormsLoader.requestQueue=[];XFormsLoader.isGetSessionIdInProgress=false;XFormsLoader.MAX_ATTEMPTS_COUNT=3;XFormsLoader.resetGlobalVars=function(win){"use strict";function getCleanWindow(ijsfWin){var cleanIFrame=ijsfWin.document.getElementById("cleanIFrame");if(!cleanIFrame){cleanIFrame=ijsfWin.Inq.createHiddenIFrame("cleanIFrame");ijsfWin.document.body.appendChild(cleanIFrame)}var win=cleanIFrame.contentWindow;if(typeof win=="undefined"||win==null)logError({message:"Failed to get clean window object"});return win}log("Resetting global variables to overcome WebKit's peculiarity");var cleanWindow=getCleanWindow(window);if(win.XMLHttpRequestOriginal){win.XMLHttpRequest=win.XMLHttpRequestOriginal;win.XMLHttpRequestOriginal=void 0}for(var property in win)if(win.hasOwnProperty(property)&&typeof cleanWindow[property]=="undefined")try{win[property]=void 0}catch(ex){log("WARN: cannot delete global variable '"+property+"'")}if(typeof YAHOO!="undefined")logError({message:"Failed to delete the YAHOO global variable."})};XFormsLoader.initJsid=function(){var jsidVar=PM.getVar(XFormsLoader.JSESSIONID);if(!jsidVar){jsidVar=new VER34(XFormsLoader.JSESSIONID,"",resources["session"]);jsidVar.init();jsidVar.z0();PM.addVar(jsidVar)}return jsidVar.z0()};XFormsLoader.persistJsid=function(jsid){PM.getVar(XFormsLoader.JSESSIONID).z3(jsid)};XFormsLoader.showInClientDiv=function(divId,rule,ruleBusinessUnitId,url,items,method){var divEl=getParentPageElById(divId,doc);if(inu1(divEl))log('Error: DIV with id "'+divId+'" not found.');else{var buID=ruleBusinessUnitId?ruleBusinessUnitId:rule.getBusinessUnitID();var urlData=FP.parseXFrameUrl(url);if(typeof urlData.params=="object"){MI8.prepare(urlData.params).im13(MI8.XJA3);urlData.params=MI8.unmix(urlData.params.absorb(items))}var ldr=new XFormsLoader;method=method?method:null;ldr.createXFrame(divEl,urlData.url,buID,"no",urlData.params,rule,{type:"br",id:rule.getID()},{type:"div",id:divId},false,method)}};return XFormsLoader}();function CBMR(id,config){var cbMgrRef=this;this._frameworkModule(id);this._config=config;var DEFAULT_AUTH_MODE={auth:0};var cntAlertToAgent=0;var MAX_ALERT_SENT=2;var PS_CBC_AUTH="cbcAuth";var authMode={SHARED_CONTROL:2,ACCEPTED:1,NOT_SHARED:0};var KEY_COBROWSE_EVENT_TYPE_CLIENT_COBROWSE_END="49";var KEY_COBROWSE_EVENT_TYPE_AGENT_COBROWSE_END_MESSAGE_FROM_CI="521";var KEY_COBROWSE_EVENT_TYPE_CLIENT_PERFORMANCE_TEST="53";var KEY_COBROWSE_EVENT_TYPE_CLIENT_COBROWSE_SUPPRESSED="55";function getDomain(location){return location.protocol+"//"+location.host}function getInqFrameUrl(){return getDomain(inqFrame.location)+inqFrame.location.pathname}function generateID(name){return name+Math.floor(Math.random()*1000011)}function getCookiePath(){return Inq.CM.getIFrameBaseURL()}function getChatID(){if(typeof Inq!="undefined"&&Inq.CHM)return Inq.CHM.getChatID();return"0"}function isValidChatID(){return getChatID()!="0"}function getAgentID(){if(typeof Inq!="undefined"&&Inq.CHM)return Inq.CHM.getAgentID();return 0}function isValidAgentID(){return getAgentID()!=""&&getAgentID()!=0}this.initCobrowseAuthorizationTimer=function(){var TIMERINTERVAL_AUTH_CHECK=5e3;this.authCheckTimer=setInterval(checkAuthorized,TIMERINTERVAL_AUTH_CHECK)};this.endCobrowseOnChatTimeout=function(){if(isValidChatID()&&Inq.CHM.isChatInProgress())checkAuthorized();else authorize(cobrowse.NOT_SHARED)};function authorize(auth){var COOKIE_COBROWSE="cobrowse";var COOKIE_EXPIRATION=24*60*60;var generatedId=generateID(PS_CBC_AUTH);var expiry=new Date((new Date).getTime()+COOKIE_EXPIRATION*1e3).toGMTString();var data=["CBAUTH",generatedId,Inq.getSiteID(),getInqFrameUrl(),COOKIE_COBROWSE,auth,"/cobrowse",expiry,true];var callBack=function(){};if(!CHM.isPersistentWindow())callBack=getCallbackContext();Inq.CM.postRequestToIframe(getCookiePath(),data,generatedId,callBack)}function checkAuthorized(){var PS_CBC_CHECK="cbcCheck";var COOKIE_COBROWSE="cobrowse";if(isValidChatID()){var generatedId=generateID(PS_CBC_CHECK);var data=["CBCHECK",generatedId,Inq.getSiteID(),getInqFrameUrl(),COOKIE_COBROWSE];Inq.CM.postRequestToIframe(getCookiePath(),data,generatedId,getCallbackContext())}}function getCallbackContext(){var context={};context["callbackFun"]=loadComplete;return context}function loadComplete(context){if(context)if(context.data!=null){var cd=context.data;if(cd.action=="auth")if(Inq&&Inq.CBC)Inq.CBC.callBackAuthorized(getAuthModeFromJson(cd.resp,cd.id))}}function getAuthModeFromJson(json,boxID){if(json==null)return DEFAULT_AUTH_MODE;else{var mode=parseJson(json,DEFAULT_AUTH_MODE);if(mode==null||!mode.auth)mode=DEFAULT_AUTH_MODE;if(mode.auth!=0&&!(mode.auth&authMode.ACCEPTED))if(boxID.indexOf(PS_CBC_AUTH)==0)notifyAgentUponFailure("Cobrowse enable failed, error code ["+boxID+"]");return mode}}function parseJson(json,defaultValue){try{return Inq.CM.JSON.parse(json)}catch(e){try{return window.eval("("+json+")")}catch(err){logError("Error(parseJson) json="+json,err)("json:"+json)}return defaultValue}}function notifyAgentUponFailure(message){try{if(cntAlertToAgent<MAX_ALERT_SENT){cntAlertToAgent++;cbMgrRef.getFlashPeer().ciSendMessageQuietly(message)}}catch(e){logError("Error(notifyAgentUponFailure) message="+message,e)}}this.getFlashPeer=function(){try{if(Inq.CHM&&Inq.CHM.persistentWindow&&Inq.CHM.persistentWindow.inqFrame&&Inq.CHM.persistentWindow.inqFrame.Inq&&Inq.CHM.persistentWindow.inqFrame.Inq.FlashPeer)return!Inq.CHM.persistentWindow.closed?Inq.CHM.persistentWindow.inqFrame.Inq.FlashPeer:null;if(Inq.FlashPeer&&Inq.FlashPeer.ciCheckCobrowseMgrAvalibility())return Inq.FlashPeer}catch(e){}return null};this.getEngagementId=function(){return Inq.CHM.getChatID()};this.isPersistentChatActive=function(){return Inq.CHM.isPersistentChatActive()};function logWarn(message){if(Inq.CBC)Inq.CBC.logToServer(message,Inq.CBC.LOG_LEVEL.WARN)}function logError(message,e){var errorDetails="["+getFullBrowserInfo()+"] "+message+", URL: "+top.document.URL;if(logError.caller!=null)errorDetails+=", at:"+logError.caller.toString().split("{")[0];if(e&&e.message){errorDetails+=", "+e.message;if(e.stack!=null)errorDetails+=",\nStack Trace:"+e.stack}if(Inq.CBC)Inq.CBC.logToServer(errorDetails,Inq.CBC.LOG_LEVEL.ERROR);return function(value){if(Inq.CBC)Inq.CBC.logToServer("   Trace value:["+value+"]")}}var browserInfo="";function getFullBrowserInfo(){if(!browserInfo&&typeof Inq!="undefined"&&Inq.getFullBrowserInfo)browserInfo=Inq.getFullBrowserInfo();return browserInfo}this.startCobrowse=function(flagStartBenchmarkTest){authorize(authMode.ACCEPTED);if(window["cobrowse"])window["cobrowse"].startCobrowse(flagStartBenchmarkTest)};this.startSharedCobrowse=function(flagStartBenchmarkTest){authorize(authMode.ACCEPTED|authMode.SHARED_CONTROL);if(window["cobrowse"])window["cobrowse"].startSharedCobrowse(flagStartBenchmarkTest)};this.stopCobrowse=function(callback){authorize(authMode.NOT_SHARED);if(window["cobrowse"])window["cobrowse"].stopCobrowse();if(callback)callback()};this.stopCobrowseQuiet=function(){this.stopCobrowse()};this.endCobrowse=function(){this.stopCobrowse(ciProxy.ciSendCobrowseEnded);var flashPeer=cbMgrRef.getFlashPeer();if(flashPeer!=null)flashPeer.ciSetFocusOnChatInputField()};this.stopCobrowseExternal=function(){this.stopCobrowse(ciProxy.ciAgentEndsCob)};this.stopByEtlEvent=function(windowId){if(!Inq.CHM.isMultiChatSupported()||Inq.CHM.isMultiChatSupported()&&window["cobrowse"]&&windowId==window["cobrowse"].getCobrowseWindowId()||Inq.CHM.isMultiChatSupported()&&Inq.CHM.isPersistentChat()){this.stopCobrowse(ciProxy.ciAgentEndsCob);var flashPeer=cbMgrRef.getFlashPeer();if(flashPeer!=null)flashPeer.ciSetFocusOnChatInputField()}};function sendCobrowseMessage(cobrowseEvent,messageText,resendToClient){try{if(isValidChatID())if(isValidAgentID())Inq.ROM.sendCobrowseMessage(getChatID(),getAgentID(),Inq.getCustID(),cobrowseEvent,messageText,resendToClient,Inq.getSiteID());else logError("Error (sendCobrowseMessage): Invalid agent id for chatId = "+getChatID()+", cobrowseEvent = "+cobrowseEvent+", message = "+messageText)}catch(e){logError("Error (sendCobrowseMessage): chatId = "+getChatID()+", cobrowseEvent = "+cobrowseEvent+", message = "+messageText,e)}}var ciProxy=function(){return{ciAgentEndsCob:function(){try{cbMgrRef.getFlashPeer().ciAgentEndsCob()}catch(e){sendCobrowseMessage(KEY_COBROWSE_EVENT_TYPE_AGENT_COBROWSE_END_MESSAGE_FROM_CI,Inq.getLocalizedMessage("agentEndCobrowseSession"),true)}},ciSendCobrowseEnded:function(){try{cbMgrRef.getFlashPeer().ciSendCobrowseEnded()}catch(e){sendCobrowseMessage(KEY_COBROWSE_EVENT_TYPE_CLIENT_COBROWSE_END,Inq.getLocalizedMessage("customerEndCobrowseSession"),true)}}}}();this.filterPageRules=function(rules){var filteredRules=[];if(rules)for(var i=0;i<rules.size();i++){var rule=rules[i];if(isRuleForPage(rule))filteredRules.push(rule)}return filteredRules};function isRuleForPage(rule){if(!rule.pageMarker&&!rule.urlRegex&&!rule.markerRegex&&!rule.pageId&&!rule.contentGroupId)return true;var result=false;var parentURL=getParentURL();var pageMarker=getPageMarker();if(rule.pageMarker&&rule.pageMarker==pageMarker||rule.urlRegex&&parentURL.match(rule.urlRegex)||rule.pageId&&Inq.LDM.pageCheck(rule.pageId)||rule.markerRegex&&pageMarker&&pageMarker.match(rule.markerRegex)||rule.contentGroupId&&Inq.LDM.checkCG(rule.contentGroupId))result=true;return result}function getParentURL(){return parent.location.href}var selectorId;this.getPageSelectorId=function(){if(!selectorId){var parse_esurance=parent.location.hostname.indexOf("esurance")!=-1||parent.location.hash.indexOf("RTDEV-37298")!=-1;selectorId=parse_esurance?"mainFrame":"DEFAULT_SELECTOR_ID"}return selectorId};function getPageDocument(){return parent.document}this.initBanner=function(){var divs=false;var DIV_ID_TERMS_AND_CONDITIONS="tcCbTermsAndConditions";var DIV_ID_TERMS_CLOSE="tcCbTermsAndConditionsClose";var DIV_ID_COBROWSE_BANNER="tcCobrowseBannerDiv";function createBannerDiv(){var div=getPageDocument().createElement("DIV");div.id=DIV_ID_COBROWSE_BANNER;div.setAttribute("aria-live","polite");div.style.display="none";getPageDocument().body.appendChild(div);setCobrowseBannerText(getBannerText());return{banner:getPageDocument().getElementById(DIV_ID_COBROWSE_BANNER),terms:getPageDocument().getElementById(DIV_ID_TERMS_AND_CONDITIONS),termsClose:getPageDocument().getElementById(DIV_ID_TERMS_CLOSE)}}function toggle(div,visible){if(div){var theDisplay=div.style.display;if(visible===true){if(theDisplay!=="block"){div.style.display="block";adjustRestoreDivForCob()}}else if(theDisplay!=="none"){div.style.display="none";adjustRestoreDivForCob()}}}function getBannerText(){var suppressedBannerText=getSuppressBannerText();if(isSuppressed()&&suppressedBannerText)return suppressedBannerText;else return Inq.FlashPeer.getLocalizedMessage("cobrowseBanner",true)}function getSuppressBannerText(){return Inq.FlashPeer.getLocalizedMessage("cobrowseSuppressedBanner",true)}function setCobrowseBannerText(bannerText){var topDoc=getPageDocument();var div=topDoc.getElementById(DIV_ID_COBROWSE_BANNER);if(div&&bannerText){div.innerHTML=bannerText;if(Inq.FlashPeer.getDeviceType()==="Phone"){var divInqC2CMob=topDoc.getElementById("inqC2CMobDiv");if(divInqC2CMob&&divInqC2CMob.style.opacity!=0){divInqC2CMob.setAttribute("origOpacity",divInqC2CMob.style.opacity);divInqC2CMob.style.opacity=0}}}return div}function extractCssToHead(div){var head=getPageDocument().getElementsByTagName("HEAD")[0];if(head&&div){var links=div.getElementsByTagName("LINK");for(var i=0;i<links.length;i++){var link=getPageDocument().createElement("LINK");link.type="text/css";link.rel="stylesheet";link.href=links[i].href;head.appendChild(link);links[i].parentNode.removeChild(links[i])}var styles=div.getElementsByTagName("STYLE");for(var i=0;i<styles.length;i++){var style=getPageDocument().createElement("STYLE");style.type="text/css";head.appendChild(style);if(style.styleSheet)style.styleSheet.cssText=styles[i].innerHTML+cssHighlightStyleCI;else style.innerHTML=styles[i].innerHTML+cssHighlightStyleCI;styles[i].parentNode.removeChild(styles[i])}}}function adjustRestoreDivForCob(){try{if(Inq.FlashPeer.getDeviceType()==="Phone"){var topDoc=getPageDocument();var divMinimized=topDoc.getElementById("tcChat_Minimized");var divRestore=topDoc.getElementById("tcChat_btnRestore");var divCobDiv=topDoc.getElementById("tcCobrowseBannerDiv");var divCobInnerDiv=topDoc.getElementById("tcCob");var divInqC2CMob=topDoc.getElementById("inqC2CMobDiv");if(divMinimized&&divCobDiv&&divCobInnerDiv)if(divCobDiv.style.display=="none"){if(divMinimized.hasAttribute("origBottomPosition")){divMinimized.style.bottom=divMinimized.getAttribute("origBottomPosition");divMinimized.removeAttribute("origBottomPosition")}if(divRestore.hasAttribute("origPosition")){divRestore.style.position=divRestore.getAttribute("origPosition");divRestore.removeAttribute("origPosition")}if(divInqC2CMob&&divInqC2CMob.hasAttribute("origOpacity")){divInqC2CMob.style.opacity=divInqC2CMob.getAttribute("origOpacity");divInqC2CMob.removeAttribute("origOpacity")}}else if(divCobDiv.style.display!="none"){if(!divMinimized.hasAttribute("origBottomPosition")){divMinimized.setAttribute("origBottomPosition",divMinimized.style.bottom);divMinimized.style.bottom=parseFloat(divMinimized.style.bottom)+parseFloat(divCobInnerDiv.clientHeight)+"px"}if(!divRestore.hasAttribute("origPosition")){divRestore.setAttribute("origPosition",divRestore.style.position);divRestore.style.position="absolute"}if(divInqC2CMob&&divInqC2CMob.style.opacity!=0){divInqC2CMob.setAttribute("origOpacity",divInqC2CMob.style.opacity);divInqC2CMob.style.opacity=0}}}}catch(e){logError("Error(adjustRestoreDivForCob): ",e)}}function toggleMenuBoxForCob(visible){try{var innerMenu=getPageDocument().getElementById("hamBugMenuBoxId");var aElm;if(innerMenu)if(visible===false||innerMenu.style.display=="block")innerMenu.style.display="none";else{innerMenu.style.display="block";aElm=window.top.document.querySelector("#hamBugMenuBoxId a:first-of-type");if(aElm)window.setTimeout((function(){aElm.focus()}),5e3)}}catch(e){logWarn("Error(toggleMenuBoxForCob): "+e)}}function toggleTermsAndConditionDivForCob(visible){try{var tncObj=getPageDocument().getElementById("termsAndCondId");if(tncObj){toggleMenuBoxForCob(false);if(visible===false||tncObj.style.display=="block")tncObj.style.display="none";else{tncObj.style.display="block";tncObj.style.width=parseFloat(getPageDocument().defaultView.innerWidth)-2+"px";tncObj.style.height=parseFloat(getPageDocument().defaultView.innerheight)-parseFloat(getPageDocument().getElementById("hamBugMenuBoxId").clientHeight)+"px"}}}catch(e){logError("Error(toggleTermsAndConditionDivForCob): ",e)}}function toggleTermsAndConditions(visible){if(divs.terms)toggle(divs.terms,visible);if(divs.termsClose)toggle(divs.termsClose,visible)}return{getBannerDivId:function(){return DIV_ID_COBROWSE_BANNER},hide:function(){toggleMenuBoxForCob(false);toggle(divs.banner,false);toggleTermsAndConditions(false)},show:function(){if(!divs)divs=createBannerDiv();window.setTimeout((function(){toggle(divs.banner,true)}),3e3)},setSuppressBanner:function(){setCobrowseBannerText(getSuppressBannerText())},termsAndConditions:function(visible){toggleTermsAndConditions(visible)},adjustRestoreDivForCobBannerRef:function(){adjustRestoreDivForCob()},toggleTermsAndConditionDivForCobBannerRef:function(){toggleTermsAndConditionDivForCob()},toggleMenuBoxForCobBannerRef:function(){toggleMenuBoxForCob()}}};function isSuppressed(){return Inq.CBC&&Inq.CBC.isPageMaxSizeExceeded()||isSuppressedByPageConfig()}function getPageMarker(){return Inq.LDM.page?Inq.LDM.page.mID:null}this.isEmbeddedResourceForCurrentPageMarker=function(absoluteUrl){return config.isEmbeddedResource(absoluteUrl,getPageMarker())};this.settingIdConst={getCBCFromTS:"FETCH_CBC_FROM_TAGSERVER"};var defaultSettings={};defaultSettings[this.settingIdConst.getCBCFromTS]=false;this.getCobrowseSettingValue=function(settingId){var settingValue;if(site.extraSettings&&site.extraSettings[settingId])settingValue=site.extraSettings[settingId];else settingValue=defaultSettings[settingId];return settingValue};this.getCustomCSS=function(){var SPRINT_MENU_HOTFIX=".sprint-header-inner .sprint-header-meta a,"+".sprint-header-inner .sprint-header-meta nav ul li,"+".sprint-header-inner .sprint-header-tools div { float: left; }"+"div.content {clear: both }";return Inq.getSiteID()==154?SPRINT_MENU_HOTFIX:""};this.callbacks={cobrowseFailHandler:function(cbcFailMessage){sendCobrowseMessage(KEY_COBROWSE_EVENT_TYPE_CLIENT_COBROWSE_END,cbcFailMessage)},benchmarkTestHandler:function(messageText){sendCobrowseMessage(KEY_COBROWSE_EVENT_TYPE_CLIENT_PERFORMANCE_TEST,messageText)},pageSuppressedHandler:function(messageText){sendCobrowseMessage(KEY_COBROWSE_EVENT_TYPE_CLIENT_COBROWSE_SUPPRESSED,messageText)}};this.testHooks={getAuthModeFromJson:getAuthModeFromJson,DEFAULT_AUTH_MODE:DEFAULT_AUTH_MODE,filterPageRules:this.filterPageRules,defaultSettings:defaultSettings}}function isSuppressedByPageConfig(){return Inq.LDM.page?Inq.LDM.page.sup:false}MI8.prepare(CBMR).im13(MI8.FM2);CBMR.prototype.load=function(handler){if(!CHM.isPersistentWindow()&&(CBMR.isSupported()||this._config.enableCobrowseOnMobile)&&!isWebSDK){var cbMgrRef=this;cbMgrRef.banner=cbMgrRef.initBanner();cbMgrRef.cbcBanner={id:cbMgrRef.banner.getBannerDivId(),show:cbMgrRef.banner.show,hide:cbMgrRef.banner.hide,setSuppressBanner:cbMgrRef.banner.setSuppressBanner};var server;var urlClean="/cbc.js?codeVersion="+encodeURIComponent(v3Lander.codeVersion);var urlObfuscated="/cbc-min.js?codeVersion="+encodeURIComponent(v3Lander.codeVersion);if(site.noJSHosting)server=site.clientStaticUrl;else if(cbMgrRef.getCobrowseSettingValue(cbMgrRef.settingIdConst.getCBCFromTS)){server=urls.vanityURL;urlClean="/tagserver"+urlClean;urlObfuscated="/tagserver"+urlObfuscated}else{server=urls.cobrowseURL;urlClean="/cobrowse"+urlClean;urlObfuscated="/cobrowse"+urlObfuscated}loadScript(server,urlClean,urlObfuscated,(function(){try{if(window["cobrowse"]){window.cobrowse.stop=function(){cbMgrRef.endCobrowse()};window.cobrowse.termsAndConditions=function(){cbMgrRef.banner.termsAndConditions()};window.cobrowse.adjustRestoreDivForCobBanner=function(){cbMgrRef.banner.adjustRestoreDivForCobBannerRef()};window.cobrowse.toggleMenuBoxForCobBanner=function(){cbMgrRef.banner.toggleMenuBoxForCobBannerRef()};window.cobrowse.toggleTermsAndConditionDivForCobBanner=function(){cbMgrRef.banner.toggleTermsAndConditionDivForCobBannerRef()};window.cobrowse.stopCobrowseExternal=function(){cbMgrRef.stopCobrowseExternal()};var cobrowseConfig={cobrowseURL:Inq.urls.cobrowseURL,isSuppressedByPageConfig:isSuppressedByPageConfig,embeddedResourceConfig:cbMgrRef.isEmbeddedResourceForCurrentPageMarker,maskingConfig:cbMgrRef.filterPageRules(cbMgrRef._config.cobrowseMaskingConfig),pageSelectorId:cbMgrRef.getPageSelectorId(),banner:cbMgrRef.cbcBanner,messages:{cobrowseUnexpectedFail:Inq.getLocalizedMessage("cobrowseUnexpectedFail"),cobrowseSuppressed:Inq.getLocalizedMessage("cobrowseSuppressed")},flashPeer:cbMgrRef.getFlashPeer,customerId:Inq.getCustID(),engagementId:cbMgrRef.getEngagementId,isPersistentChatActive:cbMgrRef.isPersistentChatActive,callbacks:cbMgrRef.callbacks,customCSS:cbMgrRef.getCustomCSS()};window.cobrowse.initialize(cobrowseConfig);cbMgrRef.endCobrowseOnChatTimeout();cbMgrRef.initCobrowseAuthorizationTimer()}CHM.setCobrowseFlag(true)}catch(e){log("Cobrowse Initialization failed: "+e)}try{if(handler)handler()}catch(e){log("Cobrowse load on demand failed: "+e)}}),handler)}};CBMR.prototype.init=function(){this.load()};CBMR.prototype.runOnDemand=function(handler){if(typeof window.cobrowse!="undefined")handler();else this.load(handler)};CBMR.isSupported=function(){var _isSupported=false;if("Standard"===getDeviceType())_isSupported=true;return _isSupported};CBMR.prototype.start=function(){};CBMR.prototype.reset=function(){};CBMR.prototype.getData=function(){return{cobrowseSession:FP.isCobEngaged()}};CBMR.prototype.onChatMinimize=function(){if(Inq.CBC&&Inq.CBC.isCobrowseEngaged())Inq.CBC.applyScrollTo()};function AutomatonDT(){}AutomatonDT.prototype.addDTEventFields=function(div,dataToSend){var children=div.getElementsByTagName("input");var selectedCheckboxNames=[];for(var i=0;i<children.length;i++){var elem=children[i];if(elem.type=="checkbox"){dataToSend[elem.name]=""+elem.checked;if(elem.checked)selectedCheckboxNames[selectedCheckboxNames.length]=elem.name}else dataToSend[elem.name]=""+elem.value}return selectedCheckboxNames};AutomatonDT.prototype.getAnswerText=function(button,div){if(inu1(button))return null;if(button.nodeName=="A")return button.innerHTML;if(!inu1(button.text))return button.text;if(!inu1(button.type))if(button.type=="button"){var out="";var children=div.getElementsByTagName("input");for(var i=0;i<children.length;i++){var elem=children[i];if(elem.type=="checkbox")if(elem.checked){if(out.length>0)out+=" ";out+="'"+elem.value+"'"}}if(out.length==0)out="Nothing";return button.name+" ("+out+" selected)"}return null};AutomatonDT.prototype.sendDTEvent=function(eventName,button,data){try{var div=document.getElementById(data.divId);var dataToSend=null;try{dataToSend=data.model}catch(e){log("sendDTEvent can't read data model "+e)}if(inu1(dataToSend))dataToSend={};var dataNode=button.parentNode;var selectedCheckboxNames=this.addDTEventFields(dataNode,dataToSend);if(button)data.selectedLinkName=button.name;data.selectedCheckboxNames=selectedCheckboxNames;data.model=MI8.JSON.stringify(dataToSend);var answerText=this.getAnswerText(button,div);if(answerText)data.answerText=answerText;FP.sendDTEvent(eventName,data)}catch(e){log("sendDTEvent error "+e)}return false};function VAMgr(id,data){this._frameworkModule(id);this.absorb(data);this._varTable={};this._bActionable=true;this.currentVisitorAttributes={};this.banned={};this.hashed={};this.storedValues=new MapVariable("VA",new Array,resources.state);this.allowDynamic=true;this.crc32map={};this.requestQueue=[];this.crc32=function(str){if(!this.crc32map[str]){var table="00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D";var crc=-1;var x=0;var y=0;for(var i=0,iTop=str.length;i<iTop;i++){y=(crc^str.charCodeAt(i))&255;x="0x"+table.substr(y*9,8);crc=crc>>>8^x}crc^=-1;if(crc<0)crc=4294967295+crc+1;this.crc32map[str]="a"+crc.toString(36)}return this.crc32map[str]};this.test=function(visitorAttributes){var result=false;for(var a in visitorAttributes)if(this.currentVisitorAttributes[a]){result=true;if(visitorAttributes[a].values)if(this.currentVisitorAttributes[a].values){for(var valueChecking in visitorAttributes[a].values)if(!this.currentVisitorAttributes[a].values[valueChecking])return false}else result=false}return result};this.checkBanDuration=function(attributeName){var attr;var expiry;if((attr=this.businessVisitorAttributes[attributeName])||(attr=this.programVisitorAttributes[attributeName])){var b=this.banned[this.crc32(attributeName)];if(b){var currentTime=(new Date).getTime();expiry=parseInt(b.d,36)*1e3;if(!inu1(b.d)&&expiry>0&&expiry<currentTime){delete this.banned[this.crc32(attributeName)];attr.banAll=false}else for(var bannedValue in b)if(bannedValue!="d"){expiry=parseInt(b[bannedValue].d,36)*1e3;if(expiry>0&&expiry<currentTime)delete b[bannedValue]}}}};this.add=function(visitorAttributes){for(var a in visitorAttributes){if(typeof visitorAttributes[a]=="function")continue;var attr;var val=null;if((attr=this.businessVisitorAttributes[a])||(attr=this.programVisitorAttributes[a])){this.checkBanDuration(a);if(!attr.banAll)for(var valueAdding in visitorAttributes[a].values){if(typeof visitorAttributes[a].values[valueAdding]=="function")continue;if((attr.values[valueAdding]&&!this.allowDynamic||this.allowDynamic)&&!(this.banned[this.crc32(a)]&&this.banned[this.crc32(a)][this.crc32(valueAdding)])){var valuesNumber=Object.keys(visitorAttributes[a].values).length;if(this.currentVisitorAttributes[a]&&this.currentVisitorAttributes[a].values&&this.currentVisitorAttributes[a].values[valueAdding]&&!(valuesNumber>1&&attr.mutuallyExclusive))continue;if(!this.currentVisitorAttributes[a]||attr.mutuallyExclusive){this.currentVisitorAttributes[a]={};if(attr.writeToCookie)this.hashed[this.crc32(a)]=[];this.currentVisitorAttributes[a].values={}}this.currentVisitorAttributes[a].values[valueAdding]=true;var maxLength=attr.maxLength;if(maxLength&&valueAdding.length>maxLength){var msg="Visitor attribute value is too long! visitorAttribute: "+a+", size: "+valueAdding.length+" ";lmt12(plc1(msg),LOG_LEVELS.WARN)}if(this.allowDynamic)val=valueAdding;else val=this.crc32(valueAdding);if(attr.writeToCookie){var hash=this.crc32(a);if(!this.hashed[hash].contains(val))this.hashed[hash].append([val])}}}}if(!!val)this.logData("visitorAttributeAdded",a,this.getAttributeValues(a,visitorAttributes))}if(isPersistentWindow())openerCall("addVisitorAttributes",[visitorAttributes],false)};this.remove=function(visitorAttributes,fromRemoveAll){var removedAttrs=[];for(var attribute in visitorAttributes){var hashedAttribute=this.crc32(attribute);if(typeof visitorAttributes[attribute]==="function"||this.isMutuallyExclusiveAttribute(attribute))continue;if(this.currentVisitorAttributes[attribute]){var hasNoValues=true;for(var valueRemoving in visitorAttributes[attribute].values){if(typeof visitorAttributes[attribute].values[valueRemoving]==="function")continue;hasNoValues=false;removedAttrs.push(valueRemoving);if(this.currentVisitorAttributes[attribute].values[valueRemoving]){delete this.currentVisitorAttributes[attribute].values[valueRemoving];if(this.hashed[hashedAttribute]){var valueToRemove=this.allowDynamic?valueRemoving:this.crc32(valueRemoving);var index=this.hashed[hashedAttribute].indexOf(valueToRemove);this.hashed[hashedAttribute].remove(index)}if(Object.keys(this.currentVisitorAttributes[attribute].values).length===0){delete this.currentVisitorAttributes[attribute];delete this.hashed[hashedAttribute]}}}if(hasNoValues||fromRemoveAll){removedAttrs=this.getAttributeValues(attribute,this.currentVisitorAttributes);delete this.currentVisitorAttributes[attribute];delete this.hashed[hashedAttribute]}this.logData("visitorAttributeRemoved",attribute,removedAttrs)}}if(isPersistentWindow())openerCall("removeVisitorAttributes",[visitorAttributes,fromRemoveAll],false)};this.removeAll=function(){this.remove(this.currentVisitorAttributes,true)};this.ban=function(visitorAttributes,duration){var sendlog=false;if(duration>0)duration=Math.ceil(((new Date).getTime()+duration)/1e3).toString(36);for(var a in visitorAttributes){if(typeof visitorAttributes[a]=="function"||this.isMutuallyExclusiveAttribute(a))continue;var attr;var crc=this.crc32(a);if((attr=this.businessVisitorAttributes[a])||(attr=this.programVisitorAttributes[a])){var banAll=true;if(visitorAttributes[a].values)for(var valueBanning in visitorAttributes[a].values){if(typeof visitorAttributes[a].values[valueBanning]=="function")continue;banAll=false;if(this.allowDynamic||attr.values[valueBanning]){if(this.currentVisitorAttributes[a]&&this.currentVisitorAttributes[a].values&&this.currentVisitorAttributes[a].values[valueBanning]){delete this.currentVisitorAttributes[a].values[valueBanning];if(this.allowDynamic)delete this.hashed[this.crc32(a)][valueBanning];else delete this.hashed[this.crc32(a)][this.crc32(valueBanning)]}if(!this.banned[crc])this.banned[crc]={};sendlog=true;this.banned[crc][this.crc32(valueBanning)]={d:duration}}}if(banAll){sendlog=true;attr.banAll=true;delete this.currentVisitorAttributes[a];delete this.hashed[this.crc32(a)];this.banned[this.crc32(a)]={d:duration}}}if(sendlog)this.logData("visitorAttributeBanned",a,this.getAttributeValues(a,visitorAttributes))}if(isPersistentWindow())openerCall("banVisitorAttributes",[visitorAttributes,duration],false)};this.unban=function(visitorAttributes){for(var a in visitorAttributes){if(typeof visitorAttributes[a]=="function"||this.isMutuallyExclusiveAttribute(a))continue;var attr;if((attr=this.businessVisitorAttributes[a])||(attr=this.programVisitorAttributes[a])){var unbanAll=true;if(visitorAttributes[a].values&&this.banned[this.crc32(a)])for(var valueBanning in visitorAttributes[a].values){if(typeof visitorAttributes[a].values[valueBanning]=="function")continue;delete this.banned[this.crc32(a)][this.crc32(valueBanning)];unbanAll=false}if(!unbanAll){unbanAll=true;for(var bannedValue in this.banned[this.crc32(a)])if(bannedValue!="d"){unbanAll=false;break}}if(unbanAll){attr.banAll=false;delete this.banned[this.crc32(a)]}}this.logData("visitorAttributeUnbanned",a,this.getAttributeValues(a,visitorAttributes))}if(isPersistentWindow())openerCall("unbanVisitorAttributes",[visitorAttributes],false)};this.initBanned=function(visitorAttributes){for(var a in visitorAttributes){var attr=visitorAttributes[a];var crc=this.crc32(a);if(this.banned[crc]){var banAll=true;for(var tmp in this.banned[crc])if(tmp!="d"){banAll=false;break}if(banAll)attr.banAll=true}}};this.initHashed=function(visitorAttributes){for(var a in visitorAttributes){var attr=visitorAttributes[a];var crc=this.crc32(a);if(this.hashed[crc]){this.currentVisitorAttributes[a]={};this.currentVisitorAttributes[a].values={};if(this.hashed[crc].length)if(this.allowDynamic)for(var i=0;i<this.hashed[crc].length;i++){valueAdding=this.hashed[crc][i];this.currentVisitorAttributes[a].values[valueAdding]=true}else for(var valueAdding in attr.values)if(this.hashed[crc][this.crc32(valueAdding)])this.currentVisitorAttributes[a].values[valueAdding]=true}}};this.init=function(){};this.getAttributeValues=function(a,source){var values=[];if(source==null)source=this.currentVisitorAttributes;if(source[a])for(var value in source[a].values)values[values.length]=value;return values};this.getExternalCustomerIdVisitorAttributesAsString=function(){var visitorAttrs=this.businessVisitorAttributes;var result="";for(var attr in visitorAttrs)if(visitorAttrs[attr].externalCustomerID)result+=result?","+encodeURIComponent(attr):encodeURIComponent(attr);return result};this.getCopyAsMap=function(){var copy={currentVisitorAttributes:this.currentVisitorAttributes,keys:function(){var keys=[];for(var a in this.currentVisitorAttributes)keys[keys.length]=a;return keys},values:function(){var values=[];for(var a in this.currentVisitorAttributes)values[values.length]=this.get(a);return values},each:function(func){if(typeof func=="function")for(var a in this.currentVisitorAttributes)func(a,this.get(a),this)},clear:function(){},set:function(){},get:function(key){var values=[];var cVatt=this.currentVisitorAttributes[key];if(!!cVatt&&!!cVatt.values)for(var value in cVatt.values)values[values.length]=value;return values},unset:function(){}};return copy};this.start=function(){};this.reset=function(){};this.load=function(){if(this.storedValues.z0()==null)this.storedValues.init();else{this.banned=this.storedValues.z0().get("ban");if(this.banned){this.initBanned(this.businessVisitorAttributes);this.initBanned(this.programVisitorAttributes)}else this.banned={};this.hashed=this.storedValues.z0().get("hash");if(this.hashed){this.initHashed(this.businessVisitorAttributes);this.initHashed(this.programVisitorAttributes)}else this.hashed={}}};this.save=function(){this.storedValues.set("hash",this.hashed);this.storedValues.set("ban",this.banned)};this.agrtyer=function(){this.load()};this.getPersistentId=function(){return this.getID()};this.getCopyAsArray=function(urlEncodingRequired){var tmp=new Array;for(var attribute in this.currentVisitorAttributes){var values=this.getAttributeValues(attribute);var keyValues=new Array(values.length);var attr=urlEncodingRequired?encodeURIComponent(attribute):attribute;for(var i=0;i<values.length;i++){var val=urlEncodingRequired?encodeURIComponent(values[i]):values[i];keyValues[i]=attr+","+val}tmp[tmp.length]=keyValues.length>0?keyValues.join(";"):attr+","}return tmp};this.logData=function(event,attribute,values){var encodedValues=new Array(values.length);if(values.length>0)for(var i=0;i<values.length;i++)encodedValues[i]=encodeURIComponent(attribute)+","+encodeURIComponent(values[i]);else encodedValues.push(encodeURIComponent(attribute)+",");var data={_domain:"customer",evt:event,siteID:Inq.siteID,incAssignmentID:asi4(),sessionID:getSessionID(),customerID:Inq.getCustID(),chatID:CHM.getLastChatID(),atts:encodedValues.join(";"),currentAtts:this.getCopyAsArray(true).join(";")};this.putRequestInQueue(urls.logDataURL,data)};this.testBanned=function(visitorAttribute){var result=false;for(var a in visitorAttribute){this.checkBanDuration(a);var attr=visitorAttribute[a];var crc=this.crc32(a);if(this.banned[crc]){var banAll=true;for(var tmp in this.banned[crc])if(tmp!="d"){banAll=false;break}if(banAll)result=true;else for(var valueBanning in attr.values)if(this.banned[crc][this.crc32(valueBanning)]){result=true;break}}}return result};this.toString=function(){return!!this.getCopyAsArray()?this.getCopyAsArray().toString():""};this.isMutuallyExclusiveAttribute=function(attr){return attr=="mutuallyExclusive"};this.onRemoteCallback=function(){this.requestQueue.shift();if(this.requestQueue.length>0){var request=this.requestQueue[0];this.callRemote(request.url,request.data)}else this.save()};this.putRequestInQueue=function(url,data){this.requestQueue.push({url:url,data:data});if(this.requestQueue.length==1)this.callRemote(url,data)}}MI8.prepare(VAMgr).im13(MI8.Persistable).im13(MI8.FM2).im13(MI8.XJA3).im13(MI8.Observable).im13(MI8.Persistable).im13(MI8.RC54);function WatchDogMgr(){this.clients=[];this._className="WatchDogMgr"}WatchDogMgr.prototype.registerClient=function(clientID,checkInterval,isAliveCallback,resetStateCallback){this.unregisterClient(clientID);var client=new Object;client.id=clientID;client.checkInterval=checkInterval;client.isAlive=isAliveCallback;client.resetState=resetStateCallback;var me=this;client.timer=window.setInterval((function(){me.onProcessClient(client)}),checkInterval);this.clients.push(client)};WatchDogMgr.prototype.unregisterClient=function(clientID){for(var i=0;i<this.clients.length;i++)if(this.clients[i].id==clientID){window.clearInterval(this.clients[i].timer);this.clients.splice(i,1);return}};WatchDogMgr.prototype.onProcessClient=function(client){try{if(client.isAlive)if(!client.isAlive()&&client.resetState){Inq.FlashPeer.logInfo("Client "+client.id+" is not alive. Try to reset state");client.resetState()}}catch(e){Inq.FlashPeer.logError("Error WatchDogMgr.onProcessClient "+e)}};WatchDogMgr.WDM=null;WatchDogMgr.getInstance=function(){if(WatchDogMgr.WDM==null)WatchDogMgr.WDM=new WatchDogMgr;return WatchDogMgr.WDM};function DME2(){this.KEY_F5=116;this.initialized=false;this.target=null}DME2.prototype.init=function(){if(isPersistentWindow())return;attachListener(doc,"keydown",this._keydownHandler,false);if(isFF())attachListener(doc,"focus",this._focusinMonitor,true);else attachListener(doc,"focusin",this._focusinMonitor,false);if(isFF())attachListener(doc,"blur",this._focusoutMonitor,true);else attachListener(doc,"focusout",this._focusoutMonitor,false);if(isSafari())attachListener(doc,"mousedown",this._focusinMonitor,false);this.initialized=true};DME2.prototype.reset=function(){if(this.initialized){detachListener(doc,"keydown",this._keydownHandler,false);detachListener(doc,"focus",this._focusinMonitor,true);detachListener(doc,"focusin",this._focusinMonitor,false);detachListener(doc,"blur",this._focusoutMonitor,true);detachListener(doc,"focusout",this._focusoutMonitor,false);detachListener(doc,"mousedown",this._focusinMonitor,false);this.initialized=false}};DME2.prototype.addTarget=function(e){e=e||window.event;var target=this.filterTarget(e);if(target){this.target=target;this.saveDestinationURL(target.href)}};DME2.prototype.removeTarget=function(e){e=e||window.event;var target=this.filterTarget(e);if(target&&this.target==target){this.target=null;this.clearDestinationURL()}};DME2.prototype.filterTarget=function(e){var target=e.target||e.srcElement;if(target.tagName&&"A"==target.tagName.toUpperCase()&&target.href&&target.getAttribute("target")!="_blank")return target;else return null};DME2.prototype._keydownHandler=function(e){if(DM)DM.keydownHandler.apply(DM,arguments)};DME2.prototype.keydownHandler=function(e){e=e||window.event;if(this.KEY_F5==e.keyCode&&!isSafari())this.clearDestinationURL()};DME2.prototype._focusinMonitor=function(e){if(DM)DM.focusinMonitor.apply(DM,arguments)};DME2.prototype.focusinMonitor=function(e){this.addTarget(e)};DME2.prototype._focusoutMonitor=function(e){if(DM)DM.focusoutMonitor.apply(DM,arguments)};DME2.prototype.focusoutMonitor=function(e){this.removeTarget(e)};DME2.prototype.saveDestinationURL=function(url){var chat=CHM.getChat();if(chat&&!CHM.isPersistentChat()&&chat.isEngaged())CHM.setCABeacon(CHM.getChat().BEACON_DATA,{lastDestinationUrl:url})};DME2.prototype.clearDestinationURL=function(){this.saveDestinationURL("")};function EtlDataBuilder(){this.eventMapper={automaton:{started:this.buildStartedEvent,assisted:this.buildAssistedEvent,contentSentToCustomer:this.buildCommonAutomatonEvent,customerResponded:this.buildCommonAutomatonEvent,ended:this.buildCommonAutomatonEvent,transition:this.buildCommonAutomatonEvent},engagement:{requested:this.buildEngagementRequested}}}EtlDataBuilder.prototype.build=function(event,rule){if(this.eventMapper[event._domain]&&this.eventMapper[event._domain][event.evt])return this.eventMapper[event._domain][event.evt].call(this,event,rule);else return this.buildUnknownEvent(event,rule)};EtlDataBuilder.prototype.buildStartedEvent=function(event,rule){var chatData={siteID:Inq.getSiteID(),businessUnitID:CHM.getBusinessUnitID(event,rule),agentGroupID:CHM.getAgentGroupID(event,false),agentID:CHM.getAgentID(),availableAgentAttributes:CHM.getChatOrLastChatAgentAttributesString(),customerID:Inq.getCustID(),conversationID:CONVM.getConversationID(),initialCustomerID:CONVM.getInitialCustomerID(),incAssignmentID:asi4(),pageID:CHM.getLaunchPageId(),sessionID:getSessionID(),visitorAttributes:VAM.getCopyAsArray(true).join(";"),businessRuleID:CHM.getChat()?CHM.getChat().getRuleId():event.rule?event.rule.id:rule.getID(),brAttributes:firstExisting("ra1t",CHM.getChat(),event&&event.rule,rule)||"",chatID:CHM.getChatID(),deviceType:getDeviceType(),operatingSystemType:getOSType(),browserType:getClientBrowserType(),browserVersion:cbtv1(),preAssigned:isPreassignedChat()};if(SVYM.isAsyncSurveyCalled){chatData.siteID=SVYM.asyncSurveyData.siteID;chatData.businessUnitID=SVYM.asyncSurveyData.businessUnitID;chatData.agentGroupID=SVYM.asyncSurveyData.agentGroupID;chatData.agentID=SVYM.asyncSurveyData.agentID;chatData.availableAgentAttributes="";chatData.customerID=SVYM.asyncSurveyData.customerID;chatData.conversationID=SVYM.asyncSurveyData.conversationID;chatData.initialCustomerID=SVYM.asyncSurveyData.customerID;chatData.chatID=SVYM.asyncSurveyData.engagementID}return MI8.mixAbsorber(MI8.unmixMutatable(MI8.mixMutatable().set("_domain",event._domain).set("evt",event.evt).set("siteID",chatData.siteID).set("businessUnitID",chatData.businessUnitID).set("agentGroupID",chatData.agentGroupID).set("agentID",chatData.agentID).set("availableAgentAttributes",chatData.availableAgentAttributes).set("customerID",chatData.customerID).set("conversationID",chatData.conversationID).set("initialCustomerID",chatData.initialCustomerID).set("incAssignmentID",chatData.incAssignmentID).set("pageID",chatData.pageID).set("sessionID",chatData.sessionID).set("visitorAttributes",chatData.visitorAttributes).set("businessRuleID",chatData.businessRuleID).set("brAttributes",chatData.brAttributes).set("chatID",chatData.chatID).set("deviceType",chatData.deviceType).set("operatingSystemType",chatData.operatingSystemType).set("browserType",chatData.browserType).set("browserVersion",chatData.browserVersion).set("preAssigned",chatData.preAssigned))).absorb(MI8.unmixMutatable(MI8.mixMutatable(event).remove("page").remove("data")))};EtlDataBuilder.prototype.buildAssistedEvent=function(event,rule){return MI8.mixAbsorber(MI8.unmixMutatable(MI8.mixMutatable().set("_domain",event._domain).set("evt",event.evt).set("siteID",Inq.getSiteID()).set("businessUnitID",CHM.getBusinessUnitID(event,rule)).set("agentGroupID",CHM.getAgentGroupID(event,false)).set("agentID",CHM.getAgentID()).set("availableAgentAttributes",CHM.getChatOrLastChatAgentAttributesString()).set("customerID",Inq.getCustID()).set("conversationID",CONVM.getConversationID()).set("initialCustomerID",CONVM.getInitialCustomerID()).set("incAssignmentID",asi4()).set("pageID",LDM.getPageID()).set("sessionID",getSessionID()).set("visitorAttributes",VAM.getCopyAsArray(true).join(";")).set("businessRuleID",CHM.getChat()?CHM.getChat().getRuleId():event.rule?event.rule.id:rule.getID()).set("brAttributes",firstExisting("ra1t",CHM.getChat(),event&&event.rule,rule)||"").set("chatID",CHM.getChatID()).set("deviceType",getDeviceType()).set("operatingSystemType",getOSType()).set("browserType",getClientBrowserType()).set("browserVersion",cbtv1()).set("preAssigned",isPreassignedChat()))).absorb(MI8.unmixMutatable(MI8.mixMutatable(event).remove("page").remove("data")))};EtlDataBuilder.prototype.buildCommonAutomatonEvent=function(event,rule){var chatData={siteID:Inq.getSiteID(),customerID:Inq.getCustID(),conversationID:CONVM.getConversationID(),initialCustomerID:CONVM.getInitialCustomerID(),incAssignmentID:asi4(),pageID:LDM.getPageID(),sessionID:getSessionID(),chatID:CHM.getChatID()==="0"?CHM.getLastChatID():CHM.getChatID(),preAssigned:isPreassignedChat()};if(SVYM.isAsyncSurveyCalled){chatData.siteID=SVYM.asyncSurveyData.siteID;chatData.customerID=SVYM.asyncSurveyData.customerID;chatData.conversationID=SVYM.asyncSurveyData.conversationID;chatData.initialCustomerID=SVYM.asyncSurveyData.customerID;chatData.chatID=SVYM.asyncSurveyData.engagementID}return MI8.mixAbsorber(MI8.unmixMutatable(MI8.mixMutatable().set("_domain",event._domain).set("evt",event.evt).set("automatonType",event.type).set("siteID",chatData.siteID).set("customerID",chatData.customerID).set("conversationID",chatData.conversationID).set("initialCustomerID",chatData.initialCustomerID).set("incAssignmentID",chatData.incAssignmentID).set("pageID",chatData.pageID).set("sessionID",chatData.sessionID).set("chatID",chatData.chatID).set("preAssigned",chatData.preAssigned))).absorb(MI8.unmixMutatable(MI8.mixMutatable(event).remove("page").remove("data").remove("acifVersion").remove("automatonAttributes").remove("type").remove("automatonType")))};EtlDataBuilder.prototype.buildEngagementRequested=function(event,rule){return MI8.mixAbsorber(MI8.unmixMutatable(MI8.mixMutatable().set("_domain",event._domain).set("evt",event.evt).set("siteID",Inq.getSiteID()).set("businessUnitID",CHM.getBusinessUnitID(event,rule)).set("agentGroupID",CHM.getAgentGroupID(event,false)).set("agentID",CHM.getAgentID()).set("availableAgentAttributes",CHM.getChatOrLastChatAgentAttributesString()).set("customerID",Inq.getCustID()).set("conversationID",CONVM.getConversationID()).set("initialCustomerID",CONVM.getInitialCustomerID()).set("incAssignmentID",asi4()).set("pageID",CHM.getLaunchPageId()).set("sessionID",getSessionID()).set("visitorAttributes",VAM.getCopyAsArray(true).join(";")).set("businessRuleID",CHM.getChat()?CHM.getChat().getRuleId():event.rule?event.rule.id:rule.getID()).set("brAttributes",firstExisting("ra1t",CHM.getChat(),event&&event.rule,rule)||"").set("chatID",CHM.getChatID()).set("deviceType",getDeviceType()).set("operatingSystemType",getOSType()).set("browserType",getClientBrowserType()).set("browserVersion",cbtv1()).set("qt",CHM.q6t()).setIfNotEmpty("conversationChannel",CONVM.getConversationChannel()))).absorb(MI8.unmixMutatable(MI8.mixMutatable(event).remove("page").remove("data")))};EtlDataBuilder.prototype.buildUnknownEvent=function(event,rule){return MI8.mixAbsorber(MI8.unmixMutatable(MI8.mixMutatable().set("_domain",event._domain).set("evt",event.evt).set("siteID",Inq.getSiteID()).set("businessUnitID",CHM.getBusinessUnitID(event,rule)).set("agentGroupID",CHM.getAgentGroupID(event,false)).set("agentID",CHM.getAgentID()).set("availableAgentAttributes",CHM.getChatOrLastChatAgentAttributesString()).set("customerID",Inq.getCustID()).set("conversationID",CONVM.getConversationID()).set("initialCustomerID",CONVM.getInitialCustomerID()).set("incAssignmentID",asi4()).set("pageID",LDM.getPageID()).set("sessionID",getSessionID()).set("visitorAttributes",VAM.getCopyAsArray(true).join(";")).set("businessRuleID",CHM.getChat()?CHM.getChat().getRuleId():event.rule?event.rule.id:rule.getID()).set("brAttributes",firstExisting("ra1t",CHM.getChat(),event&&event.rule,rule)||"").set("chatID",CHM.getChatID()).set("deviceType",getDeviceType()).set("operatingSystemType",getOSType()).set("browserType",getClientBrowserType()).set("browserVersion",cbtv1()))).absorb(MI8.unmixMutatable(MI8.mixMutatable(event).remove("page").remove("data")))};function PSC1(){this.initialized=false;this.pageIsHidden=false;this.beaconURL=null;this.beaconRequestData=null}PSC1.prototype.init=function(){log("PSC initialized.");if(this.initialized)return;this.initialized=true;this.g2t(function(){if(!this.pageIsHidden&&CHM.isInlineChatInProgress()){this.pageIsHidden=true;CHM.closeChatMonitor();this.sendBeaconToTS();if(this.beaconURL&&this.beaconRequestData)sendBeacon(this.beaconURL,this.beaconRequestData)}}.bind(this));attachListener(window,"pageshow",this.cipri,false)};PSC1.prototype.g2t=function(handler,useCapture){attachListener(window,"unload",handler,useCapture);attachListener(window,"beforeunload",handler,useCapture);attachListener(window,"pagehide",handler,useCapture)};PSC1.prototype.cipri=function(event){if(event.persisted){log("reinitChat() was called from PSC1");reinitChat()}};PSC1.prototype.sendBeaconToTS=function(){var logText=plc1("Page was reloaded. "+CHM.getChat());var url=urls.loggingURL+"?line="+encodeURIComponent(logText);sendBeacon(url)};PSC1.prototype.setBeaconData=function(url,action,beaconRequestData){if(action==="DEACTIVATE")this.resetBeaconData();else{this.beaconURL=url;this.beaconRequestData=beaconRequestData}};PSC1.prototype.resetBeaconData=function(){this.beaconURL=null;this.beaconRequestData=null};function TSD4(){this._observable();this.evtIdx=0;this.lastBusinessUnitId=null;this.lastAgentGroupId=null;this.initialCustomerID=null;this.conversationTokenID=null;this.conversationObjectID=null;this.getConversationID=function(){return CHM.getChatInterfaceData().cid};this.getInitialCustomerID=function(){return this.initialCustomerID||CHM.getChatInterfaceData().iccid}}MI8.prepare(TSD4).im13(MI8.Observable).im13(MI8.XJA3);TSD4.prototype.agrtyer=function(){this.createConversationVars();this.conversationTokenID=PM.getVar("conversationTokenID")?PM.getVar("conversationTokenID").getValueOrDefault():null;this.conversationObjectID=PM.getVar("conversationObjectID")?PM.getVar("conversationObjectID").getValueOrDefault():null};TSD4.prototype.createConversationVars=function(){if(!PM.getVar("conversationTokenID")&&CHM.isAsyncUnauthUser()){var conversationTokenIDVar=new VER34("conversationTokenID",null,resources["conversationTokens"],"cti");PM.addVar(conversationTokenIDVar)}if(!PM.getVar("conversationObjectID")&&CHM.isAsyncUnauthUser()){var conversationObjectIDVar=new VER34("conversationObjectID",null,resources["conversationTokens"],"coi");PM.addVar(conversationObjectIDVar)}};TSD4.prototype.getLastAgentGroupID=function(){return this.lastAgentGroupId};TSD4.prototype.getLastBusinessUnitID=function(){return this.lastBusinessUnitId};TSD4.prototype.getConversationTokenID=function(){return this.conversationTokenID};TSD4.prototype.getConversationObjectID=function(){return this.conversationObjectID};TSD4.prototype.setConversationIDs=function(conversationTokenID,conversationObjectID){if((this.conversationTokenID!==conversationTokenID||this.conversationObjectID!==conversationObjectID)&&PM.getVar("conversationTokenID")&&PM.getVar("conversationObjectID")){PM.getVar("conversationTokenID").z3(conversationTokenID);PM.getVar("conversationObjectID").z3(conversationObjectID)}this.conversationTokenID=conversationTokenID;this.conversationObjectID=conversationObjectID};TSD4.prototype.appendConversationIDsTo=function(targetObject){if(targetObject!==null&&typeof targetObject=="object")if(this.conversationTokenID&&this.conversationObjectID){targetObject.conversationTokenID=this.conversationTokenID;targetObject.conversationObjectID=this.conversationObjectID}};TSD4.prototype.setLastBusinessUnitAndAgentGroup=function(lastBu,lastAg){this.lastBusinessUnitId=lastBu;this.lastAgentGroupId=lastAg};TSD4.prototype.reset=function(){this.lastAgentGroupId=null;this.lastBusinessUnitId=null;this.initialCustomerID=null};TSD4.prototype.isListener=function(l){return!!(l&&(l.onAgentAssigned||l.onConversationResolved||l.onCustomerAuthenticated||l.onVerifyTokenSuccess||l.onVerifyTokenError))};TSD4.prototype.onAgentAssigned=function(evt){if(evt.businessUnitID&&CHM.isAsyncChat())this.setLastBusinessUnitAndAgentGroup(evt.businessUnitID,evt.agentGroupID);this.deleteEngageChatParams()};TSD4.prototype.deleteEngageChatParams=function(){var ciData=CHM.getChatInterfaceData();if(ciData[ENGAGE_CHAT_PARAMS]){delete ciData[ENGAGE_CHAT_PARAMS];CHM.setChatInterfaceData(ciData);return true}return false};TSD4.prototype.setInitialCustomerID=function(customerID){this.initialCustomerID=customerID};TSD4.prototype.fireConversationResolvedEvent=function(){var evt=MI8.mixAbsorber({id:++this.evtIdx,evtType:this.EVENTS.CONVERSATION_RESOLVED,timestamp:new Date});evt.absorb({chatID:CHM.getChatID(),customerID:Inq.getCustID(),conversationID:this.getConversationID()});this._fireEvt((function(aListener,aEvent){if(typeof aListener.onConversationResolved=="function")aListener.onConversationResolved(aEvent)}),evt)};TSD4.prototype.fireVerifyTokenSuccessEvent=function(event){var evt=MI8.mixAbsorber({id:++this.evtIdx,evtType:this.EVENTS.TOKEN_SUCCESS,timestamp:new Date,siteID:getSiteID(),customerID:Inq.getCustID()});evt.absorb(event);this._fireEvt((function(aListener,aEvent){if(typeof aListener.onVerifyTokenSuccess=="function")aListener.onVerifyTokenSuccess(aEvent)}),evt)};TSD4.prototype.fireVerifyTokenErrorEvent=function(event){var evt=MI8.mixAbsorber({id:++this.evtIdx,evtType:this.EVENTS.TOKEN_ERROR,timestamp:new Date,siteID:getSiteID(),customerID:Inq.getCustID()});evt.absorb(event);this._fireEvt((function(aListener,aEvent){if(typeof aListener.onVerifyTokenError=="function")aListener.onVerifyTokenError(aEvent)}),evt)};TSD4.prototype.fireCustomerAuthenticated=function(){var evt=MI8.mixAbsorber({id:++this.evtIdx,evtType:this.EVENTS.CUSTOMER_AUTHENTICATED,timestamp:new Date});evt.absorb({chatID:CHM.getChatID(),customerID:Inq.getCustID(),conversationID:this.getConversationID()});this._fireEvt((function(l,evt){if(typeof l.onCustomerAuthenticated=="function")l.onCustomerAuthenticated(evt)}),evt)};TSD4.prototype.getConversationChannel=function(){if(CHM.isAsyncChat())return"WEB";else return};TSD4.prototype.resolveConversation=function(){if(this.conversationTokenID&&this.conversationObjectID){var data={conversationTokenID:this.conversationTokenID,conversationObjectID:this.conversationObjectID};var resolveConversation=CHM.getChatRouterURL()+urls.resolveConversation;var id=generateRequestId("resolveConversation");ROM.sendToChatrouter(resolveConversation,data,id);this.fireConversationResolvedEvent()}};TSD4.prototype.EVENTS={CONVERSATION_RESOLVED:"CONVERSATION_RESOLVED",CUSTOMER_AUTHENTICATED:"CUSTOMER_AUTHENTICATED",TOKEN_SUCCESS:"TOKEN_SUCCESS",TOKEN_ERROR:"TOKEN_ERROR"};var urls={addActiveWindowIdURL:"/chatrouter/chat/addActiveWindowId",agentsAvailabilityCheckURL:secureProtocol(site.vanityDomainName+"/tagserver/launch/agentAvailability"),apiServiceURL:secureProtocol(site.apiServiceURL+"/surveyemailalert"),authUserURL:secureProtocol(site.vanityDomainName+"/tagserver/tracking/authenticatedUser"),baseURL:secureProtocol(site.vanityDomainName+"/tagserver"),cdnURL:secureProtocol(site.cdnURL),chatRouterVanityDomain:secureProtocol(site.chatRouterVanityDomain),cobrowseURL:secureProtocol(site.cobrowseURL),conversationTranscriptURL:secureProtocol(site.vanityDomainName+"/tagserver/conversation"),exitChatURL:"/chatrouter/chat/exitChat",getCustIDURL:secureProtocol(site.vanityDomainName+"/tagserver/init/getCustomerID"),getExistingChatDataForReconnectOrNewChatId:secureProtocol(site.vanityDomainName+"/tagserver/launch/getExistingChatDataForReconnectOrNewChatId"),getNewChatIdUrl:secureProtocol(site.vanityDomainName+"/tagserver/launch/getNewChatId"),getSiteTzOffsetURL:secureProtocol(site.vanityDomainName+"/tagserver/init/getSiteTzOffset"),initFrameworkURL:secureProtocol(site.vanityDomainName+"/tagserver/init/initFramework"),isPersistentActive:"/chatrouter/chat/isPersistentActive",loggingURL:secureProtocol(site.vanityDomainName+"/tagserver/logging/logline"),logDataURL:secureProtocol(site.vanityDomainName+"/tagserver/logging/logdata"),logDataEvtListURL:secureProtocol(site.vanityDomainName+"/tagserver/logging/logDataEvtList"),logCiEvent:secureProtocol(site.vanityDomainName+"/tagserver/servlet/v1/dataCollection/logCiEvent"),logJsURL:secureProtocol(site.clusterEnvironment+"tslogging.touchcommerce.com/tagserver/logging/log4js"),logJsPostURL:secureProtocol(site.vanityDomainName+"/tagserver/logging/log4js"),mediaBaseURL:secureProtocol(site.mediaServer+"/media"),mediaLaunchCiURL:secureProtocol(site.mediaServer+"/media/launch/ci"),mediaRootURL:secureProtocol(site.mediaServer),mediaSiteURL:secureProtocol(site.mediaServer+"/media/sites/"+site.siteID),nativePostChatSurveyURL:secureProtocol(site.vanityDomainName+"/tagserver/survey/submitNativePostChatSurvey"),one2ManyVanityDomain:secureProtocol(one2ManyChatrouterDomain),pageUnloadURL:"/chatrouter/chat/pageUnload",persistentComplete:"/chatrouter/chat/persistentComplete",resolveConversation:"/chatrouter/resolveConversation",resolvePageURL:secureProtocol(site.vanityDomainName+"/tagserver/launch/resolvePage"),resolvePageWSURL:secureProtocol(site.resolvePageWSDomain+"/launch/resolvePage"),requestC2CImageURL:secureProtocol(site.vanityDomainName+"/tagserver/launch/requestC2CImage"),requestChatLaunchURL:secureProtocol(site.vanityDomainName+"/tagserver/launch/requestChatLaunch"),requestCustomerStatus:secureProtocol(site.vanityDomainName+"/tagserver/conversation/customerStatus"),siteHostedFileDomains:site.hostedFileDomains||"",siteHostedFileURL:productionFilter(site.psHosturlList||"",site.productionFilter),skinURL:secureProtocol(site.vanityDomainName+"/chatskins/sites/"+site.siteID+"/flash/"),vanityURL:secureProtocol(site.vanityDomainName),verifyTokenURL:secureProtocol(site.vanityDomainName+"/tagserver/conversation/verifyToken"),xFormsDomain:secureProtocol(site.xformsVanityDomain)};function getCurrentSetting(){function getCurrentSettingById(id){if(id)for(var i=0;i<site.cobrowseSettings.length;i++)if(site.cobrowseSettings[i].id==id)return site.cobrowseSettings[i];return null}function getCurrentSettingByBusinessUnitId(id){var settingId=site.businessUnitDictionary[id];if(settingId)return getCurrentSettingById(settingId);return null}if(site.cobrowseSettings.length==1)return site.cobrowseSettings[0];if(site.agentGroupsActive){var agentGroupID=CHM.getAgentGroupID();var agentGroupSetting=getCurrentSettingById(agentGroupID);if(agentGroupSetting)return agentGroupSetting}else{var businessUnitID=CHM.getBusinessUnitID({},true);var businessUnitSetting=getCurrentSettingByBusinessUnitId(businessUnitID);if(businessUnitSetting)return businessUnitSetting}return getCurrentSettingById(siteID)}function getLocalizedMessage(key,ignoreUndefinedText){var setting=getCurrentSetting();if(setting){var messages=setting.messages;if(messages){var result=messages[key];if(result)return result}}return ignoreUndefinedText?null:"undefined message for the key ["+key+"]"}function getEnableHighlight(){return getLocalizedMessage("enableCobrowseHighlight")!=="false"}function getCobrowseEnableMinimizeRestore(){var setting=getCurrentSetting();if(setting){var messages=setting.messages;if(messages){var result=messages["cobrowseEnableMinimizeRestore"];if(result==="true")return true}}return false}if(typeof RENDERINGCONTEXT!=="undefined")RENDERINGCONTEXT={Date:Date};var businessConstants=site.businessConstants();var constants=MI8.mixAbsorber();if(jsSDKEnabled)constants.absorb(JSSDK_RENDERER.RenderAbstractConstants(jsonAPIData["program-data"]["constants"]));else constants.absorb(programRulesConfig("constants"));constants.absorb(businessConstants);if(typeof RENDERINGCONTEXT!=="undefined")RENDERINGCONTEXT={Rule:Rule,BusinessRule:BusinessRule,LDM:LDM,PM:PM,FM:FM,BRM:BRM,VAM:VAM,C2CM:C2CM,CHM:CHM,SVYM:SVYM,ROM:ROM,CM:CM,FP:FP,EVM:EVM,win:win,log:log,MI8:MI8,e9:e9,DFV:DFV,getDFV:getDFV,gc7:gc7,processReceivedExternalDataThrows:processReceivedExternalDataThrows,isServiceBlocked:isServiceBlocked,d8t:d8t,s7:s7,safeResult:safeResult,SL1:SL1,getDefaultValueIfNull:getDefaultValueIfNull,URI:URI,doc:doc,rand:rand,inu1:inu1,secureProtocol:secureProtocol,cf21:cf21,pd1d:pd1d,let12:let12,getSiteID:getSiteID,asi4:asi4,getSessionID:getSessionID,lmt12:lmt12,urls:MI8.clonize(urls).clone(),WebResource:WebResource,JSResource:JSResource,CCD:CCD,publishAPI:publishAPI,getClientBrowserType:getClientBrowserType,XFormsLoader:XFormsLoader,setPersistCustID:setPersistCustID,setAuthUser:setAuthUser,setUserObject:setUserObject,Date:Date,LOG_LEVELS:LOG_LEVELS,resources:resources,cbtv1:cbtv1,getOSType:getOSType,EXCBTT:EXCBTT,firstExisting:firstExisting,isC2PActive:isC2PActive,getBlockedServicesList:getBlockedServicesList,getDeviceType:getDeviceType,getDefaultLanguage:getDefaultLanguage,compareVersions:compareVersions,CRMT:CRMT,Schedule:Schedule,getConversationActive:getConversationActive,LocalStorageResource:LocalStorageResource,isSchMet:isSchMet};function o1p(){var opener=null;if(isPersistentWindow())try{if(isWebSDK)opener=window.opener&&FrameBridge.o1p()?FrameBridge.o1p():null;else opener=window.parent.opener&&window.parent.opener.inqFrame?window.parent.opener.inqFrame:window.opener?window.opener:null}catch(e){log("Error getting opener: "+e.message)}return opener}function openerCall(func,args,async){var opener=o1p();if(!inu1(opener)&&opener.Inq&&opener.Inq.FlashPeer){if(!opener.Inq.FlashPeer.callFromPersistent("isPersistentWindowRegisteredInOpener"))opener.Inq.FlashPeer.callFromPersistent("registerPersistentWindowInOpener",[parent],false);return opener.Inq.FlashPeer.callFromPersistent(func,args,async)}}var frameworkCanRun=site.frameworkCanRun;function isSameOrigin(){try{if(isPersistentWindow())if(isWebSDK)if(window.opener.Inq)return true;else return false;else if(window.parent.opener.Inq)return true;else return false}catch(err){return false}}function getID(){return this._id}function getCustID(){if(inu1(initData.custID))return"";else return initData.custID}function setCustID(customerID,save){if(!inu1(customerID)){logInfoToTagServer("Changing current customerID: "+initData.custID+" to newCustomerID:"+customerID);initData.custID=customerID;if(save)Inq.save()}}function getCustGeoData(){return initData["geoData"]||{}}var userObject=null;function getUserObject(){return userObject}function setUserObject(object){userObject=object}function getPersistCustID(){return persistentCustomerID}function getAuthUser(){return authenticatedUser}var custIdRegenerationInProgress=false;var needToLaunchChat=false;function setAuthUser(persistCustID,simpleObject){authenticatedUser={};if(simpleObject)authenticatedUser=simpleObject;if(persistCustID)authenticatedUser.persistentCustomerID=persistCustID;var engagementId=CHM.getChatID();if(engagementId!=="0"){CHM.disableAsyncUnauthUser();ROM.sendAuthenticatedUser(authenticatedUser)}}function setPersistCustID(persistCustID,isSecureWithCustToken,allowEmptyValues){var persistDataVar=new VER34("pcID",{},resources["session"]);secureWithCustToken=!!isSecureWithCustToken;CHM.setSecureWithCustToken(secureWithCustToken);if(!allowEmptyValues)for(var key in persistCustID)if(persistCustID.hasOwnProperty(key)&&(inu1(persistCustID[key])||persistCustID[key]===""))delete persistCustID[key];if(!secureWithCustToken){var pcID=persistDataVar.z0();if(!objectEquals(pcID,persistCustID)){CONVM.reset();if(!CHM.getChat()||CHM.getChat().isAsyncChat())renewCustomerId()}persistentCustomerID=persistCustID;Inq.save()}else{if(!objectEquals(persistentCustomerID,persistCustID))CONVM.reset();if(!isEmptyObject(persistDataVar.z0()))persistDataVar.z3({});persistentCustomerID=persistCustID}}function renewCustomerId(){var customerRegenerationEnabled=PM.getVar("enableCustomerIDRegenerationFeature");if(customerRegenerationEnabled&&customerRegenerationEnabled.z0()===true){if(CHM.getChat()&&CHM.getChat().isAsyncChat()){log("Closing chat window because persistentCustomerID was changed and customer ID will be re-generated");if(CHM.getChat().isVisible()){CHM.closeChat();FP.closeChatInterface();window["Application"]=null}else CHM.needToCloseOnChatShown=true}ROM.post(urls.getCustIDURL,{siteID:Inq.getSiteID()},null,null,setCustomerId);custIdRegenerationInProgress=true}}var customerIdRenewRetriesCount=0;function setCustomerId(obj){var data=typeof obj==="object"&&obj.data?obj.data:null;if(typeof data==="string")try{data=JSON.parse(data)}catch(e){let12("Cannot parse response from getCustomerID, response"+data,true);data=null}if(data&&!inu1(data.custID)){setCustID(data.custID,true);if(isInitialized())BRM.fireOnResetSession();else BRM.fireResetSessionOnStart=true;custIdRegenerationInProgress=false;if(needToLaunchChat){CHM.launchDelayedChat();needToLaunchChat=false}customerIdRenewRetriesCount=0}else{++customerIdRenewRetriesCount;if(customerIdRenewRetriesCount<3)setTimeout((function(){ROM.post(urls.getCustIDURL,{siteID:Inq.getSiteID()},null,null,setCustomerId)}),1e3);else{blockServices(["ALL"],0);let12("Customer regeneration failed! Services will blocked for session!",true);customerIdRenewRetriesCount=0;C2CM.reset()}}}function getCustIP(){return initData.custIP}var siteID=site.siteID;function getSiteID(){return siteID}function getChatSkinFormat(){if(site.hasOwnProperty("chatSkinFormat"))return site.chatSkinFormat;else return"mxml"}var fileUploadSize=site.fileTransferSize;var fileDeleteSetting=site.fileDeleteSetting;function getDefaultLanguage(){return site.language}function getCiObfuscationLevel(){return parseInt(site.ciObfuscation)}function isJsDebugActive(){return site.JSDebugMode}function isJsLoggingActive(){return!JSLoggingDisabled}function isLogToServerDisabled(){return disableLogToServer}function getRootDomainsList(){return site.rootDomainsList}function getRefreshIframeDelayIncrement(){return site.refreshIframeDelayIncrement}function getMaxRefreshIframeDelay(){return site.maxRefreshIframeDelay}function isHideJsonTranscriptMessages(){return!!site.hideJsonTranscriptMessages}function isAliasesNoEvalToggleEnable(){return site.aliasesToggle}function isPolishNotationEnabled(){return site.usePolishNotation}function getDefaultAgentGroupId(){return site.defaultAgentGroup}function getClearOutdatedCookies(){return site.clearOutdatedCookies}function useNativeJson(){return site.useNativeJson}function isCacheSolutionEnabled(){return site.cacheSolutionEnabled}function isPostChatSurveyLogsEnabled(){return site.postChatSurveyLogsEnabled}function getFlagSendDataToTSWithoutIframe(){return site.sendDataToTSWithoutIframe}function getSessionID(){var sesVar=PM.getVar("sesID");return sesVar?sesVar.z0():""}function asi4(){var incAssignmentID=PM.getVar("incID");return incAssignmentID?incAssignmentID.z0():""}function getIncGroupID(){var inqGroupID=PM.getVar("incGroup");return inqGroupID?inqGroupID.z0():""}var getDefaultBusinessUnitID=site.getDefaultBusinessUnitID;var deviceType="Standard";function setDeviceType(newDeviceType){deviceType=newDeviceType}function getDeviceType(){return deviceType}function d8t(type){return type==getDeviceType()}function setDeviceDetails(newDeviceDetails){deviceDetails=newDeviceDetails}function getDeviceDetails(){return deviceDetails}function getClientTimeLag(){return initData.clntLag}var siteTzID=site.timezoneID;function getSiteTZOffset(){return initData["siteTzOffset"]}function isTZRequestRequired(){if((!isEmptyObject(businessSchedules)||!isEmptyObject(programSchedules))&&inu1(initData["siteTzOffset"]))return true;return false}function isSchMet(scheduleId){if(schedules[scheduleId])schedules[scheduleId].tzOffset=initData.scheduleTZs[schedules[scheduleId].timezone];return schedules[scheduleId]&&schedules[scheduleId].isScheduleMet(new Date,getClientTimeLag(),getSiteTZOffset())}function processCustomerApiRegistry(){Inq.overridePageID=!!win.inqSiteID?win.inqSiteID:-1;var registry;if(isWebSDK)registry=window.InqRegistry;else registry=window.parent.InqRegistry;if(registry){var listeners=[];if(!inu1(registry.chatListeners))listeners.append(registry.chatListeners);if(!inu1(registry.saleListeners))listeners.append(registry.saleListeners);if(!inu1(registry.incrementalityListeners))listeners.append(registry.incrementalityListeners);if(!inu1(registry.listeners))listeners.append(registry.listeners);for(var x=0;x<listeners.length;x++)listeners[x].custApi=true;EVM.addListeners(listeners);if(!inu1(registry.disableChat)&&registry.disableChat==true)tryue(CHM.CHAT_TYPES.POPUP,0);if(!inu1(registry.disableC2C)&&registry.disableC2C==true)tryue(CHM.CHAT_TYPES.C2C,0)}}function saveDeviceDetails(details){if(details!=null){var ddVar=PM.getVar("deviceDetailsMap");if(ddVar!=null){ddVar.clear();for(var key in details)if(details.hasOwnProperty(key))ddVar.set(key,details[key])}}}function initMgrs(mgrList){PM.addVars(programVars);PM.addVars(businessVars);saveDeviceDetails(deviceDetails);var table=BRM.getRuleVarTable();for(var ruleID in table)if(!!table[ruleID])PM.addVars(table[ruleID]);for(var m in mgrList)try{if(mgrList[m].init)mgrList[m].init()}catch(e){log(e)}}function startMgrs(mgrList){for(var m in mgrList)try{if(mgrList[m].start)mgrList[m].start()}catch(e){log(e)}CHM.fireFrameworkReadyEvent({loadingTime:Date.now()-startedTime})}function deferredStartMgrs(){if(gc7(DEFERRED_START_OF_MANAGERS_KEY)&&isPersistentChatLaunchingLimited())startMgrs(mgrList)}function start(){if(!this.isFrameworkReady())return;if(this.started)return;this.started=true;EVM.addObservables(mgrList);EVM.addObservables([EC,CONVM,EH]);EVM.addListeners(mgrList);EVM.addListeners([EC,CONVM]);EVM.addCustomEvents(programCustomEvents);EVM.addCustomEvents(businessCustomEvents);PM.fireDataReady();processCustomerApiRegistry();initMgrs(mgrList);EVM.addListeners(BRM.getRules());if(typeof site.setAuthenticatedUser==="function")site.setAuthenticatedUser();if(typeof site.setPersistentCustomerId==="function")site.setPersistentCustomerId();if(typeof site.setUserObject==="function")site.setUserObject();if(!isEmptyObject(getPersistCustID()))ROM.hasActiveConversations();else if(!gc7(DEFERRED_START_OF_MANAGERS_KEY)||!isPersistentChatLaunchingLimited())startMgrs(mgrList)}function isCEAPIPostChatSurveyMode(){return!isWebSDK&&!inu1(parent.CEAPI_POST_CHAT_SURVEY_DATA)}function agrtyer(){if(this.dataReady)return;this.dataReady=true;this.load()}function load(){var vitalVar=new VER34(this.getID(),{},resources["vital"]);var vitalData=vitalVar.z0();if(vitalData)initData.absorb(vitalData);var persistDataVar=new VER34("pcID",{},resources["session"]);var persistCustID=persistDataVar.z0();if(persistCustID&&!isEmptyObject(persistCustID))setPersistCustID(persistCustID);var siteTzOffsetVar=new VER34("siteTzOffset",null,resources["session"],"tzOf");initData["siteTzOffset"]=siteTzOffsetVar.z0()}function save(){var vitalVar=new VER34(this.getID(),{},resources["vital"]);var persistDataVar=new VER34("pcID",{},resources["session"]);var vitalData={custID:this.getCustID()};if(getClientTimeLag())vitalData.clntLag=getClientTimeLag();if(!secureWithCustToken){var persistCustID=getPersistCustID();if(persistCustID&&!isEmptyObject(persistCustID))persistDataVar.z3(persistCustID)}vitalVar.z3(vitalData);if(!inu1(initData["siteTzOffset"])){var siteTzOffsetVar=new VER34("siteTzOffset",0,resources["session"],"tzOf");siteTzOffsetVar.z3(initData["siteTzOffset"])}}function isDataReady(){return this.dataReady}var initData={scheduleTZs:{}};MI8.prepare(initData).im13(MI8.XJA3);function setFrameworkData(data){initData.absorb(data);if(data.serverTime){initData.clntLag=data.serverTime-(new Date).getTime();if(Math.abs(initData.clntLag)<1e3)initData.clntLag=void 0}Inq.save()}function getDFV(dfvID){return dfvs[dfvID]}function getInitialDFV(){var result=null;for(name in dfvs){var dfv=dfvs[name];if(dfv.initial)result=dfv}return result}function isThirdPartyCookiesEnabled(){return this.thirdPartyCookiesEnabled}function isFrameworkReady(){var isReady=true;var id=this.getCustID();if(inu1(id)||id==""||id=="0")isReady=false;return isReady}function tryue(serviceType,duration){switch(serviceType){case CHM.CHAT_TYPES.POPUP:case CHM.CHAT_TYPES.POPUP_CALL:CHM.tryue(serviceType,duration);break;case CHM.CHAT_TYPES.C2C:case CHM.CHAT_TYPES.C2CALL:case CHM.CHAT_TYPES.C2WEBRTC:C2CM.tryue(serviceType,duration);break;case"ALL":CHM.tryue(CHM.CHAT_TYPES.POPUP,duration);CHM.tryue(CHM.CHAT_TYPES.POPUP_CALL,duration);C2CM.tryue(CHM.CHAT_TYPES.C2C,duration);C2CM.tryue(CHM.CHAT_TYPES.C2CALL,duration);C2CM.tryue(CHM.CHAT_TYPES.C2WEBRTC,duration);break;default:break}}function blockServices(services,duration){for(var service in services)tryue(services[service],duration)}var rule=null;function gc7(constantID,rule){if(rule)return rule.gc7(constantID);return constants[constantID]}function unblockServices(services){for(var service in services)unblockService(services[service])}function unblockService(serviceType){switch(serviceType){case CHM.CHAT_TYPES.POPUP:case CHM.CHAT_TYPES.POPUP_CALL:CHM.unblockService(serviceType);break;case CHM.CHAT_TYPES.C2C:case CHM.CHAT_TYPES.C2CALL:case CHM.CHAT_TYPES.C2WEBRTC:C2CM.unblockService(serviceType);break;case"ALL":CHM.unblockService(CHM.CHAT_TYPES.POPUP);CHM.unblockService(CHM.CHAT_TYPES.POPUP_CALL);C2CM.unblockService(CHM.CHAT_TYPES.C2C);C2CM.unblockService(CHM.CHAT_TYPES.C2CALL);C2CM.unblockService(CHM.CHAT_TYPES.C2WEBRTC);break;default:break}}function doBusinessRuleActionList(actionId,rule,evt){var action=BusinessRuleActionLists[actionId];if(!inu1(action))action(rule,evt);else log("Can't find BusinessRule Action List "+actionId)}function doRuleActionList(actionId,rule,evt){var action=RuleActionLists[actionId];if(!inu1(action))action(rule,evt);else log("Can't find Rule Action List "+actionId)}function isServiceBlocked(serviceType){switch(serviceType){case CHM.CHAT_TYPES.POPUP:case CHM.CHAT_TYPES.POPUP_CALL:return CHM.isBlocked(serviceType);case CHM.CHAT_TYPES.C2C:case CHM.CHAT_TYPES.C2CALL:case CHM.CHAT_TYPES.C2WEBRTC:return C2CM.isBlocked(serviceType);case"ANY":return CHM.isAnyBlocked()||C2CM.isAnyBlocked();default:return false}}function getBlockedServicesList(){var result=[];if(C2CM.isBlocked(CHM.CHAT_TYPES.C2CALL))result.push(CHM.CHAT_TYPES.C2CALL);if(C2CM.isBlocked(CHM.CHAT_TYPES.C2C))result.push(CHM.CHAT_TYPES.C2C);if(CHM.isBlocked(CHM.CHAT_TYPES.POPUP))result.push(CHM.CHAT_TYPES.POPUP);if(CHM.isBlocked(CHM.CHAT_TYPES.POPUP_CALL))result.push(CHM.CHAT_TYPES.POPUP_CALL);if(C2CM.isBlocked(CHM.CHAT_TYPES.C2WEBRTC))result.push(CHM.CHAT_TYPES.C2WEBRTC);return result}function createFloatingDiv(_id,_x,_y,_w,_h){try{var obj=document.createElement("div");obj.style.position="absolute";obj.style.width=_w?_w:0;obj.style.height=_h?_h:0;obj.style.left=_x?_x+"px":0;obj.style.top=_y?_y+"px":0;obj.style.zIndex=99;obj.style.display="none";obj.style.padding=0;obj.style.margin=0;obj.id=_id;document.getElementsByTagName("body")[0].appendChild(obj)}catch(E){this.debug("Could not create div element.")}return document.getElementById(_id)}function createHiddenIFrame(_id,_x,_y,_w,_h,src){try{var obj=document.createElement("iframe");obj.style.position="absolute";obj.style.width=_w?_w:0;obj.style.height=_h?_h:0;obj.style.left=_x?_x+"px":0;obj.style.top=_y?_y+"px":0;obj.style.zIndex=99;obj.style.display="none";obj.style.overflow="hidden";obj.style.padding=0;obj.style.margin=0;obj.id=_id;obj.name=_id;if(src)obj.src=src;return obj}catch(E){this.debug("Could not create iFrame element.")}return null}function wasSaleAction(){try{var par=PM.getVar("saleState",null).z0();var con=gc7("SALE_STATE_CONVERTED",null);return par==con}catch(e){}return false}function executeCustomCommand(params){if(!inu1(params))try{params=params.replace(/\({/g,"{").replace(/}\)/g,"}");var inParams=MI8.JSON.parse(params);var cmdType=inParams.cmdType;var cmdParam=inParams.cmdParam;switch(cmdType){case"block-service":tryue(cmdParam.serviceType,cmdParam.period);break;case"client_function":var functionName=inParams.functionName;if(isWebSDK)FrameBridge.postFunctionByName(functionName,[cmdParam]);else if(parent[functionName])parent[functionName].apply(parent,[cmdParam]);else if(functionName.indexOf(".")!=-1){var t=functionName.split("."),k;for(var i=0;i<t.length;i++)if(typeof k!="undefined"){if(typeof k[t[i]]=="function")k[t[i]].apply(parent,[cmdParam]);else if(typeof k[t[i]]=="object")k=k[t[i]]}else if(typeof parent[t[i]]=="function")parent[t[i]].apply(parent,[cmdParam]);else if(typeof parent[t[i]]=="object")k=parent[t[i]]}break;default:log("Unknown command "+cmdType+", parameters : "+cmdParam)}}catch(ex){log("Error execute command "+params+", "+ex)}}function initXD(){CM.init();CM.requestCookie((function(context){Inq.IFrameProxyCallback(context.data)}))}function parseCookieData(data){var retval={};var cookieRes=[];for(var res in resources)try{if(typeof resources[res]["getName"]==="function")cookieRes.push(resources[res].getName())}catch(err01){}for(var name in data){var cval=data[name];if(!!cval){var cname=name.replace(/_\d+$/,"");if(cname=="JSESSIONID"||cname==="inqCA"||cname==="inqLT")retval[cname]=cval;else if(cookieRes.contains(cname,(function(oa,ob){return oa===ob})))try{retval[cname]=MI8.JSON.parse(cval)}catch(e){var errMsg="Error[parseCookieData] while parsing cookie: Cookie name="+cname+",value="+cval+cf21(e);let12(errMsg)}}}return retval}var _3pcSupported=true;function onRemoteCallback(initDataFromTS){var _xd=this.xd&&CM.cookies[COOKIE_PC_NAME]!="2"&&!(CM47.xdPsHelper.enabled||CM47.chatSessionHelper.isEnabled);if(!!initDataFromTS["devicetype"])setDeviceType(initDataFromTS["devicetype"]);if(!!initDataFromTS["deviceDetails"])setDeviceDetails(initDataFromTS["deviceDetails"]);var inqID=this.getID();var inqDataForLogs=initDataFromTS[inqID]||{};if(!frameworkCanRun(getDeviceType(),_3pcSupported,true,_xd)){if(document.cookie.indexOf("_inqNR=0")<0){lmt12(plc1("Framework load aborted due to business rules settings: deviceType="+getDeviceType()+";3pc="+_3pcSupported+";userAgent="+navigator.userAgent,null,inqDataForLogs["custID"],inqDataForLogs["custIP"],inqDataForLogs["siteID"]),LOG_LEVELS.INFO);document.cookie="_inqNR=0"}return}if(initDataFromTS[inqID])setFrameworkData(initDataFromTS[inqID]);else if(!inu1(initDataFromTS["siteTzOffset"])){log("Received site timezone offset from server: "+initDataFromTS["siteTzOffset"]+"ms");setFrameworkData(initDataFromTS)}else{lmt12(plc1("Framework load aborted due to incorrect initData: deviceType="+getDeviceType()+";3pc="+_3pcSupported+";userAgent="+navigator.userAgent+";initData="+initDataFromTS),LOG_LEVELS.WARN);return}initData["geoData"]=initDataFromTS["geoData"];PM.fireDataReady();this.start()}function IFrameProxyCallback(data){if((data==="no-cookie"||data==="")&&inu1(CM.isPersistentCookiesEnabled)){CM.isPersistentCookiesEnabled=false;if(xdAutoSelect&&isCacheSolutionEnabled()&&isFF()&&CM47.xdPsHelper.is1pcEnabled())if(CM47.xdPsHelper.populateDomains2Check()){log("Starting Cache Persistent solution");CM47.chatSessionHelper.isEnabled=true;CM47.chatSessionHelper.read1SPC(CM47.xdPsHelper.hostFileURLUse)}else log("No Sibling domain to use Cache Solution");else if(xdAutoSelect&&CM47.xdPsHelper.is1pcEnabled()&&(isChrome()||isEdge()||isIE()))CM47.xdPsHelper.requestSavedXdCookies();else log("3PC blocked and not able to offer a chat")}else{CM.isPersistentCookiesEnabled=true;data=parseCookieData(CM._getCookies(data));CM.setXDCookies(data);this.agrtyer();if(resources["vital"])log("Sync Sale Status: "+resources["vital"].read("_ss"));var inqID=this.getID();var inqData={};inqData[inqID]={siteID:this.getSiteID(),custID:this.getCustID(),scheduleTZs:initData["scheduleTZs"]};if(isTZRequestRequired())inqData[inqID].tzID=siteTzID;var strData=MI8.JSON.stringify(inqData);this.callRemote(urls.initFrameworkURL,{rid:this.getID(),d:strData})}}function IFrameTSCallback(data){CM.isPersistentCookiesEnabled=true;var currentCookiesObject=parseCookieData(CM._getCookies(CM47.chatSessionHelper.cookie1pcXdData));var serverData=CM47.chatSessionHelper.parseDataFromServer(data);if(inu1(serverData)){var currentChat=currentCookiesObject["inqSession"]?currentCookiesObject["inqSession"]["chat"]:{};logInfoToTagServer("For Cache Persistent Solution chat data wasn't received from server."+" Cookies will be used. Current chat id in cookies "+(currentChat?currentChat.id:"is absent"));if(!this.getCustID()&&!inu1(CM47.chatSessionHelper.customerId)){setParamToObject(currentCookiesObject,"inqVital.INQ.custID",CM47.chatSessionHelper.customerId);setCustID(CM47.chatSessionHelper.customerId,false)}CM.setXDCookies(currentCookiesObject);this.agrtyer()}else{logInfoToTagServer("For Cache Persistent Solution chat data was received from server."+" Server data will be merged with cookies for chat restoring."+" Chat id "+serverData.engagementID+" was received from server");data=CM47.chatSessionHelper.buildCookieFromAPI(currentCookiesObject,serverData);CM.setXDCookies(data);this.agrtyer();setCustID(CM47.chatSessionHelper.customerId,false)}if(resources["vital"])log("Sync Sale Status: "+resources["vital"].read("_ss"));var inqID=this.getID();var inqData={};inqData[inqID]={siteID:this.getSiteID(),custID:this.getCustID(),scheduleTZs:initData["scheduleTZs"]};if(isTZRequestRequired())inqData[inqID].tzID=siteTzID;var strData=MI8.JSON.stringify(inqData);this.callRemote(urls.initFrameworkURL,{rid:this.getID(),d:strData})}function init(){if(this.initialized||!isValidBaseFunctionality())return;var inqData={};var inqID=this.getID();PM.addListener(this);exposeCustomerApi();DM.init();PSC.init();if(xdAutoSelect){CM.init();CM47.firstRequestCookie()}else if(this.xd)initXD();else if(CM47.isSessionCookiesAllowed()){this.load();inqData[inqID]={siteID:this.getSiteID(),custID:this.getCustID(),scheduleTZs:initData["scheduleTZs"]};if(isTZRequestRequired())inqData[inqID].tzID=siteTzID;var strData=MI8.JSON.stringify(inqData);this.callRemote(urls.initFrameworkURL,{rid:this.getID(),d:strData})}}function pd1d(data){if(!data)return data;if(typeOf(data)=="array")try{if(data.length>0){var elem=data[0];if(elem.key){var out=Array.prepareMapToSerialize(data);return MI8.JSON.stringify(out)}}return MI8.JSON.stringify(data)}catch(e){let12(cf21(e))}return data}function main(){if(site.sameOriginReferrerFilterRegex())try{var elm=getParentElByIDTFacade("doesNotExist")}catch(e){return}MI8.prepare(this).im13(MI8.Observable).im13(MI8.FM2);this.im13(MI8.Persistable).im13(MI8.XJA3).im13(MI8.RC54);this._frameworkModule("INQ");this._observable();if(getIOSNativeSDKInstance())getIOSNativeSDKInstance().postMessage(JSON.stringify({reqType:"chatprogress"}));else this.init()}var c2cPageElementIDs=site.c2cPageElementIDs();C2C.setC2CPageElementIDs(c2cPageElementIDs);var PM=X4334rtf.getInstance(site.persistenceMode!="non-XD");var CM=PM.getCookieMgr();var SM=new StorageMgr("SM",CM);var C2CM=new X43("C2CM",site.c2cMgrData());var EVM=new EMT5("EVM");var ROM=new RM91("ROM",{});var LDM=new LE12("LDM",v3Lander.landingData);var EDB=new EtlDataBuilder;var PSC=new PSC1;var AL;if(!isWebSDK)AL=new af4;var BusinessRuleActionLists=site.businessRuleActionLists();var RuleActionLists=site.ruleActionLists();var functionRulesObj;if(jsSDKEnabled)functionRulesObj=JSSDK_RENDERER.RenderJsFunctions(jsonAPIData["program-data"]["js-functions"]);else functionRulesObj=programRulesConfig("js-functions");var businessFuncRulesObj=site.JSBusinessFunctions();if(businessFuncRulesObj){var prop,hasOwnProp={}.hasOwnProperty;for(prop in businessFuncRulesObj)if(hasOwnProp.call(businessFuncRulesObj,prop))functionRulesObj[prop]=businessFuncRulesObj[prop]}var FM=new FcnMgr(functionRulesObj);if(typeof RENDERINGCONTEXT!=="undefined"){RENDERINGCONTEXT.SM=SM;RENDERINGCONTEXT.CM=CM}var dfvs=site.xmlData.dfvs();var resources=site.resources();resources[PERSISTENT_COOKIE_ALLOWED]=new CCD(PERSISTENT_COOKIE_ALLOWED,COOKIE_PC_NAME,site.cookiePath,24*3600*1e3,site.rootDomain,0,CM);resources["state"]=new CCD("state","inqState",site.cookiePath,365*24*3600*1e3,site.rootDomain,0,CM);resources["vital"]=new CCD("vital","inqVital",site.cookiePath,365*24*3600*1e3,site.rootDomain,0,CM);resources["session"]=new CCD("session","inqSession",site.cookiePath,365*24*3600*1e3,site.rootDomain,0,CM);resources["bses"]=new CCD("bses","inqBSes",site.cookiePath,void 0,site.rootDomain,0,CM);resources["surveyShown"]=new CCD("surveyShown","tcSrv",site.cookiePath,365*24*3600*1e3,site.rootDomain,0,CM);resources["conversationTokens"]=new CCD("conversationTokens","inqCT",site.cookiePath,void 0,site.rootDomain,0,CM);var schedules=MI8.mixAbsorber();var businessSchedules=site.xmlData.businessSchedules();var programSchedules;if(jsSDKEnabled)programSchedules=JSSDK_RENDERER.RenderSchedules(jsonAPIData["program-data"]["schedules"]);else programSchedules=programRulesConfig("schedules");schedules.absorb(programSchedules);schedules.absorb(businessSchedules);var k6ji=(0,_Base64_ts__WEBPACK_IMPORTED_MODULE_0__.D)();var LoadM=new LR45;var CommunicationMgr=new NR7;var MM=new MM12(site.mediaMgrData());var programRulesData;if(jsSDKEnabled)programRulesData=JSSDK_RENDERER.RenderRules(jsonAPIData["program-data"]["rules"]);else programRulesData=programRulesConfig("rules");if(jsSDKEnabled)var initRulesData=rulesEngineDataStr;else eval("var initRulesData = "+rulesEngineDataStr.toString());var reDat=initRulesData(programRulesData);var SVYM=new SM19(site.surveySpecs());if(isCEAPIPostChatSurveyMode())reDat.rules.push(SVYM.createCEAPIPostChatSurveyRule(401));for(var i=0;i<loadedMbuRuleDataFuns.length;i++){if(jsSDKEnabled)var initMbuRules=loadedMbuRuleDataFuns[i];else eval("var initMbuRules = "+loadedMbuRuleDataFuns[i].toString());reDat.rules=reDat.rules.append(initMbuRules().rules)}if(loadedMbuRuleDataFuns.length>0)reDat.rules.sort((function(a,b){if(inu1(a.ruleIndex)||inu1(b.ruleIndex))return 0;if(a.ruleIndex>b.ruleIndex)return 1;if(a.ruleIndex<b.ruleIndex)return-1;return 0}));var BRM=new G3R3("BRM",reDat,site.disableMutationObservation);var CHM=GR34.getInstance({thankYouShown:site.displayTYImage,thankYouEnabled:site.displayTYImage,displayTYImage:site.displayTYImage,CHAT_TYPES:{C2C:"C2C",C2CALL:"C2CALL",C2VIDEO:"C2VIDEO",C2WEBRTC:"C2WEBRTC",POPUP:"POPUP",POPUP_CALL:"POPUP_CALL",PERSISTENT:"PERSISTENT",MONITOR:"MONITOR",CONVERSIVE:"CONVERSIVE",EXTERNAL_CHAT:"EXTERNAL_CHAT",EXTERNAL_POPUP_CHAT:"EXTERNAL_POPUP_CHAT"}});if(shouldDetectAdblock())checkAdBlockersActive();if(v3Lander.appInsightsEnabled)initAzureAppInsights();var CONVM=new TSD4;var as17={};var FP=new FlashPeer("FP",{});var CBM=null;if(site.enableCobrowse==true&&!isCEAPIPostChatSurveyMode()){var CMBConfigs=site.coBrowseConfigs();CBM=new CBMR("CBM",{cobrowseMaskingConfig:CMBConfigs.cobrowseMaskingConfig,isEmbeddedResource:CMBConfigs.isEmbeddedResource,enableCobrowseOnMobile:site.enableCobrowseOnMobile})}else site.enableCobrowse=false;var WDM=WatchDogMgr.getInstance();var EC={};if(site.EC){MI8.prepare(site.EC).im13(MI8.Observable).im13(MI8.RC54);EC=site.EC;EC._observable()}var EH={};if(site.EH){MI8.prepare(site.EH).im13(MI8.Observable);EH=site.EH;EH._observable()}var DM=new DME2;var DT=new AutomatonDT;if(typeof RENDERINGCONTEXT!=="undefined"){RENDERINGCONTEXT.C2CM=C2CM;RENDERINGCONTEXT.PM=PM;RENDERINGCONTEXT.SM=SM;RENDERINGCONTEXT.EVM=EVM;RENDERINGCONTEXT.FM=FM;RENDERINGCONTEXT.ROM=ROM;RENDERINGCONTEXT.SVYM=SVYM;RENDERINGCONTEXT.BRM=BRM;RENDERINGCONTEXT.CHM=CHM;RENDERINGCONTEXT.LDM=LDM;RENDERINGCONTEXT.FP=FP;RENDERINGCONTEXT.CONVM=CONVM;RENDERINGCONTEXT.resources=resources;RENDERINGCONTEXT.getCustGeoData=getCustGeoData}var programVarsSource;if(jsSDKEnabled)programVarsSource=JSSDK_RENDERER.RenderVariables(jsonAPIData["program-data"]["vars"]);else programVarsSource=programRulesConfig("vars");var programVars=VER34.getInstancesFromData(programVarsSource);var businessVars=VER34.getInstancesFromData(site.businessVars());var businessCustomEvents=site.businessCustomEvents();var programCustomEvents;if(jsSDKEnabled)programCustomEvents=JSSDK_RENDERER.RenderCustomEvents(jsonAPIData["program-data"]["custom-events"]);else programCustomEvents=programRulesConfig("custom-events");var VAM=new VAMgr("VAM",site.vamAttributes);var mgrList=[PM,CM,SM,ROM,BRM,LDM,C2CM,CHM,VAM,MM,SVYM];if(CBM)mgrList.push(CBM);if(!("forceFPCookie"in window))window.forceFPCookie=false;if(typeof RENDERINGCONTEXT!=="undefined")RENDERINGCONTEXT.VAM=VAM;var rechatInterval=parseInt(site.rechatinterval);var v3framesrc=v3Lander.hostedFileURL||site.v3framesrc;var v3C2cPersistent=site.c2cToPersistent;var xd=site.persistenceMode!="non-XD";var xdAutoSelect=site.persistenceMode=="Self-Detection";var initialized=false;var started=false;var multiHost=site.multiHost;function getVar(varname,ruleID,optDflt){return PM.getVar(varname,BRM.rb41(ruleID)).z0()}function getHostedFileUrl(){return window.location.protocol+"//"+window.location.hostname+(window.location.port==""?"":":"+window.location.port)+v3framesrc}function isC2cPersistent(){return v3C2cPersistent}async function injectScriptAsync(server,urlClean,urlObfuscated){return new Promise(((resolve,reject)=>{const script=document.createElement("script");script.src=secureProtocol(server)+(site.JSDebugMode?urlClean:urlObfuscated);script.async=true;script.onload=resolve;script.onerror=reject;document.head.appendChild(script)}))}function loadScript(server,urlClean,urlObfuscated,initFunction,parameters,errorFunction){var srctag=document.createElement("SC"+"RIPT");srctag.src=secureProtocol(server)+(site.JSDebugMode?urlClean:urlObfuscated);srctag.type="text/javascript";srctag.charset="utf-8";srctag.language="javascript";srctag._parameters=parameters;srctag._function=initFunction;srctag._errFunction=errorFunction;srctag.onload=function(){this.onreadystatechange=null;this.onload=null;this._function(this._parameters)};srctag.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded"){this.onreadystatechange=null;this.onload=null;this._function(this._parameters)}};srctag.onerror=function(msg){this.onreadystatechange=null;this.onload=null;if(typeof this._errFunction=="function")this._errFunction(msg)};document.body.appendChild(srctag)}function shouldDetectAdblock(){if(isWebSDK)return false;return site.detectAdblock}function getThemeName(){return CHM.chat.chatSpec.chatTheme.fn.replace(/\.(mxml|zip)$/,"")}function getSkinRootUrl(){return site.noJSHosting?site.clientStaticUrl+"/":urls.skinURL}function checkAdBlockersActive(){if(typeof top.blockingDetector!=="undefined"||typeof top.BlockingDetector!=="undefined")CHM.setAdblockOn();else{var filePath="/js/ads-blocking-detector";loadScript(urls.baseURL,filePath+".js",filePath+".min.js",(function(){try{top.blockingDetector.onDetected((function(){CHM.setAdblockOn()}));top.blockingDetector.onNotDetected((function(){CHM.setAdblockOff()}));top.blockingDetector.check(true)}catch(e){log("ERROR: "+e.message);top.blockingDetector=void 0;CHM.setAdblockOn()}}),"",(function(){CHM.setAdblockOn()}))}}function initAzureAppInsights(){const appInsightsConnectionString="InstrumentationKey=ad548406-50ec-4970-99ef-bd704b65c4d2;IngestionEndpoint=https://westus2-2.in.applicationinsights.azure.com/;LiveEndpoint=https://westus2.livediagnostics.monitor.azure.com/";(0,_appInsights__WEBPACK_IMPORTED_MODULE_1__.Z)(appInsightsConnectionString)}function isInitialized(){return isInqInitialized}function updateDataFromOpener(){openerData.page=openerCall("getPage")}function clearDataFromOpener(){openerData={}}function prepareBaseBodyForAsyncChatDataRequest(){var data={siteID:getSiteID(),customerID:Inq.getCustID()};if(getAuthUser())data.authenticatedUser=JSON.stringify(getAuthUser());if(getPersistCustID())data.persistentCustomerID=JSON.stringify(getPersistCustID());if(getUserObject())data.user_object=JSON.stringify(getUserObject());return data}function evaluateLegacySettings(string,contextWindow){if(typeof site.evaluateLegacySettings==="function")return site.evaluateLegacySettings(string,contextWindow);else if(site.evaluateLegacySettings===null){var errorMessage="evaluateLegacySettings in tcFramework "+"can't be used, because it was disabled in settings";var error=new Error(errorMessage);var errorWithStackTrace=errorMessage;if(error.stack)errorWithStackTrace+=error.stack;let12(errorWithStackTrace,true);throw error}else if(!jsSDKEnabled&&evaluateLegacySettingsWarnNeeded){evaluateLegacySettingsWarnNeeded=false;lwt12("Incompatible version of tcFramework and site default,"+" probably this happened because of cache.");contextWindow=contextWindow||window;return contextWindow.eval(string)}}function isResolvePageServiceEnabled(){return site.useResolvePageWSDomain}return{xd:xd,siteID:siteID,main:main,agrtyer:agrtyer,onRemoteCallback:onRemoteCallback,isFrameworkReady:isFrameworkReady,isDataReady:isDataReady,init:init,initXD:initXD,IFrameProxyCallback:IFrameProxyCallback,IFrameTSCallback:IFrameTSCallback,isThirdPartyCookiesEnabled:isThirdPartyCookiesEnabled,start:start,save:save,load:load,getID:getID,getCustID:getCustID,getCustIP:getCustIP,getSiteID:getSiteID,tryue:tryue,unblockService:unblockService,blockServices:blockServices,unblockServices:unblockServices,isServiceBlocked:isServiceBlocked,Drag:isWebSDK?null:new Drag,Resize:isWebSDK?null:new Resize,Rule:Rule,log:log,getLocalizedMessage:getLocalizedMessage,v3C2cPersistent:v3C2cPersistent,v3framesrc:v3framesrc,multiHost:multiHost,rechatInterval:rechatInterval,isSameOrigin:isSameOrigin,doBusinessRuleActionList:doBusinessRuleActionList,doRuleActionList:doRuleActionList,createHiddenIFrame:createHiddenIFrame,createFloatingDiv:createFloatingDiv,wasSaleAction:wasSaleAction,JSON:MI8.JSON,getEnableHighlight:getEnableHighlight,getCobrowseEnableMinimizeRestore:getCobrowseEnableMinimizeRestore,isCEAPIPostChatSurveyMode:isCEAPIPostChatSurveyMode,getFullBrowserInfo:getFullBrowserInfo,urls:MI8.clonize(urls).clone(),EVM:EVM,CM:CM,LoadM:LoadM,PM:PM,ROM:ROM,BRM:BRM,LDM:LDM,C2CM:C2CM,C2C:C2C,CHM:CHM,GR34:CHM,CBM:CBM,SVYM:SVYM,reinitChat:reinitChat,launchChatNow:launchChatNow,launchChatNowByPageID:launchChatNowByPageID,setChatSuppressedForSession:setChatSuppressedForSession,FlashPeer:FP,WDM:WDM,DT:DT,EC:EC,EH:EH,get custIP(){return getCustIP()},get custID(){return getCustID()}}}(v3Lander.inqSiteDataFun,v3Lander.inqRulesEngineFun,v3Lander.loadedMbuRuleDataFuns,v3Lander.programRulesConfig);Inq.main()}();