PageSourceSearch

https://www.westernunion.com/content/wucom/dist/ng9staticassets/R260930-2584feec25/assets/vendor/util.js

js westernunion.com collected 2026-10-09 21:33:52 UTC 34,941 bytes, 974 lines download raw bytes

1if (window['SWITCHES']) {
2  sessionStorage.setItem('switches', JSON.stringify(window['SWITCHES']));
3}
4// Amplitude
5(function (e, t) {
6  var n = e.amplitude || { _q: [], _iq: {} };
7  function s(e, t) {
8    e.prototype[t] = function () {
9      _q.push([t].concat(Array.prototype.slice.call(arguments, 0))); return this
10    }
11  }
12  var o = function () { _q = []; return this }
13    ; var a = ["add", "append", "clearAll", "prepend", "set", "setOnce", "unset"]
14    ; for (var u = 0; u < a.length; u++) { s(o, a[u]) } n.Identify = o; var c = function () {
15      _q = []
16        ; return this
17    }
18    ; var l = ["setProductId", "setQuantity", "setPrice", "setRevenueType", "setEventProperties"]
19    ; for (var p = 0; p < l.length; p++) { s(c, l[p]) } n.Revenue = c
20    ; var d = ["init", "logEvent", "logRevenue", "setUserId", "setUserProperties", "setOptOut", "setVersionName", "setDomain", "setDeviceId", "setGlobalUserProperties", "identify", "clearUserProperties", "setGroup", "logRevenueV2", "regenerateDeviceId", "logEventWithTimestamp", "logEventWithGroups", "setSessionId", "resetSessionId"]
21    ; function v(e) {
22      function t(t) {
23        e[t] = function () {
24          e._q.push([t].concat(Array.prototype.slice.call(arguments, 0)))
25        }
26      }
27      for (var n = 0; n < d.length; n++) { t(d[n]) }
28    } v(n); n.getInstance = function (e) {
29      e = (!e || e.length === 0 ? "$default_instance" : e).toLowerCase()
30        ; if (!n._iq.hasOwnProperty(e)) { n._iq[e] = { _q: [] }; v(n._iq[e]) } return n._iq[e]
31    }
32    ; e.amplitude = n
33})
34
35// SD
36var SDConf = {
37  "senderDirect": {
38    "senderCountries": ["US", "FR", "IT", "DE", "GB", "AU", "CA", "SE", "ES", "BE", "RU", "NL", "NO"],
39    "corridors": ["IN", "PH", "US", "PK", "TR", "TH", "MX", "NG", "CO", "MA", "ID", "CN", "FR", "GB", "JM", "LK", "RU", "BD", "CA", "DE", "ES", "KE", "RO", "VN", "SN", "SV", "UA", "YU"]
40  },
41  "receiverAssist": {
42    "senderCountries": ["US", "FR", "IT", "DE", "GB", "AU", "CA", "SE", "ES", "BE", "NL", "NO"],
43    "corridors": ["IN", "PH", "US", "PK", "TR", "TH", "MX", "NG", "CO", "MA", "ID", "CN", "FR", "GB", "JM", "LK", "BD", "CA", "DE", "ES", "KE", "RO", "VN", "SN", "SV", "UA", "YU"]
44  },
45  "localCurr": {
46    "corridors": ["PH", "TR", "CN"]
47  }
48};
49var partnerConfig = {
50  "googlespot": {
51    "name": "googlespot",
52    "country": "US",
53    "onTrust": false
54  },
55  "vigo": {
56    "name": "vigo",
57    "country": "US",
58    "onTrust": true
59  },
60  "kroger": {
61    "name": "kroger",
62    "country": "US",
63    "onTrust": true
64  },
65  "moneymart": {
66    "name": "moneymart",
67    "country": "CA",
68    "onTrust": false
69  },
70  "auspost": {
71    "name": "auspost",
72    "country": "AU",
73    "onTrust": false
74  },
75  "postoffice": {
76    "name": "postoffice",
77    "country": "GB",
78    "onTrust": true
79  },
80  "tui": {
81    "name": "tui",
82    "country": "GB",
83    "onTrust": true
84  },
85  "ryman": {
86    "name": "ryman",
87    "country": "GB",
88    "onTrust": true
89  },
90  "linxo": {
91    "name": "linxo",
92    "country": "FR",
93    "onTrust": true
94  },
95  "posteitaliane": {
96    "name": "posteitaliane",
97    "country": "IT",
98    "onTrust": true
99  },
100  "lbp": {
101    "name": "lbp",
102    "country": "FR",
103    "onTrust": true
104  },
105  "advanceamerica": {
106    "name": "advanceamerica",
107    "country": "US",
108    "onTrust": true
109  },
110  "postbank": {
111    "name": "postbank",
112    "country": "DE",
113    "onTrust": true
114  },
115  "alipay": {
116    "name": "alipay",
117    "country": "US",
118    "onTrust": true
119  },
120};
121var urlParameters = getUrlParams();
122var partnerName = window.getCookie('partnerName') || sessionStorage.getItem('partnerName');
123if (!partnerName) partnerName = urlParameters['partnerName'];
124setFavicon();
125
126// Auto login
127sessionStorage.setItem("loginExt", "true");
128sessionStorage.setItem("enableReceiver", "true");
129// Chat bot 
130function loadScript(url, callback) {
131  var script = document.createElement("script");
132  script.type = "text/javascript";
133  script.async = 1;
134
135  if (script.readyState) {
136    script.onreadystatechange = function () {
137      if (script.readyState == "loaded" ||
138        script.readyState == "complete") {
139        script.onreadystatechange = null;
140        callback();
141      }
142    };
143  } else {
144    script.onload = function () {
145      callback();
146    };
147  }
148
149  script.src = url;
150  var fScript = document.getElementsByTagName("script")[0];
151  fScript.parentNode.insertBefore(script, fScript);
152}
153
154var pageurl = window.location.href;
155var botalias;
156var domainURL;
157if ((pageurl.indexOf('westernunion.com') > 0 || pageurl.indexOf('westernunion.ru') > 0) && pageurl.indexOf('-uat') === -1 && pageurl.indexOf('-dev') === -1 && pageurl.indexOf('-qa') === -1 && pageurl.indexOf('ruwudispatcheruat') === -1 && (pageurl.indexOf('www') > 0 || pageurl.indexOf('wudispatcherrs') || pageurl.indexOf('wudispatcherci'))) {
158  botalias = 'prod';
159  domainURL = 'www.westernunion.com';
160} else {
161  botalias = 'qa';
162  domainURL = 'wubotdev-origin.westernunion.com';
163}
164
165var loader = null;
166var chatbotUiConfig = null;
167var loadedFresh = "true";
168if (JSON.parse(sessionStorage.getItem('featureFlags'))?.IOVATION_ENABLED?.countries === "") {
169  var initalScriptsToLoad = {
170    snare: {
171      url: 'https://mpsnare.iesnare.com/wu/snare.js',
172      enable: !disableAnalytics
173    }
174  }
175}
176
177loadScripts(initalScriptsToLoad);
178
179window.addEventListener('load', function () {
180  insertScripts();
181  if (pageurl.includes("/gbg")) {
182    loadGbgScripts();
183  }
184  loadScript('https://' + domainURL + '/wubot/lex-web-ui-loader.m.js', function () {
185    var currentUrlHost = window.location.protocol + "//" + window.location.host;
186    var loaderOpts = {
187      baseUrl: 'https://' + domainURL + '/'
188    };
189    loader = new ChatBotUiLoader.IframeLoader(loaderOpts);
190
191    var chatBotWindowActiveFlag = sessionStorage.getItem('chatBotWindowActive');
192    chatbotUiConfig;
193
194    if (chatBotWindowActiveFlag === undefined || chatBotWindowActiveFlag === null || chatBotWindowActiveFlag === '') {
195      chatbotUiConfig = {
196        lex: {
197          botName: "WU_Virtualassistant",
198          botAlias: botalias,
199          initialText: "Hi! I am the WU Assistant to help you with general questions so please do not share any personal information.",
200          initialSpeechInstruction: "Say 'Help' to get started.",
201          reInitSessionAttributesOnRestart: false,
202          region: "us-east-1"
203        },
204        ui: {
205          parentOrigin: currentUrlHost
206        },
207        iframe: {
208          iframeOrigin: "https://" + domainURL
209        }
210      }
211    } else {
212      chatbotUiConfig = {
213        lex: {
214          botName: "WU_Virtualassistant",
215          botAlias: botalias,
216          initialSpeechInstruction: "Say 'Help' to get started.",
217          reInitSessionAttributesOnRestart: false,
218          region: "us-east-1"
219        },
220        ui: {
221          parentOrigin: currentUrlHost
222        },
223        iframe: {
224          iframeOrigin: "https://" + domainURL
225        }
226      }
227    }
228
229    var chatBotWindowActiveFlag = sessionStorage.getItem('chatBotWindowActive');
230
231    if (chatBotWindowActiveFlag && chatBotWindowActiveFlag == "true") {
232      loader.load(chatbotUiConfig).then(function () {
233        document.querySelector(".chat-loading-container").style.display = 'none';
234        document.querySelector("#prime").style.display = 'none';
235        loadedFresh = "false";
236      }).catch(function (e) { console.error('Chat bot error 1:' + e.message); });
237    }
238
239  });
240
241  setupMicroappsCallback();
242});
243
244function closeChatIcon() {
245  document.querySelector("#chat_svg").style.display = 'none';
246}
247
248function openSpinnerContainer() {
249  document.querySelector(".chat-loading-container").style.display = 'block';
250}
251
252function openChat() {
253  var chatBotPingTrigger = sessionStorage.getItem('chatBotPing');
254  closeChatIcon();
255  openSpinnerContainer();
256  document.querySelector("#prime").style.background = 'black';
257  if (chatBotPingTrigger && chatBotPingTrigger == "true" && loadedFresh == "false") {
258    document.querySelector("#prime").style.display = 'none';
259    document.querySelector(".chat-loading-container").style.display = 'none';
260    sessionStorage.setItem("chatBotWindowActive", "true");
261    loader.api.closeIFrameUi().then(function () {
262      return loader.api.postText('ping');
263    }).catch(function (e) { console.error('Chat bot error 2:' + e.message); });
264  } else {
265    loader.load(chatbotUiConfig).then(function () {
266      document.querySelector(".chat-loading-container").style.display = 'none';
267      document.querySelector("#prime").style.display = 'none';
268      if (document.querySelector(".lex-web-ui-iframe--show") && 
269          getComputedStyle(document.querySelector(".lex-web-ui-iframe--show")).display == 'flex') {
270        sessionStorage.setItem("chatBotWindowActive", "true");
271      } else if (document.querySelector(".lex-web-ui-iframe") && 
272                getComputedStyle(document.querySelector(".lex-web-ui-iframe")).display == 'none') {
273        sessionStorage.setItem("chatBotWindowActive", "false");
274      }
275      loadedFresh = "false";
276      if (chatBotPingTrigger !== "true") {
277        sessionStorage.setItem("chatBotPing", "true");
278        return loader.api.postText('ping');
279      }
280    }).catch(function (e) { console.error('Chat bot error 3:' + e.message); });
281  }
282}
283
284document.addEventListener('lexWebUiClosed', function onUpdateLexState(evt) {
285  document.querySelector("#prime").style.display = 'block';
286  document.querySelector(".chat-loading-container").style.display = 'none';
287  document.querySelector("#prime").style.background = '#FFDA1A';
288  document.querySelector("#chat_svg").style.display = 'block';
289  sessionStorage.setItem("chatBotWindowActive", "false");
290});
291
292
293/***************************************************************************************************/
294/** THIRD PARTY SCRIPTS LOAD */
295/***************************************************************************************************/
296
297var isProd = (
298  (pageurl.indexOf('westernunion.com') > 0 || pageurl.indexOf('westernunion.ru') > 0) &&
299  pageurl.indexOf('-uat') === -1 &&
300  pageurl.indexOf('partners-sandbox') === -1 &&
301  pageurl.indexOf('-dev') === -1 &&
302  pageurl.indexOf('-qa') === -1 &&
303  pageurl.indexOf('www2') === -1 &&
304  pageurl.indexOf('www3') === -1 &&
305  (pageurl.indexOf('www') > 0 || pageurl.indexOf('wudispatcherrs') || pageurl.indexOf('wudispatcherci') || pageurl.indexOf('partners.westernunion.com') || pageurl.indexOf('partners-westernunion.com'))
306);
307includeHtml('/content/wucom/outage-banner/outage-banner.html');
308if (!isProd) {
309  includeHtml('/content/wucom/test-environment-banner/banner-message.html');
310}
311
312var countryIsoCode = pageurl.split('/')[3];
313var urlParams = getUrlParams();
314var disableAnalytics = urlParams['disableAnalytics'];
315var cookieOptIn = getCookie('cookieOptIn');
316const cookieBucketingEnabledCountries = 'GB,AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,HU,IE,IT,LV,LI,LT,LU,NL,NO,PL,PT,RO,SK,SI,ES,SE,CH,GLOBAL-SERVICE'
317var cookieBucketingFlag = cookieBucketingEnabledCountries.indexOf(countryIsoCode);
318var userConsent = getCookie('userCookieOptIn');
319if (userConsent === '' && getOTEnabled() && isGDPRCountry()) {
320  userConsent = ',C0001';
321}
322
323function getUrlParams() {
324  let urlParamsString = decodeURIComponent(encodeURIComponent(window.location.search));
325  let output = new Object();
326  const mapParams = new Map(Object.entries(output));
327  if (urlParamsString) {
328    urlParamsString = urlParamsString.substring(1);
329    const params = urlParamsString.split('&');
330    for (let i = 0; i < params.length; i++) {
331      const param = params[i];
332      const key = param.split('=')[0];
333      const value = param.split('=')[1];
334      mapParams.set(key, value);
335    }
336  }
337  output = this.mapToObj(mapParams);
338  return output;
339}
340
341function mapToObj(inputMap) {
342  const obj = {};
343
344  inputMap.forEach(function (value, key) {
345    obj[key] = value;
346  });
347
348  return obj;
349}
350
351
352function isGDPRCountry() {
353  return 'AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,HU,IS,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE,GB,CH,FR,UA,KZ,BY,MD'.indexOf(countryIsoCode.toUpperCase()) > -1;
354}
355
356function setFavicon() {
357  if (partnerName) {
358    // document.getElementById('appFavicon').setAttribute('href', '/your/icon/path.ico');
359    var url = '/content/dam/wu/partners/' + partnerName + '/' + partnerName + '.ico';
360    const link = this.document.createElement('link');
361    link.rel = 'icon';
362    link.type = 'image/x-icon';
363    link.href = url;
364    this.document.head.appendChild(link);
365  } else {
366    const link16 = this.document.createElement('link');
367    link16.rel = 'icon';
368    link16.type = 'image/png';
369    link16.sizes = '16x16';
370    link16.href = '/content/dam/wu/logo/favicon-16x16.png';
371    this.document.head.appendChild(link16);
372
373    const link32 = this.document.createElement('link');
374    link32.rel = 'icon';
375    link32.type = 'image/png';
376    link32.sizes = '32x32';
377    link32.href = '/content/dam/wu/logo/favicon-32x32.png';
378    this.document.head.appendChild(link32);
379
380    const link48 = this.document.createElement('link');
381    link48.rel = 'icon';
382    link48.type = 'image/png';
383    link48.sizes = '48x48';
384    link48.href = '/content/dam/wu/logo/favicon-48x48.ico';
385    this.document.head.appendChild(link48);
386
387    const link180 = this.document.createElement('link');
388    link180.rel = 'apple-touch-icon';
389    link180.type = 'image/png';
390    link180.sizes = '180x180';
391    link180.href = '/content/dam/wu/logo/apple-touch-icon.png';
392    this.document.head.appendChild(link180);
393
394    const link192 = this.document.createElement('link');
395    link192.rel = 'icon';
396    link192.type = 'image/png';
397    link192.sizes = '192x192';
398    link192.href = '/content/dam/wu/logo/android-chrome-192x192.png';
399    this.document.head.appendChild(link192);
400
401    const link384 = this.document.createElement('link');
402    link384.rel = 'icon';
403    link384.type = 'image/png';
404    link384.sizes = '384x384';
405    link384.href = '/content/dam/wu/logo/android-chrome-384x384.png';
406    this.document.head.appendChild(link384);
407  }
408}
409function loadGbgScripts() {
410  loadScript("https://simpleui-test-au.vixverify.com/df/javascripts/greenidConfig.js", function () {
411    loadScript("https://simpleui-test-au.vixverify.com/df/javascripts/greenidui.min.js", function () {
412      if (greenidJQuery) {
413        console.log("GBG js loaded successfully")
414      }
415    });
416  });
417}
418
419function insertScripts() {
420  const assetVersion = window['ACTIVE_VERSION']?.assetVersion || sessionStorage.getItem('assetVersion');
421
422  // will inlude all necessary scripts
423  var scriptsToLoad = {
424    /* greenidConfigLink: {
425      url: 'https://simpleui-test-au.vixverify.com/df/javascripts/greenidConfig.js',
426      defer: !0,
427      async: !0
428    },
429    greenIdUILink: {
430      url: 'https://simpleui-test-au.vixverify.com/df/javascripts/greenidui.min.js',
431      defer: !0,
432      async: !0
433    }, */
434    onetrust: {
435      url: 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js',
436      defer: !0,
437      async: !0,
438      enable: getOTEnabled(),
439      attributes: {
440        'data-document-language': 'true',
441        'charset': 'UTF-8',
442        'data-domain-script': getOTDomainscript()
443      },
444    },
445    signUpOverlay: {
446      url: assetVersion ? '/content/wucom/dist/' + assetVersion + '/js/vendors/signupoverlay.js' : '/etc/clientlibs/westernunion/optimus/vendors/signupoverlay.js',
447      enable: getSOEnabled()
448    },
449    adobeLaunch: {
450      url: getLaunchScript(),
451      defer: !1,
452      async: !0,
453      attributes: {
454        'id': 'adobe-dtm-satelliteLib'
455      },
456    },
457    audioEye: {
458      url: 'https://ws.audioeye.com/ae.js',
459      defer: !0,
460      async: !0,
461      enable: isAEEnabled(),
462      countryList: ['US']
463    },
464    wuAdaManifest: {
465      url: assetVersion ? '/content/wucom/dist/' + assetVersion + '/js/vendors/wu-ada-utils/wu-ada-utils-manifest.js' : '/etc/clientlibs/westernunion/optimus/vendors/wu-ada-utils/wu-ada-utils-manifest.js',
466      callback: loadAdaUtils
467    },
468    amplitude: {
469      url: 'https://cdn.amplitude.com/libs/amplitude-8.21.9-min.gz.js',
470      defer: !1,
471      async: !0,
472      type: isC0002Accepted() ? 'text/plain' : 'text/javascript',
473      class: 'optanon-category-C0002',
474      callbackFnName: 'ampCallback()',
475      callback: ampCallback
476    },
477    quantum: {
478      url: getQuantumUrl(),
479      defer: !0,
480      async: !0,
481      type: isC0002Accepted() ? 'text/plain' : 'text/javascript',
482      class: 'optanon-category-C0002'
483    },
484    plaidLink: {
485      url: 'https://cdn.plaid.com/link/v2/stable/link-initialize.js',
486      defer: !0,
487      async: !0
488    },
489    applePayWebCDN: {
490      url: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js',
491      defer: !0,
492      async: !0
493    }
494  };
495
496  loadScripts(scriptsToLoad);
497  initMParticle();
498}
499
500function ampCallback(param) {
501  param = null;
502  const e = param ? param : window;
503  // console.log('ampliturerer', window.amplitude);
504  if (e.amplitude && e.amplitude.runQueuedFunctions) {
505    e.amplitude.runQueuedFunctions();
506    amplitude.getInstance().init(getAmpKey(), null, { includeUtm: true, includeReferrer: true, saveParamsReferrerOncePerSession: false });
507    if(partnerName && partnerConfig[partnerName] && (partnerConfig[partnerName].name === 'lbp' || partnerConfig[partnerName].name === 'posteitaliane')){
508      var getDeviceID = amplitude?.getInstance().options.deviceId;
509      if (!sessionStorage.getItem('amp_device_id')) {
510        sessionStorage.setItem('amp_device_id', getDeviceID);
511      }
512    }
513    if (partnerName && partnerConfig[partnerName] && partnerConfig[partnerName].name === 'googlespot') {
514      var getDevideID = amplitude?.getInstance().options.deviceId;
515      if (!sessionStorage.getItem('wu_device_id')) {
516        sessionStorage.setItem('wu_device_id', getDevideID);
517      }
518    }
519    console.log('[Amplitude] Success: loaded SDK');
520  } else {
521    console.log('[Amplitude] Error: could not load SDK');
522  }
523}
524
525function isC0002Accepted() {
526  return getOTEnabled() && userConsent != "" && userConsent.indexOf('C0002') == -1;
527}
528
529function loadAdaUtils() {
530  if (typeof adaVersionObj != 'undefined') {
531    const assetVersion = window['ACTIVE_VERSION']?.assetVersion || sessionStorage.getItem('assetVersion');
532    var element = document.createElement('script');
533    element.type = "text/javascript";
534    element.src = assetVersion ? '/content/wucom/dist/' + assetVersion + '/js/vendors/wu-ada-utils/' + adaVersionObj["wu-ada-utils.min.js"] : '/etc/clientlibs/westernunion/optimus/vendors/wu-ada-utils/' + adaVersionObj["wu-ada-utils.min.js"];
535    document.head.appendChild(element);
536  }
537}
538
539function getOTEnabled() {
540  const OTCountriesConst = 'US,AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,HU,IS,IE,IT,LV,LI,LT,LU,MT,NL,NO,PL,PT,RO,SK,SI,ES,SE,GB,CH,UA,KZ,BY,MD,BR';
541  let switchesStr = (sessionStorage.getItem('switches') || '{}').replace(/'/g, '"');
542  const switches = JSON.parse(switchesStr);
543
544  const OTCountries = switches.CountriesWithOneTrustBanner ? switches.CountriesWithOneTrustBanner : OTCountriesConst;
545  partnerName = (partnerName) ? partnerName.toLowerCase() : null;
546  if (partnerName && partnerConfig[partnerName]) {
547    return partnerConfig[partnerName].onTrust;
548  }
549  return OTCountries.indexOf(countryIsoCode.toUpperCase()) > -1;
550}
551
552function getIovationEnabled() {
553  let featureFlagStr = (sessionStorage.getItem('featureFlags') || '{}').replace(/'/g, '"');
554  const IovationCountriesConst = JSON.parse(featureFlagStr)?.IOVATION_ENABLED?.countries;
555  if (IovationCountriesConst === "") {
556    return false;
557  } else {
558    return true;
559  }
560}
561
562function getSOEnabled() {
563  let featureFlagStr = (sessionStorage.getItem('featureFlags') || '{}').replace(/'/g, '"');
564  const SECountriesConst = JSON.parse(featureFlagStr)?.SIGNUP_OVERLAY?.countries;
565
566  const isSignupOverlayEnabled = SECountriesConst?.indexOf(countryIsoCode.toUpperCase()) > -1;
567  const isSmoPage = pageurl && pageurl.indexOf('/send-money/start') > -1;
568  return isSignupOverlayEnabled && isSmoPage && isPartner();
569}
570
571function isPartner() {
572  let isPPSApplication = sessionStorage.getItem("applicationName");
573  let isPartner = sessionStorage.getItem("partnerName");
574  return !isPPSApplication && !isPartner;
575}
576
577function getOTDomainscript() {
578  let switchesStr = (sessionStorage.getItem('switches') || '{}').replace(/'/g, '"');
579  let domains, partnersDomain;
580  const switches = JSON.parse(switchesStr);
581  const otDomains = Object.keys(switches).length > 0 && JSON.parse(switches.otDomains);
582  if (otDomains) {
583    domains = otDomains.domains;
584    /* Configure key for partners.westernunion.com domain */
585    /* For AU and CA - key not configured  - No Need as its Global*/
586    partnersDomain = otDomains.partnersDomain;
587    console.log("NG15 - otDomains read from Switches", otDomains);
588  } else {
589    domains = {
590      'AT': 'a70a77d9-eefc-486e-b0a1-138d47aa9456',
591      'BE': 'b2012572-b72d-41b8-84d8-9a1bfe437eb3',
592      'BG': 'c3fbe9d1-fcdd-4be8-a3fc-35923b217c2a',
593      'BY': '9d2bb1f9-d2f2-4255-a81b-7f25b8cbb811',
594      'CH': '6f48cac4-9db0-4610-8040-07891eeabb84',
595      'CY': '18197f0a-6243-4b08-b02b-953babc50425',
596      'CZ': '6e13b22f-8f2e-4e76-ac52-97d96c8d9e7e',
597      'DE': '0c703825-361c-461d-8edb-a7bcd0633331',
598      'DK': '8db04ba5-e758-44f1-ae2f-ea5c605da526',
599      'EE': '82ef72a2-2064-4cc4-b93a-bba4dce76b74',
600      'ES': '1e1b66ac-255c-4f36-b0c4-e832abcf1059',
601      'FI': '7ff13dc5-ba2a-4708-a81b-45d4849d2038',
602      'FR': '7bf2522d-7e08-42b9-8d48-037124fb6b39',
603      'GB': '6a574314-00a8-4e73-9983-0b82d2800be2',
604      'HR': '73848dd5-7128-44f5-9e94-c91ce19ea94e',
605      'HU': '69c36364-748a-413f-8bfe-7b2a053bd142',
606      'IE': 'bdbd83e0-7817-4724-9505-c5595f4bb855',
607      'IS': '28d93be9-9df8-4fa7-b64a-403369c87c43',
608      'IT': '675baf12-1b2e-445d-ad46-3ed95408cb24',
609      'KZ': 'e6bc2284-3649-468f-8144-d071b4778f8e',
610      'LI': 'c77b65d5-423d-4156-87b4-5057801429b9',
611      'LT': '60d33fe0-894a-4b22-b06a-2109a81a12b7',
612      'LU': '60597770-c427-4e08-85f6-165886c9c5f9',
613      'LV': '75ea7d90-e0bf-4422-98fe-dcbb25443ea6',
614      'MD': 'd0362957-1e8c-48c0-a2b4-f567ed5ae31b',
615      'MT': '77e5a9eb-b487-467f-b902-8b58906edb02',
616      'NL': 'a4a07669-8316-419a-8633-29fd1ccc7e27',
617      'NO': 'bbc1b0a9-2724-4c41-a82b-6051abffbcbe',
618      'PL': 'f1eee797-96c0-4a44-ad65-43dd7e67cdcd',
619      'PT': 'd3061a90-6d7b-446e-9ded-8814fe5ad910',
620      'RO': '695110cf-f309-4ee6-b906-dd48d9c42fd8',
621      'SE': 'fa9e39c8-57d0-4772-8849-f25c6e054a87',
622      'SI': 'a9727df6-526a-4ca0-9acc-a74781106a33',
623      'SK': '02c8a2ff-8cb6-4157-817f-d77cab11b4d2',
624      'UA': '5a21fa62-0966-4360-a778-30e0e029985a',
625      'US': '521f4809-fc8f-46b5-986a-d3b8da4f60e0',
626      'BR': 'c6b148a1-51f0-4f15-87d9-3911d66ace0c'
627    };
628    /* Configure key for partners.westernunion.com domain */
629    /* For AU and CA - key not configured  - No Need as its Global*/
630    partnersDomain = {
631      'DE': '0c703825-361c-461d-8edb-a7bcd0633331',
632      'FR': '7bf2522d-7e08-42b9-8d48-037124fb6b39',
633      'GB': '6a574314-00a8-4e73-9983-0b82d2800be2',
634      'IT': '675baf12-1b2e-445d-ad46-3ed95408cb24',
635      'US': '521f4809-fc8f-46b5-986a-d3b8da4f60e0'
636    };
637    console.log("NG15 - otDomains read from local");
638  }
639
640  var domainValue = domains[countryIsoCode.toUpperCase()] ? domains[countryIsoCode.toUpperCase()] : '521f4809-fc8f-46b5-986a-d3b8da4f60e0';
641  if (partnerName) {
642    domainValue = partnersDomain[countryIsoCode.toUpperCase()] ? partnersDomain[countryIsoCode.toUpperCase()] : '521f4809-fc8f-46b5-986a-d3b8da4f60e0';
643  }
644  return !isProd ? domainValue + '-test' : domainValue;
645}
646
647function getLaunchScript() {
648  const scripts = {
649    'prod': 'https://assets.adobedtm.com/launch-EN0655178b63a1496ab02060384481db37.min.js',
650    'uat': 'https://assets.adobedtm.com/launch-EN3d9c8c8a46944d22b4c62f58ffe9410d-staging.min.js',
651    'qa': 'https://assets.adobedtm.com/launch-EN5b74b187bed8475ab8cfddf12455e0b5-development.min.js',
652    'dev': 'https://assets.adobedtm.com/launch-EN5b74b187bed8475ab8cfddf12455e0b5-development.min.js',
653    'localhost': 'https://assets.adobedtm.com/launch-EN5b74b187bed8475ab8cfddf12455e0b5-development.min.js'
654  };
655  const env = getEnv(scripts);
656  return scripts[env];
657}
658
659function getQuantumUrl() {
660  if (isProd) {
661    return 'https://cdn.quantummetric.com/qscripts/quantum-wu.js'
662  }
663  return 'https://cdn.quantummetric.com/qscripts/quantum-wutest.js';
664}
665
666function getEnv(envs, def) {
667  if (!def) {
668    def = null;
669  }
670  for (let key in envs) {
671    if (pageurl.indexOf(key) > -1) {
672      return key;
673    }
674  }
675  return def ? def : 'prod';
676}
677
678function isAEEnabled() {
679  const AECountriesConst = 'US,CA';
680  let switchesStr = (sessionStorage.getItem('switches') || '{}').replace(/'/g, '"');
681  const switches = JSON.parse(switchesStr);
682  const AECountries = switches?.CountriesListForAe ? switches.CountriesListForAe : AECountriesConst;
683  return AECountries.indexOf(countryIsoCode && countryIsoCode.toUpperCase()) > -1;
684}
685
686function loadScripts(scripts) {
687  for (let key in scripts) {
688    if (scripts.hasOwnProperty(key)) {
689      loadJS(scripts[key]);
690    }
691  }
692}
693
694function loadJS(src) {
695  if (src.enable === false || src.enable === null) {
696    return;
697  }
698  // create preconnect
699  if (src.url) {
700    const preconnectLink = this.document.createElement('link');
701    preconnectLink.rel = 'preconnect';
702    // preconnectLink.as = 'script';
703    preconnectLink.href = src.url?.split('/')[0] + '//' + src.url?.split('/')[1] + src.url?.split('/')[2];
704    this.document.head.appendChild(preconnectLink);
705  }
706  // create scripts
707  const scriptElement = document.createElement('script');
708  scriptElement.type = src.type || 'text/javascript';
709  scriptElement.className = src.class || '';
710  if (src.defer) {
711    scriptElement.defer = true;
712  } else if (src.async) {
713    scriptElement.async = true;
714  }
715  scriptElement.src = src.url;
716  if (src.attributes) {
717    Object.keys(src.attributes).forEach(function (attr) {
718      scriptElement.setAttribute(attr, src.attributes[attr]);
719    });
720  }
721
722
723  if (src.callback && typeof src.callback === 'function') {
724    if (src.callbackFnName) {
725      scriptElement.setAttribute('onload', src.callbackFnName);
726    }
727    scriptElement.onload = src.callback;
728  }
729  document.getElementsByTagName('body')[0].appendChild(scriptElement);
730};
731
732function getCookie(cname) {
733  var name = cname + "=";
734  var ca = document.cookie.split(';');
735  for (var i = 0; i < ca.length; i++) {
736    var c = ca[i];
737    while (c.charAt(0) == ' ') {
738      c = c.substring(1);
739    }
740    if (c.indexOf(name) == 0) {
741      return c.substring(name.length, c.length);
742    }
743  }
744  return "";
745}
746
747function getAmpKey() {
748  const keys = {
749    localhost: 'bb504faf9add140a6b6ccdfef2e2d0c3',
750    dev: '34d56f5c4cecde6f72a9ea0b4c2e195c',
751    qa: 'bb504faf9add140a6b6ccdfef2e2d0c3',
752    uat: '6df7e5898faeba52a21c7f38c8858a8e',
753    prod: '4aec879ef8bf1823486c4338537ec441',
754    'amerigo-uat': '18e9b5efcf52c7ac5fd0b7299029142d',
755    'amerigo-prod': '48abc78eb10eb233812f4e4f6e263ed4'
756  };
757  const env = getEnv(keys);
758  return keys[env];
759}
760
761function includeHtml(url) {
762  var xmlhttp;
763  // compatible with IE7+, Firefox, Chrome, Opera, Safari
764  xmlhttp = new XMLHttpRequest();
765  xmlhttp.onreadystatechange = function () {
766    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
767      const container = document.createElement('div');
768      const responseText = encodeURIComponent(xmlhttp.responseText);
769      container.innerHTML = decodeURIComponent(responseText)
770      runInnerHTMLScripts(decodeURIComponent(responseText));
771      document.body.insertBefore(container, document.body.firstChild);
772    }
773  }
774  xmlhttp.open("GET", url, true);
775  xmlhttp.send();
776}
777
778function runInnerHTMLScripts(html) {
779  let scripts = html.match(/<script([\S\s]*?)<\/script>/g);
780  scripts = scripts ? scripts : [];
781  for (let i = 0; i < scripts.length; i++) {
782    const script = scripts[i];
783    let src = script.match(/src="([\S\s]*?)"/);
784    let scriptContent = script.replace(/<[/]?script.*>/gm, '');
785    const head = document.getElementsByTagName("head")[0];
786    const newScript = document.createElement('script');
787    newScript.type = 'text/javascript';
788    if (src && src.length > 1) {
789      src = src[1];
790      eval("newScript.src=src;");
791      head.appendChild(newScript);
792    } else if (scriptContent && scriptContent.trim()) {
793      newScript.text = scriptContent.trim();
794      head.appendChild(newScript);
795    }
796  }
797}
798
799function OptanonWrapper() {
800  let eOT;
801  if (typeof (Event) === 'function') {
802    eOT = new Event('OneTrustGroupsUpdated');
803  } else {
804    eOT = document.createEvent('OneTrustGroupsUpdated');
805    eOT.initEvent('submit', true, true);
806  }
807  document.dispatchEvent(eOT);
808  // var eOT = new Event('OneTrustGroupsUpdated');
809  // document.dispatchEvent(eOT);
810  var dateN = new Date();
811  dateN.setDate(dateN.getDate() + 365);
812  var expires = "expires=" + dateN.toUTCString();
813  document.cookie = 'userCookieOptIn' + "=" + OptanonActiveGroups + ";domain=.westernunion.com;path=/;expires=" + expires;
814
815  // Changes to read user purposes from new OT template TCF 2.2.
816  try {
817    // __tcfapi is opensource APi provided by OT to read purpose values. 
818    var userCookiePreference = {};
819    if (typeof __tcfapi === 'function') {
820      __tcfapi('getTCData', 2, (tcData, success) => {
821        if (success) {
822          const userConsentData = {
823            userPurposesSelected: tcData && tcData.purpose && tcData.purpose.consents ? Object.values(tcData.purpose.consents).every(Boolean) : false,
824            userSpecialPurposeSelected: tcData && tcData.specialFeatureOptins ? JSON.stringify(tcData.specialFeatureOptins) !== '{}' : false,
825            performanceCookieOpted: OptanonActiveGroups ? OptanonActiveGroups.includes('C0002') : false,
826            targetCookiesOpted: OptanonActiveGroups ? OptanonActiveGroups.includes('C0004') : false,
827            functionalCookiesOpted: OptanonActiveGroups ? OptanonActiveGroups.includes('C0003') : false
828          };
829          sessionStorage.setItem('userConsentForAds', Object.values(userConsentData).every(Boolean));
830          userCookiePreference.cookie = window.getCookie('userCookieOptIn').split(',').filter(function (n) { return n; });
831          userCookiePreference.purpose = tcData.purpose.consents;
832          if (Object.keys(tcData.specialFeatureOptins).length) userCookiePreference.special_purpose = tcData.specialFeatureOptins;
833          sessionStorage.setItem('userCookiePurposePreference', JSON.stringify(userCookiePreference));
834        }
835      }, []);
836    } else {
837      userCookiePreference.cookie = window.getCookie('userCookieOptIn').split(',').filter(function (n) { return n; });
838      sessionStorage.setItem('userCookiePurposePreference', JSON.stringify(userCookiePreference));
839    }
840  } catch (err) {
841    console.error(err);
842  }
843  Optanon.OnConsentChanged(function (e) {
844    var eOtuserPreference = new Event('OneTrustGroupsUpdateUserPreference');
845    document.dispatchEvent(eOtuserPreference);
846    //fix for PBL-6056, setting OneTrust specific cookies without path, to fix issues on global pages which doesn't have context path for c
846ountries
847    var OptanonAlertBoxClosed = window.getCookie('OptanonAlertBoxClosed');
848    document.cookie = "OptanonAlertBoxClosed=" + OptanonAlertBoxClosed + ";path=/";
849
850    var OptanonConsent = window.getCookie('OptanonConsent');
851    document.cookie = "OptanonConsent=" + OptanonConsent + ";path=/";
852
853    var url = window.location.href || '';
854    if (url) {
855      var splitUrl = url.split('/');
856      var country = splitUrl[3];
857      if (country.toLowerCase() !== 'us') {
858        location.reload();
859      }
860    }
861  });
862  // fix for cookie policy page
863  if (window.location.href.indexOf('cookie-information') > -1) {
864    try {
865      var cookiePolicyDiv = document.getElementById('optanon-cookie-policy');
866      if (cookiePolicyDiv && cookiePolicyDiv.innerHTML == "") {
867        Optanon.initializeCookiePolicyHtml();
868      }
869    } catch (e) {
870      console.log('error in loading OT cookie policy: ' + e);
871    }
872  }
873}
874
875function setupMicroappsCallback() {
876  var userAgent = navigator.userAgent;
877  if (userAgent.indexOf('Microapps') === -1 && userAgent.indexOf('GPay') === -1) {
878    return;
879  }
880  document.addEventListener('click', function(e) {
881    if (e.target.closest('a[target=_blank]') && 
882        ((e.target && e.target.href) || (e.currentTarget && e.currentTarget.href)) && 
883        typeof microapps !== 'undefined') {
884      e.preventDefault();
885      if (e.target && e.target.href) {
886        microapps.openUrl({ url: e.target.href });
887        return true;
888      } else if (e.currentTarget && e.currentTarget.href) {
889        microapps.openUrl({ url: e.currentTarget.href });
890        return true;
891      }
892    }
893  });
894}
895
896function initMParticle() {
897  window.mParticle = {
898    config: {
899      isDevelopmentMode: !isProd
900    }
901  };
902  loadMParticle('us1-fdd5f1abc3a1f3499fd53e18a790704f');
903}
904
905
906function loadMParticle(t) {
907  window.mParticle = window.mParticle || {};
908  window.mParticle.EventType = {
909    Unknown: 0,
910    Navigation: 1,
911    Location: 2,
912    Search: 3,
913    Transaction: 4,
914    UserContent: 5,
915    UserPreference: 6,
916    Social: 7,
917    Other: 8
918  };
919  window.mParticle.eCommerce = {
920    Cart: {}
921  };
922  window.mParticle.Identity = {};
923  window.mParticle.config = window.mParticle.config || {};
924  window.mParticle.config.rq = [];
925  window.mParticle.config.snippetVersion = 2.2;
926  window.mParticle.ready = function (t) {
927    window.mParticle.config.rq.push(t)
928  };
929  var e = ["endSession", "logError", "logBaseEvent", "logEvent", "logForm", "logLink", "logPageView", "setSessionAttribute", "setAppName", "setAppVersion", "setOptOut", "setPosition", "startNewSession", "startTrackingLocation", "stopTrackingLocation"];
930  var o = ["setCurrencyCode", "logCheckout"];
931  var i = ["identify", "login", "logout", "modify"];
932  e.forEach(function (t) {
933    window.mParticle[t] = n(t)
934  });
935  o.forEach(function (t) {
936    window.mParticle.eCommerce[t] = n(t, "eCommerce")
937  });
938  i.forEach(function (t) {
939    window.mParticle.Identity[t] = n(t, "Identity")
940  });
941
942  function n(e, o) {
943    return function () {
944      if (o) {
945        e = o + "." + e
946      }
947      var t = Array.prototype.slice.call(arguments);
948      t.unshift(e);
949      window.mParticle.config.rq.push(t)
950    }
951  }
952  var mp = document.createElement("script");
953  mp.type = "text/javascript";
954  mp.async = true;
955  mp.src = ("https:" == document.location.protocol ? "https://jssdkcdns" : "http://jssdkcdn") + ".mparticle.com/js/v2/" + t + "/mparticle.js";
956  var c = document.getElementsByTagName("script")[0];
957  c.parentNode.insertBefore(mp, c)
958}
959
960function fireTag(tagsrc, bAsync) {
961  if (bAsync === undefined) bAsync = true;
962  var e = document.createElement('script');
963  e.type = 'text/javascript';
964  e.async = bAsync;
965  e.src = ('https:' === document.location.protocol ? 'https://' : 'http://') + tagsrc;
966  var s = document.getElementsByTagName('script')[0];
967  s.parentNode.appendChild(e);
968}
969var _tags = [];
970function fireTags() {
971  for (_tag in _tags) {
972    fireTag(_tags[_tag]);
973  }
974}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.