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 > 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;
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() = 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() 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 0) return vi > nvi;
if (cp = 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, arr2 = new Array(len); i 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 = 64 && parseInt(v) = 13 && Device.os.getNumVersion() 3 && arguments[3] !== undefined ? arguments[3] : {};
function getAttr(s, a) {
var m = s.match(new RegExp(a + '\\s*=\\s*["\']?([^"\'\\s>]+)["\']?'));
return m && m[1];
}
function filterContentWithLinkNWeapp(str, enableTagReg) {
enableTagReg && (str = replaceTagChar(str, enableTagReg));
str = str.split(/(]*>)((?:.|\n)*?)()/);
var valid;
for (var i = 0; i ".concat(str[i + 1], "");
str[i + 2] = "";
i += 3;
continue;
} else if (getAttr(str[i], 'data-cardtype') === '3') {
var customstyle = getAttr(str[i], 'data-customstyle');
var customHeight = void 0;
if (customstyle) {
try {
var _JSON$parse = JSON.parse(customstyle.html(false)),
display = _JSON$parse.display,
height = _JSON$parse.height;
if (display !== 'none') {
customHeight = parseInt(height, 10);
} else {
customHeight = 0;
}
} catch (err) {
console.error(err);
}
} else {
var fontScale = getScaleByDom();
customHeight = 24 + 44 * fontScale;
}
str[i] = str[i].replace('";
i += 3;
continue;
}
} else if (valid) {
r += ' class="js_common_share_desc_link"';
var _itemShowType = getAttr(str[i], 'data-itemshowtype');
_itemShowType && (r += ' data-itemshowtype="' + _itemShowType + '"');
}
str[i] = valid ? r + '>' : '';
} else if (i % 4 === 3) {
!valid && (str[i] = '');
} else {
str[i] = str[i].replace(//g, '');
}
}
str = str.join('');
enableTagReg && (str = str.replace(ltReplaceCharReg, ''));
return str;
}
if (isNoEncode) {
if (itemShowType * 1 === 8) {
desc = desc.html(false);
}
desc = filterContentWithLinkNWeapp(desc, isAudioPage(itemShowType) ? /]+?textstyle[^>]+?)>([\s\S]+?)/g : undefined);
desc = window.__emojiFormat(desc.replace(/\r/g, '').replace(/\n/g, ''));
} else {
desc = desc.replace(/\r/g, '').replace(/\n/g, '').replace(/\s/g, ' ');
}
if (itemShowType * 1 === 8) {
var descDom = document.getElementById('js_image_desc');
descDom && (descDom.innerHTML = desc);
if (location.href.indexOf('immerse_style=1') > -1 && descDom) {
var r = window.innerHeight - descDom.getBoundingClientRect().y - document.getElementById('wx_expand_bottom').offsetHeight;
var l = window.getComputedStyle(descDom).lineHeight;
window.__immersiveFullDesc = desc;
window.__immersiveOmited = 1;
textOverflow(descDom, {
value: {
lineClamp: Math.floor(r / parseFloat(l)),
html: '... 展开'
}
});
}
} else if (itemShowType * 1 === 10) {
var dom = document.querySelector('.js_share_notice_dom');
var _descDom = document.getElementById('js_text_desc');
_descDom && (_descDom.innerHTML = desc);
if (extData.superVoteId) dom && dom.classList.add('no_min_height');
var titleDom = document.getElementById('js_text_title');
var titleRect = titleDom ? titleDom.getBoundingClientRect() : undefined;
var descRect = _descDom ? _descDom.getBoundingClientRect() : undefined;
if (titleRect && titleRect.height > 17 * 1.4 + 2 || descRect && descRect.height > 17 * 1.6 + 2 || extData.superVoteId) {
dom && dom.classList.add('text_align_left');
}
} else if (isAudioPage(itemShowType)) {
document.querySelector('#js_audio_desc') && (document.querySelector('#js_audio_desc').innerHTML = desc);
} else {
var _descDom2 = document.getElementById('js_common_share_desc');
var descDomWrap = document.getElementById('js_common_share_desc_wrap');
if (!_descDom2 || !descDomWrap) {
return;
}
_descDom2.innerHTML = desc;
if (itemShowType * 1 !== 5) {
setTimeout(function () {
var folderSwitcher = document.getElementById('js_folder_text_switch');
if (_descDom2.offsetHeight - descDomWrap.offsetHeight > 1) {
descDomWrap.className += ' weui-ellipsis_multi';
folderSwitcher.style.display = 'block';
} else {
folderSwitcher.style.display = 'none';
}
}, 300);
}
}
};
if (!window.__second_open__) {
var videoContentNoEncode = window.a_value_which_never_exists || '当出差的你在机场焦急寻找着登机口,转头一看,却发现一群人跟着音乐踩起了动感单车……看似违和的搭配,但当代年轻人确实是把健身卷到了机场这一出行场景。\x0a到底什么人会在机场健身?开办机场健身房能赚钱吗?本期的《体育研究所》继续来带大家探秘新鲜好玩的体育内容。欢迎移步B站、抖音关注「体育研究所」,一键三连多多支持!';
var TextContentNoEncode = window.a_value_which_never_exists || '';
var ContentNoEncode = window.a_value_which_never_exists || '当出差的你在机场焦急寻找着登机口,转头一看,却发现一群人跟着音乐踩起了动感单车……看似违和的搭配,但当代年轻人确实是把健身卷到了机场这一出行场景。\x0a到底什么人会在机场健身?开办机场健身房能赚钱吗?本期的《体育研究所》继续来带大家探秘新鲜好玩的体育内容。欢迎移步B站、抖音关注「体育研究所」,一键三连多多支持!';
var itemShowType = window.a_value_which_never_exists || '5';
var content = window.a_value_which_never_exists || '';
var desc = window.a_value_which_never_exists || '当出差的你在机场焦急寻找着登机口,转头一看,却发现一群人跟着音乐踩起了动感单车……看似违和的搭配,但当代年轻人确实是把健身卷到了机场这一出行场景。\x0a到底什么人会在机场健身?开办机场健身房能赚钱吗?本期的《体育研究所》继续来带大家探秘新鲜好玩的体育内容。欢迎移步B站、抖音关注「体育研究所」,一键三连多多支持!';
var superVoteId = window.a_value_which_never_exists || '';
var extData = {
superVoteId: superVoteId
};
if (videoContentNoEncode) {
__setDesc(videoContentNoEncode, true, itemShowType, extData);
} else if (itemShowType * 1 === 10 && (ContentNoEncode || superVoteId) || isAudioPage(itemShowType) && ContentNoEncode) {
__setDesc(ContentNoEncode, true, itemShowType, extData);
} else if (TextContentNoEncode) {
__setDesc(TextContentNoEncode, true, itemShowType, extData);
} else if (itemShowType * 1 === 8) {
__setDesc(content || desc, true, itemShowType, extData);
} else {
__setDesc(desc, false, itemShowType, extData);
}
window.__setDesc = __setDesc;
}
return __setDesc;
})();