Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- var o = {};
- var self = {};
- var data = {
- id : "3faf3a47435cc512f3b86dc12af100d0",
- dm : ["zone.wooyun.org"],
- js : "tongji.baidu.com/hm-web/js/",
- etrk : [],
- icon : "/hmt/icon/21|gif|20|20",
- ctrk : true,
- align : 1,
- nv : -1,
- vdur : 18E5,
- age : 31536E6,
- rec : 0,
- rp : [],
- trust : 0,
- vcard : 0,
- qiao : 0,
- lxb : 0,
- conv : 0,
- apps : ""
- };
- /** @type {boolean} */
- var key = true;
- /** @type {null} */
- var NULL = null;
- /** @type {boolean} */
- var useCapture = false;
- self.g = {};
- /** @type {boolean} */
- self.g.wa = /msie (\d+\.\d+)/i.test(navigator.userAgent);
- /** @type {boolean} */
- self.g.cookieEnabled = navigator.cookieEnabled;
- /** @type {boolean} */
- self.g.javaEnabled = navigator.javaEnabled();
- self.g.language = navigator.language || (navigator.browserLanguage || (navigator.systemLanguage || (navigator.userLanguage || "")));
- /** @type {string} */
- self.g.ya = (window.screen.width || 0) + "x" + (window.screen.height || 0);
- /** @type {number} */
- self.g.colorDepth = window.screen.colorDepth || 0;
- self.cookie = {};
- /**
- * @param {string} name
- * @param {string} value
- * @param {Object} item
- * @return {undefined}
- */
- self.cookie.set = function(name, value, item) {
- var expires;
- if (item.F) {
- /** @type {Date} */
- expires = new Date;
- expires.setTime(expires.getTime() + item.F);
- }
- /** @type {string} */
- document.cookie = name + "=" + value + (item.domain ? "; domain=" + item.domain : "") + (item.path ? "; path=" + item.path : "") + (expires ? "; expires=" + expires.toGMTString() : "") + (item.Ka ? "; secure" : "");
- };
- /**
- * @param {string} name
- * @return {?}
- */
- self.cookie.get = function(name) {
- return(name = RegExp("(^| )" + name + "=([^;]*)(;|$)").exec(document.cookie)) ? name[2] : NULL;
- };
- self.r = {};
- /**
- * @param {?} opt_id
- * @return {?}
- */
- self.r.Da = function(opt_id) {
- return document.getElementById(opt_id);
- };
- /**
- * @param {Node} n
- * @return {?}
- */
- self.r.ia = function(n) {
- var inTag;
- /** @type {string} */
- inTag = "A";
- for (;(n = n.parentNode) && 1 == n.nodeType;) {
- if (n.tagName == inTag) {
- return n;
- }
- }
- return NULL;
- };
- /** @type {boolean} */
- (self.r.Ja = function() {
- /**
- * @return {undefined}
- */
- function ready() {
- if (!ready.w) {
- /** @type {boolean} */
- ready.w = key;
- /** @type {number} */
- var i = 0;
- /** @type {number} */
- var valuesLen = configList.length;
- for (;i < valuesLen;i++) {
- configList[i]();
- }
- }
- }
- /**
- * @return {undefined}
- */
- function scrollCheck() {
- try {
- document.documentElement.doScroll("left");
- } catch (d) {
- setTimeout(scrollCheck, 1);
- return;
- }
- ready();
- }
- /** @type {boolean} */
- var attrs = useCapture;
- /** @type {Array} */
- var configList = [];
- var contentLoaded;
- if (document.addEventListener) {
- /**
- * @return {undefined}
- */
- contentLoaded = function() {
- document.removeEventListener("DOMContentLoaded", contentLoaded, useCapture);
- ready();
- };
- } else {
- if (document.attachEvent) {
- /**
- * @return {undefined}
- */
- contentLoaded = function() {
- if ("complete" === document.readyState) {
- document.detachEvent("onreadystatechange", contentLoaded);
- ready();
- }
- };
- }
- }
- (function() {
- if (!attrs) {
- if (attrs = key, "complete" === document.readyState) {
- /** @type {boolean} */
- ready.w = key;
- } else {
- if (document.addEventListener) {
- document.addEventListener("DOMContentLoaded", contentLoaded, useCapture);
- window.addEventListener("load", ready, useCapture);
- } else {
- if (document.attachEvent) {
- document.attachEvent("onreadystatechange", contentLoaded);
- window.attachEvent("onload", ready);
- /** @type {boolean} */
- var d = useCapture;
- try {
- /** @type {boolean} */
- d = window.frameElement == NULL;
- } catch (m) {
- }
- if (document.documentElement.doScroll) {
- if (d) {
- scrollCheck();
- }
- }
- }
- }
- }
- }
- })();
- return function(name) {
- if (ready.w) {
- name();
- } else {
- configList.push(name);
- }
- };
- }()).w = useCapture;
- self.event = {};
- /**
- * @param {Object} element
- * @param {string} name
- * @param {Function} callback
- * @return {undefined}
- */
- self.event.d = function(element, name, callback) {
- if (element.attachEvent) {
- element.attachEvent("on" + name, function(operation) {
- callback.call(element, operation);
- });
- } else {
- if (element.addEventListener) {
- element.addEventListener(name, callback, useCapture);
- }
- }
- };
- /**
- * @param {Event} e
- * @return {undefined}
- */
- self.event.preventDefault = function(e) {
- if (e.preventDefault) {
- e.preventDefault();
- } else {
- /** @type {boolean} */
- e.returnValue = useCapture;
- }
- };
- self.o = {};
- /**
- * @return {?}
- */
- self.o.parse = function() {
- return(new Function('return (" + source + ")'))();
- };
- self.o.stringify = function() {
- /**
- * @param {string} string
- * @return {?}
- */
- function quote(string) {
- if (/["\\\x00-\x1f]/.test(string)) {
- string = string.replace(/["\\\x00-\x1f]/g, function(a) {
- var c = meta[a];
- if (c) {
- return c;
- }
- c = a.charCodeAt();
- return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
- });
- }
- return'"' + string + '"';
- }
- /**
- * @param {number} v
- * @return {?}
- */
- function _zeroPad(v) {
- return 10 > v ? "0" + v : v;
- }
- var meta = {
- "\b" : "\\b",
- "\t" : "\\t",
- "\n" : "\\n",
- "\f" : "\\f",
- "\r" : "\\r",
- '"' : '\\"',
- "\\" : "\\\\"
- };
- return function(value) {
- switch(typeof value) {
- case "undefined":
- return "undefined";
- case "number":
- return isFinite(value) ? String(value) : "null";
- case "string":
- return quote(value);
- case "boolean":
- return String(value);
- default:
- if (value === NULL) {
- return "null";
- }
- if (value instanceof Array) {
- /** @type {Array} */
- var buffer = ["["];
- /** @type {number} */
- var j = value.length;
- var tagNameArr;
- var i;
- var key;
- /** @type {number} */
- i = 0;
- for (;i < j;i++) {
- switch(key = value[i], typeof key) {
- case "undefined":
- ;
- case "function":
- ;
- case "unknown":
- break;
- default:
- if (tagNameArr) {
- buffer.push(",");
- }
- buffer.push(self.o.stringify(key));
- /** @type {number} */
- tagNameArr = 1;
- }
- }
- buffer.push("]");
- return buffer.join("");
- }
- if (value instanceof Date) {
- return'"' + value.getFullYear() + "-" + _zeroPad(value.getMonth() + 1) + "-" + _zeroPad(value.getDate()) + "T" + _zeroPad(value.getHours()) + ":" + _zeroPad(value.getMinutes()) + ":" + _zeroPad(value.getSeconds()) + '"';
- }
- /** @type {Array} */
- tagNameArr = ["{"];
- i = self.o.stringify;
- for (j in value) {
- if (Object.prototype.hasOwnProperty.call(value, j)) {
- switch(key = value[j], typeof key) {
- case "undefined":
- ;
- case "unknown":
- ;
- case "function":
- break;
- default:
- if (buffer) {
- tagNameArr.push(",");
- }
- /** @type {number} */
- buffer = 1;
- tagNameArr.push(i(j) + ":" + i(key));
- }
- }
- }
- tagNameArr.push("}");
- return tagNameArr.join("");
- }
- };
- }();
- self.lang = {};
- /**
- * @param {string} d
- * @param {string} name
- * @return {?}
- */
- self.lang.e = function(d, name) {
- return "[object " + name + "]" === {}.toString.call(d);
- };
- /**
- * @param {string} x
- * @return {?}
- */
- self.lang.Ga = function(x) {
- return self.lang.e(x, "Number") && isFinite(x);
- };
- /**
- * @param {string} next
- * @return {?}
- */
- self.lang.Ia = function(next) {
- return self.lang.e(next, "String");
- };
- self.localStorage = {};
- /**
- * @return {?}
- */
- self.localStorage.C = function() {
- if (!self.localStorage.f) {
- try {
- /** @type {Element} */
- self.localStorage.f = document.createElement("input");
- /** @type {string} */
- self.localStorage.f.type = "hidden";
- /** @type {string} */
- self.localStorage.f.style.display = "none";
- self.localStorage.f.addBehavior("#default#userData");
- document.getElementsByTagName("head")[0].appendChild(self.localStorage.f);
- } catch (a) {
- return useCapture;
- }
- }
- return key;
- };
- /**
- * @param {string} name
- * @param {string} value
- * @param {number} ms
- * @return {undefined}
- */
- self.localStorage.set = function(name, value, ms) {
- /** @type {Date} */
- var expires = new Date;
- expires.setTime(expires.getTime() + ms || 31536E6);
- try {
- if (window.localStorage) {
- /** @type {string} */
- value = expires.getTime() + "|" + value;
- window.localStorage.setItem(name, value);
- } else {
- if (self.localStorage.C()) {
- /** @type {string} */
- self.localStorage.f.expires = expires.toUTCString();
- self.localStorage.f.load(document.location.hostname);
- self.localStorage.f.setAttribute(name, value);
- self.localStorage.f.save(document.location.hostname);
- }
- }
- } catch (g) {
- }
- };
- /**
- * @param {string} name
- * @return {?}
- */
- self.localStorage.get = function(name) {
- if (window.localStorage) {
- if (name = window.localStorage.getItem(name)) {
- /** @type {number} */
- var indexOfEquals = name.indexOf("|");
- /** @type {number} */
- var delay = name.substring(0, indexOfEquals) - 0;
- if (delay && delay > (new Date).getTime()) {
- return name.substring(indexOfEquals + 1);
- }
- }
- } else {
- if (self.localStorage.C()) {
- try {
- return self.localStorage.f.load(document.location.hostname), self.localStorage.f.getAttribute(name);
- } catch (d) {
- }
- }
- }
- return NULL;
- };
- /**
- * @param {string} key
- * @return {undefined}
- */
- self.localStorage.remove = function(key) {
- if (window.localStorage) {
- window.localStorage.removeItem(key);
- } else {
- if (self.localStorage.C()) {
- try {
- self.localStorage.f.load(document.location.hostname);
- self.localStorage.f.removeAttribute(key);
- self.localStorage.f.save(document.location.hostname);
- } catch (b) {
- }
- }
- }
- };
- self.sessionStorage = {};
- /**
- * @param {string} name
- * @param {string} value
- * @return {undefined}
- */
- self.sessionStorage.set = function(name, value) {
- if (window.sessionStorage) {
- try {
- window.sessionStorage.setItem(name, value);
- } catch (f) {
- }
- }
- };
- /**
- * @param {string} opt_key
- * @return {?}
- */
- self.sessionStorage.get = function(opt_key) {
- return window.sessionStorage ? window.sessionStorage.getItem(opt_key) : NULL;
- };
- /**
- * @param {string} key
- * @return {undefined}
- */
- self.sessionStorage.remove = function(key) {
- if (window.sessionStorage) {
- window.sessionStorage.removeItem(key);
- }
- };
- self.M = {};
- /**
- * @param {string} url
- * @param {Function} done
- * @return {undefined}
- */
- self.M.log = function(url, done) {
- /** @type {Image} */
- var tmp = new Image;
- /** @type {string} */
- var id = "mini_tangram_log_" + Math.floor(2147483648 * Math.random()).toString(36);
- window[id] = tmp;
- /** @type {function (): undefined} */
- tmp.onload = tmp.onerror = tmp.onabort = function() {
- /** @type {null} */
- tmp.onload = tmp.onerror = tmp.onabort = NULL;
- /** @type {null} */
- tmp = window[id] = NULL;
- if (done) {
- done(url);
- }
- };
- /** @type {string} */
- tmp.src = url;
- };
- self.B = {};
- /**
- * @return {?}
- */
- self.B.pa = function() {
- /** @type {string} */
- var d = "";
- if (navigator.plugins && navigator.mimeTypes.length) {
- var flash = navigator.plugins["Shockwave Flash"];
- if (flash) {
- if (flash.description) {
- d = flash.description.replace(/^.*\s+(\S+)\s+\S+$/, "$1");
- }
- }
- } else {
- if (window.ActiveXObject) {
- try {
- if (flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) {
- if (d = flash.GetVariable("$version")) {
- d = d.replace(/^.*\s+(\d+),(\d+).*$/, "$1.$2");
- }
- }
- } catch (f) {
- }
- }
- }
- return d;
- };
- /**
- * @param {string} dataAndEvents
- * @param {string} v11
- * @param {string} deepDataAndEvents
- * @param {string} d
- * @param {string} classNames
- * @return {?}
- */
- self.B.ea = function(dataAndEvents, v11, deepDataAndEvents, d, classNames) {
- return'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="' + dataAndEvents + '" width="' + deepDataAndEvents + '" height="' + d + '"><param name="movie" value="' + v11 + '" /><param name="flashvars" value="' + (classNames || "") + '" /><param name="allowscriptaccess" value="always" /><embed type="application/x-shockwave-flash" name="' + dataAndEvents + '" width="' + deepDataAndEvents + '" height="' + d + '" src="' + v11 + '" flashvars="' + (classNames || "") + '" allowscriptaccess="always" /></object>';
- };
- self.url = {};
- /**
- * @param {string} s
- * @param {string} a
- * @return {?}
- */
- self.url.k = function(s, a) {
- var point = s.match(RegExp("(^|&|\\?|#)(" + a + ")=([^&#]*)(&|$|#)", ""));
- return point ? point[3] : NULL;
- };
- /**
- * @param {string} optionsString
- * @return {?}
- */
- self.url.Fa = function(optionsString) {
- return(optionsString = optionsString.match(/^(https?:)\/\//)) ? optionsString[1] : NULL;
- };
- /**
- * @param {string} s
- * @return {?}
- */
- self.url.ma = function(s) {
- return(s = s.match(/^(https?:\/\/)?([^\/\?#]*)/)) ? s[2].replace(/.*@/, "") : NULL;
- };
- /**
- * @param {string} mod
- * @return {?}
- */
- self.url.P = function(mod) {
- return(mod = self.url.ma(mod)) ? mod.replace(/:\d+$/, "") : mod;
- };
- /**
- * @param {string} raw
- * @return {?}
- */
- self.url.Ea = function(raw) {
- return(raw = raw.match(/^(https?:\/\/)?[^\/]*(.*)/)) ? raw[2].replace(/[\?#].*/, "").replace(/^$/, "/") : NULL;
- };
- o.q = {
- va : "http://tongji.baidu.com/hm-web/welcome/ico",
- K : "hm.baidu.com/hm.gif",
- Y : "baidu.com",
- sa : "hmmd",
- ta : "hmpl",
- ra : "hmkw",
- qa : "hmci",
- ua : "hmsr",
- l : 0,
- h : Math.round(+new Date / 1E3),
- protocol : "https:" == document.location.protocol ? "https:" : "http:",
- Ha : 0,
- ca : 6E5,
- da : 10,
- N : 1024,
- ba : 1,
- m : 2147483647,
- V : "cc cf ci ck cl cm cp cw ds ep et fl ja ln lo lt nv rnd si st su v cv lv api tt u".split(" ")
- };
- (function() {
- var obj = {
- j : {},
- /**
- * @param {Object} a
- * @param {Function} name
- * @return {undefined}
- */
- d : function(a, name) {
- this.j[a] = this.j[a] || [];
- this.j[a].push(name);
- },
- /**
- * @param {string} event
- * @param {?} p
- * @return {undefined}
- */
- s : function(event, p) {
- this.j[event] = this.j[event] || [];
- var valuesLen = this.j[event].length;
- /** @type {number} */
- var i = 0;
- for (;i < valuesLen;i++) {
- this.j[event][i](p);
- }
- }
- };
- return o.n = obj;
- })();
- (function() {
- /**
- * @param {string} url
- * @param {string} next
- * @return {undefined}
- */
- function load(url, next) {
- /** @type {Element} */
- var script = document.createElement("script");
- /** @type {string} */
- script.charset = "utf-8";
- if ($.e(next, "Function")) {
- if (script.readyState) {
- /**
- * @return {undefined}
- */
- script.onreadystatechange = function() {
- if ("loaded" === script.readyState || "complete" === script.readyState) {
- /** @type {null} */
- script.onreadystatechange = NULL;
- next();
- }
- };
- } else {
- /**
- * @return {undefined}
- */
- script.onload = function() {
- next();
- };
- }
- }
- /** @type {string} */
- script.src = url;
- var insertAt = document.getElementsByTagName("script")[0];
- insertAt.parentNode.insertBefore(script, insertAt);
- }
- var $ = self.lang;
- return o.load = load;
- })();
- (function() {
- var s = o.q;
- var ctx = self.B;
- var proto = {
- /**
- * @return {undefined}
- */
- init : function() {
- if ("" !== data.icon) {
- var c;
- /** @type {Array.<string>} */
- c = data.icon.split("|");
- /** @type {string} */
- var segmentAngle = s.va + "?s=" + data.id;
- /** @type {string} */
- var y = ("http:" == s.protocol ? "http://eiv" : "https://bs") + ".baidu.com" + c[0] + "." + c[1];
- switch(c[1]) {
- case "swf":
- c = ctx.ea("HolmesIcon" + s.h, y, c[2], c[3], "s=" + segmentAngle);
- break;
- case "gif":
- /** @type {string} */
- c = '<a href="' + segmentAngle + '" target="_blank"><img border="0" src="' + y + '" width="' + c[2] + '" height="' + c[3] + '"></a>';
- break;
- default:
- /** @type {string} */
- c = '<a href="' + segmentAngle + '" target="_blank">' + c[0] + "</a>";
- }
- document.write(c);
- }
- }
- };
- o.n.d("pv-b", proto.init);
- return proto;
- })();
- (function() {
- var r = self.r;
- var event = self.event;
- var len = self.g;
- var options = o.q;
- /** @type {Array} */
- var query = [];
- var w = {
- /**
- * @return {undefined}
- */
- W : function() {
- if (data.ctrk) {
- event.d(document, "mouseup", w.aa());
- event.d(window, "unload", function() {
- w.z();
- });
- setInterval(function() {
- w.z();
- }, options.ca);
- }
- },
- /**
- * @return {?}
- */
- aa : function() {
- return function(qualifier) {
- qualifier = w.ka(qualifier);
- if ("" !== qualifier) {
- var lineLength = (options.protocol + "//" + options.K + "?" + o.b.U().replace(/ep=[^&]*/, "ep=" + encodeURIComponent("[" + qualifier + "]"))).length;
- if (!(lineLength + (options.m + "").length > options.N)) {
- if (lineLength + encodeURIComponent(query.join(",") + (query.length ? "," : "")).length + (options.m + "").length > options.N) {
- w.z();
- }
- query.push(qualifier);
- if (query.length >= options.da || /t:a/.test(qualifier)) {
- w.z();
- }
- }
- }
- };
- },
- /**
- * @param {Object} event
- * @return {?}
- */
- ka : function(event) {
- if (0 === options.ba) {
- var e = event.target || event.srcElement;
- var x = e.tagName.toLowerCase();
- if ("embed" == x || "object" == x) {
- return "";
- }
- }
- if (len.wa) {
- /** @type {number} */
- e = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
- /** @type {number} */
- x = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
- x = event.clientX + x;
- e = event.clientY + e;
- } else {
- x = event.pageX;
- e = event.pageY;
- }
- /** @type {number} */
- var itemWidth = window.innerWidth || (document.documentElement.clientWidth || document.body.offsetWidth);
- switch(data.align) {
- case 1:
- x -= itemWidth / 2;
- break;
- case 2:
- x -= itemWidth;
- }
- /** @type {string} */
- x = "{x:" + x + ",y:" + e + ",";
- e = event.target || event.srcElement;
- return x = (event = "a" == e.tagName.toLowerCase() ? e : r.ia(e)) ? x + ("t:a,u:" + encodeURIComponent(event.href) + "}") : x + "t:b}";
- },
- /**
- * @return {undefined}
- */
- z : function() {
- if (0 !== query.length) {
- /** @type {number} */
- o.b.a.et = 2;
- /** @type {string} */
- o.b.a.ep = "[" + query.join(",") + "]";
- o.b.i();
- /** @type {Array} */
- query = [];
- }
- }
- };
- o.n.d("pv-b", w.W);
- return w;
- })();
- (function() {
- /**
- * @return {?}
- */
- function property() {
- return function() {
- /** @type {number} */
- o.b.a.nv = 0;
- /** @type {number} */
- o.b.a.st = 4;
- /** @type {number} */
- o.b.a.et = 3;
- /** @type {string} */
- o.b.a.ep = o.D.na() + "," + o.D.la();
- o.b.i();
- };
- }
- /**
- * @return {undefined}
- */
- function reset() {
- clearTimeout(timeoutId);
- var io;
- if (output) {
- /** @type {boolean} */
- io = "visible" == document[output];
- }
- if (hidden) {
- /** @type {boolean} */
- io = !document[hidden];
- }
- /** @type {boolean} */
- type = "undefined" == typeof io ? key : io;
- if ((!data || !options) && (type && listener)) {
- /** @type {boolean} */
- flagMsg = key;
- /** @type {number} */
- YYSTATE = +new Date;
- } else {
- if (data && (options && (!type || !listener))) {
- /** @type {boolean} */
- flagMsg = useCapture;
- msg += +new Date - YYSTATE;
- }
- }
- /** @type {boolean} */
- data = type;
- options = listener;
- /** @type {number} */
- timeoutId = setTimeout(reset, 100);
- }
- /**
- * @param {string} key
- * @return {?}
- */
- function prefix(key) {
- /** @type {HTMLDocument} */
- var t = document;
- /** @type {string} */
- var result = "";
- if (key in t) {
- /** @type {string} */
- result = key;
- } else {
- /** @type {Array} */
- var vendors = ["webkit", "ms", "moz", "o"];
- /** @type {number} */
- var i = 0;
- for (;i < vendors.length;i++) {
- var k = vendors[i] + key.charAt(0).toUpperCase() + key.slice(1);
- if (k in t) {
- result = k;
- break;
- }
- }
- }
- return result;
- }
- /**
- * @param {Event} options
- * @return {undefined}
- */
- function init(options) {
- if (!("focus" == options.type || "blur" == options.type) || !(options.target && options.target != window)) {
- /** @type {boolean} */
- listener = "focus" == options.type || "focusin" == options.type ? key : useCapture;
- reset();
- }
- }
- var event = self.event;
- var matrix = o.n;
- /** @type {boolean} */
- var data = key;
- /** @type {boolean} */
- var type = key;
- /** @type {boolean} */
- var options = key;
- /** @type {boolean} */
- var listener = key;
- /** @type {number} */
- var YY_START = +new Date;
- /** @type {number} */
- var YYSTATE = YY_START;
- /** @type {number} */
- var msg = 0;
- /** @type {boolean} */
- var flagMsg = key;
- var output = prefix("visibilityState");
- var hidden = prefix("hidden");
- var timeoutId;
- reset();
- (function() {
- var rvar = output.replace(/[vV]isibilityState/, "visibilitychange");
- event.d(document, rvar, reset);
- event.d(window, "pageshow", reset);
- event.d(window, "pagehide", reset);
- if ("object" == typeof document.onfocusin) {
- event.d(document, "focusin", init);
- event.d(document, "focusout", init);
- } else {
- event.d(window, "focus", init);
- event.d(window, "blur", init);
- }
- })();
- o.D = {
- /**
- * @return {?}
- */
- na : function() {
- return+new Date - YY_START;
- },
- /**
- * @return {?}
- */
- la : function() {
- return flagMsg ? +new Date - YYSTATE + msg : msg;
- }
- };
- matrix.d("pv-b", function() {
- event.d(window, "unload", property());
- });
- return o.D;
- })();
- (function() {
- /**
- * @param {(Object|string)} obj
- * @return {undefined}
- */
- function format(obj) {
- var key;
- for (key in obj) {
- if ({}.hasOwnProperty.call(obj, key)) {
- var val = obj[key];
- if (test.e(val, "Object") || test.e(val, "Array")) {
- format(val);
- } else {
- /** @type {string} */
- obj[key] = String(val);
- }
- }
- }
- }
- /**
- * @param {string} s
- * @return {?}
- */
- function encode(s) {
- return s.replace ? s.replace(/'/g, "'0").replace(/\*/g, "'1").replace(/!/g, "'2") : s;
- }
- var messages = self.M;
- var test = self.lang;
- var c = self.o;
- var config = o.q;
- var result = o.n;
- var obj = {
- Q : NULL,
- p : [],
- A : 0,
- R : useCapture,
- /**
- * @return {undefined}
- */
- init : function() {
- /** @type {number} */
- obj.c = 0;
- obj.Q = {
- /**
- * @return {undefined}
- */
- push : function() {
- obj.J.apply(obj, arguments);
- }
- };
- result.d("pv-b", function() {
- obj.fa();
- obj.ga();
- });
- result.d("pv-d", obj.ha);
- result.d("stag-b", function() {
- /** @type {string} */
- o.b.a.api = obj.c || obj.A ? obj.c + "_" + obj.A : "";
- });
- result.d("stag-d", function() {
- /** @type {number} */
- o.b.a.api = 0;
- /** @type {number} */
- obj.c = 0;
- /** @type {number} */
- obj.A = 0;
- });
- },
- /**
- * @return {undefined}
- */
- fa : function() {
- var a = window._hmt;
- if (a && a.length) {
- /** @type {number} */
- var i = 0;
- for (;i < a.length;i++) {
- var b = a[i];
- switch(b[0]) {
- case "_setAccount":
- if (1 < b.length) {
- if (/^[0-9a-z]{32}$/.test(b[1])) {
- obj.c |= 1;
- window._bdhm_account = b[1];
- }
- }
- break;
- case "_setAutoPageview":
- if (1 < b.length && (b = b[1], useCapture === b || key === b)) {
- obj.c |= 2;
- window._bdhm_autoPageview = b;
- }
- ;
- }
- }
- }
- },
- /**
- * @return {undefined}
- */
- ga : function() {
- if ("undefined" === typeof window._bdhm_account || window._bdhm_account === data.id) {
- /** @type {string} */
- window._bdhm_account = data.id;
- var p = window._hmt;
- if (p && p.length) {
- /** @type {number} */
- var i = 0;
- var pl = p.length;
- for (;i < pl;i++) {
- if (test.e(p[i], "Array") && ("_trackEvent" !== p[i][0] && "_trackRTEvent" !== p[i][0])) {
- obj.J(p[i]);
- } else {
- obj.p.push(p[i]);
- }
- }
- }
- /** @type {(null|{push: function (): undefined})} */
- window._hmt = obj.Q;
- }
- },
- /**
- * @return {undefined}
- */
- ha : function() {
- if (0 < obj.p.length) {
- /** @type {number} */
- var i = 0;
- /** @type {number} */
- var valuesLen = obj.p.length;
- for (;i < valuesLen;i++) {
- obj.J(obj.p[i]);
- }
- }
- /** @type {null} */
- obj.p = NULL;
- },
- /**
- * @param {(Array|string)} data
- * @return {undefined}
- */
- J : function(data) {
- if (test.e(data, "Array")) {
- var x = data[0];
- if (obj.hasOwnProperty(x) && test.e(obj[x], "Function")) {
- obj[x](data);
- }
- }
- },
- /**
- * @param {Array} written
- * @return {undefined}
- */
- _trackPageview : function(written) {
- if (1 < written.length && (written[1].charAt && "/" == written[1].charAt(0))) {
- obj.c |= 4;
- /** @type {number} */
- o.b.a.et = 0;
- /** @type {string} */
- o.b.a.ep = "";
- if (o.b.H) {
- /** @type {number} */
- o.b.a.nv = 0;
- /** @type {number} */
- o.b.a.st = 4;
- } else {
- /** @type {boolean} */
- o.b.H = key;
- }
- var u = o.b.a.u;
- var su = o.b.a.su;
- o.b.a.u = config.protocol + "//" + document.location.host + written[1];
- if (!obj.R) {
- /** @type {string} */
- o.b.a.su = document.location.href;
- }
- o.b.i();
- o.b.a.u = u;
- o.b.a.su = su;
- }
- },
- /**
- * @param {Array} data
- * @return {undefined}
- */
- _trackEvent : function(data) {
- if (2 < data.length) {
- obj.c |= 8;
- /** @type {number} */
- o.b.a.nv = 0;
- /** @type {number} */
- o.b.a.st = 4;
- /** @type {number} */
- o.b.a.et = 4;
- /** @type {string} */
- o.b.a.ep = encode(data[1]) + "*" + encode(data[2]) + (data[3] ? "*" + encode(data[3]) : "") + (data[4] ? "*" + encode(data[4]) : "");
- o.b.i();
- }
- },
- /**
- * @param {Array} value
- * @return {undefined}
- */
- _setCustomVar : function(value) {
- if (!(4 > value.length)) {
- var section = value[1];
- var prop = value[4] || 3;
- if (0 < section && (6 > section && (0 < prop && 4 > prop))) {
- obj.A++;
- var leaks = (o.b.a.cv || "*").split("!");
- var cnl = leaks.length;
- for (;cnl < section - 1;cnl++) {
- leaks.push("*");
- }
- /** @type {string} */
- leaks[section - 1] = prop + "*" + encode(value[2]) + "*" + encode(value[3]);
- o.b.a.cv = leaks.join("!");
- value = o.b.a.cv.replace(/[^1](\*[^!]*){2}/g, "*").replace(/((^|!)\*)+$/g, "");
- if ("" !== value) {
- o.b.setData("Hm_cv_" + data.id, encodeURIComponent(value), data.age);
- } else {
- o.b.xa("Hm_cv_" + data.id);
- }
- }
- }
- },
- /**
- * @param {Array} written
- * @return {undefined}
- */
- _setReferrerOverride : function(written) {
- if (1 < written.length) {
- o.b.a.su = written[1].charAt && "/" == written[1].charAt(0) ? config.protocol + "//" + window.location.host + written[1] : written[1];
- /** @type {boolean} */
- obj.R = key;
- }
- },
- /**
- * @param {string} date
- * @return {undefined}
- */
- _trackOrder : function(date) {
- date = date[1];
- if (test.e(date, "Object")) {
- format(date);
- obj.c |= 16;
- /** @type {number} */
- o.b.a.nv = 0;
- /** @type {number} */
- o.b.a.st = 4;
- /** @type {number} */
- o.b.a.et = 94;
- o.b.a.ep = c.stringify(date);
- o.b.i();
- }
- },
- /**
- * @param {string} dataAndEvents
- * @return {undefined}
- */
- _trackMobConv : function(dataAndEvents) {
- if (dataAndEvents = {
- webim : 1,
- tel : 2,
- map : 3,
- sms : 4,
- callback : 5,
- share : 6
- }[dataAndEvents[1]]) {
- obj.c |= 32;
- /** @type {number} */
- o.b.a.et = 93;
- /** @type {string} */
- o.b.a.ep = dataAndEvents;
- o.b.i();
- }
- },
- /**
- * @param {string} date
- * @return {undefined}
- */
- _trackRTPageview : function(date) {
- date = date[1];
- if (test.e(date, "Object")) {
- format(date);
- date = c.stringify(date);
- if (512 >= encodeURIComponent(date).length) {
- obj.c |= 64;
- /** @type {string} */
- o.b.a.rt = date;
- }
- }
- },
- /**
- * @param {string} data
- * @return {undefined}
- */
- _trackRTEvent : function(data) {
- data = data[1];
- if (test.e(data, "Object")) {
- format(data);
- /** @type {string} */
- data = encodeURIComponent(c.stringify(data));
- /**
- * @param {Array} token
- * @return {undefined}
- */
- var handler = function(token) {
- var rt = o.b.a.rt;
- obj.c |= 128;
- /** @type {number} */
- o.b.a.et = 90;
- /** @type {Array} */
- o.b.a.rt = token;
- o.b.i();
- o.b.a.rt = rt;
- };
- /** @type {number} */
- var fileSize = data.length;
- if (900 >= fileSize) {
- handler.call(this, data);
- } else {
- /** @type {number} */
- fileSize = Math.ceil(fileSize / 900);
- /** @type {string} */
- var o = "block|" + Math.round(Math.random() * config.m).toString(16) + "|" + fileSize + "|";
- /** @type {Array} */
- var assigns = [];
- /** @type {number} */
- var vvar = 0;
- for (;vvar < fileSize;vvar++) {
- assigns.push(vvar);
- assigns.push(data.substring(900 * vvar, 900 * vvar + 900));
- handler.call(this, o + assigns.join("|"));
- /** @type {Array} */
- assigns = [];
- }
- }
- }
- },
- /**
- * @param {Object} date
- * @return {undefined}
- */
- _setUserId : function(date) {
- date = date[1];
- if (test.e(date, "String") || test.e(date, "Number")) {
- var encodedValue = o.b.G();
- /** @type {string} */
- var hm_ = "hm-" + o.b.a.v;
- obj.T = obj.T || Math.round(Math.random() * config.m);
- messages.log("//datax.baidu.com/x.gif?si=" + data.id + "&dm=" + encodeURIComponent(encodedValue) + "&ac=" + encodeURIComponent(date) + "&v=" + hm_ + "&li=" + obj.T + "&rnd=" + Math.round(Math.random() * config.m));
- }
- }
- };
- obj.init();
- o.Z = obj;
- return o.Z;
- })();
- (function() {
- /**
- * @return {undefined}
- */
- function Game() {
- if ("undefined" == typeof window["_bdhm_loaded_" + data.id]) {
- /** @type {boolean} */
- window["_bdhm_loaded_" + data.id] = key;
- this.a = {};
- /** @type {boolean} */
- this.H = useCapture;
- this.init();
- }
- }
- var t = self.url;
- var app = self.M;
- var max = self.B;
- var a = self.lang;
- var c = self.cookie;
- var ctx = self.g;
- var elem = self.localStorage;
- var cache = self.sessionStorage;
- var s = o.q;
- var color = o.n;
- Game.prototype = {
- /**
- * @param {string} result
- * @param {string} el
- * @return {?}
- */
- I : function(result, el) {
- result = "." + result.replace(/:\d+/, "");
- el = "." + el.replace(/:\d+/, "");
- var j = result.indexOf(el);
- return-1 < j && j + el.length == result.length;
- },
- /**
- * @param {string} s
- * @param {?} args
- * @return {?}
- */
- S : function(s, args) {
- s = s.replace(/^https?:\/\//, "");
- return 0 === s.indexOf(args);
- },
- /**
- * @param {string} mod
- * @return {?}
- */
- t : function(mod) {
- /** @type {number} */
- var s = 0;
- for (;s < data.dm.length;s++) {
- if (-1 < data.dm[s].indexOf("/")) {
- if (this.S(mod, data.dm[s])) {
- return key;
- }
- } else {
- var parent = t.P(mod);
- if (parent && this.I(parent, data.dm[s])) {
- return key;
- }
- }
- }
- return useCapture;
- },
- /**
- * @return {?}
- */
- G : function() {
- /** @type {string} */
- var expectationResult = document.location.hostname;
- /** @type {number} */
- var i = 0;
- /** @type {number} */
- var valuesLen = data.dm.length;
- for (;i < valuesLen;i++) {
- if (this.I(expectationResult, data.dm[i])) {
- return data.dm[i].replace(/(:\d+)?[\/\?#].*/, "");
- }
- }
- return expectationResult;
- },
- /**
- * @return {?}
- */
- O : function() {
- /** @type {number} */
- var i = 0;
- /** @type {number} */
- var valuesLen = data.dm.length;
- for (;i < valuesLen;i++) {
- var b = data.dm[i];
- if (-1 < b.indexOf("/") && this.S(document.location.href, b)) {
- return b.replace(/^[^\/]+(\/.*)/, "$1") + "/";
- }
- }
- return "/";
- },
- /**
- * @return {?}
- */
- oa : function() {
- if (!document.referrer) {
- return s.h - s.l > data.vdur ? 1 : 4;
- }
- /** @type {boolean} */
- var format = useCapture;
- if (this.t(document.referrer) && this.t(document.location.href)) {
- /** @type {boolean} */
- format = key;
- } else {
- format = t.P(document.referrer);
- format = this.I(format || "", document.location.hostname);
- }
- return format ? s.h - s.l > data.vdur ? 1 : 4 : 3;
- },
- /**
- * @param {string} name
- * @return {?}
- */
- getData : function(name) {
- try {
- return c.get(name) || (cache.get(name) || elem.get(name));
- } catch (b) {
- }
- },
- /**
- * @param {string} name
- * @param {string} value
- * @param {number} val
- * @return {undefined}
- */
- setData : function(name, value, val) {
- try {
- c.set(name, value, {
- domain : this.G(),
- path : this.O(),
- F : val
- });
- if (val) {
- elem.set(name, value, val);
- } else {
- cache.set(name, value);
- }
- } catch (f) {
- }
- },
- /**
- * @param {string} name
- * @return {undefined}
- */
- xa : function(name) {
- try {
- c.set(name, "", {
- domain : this.G(),
- path : this.O(),
- F : -1
- });
- cache.remove(name);
- elem.remove(name);
- } catch (b) {
- }
- },
- /**
- * @return {undefined}
- */
- Ba : function() {
- var a;
- var oa;
- var v;
- var p;
- var i;
- s.l = this.getData("Hm_lpvt_" + data.id) || 0;
- if (13 == s.l.length) {
- /** @type {number} */
- s.l = Math.round(s.l / 1E3);
- }
- oa = this.oa();
- /** @type {number} */
- a = 4 != oa ? 1 : 0;
- if (v = this.getData("Hm_lvt_" + data.id)) {
- p = v.split(",");
- /** @type {number} */
- i = p.length - 1;
- for (;0 <= i;i--) {
- if (13 == p[i].length) {
- /** @type {string} */
- p[i] = "" + Math.round(p[i] / 1E3);
- }
- }
- for (;2592E3 < s.h - p[0];) {
- p.shift();
- }
- /** @type {number} */
- i = 4 > p.length ? 2 : 3;
- if (1 === a) {
- p.push(s.h);
- }
- for (;4 < p.length;) {
- p.shift();
- }
- v = p.join(",");
- p = p[p.length - 1];
- } else {
- /** @type {number} */
- v = s.h;
- /** @type {string} */
- p = "";
- /** @type {number} */
- i = 1;
- }
- this.setData("Hm_lvt_" + data.id, v, data.age);
- this.setData("Hm_lpvt_" + data.id, s.h);
- /** @type {string} */
- v = s.h == this.getData("Hm_lpvt_" + data.id) ? "1" : "0";
- if (0 === data.nv && (this.t(document.location.href) && ("" === document.referrer || this.t(document.referrer)))) {
- /** @type {number} */
- a = 0;
- /** @type {number} */
- oa = 4;
- }
- /** @type {number} */
- this.a.nv = a;
- this.a.st = oa;
- /** @type {string} */
- this.a.cc = v;
- this.a.lt = p;
- /** @type {number} */
- this.a.lv = i;
- },
- /**
- * @return {?}
- */
- U : function() {
- /** @type {Array} */
- var tagNameArr = [];
- /** @type {number} */
- var a = 0;
- /** @type {number} */
- var al = s.V.length;
- for (;a < al;a++) {
- /** @type {string} */
- var i = s.V[a];
- var v = this.a[i];
- if ("undefined" != typeof v) {
- if ("" !== v) {
- tagNameArr.push(i + "=" + encodeURIComponent(v));
- }
- }
- }
- a = this.a.et;
- if (this.a.rt) {
- if (0 === a) {
- tagNameArr.push("rt=" + encodeURIComponent(this.a.rt));
- } else {
- if (90 === a) {
- tagNameArr.push("rt=" + this.a.rt);
- }
- }
- }
- return tagNameArr.join("&");
- },
- /**
- * @return {undefined}
- */
- Ca : function() {
- this.Ba();
- /** @type {string} */
- this.a.si = data.id;
- /** @type {string} */
- this.a.su = document.referrer;
- /** @type {string} */
- this.a.ds = ctx.ya;
- /** @type {string} */
- this.a.cl = ctx.colorDepth + "-bit";
- this.a.ln = ctx.language;
- /** @type {number} */
- this.a.ja = ctx.javaEnabled ? 1 : 0;
- /** @type {number} */
- this.a.ck = ctx.cookieEnabled ? 1 : 0;
- /** @type {number} */
- this.a.lo = "number" == typeof _bdhm_top ? 1 : 0;
- this.a.fl = max.pa();
- /** @type {string} */
- this.a.v = "1.0.75";
- /** @type {string} */
- this.a.cv = decodeURIComponent(this.getData("Hm_cv_" + data.id) || "");
- if (1 == this.a.nv) {
- /** @type {string} */
- this.a.tt = document.title || "";
- }
- /** @type {string} */
- var url = document.location.href;
- this.a.cm = t.k(url, s.sa) || "";
- this.a.cp = t.k(url, s.ta) || "";
- this.a.cw = t.k(url, s.ra) || "";
- this.a.ci = t.k(url, s.qa) || "";
- this.a.cf = t.k(url, s.ua) || "";
- },
- /**
- * @return {undefined}
- */
- init : function() {
- try {
- this.Ca();
- if (0 === this.a.nv) {
- this.Aa();
- } else {
- this.L(".*");
- }
- o.b = this;
- this.$();
- color.s("pv-b");
- this.za();
- } catch (e) {
- /** @type {Array} */
- var tagNameArr = [];
- tagNameArr.push("si=" + data.id);
- tagNameArr.push("n=" + encodeURIComponent(e.name));
- tagNameArr.push("m=" + encodeURIComponent(e.message));
- tagNameArr.push("r=" + encodeURIComponent(document.referrer));
- app.log(s.protocol + "//" + s.K + "?" + tagNameArr.join("&"));
- }
- },
- /**
- * @return {undefined}
- */
- za : function() {
- /**
- * @return {undefined}
- */
- function e() {
- color.s("pv-d");
- }
- if ("undefined" === typeof window._bdhm_autoPageview || window._bdhm_autoPageview === key) {
- /** @type {boolean} */
- this.H = key;
- /** @type {number} */
- this.a.et = 0;
- /** @type {string} */
- this.a.ep = "";
- this.i(e);
- } else {
- e();
- }
- },
- /**
- * @param {Function} v
- * @return {undefined}
- */
- i : function(v) {
- var node = this;
- /** @type {number} */
- node.a.rnd = Math.round(Math.random() * s.m);
- color.s("stag-b");
- var load = s.protocol + "//" + s.K + "?" + node.U();
- color.s("stag-d");
- node.X(load);
- app.log(load, function(o) {
- node.L(o);
- if (a.e(v, "Function")) {
- v.call(node);
- }
- });
- },
- /**
- * @return {undefined}
- */
- $ : function() {
- /** @type {string} */
- var script = document.location.hash.substring(1);
- /** @type {RegExp} */
- var RE_SIMPLE_SELECTOR = RegExp(data.id);
- /** @type {boolean} */
- var newKey = -1 < document.referrer.indexOf(s.Y) ? key : useCapture;
- var tag = t.k(script, "jn");
- /** @type {boolean} */
- var elements = /^heatlink$|^select$/.test(tag);
- if (script) {
- if (RE_SIMPLE_SELECTOR.test(script) && (newKey && elements)) {
- /** @type {Element} */
- script = document.createElement("script");
- script.setAttribute("type", "text/javascript");
- script.setAttribute("charset", "utf-8");
- script.setAttribute("src", s.protocol + "//" + data.js + tag + ".js?" + this.a.rnd);
- tag = document.getElementsByTagName("script")[0];
- tag.parentNode.insertBefore(script, tag);
- }
- }
- },
- /**
- * @param {string} cmd
- * @return {undefined}
- */
- X : function(cmd) {
- var value = cache.get("Hm_unsent_" + data.id) || "";
- /** @type {string} */
- var path = this.a.u ? "" : "&u=" + encodeURIComponent(document.location.href);
- /** @type {string} */
- value = encodeURIComponent(cmd.replace(/^https?:\/\//, "") + path) + (value ? "," + value : "");
- cache.set("Hm_unsent_" + data.id, value);
- },
- /**
- * @param {string} cls
- * @return {undefined}
- */
- L : function(cls) {
- var result = cache.get("Hm_unsent_" + data.id) || "";
- if (result) {
- if (result = result.replace(RegExp(encodeURIComponent(cls.replace(/^https?:\/\//, "")).replace(/([\*\(\)])/g, "\\$1") + "(%26u%3D[^,]*)?,?", "g"), "").replace(/,$/, "")) {
- cache.set("Hm_unsent_" + data.id, result);
- } else {
- cache.remove("Hm_unsent_" + data.id);
- }
- }
- },
- /**
- * @return {undefined}
- */
- Aa : function() {
- var that = this;
- var values = cache.get("Hm_unsent_" + data.id);
- if (values) {
- values = values.split(",");
- /**
- * @param {?} param
- * @return {undefined}
- */
- var fn = function(param) {
- app.log(s.protocol + "//" + decodeURIComponent(param).replace(/^https?:\/\//, ""), function(cls) {
- that.L(cls);
- });
- };
- /** @type {number} */
- var i = 0;
- var valuesLen = values.length;
- for (;i < valuesLen;i++) {
- fn(values[i]);
- }
- }
- }
- };
- return new Game;
- })();
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement