Created
June 16, 2020 01:49
-
-
Save ryanshoover/fea1473dbcd25f1a1279915a7c1965bb to your computer and use it in GitHub Desktop.
Unminified Demandbase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
"undefined" == typeof window.console && (window.console = { log: function () {}, debug: function () {} }); | |
"undefined" == typeof JSON && (JSON = { stringify: function () {}, parse: function () {} }); | |
Array.prototype.indexOf || | |
(Array.prototype.indexOf = function (e) { | |
var t = this.length >>> 0, | |
n = Number(arguments[1]) || 0; | |
n = 0 > n ? Math.ceil(n) : Math.floor(n); | |
0 > n && (n += t); | |
for (; t > n; n++) if (n in this && this[n] === e) return n; | |
return -1; | |
}); | |
Array.isArray || | |
(Array.isArray = function (e) { | |
return "[object Array]" === Object.prototype.toString.call(e); | |
}); | |
"function" != typeof Object.assign && | |
(Object.assign = function (e, t) { | |
if (null == e) throw new TypeError("Cannot convert undefined or null to object"); | |
for (var n = Object(e), i = 1; i < arguments.length; i++) { | |
var o = arguments[i]; | |
if (null != o) for (var a in o) Object.prototype.hasOwnProperty.call(o, a) && (n[a] = o[a]); | |
} | |
return n; | |
}); | |
Object.keys || | |
(Object.keys = (function () { | |
var e = Object.prototype.hasOwnProperty, | |
t = !{ toString: null }.propertyIsEnumerable("toString"), | |
n = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], | |
i = n.length; | |
return function (o) { | |
if ("object" != typeof o && ("function" != typeof o || null === o)) throw new TypeError("Object.keys called on non-object"); | |
var a, | |
r, | |
s = []; | |
for (a in o) e.call(o, a) && s.push(a); | |
if (t) for (r = 0; i > r; r++) e.call(o, n[r]) && s.push(n[r]); | |
return s; | |
}; | |
})()); | |
Array.prototype.some || | |
(Array.prototype.some = function (e) { | |
if (null == this) throw new TypeError("Array.prototype.some called on null or undefined"); | |
if ("function" != typeof e) throw new TypeError(); | |
for (var t = Object(this), n = t.length >>> 0, i = arguments.length >= 2 ? arguments[1] : void 0, o = 0; n > o; o++) if (o in t && e.call(i, t[o], o, t)) return !0; | |
return !1; | |
}); | |
var __extends = | |
(this && this.__extends) || | |
(function () { | |
var e = | |
Object.setPrototypeOf || | |
({ __proto__: [] } instanceof Array && | |
function (e, t) { | |
e.__proto__ = t; | |
}) || | |
function (e, t) { | |
for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); | |
}; | |
return function (t, n) { | |
function i() { | |
this.constructor = t; | |
} | |
e(t, n); | |
t.prototype = null === n ? Object.create(n) : ((i.prototype = n.prototype), new i()); | |
}; | |
})(); | |
String.prototype.includes || | |
(String.prototype.includes = function (e, t) { | |
if (!e) return !1; | |
"number" != typeof t && (t = 0); | |
return t + e.length > this.length ? !1 : -1 !== this.indexOf(e, t); | |
}); | |
window.Demandbase = window.Demandbase || {}; | |
window.Demandbase.Config = window.Demandbase.Config || {}; | |
window.Demandbase.Config.hooks = window.Demandbase.Config.hooks || {}; | |
window.Demandbase.Config.ads = window.Demandbase.Config.ads || {}; | |
window.Demandbase.Config.analytics = window.Demandbase.Config.analytics || {}; | |
window.Demandbase.Config.tokens = window.Demandbase.Config.tokens || {}; | |
window.Demandbase.Config.forms = window.Demandbase.Config.forms || {}; | |
window.Demandbase.Config.SiteOptimization = window.Demandbase.Config.SiteOptimization || {}; | |
window.Demandbase.Connectors = window.Demandbase.Connectors || {}; | |
var Demandbase; | |
!(function (e) { | |
var t; | |
!(function (t) { | |
t.ads = window.Demandbase.Config.ads || {}; | |
t.analytics = window.Demandbase.Config.analytics || {}; | |
t.conditions = window.Demandbase.Config.conditions || {}; | |
t.content = window.Demandbase.Config.content || {}; | |
t.forms = window.Demandbase.Config.forms || {}; | |
t.segments = window.Demandbase.Config.segments || {}; | |
t.emptyWatchDefault = window.Demandbase.Config.emptyWatchDefault || null; | |
t.hooks = window.Demandbase.Config.hooks || {}; | |
t.isInIFrame = window.Demandbase.Config.isInIFrame || null; | |
t.key = window.Demandbase.Config.key || null; | |
t.logging = window.Demandbase.Config.logging || null; | |
t.nonCompanyDefault = window.Demandbase.Config.nonCompanyDefault || null; | |
t.nonWatchDefault = window.Demandbase.Config.nonWatchDefault || null; | |
t.testDomain = window.Demandbase.Config.testDomain || void 0; | |
t.testIp = window.Demandbase.Config.testIp || void 0; | |
t.tokens = window.Demandbase.Config.tokens || {}; | |
t.useTestDomain = window.Demandbase.Config.useTestDomain || !1; | |
t.useTestIp = window.Demandbase.Config.useTestIp || !1; | |
t.Advertising = window.Demandbase.Config.Advertising || {}; | |
t.AssetReporter = window.Demandbase.Config.AssetReporter || {}; | |
t.Content = window.Demandbase.Config.Content || {}; | |
t.ErrorReporter = window.Demandbase.Config.ErrorReporter || {}; | |
t.Forms = window.Demandbase.Config.Forms || {}; | |
t.Google_Analytics = window.Demandbase.Config.Google_Analytics || {}; | |
t.Google_TagManager = window.Demandbase.Config.Google_TagManager || {}; | |
t.IpApiModule = e.Config.IpApiModule || {}; | |
t.SiteOptimization = window.Demandbase.Config.SiteOptimization || {}; | |
t.EmailDomainReporter = window.Demandbase.Config.EmailDomainReporter || {}; | |
})((t = e.Config || (e.Config = {}))); | |
var n; | |
!(function (e) {})((n = e.Connectors || (e.Connectors = {}))); | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
e.version = "8.0.15"; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t; | |
!(function (e) { | |
var t; | |
!(function (e) { | |
function t(e) { | |
return "undefined" != typeof e.stacktrace || "undefined" != typeof e["opera#sourceloc"] ? this.parseOpera(e) : e.stack && e.stack.match(c) ? this.parseV8OrIE(e) : e.stack ? this.parseFFOrSafari(e) : void 0; | |
} | |
function n(e) { | |
if (-1 === e.indexOf(":")) return [e]; | |
var t = /(.+?)(?:\:(\d+))?(?:\:(\d+))?$/, | |
n = t.exec(e.replace(/[\(\)]/g, "")); | |
return [n[1], n[2] || void 0, n[3] || void 0]; | |
} | |
function i(e, t) { | |
void 0 === t && (t = 10); | |
return e ? parseInt(e, t) : void 0; | |
} | |
function o(e) { | |
var t = e.stack.split("\n").filter(function (e) { | |
return !!e.match(c); | |
}, this); | |
return t.map(function (e) { | |
e.indexOf("(eval ") > -1 && (e = e.replace(/eval code/g, "eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g, "")); | |
var t = e | |
.replace(/^\s+/, "") | |
.replace(/\(eval code/g, "(") | |
.split(/\s+/) | |
.slice(1), | |
n = this.extractLocation(t.pop()), | |
i = t.join(" ") || void 0, | |
o = ["eval", "<anonymous>"].indexOf(n[0]) > -1 ? void 0 : n[0]; | |
return { function: i, file: o, line: this._parseInt(n[1]), column: this._parseInt(n[2]) }; | |
}, this); | |
} | |
function a(e) { | |
var t = e.stack.split("\n").filter(function (e) { | |
return !e.match(g); | |
}, this); | |
return t.map(function (e) { | |
e.indexOf(" > eval") > -1 && (e = e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g, ":$1")); | |
if (-1 === e.indexOf("@") && -1 === e.indexOf(":")) return { function: e }; | |
var t = e.split("@"), | |
n = this.extractLocation(t.pop()), | |
i = t.join("@") || void 0; | |
return { function: i, file: n[0], line: this._parseInt(n[1]), column: this._parseInt(n[2]) }; | |
}, this); | |
} | |
function r(e) { | |
return !e.stacktrace || (e.message.indexOf("\n") > -1 && e.message.split("\n").length > e.stacktrace.split("\n").length) ? this.parseOpera9(e) : e.stack ? this.parseOpera11(e) : this.parseOpera10(e); | |
} | |
function s(e) { | |
for (var t = /Line (\d+).*script (?:in )?(\S+)/i, n = e.message.split("\n"), i = [], o = 2, a = n.length; a > o; o += 2) { | |
var r = t.exec(n[o]); | |
r && i.push({ file: r[2], line: this._parseInt(r[1]) }); | |
} | |
return i; | |
} | |
function l(e) { | |
for (var t = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, n = e.stacktrace.split("\n"), i = [], o = 0, a = n.length; a > o; o += 2) { | |
var r = t.exec(n[o]); | |
r && i.push({ function: r[3] || void 0, file: r[2], line: this._parseInt(r[1]) }); | |
} | |
return i; | |
} | |
function d(e) { | |
var t = e.stack.split("\n").filter(function (e) { | |
return !!e.match(u) && !e.match(/^Error created at/); | |
}, this); | |
return t.map(function (e) { | |
var t, | |
n = e.split("@"), | |
i = this.extractLocation(n.pop()), | |
o = n.shift() || "", | |
a = o.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^\)]*\)/g, "") || void 0; | |
o.match(/\(([^\)]*)\)/) && (t = o.replace(/^[^\(]+\(([^\)]*)\)$/, "$1")); | |
void 0 === t || "[arguments not available]" === t ? void 0 : t.split(","); | |
return { function: a, file: i[0], line: this._parseInt(i[1]), column: this._parseInt(i[2]) }; | |
}, this); | |
} | |
var u = /(^|@)\S+\:\d+/, | |
c = /^\s*at .*(\S+\:\d+|\(native\))/m, | |
g = /^(eval@)?(\[native code\])?$/; | |
e.parse = t; | |
e.extractLocation = n; | |
e._parseInt = i; | |
e.parseV8OrIE = o; | |
e.parseFFOrSafari = a; | |
e.parseOpera = r; | |
e.parseOpera9 = s; | |
e.parseOpera10 = l; | |
e.parseOpera11 = d; | |
})((t = e.ErrorStackParser || (e.ErrorStackParser = {}))); | |
})((t = e.Utilities || (e.Utilities = {}))); | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t; | |
!(function (t) { | |
var n; | |
!(function (n) { | |
function i(t) { | |
var n = { referrer: document.referrer, page: document.URL, page_title: document.title }; | |
if (e.Config.isInIFrame) | |
try { | |
n.page = window.top.document.URL; | |
n.referrer = window.top.document.referrer; | |
n.page_title = window.top.document.title; | |
} catch (i) { | |
n.page = document.referrer; | |
n.referrer = null; | |
n.page_title = "3rd Party iFrame"; | |
} | |
n = Object.assign(n, t); | |
return a(n); | |
} | |
function o(e, n) { | |
var o = e || t.Constants.URL_IP_API; | |
o += i(n); | |
return o; | |
} | |
function a(e) { | |
var t = "?"; | |
for (var n in e) e.hasOwnProperty(n) && void 0 !== e[n] && (t += n + "=" + encodeURIComponent(e[n]) + "&"); | |
t = t.substring(0, t.length - 1); | |
return t; | |
} | |
n.buildApiParamString = i; | |
n.buildApiUrl = o; | |
n.buildQueryString = a; | |
})((n = t.Api || (t.Api = {}))); | |
})((t = e.Utilities || (e.Utilities = {}))); | |
})(Demandbase || (Demandbase = {})); | |
!(function (e) { | |
e.Demandbase.utils = e.Demandbase.utils || {}; | |
Object.assign(e.Demandbase.utils, e.Demandbase.utils, { | |
buildApiParamString: Demandbase.Utilities.Api.buildApiParamString, | |
buildApiUrl: Demandbase.Utilities.Api.buildApiUrl, | |
buildQueryString: Demandbase.Utilities.Api.buildQueryString, | |
}); | |
})(window); | |
var Demandbase; | |
!(function (e) { | |
var t; | |
!(function (t) { | |
var n; | |
!(function (t) { | |
function n(n) { | |
for ( | |
var i = function (i) { | |
var o = t.callbackStack[i]; | |
e.ErrorReporter.wrap(function () { | |
o.call(e, n); | |
})(); | |
}, | |
o = 0; | |
o < t.callbackStack.length; | |
o++ | |
) | |
i(o); | |
} | |
function i(t) { | |
e.IpApi.CompanyProfile = e.Utilities.flatten(t); | |
this.callback(t); | |
} | |
function o(n) { | |
if (-1 === t.callbackStack.indexOf(n)) { | |
t.callbackStack.push(n); | |
e.IpApi.CompanyProfile && | |
e.ErrorReporter.wrap(function () { | |
n.call(e, e.IpApi.CompanyProfile); | |
})(); | |
} | |
} | |
t.callbackStack = []; | |
t.callback = n; | |
t.domScriptCallback = i; | |
t.registerCallback = o; | |
})((n = t.Callbacks || (t.Callbacks = {}))); | |
})((t = e.Utilities || (e.Utilities = {}))); | |
})(Demandbase || (Demandbase = {})); | |
!(function (e) { | |
e.Demandbase.utils = e.Demandbase.utils || {}; | |
Object.assign(e.Demandbase.utils, e.Demandbase.utils, { | |
callback: Demandbase.Utilities.Callbacks.callback.bind(Demandbase.Utilities.Callbacks), | |
registerCallback: Demandbase.Utilities.Callbacks.registerCallback.bind(Demandbase.Utilities.Callbacks), | |
}); | |
})(window); | |
var Demandbase; | |
!(function (e) { | |
var t; | |
!(function (t) { | |
var n; | |
!(function (t) { | |
t.QS_USE_TEST_DOMAIN = "db_useTestDomain"; | |
t.QS_QUERY_DOMAIN = "db_domain"; | |
t.QS_ENABLE_LOG = "db_logging"; | |
t.QS_PREVIEW_TOKEN = "db_preview_token"; | |
t.DFLT_NON_COMPANY = "(Non-Company Visitor)"; | |
t.DFLT_AW_EMPTY = "(AccountWatch Empty)"; | |
t.DFLT_NON_AW = "(Non-AccountWatch Visitor)"; | |
t.DFLT_EVENT_TYPE = "click"; | |
t.URL_IP_API = "api.company-target.com/api/v2/ip.json"; | |
t.URL_DOMAIN_API = "api.demandbase.com/api/v1/domain.json"; | |
t.URL_BW_AD_PIXEL = e.Config.tokens.URL_BW_AD_PIXEL || "match.prod.bidr.io/cookie-sync/demandbase"; | |
t.PARDOT_VISITOR_COOKIE_REGEX = /^visitor_id[\d]+$/; | |
t.NON_HUMAN_DEVICES = [/adsbot-google/i, /googlebot/i]; | |
t.URL_CURRENT = (function () { | |
var t = document.URL; | |
e.Config.isInIFrame && (t = document.referrer); | |
t = encodeURIComponent(t); | |
return t; | |
})(); | |
t.PROTOCOL = "https://"; | |
})((n = t.Constants || (t.Constants = {}))); | |
})((t = e.Utilities || (e.Utilities = {}))); | |
})(Demandbase || (Demandbase = {})); | |
!(function (e) { | |
e.Demandbase.utils = e.Demandbase.utils || {}; | |
Object.assign(e.Demandbase.utils, e.Demandbase.utils, { tokens: Demandbase.Utilities.Constants }); | |
})(window); | |
var Demandbase; | |
!(function (e) { | |
var t = (function () { | |
function t(t) { | |
void 0 === t && (t = {}); | |
this.name = t.name || ""; | |
this.modify = t.modify || null; | |
this.segments = t.segments || []; | |
this.url = t.url || []; | |
this.modify || | |
(this.modify = function () { | |
e.Utilities.Logging.log("DBContent: modify function not defined"); | |
}); | |
"string" == typeof this.segments && (this.segments = [this.segments]); | |
"string" == typeof this.url && (this.url = [this.url]); | |
} | |
t.prototype.run = function () { | |
var t = !1; | |
for (var n in this.url) | |
if (this.url.hasOwnProperty(n)) { | |
var i = this.url[n]; | |
e.Utilities.isCurrentPage(i) && (t = !0); | |
} | |
if (t) { | |
var o = !1; | |
for (var n in this.segments) | |
if (this.segments.hasOwnProperty(n)) { | |
var a = this.segments[n], | |
r = window.Demandbase.Segments[a]; | |
"undefined" != typeof r && r && (o = !0); | |
} | |
if (!o) { | |
e.Utilities.Logging.log("DBContent modify " + this.name + " not fired. Segment " + a); | |
return !1; | |
} | |
e.Utilities.Logging.log("DBContent: running modify function for: " + this.name); | |
this.modify.call(document); | |
return !0; | |
} | |
e.Utilities.Logging.log("DBContent modify " + this.name + " not fired. no URL match with: " + this.url); | |
return !1; | |
}; | |
return t; | |
})(); | |
e.DBContent = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t; | |
!(function (t) { | |
function n(t) { | |
if (!t) return !1; | |
var n = ["name", "segments", "pages", "modify"]; | |
if ("function" != typeof t.modify) { | |
e.Utilities.Logging.log("DBContentBuilder: invalid type in config."); | |
return !1; | |
} | |
for (var i = 0; i < n.length; i++) | |
if ("undefined" == typeof t[n[i]]) { | |
e.Utilities.Logging.log("DBContentBuilder: invalid config missing: " + n[i]); | |
return !1; | |
} | |
return !0; | |
} | |
function i(t) { | |
if (n(t)) { | |
"string" == typeof t.pages ? (t.url = [t.pages]) : (t.url = t.pages); | |
"string" == typeof t.segments && (t.segments = [t.segments]); | |
return new e.DBContent(t); | |
} | |
return null; | |
} | |
t.isValid = n; | |
t.build = i; | |
})((t = e.DBContentBuilder || (e.DBContentBuilder = {}))); | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t; | |
!(function (t) { | |
var n; | |
!(function (t) { | |
function n(t) { | |
var n = !0; | |
if (!o(t)) { | |
e.Utilities.Logging.log("Event not added."); | |
return !1; | |
} | |
var a = t.type || e.Utilities.Constants.DFLT_EVENT_TYPE, | |
r = t.elements, | |
s = r.constructor; | |
if (s !== HTMLCollection && s !== NodeList) return i(t.elements, a, t.listener); | |
for (var l in r) { | |
var d = !1; | |
if (r.hasOwnProperty(l)) { | |
d = i(r[l], a, t.listener); | |
if (!d) { | |
n = !1; | |
e.Utilities.Logging.log("Event not added to" + r[l]); | |
} | |
} | |
} | |
return n; | |
} | |
function i(t, n, i) { | |
if (!t) { | |
e.Utilities.Logging.log("Event not registered - invalid element/s."); | |
return null; | |
} | |
t.jquery && (t = t[0]); | |
e.Utilities.addEventListener(t, n, i); | |
e.Utilities.Logging.log("Event Listener bind to: " + t + " on event " + n); | |
return !0; | |
} | |
function o(t) { | |
for (var n = !1, i = ["elements", "listener"], o = t.elements || null, a = t.listener || null, r = 0; r < i.length; r++) | |
if ("undefined" == typeof t[i[r]] || !t[i[r]]) { | |
e.Utilities.Logging.log("Invalid Event object. Missing: " + i[r]); | |
return !1; | |
} | |
if ("function" != typeof a) { | |
e.Utilities.Logging.log('Invalid Event: "listener" must be a function. Got (' + a + ")"); | |
return !1; | |
} | |
o instanceof Node || | |
o instanceof NodeList || | |
o instanceof HTMLElement || | |
o instanceof HTMLCollection || | |
o instanceof Window || | |
o instanceof Document || | |
"function" == typeof o || | |
("undefined" != typeof window.Demandbase.jQuery && o instanceof window.Demandbase.jQuery) | |
? (n = !0) | |
: e.Utilities.Logging.log("Invalid Event: element: " + o + ' has type: "' + o.constructor + '" which is not proper instance type.'); | |
return n; | |
} | |
t.add = n; | |
t._attachListener = i; | |
t.isValid = o; | |
})((n = t.Events || (t.Events = {}))); | |
})((t = e.Utilities || (e.Utilities = {}))); | |
})(Demandbase || (Demandbase = {})); | |
!(function (e) { | |
e.Demandbase.utils = e.Demandbase.utils || {}; | |
Object.assign(e.Demandbase.utils, e.Demandbase.utils, { events: Demandbase.Utilities.Events }); | |
})(window); | |
var Demandbase; | |
!(function (e) { | |
var t; | |
!(function (t) { | |
var n; | |
!(function (t) { | |
function n(e) { | |
i(e); | |
} | |
function i(t) { | |
(e.Config.logging || "true" === e.Utilities.getQueryParam(e.Utilities.Constants.QS_ENABLE_LOG)) && console.log("DB: " + t); | |
} | |
t.logging = !1; | |
t.debug = !1; | |
t.alert = n; | |
t.log = i; | |
})((n = t.Logging || (t.Logging = {}))); | |
})((t = e.Utilities || (e.Utilities = {}))); | |
})(Demandbase || (Demandbase = {})); | |
!(function (e) { | |
e.Demandbase.utils = e.Demandbase.utils || {}; | |
Object.assign(e.Demandbase.utils, e.Demandbase.utils, { | |
logging: Demandbase.Utilities.Logging.logging, | |
debug: Demandbase.Utilities.Logging.debug, | |
alert: Demandbase.Utilities.Logging.alert.bind(Demandbase.Utilities.Logging), | |
log: Demandbase.Utilities.Logging.log.bind(Demandbase.Utilities.Logging), | |
}); | |
})(window); | |
var Demandbase; | |
!(function (e) { | |
var t; | |
!(function (t) { | |
function n(e, t) { | |
var n = {}; | |
t.cookie.split(";").forEach(function (t) { | |
var i = t.split("="), | |
o = i[0].trim(); | |
e.test(o) && i.length > 1 && (n[o] = i[1].trim()); | |
}); | |
return n; | |
} | |
function i(e, t, n) { | |
e.addEventListener ? e.addEventListener(t, n) : e.attachEvent && e.attachEvent(t, n); | |
} | |
function o() { | |
return window.top !== window.self; | |
} | |
function a(e) { | |
for (var t = [], n = 1; n < arguments.length; n++) t[n - 1] = arguments[n]; | |
for (var i = e, o = 0, a = t; o < a.length; o++) { | |
var r = a[o]; | |
if ("undefined" == typeof i) return; | |
i = "function" == typeof r ? r(i) : i[r]; | |
} | |
return i; | |
} | |
function r(e) { | |
for (var t in e) { | |
var n = e[t]; | |
if ("object" == typeof n && null !== n && e.hasOwnProperty(t)) { | |
for (var i in n) e[t + "_" + i] = n[i]; | |
delete e[t]; | |
} | |
} | |
return e; | |
} | |
function s(t, n) { | |
var i = { city: "registry_city", state: "registry_state", zip: "registry_zip_code", country: "registry_country_code", country_name: "registry_country", latitude: "registry_latitude", longitude: "registry_longitude" }, | |
o = e.Config.nonCompanyDefault || e.Utilities.Constants.DFLT_NON_COMPANY, | |
a = e.Config.emptyWatchDefault || e.Utilities.Constants.DFLT_AW_EMPTY, | |
r = i[n] || "", | |
s = t[n] || t[r] || o, | |
l = (t.company_name || o) !== o, | |
d = Object.keys(t).some(function (e) { | |
return 0 === e.indexOf("watch_list_"); | |
}); | |
if (t[n] === !1) return "false"; | |
if (-1 !== n.indexOf("watch_list_") && l) { | |
d || (a = e.Config.nonWatchDefault || e.Utilities.Constants.DFLT_NON_AW); | |
s = t[n] || a; | |
} | |
return s; | |
} | |
function l() { | |
return document.readyState; | |
} | |
function d(e) { | |
return document.getElementById(e) || document.getElementsByName(e)[0] || null; | |
} | |
function u(e, t) { | |
var t = t || window || { location: { search: "", hash: "" } }, | |
n = {}, | |
i = t.location.search.substring(1) || (t.location.hash && t.location.hash.split("?")[1]); | |
if (!i) return ""; | |
for (var o = i.split("&"), a = 0; a < o.length; a++) { | |
var r = o[a].split("="), | |
s = r[0], | |
l = r[1]; | |
n[s] = l; | |
} | |
return n[e] || ""; | |
} | |
function c(t, n) { | |
if (t) { | |
e._loadedScripts = e._loadedScripts || {}; | |
if (!e._loadedScripts[t]) { | |
e._loadedScripts[t] = !0; | |
var i = document.createElement("script"), | |
o = document.getElementsByTagName("script")[0]; | |
i.async = !0; | |
i.id = n || ""; | |
i.src = "https://" + t.replace(/(^\/\/)|(^http:\/\/)|(^https:\/\/)/, ""); | |
o.parentNode.insertBefore(i, o); | |
} | |
} | |
} | |
function g() { | |
try { | |
if (window.navigator.cookieEnabled) { | |
document.cookie = "COOKIE_TEST=TEST"; | |
if (-1 !== document.cookie.indexOf("COOKIE_TEST=TEST")) { | |
document.cookie = "COOKIE_TEST=PASSED_TEST"; | |
return !0; | |
} | |
} | |
return !1; | |
} catch (e) { | |
return !1; | |
} | |
} | |
function f(t) { | |
var n = document.location.href; | |
e.Config.isInIFrame && (n = document.referrer); | |
t && (n = t); | |
return n; | |
} | |
function m(e, t) { | |
function n(e) { | |
var t = "//"; | |
return 0 === e.indexOf(t) ? e.substring(t.length, e.length) : e.replace(/^.*?:\/\//g, ""); | |
} | |
function i(e) { | |
return e.replace(/^(www\.)/g, ""); | |
} | |
function o(e) { | |
var t = "/"; | |
-1 !== e.indexOf(r, e.length - r.length) && (e = e.substring(0, e.length - 1)); | |
-1 !== e.indexOf(t, e.length - t.length) && (e = e.substring(0, e.length - 1)); | |
return e; | |
} | |
var a = "?", | |
r = "#", | |
s = document.location.hash, | |
l = document.location.search, | |
d = f(t); | |
if (t) { | |
var u = t.indexOf(r); | |
-1 === u && (u = t.length); | |
s = t.substring(t.indexOf(r), t.length); | |
l = t.substring(t.indexOf(a), u); | |
d = t; | |
} | |
e = n(e); | |
e = i(e); | |
e = o(e); | |
d = n(d); | |
d = i(d); | |
d = o(d); | |
-1 === e.indexOf(r) && -1 !== d.indexOf(r) && (d = d.substring(0, d.length - s.length)); | |
-1 === e.indexOf(a) && -1 !== d.indexOf(a) && (d = d.substring(0, d.length - l.length)); | |
d = o(d); | |
return d === e; | |
} | |
function p(e, t) { | |
if (!e) return !1; | |
if (e.length <= 0) return !1; | |
"^" !== e[0] && (e = "^" + e); | |
var n = e.length - 1; | |
"$" !== e[n] && (e += "$"); | |
var i = f(t); | |
return new RegExp(e).test(i); | |
} | |
function h(e) { | |
try { | |
var t = window[e.toString()]; | |
t.setItem("STORAGE_CHECK", "STORAGE_CHECK"); | |
t.getItem("STORAGE_CHECK"); | |
t.removeItem("STORAGE_CHECK"); | |
return !0; | |
} catch (n) { | |
return !1; | |
} | |
} | |
function y() { | |
try { | |
return window.navigator.userAgent.indexOf("MSIE ") > 0; | |
} catch (e) { | |
return !0; | |
} | |
} | |
function b(e) { | |
return e ? "#" + e.replace(/(:|\.|\[|\]|,)/g, "\\$1") : null; | |
} | |
function v(e, t) { | |
for (var n = 0; n < t.length; n++) if (e.includes(t[n])) return !0; | |
return !1; | |
} | |
function _(e) { | |
var t = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
return t.test(e); | |
} | |
function w(e) { | |
return e.replace(/[.*+?^${}()|[\]\\\/]/g, "\\$&"); | |
} | |
function D(e) { | |
for (var t = [], n = 0; n < e.length; n++) t.push(e[n]); | |
return t; | |
} | |
function C(e) { | |
return btoa( | |
encodeURIComponent(e).replace(/%([0-9A-F]{2})/g, function (e, t) { | |
return String.fromCharCode(parseInt("0x" + t, 16)); | |
}) | |
); | |
} | |
function E(e, t) { | |
return e + " has been deprecated since version " + t; | |
} | |
t.getCookiesByRegex = n; | |
t.addEventListener = i; | |
t.detectIFrame = o; | |
t.dig = a; | |
t.flatten = r; | |
t.getAttributeValue = s; | |
t.getDocumentReadyState = l; | |
t.getElementByIdOrName = d; | |
t.getQueryParam = u; | |
t.insertScript = c; | |
t.isCookieEnabled = g; | |
t.isCurrentPage = m; | |
t.isCurrentPageRegex = p; | |
t.isStorageEnabled = h; | |
t.isOldBrowserOrUserAgentUnavailable = y; | |
t.jqid = b; | |
t.includesAny = v; | |
t.isValidEmail = _; | |
t.escapeRegExp = w; | |
t.nodeListToArray = D; | |
t.b64EncodeUnicode = C; | |
t.generateDeprecationMessage = E; | |
})((t = e.Utilities || (e.Utilities = {}))); | |
})(Demandbase || (Demandbase = {})); | |
!(function (e) { | |
e.Demandbase.utils = e.Demandbase.utils || {}; | |
Object.assign(e.Demandbase.utils, e.Demandbase.utils, Demandbase.Utilities); | |
Object.assign(e.Demandbase.utils, Demandbase.utils, { loadScript: Demandbase.Utilities.insertScript, flattenData: Demandbase.Utilities.flatten, getAttrValue: Demandbase.Utilities.getAttributeValue }); | |
})(window); | |
var Demandbase; | |
!(function (e) { | |
var t = (function () { | |
function t(e, t, n) { | |
this.config = e; | |
this.moduleNameToConstructorMap = t; | |
this.nameSpace = n; | |
} | |
t.prototype.build = function () { | |
this._parseConfig(); | |
}; | |
t.prototype._parseConfig = function () { | |
var t = this; | |
Object.keys(this.config).forEach(function (n) { | |
var i = t._testConfigForKey(n); | |
if (i && 3 === i.length) { | |
var o = i[1], | |
a = t.moduleNameToConstructorMap[o]; | |
if (t.nameSpace[n]) { | |
e.ErrorReporter.send(new Error("Failed to dynamically create configuration for " + n + " due to previously existing configuration with the same name.")); | |
return; | |
} | |
if (!a) { | |
e.ErrorReporter.send(new Error("No constructor available in moduleNameToConstructor map for module: " + o)); | |
return; | |
} | |
t.nameSpace[n] = new a(t.config[n]); | |
t.nameSpace[n].isEnabled() && t.nameSpace[n].initialize(); | |
} | |
}); | |
}; | |
t.prototype._testConfigForKey = function (e) { | |
return t.REGEX_CUSTOM_MODULE_NAME.exec(e); | |
}; | |
t.REGEX_CUSTOM_MODULE_NAME = /(.*)__(.*)/; | |
return t; | |
})(); | |
e.ModuleFactory = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function () { | |
function e() { | |
this.configuration = {}; | |
} | |
e.prototype.isEnabled = function () { | |
return this.configuration.enabled; | |
}; | |
e.prototype.mergeConfigs = function () { | |
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t]; | |
Object.assign.apply(Object, [this.configuration].concat(e)); | |
}; | |
return e; | |
})(); | |
e.BaseModule = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function (t) { | |
function n(n) { | |
var i = t.call(this) || this; | |
i.ADVERTISING_PIXEL_ID = "ad"; | |
i.CONVERSION_PIXEL_ID = "cn"; | |
i.RETARGETING_PIXEL_ID = "rt"; | |
i.DEFAULT_CONFIGURATION = { enabled: !0, key: null, reportingOnly: !1, enableBW: !0 }; | |
i.configuration = {}; | |
i.trackConversion = i.trackConversionListener; | |
i.load = i.initialize; | |
i.loadPixels = i.insertPixels; | |
i._loadPixel = i.insertPixel; | |
i._setCampaign = i.loadCampaign; | |
i._setEvents = i.registerEvents; | |
t.prototype.mergeConfigs.call(i, i.DEFAULT_CONFIGURATION, n ? n : e.Config.Advertising); | |
t.prototype.mergeConfigs.call(i, n ? n : e.Config.ads); | |
return i; | |
} | |
__extends(n, t); | |
n.prototype.initialize = function () { | |
this.insertPixels(); | |
this.configuration.reportingOnly === !0 && this.configuration.key && this.configuration.key !== e.Config.key && e.IpApiReportingOnly.get(this.configuration.key, !1); | |
}; | |
n.prototype.isConversionPage = function () { | |
throw new Error(e.Utilities.generateDeprecationMessage("AdvertisingModule.isConversionPage", "8.0.0")); | |
}; | |
n.prototype.insertPixels = function () { | |
this.configuration.enableBW && this.insertBWPixel(this.ADVERTISING_PIXEL_ID); | |
}; | |
n.prototype.createAndAppendPixel = function (e, t) { | |
var n = document.getElementsByTagName("body")[0] || document.getElementsByTagName("head")[0], | |
i = document.createElement("img"); | |
i.setAttribute("style", "display:none"); | |
i.setAttribute("alt", ""); | |
i.setAttribute("aria-hidden", "true"); | |
i.id = e; | |
i.src = t; | |
n.appendChild(i); | |
}; | |
n.prototype.insertBWPixel = function (t) { | |
var n = "db_bw_pixel_" + t, | |
i = e.Utilities.Constants.PROTOCOL + e.Utilities.Constants.URL_BW_AD_PIXEL; | |
this.createAndAppendPixel(n, i); | |
}; | |
n.prototype.insertPixel = function (t) { | |
throw new Error(e.Utilities.generateDeprecationMessage("AdvertisingModule.insertPixel", "8.0.0")); | |
}; | |
n.prototype.loadCampaign = function () { | |
throw new Error(e.Utilities.generateDeprecationMessage("AdvertisingModule.loadCampaign", "8.0.0")); | |
}; | |
n.prototype.registerEvents = function () { | |
throw new Error(e.Utilities.generateDeprecationMessage("AdvertisingModule.registerEvents", "8.0.0")); | |
}; | |
n.prototype.trackConversionListener = function () { | |
throw new Error(e.Utilities.generateDeprecationMessage("AdvertisingModule.trackConversionListener", "8.0.0")); | |
}; | |
n.prototype.virtualPageViewListener = function () { | |
throw new Error(e.Utilities.generateDeprecationMessage("AdvertisingModule.virtualPageViewListener", "8.0.0")); | |
}; | |
return n; | |
})(e.BaseModule); | |
e.AdvertisingModule = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function (t) { | |
function n(n) { | |
var i = t.call(this) || this; | |
i.DEFAULT_CONFIGURATION = { | |
enabled: !0, | |
assetList: [ | |
"api.demandbase.com/autocomplete/widget.js", | |
"api.demandbase.com/autocomplete/widget.min.js", | |
"autocomplete.demandbase.com/autocomplete/widget.js", | |
"autocomplete.demandbase.com/autocomplete/widget.min.js", | |
"scripts.demandbase.com/formWidget.js", | |
"scripts.demandbase.com/formWidgetDebug.js", | |
"scripts.demandbase.com/demandbase-sdk.js", | |
"scripts.demandbase.com/demandbase-sdk-debug.js", | |
"scripts.demandbase.com/forms.js", | |
"scripts.demandbase.com/forms.min.js", | |
], | |
}; | |
i.ERROR_MESSAGE_PREFIX = "Legacy Asset Detected: "; | |
i.configuration = {}; | |
i.values = {}; | |
t.prototype.mergeConfigs.call(i, i.DEFAULT_CONFIGURATION, n ? n : e.Config.AssetReporter); | |
return i; | |
} | |
__extends(n, t); | |
n.prototype.initialize = function () { | |
"complete" === e.Utilities.getDocumentReadyState() ? this.read() : e.Utilities.addEventListener(window, "load", e.ErrorReporter.wrap(this.read.bind(this))); | |
}; | |
n.prototype.read = function () { | |
for (var t = this.configuration.assetList.length, n = 0; t > n; n++) { | |
var i = this.configuration.assetList[n], | |
o = document.querySelector("script[src='" + e.Utilities.Constants.PROTOCOL + i + "']"); | |
if (o) { | |
this.values[i] = !0; | |
this.send(i); | |
} else this.values[i] = !1; | |
} | |
}; | |
n.prototype.send = function (t) { | |
var n = new Error(this.ERROR_MESSAGE_PREFIX + t); | |
e.ErrorReporter.send(n); | |
}; | |
return n; | |
})(e.BaseModule); | |
e.AssetReporterModule = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function (t) { | |
function n(n) { | |
var i = t.call(this) || this; | |
i.DEFAULT_CONFIGURATION = { enabled: !0 }; | |
i.configuration = {}; | |
i.mods = {}; | |
t.prototype.mergeConfigs.call(i, i.DEFAULT_CONFIGURATION, n ? n : e.Config.Content); | |
Object.assign(i.configuration, n ? n : e.Config.content); | |
return i; | |
} | |
__extends(n, t); | |
n.prototype.initialize = function () { | |
e.Utilities.Callbacks.registerCallback(this.callback.bind(this)); | |
this.setup(); | |
}; | |
n.prototype.callback = function () { | |
this.setup(); | |
this.modify(); | |
}; | |
n.prototype.setup = function () { | |
if ("undefined" != typeof e.Config.content) | |
for (var t in e.Config.content) { | |
var n = e.Config.content[t], | |
i = window.Demandbase.DBContentBuilder.build(n); | |
i && (this.mods[i.name] = i); | |
} | |
}; | |
n.prototype.modify = function () { | |
var t = this; | |
return e.ErrorReporter.wrap(function () { | |
var e = !1; | |
for (var n in t.mods) | |
if (t.mods.hasOwnProperty(n)) { | |
var i = t.mods[n], | |
o = i.run(); | |
o && (e = !0); | |
} | |
})(); | |
}; | |
return n; | |
})(e.BaseModule); | |
e.ContentModule = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function (t) { | |
function n(n) { | |
var i = t.call(this) || this; | |
i.DEFAULT_CONFIGURATION = { enabled: !0, formInputSelectors: ['input[type="text"]', 'input[type="email"]'], inputSearchTerms: ["email", "user", "login"] }; | |
i.configuration = {}; | |
i.baseUrl = "https://segments.company-target.com"; | |
i.activeSetTimeout = 0; | |
t.prototype.mergeConfigs.call(i, i.DEFAULT_CONFIGURATION, n ? n : e.Config.EmailDomainReporter); | |
return i; | |
} | |
__extends(n, t); | |
n.prototype.initialize = function () { | |
this.sendDataIfAlreadyPresent(); | |
this.attachListenersIfDocumentReady(); | |
}; | |
n.prototype.sendDataIfAlreadyPresent = function () { | |
var t = this, | |
n = this.suspectedEmailInputs(); | |
n.length < 1 || | |
n.forEach(function (n) { | |
var i = n.value; | |
if (e.Utilities.isValidEmail(i)) { | |
var o = i.split("@")[1].toLowerCase(); | |
t.send(o); | |
} | |
}); | |
}; | |
n.prototype.attachListenersIfDocumentReady = function () { | |
var t = this; | |
"loading" !== e.Utilities.getDocumentReadyState() | |
? this.suspectedEmailInputs().forEach(function (n) { | |
n.addEventListener("input", function () { | |
var i = n.value; | |
if (e.Utilities.isValidEmail(i)) { | |
var o = i.split("@")[1].toLowerCase(); | |
window.clearTimeout(t.activeSetTimeout); | |
t.activeSetTimeout = window.setTimeout(function () { | |
t.send(o); | |
}, 400); | |
} | |
}); | |
}) | |
: document.addEventListener("DOMContentLoaded", this.attachListenersIfDocumentReady.bind(this)); | |
}; | |
n.prototype.suspectedEmailInputs = function () { | |
var t = this, | |
n = e.Utilities.nodeListToArray(document.querySelectorAll(this.configuration.formInputSelectors.join(","))).map(function (e) { | |
return e; | |
}), | |
i = n.filter(function (n) { | |
var i = n.name.toLowerCase(), | |
o = n.id.toLowerCase(), | |
a = t.configuration.inputSearchTerms; | |
return e.Utilities.includesAny(i, a) ? !0 : e.Utilities.includesAny(o, a) ? !0 : !1; | |
}); | |
return i; | |
}; | |
n.prototype.send = function (t) { | |
var n; | |
window.XMLHttpRequest ? (n = new XMLHttpRequest()) : window.ActiveXObject && (n = new ActiveXObject("Microsoft.XMLHTTP")); | |
var i = e.Config.key || e.Utilities.dig(e.Config, "analytics", "key") || e.Utilities.dig(e.Config, "ads", "key") || e.Utilities.dig(e.Config, "forms", "key") || "", | |
o = e.Utilities.b64EncodeUnicode("vendor=mariposa&p1=" + t + "&token=" + i), | |
a = this.baseUrl + "/l/" + o; | |
try { | |
n.open("GET", a); | |
n.withCredentials = !0; | |
n.setRequestHeader("Content-type", "application/json"); | |
n.send(); | |
} catch (r) { | |
throw r; | |
} | |
}; | |
n.prototype.responseHandler = function (e) {}; | |
return n; | |
})(e.BaseModule); | |
e.EmailDomainReporterModule = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function (t) { | |
function n(n) { | |
var i = t.call(this) || this; | |
i.VERSION = "0.0.0"; | |
i.PROJECT_ID = "141580"; | |
i.PROJECT_KEY = "9a0a3519e930259f5886a7af53b0ccaa"; | |
i.SENTRY_PROJECT_ID = "1190150"; | |
i.SENTRY_PUBLIC_KEY = "3c9d467f8a9d4295b0f8320ae852091d"; | |
i.DEFAULT_CONFIGURATION = { environment: "production", ignorableErrors: [] }; | |
i.configuration = {}; | |
i.additionalErrorDetails = {}; | |
t.prototype.mergeConfigs.call(i, i.DEFAULT_CONFIGURATION, n ? n : e.Config.ErrorReporter); | |
return i; | |
} | |
__extends(n, t); | |
n.prototype.initialize = function () {}; | |
n.prototype.send = function (e) { | |
if (!(this.configuration.ignorableErrors.indexOf(e.name) > -1 || this.configuration.ignorableErrors.indexOf(e.message) > -1)) { | |
var t; | |
window.XMLHttpRequest ? (t = new XMLHttpRequest()) : window.ActiveXObject && (t = new ActiveXObject("Microsoft.XMLHTTP")); | |
var n = "https://sentry.io/api/" + this.SENTRY_PROJECT_ID + "/store/?sentry_version=7&sentry_key=" + this.SENTRY_PUBLIC_KEY; | |
try { | |
t.open("POST", n, !0); | |
t.setRequestHeader("Content-type", "text/plain;charset=UTF-8"); | |
t.send(this.formatMessage(e, !0)); | |
} catch (i) {} | |
} | |
}; | |
n.prototype.wrap = function (t) { | |
var n = this; | |
if ("function" != typeof t) throw new Error("Invalid Function: " + t); | |
return function () { | |
for (var i = [], o = 0; o < arguments.length; o++) i[o] = arguments[o]; | |
try { | |
if ("undefined" != typeof t && "function" == typeof t.apply) return t.apply(n, i); | |
} catch (a) { | |
n.send(a); | |
e.Utilities.Logging.alert("Error: " + a + "\n" + a.stack); | |
} | |
}; | |
}; | |
n.prototype.formatMessage = function (e, t) { | |
void 0 === t && (t = !1); | |
var n = this.parseError(e), | |
i = this.parseContext(), | |
o = this.parseEnviroment(), | |
a = this.parseSession(), | |
r = this.parseParams(), | |
s = this.additionalErrorDetails; | |
if (t) { | |
var l = this.formatErrorForSentry(n); | |
return JSON.stringify({ | |
logger: i.notifier.name, | |
platform: "javascript", | |
release: i.version, | |
environment: i.environment, | |
request: { url: i.url }, | |
contexts: { browser: { userAgent: i.userAgent } }, | |
tags: { clientId: o.config.clientId }, | |
extra: { readyState: i.readyState, config: o.config, companyProfile: a, additionalErrorDetails: s }, | |
exception: { values: [l] }, | |
}); | |
} | |
return JSON.stringify({ errors: [n], context: i, environment: o, session: a, params: r }); | |
}; | |
n.prototype.formatErrorForSentry = function (e) { | |
for (var t = [], n = 0, i = e.backtrace; n < i.length; n++) { | |
var o = i[n]; | |
t.push({ function: o["function"], filename: o.file, lineno: o.line, colno: o.column }); | |
} | |
return { type: e.type, value: e.message, stacktrace: { frames: t } }; | |
}; | |
n.prototype.parseError = function (t) { | |
return { type: t.name, message: t.message, backtrace: e.Utilities.ErrorStackParser.parse(t) }; | |
}; | |
n.prototype.parseContext = function () { | |
return { | |
notifier: { name: "ErrorReporterModule", version: this.VERSION }, | |
environment: this.configuration.environment, | |
version: e.version, | |
url: window.location.href, | |
userAgent: navigator.userAgent, | |
rootDirectory: window.location.origin, | |
readyState: document.readyState, | |
}; | |
}; | |
n.prototype.parseEnviroment = function () { | |
return { config: e.Utilities.dig(e, "Config") }; | |
}; | |
n.prototype.parseSession = function () { | |
return { companyProfile: e.Utilities.dig(e, "IP", "CompanyProfile") }; | |
}; | |
n.prototype.parseParams = function () { | |
return {}; | |
}; | |
return n; | |
})(e.BaseModule); | |
e.ErrorReporterModule = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function (t) { | |
function n(e) { | |
var n = t.call(this) || this; | |
n.FORMS_REMOTE_MODULE_URL = "tag.demandbase.com/shared/forms.min.js"; | |
n.DEFAULT_CONFIGURATION = { enabled: void 0, emailID: null, emailFields: [] }; | |
n.configuration = {}; | |
n.inserted = !1; | |
n.setConfiguration(e); | |
return n; | |
} | |
__extends(n, t); | |
n.prototype.initialize = function () { | |
e.Utilities.Callbacks.registerCallback(this.whenReady.bind(this)); | |
}; | |
n.prototype.whenReady = function () { | |
this.isMktoForms2Installed() ? window.MktoForms2.whenReady(e.ErrorReporter.wrap(this.load.bind(this))) : this.load(); | |
}; | |
n.prototype.load = function () { | |
var t = !1; | |
if ("function" == typeof e.Config.isFormPage) { | |
t = e.Config.isFormPage(); | |
this.setConfiguration(); | |
t = e.Config.isFormPage(); | |
} else t = this.isFormPage(); | |
t && !this.inserted && this.insertForms(); | |
}; | |
n.prototype.isFormPage = function () { | |
var t = this.configuration.emailFields; | |
this.configuration.emailID && t.push(this.configuration.emailID); | |
for (var n = 0; n < t.length; n++) if (e.Utilities.getElementByIdOrName(t[n])) return !0; | |
return !1; | |
}; | |
n.prototype.isMktoForms2Installed = function () { | |
return void 0 !== window.MktoForms2 && void 0 !== window.MktoForms2.whenReady; | |
}; | |
n.prototype.insertForms = function () { | |
this.inserted = !0; | |
e.Connectors.initWebForm = this.initializeWebForm; | |
e.Utilities.insertScript(e.FormsLoader.FORMS_REMOTE_MODULE_URL, "db_form_module"); | |
}; | |
n.prototype.initializeWebForm = function (t) { | |
t = t || e.Config.forms || e.Config.Forms || {}; | |
window.Demandbase.Connectors.WebForm.connect(t); | |
}; | |
n.prototype.setConfiguration = function (n) { | |
t.prototype.mergeConfigs.call(this, this.DEFAULT_CONFIGURATION, n ? n : e.Config.Forms); | |
void 0 === this.configuration.enabled && void 0 !== e.Config.Forms && (this.configuration.enabled = !0); | |
t.prototype.mergeConfigs.call(this, this.DEFAULT_CONFIGURATION, n ? n : e.Config.forms); | |
void 0 === this.configuration.enabled && void 0 !== e.Config.forms && (this.configuration.enabled = !0); | |
}; | |
return n; | |
})(e.BaseModule); | |
e.FormsLoaderModule = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function (t) { | |
function n(n) { | |
var i = t.call(this) || this; | |
i.SO_REMOTE_MODULE_URL = "https://tag.demandbase.com/shared/siteOptimization.min.js"; | |
i.REMOTE_STYLESHEET_URL = "https://tag.demandbase.com/shared/siteOptimization.css"; | |
i.DEFAULT_CONFIGURATION = { | |
additionalClass: null, | |
backgroundColorClass: null, | |
closedTitle: "Recommended Content", | |
companyProfile: null, | |
cssFileURL: i.REMOTE_STYLESHEET_URL, | |
delay: 0, | |
enabled: void 0, | |
fadeIn: 0, | |
fontColor: null, | |
fontName: null, | |
googleAnalyticsTrackerName: null, | |
isGoogleAnalyticsEnabled: !1, | |
isRippleAnimation: !0, | |
isSwitchersDots: !0, | |
isSwitchersArrows: !1, | |
itemBackgroundColor: null, | |
mainClass: "defaultBlock", | |
openByDefault: !1, | |
openTitle: null, | |
recommendationApiURL: "https://site-optimization-api.company-target.com/recommend/", | |
recommendationCompanyName: null, | |
recommendationCompanyId: null, | |
recommendationKey: null, | |
recommendationsProtocol: "forceHTTPS", | |
recommendationUrl: window.location.href, | |
showCloseButton: !0, | |
showCompanyName: !0, | |
showFeedbackLink: !1, | |
showIndicatorArrows: !0, | |
showLogo: !0, | |
showLogoWhenClosed: !0, | |
showLogoWhenOpen: !1, | |
showOnlyOnScroll: !1, | |
showTitleWhenClosed: !0, | |
showTitleWhenOpen: !0, | |
switcherArrowsColor: "#444", | |
state: { openedRecommendationBlock: null }, | |
widgetBackgroundColor: null, | |
widgetContainerId: null, | |
}; | |
i.configuration = {}; | |
i.inserted = !1; | |
t.prototype.mergeConfigs.call(i, i.DEFAULT_CONFIGURATION, n ? n : e.Config.SiteOptimization); | |
i.configuration.recommendationKey = e.Config.key; | |
return i; | |
} | |
__extends(n, t); | |
n.prototype.initialize = function () { | |
e.Utilities.Callbacks.registerCallback(this.callback.bind(this)); | |
}; | |
n.prototype.callback = function (e) { | |
this.configuration.companyProfile = e; | |
this.insertSiteOptimization(); | |
}; | |
n.prototype.insertSiteOptimization = function () { | |
this.inserted = !0; | |
e.Utilities.insertScript(e.SiteOptimizationLoader.SO_REMOTE_MODULE_URL, "db_site_optimization_module"); | |
}; | |
return n; | |
})(e.BaseModule); | |
e.SiteOptimizationLoaderModule = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function (t) { | |
function n(n) { | |
var i = t.call(this) || this; | |
i.DEFAULT_CONFIGURATION = { enabled: !0, events: null, fieldMap: null, googleAnalyticsClassicScope: 2, trackerName: null, trackerId: null }; | |
i.configuration = {}; | |
i.gType = ""; | |
i._cEvent = i.sendEvent; | |
t.prototype.mergeConfigs.call(i, i.DEFAULT_CONFIGURATION, n ? n : e.Config.Google_Analytics); | |
t.prototype.mergeConfigs.call(i, n ? n : e.Config.analytics); | |
return i; | |
} | |
__extends(n, t); | |
n.prototype.initialize = function () { | |
this._detectG(); | |
this._setTrackerName(); | |
this.configuration.fieldMap && "{}" !== JSON.stringify(this.configuration.fieldMap) && e.Utilities.Callbacks.registerCallback(this.callback.bind(this)); | |
this._setEvents(); | |
}; | |
n.prototype.sendEvent = function (t, n, i) { | |
"ga" === this.gType | |
? this._trackEvent(t, n, i) | |
: window.ga(function () { | |
e.Connectors.Google_Analytics._sendEvent(t, n, i); | |
}); | |
e.Utilities.Logging.log("Sent Custom Event:" + t + "/" + n + "/" + i); | |
}; | |
n.prototype.getTrackerInfo = function () { | |
var e = [], | |
t = []; | |
if ("undefined" != typeof window._gaq && "undefined" != typeof window._gat && "function" == typeof window._gat._getTrackers) { | |
var n = window._gat._getTrackers(); | |
n.forEach(function (t) { | |
t._getName().length > 0 && e.push({ type: "classic", trackerId: t._getAccount(), name: t._getName() }); | |
}); | |
} | |
if ("undefined" != typeof window.ga && "undefined" != typeof window.ga.getAll) { | |
var i = window.ga.getAll(); | |
i.forEach(function (e) { | |
t.push({ type: "universal", trackerId: e.get("trackingId"), name: e.get("name") }); | |
}); | |
} | |
return t.concat(e); | |
}; | |
n.prototype._setTrackerName = function () { | |
var e = this; | |
if (!this.configuration.trackerName) { | |
var t = "undefined" != typeof window.ga, | |
n = "undefined" != typeof window._gat && "function" == typeof window._gat._getTrackers; | |
if (n) { | |
var i = _gat._getTrackers(); | |
if ("undefined" != typeof i.length && i.length > 0) { | |
if (this.configuration.trackerId) | |
for (var o = 0; o < i.length; o++) | |
if (i[o]._getName().length > 0) { | |
var a = i[o]._getName(); | |
if (i[o]._getAccount() === this.configuration.trackerId && !this.configuration.trackerName) { | |
this.configuration.trackerName = a; | |
return; | |
} | |
} | |
var r = i[0] || null; | |
if (r && "function" == typeof r._getName) { | |
var s = r._getName() || null; | |
this.configuration.trackerName || (this.configuration.trackerName = s); | |
} | |
} | |
} | |
t && | |
window.ga(function () { | |
var t = window.ga.getAll() || []; | |
if (e.configuration.trackerId) | |
for (var n = 0; n < t.length; n++) { | |
var i = t[n], | |
o = i.get("name"); | |
if (i.get("trackingId") === e.configuration.trackerId) { | |
e.configuration.trackerName = o; | |
return; | |
} | |
} | |
if ("undefined" != typeof t.length && t.length > 0) { | |
var i = t[0] || null; | |
if (i && "function" == typeof i.get) { | |
var a = i.get("name") || null; | |
e.configuration.trackerName = a; | |
} | |
} | |
}); | |
} | |
}; | |
n.prototype.callback = function (t) { | |
try { | |
if (!t) throw new Error("Error - no data passed to callback"); | |
var n = e.Connectors.Google_Analytics; | |
n._detectG(); | |
n._setTrackerName(); | |
for (var i in n.configuration.fieldMap) | |
if (n.configuration.fieldMap.hasOwnProperty(i)) { | |
var o = +i, | |
a = n.configuration.fieldMap[i], | |
r = e.Utilities.getAttributeValue(t, a); | |
n._var(o, a, r.toString()); | |
} | |
n.sendEvent("Demandbase", "API Resolution", "IP API"); | |
} catch (s) { | |
e.Utilities.Logging.log("GA Error: " + s + "\n" + s.stack); | |
e.Connectors.Google_Analytics.sendEvent("Demandbase", "API Resolution", "Callback Error"); | |
} | |
}; | |
n.prototype._detectG = function () { | |
if (window._gaq) { | |
this.gType = "ga"; | |
_gaq.push(["_addDevId", "NE7T9"]); | |
} else this.gType = null; | |
this._setGaObject(); | |
try { | |
window.ga(function () { | |
e.Connectors.Google_Analytics.gType = "ua"; | |
}); | |
} catch (t) { | |
e.Connectors.Google_Analytics.gType = "ua"; | |
} | |
e.Utilities.Logging.log("Detected Google version: " + this.gType); | |
}; | |
n.prototype._sendEvent = function (e, t, n) { | |
var i = this.configuration.trackerName ? this.configuration.trackerName + ".send" : "send"; | |
window.ga(i, "event", { eventCategory: e, eventAction: t, eventLabel: n, nonInteraction: !0 }); | |
}; | |
n.prototype._setCustomDimension = function (e, t) { | |
var n = this.configuration.trackerName ? this.configuration.trackerName + ".set" : "set"; | |
window.ga(n, "dimension" + e, t); | |
}; | |
n.prototype._setCustomVariable = function (e, t, n) { | |
var i = this.configuration.trackerName ? this.configuration.trackerName + "._setCustomVar" : "_setCustomVar", | |
o = this.configuration.googleAnalyticsClassicScope || 2; | |
window._gaq.push([i, e >> 0, t, n, o]); | |
}; | |
n.prototype._setEvents = function () { | |
var t = this.configuration.events || []; | |
if (t) | |
for (var n in t) | |
if (t.hasOwnProperty(n)) { | |
var i = t[n]; | |
if (i.data) { | |
var o = i.data.category || "", | |
a = i.data.action || "", | |
r = i.data.label || ""; | |
"undefined" == typeof i.listener && o && a && r | |
? (i.listener = function () { | |
e.Connectors.Google_Analytics.sendEvent(o, a, r); | |
e.Utilities.Logging.log("Event listener ran"); | |
}) | |
: (o && a && r) || e.Utilities.Logging.log("Need to define a custom listener function or set data with category/action/label"); | |
} | |
e.Utilities.Events.add(i); | |
} | |
}; | |
n.prototype._setGaObject = function () { | |
if ("undefined" == typeof window.ga) { | |
window.ga = | |
window.ga || | |
function () { | |
(window.ga.q = window.ga.q || []).push(arguments); | |
}; | |
window.ga.l = +new Date(); | |
} | |
}; | |
n.prototype._trackEvent = function (e, t, n) { | |
var i = this.configuration.trackerName ? this.configuration.trackerName + "._trackEvent" : "_trackEvent"; | |
window._gaq.push([i, e, t, n, 0, 1]); | |
}; | |
n.prototype._var = function (t, n, i) { | |
"ga" === this.gType | |
? this._setCustomVariable(t, n, i) | |
: window.ga(function () { | |
e.Connectors.Google_Analytics._setCustomDimension(t, i); | |
}); | |
e.Utilities.Logging.log(t + " " + n + " : " + i); | |
}; | |
return n; | |
})(e.BaseModule); | |
e.Google_AnalyticsModule = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function (t) { | |
function n(n) { | |
var i = t.call(this) || this; | |
i.DEFAULT_CONFIGURATION = { enabled: !0 }; | |
i.configuration = {}; | |
t.prototype.mergeConfigs.call(i, i.DEFAULT_CONFIGURATION, n ? n : e.Config.Google_TagManager); | |
return i; | |
} | |
__extends(n, t); | |
n.prototype.initialize = function () { | |
e.Utilities.Callbacks.registerCallback(this.callback.bind(this)); | |
}; | |
n.prototype.callback = function (t) { | |
e.Connectors.Google_TagManager.pushToDataLayer(t); | |
}; | |
n.prototype.pushToDataLayer = function (t, n) { | |
if (!window.google_tag_manager || !window.dataLayer || "function" != typeof dataLayer.push) return !1; | |
var i = n ? "_" + n : ""; | |
dataLayer.push(t); | |
dataLayer.push({ event: "Demandbase_Loaded" + i }); | |
e.Utilities.Logging.log("Pushed to GTM dataLayer"); | |
return !0; | |
}; | |
return n; | |
})(e.BaseModule); | |
e.Google_TagManagerModule = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function (t) { | |
function n(n) { | |
var i = t.call(this) || this; | |
i.TEST_MODE_ENABLED = "db_useTestIp"; | |
i.TEST_MODE_VALUE = "db_ip"; | |
i.API_ENDPOINT = "api.company-target.com/api/v2/ip.json"; | |
i.DEFAULT_CONFIGURATION = { apiKey: null, baseUrl: i.API_ENDPOINT, testModeEnabled: !1, testModeValue: null, masIntegrations: { pardot: !1 }, enablePardotPolling: !0 }; | |
i.configuration = {}; | |
i.initialized = !1; | |
i.pollForPardotStart = 0; | |
i.pardotMaxPollWindow = 5e3; | |
i.key = i.configuration.apiKey; | |
i.useTestValue = i.configuration.testModeEnabled; | |
i.testValue = i.configuration.testModeValue; | |
i.load = i.get; | |
i._loadOnce = i.getOnce; | |
i.CompanyProfile = void 0; | |
i.isCalled = !1; | |
try { | |
t.prototype.mergeConfigs.call( | |
i, | |
i.DEFAULT_CONFIGURATION, | |
{ | |
apiKey: e.Config.key || e.Utilities.dig(e.Config, "analytics", "key") || e.Utilities.dig(e.Config, "ads", "key") || e.Utilities.dig(e.Config, "forms", "key"), | |
testModeEnabled: e.Utilities.getQueryParam(i.TEST_MODE_ENABLED) || e.Config.useTestIp, | |
testModeValue: e.Utilities.getQueryParam(i.TEST_MODE_VALUE) || e.Config.testIp, | |
}, | |
n ? n : e.Config.IpApiModule | |
); | |
i.initialized = !0; | |
} catch (o) { | |
i.initialized = !1; | |
} | |
return i; | |
} | |
__extends(n, t); | |
n.prototype.initialize = function () { | |
try { | |
Object.assign(this.configuration, this.configuration, { | |
apiKey: e.Config.key || e.Utilities.dig(e.Config, "analytics", "key") || e.Utilities.dig(e.Config, "ads", "key") || e.Utilities.dig(e.Config, "forms", "key"), | |
testModeEnabled: e.Utilities.getQueryParam(this.TEST_MODE_ENABLED) || e.Config.useTestIp, | |
testModeValue: e.Utilities.getQueryParam(this.TEST_MODE_VALUE) || e.Config.testIp, | |
}); | |
this.initialized = !0; | |
} catch (t) { | |
this.initialized = !1; | |
e.ErrorReporter.send(t); | |
} | |
}; | |
n.prototype.get = function (t, n) { | |
var i = this; | |
void 0 === t && (t = void 0); | |
void 0 === n && (n = !0); | |
this.initialized || this.initialize(); | |
var o; | |
window.XMLHttpRequest ? (o = new XMLHttpRequest()) : window.ActiveXObject && (o = new ActiveXObject("Microsoft.XMLHTTP")); | |
if (!o || e.Utilities.isOldBrowserOrUserAgentUnavailable()) { | |
this.getByDomScript(t, n); | |
return e.Utilities.Logging.log("IP API query via DOM tag"); | |
} | |
var a = { key: t || this.configuration.apiKey, query: this.fetchIpAddress(), mas_integrations: void 0, src: "tag" }, | |
r = e.Utilities.getQueryParam(e.Utilities.Constants.QS_PREVIEW_TOKEN); | |
r && (a.preview_token = r); | |
if (!a.key) return e.Utilities.Logging.log("IP API query cancelled - check auth key."); | |
var s = this.configuration.masIntegrations && this.configuration.masIntegrations.pardot; | |
s ? (a.mas_integrations = e.Utilities.b64EncodeUnicode(JSON.stringify({ pardot: this.fetchOrPollForPardotCookie() || {} }))) : e.Utilities.Logging.log("No Pardot integration in config, skipping cookie sync"); | |
n && | |
(o.onreadystatechange = e.ErrorReporter.wrap(function () { | |
i.responseHandler(o); | |
})); | |
try { | |
o.open("GET", "https://" + e.Utilities.Api.buildApiUrl(this.configuration.baseUrl, a)); | |
"undefined" != typeof o.withCredentials && (o.withCredentials = !0); | |
o.send(); | |
} catch (l) { | |
if (0 !== o.status) throw l; | |
if (!this.isIgnorableDevice()) throw new Error("IP API Request Blocked"); | |
} | |
}; | |
n.prototype.isIgnorableDevice = function () { | |
for (var t = 0; t < e.Utilities.Constants.NON_HUMAN_DEVICES.length; t++) if (e.Utilities.Constants.NON_HUMAN_DEVICES[t].test(window.navigator.userAgent)) return !0; | |
return !1; | |
}; | |
n.prototype.getByDomScript = function (t, n) { | |
void 0 === t && (t = void 0); | |
void 0 === n && (n = !0); | |
var i = { key: t || this.configuration.apiKey, query: this.fetchIpAddress(), callback: n ? "Demandbase.Utilities.Callbacks.domScriptCallback" : "" }; | |
if (!i.key) return e.Utilities.Logging.log("IP API query cancelled - check auth key."); | |
e.Utilities.insertScript(e.Utilities.Api.buildApiUrl(this.configuration.baseUrl, i), "db_ip_api"); | |
}; | |
n.prototype.getOnce = function () { | |
if (this.isCalled) e.Utilities.Logging.log("IP API call halted. Already called."); | |
else { | |
this.isCalled = !0; | |
this.get(); | |
} | |
}; | |
n.prototype.fetchIpAddress = function () { | |
return this.configuration.testModeEnabled ? this.configuration.testModeValue : void 0; | |
}; | |
n.prototype.responseHandler = function (t) { | |
if (4 === t.readyState && 200 === t.status) | |
try { | |
var n = JSON.parse(t.responseText); | |
this.CompanyProfile = e.Utilities.flatten(n); | |
e.Utilities.Callbacks.callback(this.CompanyProfile); | |
} catch (i) { | |
e.ErrorReporter.additionalErrorDetails = { status: t.status, readyState: t.readyState, url: t.responseURL, body: t.responseText }; | |
throw i; | |
} | |
}; | |
n.prototype.fetchOrPollForPardotCookie = function () { | |
var t = this.configuration.masIntegrations && this.configuration.masIntegrations.pardot; | |
if (t) { | |
var n = e.Utilities.getCookiesByRegex(e.Utilities.Constants.PARDOT_VISITOR_COOKIE_REGEX, document); | |
if ("object" == typeof n && Object.keys(n).length > 0) { | |
e.Utilities.Logging.log("Found Pardot cookie, including in API request"); | |
return n; | |
} | |
var i = this.configuration.enablePardotPolling && 0 === this.pollForPardotStart; | |
if (i !== !1) { | |
e.Utilities.Logging.log("Pardot cookie not found, initiating polling"); | |
this.pollForPardotCookie(); | |
} | |
} else e.Utilities.Logging.log("No Pardot integration in config, skipping cookie sync"); | |
}; | |
n.prototype.pollForPardotCookie = function () { | |
var t = this; | |
if (0 === this.pollForPardotStart) { | |
this.pollForPardotStart = Date.now(); | |
e.Utilities.Logging.log("Pardot cookie polling started at " + this.pollForPardotStart); | |
} | |
var n = Date.now() - this.pollForPardotStart, | |
i = n > this.pardotMaxPollWindow; | |
if (i) e.Utilities.Logging.log("Pardot cookie not found within " + this.pardotMaxPollWindow + " ms"); | |
else { | |
var o = this.fetchOrPollForPardotCookie(); | |
if (o) { | |
e.Utilities.Logging.log("Pardot cookie found, making second API call"); | |
this.get(void 0, !1); | |
} else | |
window.setTimeout(function () { | |
t.pollForPardotCookie(); | |
}, 100); | |
} | |
}; | |
return n; | |
})(e.BaseModule); | |
e.IpApiModule = t; | |
})(Demandbase || (Demandbase = {})); | |
var Demandbase; | |
!(function (e) { | |
var t = (function () { | |
function t() {} | |
t._callback = function (t) { | |
if (t.domain || t.person) { | |
t = t.domain || t.person; | |
e.Utilities.flatten(t); | |
this.CompanyProfile = t; | |
} else e.Utilities.Logging.log("Demandbase.Domain: No company profile available for domain: " + this.getDomain()); | |
}; | |
t.load = function () { | |
if ("function" == typeof e.Config.getDomain && void 0 !== this.key) { | |
var t = "", | |
n = {}; | |
t = this.useTestValue ? this.testValue : this.getDomain(); | |
n = { key: this.key, callback: "Demandbase.Domain._callback", query: t, src: "tag" }; | |
e.Utilities.Logging.log("Calling Domain API..."); | |
e.Utilities.insertScript(e.Utilities.Api.buildApiUrl(e.Utilities.Constants.URL_DOMAIN_API, n), "db_domain_api"); | |
} else e.Utilities.Logging.log("Domain API query cancelled - check auth key or Config.getDomain"); | |
}; | |
t.getDomain = function () { | |
if (this.useTestValue) return this.testValue; | |
if ("function" == typeof e.Config.getDomain) return e.Config.getDomain.call(e.Config); | |
e.Utilities.Logging.log("Warning: Config.getDomain fcn not defined."); | |
return "getDomain function is not defined"; | |
}; | |
t.key = e.Utilities.dig(e, "Config", "key") || e.Utilities.dig(e, "Config", "analytics", "key") || e.Utilities.dig(e, "Config", "ads", "key") || e.Utilities.dig(e, "Config", "forms", "key") || "ERR_NO_AUTH_KEY"; | |
t.CompanyProfile = null; | |
t.useTestValue = "true" === e.Utilities.getQueryParam(e.Utilities.Constants.QS_USE_TEST_DOMAIN) || e.Config.useTestDomain || !1; | |
t.testValue = e.Utilities.getQueryParam(e.Utilities.Constants.QS_QUERY_DOMAIN) || e.Config.testDomain || "No Test Domain Set"; | |
return t; | |
})(); | |
e.Domain = t; | |
})(Demandbase || (Demandbase = {})); | |
if ("undefined" == typeof window.__db) var __db = { segments: null, conditions: null }; | |
window.Demandbase.DBCondition = function (e, t, n, i, o) { | |
this.name = e; | |
this.attributeValue = t; | |
this.operator = n; | |
this.value = i; | |
this.attributeName = o; | |
this._checkValue = function (e) { | |
switch (n) { | |
case "equals": | |
return this.attributeValue == e; | |
case "not equals": | |
return this.attributeValue !== e; | |
case "contains": | |
return -1 !== this.attributeValue.indexOf(e); | |
default: | |
return !1; | |
} | |
}; | |
this.evaluate = function () { | |
n = this.operator.toLowerCase(); | |
n = window.Demandbase.DBCondition.prototype.supportedOperators[n]; | |
if ("object" == typeof this.value) { | |
for (var e in this.value) if (this._checkValue(this.value[e]) === !0) return !0; | |
return !1; | |
} | |
return this._checkValue(this.value); | |
}; | |
}; | |
window.Demandbase.DBCondition.prototype.name = "DBCondition"; | |
window.Demandbase.DBCondition.prototype.supportedOperators = { | |
"=": "equals", | |
"==": "equals", | |
equal: "equals", | |
equals: "equals", | |
"!=": "not equals", | |
"!==": "not equals", | |
"not equal": "not equals", | |
"not equals": "not equals", | |
contains: "contains", | |
contain: "contains", | |
}; | |
window.Demandbase.DBConditionBuilder = { | |
isValid: function (e) { | |
for (var t = ["name", "attributeValue", "operator", "value", "attributeName"], n = 0; n < t.length; n++) if ("undefined" == typeof e[t[n]]) return !1; | |
return !0; | |
}, | |
build: function (e, t) { | |
if (e && !e.name) return null; | |
if ("undefined" != typeof e.constructor.prototype.name && "DBCondition" === e.constructor.prototype.name) return e; | |
e.attributeName || (e.attributeName = e.attribute || "NO_ATTR_SET"); | |
e.attributeValue = t[e.attribute] || ""; | |
if (!this.isValid(e)) return null; | |
var n = e.name, | |
i = e.attributeValue, | |
o = e.operator, | |
a = e.value, | |
r = e.attributeName, | |
s = new window.Demandbase.DBCondition(n, i, o, a, r); | |
return s; | |
}, | |
}; | |
var DBSegment = function (e, t) { | |
this.name = e; | |
this.rules = []; | |
this.operator = ""; | |
this.addCondition = function (e) { | |
if (!((e && e.evaluate) || ("undefined" != typeof e.constructor.prototype.name && "DBCondition" === e.constructor.prototype.name))) { | |
var e = window.Demandbase.DBConditionBuilder.build(e, window.Demandbase.Segments.CompanyProfile); | |
if (!e) throw new Error("Invalid Condition: " + e.name); | |
Demandbase.Utilities.Logging.log("DBSegmentBuilder converted condition successfully..."); | |
} | |
this.rules.push(e); | |
var t = this.operator || DBSegment.prototype.supportedOperators.any; | |
switch (t) { | |
case "and": | |
return (this.value = this.value && e.evaluate()); | |
case "or": | |
return (this.value = this.value || e.evaluate()); | |
default: | |
return e.evaluate(); | |
} | |
}; | |
this.value = this.addCondition(t); | |
}; | |
DBSegment.prototype.name = "DBSegment"; | |
DBSegment.prototype.supportedOperators = { "&&": "and", "&": "and", and: "and", "||": "or", "|": "or", or: "or", any: "or", all: "and" }; | |
window.Demandbase.DBSegmentBuilder = { | |
isValid: function (e) { | |
for (var t = ["name", "operator", "rules"], n = 0; n < t.length; n++) if ("undefined" == typeof e[t[n]]) return !1; | |
return Array.isArray(e.rules) ? !0 : !1; | |
}, | |
build: function (e) { | |
if (!this.isValid(e)) return null; | |
var t, | |
n = e.name, | |
i = e.rules[0], | |
o = e.operator; | |
if (i) { | |
t = new DBSegment(n, i); | |
t.operator = DBSegment.prototype.supportedOperators[o] || DBSegment.prototype.supportedOperators.any; | |
if (e.rules.length > 1) | |
for (var a = 1; a < e.rules.length; a += 1) { | |
var i = e.rules[a]; | |
if ("undefined" == typeof i.constructor.prototype.name || "DBCondition" !== i.constructor.prototype.name) { | |
var r = window.Demandbase.DBConditionBuilder.build(i, void 0); | |
r && (i = r); | |
} | |
t.addCondition(i); | |
} | |
return t; | |
} | |
}, | |
}; | |
window.Demandbase.Segments = window.Demandbase.Segments || { | |
name: "Demandbase Segments", | |
CompanyProfile: null, | |
AccountWatchVisitor: !1, | |
IsCompany: !1, | |
version: "1.2.2", | |
_debug: !1, | |
_allConditions: [], | |
_allSegments: [], | |
_isInitialized: !1, | |
_setup: function () { | |
this._isInitialized && this._reset(); | |
this.CompanyProfile || (!window.Demandbase.IP && !window.Demandbase.Domain) || (this.CompanyProfile = window.Demandbase.IP.CompanyProfile || window.Demandbase.Domain.CompanyProfile || {}); | |
"Detailed" === this.CompanyProfile.information_level && (this.IsCompany = !0); | |
for (var e in this.CompanyProfile) this.CompanyProfile.hasOwnProperty(e) && 0 === e.indexOf("watch_list_") && (this.AccountWatchVisitor = !0); | |
for (var t in this._allConditions) | |
this._allConditions.hasOwnProperty(t) && | |
this._allConditions[t] && | |
("undefined" == typeof this._allConditions[t].constructor.prototype.name || "DBCondition" !== this._allConditions[t].constructor.prototype.name) && | |
this.add("condition", this._allConditions[t]); | |
for (var n in this._allSegments) | |
this._allSegments.hasOwnProperty(n) && | |
this._allSegments[n].name && | |
("undefined" == typeof this._allSegments[n].constructor.prototype.name || "DBSegment" !== this._allSegments[n].constructor.prototype.name) && | |
this.add("segment", this._allSegments[n]); | |
}, | |
_reset: function () { | |
this._allConditions = Demandbase.Config.conditions || __db.conditions || []; | |
this._allSegments = Demandbase.Config.segments || __db.segments || []; | |
}, | |
load: function () { | |
Demandbase.Utilities.Callbacks.registerCallback(this.init.bind(this)); | |
}, | |
init: function (e) { | |
window.Demandbase.Segments._debug = Demandbase.Utilities.Logging.debug || !1; | |
window.Demandbase.Segments._allConditions = Demandbase.Config.conditions || __db.conditions || []; | |
window.Demandbase.Segments._allSegments = Demandbase.Config.segments || __db.segments || []; | |
var t = window.Demandbase.Segments; | |
t.CompanyProfile = e; | |
t._setup(); | |
t._isInitialized = !0; | |
}, | |
getActiveSegments: function () { | |
var e = []; | |
for (var t in this._allSegments) this._allSegments.hasOwnProperty(t) && this._allSegments[t].value && e.push(this._allSegments[t]); | |
return e; | |
}, | |
getInactiveSegments: function () { | |
var e = []; | |
for (var t in this._allSegments) this._allSegments.hasOwnProperty(t) && (this._allSegments[t].value || e.push(this._allSegments[t])); | |
return e; | |
}, | |
add: function (e, t) { | |
if (!e || !t || t == {}) { | |
Demandbase.Utilities.Logging.log("Demandbase.Segments.add operation failed due to invalid/empty parameters."); | |
return null; | |
} | |
if ("condition" === e) { | |
for (var n, i = this._allConditions.length, o = 0; o < this._allConditions.length; o++) | |
if (this._allConditions[o].name === t.name) { | |
i = o; | |
break; | |
} | |
n = window.Demandbase.DBConditionBuilder.build(t, this.CompanyProfile); | |
n ? (this._allConditions[i] = n) : Demandbase.Utilities.Logging.log("Invalid Condition (not created) from: " + JSON.stringify(t)); | |
if ("undefined" == typeof t.standalone || t.standalone !== !1) { | |
var a = t.name; | |
this.add("segment", { name: a, rules: [a], operator: DBSegment.prototype.supportedOperators.any }); | |
} | |
} else if ("segment" === e) { | |
if ("segment" !== this.isValid(t)) return null; | |
for (var r, s, l = (t.name, this._allSegments.length), d = t.rules || [], u = 0; u < this._allSegments.length; u++) | |
if (this._allSegments[u].name === t.name) { | |
l = u; | |
break; | |
} | |
for (var c = 0; c < d.length; c++) { | |
var g = d[c]; | |
if (!DBSegment.prototype.supportedOperators[g]) { | |
DBSegment.prototype.supportedOperators[g] || (s = this.get("condition", g)); | |
s ? (d[c] = s) : Demandbase.Utilities.Logging.log("Segment: " + t + " uses a Condition (" + d[c] + ") that is not defined."); | |
} | |
} | |
t.rules = d; | |
r = window.Demandbase.DBSegmentBuilder.build(t); | |
if (r) { | |
this._allSegments[l] = r; | |
if (this.hasOwnProperty(r.name)) this[r.name] = r; | |
else | |
try { | |
Object.defineProperty(this, r.name, { value: r.value, writable: !0 }); | |
} catch (f) { | |
window.Demandbase.Segments[r.name] = r.value; | |
} | |
} else Demandbase.Utilities.Logging.log("Invalid Segment (not created) from: " + JSON.stringify(t)); | |
} else Demandbase.Utilities.Logging.log('Invalid "type" parameter (' + e + ') passed to "add" function. Must be "segment" or "condition".'); | |
}, | |
get: function (e, t) { | |
var n = []; | |
1 === arguments.length && (t = e); | |
if ("condition" === e) { | |
if ("undefined" != typeof t.constructor.prototype.name && "DBCondition" === t.constructor.prototype.name) return t; | |
n = this._allConditions; | |
} else { | |
if ("undefined" != typeof t.constructor.prototype.name && "DBSegment" === t.constructor.prototype.name) return t; | |
n = this._allSegments; | |
} | |
for (var i in n) if (this._allConditions[i].name === t) return this._allConditions[i]; | |
DBSegment.prototype.supportedOperators[t] || Demandbase.Utilities.Logging.log('No item with type: "' + e + '" found with name: ' + t); | |
return null; | |
}, | |
isValid: function (e) { | |
var t, | |
n = "condition", | |
i = "segment", | |
o = ["name", "rules"], | |
a = ["name", "attribute", "operator", "value"]; | |
if (!e) return !1; | |
if ("undefined" != typeof e.constructor.prototype.name && "DBSegment" === e.constructor.prototype.name) return i; | |
if ("undefined" != typeof e.constructor.prototype.name && "DBCondition" === e.constructor.prototype.name) return n; | |
try { | |
if (e.hasOwnProperty("name") && e.hasOwnProperty("rules")) { | |
if ("object" == typeof e.rules) return i; | |
} else | |
for (var r in o) | |
if (!e.hasOwnProperty(o[r])) { | |
Demandbase.Utilities.Logging.log('Invalid DBSegment definition. Missing property:"' + o[r] + '"'); | |
return !1; | |
} | |
if (t) return t; | |
for (var r in a) { | |
if (!e.hasOwnProperty(a[r])) { | |
Demandbase.Utilities.Logging.log('Invalid DBCondition definition. Missing property:"' + a[r] + '"'); | |
return !1; | |
} | |
t = n; | |
} | |
return t; | |
} catch (s) { | |
Demandbase.ErrorReporter.send(s); | |
return !1; | |
} | |
}, | |
}; | |
var Demandbase; | |
!(function (e) { | |
function t(t) { | |
if (!e._isInitialized || t) { | |
e._isInitialized = !0; | |
null == e.Config.isInIFrame && (e.Config.isInIFrame = e.Utilities.detectIFrame()); | |
e.AssetReporter = new e.AssetReporterModule(); | |
e.AssetReporter.isEnabled() && e.AssetReporter.initialize(); | |
e.Advertising = new e.AdvertisingModule(); | |
e.Ads = e.Advertising; | |
if (e.Advertising.isEnabled()) { | |
e.IpApiReportingOnly = new e.IpApiModule(); | |
e.Advertising.initialize(); | |
} | |
e.IpApi = new e.IpApiModule(); | |
e.IP = e.IpApi; | |
e.IpApi.getOnce(); | |
window.Demandbase.Segments.load(); | |
e.Config.callback && e.Utilities.Callbacks.registerCallback(e.Config.callback); | |
e.FormsLoader = new e.FormsLoaderModule(); | |
if (e.FormsLoader.isEnabled()) { | |
e.FormsLoader.initialize(); | |
window.Demandbase.utils.loadFormModule = e.FormsLoader.load.bind(e.FormsLoader); | |
window.Demandbase.utils.isFormPage = e.FormsLoader.isFormPage.bind(e.FormsLoader); | |
} | |
e.SiteOptimizationLoader = new e.SiteOptimizationLoaderModule(); | |
e.SiteOptimizationLoader.isEnabled() && e.SiteOptimizationLoader.initialize(); | |
e.Connectors.Google_Analytics = new e.Google_AnalyticsModule(); | |
e.Connectors.Google_Analytics.isEnabled() && e.Connectors.Google_Analytics.initialize(); | |
e.Connectors.Google_TagManager = new e.Google_TagManagerModule(); | |
e.Connectors.Google_TagManager.isEnabled() && e.Connectors.Google_TagManager.initialize(); | |
e.Content = new e.ContentModule(); | |
e.Content.isEnabled() && e.Content.initialize(); | |
if ("function" == typeof e.Config.getDomain) { | |
var n = e.Config.getDomain(); | |
n && e.Domain.load(); | |
} | |
e.EmailDomainReporter = new e.EmailDomainReporterModule(); | |
e.EmailDomainReporter.isEnabled() && e.EmailDomainReporter.initialize(); | |
var i = { Advertising: e.AdvertisingModule, AssetReporter: e.AssetReporterModule, Content: e.ContentModule, ErrorReporter: e.ErrorReporterModule, Google_Analytics: e.Google_AnalyticsModule }; | |
new e.ModuleFactory(e.Config, i, e).build(); | |
"function" == typeof e.Config.onLoad && e.Config.onLoad.call(e); | |
} | |
} | |
e.initialize = t; | |
})(Demandbase || (Demandbase = {})); | |
Demandbase.Config.Google_Analytics = { | |
fieldMap: { | |
5: "demandbase_sid", | |
9: "company_name", | |
10: "industry", | |
13: "sub_industry", | |
14: "employee_range", | |
18: "revenue_range", | |
11: "audience", | |
23: "audience_segment", | |
24: "city", | |
20: "country_name", | |
12: "watch_list_account_type", | |
25: "watch_list_account_owner", | |
26: "web_site", | |
19: "watch_list_account_region", | |
}, | |
}; | |
Demandbase.Config.forms = { | |
companyID: "NotACompany", | |
emailID: "email", | |
fieldMap: { | |
demandbase_sid: "demandbase_sid", | |
company_name: "db_company_name", | |
industry: "db_industry", | |
sub_industry: "db_sub_industry", | |
employee_range: "db_employee_range", | |
revenue_range: "db_revenue_range", | |
street_address: "db_street_address", | |
city: "db_city", | |
state: "db_state", | |
zip: "db_zip", | |
country: "db_country", | |
data_source: "db_data_source", | |
phone: "db_phone", | |
country_name: "db_country_name", | |
employee_count: "db_employee_count", | |
b2b: "db_b2b", | |
b2c: "db_b2c", | |
web_site: "db_web_site", | |
}, | |
}; | |
Demandbase.Config.onLoad = function () { | |
Demandbase.Config.loadFormModule(); | |
}; | |
Demandbase.Config.loadFormModule = function () { | |
function e() { | |
i++; | |
var o = Demandbase.Utilities.getElementByIdOrName("email"); | |
if ((o && "undefined" == typeof Demandbase.Connectors.WebForm && window.jQuery) || i === n) { | |
if (window.jQuery) { | |
window.Demandbase.client$ = window.$; | |
window.Demandbase.clientJQuery = window.jQuery.noConflict(!0); | |
} | |
Demandbase.utils.loadFormModule(); | |
clearTimeout(e); | |
} else n > i && setTimeout(e, t); | |
} | |
var t = 100, | |
n = 25, | |
i = 0; | |
e(); | |
}; | |
Demandbase.Config.clientId = "02de8088"; | |
Demandbase.Config.key = "8b4b10ca2b40379264274d10f7592303"; | |
Demandbase.Config.Advertising = { pixels: { ad: "15224404876937", rt: "1522440487461", cn: null } }; | |
Demandbase.ErrorReporter = new Demandbase.ErrorReporterModule(); | |
Demandbase.ErrorReporter.initialize(); | |
Demandbase.ErrorReporter.wrap(Demandbase.initialize.bind(Demandbase))(); | |
//# sourceMappingURL=02de8088.min.js.map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment