(async function () {


var s = document.createElement('script'); s.text = '(function() { var SITEID=\'citibank\';\n\n(function(b, t, r, a, i, n) {\n    b[\'bt\']=b[\'bt\'] || function() {\n        (b[\'_bt\']=b[\'_bt\']||[]).push(arguments);\n    },\n    i = t.createElement(r),\n    n = t.getElementsByTagName(r)[0];\n    i.async = 1;\n    i.src = a;\n	i.onload = function() {\n        console.info("ZMP: Initialized Library...");\n        console.info("ZMP: version: 1.45");\n        // first track on library init\n        //zmp_track_data();\n		if (window.hasOwnProperty(\'_bt\')) {\n        var CookieDate = new Date();\n        CookieDate.setFullYear(CookieDate.getFullYear() +1);\n        document.cookie="ZT_ZYNC=" + window._bt._externalIds.zync + "; expires=" + CookieDate.toUTCString() + "; path=/; domain=.citi.com";\n		}\n\n    defer(updateUser);\n\n    }(window, document);\n    n.parentNode.insertBefore(i, n);\n})(\n    window,\n    document,\n    \'script\',\n		\'https://cdn.boomtrain.com/p13n/\'+SITEID+\'/p13n.min.js\'\n);\nbt(\'initialize\', SITEID, {externalIds: {zync: \'dd5edbbd-2ac1-457e-ae5e-6c573ce40eeb:1781423493.9704473\'}});\n//This section added to include re-identification\n\n//removing Live Intent call 10-31-2024\n/*\nvar scriptTag = document.createElement(\'script\');\n	scriptTag.src = \'https://d-code.liadm.com/did-0049.min.js\';\n	scriptTag[\'onload\'] = function(e) {\n		window.liQd_did_0049.resolve(function(result) {\n			if (result)\n              //	console.log(\'success==>\'+JSON.stringify(result));\n          		bt(\'initialize\', SITEID, {externalIds: {zync: \'dd5edbbd-2ac1-457e-ae5e-6c573ce40eeb:1781423493.9704473\', email_md5: result.md5}});\n        },\n        function(err) {\n          console.error(\'ZETA error==>\'+JSON.stringify(err));\n          bt(\'initialize\', SITEID, {externalIds: {zync: \'dd5edbbd-2ac1-457e-ae5e-6c573ce40eeb:1781423493.9704473\'}});\n        },\n    		{resolve: "md5"});\n	}\ndocument.head.appendChild(scriptTag);\n*/\n\n//end Live Intent section\n\nvar view_data = {\n	"citi_event":"",\n	"evar_page_name":"us,web,public,marketing,loginpage,retarget",\n	"pid":"undefined",\n	"cuuid":"null",\n	"products_details":"undefined",\n	"prospect_id":"undefined"\n}\n\n//get cookie by name from DOM\nfunction getCookieByName(name) {\n  const cookies = document.cookie.split(";");\n  for (let cookie of cookies) {\n    cookie = cookie.trim();\n    if (cookie.startsWith(name + "=")) {\n      return cookie.substring(name.length + 1);\n    }\n  }\n  return null;\n}\n\n\n\n\n//checks to see if JQuery exists and wait 50ms if it doesn\'t exist\nfunction defer(method) {\n  if (window.jQuery) {\n      console.info("ZMP: JQuery loaded");\n      updateUser();\n  } else {\n      setTimeout(function() { defer(method) }, 50);\n  }\n}\n\n//check if the Live Ramp cookie cookies exists.  Update User with the Live Ramp ID with the RF cookie ID\nfunction updateUser() {\n  if (getCookie(\'liveRamp\') != \'\')\n            {\n                var LiveRampID = getCookie("liveRamp");\n                console.info ("ZMP: " + LiveRampID);\n                if (LiveRampID != "")\n                {\n                    jQuery.getJSON("https://a.rfihub.com/idr.js?_callback=?",\n                    function(result) {\n                    console.log(result);\n                    bt(\'updateUser\',{"user_id":result,"unique_client_ids":[{"name":"live_ramp_id","value":LiveRampID}]});\n                    });\n                }\n            }\n   \n}\n\nfunction getCookie(cname) {\n    let name = cname + "=";\n    let decodedCookie = decodeURIComponent(document.cookie);\n    let ca = decodedCookie.split(\';\');\n    for(let i = 0; i <ca.length; i++) {\n      let c = ca[i];\n      while (c.charAt(0) == \' \') {\n        c = c.substring(1);\n      }\n      if (c.indexOf(name) == 0) {\n        return c.substring(name.length, c.length);\n      }\n    }\n    return "";\n  }\n\n//removed because innerHTML is throwing errors on some pages 3/3/25\n/*\nfunction checkIfBtnTextExists(btnTextValue) {\n    return document.getElementsByClassName("cds-cta cds-cta-lg cds-cta-primary cds-cta-priority")[0].innerHTML == btnTextValue;\n}\nconst btnTextStatus = checkIfBtnTextExists(\'See My Offers\');\n\nif (btnTextStatus == true){\n    let buttonbtnId = document.getElementsByClassName("cds-cta cds-cta-lg cds-cta-primary cds-cta-priority")[0];\n    buttonbtnId.addEventListener("click", e => {\n        bt(\'track\', \'prequal_see_offers_button\', view_data);\n        console.log(\'ZMP: See Offers Button click\');\n\n    })\n}\n*/\n\nbt(\'track\', \'viewed\', view_data);\n\n//translet SY cookie to numeric ID\nfunction murmurhash3(key, seed = 0) {\n      let h1 = seed;\n      let remainder = key.length & 3; // key.length % 4\n      let bytes = key.length - remainder;\n \n      for (let i = 0; i < bytes; i += 4) {\n        let k1 = (key.charCodeAt(i) & 0xff) |\n                 ((key.charCodeAt(i + 1) & 0xff) << 8) |\n                 ((key.charCodeAt(i + 2) & 0xff) << 16) |\n                 ((key.charCodeAt(i + 3) & 0xff) << 24);\n        k1 = Math.imul(k1, 0xcc9e2d51);\n        k1 = (k1 << 15) | (k1 >>> 17);\n        k1 = Math.imul(k1, 0x1b873593);\n        h1 ^= k1;\n        h1 = (h1 << 13) | (h1 >>> 19);\n        h1 = Math.imul(h1, 5) + 0xe6546b64;\n      }\n \n      let k1 = 0;\n      if (remainder > 0) {\n        for (let i = bytes; i < key.length; i++) {\n          k1 ^= key.charCodeAt(i) << ((i - bytes) * 8);\n        }\n        k1 = Math.imul(k1, 0xcc9e2d51);\n        k1 = (k1 << 15) | (k1 >>> 17);\n        k1 = Math.imul(k1, 0x1b873593);\n        h1 ^= k1;\n      }\n \n      h1 ^= key.length;\n      h1 ^= h1 >>> 16;\n      h1 = Math.imul(h1, 0x85ebca6b);\n      h1 ^= h1 >>> 13;\n      h1 = Math.imul(h1, 0xc2b2ae35);\n      h1 ^= h1 >>> 16;\n \n      return h1 >>> 0; // Convert to unsigned 32-bit integer\n    }\n \n \nfunction byteArrayToLong(barray) {\n  if (barray.length !== 8) {\n    throw new Error("The byte array must be 8 bytes long");\n  }\n \n  let longValue = 0n; // Use BigInt to handle 64-bit numbers\n  for (let i = 0; i < 8; i++) {\n    longValue = (longValue << 8n) | BigInt(barray[i] & 0xFF);\n  }\n \n  return longValue;\n}\n \n//get the RF cookie ID from the 1st party cookie.  This is the SY cookie \nvar SY_cookie  = getCookieByName(\'RFXPUID\'); \nconst id = decodeURIComponent(SY_cookie); //URL decode the SY cookie\nconsole.info(\'ZMP: RF cookie = \' + id);\n \n// Extract the substring by removing "SY-00" and the last 3 characters\nconst uuid = id.substring("SY-00".length, id.length - 3);\n\nconsole.info(\'ZMP: uuid = \' + uuid);\n \n// Decode the Base64 string into a byte array\nconst barray = Uint8Array.from(atob(uuid), char => char.charCodeAt(0));\n//const barray = Uint8Array.from(decodeURI(uuid), char => char.charCodeAt(0));\nconsole.info(\'ZMP: barray = \' + barray);\n \nconst ret = byteArrayToLong(barray);\nconsole.log(ret.toString());\nvar converted_cookie = murmurhash3(ret.toString()); //convert the SY cookie to a numeric cookie value\nconsole.info(ret.toString());\n\n\nconsole.info(\'ZMP: update user event - user_id = \' + ret.toString());\nbt(\'updateUser\',{"user_id":ret.toString()}); })();'; document.body.appendChild(s);







})();