Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
'use strict';
!function(modules) {
/**
* @param {number} moduleId
* @return {?}
*/
function __webpack_require__(moduleId) {
if (installedModules[moduleId]) {
return installedModules[moduleId].exports;
}
var module = installedModules[moduleId] = {
i : moduleId,
l : false,
exports : {}
};
return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.l = true, module.exports;
}
var installedModules = {};
__webpack_require__.m = modules;
__webpack_require__.c = installedModules;
/**
* @param {!Function} exports
* @param {string} name
* @param {!Function} getter
* @return {undefined}
*/
__webpack_require__.d = function(exports, name, getter) {
if (!__webpack_require__.o(exports, name)) {
Object.defineProperty(exports, name, {
configurable : false,
enumerable : true,
get : getter
});
}
};
/**
* @param {!Object} module
* @return {?}
*/
__webpack_require__.n = function(module) {
/** @type {function(): ?} */
var getter = module && module.__esModule ? function() {
return module.default;
} : function() {
return module;
};
return __webpack_require__.d(getter, "a", getter), getter;
};
/**
* @param {!Function} e
* @param {string} key
* @return {?}
*/
__webpack_require__.o = function(e, key) {
return Object.prototype.hasOwnProperty.call(e, key);
};
/** @type {string} */
__webpack_require__.p = "https://js.intercomcdn.com/";
__webpack_require__(__webpack_require__.s = 315);
}({
315 : function(module, object, instantiate) {
module.exports = instantiate(316);
},
316 : function(isContact, str, unescape) {
var rawUrl = unescape(317);
var byteString = unescape(318);
var i = byteString.addTurbolinksEventListeners;
/** @type {string} */
var name = "Intercom";
/** @type {!RegExp} */
var FIREFOX_LINUX = /bot|googlebot|crawler|spider|robot|crawling/i;
/**
* @return {?}
*/
var notifyAttributes = function() {
return window[name] && window[name].booted;
};
/**
* @return {?}
*/
var writeTime = function() {
return window[name].booted = true;
};
/**
* @return {?}
*/
var contentLoaded = function() {
return "attachEvent" in window && !window.addEventListener;
};
/**
* @return {?}
*/
var factory = function() {
return navigator && navigator.userAgent && /MSIE 9\.0/.test(navigator.userAgent) && window.addEventListener && !window.atob;
};
/**
* @return {?}
*/
var init = function() {
return "onpropertychange" in document && !!window.matchMedia && /MSIE 10\.0/.test(navigator.userAgent);
};
/**
* @return {?}
*/
var detectBrowserEngine = function() {
return navigator && navigator.userAgent && FIREFOX_LINUX.test(navigator.userAgent);
};
/**
* @return {?}
*/
var updateDevicesAfterDelay = function() {
return window.isIntercomMessengerSheet;
};
/**
* @return {?}
*/
var loadScriptAsync = function() {
/** @type {!Element} */
var script = document.createElement("script");
return script.type = "text/javascript", script.charset = "utf-8", script.src = rawUrl, script;
};
/**
* @return {?}
*/
var test = function() {
/** @type {(Element|null)} */
var args = document.querySelector('meta[name="referrer"]');
/** @type {string} */
var e = args ? '<meta name="referrer" content="' + args.content + '">' : "";
/** @type {!Element} */
var result = document.createElement("iframe");
/** @type {string} */
result.id = "intercom-frame";
/** @type {string} */
result.style.display = "none";
document.body.appendChild(result);
result.contentWindow.document.open("text/html", "replace");
result.contentWindow.document.write("\n <!doctype html>\n <head>\n " + e + "\n </head>\n <body>\n </body>\n </html>");
result.contentWindow.document.close();
var value = loadScriptAsync();
return result.contentWindow.document.head.appendChild(value), result;
};
/**
* @return {undefined}
*/
var f = function() {
/** @type {(Element|null)} */
var div2 = document.getElementById("intercom-frame");
if (div2 && div2.parentNode) {
div2.parentNode.removeChild(div2);
}
};
/**
* @return {undefined}
*/
var write = function() {
if (!window[name]) {
/**
* @return {undefined}
*/
var query = function update() {
/** @type {number} */
var _len8 = arguments.length;
/** @type {!Array} */
var args = Array(_len8);
/** @type {number} */
var _key8 = 0;
for (; _key8 < _len8; _key8++) {
args[_key8] = arguments[_key8];
}
update.q.push(args);
};
/** @type {!Array} */
query.q = [];
/** @type {function(): undefined} */
window[name] = query;
}
};
/**
* @return {undefined}
*/
var getCalibratedMagValue = function() {
delete window[name];
};
/**
* @return {undefined}
*/
var value = function() {
if (!notifyAttributes()) {
write();
test();
writeTime();
}
};
/**
* @return {undefined}
*/
var handleMessage = function() {
window[name]("shutdown", false);
getCalibratedMagValue();
f();
write();
};
if (function() {
return !(contentLoaded() || factory() || init() || detectBrowserEngine() || updateDevicesAfterDelay());
}() && !notifyAttributes()) {
value();
i(value, f, handleMessage);
}
},
317 : function(module, layer, stored) {
/** @type {string} */
module.exports = stored.p + "frame.e687f397.js";
},
318 : function(module, data, urlPartConfig) {
/**
* @param {!Function} fn
* @param {!Function} el
* @param {!Function} callback
* @return {undefined}
*/
function addMultipleEventListeners(fn, el, callback) {
pipelets.forEach(function(e) {
document.addEventListener(e, fn);
});
related_node_ids.forEach(function(n) {
document.addEventListener(n, el);
});
trytes.forEach(function(n) {
document.addEventListener(n, callback);
});
}
/** @type {!Array} */
var trytes = ["turbolinks:visit", "page:before-change"];
/** @type {!Array} */
var related_node_ids = ["turbolinks:before-cache"];
/** @type {!Array} */
var pipelets = ["turbolinks:load", "page:change"];
module.exports = {
addTurbolinksEventListeners : addMultipleEventListeners
};
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.