var __INLINE_SCRIPT__ = (function () {
'use strict';
function _arrayLikeToArray$1(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _unsupportedIterableToArray$1(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread();
}
function textOverflow(el, binding) {
var _a, _b;
var text = el.innerHTML;
if (!text || !text.length) return;
var retainTail = [];
if ((_a = binding.value) === null || _a === void 0 ? void 0 : _a.tailNum) {
retainTail = _toConsumableArray(el.childNodes).slice(-binding.value.tailNum);
}
var count = 0;
function needTextOverflow() {
var _a;
if ((_a = binding.value) === null || _a === void 0 ? void 0 : _a.lineClamp) {
return binding.value.lineClamp < computeLineNum(el);
}
return el.offsetHeight < el.scrollHeight;
}
if (needTextOverflow()) {
try {
var getLeaf = function getLeaf(node) {
var result = [];
if (!node.childNodes || node.childNodes.length === 0) {
return [node];
}
node.childNodes.forEach(function (child) {
result = [].concat(_toConsumableArray(result), _toConsumableArray(getLeaf(child)));
});
return result;
};
var getFragmentHTML = function getFragmentHTML(frag) {
var _a, _b;
var div = document.createDocumentFragment();
div.appendChild(frag);
var span = document.createElement('span');
span.innerHTML = ((_a = binding.value) === null || _a === void 0 ? void 0 : _a.html) || '...';
if (div.lastElementChild) {
div.lastElementChild.style.display = 'inline';
}
div.appendChild(span);
el.extraElement = span;
if ((_b = binding.value) === null || _b === void 0 ? void 0 : _b.tailNum) {
retainTail.forEach(function (tail) {
div.appendChild(tail);
});
}
return div;
};
var findLastNode = function findLastNode(start, end) {
if (end - start <= 1) {
range.setEndAfter(leaves[start]);
setNewFrag(el, getFragmentHTML(range.cloneContents()));
return needTextOverflow() ? start : end;
}
var mid = start + end >> 1;
count++;
range.setEndAfter(leaves[mid]);
setNewFrag(el, getFragmentHTML(range.cloneContents()));
return needTextOverflow() ? findLastNode(start, mid) : findLastNode(mid, end);
};
var findLastCharIndex = function findLastCharIndex(start, end) {
if (end - start <= 1) {
if (start === 0) {
range.setEndAfter(leaves[Math.max(lastNodeIndex - 1, 0)]);
} else {
range.setEnd(lastNode, start);
}
setNewFrag(el, getFragmentHTML(range.cloneContents()));
return start;
}
var mid = start + end >> 1;
count++;
range.setEnd(lastNode, mid);
setNewFrag(el, getFragmentHTML(range.cloneContents()));
return needTextOverflow() ? findLastCharIndex(start, mid) : findLastCharIndex(mid, end);
};
var dom = document.createElement('div');
dom.innerHTML = text;
var leaves = getLeaf(dom);
var range = document.createRange();
range.setStartBefore(leaves[0]);
var lastNodeIndex = findLastNode(0, leaves.length - 1);
var lastNode = leaves[lastNodeIndex];
findLastCharIndex(0, lastNode.textContent.length);
((_b = binding.value) === null || _b === void 0 ? void 0 : _b.processExtraElement) && binding.value.processExtraElement(el.extraElement, el);
console.log(count);
} catch (error) {
console.error(error);
}
}
}
function computeLineNum(el) {
var computyStyle = getComputedStyle(el);
return Math.round(el.offsetHeight / parseFloat(computyStyle.lineHeight));
}
function removeAllChild(el) {
var childNodes = Array.from(el.childNodes);
childNodes.forEach(function (child) {
el.removeChild(child);
});
}
function setNewFrag(el, frag) {
removeAllChild(el);
el.appendChild(frag);
}
var Device = {};
function detect(ua) {
var MQQBrowser = ua.match(/MQQBrowser\/(\\d+\\.\\d+)/i);
var MQQClient = ua.match(/QQ\/(\\d+\\.(\\d+)\\.(\\d+)\\.(\\d+))/i) || ua.match(/V1_AND_SQ_([\\d.]+)/);
var WeChat = ua.match(/MicroMessenger\/((\\d+)\\.(\\d+))\\.(\\d+)/) || ua.match(/MicroMessenger\/((\\d+)\\.(\\d+))/);
var MacOS = ua.match(/Mac\\sOS\\sX\\s(\\d+[\\.|_]\\d+)/);
var WinOS = ua.match(/Windows(\\s+\\w+)?\\s+?(\\d+\\.\\d+)/);
var Linux = ua.match(/Linux\\s/);
var MiuiBrowser = ua.match(/MiuiBrowser\/(\\d+\\.\\d+)/i);
var M1 = ua.match(/MI-ONE/);
var MIPAD = ua.match(/MI PAD/);
var UC = ua.match(/UCBrowser\/(\\d+\\.\\d+(\\d+\\.\\d+)?)/) || ua.match(/\\sUC\\s/);
var IEMobile = ua.match(/IEMobile(\//|(\\s+))(\\d+\\.\\d+)/) || ua.match(/WPDesktop/);
var ipod = ua.match(/(ipod).*\\s([\\d_]+)/i);
var ipad = ua.match(/(ipad).*\\s([\\d_]+)/i);
var iphone = ua.match(/(iphone)\\sos\\s([\\d_]+)/i);
var Chrome = ua.match(/Chrome\/(\\d+\\.\\d+)/);
var AndriodBrowser = ua.match(/Mozilla.*Linux.*Android.*AppleWebKit.*Mobile Safari/);
var android = ua.match(/(android)\\s([\\d.]+)/i);
var harmony = ua.match(/(OpenHarmony)\\s([\\d.]+)/i);
Device.browser = Device.browser || {}, Device.os = Device.os || {};
if (window.ActiveXObject) {
var vie = 6;
(window.XMLHttpRequest || ua.indexOf('MSIE 7.0') > -1) && (vie = 7);
(window.XDomainRequest || ua.indexOf('Trident/4.0') > -1) && (vie = 8);
ua.indexOf('Trident/5.0') > -1 && (vie = 9);
ua.indexOf('Trident/6.0') > -1 && (vie = 10);
Device.browser.ie = true, Device.browser.version = vie;
} else if (ua.indexOf('Trident/7.0') > -1) {
Device.browser.ie = true, Device.browser.version = 11;
}
if (android) {
Device.os.android = true;
Device.os.version = android[2];
}
if (harmony) {
Device.os.harmony = true;
Device.os.version = harmony[2];
}
if (ipod) {
Device.os.ios = Device.os.ipod = true;
Device.os.version = ipod[2].replace(/_/g, '.');
}
if (ipad) {
Device.os.ios = Device.os.ipad = true;
Device.os.version = ipad[2].replace(/_/g, '.');
}
if (iphone) {
Device.os.iphone = Device.os.ios = true;
Device.os.version = iphone[2].replace(/_/g, '.');
}
if (WinOS) Device.os.windows = true, Device.os.version = WinOS[2];
if (MacOS) Device.os.Mac = true, Device.os.version = MacOS[1];
if (Linux) Device.os.Linux = true;
if (ua.indexOf('lepad_hls') > 0) Device.os.LePad = true;
if (MIPAD) Device.os.MIPAD = true;
if (MQQBrowser) Device.browser.MQQ = true, Device.browser.version = MQQBrowser[1];
if (MQQClient) Device.browser.MQQClient = true, Device.browser.version = MQQClient[1];
if (WeChat) Device.browser.WeChat = true, Device.browser.mmversion = Device.browser.version = WeChat[1];
if (MiuiBrowser) Device.browser.MIUI = true, Device.browser.version = MiuiBrowser[1];
if (UC) Device.browser.UC = true, Device.browser.version = UC[1] || NaN;
if (IEMobile) Device.browser.IEMobile = true, Device.browser.version = IEMobile[2];
if (AndriodBrowser) {
Device.browser.AndriodBrowser = true;
}
if (M1) {
Device.browser.M1 = true;
}
if (Chrome) {
Device.browser.Chrome = true, Device.browser.version = Chrome[1];
}
if (Device.os.windows) {
if (typeof navigator.platform !== "undefined" && navigator.platform.toLowerCase() == "win64") {
Device.os.win64 = true;
} else {
Device.os.win64 = false;
}
}
if (Device.os.Mac || Device.os.windows || Device.os.Linux) {
Device.os.pc = true;
}
var osType = {
iPad7: 'iPad; CPU OS 7',
LePad: 'lepad_hls',
XiaoMi: 'MI-ONE',
SonyDTV: "SonyDTV",
SamSung: 'SAMSUNG',
HTC: 'HTC',
VIVO: 'vivo'
};
for (var os in osType) {
Device.os[os] = ua.indexOf(osType[os]) !== -1;
}
Device.os.phone = Device.os.phone || /windows phone/i.test(ua);
Device.os.getNumVersion = function () {
return parseFloat(Device.os.version);
};
Device.os.hasTouch = 'ontouchstart' in window;
if (Device.os.hasTouch && Device.os.ios && Device.os.getNumVersion() < 6) {
Device.os.hasTouch = false;
}
if (Device.browser.WeChat && Device.browser.version < 5.0) {
Device.os.hasTouch = false;
}
Device.browser.getNumVersion = function () {
return parseFloat(Device.browser.version);
};
Device.browser.isFFCanOcx = function () {
return !!Device.browser.firefox && Device.browser.getNumVersion() >= 3.0;
};
Device.browser.isCanOcx = function () {
return !!Device.os.windows && (!!Device.browser.ie || Device.browser.isFFCanOcx() || !!Device.browser.webkit);
};
Device.browser.isNotIESupport = function () {
return !!Device.os.windows && (!!Device.browser.webkit || Device.browser.isFFCanOcx());
};
Device.userAgent = {};
Device.userAgent.browserVersion = Device.browser.version;
Device.userAgent.osVersion = Device.os.version;
Device.os.unifiedPC = ua.match(/UnifiedPC/);
delete Device.userAgent.version;
}
detect(window.navigator.userAgent);
function canSupportH5Video() {
var ua = window.navigator.userAgent,
m = null;
if (!!Device.os.android) {
if (Device.browser.MQQ && Device.browser.getNumVersion() >= 4.2) {
return true;
}
if (ua.indexOf('MI2') != -1) {
return true;
}
if (Device.os.version >= '4' && (m = ua.match(/MicroMessenger\/((\\d+)\\.(\\d+))\\.(\\d+)/))) {
if (parseFloat(m[1]) >= 4.2) {
return true;
}
}
if (Device.os.version >= '4.1') {
return true;
}
}
return false;
}
function canSupportVideoMp4() {
var video = document.createElement('video');
if (typeof video.canPlayType === 'function') {
if (video.canPlayType('video/mp4; codecs="mp4v.20.8"') === 'probably') {
return true;
}
if (video.canPlayType('video/mp4; codecs="avc1.42E01E"') === 'probably' || video.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"') === 'probably') {
return true;
}
}
return false;
}
function canSupportAutoPlay() {
if (Device.os.ios && Device.os.getNumVersion() < 10) {
return false;
}
return true;
}
function isLockdownMode() {
if (!Device.os.ios || Device.os.getNumVersion() < 16) {
return false;
}
if (typeof WebAssembly === 'undefined' && typeof OfflineAudioContext === 'undefined' && typeof WebGLRenderingContext === 'undefined') {
return true;
}
return false;
}
Device.canSupportVideo = canSupportVideoMp4 || canSupportH5Video;
Device.canSupportVideoMp4 = canSupportVideoMp4;
Device.canSupportH5Video = canSupportH5Video;
Device.canSupportAutoPlay = canSupportAutoPlay;
Device.isLockdownMode = isLockdownMode;
Device.cpVersion = function (version) {
var cp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
var canEqual = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var nowVersionStr = Device.os.version;
if (!nowVersionStr) return false;
var versionArr = version.split('.');
var nowVersionArr = nowVersionStr.split('.');
for (var i = 0; i < Math.max(nowVersionArr.length, versionArr.length); i++) {
var vi = +versionArr[i];
var nvi = +nowVersionArr[i];
if (vi === nvi) continue;
if (cp > 0) return vi > nvi;
if (cp < 0) return vi < nvi;
}
return canEqual || cp === 0;
};
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0; i < len; i++) arr2[i] = arr[i]; return arr2; }
var ua = navigator.userAgent;
var is_ios = /(iPhone|iPad|iPod|iOS)/i.test(ua);
var is_wp = /Windows\sPhone/i.test(ua);
var is_android = /(Android)/i.test(ua);
var is_wechat = /MicroMessenger\/([\\d.]+)/i.test(ua);
var is_mac = /mac\sos/i.test(ua) && !is_ios;
var is_windows = /windows\snt/i.test(ua) && !is_wp;
var is_mpapp = /MPAPP\/([\\d.]+)/i.test(ua);
var is_ipad = /iPad/i.test(ua);
var is_windows_wechat = /WindowsWechat/i.test(ua);
var is_mac_wechat = /MacWechat/i.test(ua) || /wechat.*mac os/i.test(ua);
var is_prefetch = is_wechat && window.WeixinPrefecherJSBridge;
var is_donut_app = /SAAASDK/i.test(ua);
var is_open_harmony = /OpenHarmony/i.test(ua);
var is_in_miniProgram = is_android && /miniprogram/.test(ua.toLowerCase()) || window.__wxjs_environment == 'miniprogram';
var is_wx_work = /wxwork/i.test(ua);
function getUrlParams() {
var vars = location.search.substring(1).split('&');
var params = {};
var _iterator = _createForOfIteratorHelper(vars),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var ele = _step.value;
var pair = ele.split('=');
var key = decodeURIComponent(pair[0]);
if (typeof params[key] === 'undefined') {
params[key] = decodeURIComponent(pair[1]);
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return params;
}
function get() {
var reg = /MicroMessenger\/([\\d.]+)/i;
var ret = ua.match(reg);
if (ret && ret[1]) {
return ret[1];
}
return false;
}
function getMac() {
var reg = /MacWechat\/([\\d.]+)/i;
var ret = ua.match(reg);
if (ret && ret[1]) {
return ret[1];
}
return false;
}
function getMacOS() {
var reg = /Mac OS X ([\\d_]+)/i;
var ret = ua.match(reg);
if (ret && ret[1]) {
return ret[1].replace(/_/g, '.');
}
return false;
}
function getWindows() {
var reg = /WindowsWechat\(0x(.+?)\)/i;
var ret = ua.match(reg);
if (ret && ret[1]) {
return ret[1];
}
return false;
}
function getWxWork() {
var reg = /wxwork\/([\\d.]+)/i;
var ret = ua.match(reg);
if (ret && ret[1]) {
return ret[1];
}
return false;
}
function getMpApp() {
var appVersion = [2, 4, 5];
var match = navigator.userAgent.match(/MPAPP\/([\\d+(\\\\\\d+)*/);
if (match) {
appVersion = match[1].split('.').map(function (v) {
return Number(v);
});
}
return appVersion.join('.');
}
function getUnifiedPcVer() {
var versionInfo = navigator.userAgent.match(/UnifiedPC\w+Wechat\(0xf\w{2}(.+?)\w{2}\)/);
if (versionInfo && versionInfo.length === 2) {
var version = versionInfo[1];
var mainVersion = getVersionNumber(version.slice(0, 1));
var subVersion = getVersionNumber(version.slice(1, 2));
var subVersion2 = getVersionNumber(version.slice(2, 3));
return [mainVersion, subVersion, subVersion2].join('.');
}
}
function getVersionNumber(hexStr) {
return Number(Number("0x".concat(hexStr)).toString(10));
}
function getWindowsVersionFormat() {
var versionInfo = navigator.userAgent.match(/WindowsWechat\(0x(.+?)\)/);
if (versionInfo && versionInfo.length === 2) {
var version = versionInfo[1];
var mainVersion = getVersionNumber(version.slice(1, 2));
var subVersion = getVersionNumber(version.slice(2, 4));
var subVersion2 = getVersionNumber(version.slice(4, 6));
return [mainVersion, subVersion, subVersion2].join('.');
}
return false;
}
function getInner() {
var reg = /MicroMessenger\/([\\d.]+\(0x(.+?)\)/i;
var ret = ua.match(reg);
if (ret && ret[1] && ret[1] != null) {
return ret[1];
}
if (!ret && /MicroMessenger\/([\\d.]+)/i.test(ua)) {
var urlParams = getUrlParams();
if (urlParams.version) {
return urlParams.version;
}
}
return false;
}
var opfunc = {
'cp-1': function cp1(a, b) {
return a < b;
},
cp0: function cp0(a, b) {
return a === b;
},
cp1: function cp1(a, b) {
return a > b;
}
};
function cpVersion(ver, op, canEq, type) {
var mmver = false;
switch (type) {
case 'mac':
mmver = getMac();
break;
case 'windows':
mmver = getWindowsVersionFormat();
break;
case 'wxwork':
mmver = getWxWork();
break;
case 'mpapp':
mmver = getMpApp();
break;
case 'unifiedpc':
mmver = getUnifiedPcVer();
break;
default:
mmver = get();
break;
}
if (!mmver) {
return;
}
var mmversion = mmver.split('.');
var version = ver.split('.');
if (!/\d+/g.test(mmversion[mmversion.length - 1])) {
mmversion.pop();
}
for (var i = 0, len = Math.max(mmversion.length, version.length); i < len; ++i) {
var mmv = mmversion[i] || '';
var v = version[i] || '';
var mmvn = parseInt(mmv, 10) || 0;
var vn = parseInt(v, 10) || 0;
var eq = opfunc.cp0(mmvn, vn);
if (eq) {
continue;
}
var cp = opfunc["cp".concat(op)];
return cp(mmvn, vn);
}
return canEq || op === 0;
}
function eqVersion(version) {
return cpVersion(version, 0);
}
function gtVersion(version, canEq) {
return cpVersion(version, 1, canEq);
}
function ltVersion(version, canEq) {
return cpVersion(version, -1, canEq);
}
function getPlatform() {
if (is_ios) {
return 'ios';
}
if (is_android) {
return 'android';
}
if (is_mac) {
return 'mac_os';
}
if (is_windows) {
return 'windows';
}
return 'unknown';
}
var is_google_play = false;
var inner_ver_for_google_play_check = getInner();
if (is_android && inner_ver_for_google_play_check) {
var v = "0x".concat(inner_ver_for_google_play_check.substr(-2));
if (parseInt(v) >= 64 && parseInt(v) <= 79) {
is_google_play = true;
}
}
({
get: get,
getMac: getMac,
getMacOS: getMacOS,
getWindows: getWindows,
getInner: getInner,
getWxWork: getWxWork,
getMpApp: getMpApp,
cpVersion: cpVersion,
eqVersion: eqVersion,
gtVersion: gtVersion,
ltVersion: ltVersion,
getPlatform: getPlatform,
getVersionNumber: getVersionNumber,
isWp: is_wp,
isIOS: is_ios,
isAndroid: is_android,
isOHOS: is_open_harmony,
isHarmonyNextWechat: is_open_harmony && is_wechat && cpVersion('3.0.0', 1, true),
isInMiniProgram: is_in_miniProgram,
isWechat: is_wechat,
isMac: is_mac,
isWindows: is_windows,
isMacWechat: is_mac_wechat,
isWindowsWechat: is_windows_wechat,
isWxWork: is_wx_work,
isOnlyWechat: is_wechat && !is_wx_work,
isMpapp: is_mpapp,
isNewMpApp: is_mpapp && cpVersion('3.0.0', 1, true, 'mpapp'),
isIPad: is_ipad,
isGooglePlay: is_google_play,
isPrefetch: is_prefetch,
isDonutAPP: is_donut_app
});
Device.os.ipad && Device.os.getNumVersion() >= 13 && Device.os.getNumVersion() < 14;
function getScaleByDom() {
var fontDom = document.createElement('div');
fontDom.style.fontSize = '16px';
document.body.appendChild(fontDom);
var originFontSize = parseFloat(fontDom.style.fontSize);
var realFontSize = parseFloat(window.getComputedStyle(fontDom, null).getPropertyValue('font-size'));
document.body.removeChild(fontDom);
var percent = realFontSize / originFontSize;
return percent;
}
var ltReplaceChar = "lt".concat(Date.now(), "-").concat(Math.random());
var gtReplaceChar = "gt".concat(Date.now(), "-").concat(Math.random());
var ltReplaceCharReg = new RegExp(ltReplaceChar, 'g');
var gtReplaceCharReg = new RegExp(gtReplaceChar, 'g');
function isAudioPage(itemShowType) {
return itemShowType * 1 === 7;
}
function replaceTagChar(str, enableTagReg) {
var strAfterReplace;
while (true) {
str = str.replace(enableTagReg, function (match, sub1, sub2, sub3) {
return "".concat(ltReplaceChar).concat(sub1).concat(gtReplaceChar).concat(sub2).concat(ltReplaceChar).concat(sub3).concat(gtReplaceChar);
});
if (str !== strAfterReplace) {
strAfterReplace = str;
continue;
}
break;
}
return strAfterReplace;
}
var __setDesc = function __setDesc(desc, isNoEncode, itemShowType) {
var extData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
function getAttr(s, a) {
var m = s.match(new RegExp(a + '\s*=\s*[\
Leave a Comment
Your email address will not be published. Required fields are marked *