var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); var initESW = function(gslbBaseURL, options) { var queueConfig = { cs: '5733h000000Qd6t', ol: '5733h000000Qd73', test: '5736S0000002gPl', ns: '5736S000000RsRr' }; var config = { defaultAccountId: '0013h00000FvRclAAF', cs: { init1: 'https://web.archive.org./web/20221216224747/https://candid.my.salesforce.com', init2: 'https://web.archive.org./web/20221216224747/https://help.candid.org/', initId: '00D3h000001QSAr', snapIn: 'Customer_Success_Chat', baseLiveAgentContentURL: 'https://web.archive.org./web/20221216224747/https://c.la4-c1-ia4.salesforceliveagent.com/content', deploymentId: '5723h000000QODx', buttonId: queueConfig.cs, baseLiveAgentUrl: 'https://web.archive.org./web/20221216224747/https://d.la4-c1-ia4.salesforceliveagent.com/chat', eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I0S00000000ApUAI_173102c4c42', isOfflineSupportEnabled: false, preform: true, webToCaseUrl: 'https://web.archive.org./web/20221216224747/https://support.candid.org/case.html?mode=popup&type=fdo', webToCaseSettings: { height: 680, width: 1000 } }, cs_noform: { init1: 'https://web.archive.org./web/20221216224747/https://candid.my.salesforce.com', init2: 'https://web.archive.org./web/20221216224747/https://help.candid.org/', initId: '00D3h000001QSAr', snapIn: 'Customer_Success_No_Preform_Support_Chat', baseLiveAgentContentURL: 'https://web.archive.org./web/20221216224747/https://c.la4-c1-ia4.salesforceliveagent.com/content', deploymentId: '5723h000000QODx', buttonId: queueConfig.cs, baseLiveAgentUrl: 'https://web.archive.org./web/20221216224747/https://d.la4-c1-ia4.salesforceliveagent.com/chat', eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I0S00000000AuUAI_1732a286160', isOfflineSupportEnabled: false, preform: false, webToCaseUrl: 'https://web.archive.org./web/20221216224747/https://support.candid.org/case.html?mode=popup&type=fdo', webToCaseSettings: { height: 680, width: 1000 } }, ol: { init1: 'https://web.archive.org./web/20221216224747/https://candid.my.salesforce.com', init2: 'https://web.archive.org./web/20221216224747/https://help.candid.org/', initId: '00D3h000001QSAr', snapIn: 'Online_Librarian_Service_Chat', baseLiveAgentContentURL: 'https://web.archive.org./web/20221216224747/https://c.la4-c1-ia4.salesforceliveagent.com/content', deploymentId: '5723h000000QODx', buttonId: queueConfig.ol, baseLiveAgentUrl: 'https://web.archive.org./web/20221216224747/https://d.la4-c1-ia4.salesforceliveagent.com/chat', eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I0S00000000AvUAI_1732a2d4495', isOfflineSupportEnabled: false, preform: true, webToCaseUrl: 'https://web.archive.org./web/20221216224747/https://support.candid.org/case.html?mode=popup', webToCaseSettings: { height: 680, width: 1000 } }, ns: { init1: 'https://web.archive.org./web/20221216224747/https://candid.my.salesforce.com', init2: 'https://web.archive.org./web/20221216224747/https://help.candid.org/', initId: '00D3h000001QSAr', snapIn: 'Nonprofit_Support_Chat', baseLiveAgentContentURL: 'https://web.archive.org./web/20221216224747/https://c.la4-c1-ia4.salesforceliveagent.com/content', deploymentId: '5723h000000QODx', buttonId: queueConfig.ns, baseLiveAgentUrl: 'https://web.archive.org./web/20221216224747/https://d.la4-c1-ia4.salesforceliveagent.com/chat', eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I6S0000004CFWUA2_183468316a4', isOfflineSupportEnabled: false, preform: true, webToCaseUrl: 'https://web.archive.org./web/20221216224747/https://support.candid.org/case.html?mode=popup&type=ns', webToCaseSettings: { height: 680, width: 1000 } }, test: { init1: 'https://web.archive.org./web/20221216224747/https://candid.my.salesforce.com', init2: 'https://web.archive.org./web/20221216224747/https://help.candid.org/', initId: '00D3h000001QSAr', snapIn: 'Test_Chat', baseLiveAgentContentURL: 'https://web.archive.org./web/20221216224747/https://c.la4-c1-ia4.salesforceliveagent.com/content', deploymentId: '5723h000000QODx', buttonId: queueConfig.test, baseLiveAgentUrl: 'https://web.archive.org./web/20221216224747/https://d.la4-c1-ia4.salesforceliveagent.com/chat', eswLiveAgentDevName: 'EmbeddedServiceLiveAgent_Parent04I6S000000fxuaUAA_17d83aa7fa2', isOfflineSupportEnabled: false, preform: true, webToCaseUrl: 'https://web.archive.org./web/20221216224747/https://support.candid.org/case.html?mode=popup', webToCaseSettings: { height: 680, width: 1000 } } } if(!options) options = {} if(!options.type) options.type = 'ol'; var chatConfig = config[options.type]; embedded_svc.settings.displayHelpButton = true; //Or false embedded_svc.settings.language = ''; //For example, enter 'en' or 'en-US' embedded_svc.settings.defaultMinimizedText = 'Chat with an expert'; //(Defaults to Chat with an Expert) embedded_svc.settings.disabledMinimizedText = 'Agent offline'; //(Defaults to Agent Offline) //Handle dynamic routing to buttons based on reason, if the current provided options //or config specifes routing options var routeConfig = options.routing || chatConfig.routing; if(routeConfig && routeConfig.reasonButtonRoutes.length > 0) { embedded_svc.settings.directToButtonRouting = function(prechatFormData) { console.log(prechatFormData); var routeFieldData = $.grep(prechatFormData, function(formDataItem){return formDataItem.name === routeConfig.field}); console.log(routeFieldData) if(routeFieldData.length > 0) { var dynamicRoute = $.grep(routeConfig.reasonButtonRoutes, function(reasonButtonRoute){ return routeFieldData[0].value && routeFieldData[0].value.toLowerCase() == reasonButtonRoute.value.toLowerCase() }); if(dynamicRoute.length > 0) { console.log('dynamic route: ' + queueConfig[dynamicRoute[0].queue]); if(queueConfig[dynamicRoute[0].queue]) return queueConfig[dynamicRoute[0].queue]; }; } console.log('default route used'); return chatConfig.buttonId; } } if(options.settings) { if(options.settings.offlineEnableWebToCase) embedded_svc.settings.disabledMinimizedText = 'Contact us'; if(options.settings.onlineButtonText) embedded_svc.settings.defaultMinimizedText = options.settings.onlineButtonText; if(options.settings.offlineButtonText) embedded_svc.settings.disabledMinimizedText = options.settings.offlineButtonText; if(options.settings.loadingText) embedded_svc.settings.loadingText = options.settings.loadingText; //(Defaults to Loading) //If option for hiding the button is true, dynamically add css to hide it if(options.settings.hideButton) { var cssText = '.embeddedServiceHelpButton { display: none !important; }'; var style = document.createElement('style'); style.type = 'text/css'; if (style.styleSheet) { // IE style.styleSheet.cssText = cssText; } else { // Other browsers style.innerHTML = cssText; } var documentHeadTags = document.getElementsByTagName('head'); if(documentHeadTags.length > 0) documentHeadTags[0].appendChild(style); } //Show a close button to allow users to close out the chat button if(options.settings.enableHideButton) { var isFirstLoad = true; embedded_svc._onButtonStatusChange1 = embedded_svc.onButtonStatusChange; embedded_svc.onButtonStatusChange = function() { this._onButtonStatusChange1(); //Check if chat snap-in is loaded if(this.isIframeReady) { if(options.settings.enableHideButton && isFirstLoad) { if(document.cookie && document.cookie.indexOf('chatClosed=1') >= 0) { options.hideButton(true); } //Add UI element for close var closeButton = $(' '); $('.embeddedServiceHelpButton .helpButton').append(closeButton); closeButton = document.querySelector('.embeddedServiceHelpButton a.closeButton'); //Hook logic to newly added close UI element for hiding/closing the chat button closeButton.onclick = function(event) { event.stopPropagation(); console.log('close clicked'); options.hideButton(true); return false; } } isFirstLoad = false; } } } var webToCaseUrl = chatConfig.webToCaseUrl; if(options.settings.webToCaseUrl) webToCaseUrl = options.settings.webToCaseUrl; //Ensure we always have a ? in the url, as later we tack on querystring parameters with & assuming there is already a ? defined if(webToCaseUrl && webToCaseUrl.indexOf('?') < 0) webToCaseUrl += '?'; var openWebToCase = function() { //Open web to case form in new popup window. Note context parameter is appended url with window.location.href to deal with cross-origin location limitations return window.open(webToCaseUrl + '&context=' + window.location.href, 'caseWindow', 'toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=' + chatConfig.webToCaseSettings.width + ',height=' + chatConfig.webToCaseSettings.height); }; if(options.settings.onOpenWebToCase) openWebToCase = options.settings.onOpenWebToCase; options.openWebToCase = openWebToCase; //Special logic to handle showing web to case button when chat agent not online if(options.settings.offlineEnableWebToCase) { embedded_svc._onButtonStatusChange = embedded_svc.onButtonStatusChange; embedded_svc.onButtonStatusChange = function() { this._onButtonStatusChange(); //Check if chat snap-in is loaded if(this.isIframeReady) { //isButtonDisabled indicates whether we are in offline mode if(this.isButtonDisabled) { //Add click handler to offline button var offlineButton = document.querySelector('.helpButtonDisabled'); offlineButton.classList.add("webToCaseButton"); offlineButton.onclick = function() { openWebToCase(); } } } }; } } //embedded_svc.settings.loadingText = ''; //(Defaults to Loading) //embedded_svc.settings.storageDomain = 'yourdomain.com'; //(Sets the domain for your deployment so that visitors can navigate subdomains during a chat session) // Settings for Live Agent //embedded_svc.settings.directToButtonRouting = function(prechatFormData) { // Dynamically changes the button ID based on what the visitor enters in the pre-chat form. // Returns a valid button ID. //}; //embedded_svc.settings.prepopulatedPrechatFields = {}; //Sets the auto-population of pre-chat form fields //embedded_svc.settings.fallbackRouting = []; //An array of button IDs, user IDs, or userId_buttonId //embedded_svc.settings.offlineSupportMinimizedText = '...'; //(Defaults to Contact Us) embedded_svc.settings.enabledFeatures = ['LiveAgent']; embedded_svc.settings.entryFeature = 'LiveAgent'; // embedded_svc.settings.avatarImgURL = "..." // embedded_svc.settings.chatbotAvatarImgURL = window.location.origin + "/img/avatar-bot.png"; embedded_svc.settings.extraPrechatFormDetails = []; var url = window.location.href; //If a specific url was provided in the options values, use it rather than just the current url if(options.url) url = options.url; if(url && url.length > 255) url = url.substring(0, 255); //Pass url as contextual value embedded_svc.settings.extraPrechatFormDetails.push({ "label":"Case originated URL", "transcriptFields":["Case_Originated_URL__c"], "value": url, "displayToAgent":true }, { "label":"Case origin", "transcriptFields":[], "value": "Chat (Converted to Case)", "displayToAgent":true } // { // "label":"Account", // "value": config.defaultAccountId, // "transcriptFields":[], // "displayToAgent":true // } ); var caseFieldMaps = [{ "isExactMatch":false, "fieldName":"Case_Originated_URL__c", "doCreate":true, "doFind":false, "label":"Case originated URL" }, { "isExactMatch":false, "fieldName":"Origin", "doCreate":true, "doFind":false, "label": "Case origin" } ]; var contactFieldMaps = [ { "isExactMatch": false, "fieldName": "FirstName", "doCreate": true, "doFind": false, "label": "First Name" }, { "isExactMatch": false, "fieldName": "LastName", "doCreate": true, "doFind": false, "label": "Last Name" }, { "isExactMatch": true, "fieldName": "Email", "doCreate": true, "doFind": true, "label": "Email" } // { // "isExactMatch": false, // "fieldName": "AccountId", // "doCreate": true, // "doFind": false, // "label": "Account" // } ]; if(chatConfig.preform) { embedded_svc.settings.prepopulatedPrechatFields = {}; if(options.product && options.product.toLowerCase() == 'grantspace') embedded_svc.settings.prepopulatedPrechatFields['Reason'] = 'Training/Events'; if(options.subject) { embedded_svc.settings.prepopulatedPrechatFields['Subject'] = options.subject; } if(options.reason) { embedded_svc.settings.prepopulatedPrechatFields['Reason'] = options.reason; } } if(!options.userInfo || chatConfig.preform) { embedded_svc.settings.extraPrechatFormDetails.push({ "label":"First Name", "transcriptFields":["Contact_First_Name__c"] }); embedded_svc.settings.extraPrechatFormDetails.push({ "label":"Last Name", "transcriptFields":["Contact_Last_Name__c"] }); embedded_svc.settings.extraPrechatFormDetails.push({ "label":"Email", "transcriptFields":["Contact_Email__c"] }); } //If a product was supplied in the chat options, we map it to a transcript field if(options.product) { var product = options.product; if(product && product.length > 255) product = product.substring(0, 255); embedded_svc.settings.extraPrechatFormDetails.push({ "label":"Product", "value": product, "transcriptFields":["Product_Name__c"], "displayToAgent":true }); } if(options.userInfo) { var userInfo = options.userInfo; if(chatConfig.preform) { //Populate pre-form field defaults if(userInfo.firstName) { embedded_svc.settings.prepopulatedPrechatFields['FirstName'] = userInfo.firstName; } if(userInfo.lastName) { embedded_svc.settings.prepopulatedPrechatFields['LastName'] = userInfo.lastName; } if(userInfo.email) { embedded_svc.settings.prepopulatedPrechatFields['Email'] = userInfo.email; } if(userInfo.postalCode) { embedded_svc.settings.prepopulatedPrechatFields['Postal_Code__c'] = userInfo.postalCode; } if(userInfo.country) { embedded_svc.settings.prepopulatedPrechatFields['Country__c'] = userInfo.country; } /*embedded_svc.settings.prepopulatedPrechatFields = { FirstName: 'Kevin', LastName: 'Mulder', Email: 'kevin.mulder.fc@gmail.com', Subject: 'Help!', //Case_Originated_URL__c: 'hereweare', };*/ } else { if(userInfo.firstName) { embedded_svc.settings.extraPrechatFormDetails.push({ "label":"First Name", "value": userInfo.firstName, "transcriptFields":["Contact_First_Name__c"], "displayToAgent":true }); // contactFieldMaps.push({ // "isExactMatch": false, // "fieldName": "FirstName", // "doCreate": true, // "doFind": false, // "label": "First Name" // }); } if(userInfo.lastName) { embedded_svc.settings.extraPrechatFormDetails.push({ "label":"Last Name", "value": userInfo.lastName, "transcriptFields":["Contact_Last_Name__c"], "displayToAgent":true }); // contactFieldMaps.push({ // "isExactMatch": false, // "fieldName": "LastName", // "doCreate": true, // "doFind": false, // "label": "Last Name" // }); } if(userInfo.email) { embedded_svc.settings.extraPrechatFormDetails.push({ "label":"Email", "value": userInfo.email, "transcriptFields":["Contact_Email__c"], "displayToAgent":true }); // contactFieldMaps.push({ // "isExactMatch": true, // "fieldName": "Email", // "doCreate": true, // "doFind": true, // "label": "Email" // }); } } //Add memberId value to contextual info if it was supplied if(userInfo.memberId) { embedded_svc.settings.extraPrechatFormDetails.push({ "label":"Member Id", "transcriptFields":["Member_Id__c"], "value": options.userInfo.memberId, "displayToAgent":true }); caseFieldMaps.push({ "isExactMatch":false, "fieldName":"Member_Id__c", "doCreate":true, "doFind":false, "label":"Member Id" }); } } //Maps hidden fields to actual SF entity objects/fields embedded_svc.settings.extraPrechatInfo = []; //Add contact field mapping config, if there are any field values identified to be mapped if(contactFieldMaps.length > 0) { embedded_svc.settings.extraPrechatInfo.push({ "entityName": "Contact", "showOnCreate": true, "linkToEntityName": "Case", "linkToEntityField": "ContactId", "saveToTranscript": "Contact", "entityFieldMaps": contactFieldMaps }); } embedded_svc.settings.extraPrechatInfo.push({ "entityName":"Case", "showOnCreate":true, "saveToTranscript":"CaseId", "entityFieldMaps": caseFieldMaps }); // console.log(embedded_svc); // embedded_svc.addEventHandler('onhelpbuttonclick', function() { alert('ready')}); //Changes per environment - make this configurable embedded_svc.init( chatConfig.init1, chatConfig.init2, gslbBaseURL, chatConfig.initId, chatConfig.snapIn, { baseLiveAgentContentURL: chatConfig.baseLiveAgentContentURL, deploymentId: chatConfig.deploymentId, buttonId: chatConfig.buttonId, baseLiveAgentURL: chatConfig.baseLiveAgentUrl, eswLiveAgentDevName: chatConfig.eswLiveAgentDevName, isOfflineSupportEnabled: chatConfig.isOfflineSupportEnabled } ); //updateShadowRootStyle(); }; function initializeChat(options) { if(!options) options = {}; options.hideButton = function(persistHide) { var chatUiButton = document.querySelector('.embeddedServiceHelpButton .helpButton'); chatUiButton.classList.add("closed"); if(persistHide) document.cookie = "chatClosed=1;path=/"; }; options.showButton = function() { document.cookie = "chatClosed=0"; var chatButton = document.querySelector(".embeddedServiceHelpButton .helpButton"); if(chatButton) { chatButton.classList.remove('closed'); } else { console.log('chat button not available'); } }; options.open = function() { var chatButton = document.querySelector(".embeddedServiceHelpButton .uiButton"); if(chatButton) { chatButton.click(); } else { console.log('chat button not available'); } //updateShadowRootStyle(); }; options.openChat = function() { var chatButton = document.querySelector(".embeddedServiceHelpButton .helpButtonEnabled"); if(chatButton) { chatButton.click(); } else { console.log('chat button not available'); } }; if (!window.embedded_svc) { var s = document.createElement('script'); s.setAttribute('src', 'https://web.archive.org./web/20221216224747/https://candid.my.salesforce.com/embeddedservice/5.0/esw.min.js'); s.onload = function() { initESW(null, options); }; document.body.appendChild(s); } else { initESW('https://web.archive.org./web/20221216224747/https://service.force.com', options); } //updateShadowRootStyle(); return { hideButton: options.hideButton, showButton: options.showButton, open: options.open, //Has to be a callback, as openWebToCase may not be available until later in the initalization openWebToCase: function() { return options.openWebToCase() }, openChat: options.openChat }; } function updateShadowRootStyle() { const shadowHost = document.getElementsByTagName('embeddedservice-chat-header'); const shadow = shadowHost.shadowRoot; if (shadow) { const childNodes = Array.from(shadow.childNodes); childNodes.forEach(childNode => { if (childNode.nodeName === 'STYLE') { childNode.textContent = ` `; } }); } } } /* FILE ARCHIVED ON 22:47:47 Dec 16, 2022 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 22:07:17 May 17, 2024. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ /* playback timings (ms): captures_list: 1.075 exclusion.robots: 0.119 exclusion.robots.policy: 0.109 esindex: 0.009 cdx.remote: 11.396 LoadShardBlock: 135.381 (3) PetaboxLoader3.datanode: 64.076 (4) PetaboxLoader3.resolve: 106.347 (3) load_resource: 94.187 */