V2Next-Mobile

V2Next - 一个好用的V2EX脚本! 移动端专用

目前为 2024-03-14 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name V2Next-Mobile
  3. // @namespace http://tampermonkey.net/
  4. // @version 8.3
  5. // @author zyronon
  6. // @description V2Next - 一个好用的V2EX脚本! 移动端专用
  7. // @license GPL License
  8. // @icon https://v2next.netlify.app/favicon.ico
  9. // @homepage https://github.com/zyronon/web-scripts
  10. // @homepageURL https://github.com/zyronon/web-scripts
  11. // @supportURL https://update.greasyfork.org/scripts/485356/V2Next-Mobile.user.js
  12. // @match https://v2ex.com/
  13. // @match https://v2ex.com/?tab=*
  14. // @match https://v2ex.com/t/*
  15. // @match https://v2ex.com/recent*
  16. // @match https://v2ex.com/go/*
  17. // @match https://v2ex.com/member/*
  18. // @match https://v2ex.com/changes*
  19. // @match https://*.v2ex.com/
  20. // @match https://*.v2ex.com/?tab=*
  21. // @match https://*.v2ex.com/t/*
  22. // @match https://*.v2ex.com/recent*
  23. // @match https://*.v2ex.com/go/*
  24. // @match https://*.v2ex.com/member/*
  25. // @match https://*.v2ex.com/changes*
  26. // @require http://code.jquery.com/jquery-3.7.1.min.js
  27. // @require https://cdn.jsdelivr.net/npm/vue@3.4.14/dist/vue.global.prod.js
  28. // @grant GM_addStyle
  29. // @grant GM_notification
  30. // @grant GM_openInTab
  31. // @grant GM_registerMenuCommand
  32. // ==/UserScript==
  33.  
  34.  
  35. (function (vue) {
  36. 'use strict';
  37.  
  38. var PageType = /* @__PURE__ */ ((PageType2) => {
  39. PageType2["Home"] = "Home";
  40. PageType2["Node"] = "Node";
  41. PageType2["Post"] = "Post";
  42. PageType2["Member"] = "Member";
  43. PageType2["Changes"] = "Changes";
  44. return PageType2;
  45. })(PageType || {});
  46. var CommentDisplayType = /* @__PURE__ */ ((CommentDisplayType2) => {
  47. CommentDisplayType2[CommentDisplayType2["FloorInFloor"] = 0] = "FloorInFloor";
  48. CommentDisplayType2[CommentDisplayType2["FloorInFloorNoCallUser"] = 4] = "FloorInFloorNoCallUser";
  49. CommentDisplayType2[CommentDisplayType2["FloorInFloorNested"] = 5] = "FloorInFloorNested";
  50. CommentDisplayType2[CommentDisplayType2["Like"] = 1] = "Like";
  51. CommentDisplayType2[CommentDisplayType2["V2exOrigin"] = 2] = "V2exOrigin";
  52. CommentDisplayType2[CommentDisplayType2["OnlyOp"] = 3] = "OnlyOp";
  53. CommentDisplayType2[CommentDisplayType2["New"] = 6] = "New";
  54. return CommentDisplayType2;
  55. })(CommentDisplayType || {});
  56. const MAX_REPLY_LIMIT = 400;
  57. const _sfc_main$r = {
  58. name: "Tooltip",
  59. props: {
  60. title: {
  61. type: String,
  62. default() {
  63. return "";
  64. }
  65. },
  66. disabled: {
  67. type: Boolean,
  68. default() {
  69. return false;
  70. }
  71. }
  72. },
  73. data() {
  74. return {
  75. show: false
  76. };
  77. },
  78. methods: {
  79. showPop(e2) {
  80. if (this.disabled)
  81. return;
  82. if (!this.title)
  83. return;
  84. e2.stopPropagation();
  85. let rect = e2.target.getBoundingClientRect();
  86. this.show = true;
  87. vue.nextTick(() => {
  88. var _a, _b;
  89. let tip = (_b = (_a = this.$refs) == null ? void 0 : _a.tip) == null ? void 0 : _b.getBoundingClientRect();
  90. if (!tip)
  91. return;
  92. if (rect.top < 50) {
  93. this.$refs.tip.style.top = rect.top + rect.height + 10 + "px";
  94. } else {
  95. this.$refs.tip.style.top = rect.top - tip.height - 10 + "px";
  96. }
  97. let tipWidth = tip.width;
  98. let rectWidth = rect.width;
  99. this.$refs.tip.style.left = rect.left - (tipWidth - rectWidth) / 2 + "px";
  100. });
  101. }
  102. },
  103. render() {
  104. let Vnode = this.$slots.default()[0];
  105. return vue.createVNode(vue.Fragment, null, [this.show && this.title && vue.createVNode(vue.Teleport, {
  106. "to": "body"
  107. }, {
  108. default: () => [vue.createVNode(vue.Transition, {
  109. "name": "fade"
  110. }, {
  111. default: () => [vue.createVNode("div", {
  112. "ref": "tip",
  113. "className": "tip"
  114. }, [this.title])]
  115. })]
  116. }), vue.createVNode(Vnode, {
  117. "onClick": () => this.show = false,
  118. "onmouseenter": (e2) => this.showPop(e2),
  119. "onmouseleave": () => this.show = false
  120. }, null)]);
  121. }
  122. };
  123. const _export_sfc = (sfc, props) => {
  124. const target = sfc.__vccOpts || sfc;
  125. for (const [key, val] of props) {
  126. target[key] = val;
  127. }
  128. return target;
  129. };
  130. const Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-ee672411"]]);
  131. const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
  132. __name: "BaseSwitch",
  133. props: {
  134. modelValue: { type: Boolean }
  135. },
  136. emits: ["update:modelValue"],
  137. setup(__props, { emit: __emit }) {
  138. return (_ctx, _cache) => {
  139. return vue.openBlock(), vue.createElementBlock("div", {
  140. class: vue.normalizeClass(["switch", { active: _ctx.modelValue }]),
  141. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", !_ctx.modelValue))
  142. }, null, 2);
  143. };
  144. }
  145. });
  146. const BaseSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-e7c0fbef"]]);
  147. const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
  148. const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
  149. const colonSeparated = value.split(":");
  150. if (value.slice(0, 1) === "@") {
  151. if (colonSeparated.length < 2 || colonSeparated.length > 3) {
  152. return null;
  153. }
  154. provider = colonSeparated.shift().slice(1);
  155. }
  156. if (colonSeparated.length > 3 || !colonSeparated.length) {
  157. return null;
  158. }
  159. if (colonSeparated.length > 1) {
  160. const name2 = colonSeparated.pop();
  161. const prefix = colonSeparated.pop();
  162. const result = {
  163. // Allow provider without '@': "provider:prefix:name"
  164. provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
  165. prefix,
  166. name: name2
  167. };
  168. return validate && !validateIconName(result) ? null : result;
  169. }
  170. const name = colonSeparated[0];
  171. const dashSeparated = name.split("-");
  172. if (dashSeparated.length > 1) {
  173. const result = {
  174. provider,
  175. prefix: dashSeparated.shift(),
  176. name: dashSeparated.join("-")
  177. };
  178. return validate && !validateIconName(result) ? null : result;
  179. }
  180. if (allowSimpleName && provider === "") {
  181. const result = {
  182. provider,
  183. prefix: "",
  184. name
  185. };
  186. return validate && !validateIconName(result, allowSimpleName) ? null : result;
  187. }
  188. return null;
  189. };
  190. const validateIconName = (icon, allowSimpleName) => {
  191. if (!icon) {
  192. return false;
  193. }
  194. return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
  195. };
  196. const defaultIconDimensions = Object.freeze(
  197. {
  198. left: 0,
  199. top: 0,
  200. width: 16,
  201. height: 16
  202. }
  203. );
  204. const defaultIconTransformations = Object.freeze({
  205. rotate: 0,
  206. vFlip: false,
  207. hFlip: false
  208. });
  209. const defaultIconProps = Object.freeze({
  210. ...defaultIconDimensions,
  211. ...defaultIconTransformations
  212. });
  213. const defaultExtendedIconProps = Object.freeze({
  214. ...defaultIconProps,
  215. body: "",
  216. hidden: false
  217. });
  218. function mergeIconTransformations(obj1, obj2) {
  219. const result = {};
  220. if (!obj1.hFlip !== !obj2.hFlip) {
  221. result.hFlip = true;
  222. }
  223. if (!obj1.vFlip !== !obj2.vFlip) {
  224. result.vFlip = true;
  225. }
  226. const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
  227. if (rotate) {
  228. result.rotate = rotate;
  229. }
  230. return result;
  231. }
  232. function mergeIconData(parent, child) {
  233. const result = mergeIconTransformations(parent, child);
  234. for (const key in defaultExtendedIconProps) {
  235. if (key in defaultIconTransformations) {
  236. if (key in parent && !(key in result)) {
  237. result[key] = defaultIconTransformations[key];
  238. }
  239. } else if (key in child) {
  240. result[key] = child[key];
  241. } else if (key in parent) {
  242. result[key] = parent[key];
  243. }
  244. }
  245. return result;
  246. }
  247. function getIconsTree(data, names) {
  248. const icons = data.icons;
  249. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  250. const resolved = /* @__PURE__ */ Object.create(null);
  251. function resolve(name) {
  252. if (icons[name]) {
  253. return resolved[name] = [];
  254. }
  255. if (!(name in resolved)) {
  256. resolved[name] = null;
  257. const parent = aliases[name] && aliases[name].parent;
  258. const value = parent && resolve(parent);
  259. if (value) {
  260. resolved[name] = [parent].concat(value);
  261. }
  262. }
  263. return resolved[name];
  264. }
  265. (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
  266. return resolved;
  267. }
  268. function internalGetIconData(data, name, tree) {
  269. const icons = data.icons;
  270. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  271. let currentProps = {};
  272. function parse(name2) {
  273. currentProps = mergeIconData(
  274. icons[name2] || aliases[name2],
  275. currentProps
  276. );
  277. }
  278. parse(name);
  279. tree.forEach(parse);
  280. return mergeIconData(data, currentProps);
  281. }
  282. function parseIconSet(data, callback) {
  283. const names = [];
  284. if (typeof data !== "object" || typeof data.icons !== "object") {
  285. return names;
  286. }
  287. if (data.not_found instanceof Array) {
  288. data.not_found.forEach((name) => {
  289. callback(name, null);
  290. names.push(name);
  291. });
  292. }
  293. const tree = getIconsTree(data);
  294. for (const name in tree) {
  295. const item = tree[name];
  296. if (item) {
  297. callback(name, internalGetIconData(data, name, item));
  298. names.push(name);
  299. }
  300. }
  301. return names;
  302. }
  303. const optionalPropertyDefaults = {
  304. provider: "",
  305. aliases: {},
  306. not_found: {},
  307. ...defaultIconDimensions
  308. };
  309. function checkOptionalProps(item, defaults) {
  310. for (const prop in defaults) {
  311. if (prop in item && typeof item[prop] !== typeof defaults[prop]) {
  312. return false;
  313. }
  314. }
  315. return true;
  316. }
  317. function quicklyValidateIconSet(obj) {
  318. if (typeof obj !== "object" || obj === null) {
  319. return null;
  320. }
  321. const data = obj;
  322. if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
  323. return null;
  324. }
  325. if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
  326. return null;
  327. }
  328. const icons = data.icons;
  329. for (const name in icons) {
  330. const icon = icons[name];
  331. if (!name.match(matchIconName) || typeof icon.body !== "string" || !checkOptionalProps(
  332. icon,
  333. defaultExtendedIconProps
  334. )) {
  335. return null;
  336. }
  337. }
  338. const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
  339. for (const name in aliases) {
  340. const icon = aliases[name];
  341. const parent = icon.parent;
  342. if (!name.match(matchIconName) || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(
  343. icon,
  344. defaultExtendedIconProps
  345. )) {
  346. return null;
  347. }
  348. }
  349. return data;
  350. }
  351. const dataStorage = /* @__PURE__ */ Object.create(null);
  352. function newStorage(provider, prefix) {
  353. return {
  354. provider,
  355. prefix,
  356. icons: /* @__PURE__ */ Object.create(null),
  357. missing: /* @__PURE__ */ new Set()
  358. };
  359. }
  360. function getStorage(provider, prefix) {
  361. const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
  362. return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
  363. }
  364. function addIconSet(storage2, data) {
  365. if (!quicklyValidateIconSet(data)) {
  366. return [];
  367. }
  368. return parseIconSet(data, (name, icon) => {
  369. if (icon) {
  370. storage2.icons[name] = icon;
  371. } else {
  372. storage2.missing.add(name);
  373. }
  374. });
  375. }
  376. function addIconToStorage(storage2, name, icon) {
  377. try {
  378. if (typeof icon.body === "string") {
  379. storage2.icons[name] = { ...icon };
  380. return true;
  381. }
  382. } catch (err) {
  383. }
  384. return false;
  385. }
  386. let simpleNames = false;
  387. function allowSimpleNames(allow) {
  388. if (typeof allow === "boolean") {
  389. simpleNames = allow;
  390. }
  391. return simpleNames;
  392. }
  393. function getIconData(name) {
  394. const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
  395. if (icon) {
  396. const storage2 = getStorage(icon.provider, icon.prefix);
  397. const iconName = icon.name;
  398. return storage2.icons[iconName] || (storage2.missing.has(iconName) ? null : void 0);
  399. }
  400. }
  401. function addIcon(name, data) {
  402. const icon = stringToIcon(name, true, simpleNames);
  403. if (!icon) {
  404. return false;
  405. }
  406. const storage2 = getStorage(icon.provider, icon.prefix);
  407. return addIconToStorage(storage2, icon.name, data);
  408. }
  409. function addCollection(data, provider) {
  410. if (typeof data !== "object") {
  411. return false;
  412. }
  413. if (typeof provider !== "string") {
  414. provider = data.provider || "";
  415. }
  416. if (simpleNames && !provider && !data.prefix) {
  417. let added = false;
  418. if (quicklyValidateIconSet(data)) {
  419. data.prefix = "";
  420. parseIconSet(data, (name, icon) => {
  421. if (icon && addIcon(name, icon)) {
  422. added = true;
  423. }
  424. });
  425. }
  426. return added;
  427. }
  428. const prefix = data.prefix;
  429. if (!validateIconName({
  430. provider,
  431. prefix,
  432. name: "a"
  433. })) {
  434. return false;
  435. }
  436. const storage2 = getStorage(provider, prefix);
  437. return !!addIconSet(storage2, data);
  438. }
  439. const defaultIconSizeCustomisations = Object.freeze({
  440. width: null,
  441. height: null
  442. });
  443. const defaultIconCustomisations = Object.freeze({
  444. // Dimensions
  445. ...defaultIconSizeCustomisations,
  446. // Transformations
  447. ...defaultIconTransformations
  448. });
  449. const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
  450. const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
  451. function calculateSize(size, ratio, precision) {
  452. if (ratio === 1) {
  453. return size;
  454. }
  455. precision = precision || 100;
  456. if (typeof size === "number") {
  457. return Math.ceil(size * ratio * precision) / precision;
  458. }
  459. if (typeof size !== "string") {
  460. return size;
  461. }
  462. const oldParts = size.split(unitsSplit);
  463. if (oldParts === null || !oldParts.length) {
  464. return size;
  465. }
  466. const newParts = [];
  467. let code = oldParts.shift();
  468. let isNumber = unitsTest.test(code);
  469. while (true) {
  470. if (isNumber) {
  471. const num = parseFloat(code);
  472. if (isNaN(num)) {
  473. newParts.push(code);
  474. } else {
  475. newParts.push(Math.ceil(num * ratio * precision) / precision);
  476. }
  477. } else {
  478. newParts.push(code);
  479. }
  480. code = oldParts.shift();
  481. if (code === void 0) {
  482. return newParts.join("");
  483. }
  484. isNumber = !isNumber;
  485. }
  486. }
  487. const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
  488. function iconToSVG(icon, customisations) {
  489. const fullIcon = {
  490. ...defaultIconProps,
  491. ...icon
  492. };
  493. const fullCustomisations = {
  494. ...defaultIconCustomisations,
  495. ...customisations
  496. };
  497. const box = {
  498. left: fullIcon.left,
  499. top: fullIcon.top,
  500. width: fullIcon.width,
  501. height: fullIcon.height
  502. };
  503. let body = fullIcon.body;
  504. [fullIcon, fullCustomisations].forEach((props) => {
  505. const transformations = [];
  506. const hFlip = props.hFlip;
  507. const vFlip = props.vFlip;
  508. let rotation = props.rotate;
  509. if (hFlip) {
  510. if (vFlip) {
  511. rotation += 2;
  512. } else {
  513. transformations.push(
  514. "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
  515. );
  516. transformations.push("scale(-1 1)");
  517. box.top = box.left = 0;
  518. }
  519. } else if (vFlip) {
  520. transformations.push(
  521. "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
  522. );
  523. transformations.push("scale(1 -1)");
  524. box.top = box.left = 0;
  525. }
  526. let tempValue;
  527. if (rotation < 0) {
  528. rotation -= Math.floor(rotation / 4) * 4;
  529. }
  530. rotation = rotation % 4;
  531. switch (rotation) {
  532. case 1:
  533. tempValue = box.height / 2 + box.top;
  534. transformations.unshift(
  535. "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
  536. );
  537. break;
  538. case 2:
  539. transformations.unshift(
  540. "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
  541. );
  542. break;
  543. case 3:
  544. tempValue = box.width / 2 + box.left;
  545. transformations.unshift(
  546. "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
  547. );
  548. break;
  549. }
  550. if (rotation % 2 === 1) {
  551. if (box.left !== box.top) {
  552. tempValue = box.left;
  553. box.left = box.top;
  554. box.top = tempValue;
  555. }
  556. if (box.width !== box.height) {
  557. tempValue = box.width;
  558. box.width = box.height;
  559. box.height = tempValue;
  560. }
  561. }
  562. if (transformations.length) {
  563. body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
  564. }
  565. });
  566. const customisationsWidth = fullCustomisations.width;
  567. const customisationsHeight = fullCustomisations.height;
  568. const boxWidth = box.width;
  569. const boxHeight = box.height;
  570. let width;
  571. let height;
  572. if (customisationsWidth === null) {
  573. height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
  574. width = calculateSize(height, boxWidth / boxHeight);
  575. } else {
  576. width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
  577. height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
  578. }
  579. const attributes = {};
  580. const setAttr = (prop, value) => {
  581. if (!isUnsetKeyword(value)) {
  582. attributes[prop] = value.toString();
  583. }
  584. };
  585. setAttr("width", width);
  586. setAttr("height", height);
  587. attributes.viewBox = box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString();
  588. return {
  589. attributes,
  590. body
  591. };
  592. }
  593. const regex = /\sid="(\S+)"/g;
  594. const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
  595. let counter = 0;
  596. function replaceIDs(body, prefix = randomPrefix) {
  597. const ids = [];
  598. let match;
  599. while (match = regex.exec(body)) {
  600. ids.push(match[1]);
  601. }
  602. if (!ids.length) {
  603. return body;
  604. }
  605. const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
  606. ids.forEach((id) => {
  607. const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
  608. const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
  609. body = body.replace(
  610. // Allowed characters before id: [#;"]
  611. // Allowed characters after id: [)"], .[a-z]
  612. new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
  613. "$1" + newID + suffix + "$3"
  614. );
  615. });
  616. body = body.replace(new RegExp(suffix, "g"), "");
  617. return body;
  618. }
  619. const storage = /* @__PURE__ */ Object.create(null);
  620. function setAPIModule(provider, item) {
  621. storage[provider] = item;
  622. }
  623. function getAPIModule(provider) {
  624. return storage[provider] || storage[""];
  625. }
  626. function createAPIConfig(source) {
  627. let resources;
  628. if (typeof source.resources === "string") {
  629. resources = [source.resources];
  630. } else {
  631. resources = source.resources;
  632. if (!(resources instanceof Array) || !resources.length) {
  633. return null;
  634. }
  635. }
  636. const result = {
  637. // API hosts
  638. resources,
  639. // Root path
  640. path: source.path || "/",
  641. // URL length limit
  642. maxURL: source.maxURL || 500,
  643. // Timeout before next host is used.
  644. rotate: source.rotate || 750,
  645. // Timeout before failing query.
  646. timeout: source.timeout || 5e3,
  647. // Randomise default API end point.
  648. random: source.random === true,
  649. // Start index
  650. index: source.index || 0,
  651. // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
  652. dataAfterTimeout: source.dataAfterTimeout !== false
  653. };
  654. return result;
  655. }
  656. const configStorage = /* @__PURE__ */ Object.create(null);
  657. const fallBackAPISources = [
  658. "https://api.simplesvg.com",
  659. "https://api.unisvg.com"
  660. ];
  661. const fallBackAPI = [];
  662. while (fallBackAPISources.length > 0) {
  663. if (fallBackAPISources.length === 1) {
  664. fallBackAPI.push(fallBackAPISources.shift());
  665. } else {
  666. if (Math.random() > 0.5) {
  667. fallBackAPI.push(fallBackAPISources.shift());
  668. } else {
  669. fallBackAPI.push(fallBackAPISources.pop());
  670. }
  671. }
  672. }
  673. configStorage[""] = createAPIConfig({
  674. resources: ["https://api.iconify.design"].concat(fallBackAPI)
  675. });
  676. function addAPIProvider(provider, customConfig) {
  677. const config2 = createAPIConfig(customConfig);
  678. if (config2 === null) {
  679. return false;
  680. }
  681. configStorage[provider] = config2;
  682. return true;
  683. }
  684. function getAPIConfig(provider) {
  685. return configStorage[provider];
  686. }
  687. const detectFetch = () => {
  688. let callback;
  689. try {
  690. callback = fetch;
  691. if (typeof callback === "function") {
  692. return callback;
  693. }
  694. } catch (err) {
  695. }
  696. };
  697. let fetchModule = detectFetch();
  698. function calculateMaxLength(provider, prefix) {
  699. const config2 = getAPIConfig(provider);
  700. if (!config2) {
  701. return 0;
  702. }
  703. let result;
  704. if (!config2.maxURL) {
  705. result = 0;
  706. } else {
  707. let maxHostLength = 0;
  708. config2.resources.forEach((item) => {
  709. const host = item;
  710. maxHostLength = Math.max(maxHostLength, host.length);
  711. });
  712. const url = prefix + ".json?icons=";
  713. result = config2.maxURL - maxHostLength - config2.path.length - url.length;
  714. }
  715. return result;
  716. }
  717. function shouldAbort(status) {
  718. return status === 404;
  719. }
  720. const prepare = (provider, prefix, icons) => {
  721. const results = [];
  722. const maxLength = calculateMaxLength(provider, prefix);
  723. const type = "icons";
  724. let item = {
  725. type,
  726. provider,
  727. prefix,
  728. icons: []
  729. };
  730. let length = 0;
  731. icons.forEach((name, index) => {
  732. length += name.length + 1;
  733. if (length >= maxLength && index > 0) {
  734. results.push(item);
  735. item = {
  736. type,
  737. provider,
  738. prefix,
  739. icons: []
  740. };
  741. length = name.length;
  742. }
  743. item.icons.push(name);
  744. });
  745. results.push(item);
  746. return results;
  747. };
  748. function getPath(provider) {
  749. if (typeof provider === "string") {
  750. const config2 = getAPIConfig(provider);
  751. if (config2) {
  752. return config2.path;
  753. }
  754. }
  755. return "/";
  756. }
  757. const send = (host, params, callback) => {
  758. if (!fetchModule) {
  759. callback("abort", 424);
  760. return;
  761. }
  762. let path = getPath(params.provider);
  763. switch (params.type) {
  764. case "icons": {
  765. const prefix = params.prefix;
  766. const icons = params.icons;
  767. const iconsList = icons.join(",");
  768. const urlParams = new URLSearchParams({
  769. icons: iconsList
  770. });
  771. path += prefix + ".json?" + urlParams.toString();
  772. break;
  773. }
  774. case "custom": {
  775. const uri = params.uri;
  776. path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
  777. break;
  778. }
  779. default:
  780. callback("abort", 400);
  781. return;
  782. }
  783. let defaultError = 503;
  784. fetchModule(host + path).then((response) => {
  785. const status = response.status;
  786. if (status !== 200) {
  787. setTimeout(() => {
  788. callback(shouldAbort(status) ? "abort" : "next", status);
  789. });
  790. return;
  791. }
  792. defaultError = 501;
  793. return response.json();
  794. }).then((data) => {
  795. if (typeof data !== "object" || data === null) {
  796. setTimeout(() => {
  797. if (data === 404) {
  798. callback("abort", data);
  799. } else {
  800. callback("next", defaultError);
  801. }
  802. });
  803. return;
  804. }
  805. setTimeout(() => {
  806. callback("success", data);
  807. });
  808. }).catch(() => {
  809. callback("next", defaultError);
  810. });
  811. };
  812. const fetchAPIModule = {
  813. prepare,
  814. send
  815. };
  816. function sortIcons(icons) {
  817. const result = {
  818. loaded: [],
  819. missing: [],
  820. pending: []
  821. };
  822. const storage2 = /* @__PURE__ */ Object.create(null);
  823. icons.sort((a, b) => {
  824. if (a.provider !== b.provider) {
  825. return a.provider.localeCompare(b.provider);
  826. }
  827. if (a.prefix !== b.prefix) {
  828. return a.prefix.localeCompare(b.prefix);
  829. }
  830. return a.name.localeCompare(b.name);
  831. });
  832. let lastIcon = {
  833. provider: "",
  834. prefix: "",
  835. name: ""
  836. };
  837. icons.forEach((icon) => {
  838. if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
  839. return;
  840. }
  841. lastIcon = icon;
  842. const provider = icon.provider;
  843. const prefix = icon.prefix;
  844. const name = icon.name;
  845. const providerStorage = storage2[provider] || (storage2[provider] = /* @__PURE__ */ Object.create(null));
  846. const localStorage2 = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
  847. let list;
  848. if (name in localStorage2.icons) {
  849. list = result.loaded;
  850. } else if (prefix === "" || localStorage2.missing.has(name)) {
  851. list = result.missing;
  852. } else {
  853. list = result.pending;
  854. }
  855. const item = {
  856. provider,
  857. prefix,
  858. name
  859. };
  860. list.push(item);
  861. });
  862. return result;
  863. }
  864. function removeCallback(storages, id) {
  865. storages.forEach((storage2) => {
  866. const items = storage2.loaderCallbacks;
  867. if (items) {
  868. storage2.loaderCallbacks = items.filter((row) => row.id !== id);
  869. }
  870. });
  871. }
  872. function updateCallbacks(storage2) {
  873. if (!storage2.pendingCallbacksFlag) {
  874. storage2.pendingCallbacksFlag = true;
  875. setTimeout(() => {
  876. storage2.pendingCallbacksFlag = false;
  877. const items = storage2.loaderCallbacks ? storage2.loaderCallbacks.slice(0) : [];
  878. if (!items.length) {
  879. return;
  880. }
  881. let hasPending = false;
  882. const provider = storage2.provider;
  883. const prefix = storage2.prefix;
  884. items.forEach((item) => {
  885. const icons = item.icons;
  886. const oldLength = icons.pending.length;
  887. icons.pending = icons.pending.filter((icon) => {
  888. if (icon.prefix !== prefix) {
  889. return true;
  890. }
  891. const name = icon.name;
  892. if (storage2.icons[name]) {
  893. icons.loaded.push({
  894. provider,
  895. prefix,
  896. name
  897. });
  898. } else if (storage2.missing.has(name)) {
  899. icons.missing.push({
  900. provider,
  901. prefix,
  902. name
  903. });
  904. } else {
  905. hasPending = true;
  906. return true;
  907. }
  908. return false;
  909. });
  910. if (icons.pending.length !== oldLength) {
  911. if (!hasPending) {
  912. removeCallback([storage2], item.id);
  913. }
  914. item.callback(
  915. icons.loaded.slice(0),
  916. icons.missing.slice(0),
  917. icons.pending.slice(0),
  918. item.abort
  919. );
  920. }
  921. });
  922. });
  923. }
  924. }
  925. let idCounter = 0;
  926. function storeCallback(callback, icons, pendingSources) {
  927. const id = idCounter++;
  928. const abort = removeCallback.bind(null, pendingSources, id);
  929. if (!icons.pending.length) {
  930. return abort;
  931. }
  932. const item = {
  933. id,
  934. icons,
  935. callback,
  936. abort
  937. };
  938. pendingSources.forEach((storage2) => {
  939. (storage2.loaderCallbacks || (storage2.loaderCallbacks = [])).push(item);
  940. });
  941. return abort;
  942. }
  943. function listToIcons(list, validate = true, simpleNames2 = false) {
  944. const result = [];
  945. list.forEach((item) => {
  946. const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames2) : item;
  947. if (icon) {
  948. result.push(icon);
  949. }
  950. });
  951. return result;
  952. }
  953. var defaultConfig = {
  954. resources: [],
  955. index: 0,
  956. timeout: 2e3,
  957. rotate: 750,
  958. random: false,
  959. dataAfterTimeout: false
  960. };
  961. function sendQuery(config2, payload, query, done) {
  962. const resourcesCount = config2.resources.length;
  963. const startIndex = config2.random ? Math.floor(Math.random() * resourcesCount) : config2.index;
  964. let resources;
  965. if (config2.random) {
  966. let list = config2.resources.slice(0);
  967. resources = [];
  968. while (list.length > 1) {
  969. const nextIndex = Math.floor(Math.random() * list.length);
  970. resources.push(list[nextIndex]);
  971. list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
  972. }
  973. resources = resources.concat(list);
  974. } else {
  975. resources = config2.resources.slice(startIndex).concat(config2.resources.slice(0, startIndex));
  976. }
  977. const startTime = Date.now();
  978. let status = "pending";
  979. let queriesSent = 0;
  980. let lastError;
  981. let timer = null;
  982. let queue = [];
  983. let doneCallbacks = [];
  984. if (typeof done === "function") {
  985. doneCallbacks.push(done);
  986. }
  987. function resetTimer() {
  988. if (timer) {
  989. clearTimeout(timer);
  990. timer = null;
  991. }
  992. }
  993. function abort() {
  994. if (status === "pending") {
  995. status = "aborted";
  996. }
  997. resetTimer();
  998. queue.forEach((item) => {
  999. if (item.status === "pending") {
  1000. item.status = "aborted";
  1001. }
  1002. });
  1003. queue = [];
  1004. }
  1005. function subscribe(callback, overwrite) {
  1006. if (overwrite) {
  1007. doneCallbacks = [];
  1008. }
  1009. if (typeof callback === "function") {
  1010. doneCallbacks.push(callback);
  1011. }
  1012. }
  1013. function getQueryStatus() {
  1014. return {
  1015. startTime,
  1016. payload,
  1017. status,
  1018. queriesSent,
  1019. queriesPending: queue.length,
  1020. subscribe,
  1021. abort
  1022. };
  1023. }
  1024. function failQuery() {
  1025. status = "failed";
  1026. doneCallbacks.forEach((callback) => {
  1027. callback(void 0, lastError);
  1028. });
  1029. }
  1030. function clearQueue() {
  1031. queue.forEach((item) => {
  1032. if (item.status === "pending") {
  1033. item.status = "aborted";
  1034. }
  1035. });
  1036. queue = [];
  1037. }
  1038. function moduleResponse(item, response, data) {
  1039. const isError = response !== "success";
  1040. queue = queue.filter((queued) => queued !== item);
  1041. switch (status) {
  1042. case "pending":
  1043. break;
  1044. case "failed":
  1045. if (isError || !config2.dataAfterTimeout) {
  1046. return;
  1047. }
  1048. break;
  1049. default:
  1050. return;
  1051. }
  1052. if (response === "abort") {
  1053. lastError = data;
  1054. failQuery();
  1055. return;
  1056. }
  1057. if (isError) {
  1058. lastError = data;
  1059. if (!queue.length) {
  1060. if (!resources.length) {
  1061. failQuery();
  1062. } else {
  1063. execNext();
  1064. }
  1065. }
  1066. return;
  1067. }
  1068. resetTimer();
  1069. clearQueue();
  1070. if (!config2.random) {
  1071. const index = config2.resources.indexOf(item.resource);
  1072. if (index !== -1 && index !== config2.index) {
  1073. config2.index = index;
  1074. }
  1075. }
  1076. status = "completed";
  1077. doneCallbacks.forEach((callback) => {
  1078. callback(data);
  1079. });
  1080. }
  1081. function execNext() {
  1082. if (status !== "pending") {
  1083. return;
  1084. }
  1085. resetTimer();
  1086. const resource = resources.shift();
  1087. if (resource === void 0) {
  1088. if (queue.length) {
  1089. timer = setTimeout(() => {
  1090. resetTimer();
  1091. if (status === "pending") {
  1092. clearQueue();
  1093. failQuery();
  1094. }
  1095. }, config2.timeout);
  1096. return;
  1097. }
  1098. failQuery();
  1099. return;
  1100. }
  1101. const item = {
  1102. status: "pending",
  1103. resource,
  1104. callback: (status2, data) => {
  1105. moduleResponse(item, status2, data);
  1106. }
  1107. };
  1108. queue.push(item);
  1109. queriesSent++;
  1110. timer = setTimeout(execNext, config2.rotate);
  1111. query(resource, payload, item.callback);
  1112. }
  1113. setTimeout(execNext);
  1114. return getQueryStatus;
  1115. }
  1116. function initRedundancy(cfg) {
  1117. const config2 = {
  1118. ...defaultConfig,
  1119. ...cfg
  1120. };
  1121. let queries = [];
  1122. function cleanup() {
  1123. queries = queries.filter((item) => item().status === "pending");
  1124. }
  1125. function query(payload, queryCallback, doneCallback) {
  1126. const query2 = sendQuery(
  1127. config2,
  1128. payload,
  1129. queryCallback,
  1130. (data, error) => {
  1131. cleanup();
  1132. if (doneCallback) {
  1133. doneCallback(data, error);
  1134. }
  1135. }
  1136. );
  1137. queries.push(query2);
  1138. return query2;
  1139. }
  1140. function find(callback) {
  1141. return queries.find((value) => {
  1142. return callback(value);
  1143. }) || null;
  1144. }
  1145. const instance = {
  1146. query,
  1147. find,
  1148. setIndex: (index) => {
  1149. config2.index = index;
  1150. },
  1151. getIndex: () => config2.index,
  1152. cleanup
  1153. };
  1154. return instance;
  1155. }
  1156. function emptyCallback$1() {
  1157. }
  1158. const redundancyCache = /* @__PURE__ */ Object.create(null);
  1159. function getRedundancyCache(provider) {
  1160. if (!redundancyCache[provider]) {
  1161. const config2 = getAPIConfig(provider);
  1162. if (!config2) {
  1163. return;
  1164. }
  1165. const redundancy = initRedundancy(config2);
  1166. const cachedReundancy = {
  1167. config: config2,
  1168. redundancy
  1169. };
  1170. redundancyCache[provider] = cachedReundancy;
  1171. }
  1172. return redundancyCache[provider];
  1173. }
  1174. function sendAPIQuery(target, query, callback) {
  1175. let redundancy;
  1176. let send2;
  1177. if (typeof target === "string") {
  1178. const api = getAPIModule(target);
  1179. if (!api) {
  1180. callback(void 0, 424);
  1181. return emptyCallback$1;
  1182. }
  1183. send2 = api.send;
  1184. const cached = getRedundancyCache(target);
  1185. if (cached) {
  1186. redundancy = cached.redundancy;
  1187. }
  1188. } else {
  1189. const config2 = createAPIConfig(target);
  1190. if (config2) {
  1191. redundancy = initRedundancy(config2);
  1192. const moduleKey = target.resources ? target.resources[0] : "";
  1193. const api = getAPIModule(moduleKey);
  1194. if (api) {
  1195. send2 = api.send;
  1196. }
  1197. }
  1198. }
  1199. if (!redundancy || !send2) {
  1200. callback(void 0, 424);
  1201. return emptyCallback$1;
  1202. }
  1203. return redundancy.query(query, send2, callback)().abort;
  1204. }
  1205. const browserCacheVersion = "iconify2";
  1206. const browserCachePrefix = "iconify";
  1207. const browserCacheCountKey = browserCachePrefix + "-count";
  1208. const browserCacheVersionKey = browserCachePrefix + "-version";
  1209. const browserStorageHour = 36e5;
  1210. const browserStorageCacheExpiration = 168;
  1211. function getStoredItem(func, key) {
  1212. try {
  1213. return func.getItem(key);
  1214. } catch (err) {
  1215. }
  1216. }
  1217. function setStoredItem(func, key, value) {
  1218. try {
  1219. func.setItem(key, value);
  1220. return true;
  1221. } catch (err) {
  1222. }
  1223. }
  1224. function removeStoredItem(func, key) {
  1225. try {
  1226. func.removeItem(key);
  1227. } catch (err) {
  1228. }
  1229. }
  1230. function setBrowserStorageItemsCount(storage2, value) {
  1231. return setStoredItem(storage2, browserCacheCountKey, value.toString());
  1232. }
  1233. function getBrowserStorageItemsCount(storage2) {
  1234. return parseInt(getStoredItem(storage2, browserCacheCountKey)) || 0;
  1235. }
  1236. const browserStorageConfig = {
  1237. local: true,
  1238. session: true
  1239. };
  1240. const browserStorageEmptyItems = {
  1241. local: /* @__PURE__ */ new Set(),
  1242. session: /* @__PURE__ */ new Set()
  1243. };
  1244. let browserStorageStatus = false;
  1245. function setBrowserStorageStatus(status) {
  1246. browserStorageStatus = status;
  1247. }
  1248. let _window = typeof window === "undefined" ? {} : window;
  1249. function getBrowserStorage(key) {
  1250. const attr = key + "Storage";
  1251. try {
  1252. if (_window && _window[attr] && typeof _window[attr].length === "number") {
  1253. return _window[attr];
  1254. }
  1255. } catch (err) {
  1256. }
  1257. browserStorageConfig[key] = false;
  1258. }
  1259. function iterateBrowserStorage(key, callback) {
  1260. const func = getBrowserStorage(key);
  1261. if (!func) {
  1262. return;
  1263. }
  1264. const version = getStoredItem(func, browserCacheVersionKey);
  1265. if (version !== browserCacheVersion) {
  1266. if (version) {
  1267. const total2 = getBrowserStorageItemsCount(func);
  1268. for (let i = 0; i < total2; i++) {
  1269. removeStoredItem(func, browserCachePrefix + i.toString());
  1270. }
  1271. }
  1272. setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
  1273. setBrowserStorageItemsCount(func, 0);
  1274. return;
  1275. }
  1276. const minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
  1277. const parseItem = (index) => {
  1278. const name = browserCachePrefix + index.toString();
  1279. const item = getStoredItem(func, name);
  1280. if (typeof item !== "string") {
  1281. return;
  1282. }
  1283. try {
  1284. const data = JSON.parse(item);
  1285. if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" && // Valid item: run callback
  1286. callback(data, index)) {
  1287. return true;
  1288. }
  1289. } catch (err) {
  1290. }
  1291. removeStoredItem(func, name);
  1292. };
  1293. let total = getBrowserStorageItemsCount(func);
  1294. for (let i = total - 1; i >= 0; i--) {
  1295. if (!parseItem(i)) {
  1296. if (i === total - 1) {
  1297. total--;
  1298. setBrowserStorageItemsCount(func, total);
  1299. } else {
  1300. browserStorageEmptyItems[key].add(i);
  1301. }
  1302. }
  1303. }
  1304. }
  1305. function initBrowserStorage() {
  1306. if (browserStorageStatus) {
  1307. return;
  1308. }
  1309. setBrowserStorageStatus(true);
  1310. for (const key in browserStorageConfig) {
  1311. iterateBrowserStorage(key, (item) => {
  1312. const iconSet = item.data;
  1313. const provider = item.provider;
  1314. const prefix = iconSet.prefix;
  1315. const storage2 = getStorage(
  1316. provider,
  1317. prefix
  1318. );
  1319. if (!addIconSet(storage2, iconSet).length) {
  1320. return false;
  1321. }
  1322. const lastModified = iconSet.lastModified || -1;
  1323. storage2.lastModifiedCached = storage2.lastModifiedCached ? Math.min(storage2.lastModifiedCached, lastModified) : lastModified;
  1324. return true;
  1325. });
  1326. }
  1327. }
  1328. function updateLastModified(storage2, lastModified) {
  1329. const lastValue = storage2.lastModifiedCached;
  1330. if (
  1331. // Matches or newer
  1332. lastValue && lastValue >= lastModified
  1333. ) {
  1334. return lastValue === lastModified;
  1335. }
  1336. storage2.lastModifiedCached = lastModified;
  1337. if (lastValue) {
  1338. for (const key in browserStorageConfig) {
  1339. iterateBrowserStorage(key, (item) => {
  1340. const iconSet = item.data;
  1341. return item.provider !== storage2.provider || iconSet.prefix !== storage2.prefix || iconSet.lastModified === lastModified;
  1342. });
  1343. }
  1344. }
  1345. return true;
  1346. }
  1347. function storeInBrowserStorage(storage2, data) {
  1348. if (!browserStorageStatus) {
  1349. initBrowserStorage();
  1350. }
  1351. function store(key) {
  1352. let func;
  1353. if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
  1354. return;
  1355. }
  1356. const set = browserStorageEmptyItems[key];
  1357. let index;
  1358. if (set.size) {
  1359. set.delete(index = Array.from(set).shift());
  1360. } else {
  1361. index = getBrowserStorageItemsCount(func);
  1362. if (!setBrowserStorageItemsCount(func, index + 1)) {
  1363. return;
  1364. }
  1365. }
  1366. const item = {
  1367. cached: Math.floor(Date.now() / browserStorageHour),
  1368. provider: storage2.provider,
  1369. data
  1370. };
  1371. return setStoredItem(
  1372. func,
  1373. browserCachePrefix + index.toString(),
  1374. JSON.stringify(item)
  1375. );
  1376. }
  1377. if (data.lastModified && !updateLastModified(storage2, data.lastModified)) {
  1378. return;
  1379. }
  1380. if (!Object.keys(data.icons).length) {
  1381. return;
  1382. }
  1383. if (data.not_found) {
  1384. data = Object.assign({}, data);
  1385. delete data.not_found;
  1386. }
  1387. if (!store("local")) {
  1388. store("session");
  1389. }
  1390. }
  1391. function emptyCallback() {
  1392. }
  1393. function loadedNewIcons(storage2) {
  1394. if (!storage2.iconsLoaderFlag) {
  1395. storage2.iconsLoaderFlag = true;
  1396. setTimeout(() => {
  1397. storage2.iconsLoaderFlag = false;
  1398. updateCallbacks(storage2);
  1399. });
  1400. }
  1401. }
  1402. function loadNewIcons(storage2, icons) {
  1403. if (!storage2.iconsToLoad) {
  1404. storage2.iconsToLoad = icons;
  1405. } else {
  1406. storage2.iconsToLoad = storage2.iconsToLoad.concat(icons).sort();
  1407. }
  1408. if (!storage2.iconsQueueFlag) {
  1409. storage2.iconsQueueFlag = true;
  1410. setTimeout(() => {
  1411. storage2.iconsQueueFlag = false;
  1412. const { provider, prefix } = storage2;
  1413. const icons2 = storage2.iconsToLoad;
  1414. delete storage2.iconsToLoad;
  1415. let api;
  1416. if (!icons2 || !(api = getAPIModule(provider))) {
  1417. return;
  1418. }
  1419. const params = api.prepare(provider, prefix, icons2);
  1420. params.forEach((item) => {
  1421. sendAPIQuery(provider, item, (data) => {
  1422. if (typeof data !== "object") {
  1423. item.icons.forEach((name) => {
  1424. storage2.missing.add(name);
  1425. });
  1426. } else {
  1427. try {
  1428. const parsed = addIconSet(
  1429. storage2,
  1430. data
  1431. );
  1432. if (!parsed.length) {
  1433. return;
  1434. }
  1435. const pending = storage2.pendingIcons;
  1436. if (pending) {
  1437. parsed.forEach((name) => {
  1438. pending.delete(name);
  1439. });
  1440. }
  1441. storeInBrowserStorage(storage2, data);
  1442. } catch (err) {
  1443. console.error(err);
  1444. }
  1445. }
  1446. loadedNewIcons(storage2);
  1447. });
  1448. });
  1449. });
  1450. }
  1451. }
  1452. const loadIcons = (icons, callback) => {
  1453. const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
  1454. const sortedIcons = sortIcons(cleanedIcons);
  1455. if (!sortedIcons.pending.length) {
  1456. let callCallback = true;
  1457. if (callback) {
  1458. setTimeout(() => {
  1459. if (callCallback) {
  1460. callback(
  1461. sortedIcons.loaded,
  1462. sortedIcons.missing,
  1463. sortedIcons.pending,
  1464. emptyCallback
  1465. );
  1466. }
  1467. });
  1468. }
  1469. return () => {
  1470. callCallback = false;
  1471. };
  1472. }
  1473. const newIcons = /* @__PURE__ */ Object.create(null);
  1474. const sources = [];
  1475. let lastProvider, lastPrefix;
  1476. sortedIcons.pending.forEach((icon) => {
  1477. const { provider, prefix } = icon;
  1478. if (prefix === lastPrefix && provider === lastProvider) {
  1479. return;
  1480. }
  1481. lastProvider = provider;
  1482. lastPrefix = prefix;
  1483. sources.push(getStorage(provider, prefix));
  1484. const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
  1485. if (!providerNewIcons[prefix]) {
  1486. providerNewIcons[prefix] = [];
  1487. }
  1488. });
  1489. sortedIcons.pending.forEach((icon) => {
  1490. const { provider, prefix, name } = icon;
  1491. const storage2 = getStorage(provider, prefix);
  1492. const pendingQueue = storage2.pendingIcons || (storage2.pendingIcons = /* @__PURE__ */ new Set());
  1493. if (!pendingQueue.has(name)) {
  1494. pendingQueue.add(name);
  1495. newIcons[provider][prefix].push(name);
  1496. }
  1497. });
  1498. sources.forEach((storage2) => {
  1499. const { provider, prefix } = storage2;
  1500. if (newIcons[provider][prefix].length) {
  1501. loadNewIcons(storage2, newIcons[provider][prefix]);
  1502. }
  1503. });
  1504. return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
  1505. };
  1506. function mergeCustomisations(defaults, item) {
  1507. const result = {
  1508. ...defaults
  1509. };
  1510. for (const key in item) {
  1511. const value = item[key];
  1512. const valueType = typeof value;
  1513. if (key in defaultIconSizeCustomisations) {
  1514. if (value === null || value && (valueType === "string" || valueType === "number")) {
  1515. result[key] = value;
  1516. }
  1517. } else if (valueType === typeof result[key]) {
  1518. result[key] = key === "rotate" ? value % 4 : value;
  1519. }
  1520. }
  1521. return result;
  1522. }
  1523. const separator = /[\s,]+/;
  1524. function flipFromString(custom, flip) {
  1525. flip.split(separator).forEach((str) => {
  1526. const value = str.trim();
  1527. switch (value) {
  1528. case "horizontal":
  1529. custom.hFlip = true;
  1530. break;
  1531. case "vertical":
  1532. custom.vFlip = true;
  1533. break;
  1534. }
  1535. });
  1536. }
  1537. function rotateFromString(value, defaultValue = 0) {
  1538. const units = value.replace(/^-?[0-9.]*/, "");
  1539. function cleanup(value2) {
  1540. while (value2 < 0) {
  1541. value2 += 4;
  1542. }
  1543. return value2 % 4;
  1544. }
  1545. if (units === "") {
  1546. const num = parseInt(value);
  1547. return isNaN(num) ? 0 : cleanup(num);
  1548. } else if (units !== value) {
  1549. let split = 0;
  1550. switch (units) {
  1551. case "%":
  1552. split = 25;
  1553. break;
  1554. case "deg":
  1555. split = 90;
  1556. }
  1557. if (split) {
  1558. let num = parseFloat(value.slice(0, value.length - units.length));
  1559. if (isNaN(num)) {
  1560. return 0;
  1561. }
  1562. num = num / split;
  1563. return num % 1 === 0 ? cleanup(num) : 0;
  1564. }
  1565. }
  1566. return defaultValue;
  1567. }
  1568. function iconToHTML(body, attributes) {
  1569. let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
  1570. for (const attr in attributes) {
  1571. renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
  1572. }
  1573. return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
  1574. }
  1575. function encodeSVGforURL(svg) {
  1576. return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
  1577. }
  1578. function svgToData(svg) {
  1579. return "data:image/svg+xml," + encodeSVGforURL(svg);
  1580. }
  1581. function svgToURL(svg) {
  1582. return 'url("' + svgToData(svg) + '")';
  1583. }
  1584. const defaultExtendedIconCustomisations = {
  1585. ...defaultIconCustomisations,
  1586. inline: false
  1587. };
  1588. const svgDefaults = {
  1589. "xmlns": "http://www.w3.org/2000/svg",
  1590. "xmlns:xlink": "http://www.w3.org/1999/xlink",
  1591. "aria-hidden": true,
  1592. "role": "img"
  1593. };
  1594. const commonProps = {
  1595. display: "inline-block"
  1596. };
  1597. const monotoneProps = {
  1598. backgroundColor: "currentColor"
  1599. };
  1600. const coloredProps = {
  1601. backgroundColor: "transparent"
  1602. };
  1603. const propsToAdd = {
  1604. Image: "var(--svg)",
  1605. Repeat: "no-repeat",
  1606. Size: "100% 100%"
  1607. };
  1608. const propsToAddTo = {
  1609. webkitMask: monotoneProps,
  1610. mask: monotoneProps,
  1611. background: coloredProps
  1612. };
  1613. for (const prefix in propsToAddTo) {
  1614. const list = propsToAddTo[prefix];
  1615. for (const prop in propsToAdd) {
  1616. list[prefix + prop] = propsToAdd[prop];
  1617. }
  1618. }
  1619. const customisationAliases = {};
  1620. ["horizontal", "vertical"].forEach((prefix) => {
  1621. const attr = prefix.slice(0, 1) + "Flip";
  1622. customisationAliases[prefix + "-flip"] = attr;
  1623. customisationAliases[prefix.slice(0, 1) + "-flip"] = attr;
  1624. customisationAliases[prefix + "Flip"] = attr;
  1625. });
  1626. function fixSize(value) {
  1627. return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
  1628. }
  1629. const render = (icon, props) => {
  1630. const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
  1631. const componentProps = { ...svgDefaults };
  1632. const mode = props.mode || "svg";
  1633. const style = {};
  1634. const propsStyle = props.style;
  1635. const customStyle = typeof propsStyle === "object" && !(propsStyle instanceof Array) ? propsStyle : {};
  1636. for (let key in props) {
  1637. const value = props[key];
  1638. if (value === void 0) {
  1639. continue;
  1640. }
  1641. switch (key) {
  1642. case "icon":
  1643. case "style":
  1644. case "onLoad":
  1645. case "mode":
  1646. break;
  1647. case "inline":
  1648. case "hFlip":
  1649. case "vFlip":
  1650. customisations[key] = value === true || value === "true" || value === 1;
  1651. break;
  1652. case "flip":
  1653. if (typeof value === "string") {
  1654. flipFromString(customisations, value);
  1655. }
  1656. break;
  1657. case "color":
  1658. style.color = value;
  1659. break;
  1660. case "rotate":
  1661. if (typeof value === "string") {
  1662. customisations[key] = rotateFromString(value);
  1663. } else if (typeof value === "number") {
  1664. customisations[key] = value;
  1665. }
  1666. break;
  1667. case "ariaHidden":
  1668. case "aria-hidden":
  1669. if (value !== true && value !== "true") {
  1670. delete componentProps["aria-hidden"];
  1671. }
  1672. break;
  1673. default: {
  1674. const alias = customisationAliases[key];
  1675. if (alias) {
  1676. if (value === true || value === "true" || value === 1) {
  1677. customisations[alias] = true;
  1678. }
  1679. } else if (defaultExtendedIconCustomisations[key] === void 0) {
  1680. componentProps[key] = value;
  1681. }
  1682. }
  1683. }
  1684. }
  1685. const item = iconToSVG(icon, customisations);
  1686. const renderAttribs = item.attributes;
  1687. if (customisations.inline) {
  1688. style.verticalAlign = "-0.125em";
  1689. }
  1690. if (mode === "svg") {
  1691. componentProps.style = {
  1692. ...style,
  1693. ...customStyle
  1694. };
  1695. Object.assign(componentProps, renderAttribs);
  1696. let localCounter = 0;
  1697. let id = props.id;
  1698. if (typeof id === "string") {
  1699. id = id.replace(/-/g, "_");
  1700. }
  1701. componentProps["innerHTML"] = replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifyVue");
  1702. return vue.h("svg", componentProps);
  1703. }
  1704. const { body, width, height } = icon;
  1705. const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
  1706. const html = iconToHTML(body, {
  1707. ...renderAttribs,
  1708. width: width + "",
  1709. height: height + ""
  1710. });
  1711. componentProps.style = {
  1712. ...style,
  1713. "--svg": svgToURL(html),
  1714. "width": fixSize(renderAttribs.width),
  1715. "height": fixSize(renderAttribs.height),
  1716. ...commonProps,
  1717. ...useMask ? monotoneProps : coloredProps,
  1718. ...customStyle
  1719. };
  1720. return vue.h("span", componentProps);
  1721. };
  1722. allowSimpleNames(true);
  1723. setAPIModule("", fetchAPIModule);
  1724. if (typeof document !== "undefined" && typeof window !== "undefined") {
  1725. initBrowserStorage();
  1726. const _window2 = window;
  1727. if (_window2.IconifyPreload !== void 0) {
  1728. const preload = _window2.IconifyPreload;
  1729. const err = "Invalid IconifyPreload syntax.";
  1730. if (typeof preload === "object" && preload !== null) {
  1731. (preload instanceof Array ? preload : [preload]).forEach((item) => {
  1732. try {
  1733. if (
  1734. // Check if item is an object and not null/array
  1735. typeof item !== "object" || item === null || item instanceof Array || // Check for 'icons' and 'prefix'
  1736. typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
  1737. !addCollection(item)
  1738. ) {
  1739. console.error(err);
  1740. }
  1741. } catch (e2) {
  1742. console.error(err);
  1743. }
  1744. });
  1745. }
  1746. }
  1747. if (_window2.IconifyProviders !== void 0) {
  1748. const providers = _window2.IconifyProviders;
  1749. if (typeof providers === "object" && providers !== null) {
  1750. for (let key in providers) {
  1751. const err = "IconifyProviders[" + key + "] is invalid.";
  1752. try {
  1753. const value = providers[key];
  1754. if (typeof value !== "object" || !value || value.resources === void 0) {
  1755. continue;
  1756. }
  1757. if (!addAPIProvider(key, value)) {
  1758. console.error(err);
  1759. }
  1760. } catch (e2) {
  1761. console.error(err);
  1762. }
  1763. }
  1764. }
  1765. }
  1766. }
  1767. const emptyIcon = {
  1768. ...defaultIconProps,
  1769. body: ""
  1770. };
  1771. const Icon = vue.defineComponent({
  1772. // Do not inherit other attributes: it is handled by render()
  1773. inheritAttrs: false,
  1774. // Set initial data
  1775. data() {
  1776. return {
  1777. // Mounted status
  1778. iconMounted: false,
  1779. // Callback counter to trigger re-render
  1780. counter: 0
  1781. };
  1782. },
  1783. mounted() {
  1784. this._name = "";
  1785. this._loadingIcon = null;
  1786. this.iconMounted = true;
  1787. },
  1788. unmounted() {
  1789. this.abortLoading();
  1790. },
  1791. methods: {
  1792. abortLoading() {
  1793. if (this._loadingIcon) {
  1794. this._loadingIcon.abort();
  1795. this._loadingIcon = null;
  1796. }
  1797. },
  1798. // Get data for icon to render or null
  1799. getIcon(icon, onload) {
  1800. if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
  1801. this._name = "";
  1802. this.abortLoading();
  1803. return {
  1804. data: icon
  1805. };
  1806. }
  1807. let iconName;
  1808. if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
  1809. this.abortLoading();
  1810. return null;
  1811. }
  1812. const data = getIconData(iconName);
  1813. if (!data) {
  1814. if (!this._loadingIcon || this._loadingIcon.name !== icon) {
  1815. this.abortLoading();
  1816. this._name = "";
  1817. if (data !== null) {
  1818. this._loadingIcon = {
  1819. name: icon,
  1820. abort: loadIcons([iconName], () => {
  1821. this.counter++;
  1822. })
  1823. };
  1824. }
  1825. }
  1826. return null;
  1827. }
  1828. this.abortLoading();
  1829. if (this._name !== icon) {
  1830. this._name = icon;
  1831. if (onload) {
  1832. onload(icon);
  1833. }
  1834. }
  1835. const classes = ["iconify"];
  1836. if (iconName.prefix !== "") {
  1837. classes.push("iconify--" + iconName.prefix);
  1838. }
  1839. if (iconName.provider !== "") {
  1840. classes.push("iconify--" + iconName.provider);
  1841. }
  1842. return { data, classes };
  1843. }
  1844. },
  1845. // Render icon
  1846. render() {
  1847. this.counter;
  1848. const props = this.$attrs;
  1849. const icon = this.iconMounted ? this.getIcon(props.icon, props.onLoad) : null;
  1850. if (!icon) {
  1851. return render(emptyIcon, props);
  1852. }
  1853. let newProps = props;
  1854. if (icon.classes) {
  1855. newProps = {
  1856. ...props,
  1857. class: (typeof props["class"] === "string" ? props["class"] + " " : "") + icon.classes.join(" ")
  1858. };
  1859. }
  1860. return render({
  1861. ...defaultIconProps,
  1862. ...icon.data
  1863. }, newProps);
  1864. }
  1865. });
  1866. const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
  1867. __name: "BackIcon",
  1868. setup(__props) {
  1869. return (_ctx, _cache) => {
  1870. return vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  1871. class: "back-icon",
  1872. icon: "octicon:arrow-left-24",
  1873. width: "22"
  1874. });
  1875. };
  1876. }
  1877. });
  1878. const _hoisted_1$n = { class: "nav-bar" };
  1879. const _hoisted_2$j = {
  1880. key: 0,
  1881. class: "title"
  1882. };
  1883. const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
  1884. __name: "NavBar",
  1885. props: {
  1886. title: {}
  1887. },
  1888. emits: ["back"],
  1889. setup(__props, { emit: __emit }) {
  1890. const emit = __emit;
  1891. return (_ctx, _cache) => {
  1892. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
  1893. vue.createVNode(_sfc_main$p, {
  1894. onClick: _cache[0] || (_cache[0] = ($event) => emit("back"))
  1895. }),
  1896. _ctx.title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$j, vue.toDisplayString(_ctx.title), 1)) : vue.createCommentVNode("", true)
  1897. ]);
  1898. };
  1899. }
  1900. });
  1901. const NavBar = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-fda0acaa"]]);
  1902. const _hoisted_1$m = { class: "display-type" };
  1903. const _hoisted_2$i = { style: { "position": "relative" } };
  1904. const _hoisted_3$f = {
  1905. key: 0,
  1906. class: "type-list"
  1907. };
  1908. const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
  1909. __name: "BaseSelect",
  1910. props: {
  1911. displayType: {}
  1912. },
  1913. emits: ["update:displayType"],
  1914. setup(__props, { emit: __emit }) {
  1915. const props = __props;
  1916. const emit = __emit;
  1917. let state = vue.reactive({
  1918. showChangeDisplayType: false,
  1919. lastDisplayType: null
  1920. });
  1921. function changeOption(item) {
  1922. if (![CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  1923. state.lastDisplayType = props.displayType;
  1924. }
  1925. emit("update:displayType", item);
  1926. state.showChangeDisplayType = false;
  1927. }
  1928. function clickDisplayType() {
  1929. if ([CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  1930. return changeOption(state.lastDisplayType ?? CommentDisplayType.FloorInFloorNoCallUser);
  1931. }
  1932. state.showChangeDisplayType = !state.showChangeDisplayType;
  1933. }
  1934. const currentDisplayType = vue.computed(() => {
  1935. let judge = props.displayType;
  1936. if ([CommentDisplayType.New, CommentDisplayType.Like].includes(props.displayType)) {
  1937. judge = state.lastDisplayType;
  1938. }
  1939. switch (judge) {
  1940. case CommentDisplayType.FloorInFloorNoCallUser:
  1941. return "楼中楼";
  1942. case CommentDisplayType.FloorInFloor:
  1943. return "楼中楼(@)";
  1944. case CommentDisplayType.FloorInFloorNested:
  1945. return "冗余楼中楼";
  1946. case CommentDisplayType.V2exOrigin:
  1947. return "V2原版";
  1948. case CommentDisplayType.OnlyOp:
  1949. return "只看楼主";
  1950. default:
  1951. return "楼中楼";
  1952. }
  1953. });
  1954. return (_ctx, _cache) => {
  1955. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$m, [
  1956. vue.createElementVNode("div", {
  1957. class: vue.normalizeClass(["type", _ctx.displayType === vue.unref(CommentDisplayType).Like && "active"]),
  1958. onClick: _cache[0] || (_cache[0] = ($event) => changeOption(vue.unref(CommentDisplayType).Like))
  1959. }, "最热 ", 2),
  1960. vue.createElementVNode("div", _hoisted_2$i, [
  1961. vue.createElementVNode("div", {
  1962. class: vue.normalizeClass(["type", ![vue.unref(CommentDisplayType).New, vue.unref(CommentDisplayType).Like].includes(_ctx.displayType) && "active"]),
  1963. onClick: clickDisplayType
  1964. }, [
  1965. vue.createElementVNode("span", null, vue.toDisplayString(currentDisplayType.value), 1),
  1966. vue.createVNode(vue.unref(Icon), { icon: "mingcute:down-line" })
  1967. ], 2),
  1968. vue.unref(state).showChangeDisplayType ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$f, [
  1969. vue.createElementVNode("div", {
  1970. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloorNoCallUser && "active"]),
  1971. onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloorNoCallUser), ["stop"]))
  1972. }, "楼中楼 ", 2),
  1973. vue.createElementVNode("div", {
  1974. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloor && "active"]),
  1975. onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloor), ["stop"]))
  1976. }, "楼中楼(@) ", 2),
  1977. vue.createElementVNode("div", {
  1978. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).FloorInFloorNested && "active"]),
  1979. onClick: _cache[3] || (_cache[3] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).FloorInFloorNested), ["stop"]))
  1980. }, "冗余楼中楼 ", 2),
  1981. vue.createElementVNode("div", {
  1982. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).OnlyOp && "active"]),
  1983. onClick: _cache[4] || (_cache[4] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).OnlyOp), ["stop"]))
  1984. }, "只看楼主 ", 2),
  1985. vue.createElementVNode("div", {
  1986. class: vue.normalizeClass(["item", _ctx.displayType === vue.unref(CommentDisplayType).V2exOrigin && "active"]),
  1987. onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => changeOption(vue.unref(CommentDisplayType).V2exOrigin), ["stop"]))
  1988. }, "V2原版 ", 2)
  1989. ])) : vue.createCommentVNode("", true)
  1990. ])
  1991. ]);
  1992. };
  1993. }
  1994. });
  1995. const BaseSelect = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-1d327f48"]]);
  1996. const eventBus = {
  1997. eventMap: /* @__PURE__ */ new Map(),
  1998. on(eventType, cb) {
  1999. let cbs = this.eventMap.get(eventType);
  2000. if (cbs) {
  2001. cbs.push(cb);
  2002. } else {
  2003. cbs = [cb];
  2004. }
  2005. this.eventMap.set(eventType, cbs);
  2006. },
  2007. emit(eventType, val) {
  2008. let cbs = this.eventMap.get(eventType);
  2009. if (cbs) {
  2010. cbs.map((cb) => cb(val));
  2011. }
  2012. },
  2013. off(eventType) {
  2014. let cbs = this.eventMap.has(eventType);
  2015. if (cbs) {
  2016. this.eventMap.delete(eventType);
  2017. }
  2018. },
  2019. clear() {
  2020. this.eventMap = /* @__PURE__ */ new Map();
  2021. }
  2022. };
  2023. const CMD = {
  2024. SHOW_TOOLTIP: "SHOW_TOOLTIP",
  2025. SHOW_MSG: "SHOW_MSG",
  2026. SET_CALL: "SET_CALL",
  2027. SHOW_CALL: "SHOW_CALL",
  2028. REFRESH_ONCE: "REFRESH_ONCE",
  2029. ADD_REPLY: "ADD_REPLY",
  2030. IGNORE: "IGNORE",
  2031. MERGE: "MERGE",
  2032. MERGE_CONFIG: "MERGE_CONFIG",
  2033. REMOVE: "REMOVE",
  2034. CHANGE_COMMENT_THANK: "CHANGE_COMMENT_THANK",
  2035. CHANGE_POST_THANK: "CHANGE_POST_THANK",
  2036. ADD_TAG: "ADD_TAG",
  2037. REMOVE_TAG: "REMOVE_TAG",
  2038. RELATION_REPLY: "RELATION_REPLY",
  2039. JUMP: "JUMP",
  2040. ADD_READ: "ADD_READ",
  2041. REFRESH_POST: "REFRESH_POST",
  2042. SHOW_COMMENT_OPTIONS: "SHOW_COMMENT_OPTIONS",
  2043. SHOW_EDITOR: "COMMENT_REPLY"
  2044. };
  2045. const _withScopeId$e = (n2) => (vue.pushScopeId("data-v-a64ba8b8"), n2 = n2(), vue.popScopeId(), n2);
  2046. const _hoisted_1$l = { class: "font-size" };
  2047. const _hoisted_2$h = { class: "steps" };
  2048. const _hoisted_3$e = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", {
  2049. class: "text",
  2050. style: { "font-size": "1.2rem" }
  2051. }, "小", -1));
  2052. const _hoisted_4$d = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "point" }, null, -1));
  2053. const _hoisted_5$b = [
  2054. _hoisted_3$e,
  2055. _hoisted_4$d
  2056. ];
  2057. const _hoisted_6$a = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "text" }, "标准", -1));
  2058. const _hoisted_7$9 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "point" }, null, -1));
  2059. const _hoisted_8$9 = [
  2060. _hoisted_6$a,
  2061. _hoisted_7$9
  2062. ];
  2063. const _hoisted_9$9 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", {
  2064. class: "text",
  2065. style: { "font-size": "1.8rem" }
  2066. }, "大", -1));
  2067. const _hoisted_10$8 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "point" }, null, -1));
  2068. const _hoisted_11$8 = [
  2069. _hoisted_9$9,
  2070. _hoisted_10$8
  2071. ];
  2072. const _hoisted_12$8 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", {
  2073. class: "text",
  2074. style: { "font-size": "2.2rem" }
  2075. }, "特大", -1));
  2076. const _hoisted_13$8 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "point" }, null, -1));
  2077. const _hoisted_14$7 = [
  2078. _hoisted_12$8,
  2079. _hoisted_13$8
  2080. ];
  2081. const _hoisted_15$7 = /* @__PURE__ */ _withScopeId$e(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "line" }, null, -1));
  2082. const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
  2083. __name: "FontSizeType",
  2084. setup(__props) {
  2085. const config2 = vue.inject("config");
  2086. return (_ctx, _cache) => {
  2087. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$l, [
  2088. vue.createElementVNode("div", _hoisted_2$h, [
  2089. vue.createElementVNode("div", {
  2090. class: vue.normalizeClass(["step", [vue.unref(config2).fontSizeType === "small" && "active"]]),
  2091. onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(eventBus).emit(vue.unref(CMD).MERGE_CONFIG, { fontSizeType: "small" }))
  2092. }, _hoisted_5$b, 2),
  2093. vue.createElementVNode("div", {
  2094. class: vue.normalizeClass(["step", [vue.unref(config2).fontSizeType === "normal" && "active"]]),
  2095. onClick: _cache[1] || (_cache[1] = ($event) => vue.unref(eventBus).emit(vue.unref(CMD).MERGE_CONFIG, { fontSizeType: "normal" }))
  2096. }, _hoisted_8$9, 2),
  2097. vue.createElementVNode("div", {
  2098. class: vue.normalizeClass(["step", [vue.unref(config2).fontSizeType === "large" && "active"]]),
  2099. onClick: _cache[2] || (_cache[2] = ($event) => vue.unref(eventBus).emit(vue.unref(CMD).MERGE_CONFIG, { fontSizeType: "large" }))
  2100. }, _hoisted_11$8, 2),
  2101. vue.createElementVNode("div", {
  2102. class: vue.normalizeClass(["step", [vue.unref(config2).fontSizeType === "big-large" && "active"]]),
  2103. onClick: _cache[3] || (_cache[3] = ($event) => vue.unref(eventBus).emit(vue.unref(CMD).MERGE_CONFIG, { fontSizeType: "big-large" }))
  2104. }, _hoisted_14$7, 2)
  2105. ]),
  2106. _hoisted_15$7
  2107. ]);
  2108. };
  2109. }
  2110. });
  2111. const FontSizeType = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-a64ba8b8"]]);
  2112. var _GM_notification = /* @__PURE__ */ (() => typeof GM_notification != "undefined" ? GM_notification : void 0)();
  2113. var _GM_openInTab = /* @__PURE__ */ (() => typeof GM_openInTab != "undefined" ? GM_openInTab : void 0)();
  2114. var _GM_registerMenuCommand = /* @__PURE__ */ (() => typeof GM_registerMenuCommand != "undefined" ? GM_registerMenuCommand : void 0)();
  2115. const functions = {
  2116. //获取所有回复
  2117. getAllReply(repliesMap = []) {
  2118. return repliesMap.sort((a, b) => a.i - b.i).reduce((pre, i) => {
  2119. pre = pre.concat(i.replyList);
  2120. return pre;
  2121. }, []);
  2122. },
  2123. //查找子回复
  2124. findChildren(item, endList, all) {
  2125. var _a;
  2126. const fn = (child, endList2, parent) => {
  2127. child.level = parent.level + 1;
  2128. let rIndex = all.findIndex((v) => v.floor === child.floor);
  2129. if (rIndex > -1) {
  2130. all[rIndex].isUse = true;
  2131. }
  2132. parent.children.push(this.findChildren(child, endList2, all));
  2133. };
  2134. item.children = [];
  2135. let floorReplyList = [];
  2136. for (let i = 0; i < endList.length; i++) {
  2137. let currentItem = endList[i];
  2138. if (currentItem.isUse)
  2139. continue;
  2140. if (currentItem.replyFloor === item.floor) {
  2141. if (currentItem.replyUsers.length === 1 && currentItem.replyUsers[0] === item.username) {
  2142. currentItem.isUse = true;
  2143. floorReplyList.push({ endList: endList.slice(i + 1), currentItem });
  2144. } else {
  2145. currentItem.isWrong = true;
  2146. }
  2147. }
  2148. }
  2149. floorReplyList.reverse().map(({ currentItem, endList: endList2 }) => {
  2150. fn(currentItem, endList2, item);
  2151. });
  2152. let nextMeIndex = endList.findIndex((v) => {
  2153. var _a2;
  2154. return v.username === item.username && ((_a2 = v.replyUsers) == null ? void 0 : _a2[0]) !== item.username;
  2155. });
  2156. let findList = nextMeIndex > -1 ? endList.slice(0, nextMeIndex) : endList;
  2157. for (let i = 0; i < findList.length; i++) {
  2158. let currentItem = findList[i];
  2159. if (currentItem.isUse)
  2160. continue;
  2161. if (currentItem.replyUsers.length === 1) {
  2162. if (currentItem.replyFloor !== -1) {
  2163. if (((_a = all[currentItem.replyFloor - 1]) == null ? void 0 : _a.username) === currentItem.replyUsers[0]) {
  2164. continue;
  2165. }
  2166. }
  2167. let endList2 = endList.slice(i + 1);
  2168. if (currentItem.username === item.username) {
  2169. if (currentItem.replyUsers[0] === item.username) {
  2170. fn(currentItem, endList2, item);
  2171. }
  2172. break;
  2173. } else {
  2174. if (currentItem.replyUsers[0] === item.username) {
  2175. fn(currentItem, endList2, item);
  2176. }
  2177. }
  2178. } else {
  2179. if (currentItem.username === item.username)
  2180. break;
  2181. }
  2182. }
  2183. item.children = item.children.sort((a, b) => a.floor - b.floor);
  2184. return item;
  2185. },
  2186. //生成嵌套回复
  2187. createNestedList(allList = []) {
  2188. if (!allList.length)
  2189. return [];
  2190. let list = window.clone(allList);
  2191. let nestedList = [];
  2192. list.map((item, index) => {
  2193. let startList = list.slice(0, index);
  2194. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  2195. let endList = list.slice(index + 1);
  2196. if (index === 0) {
  2197. nestedList.push(this.findChildren(item, endList, list));
  2198. } else {
  2199. if (!item.isUse) {
  2200. let isOneLevelReply = false;
  2201. if (item.replyUsers.length) {
  2202. if (item.replyUsers.length > 1) {
  2203. isOneLevelReply = true;
  2204. } else {
  2205. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  2206. }
  2207. } else {
  2208. isOneLevelReply = true;
  2209. }
  2210. if (isOneLevelReply) {
  2211. item.level = 0;
  2212. nestedList.push(this.findChildren(item, endList, list));
  2213. }
  2214. }
  2215. }
  2216. });
  2217. return nestedList;
  2218. },
  2219. //生成嵌套冗余回复
  2220. createNestedRedundantList(allList = []) {
  2221. if (!allList.length)
  2222. return [];
  2223. let list = window.clone(allList);
  2224. let nestedList = [];
  2225. list.map((item, index) => {
  2226. let startList = list.slice(0, index);
  2227. let startReplyUsers = Array.from(new Set(startList.map((v) => v.username)));
  2228. let endList = list.slice(index + 1);
  2229. if (index === 0) {
  2230. nestedList.push(this.findChildren(item, endList, list));
  2231. } else {
  2232. if (!item.isUse) {
  2233. let isOneLevelReply = false;
  2234. if (item.replyUsers.length) {
  2235. if (item.replyUsers.length > 1) {
  2236. isOneLevelReply = true;
  2237. } else {
  2238. isOneLevelReply = !startReplyUsers.find((v) => v === item.replyUsers[0]);
  2239. }
  2240. } else {
  2241. isOneLevelReply = true;
  2242. }
  2243. if (isOneLevelReply) {
  2244. item.level = 0;
  2245. nestedList.push(this.findChildren(item, endList, list));
  2246. }
  2247. } else {
  2248. let newItem = window.clone(item);
  2249. newItem.children = [];
  2250. newItem.level = 0;
  2251. newItem.isDup = true;
  2252. nestedList.push(newItem);
  2253. }
  2254. }
  2255. });
  2256. return nestedList;
  2257. },
  2258. //解析A标签
  2259. parseA(a) {
  2260. let href = a.href;
  2261. let id;
  2262. if (href.includes("/t/")) {
  2263. id = a.pathname.substring("/t/".length);
  2264. }
  2265. return { href, id, title: a.innerText };
  2266. },
  2267. //图片链接转Img标签
  2268. checkPhotoLink2Img(str) {
  2269. if (!str)
  2270. return;
  2271. try {
  2272. let imgWebs = [
  2273. /<a((?!<a).)*href="https?:\/\/((?!<a).)*imgur.com((?!<a).)*>(((?!<a).)*)<\/a>/g,
  2274. /<a((?!<a).)*href="https?:\/\/((?!<a).)*\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG) ((?!<a).)*>(((?!<a).)*)<\/a>/g
  2275. ];
  2276. imgWebs.map((v, i) => {
  2277. let has = str.matchAll(v);
  2278. let res2 = [...has];
  2279. res2.map((r2) => {
  2280. let p = i === 0 ? r2[4] : r2[5];
  2281. if (p) {
  2282. let link = p.toLowerCase();
  2283. let src = p;
  2284. if (link.includes(".png") || link.includes(".jpg") || link.includes(".jpeg") || link.includes(".gif")) {
  2285. } else {
  2286. src = p + ".png";
  2287. }
  2288. str = str.replace(r2[0], `<img src="${src}" data-originUrl="${p}" data-notice="此img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`);
  2289. }
  2290. });
  2291. });
  2292. } catch (e2) {
  2293. console.log("正则解析html里面的a标签的图片链接出错了");
  2294. }
  2295. return str;
  2296. },
  2297. //检测帖子回复长度
  2298. async checkPostReplies(id, needOpen = true) {
  2299. return new Promise(async (resolve) => {
  2300. let res = await functions.getPostDetailByApi(id);
  2301. if ((res == null ? void 0 : res.replies) > MAX_REPLY_LIMIT) {
  2302. if (needOpen) {
  2303. functions.openNewTab(`https://${location.origin}/t/${id}?p=1&script=1`);
  2304. }
  2305. return resolve(true);
  2306. }
  2307. resolve(false);
  2308. });
  2309. },
  2310. async sleep(time) {
  2311. return new Promise((resolve) => {
  2312. setTimeout(resolve, time);
  2313. });
  2314. },
  2315. //打开新标签页
  2316. openNewTab(href, active = false) {
  2317. _GM_openInTab(href, { active });
  2318. },
  2319. async cbChecker(val, count = 0) {
  2320. if (window.cb) {
  2321. window.cb(val);
  2322. } else {
  2323. while (!window.cb && count < 30) {
  2324. await functions.sleep(500);
  2325. count++;
  2326. }
  2327. window.cb && window.cb(val);
  2328. }
  2329. },
  2330. //初始化脚本菜单
  2331. initMonkeyMenu() {
  2332. try {
  2333. _GM_registerMenuCommand("脚本设置", () => {
  2334. functions.cbChecker({ type: "openSetting" });
  2335. });
  2336. _GM_registerMenuCommand("仓库地址", () => {
  2337. functions.openNewTab(window.const.git);
  2338. });
  2339. _GM_registerMenuCommand("反馈 & 建议", functions.feedback);
  2340. } catch (e2) {
  2341. console.error("无法使用Tampermonkey");
  2342. }
  2343. },
  2344. clone(val) {
  2345. return JSON.parse(JSON.stringify(val));
  2346. },
  2347. feedback() {
  2348. functions.openNewTab(DefaultVal.issue);
  2349. },
  2350. //检测页面类型
  2351. checkPageType(a) {
  2352. let l = a || window.location;
  2353. let data = { pageType: null, pageData: { id: "", pageNo: null }, username: "" };
  2354. if (l.pathname === "/") {
  2355. data.pageType = PageType.Home;
  2356. } else if (l.pathname === "/changes") {
  2357. data.pageType = PageType.Changes;
  2358. } else if (l.pathname === "/recent") {
  2359. data.pageType = PageType.Changes;
  2360. } else if (l.href.match(/.com\/?tab=/)) {
  2361. data.pageType = PageType.Home;
  2362. } else if (l.href.match(/.com\/go\//)) {
  2363. if (!l.href.includes("/links")) {
  2364. data.pageType = PageType.Node;
  2365. }
  2366. } else if (l.href.match(/.com\/member/)) {
  2367. data.pageType = PageType.Member;
  2368. data.username = l.pathname.replace("/member/", "").replace("/replies", "");
  2369. } else {
  2370. let r2 = l.href.match(/.com\/t\/([\d]+)/);
  2371. if (r2 && !l.pathname.includes("review") && !l.pathname.includes("info")) {
  2372. data.pageType = PageType.Post;
  2373. data.pageData.id = r2[1];
  2374. if (l.search) {
  2375. let pr = l.href.match(/\?p=([\d]+)/);
  2376. if (pr)
  2377. data.pageData.pageNo = Number(pr[1]);
  2378. }
  2379. }
  2380. }
  2381. return data;
  2382. },
  2383. //通过api获取主题详情
  2384. getPostDetailByApi(id) {
  2385. return new Promise((resolve) => {
  2386. fetch(`${location.origin}/api/topics/show.json?id=${id}`).then(async (r2) => {
  2387. if (r2.status === 200) {
  2388. let res = await r2.json();
  2389. if (res) {
  2390. let d2 = res[0];
  2391. resolve(d2);
  2392. }
  2393. }
  2394. });
  2395. });
  2396. },
  2397. appendPostContent(res, el) {
  2398. let a = document.createElement("a");
  2399. a.href = res.href;
  2400. a.classList.add("post-content");
  2401. let div = document.createElement("div");
  2402. div.innerHTML = res.content_rendered;
  2403. a.append(div);
  2404. el.append(a);
  2405. const checkHeight2 = () => {
  2406. var _a;
  2407. if (div.clientHeight < 300) {
  2408. a.classList.add("show-all");
  2409. } else {
  2410. let showMore = document.createElement("div");
  2411. showMore.classList.add("show-more");
  2412. showMore.innerHTML = "显示更多/收起";
  2413. showMore.onclick = function(e2) {
  2414. e2.stopPropagation();
  2415. a.classList.toggle("show-all");
  2416. };
  2417. (_a = a.parentNode) == null ? void 0 : _a.append(showMore);
  2418. }
  2419. };
  2420. checkHeight2();
  2421. },
  2422. //从本地读取配置
  2423. initConfig() {
  2424. return new Promise((resolve) => {
  2425. let configStr = localStorage.getItem("v2ex-config");
  2426. if (configStr) {
  2427. let configObj = JSON.parse(configStr);
  2428. configObj = configObj[window.user.username ?? "default"];
  2429. if (configObj) {
  2430. window.config = Object.assign(window.config, configObj);
  2431. }
  2432. }
  2433. resolve(window.config);
  2434. });
  2435. }
  2436. };
  2437. const DefaultPost = {
  2438. allReplyUsers: [],
  2439. content_rendered: "",
  2440. createDate: "",
  2441. createDateAgo: "",
  2442. lastReplyDate: "",
  2443. fr: "",
  2444. replyList: [],
  2445. nestedReplies: [],
  2446. nestedRedundReplies: [],
  2447. username: "",
  2448. url: "",
  2449. href: "",
  2450. member: {},
  2451. node: {
  2452. title: "",
  2453. url: ""
  2454. },
  2455. headerTemplate: "",
  2456. title: "",
  2457. id: "",
  2458. type: "post",
  2459. once: "",
  2460. replyCount: 0,
  2461. clickCount: 0,
  2462. thankCount: 0,
  2463. collectCount: 0,
  2464. lastReadFloor: 0,
  2465. isFavorite: false,
  2466. isIgnore: false,
  2467. isThanked: false,
  2468. isReport: false,
  2469. inList: false
  2470. };
  2471. const DefaultUser = {
  2472. tagPrefix: "--用户标签--",
  2473. tags: {},
  2474. tagsId: "",
  2475. username: "",
  2476. avatar: "",
  2477. readPrefix: "--已读楼层--",
  2478. readNoteItemId: "",
  2479. readList: {},
  2480. imgurPrefix: "--imgur图片删除hash--",
  2481. imgurList: {},
  2482. imgurNoteId: "",
  2483. configPrefix: "--config--",
  2484. configNoteId: ""
  2485. };
  2486. const DefaultVal = {
  2487. pageType: void 0,
  2488. pageData: { pageNo: 1 },
  2489. targetUserName: "",
  2490. currentVersion: 1,
  2491. isNight: false,
  2492. cb: null,
  2493. stopMe: null,
  2494. postList: [],
  2495. git: "https://github.com/zyronon/web-scripts",
  2496. shortGit: "zyronon/web-scripts",
  2497. issue: "https://github.com/zyronon/web-scripts/issues",
  2498. pcLog: "https://greasyfork.org/zh-CN/scripts/458024/versions",
  2499. pcScript: "https://greasyfork.org/zh-CN/scripts/458024",
  2500. mobileScript: "https://greasyfork.org/zh-CN/scripts/485356",
  2501. homeUrl: "https://v2next.netlify.app/"
  2502. };
  2503. const DefaultConfig = {
  2504. showToolbar: true,
  2505. autoOpenDetail: true,
  2506. openTag: false,
  2507. //给用户打标签
  2508. clickPostItemOpenDetail: true,
  2509. closePostDetailBySpace: true,
  2510. //点击空白处关闭详情
  2511. contentAutoCollapse: true,
  2512. //正文超长自动折叠
  2513. viewType: "table",
  2514. commentDisplayType: CommentDisplayType.FloorInFloorNoCallUser,
  2515. newTabOpen: false,
  2516. //新标签打开
  2517. newTabOpenActive: false,
  2518. base64: true,
  2519. //base功能
  2520. sov2ex: false,
  2521. postWidth: "",
  2522. showTopReply: true,
  2523. topReplyLoveMinCount: 3,
  2524. topReplyCount: 3,
  2525. autoJumpLastReadFloor: false,
  2526. rememberLastReadFloor: false,
  2527. autoSignin: true,
  2528. customBgColor: "",
  2529. version: DefaultVal.currentVersion,
  2530. collectBrowserNotice: false,
  2531. fontSizeType: "normal"
  2532. };
  2533. const _sfc_main$l = {
  2534. name: "Setting",
  2535. components: {
  2536. FontSizeType,
  2537. BaseSelect,
  2538. NavBar,
  2539. BaseSwitch,
  2540. Tooltip,
  2541. Icon
  2542. },
  2543. emits: ["back"],
  2544. props: {
  2545. modelValue: {
  2546. type: Object,
  2547. default() {
  2548. return {};
  2549. }
  2550. },
  2551. show: {
  2552. type: Boolean,
  2553. default() {
  2554. return false;
  2555. }
  2556. },
  2557. to: {
  2558. type: String,
  2559. default() {
  2560. return "";
  2561. }
  2562. }
  2563. },
  2564. data() {
  2565. return {
  2566. activeEruda: !!localStorage.getItem("active-eruda"),
  2567. config: window.clone(this.modelValue)
  2568. };
  2569. },
  2570. computed: {
  2571. DefaultVal() {
  2572. return DefaultVal;
  2573. },
  2574. functions() {
  2575. return functions;
  2576. },
  2577. CommentDisplayType() {
  2578. return CommentDisplayType;
  2579. },
  2580. isNew() {
  2581. return this.config.version < window.currentVersion;
  2582. }
  2583. },
  2584. watch: {
  2585. config: {
  2586. handler(n2) {
  2587. n2.topReplyLoveMinCount = Math.trunc(n2.topReplyLoveMinCount);
  2588. if (n2.topReplyLoveMinCount < 0) {
  2589. n2.topReplyLoveMinCount = 1;
  2590. }
  2591. this.$emit("update:modelValue", n2);
  2592. },
  2593. deep: true
  2594. },
  2595. activeEruda(n2) {
  2596. if (n2) {
  2597. localStorage.setItem("active-eruda", 1);
  2598. } else {
  2599. localStorage.setItem("active-eruda", "");
  2600. }
  2601. }
  2602. }
  2603. };
  2604. const _withScopeId$d = (n2) => (vue.pushScopeId("data-v-424a2b09"), n2 = n2(), vue.popScopeId(), n2);
  2605. const _hoisted_1$k = { class: "mobile-page" };
  2606. const _hoisted_2$g = { class: "page-content" };
  2607. const _hoisted_3$d = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2608. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "关于脚本")
  2609. ], -1));
  2610. const _hoisted_4$c = { class: "row" };
  2611. const _hoisted_5$a = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "GitHub", -1));
  2612. const _hoisted_6$9 = { class: "wrapper" };
  2613. const _hoisted_7$8 = ["href"];
  2614. const _hoisted_8$8 = { class: "row" };
  2615. const _hoisted_9$8 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "反馈 & 建议", -1));
  2616. const _hoisted_10$7 = { class: "wrapper" };
  2617. const _hoisted_11$7 = ["href"];
  2618. const _hoisted_12$7 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2619. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "列表设置")
  2620. ], -1));
  2621. const _hoisted_13$7 = { class: "row" };
  2622. const _hoisted_14$6 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "列表展示方式", -1));
  2623. const _hoisted_15$6 = { class: "wrapper" };
  2624. const _hoisted_16$6 = { class: "radio-group2" };
  2625. const _hoisted_17$3 = { class: "row" };
  2626. const _hoisted_18$3 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "帖子弹框显示", -1));
  2627. const _hoisted_19$3 = { class: "wrapper" };
  2628. const _hoisted_20$3 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 开启此选项后,帖子始终会以弹框的方式显示。优先级大于“新标签页打开链接” ", -1));
  2629. const _hoisted_21$2 = { class: "row" };
  2630. const _hoisted_22$2 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "新标签页打开链接", -1));
  2631. const _hoisted_23$2 = { class: "wrapper" };
  2632. const _hoisted_24$2 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 网页上所有链接通过新标签页打开 ", -1));
  2633. const _hoisted_25$2 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2634. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "主题设置")
  2635. ], -1));
  2636. const _hoisted_26$1 = { class: "row" };
  2637. const _hoisted_27$1 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "回复展示方式", -1));
  2638. const _hoisted_28$1 = { class: "wrapper" };
  2639. const _hoisted_29$1 = { class: "row" };
  2640. const _hoisted_30$1 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "正文超长自动折叠", -1));
  2641. const _hoisted_31$1 = { class: "wrapper" };
  2642. const _hoisted_32$1 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2643. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "高赞回复")
  2644. ], -1));
  2645. const _hoisted_33$1 = { class: "row" };
  2646. const _hoisted_34$1 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "显示高赞回复", -1));
  2647. const _hoisted_35$1 = { class: "wrapper" };
  2648. const _hoisted_36$1 = { class: "row" };
  2649. const _hoisted_37$1 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "最多显示多少个高赞回复", -1));
  2650. const _hoisted_38$1 = { class: "wrapper" };
  2651. const _hoisted_39$1 = { class: "row" };
  2652. const _hoisted_40 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "最少需要多少赞才能被判定为高赞", -1));
  2653. const _hoisted_41 = { class: "wrapper" };
  2654. const _hoisted_42 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2655. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "记忆阅读")
  2656. ], -1));
  2657. const _hoisted_43 = { class: "row" };
  2658. const _hoisted_44 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "记录上次阅读楼层(误差1层左右):", -1));
  2659. const _hoisted_45 = { class: "wrapper" };
  2660. const _hoisted_46 = { class: "row" };
  2661. const _hoisted_47 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "打开帖子自动跳转到上次阅读楼层", -1));
  2662. const _hoisted_48 = { class: "wrapper" };
  2663. const _hoisted_49 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2664. /* @__PURE__ */ vue.createElementVNode("label", { class: "main-title" }, "其他设置")
  2665. ], -1));
  2666. const _hoisted_50 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "row" }, [
  2667. /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "字体设置")
  2668. ], -1));
  2669. const _hoisted_51 = { class: "row" };
  2670. const _hoisted_52 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "用户打标签(跨平台,数据保存在自己的记事本):", -1));
  2671. const _hoisted_53 = { class: "wrapper" };
  2672. const _hoisted_54 = { class: "row" };
  2673. const _hoisted_55 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "划词显示Base64解码框", -1));
  2674. const _hoisted_56 = { class: "wrapper" };
  2675. const _hoisted_57 = { class: "row" };
  2676. const _hoisted_58 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "自动签到", -1));
  2677. const _hoisted_59 = { class: "wrapper" };
  2678. const _hoisted_60 = { class: "row" };
  2679. const _hoisted_61 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "收藏时提醒添加到书签", -1));
  2680. const _hoisted_62 = { class: "wrapper" };
  2681. const _hoisted_63 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " V站帐号一旦被封禁,则无法登录,无法查看账号收藏了 ", -1));
  2682. const _hoisted_64 = { class: "row" };
  2683. const _hoisted_65 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("label", { class: "item-title" }, "调试模式", -1));
  2684. const _hoisted_66 = { class: "wrapper" };
  2685. const _hoisted_67 = /* @__PURE__ */ _withScopeId$d(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "desc" }, " 开启此项会显示调试控制台,刷新页面生效 ", -1));
  2686. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  2687. const _component_NavBar = vue.resolveComponent("NavBar");
  2688. const _component_BaseSwitch = vue.resolveComponent("BaseSwitch");
  2689. const _component_BaseSelect = vue.resolveComponent("BaseSelect");
  2690. const _component_font_size_type = vue.resolveComponent("font-size-type");
  2691. return vue.openBlock(), vue.createBlock(vue.Teleport, { to: $props.to }, [
  2692. vue.createElementVNode("div", _hoisted_1$k, [
  2693. vue.createVNode(_component_NavBar, {
  2694. title: "设置",
  2695. onBack: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("back"))
  2696. }),
  2697. vue.createElementVNode("div", _hoisted_2$g, [
  2698. _hoisted_3$d,
  2699. vue.createElementVNode("div", _hoisted_4$c, [
  2700. _hoisted_5$a,
  2701. vue.createElementVNode("div", _hoisted_6$9, [
  2702. vue.createElementVNode("a", {
  2703. href: $options.DefaultVal.git,
  2704. target: "_blank"
  2705. }, vue.toDisplayString($options.DefaultVal.shortGit), 9, _hoisted_7$8)
  2706. ])
  2707. ]),
  2708. vue.createElementVNode("div", _hoisted_8$8, [
  2709. _hoisted_9$8,
  2710. vue.createElementVNode("div", _hoisted_10$7, [
  2711. vue.createElementVNode("a", {
  2712. href: $options.DefaultVal.issue,
  2713. target: "_blank"
  2714. }, "点此填写Issue", 8, _hoisted_11$7)
  2715. ])
  2716. ]),
  2717. _hoisted_12$7,
  2718. vue.createElementVNode("div", _hoisted_13$7, [
  2719. _hoisted_14$6,
  2720. vue.createElementVNode("div", _hoisted_15$6, [
  2721. vue.createElementVNode("div", _hoisted_16$6, [
  2722. vue.createElementVNode("div", {
  2723. class: vue.normalizeClass(["radio", $data.config.viewType === "table" ? "active" : ""]),
  2724. onClick: _cache[1] || (_cache[1] = ($event) => $data.config.viewType = "table")
  2725. }, "表格 ", 2),
  2726. vue.createElementVNode("div", {
  2727. class: vue.normalizeClass(["radio", $data.config.viewType === "card" ? "active" : ""]),
  2728. onClick: _cache[2] || (_cache[2] = ($event) => $data.config.viewType = "card")
  2729. }, "卡片 ", 2)
  2730. ])
  2731. ])
  2732. ]),
  2733. vue.createElementVNode("div", _hoisted_17$3, [
  2734. _hoisted_18$3,
  2735. vue.createElementVNode("div", _hoisted_19$3, [
  2736. vue.createVNode(_component_BaseSwitch, {
  2737. modelValue: $data.config.clickPostItemOpenDetail,
  2738. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.config.clickPostItemOpenDetail = $event)
  2739. }, null, 8, ["modelValue"])
  2740. ])
  2741. ]),
  2742. _hoisted_20$3,
  2743. vue.createElementVNode("div", _hoisted_21$2, [
  2744. _hoisted_22$2,
  2745. vue.createElementVNode("div", _hoisted_23$2, [
  2746. vue.createVNode(_component_BaseSwitch, {
  2747. modelValue: $data.config.newTabOpen,
  2748. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.config.newTabOpen = $event)
  2749. }, null, 8, ["modelValue"])
  2750. ])
  2751. ]),
  2752. _hoisted_24$2,
  2753. _hoisted_25$2,
  2754. vue.createElementVNode("div", _hoisted_26$1, [
  2755. _hoisted_27$1,
  2756. vue.createElementVNode("div", _hoisted_28$1, [
  2757. vue.createVNode(_component_BaseSelect, {
  2758. "display-type": $data.config.commentDisplayType,
  2759. "onUpdate:displayType": _cache[5] || (_cache[5] = ($event) => $data.config.commentDisplayType = $event)
  2760. }, null, 8, ["display-type"])
  2761. ])
  2762. ]),
  2763. vue.createElementVNode("div", _hoisted_29$1, [
  2764. _hoisted_30$1,
  2765. vue.createElementVNode("div", _hoisted_31$1, [
  2766. vue.createVNode(_component_BaseSwitch, {
  2767. modelValue: $data.config.contentAutoCollapse,
  2768. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.config.contentAutoCollapse = $event)
  2769. }, null, 8, ["modelValue"])
  2770. ])
  2771. ]),
  2772. _hoisted_32$1,
  2773. vue.createElementVNode("div", _hoisted_33$1, [
  2774. _hoisted_34$1,
  2775. vue.createElementVNode("div", _hoisted_35$1, [
  2776. vue.createVNode(_component_BaseSwitch, {
  2777. modelValue: $data.config.showTopReply,
  2778. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.config.showTopReply = $event)
  2779. }, null, 8, ["modelValue"])
  2780. ])
  2781. ]),
  2782. vue.createElementVNode("div", _hoisted_36$1, [
  2783. _hoisted_37$1,
  2784. vue.createElementVNode("div", _hoisted_38$1, [
  2785. vue.withDirectives(vue.createElementVNode("input", {
  2786. type: "number",
  2787. min: "1",
  2788. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.config.topReplyCount = $event)
  2789. }, null, 512), [
  2790. [vue.vModelText, $data.config.topReplyCount]
  2791. ])
  2792. ])
  2793. ]),
  2794. vue.createElementVNode("div", _hoisted_39$1, [
  2795. _hoisted_40,
  2796. vue.createElementVNode("div", _hoisted_41, [
  2797. vue.withDirectives(vue.createElementVNode("input", {
  2798. type: "number",
  2799. min: "1",
  2800. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.config.topReplyLoveMinCount = $event)
  2801. }, null, 512), [
  2802. [vue.vModelText, $data.config.topReplyLoveMinCount]
  2803. ])
  2804. ])
  2805. ]),
  2806. _hoisted_42,
  2807. vue.createElementVNode("div", _hoisted_43, [
  2808. _hoisted_44,
  2809. vue.createElementVNode("div", _hoisted_45, [
  2810. vue.createVNode(_component_BaseSwitch, {
  2811. "model-value": $data.config.rememberLastReadFloor,
  2812. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => {
  2813. $data.config.rememberLastReadFloor = !$data.config.rememberLastReadFloor;
  2814. $data.config.autoJumpLastReadFloor = false;
  2815. })
  2816. }, null, 8, ["model-value"])
  2817. ])
  2818. ]),
  2819. vue.createElementVNode("div", _hoisted_46, [
  2820. _hoisted_47,
  2821. vue.createElementVNode("div", _hoisted_48, [
  2822. vue.createVNode(_component_BaseSwitch, {
  2823. modelValue: $data.config.autoJumpLastReadFloor,
  2824. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.config.autoJumpLastReadFloor = $event)
  2825. }, null, 8, ["modelValue"])
  2826. ])
  2827. ]),
  2828. _hoisted_49,
  2829. _hoisted_50,
  2830. vue.createVNode(_component_font_size_type),
  2831. vue.createElementVNode("div", _hoisted_51, [
  2832. _hoisted_52,
  2833. vue.createElementVNode("div", _hoisted_53, [
  2834. vue.createVNode(_component_BaseSwitch, {
  2835. modelValue: $data.config.openTag,
  2836. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $data.config.openTag = $event)
  2837. }, null, 8, ["modelValue"])
  2838. ])
  2839. ]),
  2840. vue.createElementVNode("div", _hoisted_54, [
  2841. _hoisted_55,
  2842. vue.createElementVNode("div", _hoisted_56, [
  2843. vue.createVNode(_component_BaseSwitch, {
  2844. modelValue: $data.config.base64,
  2845. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.config.base64 = $event)
  2846. }, null, 8, ["modelValue"])
  2847. ])
  2848. ]),
  2849. vue.createElementVNode("div", _hoisted_57, [
  2850. _hoisted_58,
  2851. vue.createElementVNode("div", _hoisted_59, [
  2852. vue.createVNode(_component_BaseSwitch, {
  2853. modelValue: $data.config.autoSignin,
  2854. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.config.autoSignin = $event)
  2855. }, null, 8, ["modelValue"])
  2856. ])
  2857. ]),
  2858. vue.createElementVNode("div", _hoisted_60, [
  2859. _hoisted_61,
  2860. vue.createElementVNode("div", _hoisted_62, [
  2861. vue.createVNode(_component_BaseSwitch, {
  2862. modelValue: $data.config.collectBrowserNotice,
  2863. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.config.collectBrowserNotice = $event)
  2864. }, null, 8, ["modelValue"])
  2865. ])
  2866. ]),
  2867. _hoisted_63,
  2868. vue.createElementVNode("div", _hoisted_64, [
  2869. _hoisted_65,
  2870. vue.createElementVNode("div", _hoisted_66, [
  2871. vue.createVNode(_component_BaseSwitch, {
  2872. modelValue: $data.activeEruda,
  2873. "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => $data.activeEruda = $event)
  2874. }, null, 8, ["modelValue"])
  2875. ])
  2876. ]),
  2877. _hoisted_67
  2878. ])
  2879. ])
  2880. ], 8, ["to"]);
  2881. }
  2882. const Setting = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$9], ["__scopeId", "data-v-424a2b09"]]);
  2883. const _sfc_main$k = {
  2884. name: "Point",
  2885. components: { Icon },
  2886. inject: ["post", "isLogin"],
  2887. props: {
  2888. item: {
  2889. type: Object,
  2890. default() {
  2891. return {};
  2892. }
  2893. },
  2894. full: {
  2895. type: Boolean,
  2896. default() {
  2897. return true;
  2898. }
  2899. },
  2900. apiUrl: ""
  2901. },
  2902. methods: {
  2903. thankError() {
  2904. if (!this.isLogin) {
  2905. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  2906. }
  2907. if (this.item.username === window.user.username) {
  2908. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "不能感谢自己" });
  2909. }
  2910. if (this.item.isThanked) {
  2911. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "已经感谢过了" });
  2912. }
  2913. this.thank();
  2914. },
  2915. async thank() {
  2916. this.$emit("addThank");
  2917. let url = `${window.baseUrl}/thank/${this.apiUrl}?once=${this.post.once}`;
  2918. $.post(url).then((res) => {
  2919. if (!res.success) {
  2920. this.$emit("recallThank");
  2921. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: res.message });
  2922. }
  2923. eventBus.emit(CMD.REFRESH_ONCE, res.once);
  2924. }, (err) => {
  2925. this.$emit("recallThank");
  2926. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "感谢失败" });
  2927. eventBus.emit(CMD.REFRESH_ONCE);
  2928. });
  2929. }
  2930. }
  2931. };
  2932. const _hoisted_1$j = {
  2933. key: 2,
  2934. class: "link-num"
  2935. };
  2936. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  2937. const _component_Icon = vue.resolveComponent("Icon");
  2938. return vue.openBlock(), vue.createElementBlock("div", {
  2939. class: "tool",
  2940. onClick: _cache[0] || (_cache[0] = (...args) => $options.thankError && $options.thankError(...args))
  2941. }, [
  2942. $props.item.isThanked ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  2943. key: 0,
  2944. color: "red",
  2945. icon: "icon-park-solid:like"
  2946. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  2947. key: 1,
  2948. color: "rgb(224,42,42)",
  2949. icon: "icon-park-outline:like"
  2950. })),
  2951. $props.item.thankCount ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$j, vue.toDisplayString($props.item.thankCount), 1)) : vue.createCommentVNode("", true)
  2952. ]);
  2953. }
  2954. const Point = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$8], ["__scopeId", "data-v-b7c6664e"]]);
  2955. const _sfc_main$j = {};
  2956. const _withScopeId$c = (n2) => (vue.pushScopeId("data-v-e92e0529"), n2 = n2(), vue.popScopeId(), n2);
  2957. const _hoisted_1$i = { class: "more" };
  2958. const _hoisted_2$f = /* @__PURE__ */ _withScopeId$c(() => /* @__PURE__ */ vue.createElementVNode("div", null, null, -1));
  2959. const _hoisted_3$c = /* @__PURE__ */ _withScopeId$c(() => /* @__PURE__ */ vue.createElementVNode("div", null, null, -1));
  2960. const _hoisted_4$b = /* @__PURE__ */ _withScopeId$c(() => /* @__PURE__ */ vue.createElementVNode("div", null, null, -1));
  2961. const _hoisted_5$9 = [
  2962. _hoisted_2$f,
  2963. _hoisted_3$c,
  2964. _hoisted_4$b
  2965. ];
  2966. function _sfc_render$7(_ctx, _cache) {
  2967. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, _hoisted_5$9);
  2968. }
  2969. const MoreIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$7], ["__scopeId", "data-v-e92e0529"]]);
  2970. const _sfc_main$i = {
  2971. name: "Author",
  2972. components: { MoreIcon, Point, Icon },
  2973. inject: ["isLogin", "tags", "config", "isNight"],
  2974. props: {
  2975. modelValue: false,
  2976. comment: {
  2977. type: Object,
  2978. default() {
  2979. return {};
  2980. }
  2981. },
  2982. type: {
  2983. type: String,
  2984. default() {
  2985. return "list";
  2986. }
  2987. }
  2988. },
  2989. computed: {
  2990. eventBus() {
  2991. return eventBus;
  2992. },
  2993. CMD() {
  2994. return CMD;
  2995. },
  2996. pointInfo() {
  2997. return {
  2998. isThanked: this.comment.isThanked,
  2999. thankCount: this.comment.thankCount,
  3000. username: this.comment.username
  3001. };
  3002. },
  3003. myTags() {
  3004. return this.tags[this.comment.username] ?? [];
  3005. }
  3006. },
  3007. methods: {
  3008. addTag() {
  3009. eventBus.emit(CMD.ADD_TAG, this.comment.username);
  3010. },
  3011. removeTag(tag) {
  3012. eventBus.emit(CMD.REMOVE_TAG, { username: this.comment.username, tag });
  3013. },
  3014. checkIsLogin(emitName = "") {
  3015. if (!this.isLogin) {
  3016. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  3017. return false;
  3018. }
  3019. this.$emit(emitName);
  3020. return true;
  3021. },
  3022. addThank() {
  3023. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "add" });
  3024. },
  3025. recallThank() {
  3026. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: this.comment.id, type: "recall" });
  3027. }
  3028. }
  3029. };
  3030. const _withScopeId$b = (n2) => (vue.pushScopeId("data-v-9041586a"), n2 = n2(), vue.popScopeId(), n2);
  3031. const _hoisted_1$h = { class: "Author-left" };
  3032. const _hoisted_2$e = ["href"];
  3033. const _hoisted_3$b = ["src"];
  3034. const _hoisted_4$a = { class: "info" };
  3035. const _hoisted_5$8 = { class: "top" };
  3036. const _hoisted_6$8 = { class: "texts" };
  3037. const _hoisted_7$7 = ["href"];
  3038. const _hoisted_8$7 = {
  3039. key: 0,
  3040. class: "owner"
  3041. };
  3042. const _hoisted_9$7 = {
  3043. key: 1,
  3044. class: "dup"
  3045. };
  3046. const _hoisted_10$6 = {
  3047. key: 2,
  3048. class: "mod"
  3049. };
  3050. const _hoisted_11$6 = { class: "my-tag" };
  3051. const _hoisted_12$6 = /* @__PURE__ */ _withScopeId$b(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  3052. const _hoisted_13$6 = ["onClick"];
  3053. const _hoisted_14$5 = { class: "floor" };
  3054. const _hoisted_15$5 = { class: "ago" };
  3055. const _hoisted_16$5 = { class: "Author-right" };
  3056. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  3057. const _component_Icon = vue.resolveComponent("Icon");
  3058. const _component_Point = vue.resolveComponent("Point");
  3059. const _component_MoreIcon = vue.resolveComponent("MoreIcon");
  3060. return vue.openBlock(), vue.createElementBlock("div", {
  3061. class: vue.normalizeClass(["Author", { expand: !$props.modelValue }])
  3062. }, [
  3063. vue.createElementVNode("div", _hoisted_1$h, [
  3064. !$props.modelValue ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  3065. key: 0,
  3066. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", true)),
  3067. color: "#177EC9",
  3068. class: "expand-icon",
  3069. icon: "gravity-ui:chevrons-expand-up-right"
  3070. })) : vue.createCommentVNode("", true),
  3071. $options.config.viewType !== "simple" ? (vue.openBlock(), vue.createElementBlock("a", {
  3072. key: 1,
  3073. class: "base-avatar",
  3074. href: `/member/${$props.comment.username}`
  3075. }, [
  3076. vue.createElementVNode("img", {
  3077. src: $props.comment.avatar,
  3078. alt: ""
  3079. }, null, 8, _hoisted_3$b)
  3080. ], 8, _hoisted_2$e)) : vue.createCommentVNode("", true),
  3081. vue.createElementVNode("div", _hoisted_4$a, [
  3082. vue.createElementVNode("div", _hoisted_5$8, [
  3083. vue.createElementVNode("span", _hoisted_6$8, [
  3084. vue.createElementVNode("strong", null, [
  3085. vue.createElementVNode("a", {
  3086. href: `/member/${$props.comment.username}`,
  3087. class: vue.normalizeClass(["username", { "dark": $options.isNight }])
  3088. }, vue.toDisplayString($props.comment.username), 11, _hoisted_7$7)
  3089. ]),
  3090. $props.comment.isOp ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$7, "OP")) : vue.createCommentVNode("", true),
  3091. $props.comment.isDup ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$7, "DUP")) : vue.createCommentVNode("", true),
  3092. $props.comment.isMod ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$6, "MOD")) : vue.createCommentVNode("", true),
  3093. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
  3094. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  3095. return vue.openBlock(), vue.createElementBlock("span", _hoisted_11$6, [
  3096. _hoisted_12$6,
  3097. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  3098. vue.createElementVNode("i", {
  3099. class: "fa fa-trash-o remove",
  3100. onClick: ($event) => $options.removeTag(i)
  3101. }, null, 8, _hoisted_13$6)
  3102. ]);
  3103. }), 256)),
  3104. vue.createElementVNode("span", {
  3105. class: "add-tag ago",
  3106. onClick: _cache[1] || (_cache[1] = (...args) => $options.addTag && $options.addTag(...args)),
  3107. title: "添加标签"
  3108. }, "+")
  3109. ], 64)) : vue.createCommentVNode("", true)
  3110. ])
  3111. ]),
  3112. vue.createElementVNode("div", null, [
  3113. vue.createElementVNode("span", _hoisted_14$5, vue.toDisplayString($props.comment.floor) + "楼", 1),
  3114. vue.createElementVNode("span", _hoisted_15$5, vue.toDisplayString($props.comment.date), 1)
  3115. ])
  3116. ])
  3117. ]),
  3118. vue.createElementVNode("div", _hoisted_16$5, [
  3119. vue.withDirectives(vue.createVNode(_component_Point, {
  3120. item: $options.pointInfo,
  3121. onAddThank: $options.addThank,
  3122. onRecallThank: $options.recallThank,
  3123. "api-url": "reply/" + $props.comment.id
  3124. }, null, 8, ["item", "onAddThank", "onRecallThank", "api-url"]), [
  3125. [vue.vShow, $props.comment.thankCount]
  3126. ]),
  3127. vue.createVNode(_component_MoreIcon, {
  3128. onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => $options.eventBus.emit($options.CMD.SHOW_COMMENT_OPTIONS, { ...$props.comment, top: $props.type === "top" }), ["stop"]))
  3129. })
  3130. ])
  3131. ], 2);
  3132. }
  3133. const Author = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$6], ["__scopeId", "data-v-9041586a"]]);
  3134. const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
  3135. __name: "BaseLoading",
  3136. props: {
  3137. size: { default: "normal" }
  3138. },
  3139. setup(__props) {
  3140. return (_ctx, _cache) => {
  3141. return vue.openBlock(), vue.createElementBlock("div", {
  3142. class: vue.normalizeClass(["loading", [_ctx.size]])
  3143. }, null, 2);
  3144. };
  3145. }
  3146. });
  3147. const BaseLoading = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-2697baa2"]]);
  3148. const _hoisted_1$g = {
  3149. key: 1,
  3150. class: "key-notice"
  3151. };
  3152. const _hoisted_2$d = { class: "key" };
  3153. const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
  3154. __name: "BaseButton",
  3155. props: {
  3156. keyboard: {},
  3157. active: { type: Boolean },
  3158. disabled: { type: Boolean },
  3159. loading: { type: Boolean },
  3160. size: { default: "normal" },
  3161. type: { default: "primary" }
  3162. },
  3163. emits: ["click"],
  3164. setup(__props) {
  3165. return (_ctx, _cache) => {
  3166. return vue.openBlock(), vue.createBlock(Tooltip, {
  3167. disabled: !_ctx.keyboard,
  3168. title: `快捷键: ${_ctx.keyboard}`
  3169. }, {
  3170. default: vue.withCtx(() => [
  3171. vue.createElementVNode("div", vue.mergeProps({ class: "base-button" }, _ctx.$attrs, {
  3172. onClick: _cache[0] || (_cache[0] = (e2) => !_ctx.disabled && !_ctx.loading && _ctx.$emit("click", e2)),
  3173. class: [
  3174. _ctx.active && "active",
  3175. _ctx.size,
  3176. _ctx.type,
  3177. (_ctx.disabled || _ctx.loading) && "disabled",
  3178. !_ctx.disabled && "hvr-grow"
  3179. ]
  3180. }), [
  3181. vue.createElementVNode("span", {
  3182. style: vue.normalizeStyle({ opacity: _ctx.loading ? 0 : 1 })
  3183. }, [
  3184. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  3185. ], 4),
  3186. _ctx.loading ? (vue.openBlock(), vue.createBlock(BaseLoading, {
  3187. key: 0,
  3188. size: "small"
  3189. })) : vue.createCommentVNode("", true),
  3190. _ctx.keyboard ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
  3191. vue.createElementVNode("span", _hoisted_2$d, vue.toDisplayString(_ctx.keyboard), 1)
  3192. ])) : vue.createCommentVNode("", true)
  3193. ], 16)
  3194. ]),
  3195. _: 3
  3196. }, 8, ["disabled", "title"]);
  3197. };
  3198. }
  3199. });
  3200. const BaseButton = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-04f4c89d"]]);
  3201. const _withScopeId$a = (n2) => (vue.pushScopeId("data-v-0612e02f"), n2 = n2(), vue.popScopeId(), n2);
  3202. const _hoisted_1$f = { class: "get-cursor" };
  3203. const _hoisted_2$c = ["innerHTML"];
  3204. const _hoisted_3$a = { class: "toolbar" };
  3205. const _hoisted_4$9 = { class: "left" };
  3206. const _hoisted_5$7 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("path", {
  3207. d: "M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",
  3208. fill: "none",
  3209. stroke: "#929596",
  3210. "stroke-width": "2",
  3211. "stroke-linejoin": "round"
  3212. }, null, -1));
  3213. const _hoisted_6$7 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("path", {
  3214. d: "M24 35C29 35 31 31 31 31H17C17 31 19 35 24 35Z",
  3215. stroke: "#929596",
  3216. "stroke-width": "2",
  3217. "stroke-linecap": "round",
  3218. "stroke-linejoin": "round"
  3219. }, null, -1));
  3220. const _hoisted_7$6 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("path", {
  3221. d: "M31 18V22",
  3222. stroke: "#929596",
  3223. "stroke-width": "2",
  3224. "stroke-linecap": "round",
  3225. "stroke-linejoin": "round"
  3226. }, null, -1));
  3227. const _hoisted_8$6 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("path", {
  3228. d: "M17 18V22",
  3229. stroke: "#929596",
  3230. "stroke-width": "2",
  3231. "stroke-linecap": "round",
  3232. "stroke-linejoin": "round"
  3233. }, null, -1));
  3234. const _hoisted_9$6 = [
  3235. _hoisted_5$7,
  3236. _hoisted_6$7,
  3237. _hoisted_7$6,
  3238. _hoisted_8$6
  3239. ];
  3240. const _hoisted_10$5 = { class: "upload" };
  3241. const _hoisted_11$5 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  3242. width: "20",
  3243. height: "20",
  3244. viewBox: "0 0 48 48",
  3245. fill: "none",
  3246. xmlns: "http://www.w3.org/2000/svg"
  3247. }, [
  3248. /* @__PURE__ */ vue.createElementVNode("path", {
  3249. "fill-rule": "evenodd",
  3250. "clip-rule": "evenodd",
  3251. d: "M5 10C5 8.89543 5.89543 8 7 8L41 8C42.1046 8 43 8.89543 43 10V38C43 39.1046 42.1046 40 41 40H7C5.89543 40 5 39.1046 5 38V10Z",
  3252. stroke: "#929596",
  3253. "stroke-width": "2",
  3254. "stroke-linecap": "round",
  3255. "stroke-linejoin": "round"
  3256. }),
  3257. /* @__PURE__ */ vue.createElementVNode("path", {
  3258. "fill-rule": "evenodd",
  3259. "clip-rule": "evenodd",
  3260. d: "M14.5 18C15.3284 18 16 17.3284 16 16.5C16 15.6716 15.3284 15 14.5 15C13.6716 15 13 15.6716 13 16.5C13 17.3284 13.6716 18 14.5 18Z",
  3261. stroke: "#929596",
  3262. "stroke-width": "2",
  3263. "stroke-linecap": "round",
  3264. "stroke-linejoin": "round"
  3265. }),
  3266. /* @__PURE__ */ vue.createElementVNode("path", {
  3267. d: "M15 24L20 28L26 21L43 34V38C43 39.1046 42.1046 40 41 40H7C5.89543 40 5 39.1046 5 38V34L15 24Z",
  3268. fill: "none",
  3269. stroke: "#929596",
  3270. "stroke-width": "2",
  3271. "stroke-linejoin": "round"
  3272. })
  3273. ], -1));
  3274. const _hoisted_12$5 = {
  3275. key: 0,
  3276. style: { "color": "black", "font-size": "1.4rem" }
  3277. };
  3278. const _hoisted_13$5 = { class: "right" };
  3279. const _hoisted_14$4 = /* @__PURE__ */ _withScopeId$a(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, "经典表情", -1));
  3280. const _hoisted_15$4 = { class: "list" };
  3281. const _hoisted_16$4 = ["src", "onClick"];
  3282. const _hoisted_17$2 = { class: "emoji" };
  3283. const _hoisted_18$2 = { class: "title" };
  3284. const _hoisted_19$2 = { class: "list" };
  3285. const _hoisted_20$2 = ["onClick"];
  3286. const _sfc_main$f = {
  3287. __name: "PostEditor",
  3288. props: {
  3289. replyUser: null,
  3290. replyFloor: null,
  3291. useType: {
  3292. type: String,
  3293. default() {
  3294. return "reply-comment";
  3295. }
  3296. }
  3297. },
  3298. emits: ["close"],
  3299. setup(__props, { expose: __expose, emit: __emit }) {
  3300. let props = __props;
  3301. let { replyUser, replyFloor, useType } = props;
  3302. let replyInfo = replyUser ? `@${replyUser} #${replyFloor} ` : "";
  3303. const emits = __emit;
  3304. const post = vue.inject("post");
  3305. const show = vue.inject("show");
  3306. const isNight = vue.inject("isNight");
  3307. const allReplyUsers = vue.inject("allReplyUsers");
  3308. let isFocus = vue.ref(false);
  3309. const loading = vue.ref(false);
  3310. const uploadLoading = vue.ref(false);
  3311. const isShowEmoticons = vue.ref(false);
  3312. const editorId = vue.ref("editorId_" + Date.now());
  3313. const content = vue.ref(replyInfo);
  3314. const txtRef = vue.ref(null);
  3315. const cursorRef = vue.ref(null);
  3316. const emoticonsRef = vue.ref(null);
  3317. const none = vue.ref('<span style="white-space:pre-wrap;"> </span>');
  3318. vue.watch(props, (n2) => {
  3319. replyUser = props.replyUser;
  3320. replyFloor = props.replyFloor;
  3321. useType = props.useType;
  3322. replyInfo = replyUser ? `@${replyUser} #${replyFloor} ` : "";
  3323. content.value = replyInfo;
  3324. });
  3325. const emojiEmoticons = [
  3326. {
  3327. title: "小黄脸",
  3328. list: [
  3329. "😀",
  3330. "😁",
  3331. "😂",
  3332. "🤣",
  3333. "😅",
  3334. "😊",
  3335. "😋",
  3336. "😘",
  3337. "🥰",
  3338. "😗",
  3339. "🤩",
  3340. "🤔",
  3341. "🤨",
  3342. "😐",
  3343. "😑",
  3344. "🙄",
  3345. "😏",
  3346. "😪",
  3347. "😫",
  3348. "🥱",
  3349. "😜",
  3350. "😒",
  3351. "😔",
  3352. "😨",
  3353. "😰",
  3354. "😱",
  3355. "🥵",
  3356. "😡",
  3357. "🥳",
  3358. "🥺",
  3359. "🤭",
  3360. "🧐",
  3361. "😎",
  3362. "🤓",
  3363. "😭",
  3364. "🤑",
  3365. "🤮"
  3366. ]
  3367. },
  3368. {
  3369. title: "手势",
  3370. list: [
  3371. "🙋",
  3372. "🙎",
  3373. "🙅",
  3374. "🙇",
  3375. "🤷",
  3376. "🤏",
  3377. "👉",
  3378. "✌️",
  3379. "🤘",
  3380. "🤙",
  3381. "👌",
  3382. "🤌",
  3383. "👍",
  3384. "👎",
  3385. "👋",
  3386. "🤝",
  3387. "🙏",
  3388. "👏"
  3389. ]
  3390. },
  3391. {
  3392. title: "庆祝",
  3393. list: ["✨", "🎉", "🎊"]
  3394. },
  3395. {
  3396. title: "其他",
  3397. list: ["👻", "🤡", "🐔", "👀", "💩", "🐴", "🦄", "🐧", "🐶", "🐒", "🙈", "🙉", "🙊", "🐵"]
  3398. }
  3399. ];
  3400. const classicsEmoticons = [
  3401. {
  3402. name: "[狗头]",
  3403. low: "https://i.imgur.com/io2SM1h.png",
  3404. high: "https://i.imgur.com/0icl60r.png"
  3405. },
  3406. {
  3407. name: "[马]",
  3408. low: "https://i.imgur.com/8EKZv7I.png",
  3409. high: "https://i.imgur.com/ANFUX52.png"
  3410. },
  3411. {
  3412. name: "[不高兴]",
  3413. low: "https://i.imgur.com/huX6coX.png",
  3414. high: "https://i.imgur.com/N7JEuvc.png"
  3415. },
  3416. {
  3417. name: "[呵呵]",
  3418. low: "https://i.imgur.com/RvoLAbX.png",
  3419. high: "https://i.imgur.com/xSzIqrK.png"
  3420. },
  3421. {
  3422. name: "[真棒]",
  3423. low: "https://i.imgur.com/xr1UOz1.png",
  3424. high: "https://i.imgur.com/w8YEw9Q.png"
  3425. },
  3426. {
  3427. name: "[鄙视]",
  3428. low: "https://i.imgur.com/u6jlqVq.png",
  3429. high: "https://i.imgur.com/8JFNANq.png"
  3430. },
  3431. {
  3432. name: "[疑问]",
  3433. low: "https://i.imgur.com/F29pmQ6.png",
  3434. high: "https://i.imgur.com/EbbTQAR.png"
  3435. },
  3436. {
  3437. name: "[吐舌]",
  3438. low: "https://i.imgur.com/InmIzl9.png",
  3439. high: "https://i.imgur.com/Ovj56Cd.png"
  3440. },
  3441. // {
  3442. // name: '[嘲笑]',
  3443. // low: 'https://i.imgur.com/BaWcsMR.png',
  3444. // high: 'https://i.imgur.com/0OGfJw4.png'
  3445. // },
  3446. // {
  3447. // name: '[滑稽]',
  3448. // low: 'https://i.imgur.com/lmbN0yI.png',
  3449. // high: 'https://i.imgur.com/Pc0wH85.png'
  3450. // },
  3451. {
  3452. name: "[笑眼]",
  3453. low: "https://i.imgur.com/ZveiiGy.png",
  3454. high: "https://i.imgur.com/PI1CfEr.png"
  3455. },
  3456. {
  3457. name: "[狂汗]",
  3458. low: "https://i.imgur.com/veWihk6.png",
  3459. high: "https://i.imgur.com/3LtHdQv.png"
  3460. },
  3461. {
  3462. name: "[大哭]",
  3463. low: "https://i.imgur.com/hu4oR6C.png",
  3464. high: "https://i.imgur.com/b4X9XLE.png"
  3465. },
  3466. {
  3467. name: "[喷]",
  3468. low: "https://i.imgur.com/bkw3VRr.png",
  3469. high: "https://i.imgur.com/wnZL13L.png"
  3470. },
  3471. {
  3472. name: "[苦笑]",
  3473. low: "https://i.imgur.com/VUWFktU.png",
  3474. high: "https://i.imgur.com/NAfspZ1.png"
  3475. },
  3476. {
  3477. name: "[喝酒]",
  3478. low: "https://i.imgur.com/2ZZSapE.png",
  3479. high: "https://i.imgur.com/rVbSVak.png"
  3480. },
  3481. {
  3482. name: "[吃瓜]",
  3483. low: "https://i.imgur.com/ee8Lq7H.png",
  3484. high: "https://i.imgur.com/0L26og9.png"
  3485. },
  3486. {
  3487. name: "[捂脸]",
  3488. low: "https://i.imgur.com/krir4IG.png",
  3489. high: "https://i.imgur.com/qqBqgVm.png"
  3490. },
  3491. {
  3492. name: "[呕]",
  3493. low: "https://i.imgur.com/6CUiUxv.png",
  3494. high: "https://i.imgur.com/kgdxRsG.png"
  3495. },
  3496. {
  3497. name: "[阴险]",
  3498. low: "https://i.imgur.com/MA8YqTP.png",
  3499. high: "https://i.imgur.com/e94jbaT.png"
  3500. },
  3501. {
  3502. name: "[怒]",
  3503. low: "https://i.imgur.com/n4kWfGB.png",
  3504. high: "https://i.imgur.com/iMXxNxh.png"
  3505. },
  3506. {
  3507. name: "[衰]",
  3508. low: "https://i.imgur.com/voHFDyQ.png",
  3509. high: "https://i.imgur.com/XffE6gu.png"
  3510. },
  3511. {
  3512. name: "[合十]",
  3513. low: "https://i.imgur.com/I8x3ang.png",
  3514. high: "https://i.imgur.com/T4rJVee.png"
  3515. },
  3516. {
  3517. name: "[赞]",
  3518. low: "https://i.imgur.com/lG44yUl.png",
  3519. high: "https://i.imgur.com/AoF5PLp.png"
  3520. },
  3521. {
  3522. name: "[踩]",
  3523. low: "https://i.imgur.com/cJp0uKZ.png",
  3524. high: "https://i.imgur.com/1XYGfXj.png"
  3525. },
  3526. {
  3527. name: "[爱心]",
  3528. low: "https://i.imgur.com/sLENaF5.png",
  3529. high: "https://i.imgur.com/dND56oX.png"
  3530. },
  3531. {
  3532. name: "[心碎]",
  3533. low: "https://i.imgur.com/AZxJzve.png",
  3534. high: "https://i.imgur.com/RiUsPci.png"
  3535. }
  3536. ];
  3537. const imgurClientIdPool = [
  3538. "3107b9ef8b316f3",
  3539. "442b04f26eefc8a",
  3540. "59cfebe717c09e4",
  3541. "60605aad4a62882",
  3542. "6c65ab1d3f5452a",
  3543. "83e123737849aa9",
  3544. "9311f6be1c10160",
  3545. "c4a4a563f698595",
  3546. "81be04b9e4a08ce"
  3547. ];
  3548. const editorClass = vue.computed(() => {
  3549. return [isFocus.value ? "isFocus" : "", isNight.value ? "isNight" : ""];
  3550. });
  3551. const cursorHtml = vue.computed(() => {
  3552. var _a;
  3553. if (!txtRef.value || !content.value)
  3554. return "";
  3555. let index = ((_a = txtRef.value) == null ? void 0 : _a.selectionStart) || 0;
  3556. return content.value.substring(0, index).replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br/>").replace(/\s/g, none.value);
  3557. });
  3558. const disabled = vue.computed(() => {
  3559. if (content.value) {
  3560. return content.value === replyInfo;
  3561. } else {
  3562. return true;
  3563. }
  3564. });
  3565. function focus() {
  3566. txtRef.value.focus();
  3567. }
  3568. __expose({ content, focus });
  3569. function drop(e2) {
  3570. e2.preventDefault();
  3571. upload(e2.dataTransfer.files[0]);
  3572. }
  3573. async function upload(file) {
  3574. if (!file)
  3575. return;
  3576. if (uploadLoading.value)
  3577. return;
  3578. uploadLoading.value = true;
  3579. const formData = new FormData();
  3580. formData.append("image", file);
  3581. const randomIndex = Math.floor(Math.random() * imgurClientIdPool.length);
  3582. const clidenId = imgurClientIdPool[randomIndex];
  3583. const res = await fetch("https://api.imgur.com/3/upload", {
  3584. method: "POST",
  3585. headers: { Authorization: `Client-ID ${clidenId}` },
  3586. body: formData
  3587. });
  3588. uploadLoading.value = false;
  3589. if (res.ok) {
  3590. const resData = await res.json();
  3591. if (resData.success) {
  3592. return insert(" " + resData.data.link + " ");
  3593. }
  3594. }
  3595. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "上传失败" });
  3596. }
  3597. async function submit() {
  3598. if (disabled.value || loading.value)
  3599. return;
  3600. loading.value = true;
  3601. let submit_content = content.value.replace(/\[((?!\[).)+\]/g, function(match) {
  3602. let item2 = classicsEmoticons.find((v) => v.name === match);
  3603. if (item2) {
  3604. return item2.low + " ";
  3605. }
  3606. return match;
  3607. });
  3608. let show_content = content.value.replace(/https?:\/\/(i\.)?imgur\.com\/((?!http).)+\.(gif|png|jpg|jpeg|GIF|PNG|JPG|JPEG)/g, function(match) {
  3609. return `<img src="${match}" data-originUrl="${match}" data-notice="这个img标签由v2ex-超级增强脚本解析" style="max-width: 100%">`;
  3610. });
  3611. show_content = show_content.replace(/\[((?!\[).)+\]/g, function(match) {
  3612. let item2 = classicsEmoticons.find((v) => v.name === match);
  3613. if (item2) {
  3614. return `<a target="_blank" href="${item2.low}" rel="nofollow noopener"><img src="${item2.low}" class="embedded_image" rel="noreferrer"></a> `;
  3615. }
  3616. return match;
  3617. });
  3618. let matchUsers = show_content.match(/@([\w]+?[\s])/g);
  3619. if (matchUsers) {
  3620. matchUsers.map((i) => {
  3621. let username = i.replace("@", "").replace(" ", "");
  3622. show_content = show_content.replace(username, `<a href="/member/${username}">${username}</a>`);
  3623. });
  3624. }
  3625. show_content = show_content.replaceAll("\n", "<br/>");
  3626. let item = {
  3627. thankCount: 0,
  3628. isThanked: false,
  3629. isOp: post.value.username === window.user.username,
  3630. isDup: false,
  3631. id: Date.now(),
  3632. username: window.user.username,
  3633. avatar: window.user.avatar,
  3634. date: "几秒前",
  3635. floor: post.value.replyCount + 1,
  3636. reply_content: show_content ?? "",
  3637. children: [],
  3638. replyUsers: replyUser ? [replyUser] : [],
  3639. replyFloor: replyFloor || -1,
  3640. level: useType === "reply-comment" ? 1 : 0
  3641. };
  3642. item.hideCallUserReplyContent = item.reply_content;
  3643. if (item.replyUsers.length === 1) {
  3644. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(\s#[\d]+)?\s(<br>)?/, () => "");
  3645. }
  3646. console.log("回复", item);
  3647. let url = `${window.baseUrl}/t/${post.value.id}`;
  3648. $.post(url, { content: submit_content, once: post.value.once }).then(
  3649. // $.post(url, {content: submit_content, once: 123}).then(
  3650. (res) => {
  3651. loading.value = false;
  3652. let r2 = res.search("你上一条回复的内容和这条相同");
  3653. if (r2 > -1)
  3654. return eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你上一条回复的内容和这条相同" });
  3655. r2 = res.search("请不要在每一个回复中都包括外链,这看起来像是在 spamming");
  3656. if (r2 > -1)
  3657. return eventBus.emit(CMD.SHOW_MSG, {
  3658. type: "error",
  3659. text: "请不要在每一个回复中都包括外链,这看起来像是在 spamming"
  3660. });
  3661. let r22 = res.search("创建新回复");
  3662. if (r22 > -1) {
  3663. eventBus.emit(CMD.REFRESH_ONCE, res);
  3664. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复出现了问题,请使用原版进行回复" });
  3665. let clientWidth = window.document.body.clientWidth;
  3666. let windowWidth = 1200;
  3667. let left = clientWidth / 2 - windowWidth / 2;
  3668. let newWin = window.open("创建新回复", "", `width=${windowWidth},height=600,left=${left},top=100`);
  3669. newWin.document.write(res);
  3670. let loop = setInterval(function() {
  3671. if (newWin.closed) {
  3672. clearInterval(loop);
  3673. eventBus.emit(CMD.REFRESH_POST);
  3674. }
  3675. }, 1e3);
  3676. return;
  3677. }
  3678. content.value = replyInfo;
  3679. emits("close");
  3680. eventBus.emit(CMD.REFRESH_ONCE, res);
  3681. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "回复成功" });
  3682. eventBus.emit(CMD.ADD_REPLY, item);
  3683. },
  3684. (err) => {
  3685. console.log("err", err);
  3686. loading.value = false;
  3687. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "回复失败" });
  3688. }
  3689. ).catch((r2) => {
  3690. console.log("catch", r2);
  3691. });
  3692. }
  3693. function showEmoticons(e2) {
  3694. if (isShowEmoticons.value) {
  3695. return isShowEmoticons.value = false;
  3696. }
  3697. let rect = e2.currentTarget.getBoundingClientRect();
  3698. emoticonsRef.value.style.left = rect.left + 30 + "px";
  3699. emoticonsRef.value.style.bottom = window.innerHeight - rect.top - 20 + "px";
  3700. isShowEmoticons.value = true;
  3701. }
  3702. function off() {
  3703. eventBus.emit(CMD.SHOW_CALL, { show: false });
  3704. eventBus.off(CMD.SET_CALL);
  3705. }
  3706. function checkHeight2() {
  3707. txtRef.value.style.height = 0;
  3708. txtRef.value.style.height = txtRef.value.scrollHeight + "px";
  3709. }
  3710. function insert(str) {
  3711. let cursorPos = txtRef.value.selectionStart;
  3712. let start = content.value.slice(0, cursorPos);
  3713. let end = content.value.slice(cursorPos, content.value.length);
  3714. content.value = start + str + end;
  3715. let moveCursorPos = start.length + str.length;
  3716. setTimeout(() => {
  3717. txtRef.value.focus();
  3718. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  3719. checkHeight2();
  3720. });
  3721. }
  3722. function showCallPopover(text) {
  3723. let r2 = cursorRef.value.getBoundingClientRect();
  3724. eventBus.emit(CMD.SHOW_CALL, { show: true, top: r2.top, left: r2.left, text });
  3725. eventBus.off(CMD.SET_CALL);
  3726. eventBus.on(CMD.SET_CALL, (e2) => {
  3727. let cursorPos = txtRef.value.selectionStart;
  3728. let start = content.value.slice(0, cursorPos);
  3729. let end = content.value.slice(cursorPos, content.value.length);
  3730. let lastCallPos = start.lastIndexOf("@");
  3731. start = content.value.slice(0, lastCallPos + 1);
  3732. if (e2 === "管理员") {
  3733. e2 = "Livid @Kai @Olivia @GordianZ @sparanoid";
  3734. }
  3735. if (e2 === "所有人") {
  3736. e2 = allReplyUsers.value.map((v, i) => {
  3737. if (i)
  3738. return "@" + v;
  3739. else
  3740. return v;
  3741. }).join(" ");
  3742. }
  3743. content.value = start + e2 + " " + end;
  3744. let moveCursorPos = start.length + e2.length + 1;
  3745. setTimeout(() => {
  3746. txtRef.value.setSelectionRange(moveCursorPos, moveCursorPos);
  3747. checkHeight2();
  3748. });
  3749. eventBus.off(CMD.SET_CALL);
  3750. });
  3751. }
  3752. function onKeydown(e2) {
  3753. let code = e2.keyCode;
  3754. switch (code) {
  3755. case 8:
  3756. if (content.value === "@") {
  3757. off();
  3758. }
  3759. break;
  3760. case 37:
  3761. case 38:
  3762. case 39:
  3763. case 40:
  3764. setTimeout(() => onInput({ data: "" }), 100);
  3765. break;
  3766. case 27:
  3767. e2.preventDefault();
  3768. e2.stopPropagation();
  3769. e2.stopImmediatePropagation();
  3770. return false;
  3771. case 13:
  3772. if (e2.ctrlKey)
  3773. submit();
  3774. if (e2.metaKey)
  3775. submit();
  3776. break;
  3777. }
  3778. }
  3779. function onInput(e2) {
  3780. let cursorPos = txtRef.value.selectionStart;
  3781. if (!content.value)
  3782. return;
  3783. if (e2.data === " ") {
  3784. return off();
  3785. }
  3786. if (e2.data === "@") {
  3787. if (content.value.length !== 1) {
  3788. if (content.value[cursorPos - 2] === " " || content.value[cursorPos - 2] === "\n") {
  3789. return showCallPopover("");
  3790. }
  3791. } else {
  3792. return showCallPopover("");
  3793. }
  3794. off();
  3795. } else {
  3796. let judgeStr = content.value.slice(0, cursorPos);
  3797. let lastCallPos = judgeStr.lastIndexOf("@");
  3798. if (lastCallPos === -1) {
  3799. return off();
  3800. }
  3801. let callStr = judgeStr.slice(lastCallPos, cursorPos);
  3802. let hasSpace = callStr.includes(" ");
  3803. if (hasSpace) {
  3804. off();
  3805. } else {
  3806. if (lastCallPos === 0) {
  3807. return showCallPopover(callStr.replace("@", ""));
  3808. }
  3809. if (content.value.length !== 1) {
  3810. if (content.value[lastCallPos - 1] === " " || content.value[lastCallPos - 1] === "\n") {
  3811. return showCallPopover(callStr.replace("@", ""));
  3812. }
  3813. } else {
  3814. return showCallPopover(callStr.replace("@", ""));
  3815. }
  3816. off();
  3817. }
  3818. }
  3819. }
  3820. function onPaste(e2) {
  3821. const dataTransferItemList = e2.clipboardData.items;
  3822. const items = [].slice.call(dataTransferItemList).filter(function(item) {
  3823. return item.type.indexOf("image") !== -1;
  3824. });
  3825. if (items.length === 0) {
  3826. return;
  3827. }
  3828. const dataTransferItem = items[0];
  3829. const blob = dataTransferItem.getAsFile();
  3830. upload(blob);
  3831. }
  3832. function onBlur() {
  3833. document.removeEventListener("paste", onPaste);
  3834. isFocus.value = false;
  3835. }
  3836. function onFocusin() {
  3837. document.addEventListener("paste", onPaste);
  3838. }
  3839. vue.watch(() => show, (n2) => {
  3840. if (n2.value)
  3841. isShowEmoticons.value = false;
  3842. }, { deep: true });
  3843. vue.onMounted(() => {
  3844. $(`.${editorId.value}`).each(function() {
  3845. this.setAttribute("style", "height:" + this.scrollHeight + "px;overflow-y:hidden;");
  3846. }).on("input", function() {
  3847. this.style.height = 0;
  3848. this.style.height = this.scrollHeight + "px";
  3849. });
  3850. });
  3851. return (_ctx, _cache) => {
  3852. return vue.openBlock(), vue.createElementBlock("div", {
  3853. class: vue.normalizeClass(["post-editor-wrapper", editorClass.value])
  3854. }, [
  3855. vue.withDirectives(vue.createElementVNode("textarea", {
  3856. class: vue.normalizeClass(["post-editor", editorId.value]),
  3857. ref_key: "txtRef",
  3858. ref: txtRef,
  3859. onFocus: _cache[0] || (_cache[0] = ($event) => vue.isRef(isFocus) ? isFocus.value = true : isFocus = true),
  3860. onBlur,
  3861. onFocusin,
  3862. placeholder: "请尽量让自己的回复能够对别人有帮助",
  3863. onInput,
  3864. onKeydown,
  3865. onDrop: drop,
  3866. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => content.value = $event)
  3867. }, null, 34), [
  3868. [vue.vModelText, content.value]
  3869. ]),
  3870. vue.createElementVNode("div", _hoisted_1$f, [
  3871. vue.createElementVNode("span", { innerHTML: cursorHtml.value }, null, 8, _hoisted_2$c),
  3872. vue.createElementVNode("span", {
  3873. class: "cursor",
  3874. ref_key: "cursorRef",
  3875. ref: cursorRef
  3876. }, "|", 512)
  3877. ]),
  3878. vue.createElementVNode("div", _hoisted_3$a, [
  3879. vue.createElementVNode("div", _hoisted_4$9, [
  3880. (vue.openBlock(), vue.createElementBlock("svg", {
  3881. onClick: showEmoticons,
  3882. width: "20",
  3883. height: "20",
  3884. viewBox: "0 0 48 48",
  3885. fill: "none",
  3886. xmlns: "http://www.w3.org/2000/svg"
  3887. }, _hoisted_9$6)),
  3888. vue.createElementVNode("div", _hoisted_10$5, [
  3889. vue.createElementVNode("input", {
  3890. type: "file",
  3891. accept: "image/*",
  3892. onChange: _cache[2] || (_cache[2] = (e2) => upload(e2.currentTarget.files[0]))
  3893. }, null, 32),
  3894. _hoisted_11$5
  3895. ]),
  3896. uploadLoading.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_12$5, "上传中.....")) : vue.createCommentVNode("", true)
  3897. ]),
  3898. vue.createElementVNode("div", _hoisted_13$5, [
  3899. vue.createVNode(BaseButton, {
  3900. size: "small",
  3901. disabled: disabled.value,
  3902. loading: loading.value,
  3903. onClick: submit
  3904. }, {
  3905. default: vue.withCtx(() => [
  3906. vue.createTextVNode("回复 ")
  3907. ]),
  3908. _: 1
  3909. }, 8, ["disabled", "loading"])
  3910. ])
  3911. ]),
  3912. vue.withDirectives(vue.createElementVNode("div", {
  3913. class: "emoticon-pack",
  3914. ref_key: "emoticonsRef",
  3915. ref: emoticonsRef
  3916. }, [
  3917. vue.createElementVNode("i", {
  3918. class: "fa fa-times",
  3919. "aria-hidden": "true",
  3920. onClick: _cache[3] || (_cache[3] = ($event) => isShowEmoticons.value = false)
  3921. }),
  3922. _hoisted_14$4,
  3923. vue.createElementVNode("div", _hoisted_15$4, [
  3924. (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(classicsEmoticons, (item) => {
  3925. return vue.createElementVNode("img", {
  3926. src: item.high,
  3927. onClick: ($event) => {
  3928. insert(item.name);
  3929. isShowEmoticons.value = false;
  3930. }
  3931. }, null, 8, _hoisted_16$4);
  3932. }), 64))
  3933. ]),
  3934. vue.createElementVNode("div", _hoisted_17$2, [
  3935. (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(emojiEmoticons, (item) => {
  3936. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  3937. vue.createElementVNode("div", _hoisted_18$2, vue.toDisplayString(item.title), 1),
  3938. vue.createElementVNode("div", _hoisted_19$2, [
  3939. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.list, (emoji) => {
  3940. return vue.openBlock(), vue.createElementBlock("span", {
  3941. onClick: ($event) => {
  3942. insert(emoji);
  3943. isShowEmoticons.value = false;
  3944. }
  3945. }, vue.toDisplayString(emoji), 9, _hoisted_20$2);
  3946. }), 256))
  3947. ])
  3948. ], 64);
  3949. }), 64))
  3950. ])
  3951. ], 512), [
  3952. [vue.vShow, isShowEmoticons.value]
  3953. ])
  3954. ], 2);
  3955. };
  3956. }
  3957. };
  3958. const PostEditor = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-0612e02f"]]);
  3959. const _hoisted_1$e = {
  3960. key: 0,
  3961. class: "html-wrapper"
  3962. };
  3963. const _hoisted_2$b = ["innerHTML"];
  3964. const checkHeight = 900;
  3965. const _sfc_main$e = {
  3966. __name: "BaseHtmlRender",
  3967. props: ["html"],
  3968. setup(__props) {
  3969. const config2 = vue.inject("config");
  3970. const props = __props;
  3971. const contentRef = vue.ref(null);
  3972. const htmlMask = vue.ref(false);
  3973. const handOpen = vue.ref(false);
  3974. function mouseup(e2) {
  3975. if (!config2.value.base64)
  3976. return;
  3977. let selectionText = window.win().getSelection().toString();
  3978. if (selectionText) {
  3979. let r2 = selectionText.match(/([A-Za-z0-9+/=]+)/g);
  3980. if (r2) {
  3981. if (r2[0].length < 4)
  3982. return;
  3983. eventBus.emit(CMD.SHOW_TOOLTIP, { text: r2[0], e: e2 });
  3984. }
  3985. }
  3986. }
  3987. vue.watch(config2.value, (newVale) => {
  3988. if (!newVale.contentAutoCollapse) {
  3989. htmlMask.value = false;
  3990. }
  3991. });
  3992. vue.watch([() => contentRef.value, () => props.html], () => {
  3993. if (!contentRef.value || !props.html)
  3994. return;
  3995. if (!config2.value.contentAutoCollapse)
  3996. return;
  3997. contentRef.value.querySelectorAll("img").forEach((item) => {
  3998. item.removeEventListener("load", checkContentHeight);
  3999. item.addEventListener("load", checkContentHeight);
  4000. });
  4001. checkContentHeight();
  4002. }, { immediate: true, flush: "post" });
  4003. function checkContentHeight() {
  4004. if (handOpen.value)
  4005. return;
  4006. let rect = contentRef.value.getBoundingClientRect();
  4007. htmlMask.value = rect.height >= checkHeight;
  4008. }
  4009. return (_ctx, _cache) => {
  4010. return props.html ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$e, [
  4011. vue.createElementVNode("div", {
  4012. class: vue.normalizeClass({ htmlMask: htmlMask.value })
  4013. }, [
  4014. vue.createElementVNode("div", {
  4015. ref_key: "contentRef",
  4016. ref: contentRef,
  4017. innerHTML: props.html,
  4018. onMouseup: mouseup
  4019. }, null, 40, _hoisted_2$b)
  4020. ], 2),
  4021. htmlMask.value ? (vue.openBlock(), vue.createElementBlock("div", {
  4022. key: 0,
  4023. class: "expand",
  4024. onClick: _cache[0] || (_cache[0] = ($event) => {
  4025. htmlMask.value = false;
  4026. handOpen.value = true;
  4027. })
  4028. }, "展开")) : vue.createCommentVNode("", true)
  4029. ])) : vue.createCommentVNode("", true);
  4030. };
  4031. }
  4032. };
  4033. const BaseHtmlRender = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-f8165980"]]);
  4034. const _sfc_main$d = {
  4035. name: "Comment",
  4036. components: { MoreIcon, BaseHtmlRender, Author, PostEditor, Point },
  4037. inject: ["post", "show", "isNight", "config"],
  4038. props: {
  4039. modelValue: {
  4040. reply_content: ""
  4041. },
  4042. type: {
  4043. type: String,
  4044. default() {
  4045. return "list";
  4046. }
  4047. }
  4048. },
  4049. data() {
  4050. return {
  4051. edit: false,
  4052. ding: false,
  4053. expand: true,
  4054. expandWrong: false,
  4055. replyInfo: `@${this.modelValue.username} #${this.modelValue.floor} `,
  4056. cssStyle: null,
  4057. floor: this.modelValue.floor
  4058. };
  4059. },
  4060. watch: {
  4061. show(e2) {
  4062. if (e2) {
  4063. this.edit = false;
  4064. }
  4065. },
  4066. postDetailWidth(n2, o) {
  4067. this.checkIsTooLong(n2);
  4068. }
  4069. },
  4070. computed: {
  4071. eventBus() {
  4072. return eventBus;
  4073. },
  4074. CMD() {
  4075. return CMD;
  4076. },
  4077. CommentDisplayType() {
  4078. return CommentDisplayType;
  4079. },
  4080. myClass() {
  4081. return {
  4082. isOp: this.modelValue.isOp,
  4083. ding: this.ding,
  4084. isLevelOne: this.modelValue.level === 0,
  4085. ["c_" + this.floor]: this.type !== "top"
  4086. };
  4087. }
  4088. },
  4089. mounted() {
  4090. this.checkIsTooLong();
  4091. },
  4092. methods: {
  4093. checkIsTooLong() {
  4094. let rect = this.$refs.comment.getBoundingClientRect();
  4095. let postDetailWidth = document.body.clientWidth;
  4096. let ban = postDetailWidth / 2;
  4097. if (ban < rect.width && rect.width < ban + 25 && this.modelValue.children.length) {
  4098. this.expand = false;
  4099. let padding = 2;
  4100. this.cssStyle = {
  4101. padding: "1rem 0",
  4102. width: `calc(${postDetailWidth}px - ${padding}rem)`,
  4103. transform: `translateX(calc(${rect.width - postDetailWidth}px + ${padding}rem))`,
  4104. background: this.isNight ? "#18222d" : "white"
  4105. };
  4106. }
  4107. },
  4108. //高亮一下
  4109. showDing() {
  4110. this.ding = true;
  4111. setTimeout(() => {
  4112. this.ding = false;
  4113. }, 2e3);
  4114. },
  4115. toggle() {
  4116. this.expand = !this.expand;
  4117. }
  4118. }
  4119. };
  4120. const _withScopeId$9 = (n2) => (vue.pushScopeId("data-v-312e9541"), n2 = n2(), vue.popScopeId(), n2);
  4121. const _hoisted_1$d = ["data-floor"];
  4122. const _hoisted_2$a = { class: "comment-content" };
  4123. const _hoisted_3$9 = { class: "right" };
  4124. const _hoisted_4$8 = { class: "w" };
  4125. const _hoisted_5$6 = {
  4126. key: 0,
  4127. class: "wrong-wrapper"
  4128. };
  4129. const _hoisted_6$6 = ["href"];
  4130. const _hoisted_7$5 = { class: "del-line" };
  4131. const _hoisted_8$5 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("i", {
  4132. class: "fa fa-question-circle-o wrong-icon",
  4133. "aria-hidden": "true"
  4134. }, null, -1));
  4135. const _hoisted_9$5 = {
  4136. key: 0,
  4137. class: "warning"
  4138. };
  4139. const _hoisted_10$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4140. const _hoisted_11$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4141. const _hoisted_12$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4142. const _hoisted_13$4 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4143. const _hoisted_14$3 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1));
  4144. const _hoisted_15$3 = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ vue.createElementVNode("a", {
  4145. href: "https://github.com/zyronon/web-scripts/issues",
  4146. target: "_blank"
  4147. }, "这里", -1));
  4148. const _hoisted_16$3 = { class: "simple-wrapper" };
  4149. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  4150. const _component_Author = vue.resolveComponent("Author");
  4151. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  4152. const _component_Comment = vue.resolveComponent("Comment", true);
  4153. return vue.openBlock(), vue.createElementBlock("div", {
  4154. class: vue.normalizeClass(["comment", $options.myClass]),
  4155. ref: "comment",
  4156. "data-floor": $data.floor
  4157. }, [
  4158. vue.createVNode(_component_Author, {
  4159. modelValue: $data.expand,
  4160. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.expand = $event),
  4161. comment: $props.modelValue,
  4162. type: $props.type
  4163. }, null, 8, ["modelValue", "comment", "type"]),
  4164. $data.cssStyle && !$data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  4165. key: 0,
  4166. class: "more ago",
  4167. onClick: _cache[1] || (_cache[1] = ($event) => $data.expand = !$data.expand)
  4168. }, " 由于嵌套回复层级太深,自动将后续回复隐藏 ")) : vue.createCommentVNode("", true),
  4169. $data.expand ? (vue.openBlock(), vue.createElementBlock("div", {
  4170. key: 1,
  4171. class: "comment-content-w",
  4172. style: vue.normalizeStyle($data.cssStyle)
  4173. }, [
  4174. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  4175. key: 0,
  4176. class: "more ago",
  4177. onClick: _cache[2] || (_cache[2] = ($event) => $data.expand = !$data.expand)
  4178. }, " 由于嵌套回复层级太深,自动将以下回复移至可见范围 ")) : vue.createCommentVNode("", true),
  4179. vue.createElementVNode("div", _hoisted_2$a, [
  4180. vue.createElementVNode("div", {
  4181. class: "left expand-line",
  4182. onClick: _cache[3] || (_cache[3] = (...args) => $options.toggle && $options.toggle(...args))
  4183. }),
  4184. vue.createElementVNode("div", _hoisted_3$9, [
  4185. vue.createElementVNode("div", _hoisted_4$8, [
  4186. $props.modelValue.isWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$6, [
  4187. vue.createElementVNode("span", {
  4188. onClick: _cache[4] || (_cache[4] = ($event) => $data.expandWrong = !$data.expandWrong),
  4189. title: "点击楼层号查看提示"
  4190. }, [
  4191. vue.createElementVNode("a", {
  4192. href: "/member/" + $props.modelValue.replyUsers[0]
  4193. }, "@" + vue.toDisplayString($props.modelValue.replyUsers[0]) + "  ", 9, _hoisted_6$6),
  4194. vue.createElementVNode("span", _hoisted_7$5, "#" + vue.toDisplayString($props.modelValue.replyFloor), 1),
  4195. _hoisted_8$5
  4196. ]),
  4197. $data.expandWrong ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$5, [
  4198. vue.createTextVNode(" 这条回复似乎有点问题,指定的楼层号与@的人对应不上 "),
  4199. _hoisted_10$4,
  4200. vue.createTextVNode(" 原因可能有下面几种: "),
  4201. _hoisted_11$4,
  4202. vue.createTextVNode(" 一、屏蔽用户导致楼层塌陷:你屏蔽了A,自A以后的回复的楼层号都会减1 "),
  4203. _hoisted_12$4,
  4204. vue.createTextVNode(" 二、忽略回复导致楼层塌陷:原理同上 "),
  4205. _hoisted_13$4,
  4206. vue.createTextVNode(" 三、层主回复时指定错了楼层号(同一,层主屏蔽了别人,导致楼层塌陷) "),
  4207. _hoisted_14$3,
  4208. vue.createTextVNode(" 四、脚本解析错误,请在 "),
  4209. _hoisted_15$3,
  4210. vue.createTextVNode("反馈 ")
  4211. ])) : vue.createCommentVNode("", true)
  4212. ])) : vue.createCommentVNode("", true),
  4213. $options.config.commentDisplayType === $options.CommentDisplayType.FloorInFloorNoCallUser && this.type !== "top" ? (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  4214. key: 1,
  4215. class: "reply_content",
  4216. html: $props.modelValue.hideCallUserReplyContent
  4217. }, null, 8, ["html"])) : (vue.openBlock(), vue.createBlock(_component_BaseHtmlRender, {
  4218. key: 2,
  4219. class: "reply_content",
  4220. html: $props.modelValue.reply_content
  4221. }, null, 8, ["html"]))
  4222. ]),
  4223. vue.createElementVNode("div", _hoisted_16$3, [
  4224. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.modelValue.children, (item, index) => {
  4225. return vue.openBlock(), vue.createBlock(_component_Comment, {
  4226. modelValue: $props.modelValue.children[index],
  4227. "onUpdate:modelValue": ($event) => $props.modelValue.children[index] = $event,
  4228. key: index
  4229. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  4230. }), 128))
  4231. ])
  4232. ])
  4233. ]),
  4234. $data.cssStyle ? (vue.openBlock(), vue.createElementBlock("div", {
  4235. key: 1,
  4236. class: "more ago",
  4237. onClick: _cache[5] || (_cache[5] = ($event) => $data.expand = !$data.expand)
  4238. }, " 由于嵌套回复层级太深,自动将以上回复移至可见范围 ")) : vue.createCommentVNode("", true)
  4239. ], 4)) : vue.createCommentVNode("", true)
  4240. ], 10, _hoisted_1$d);
  4241. }
  4242. const Comment = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$5], ["__scopeId", "data-v-312e9541"]]);
  4243. const _sfc_main$c = {
  4244. name: "Toolbar",
  4245. components: { Icon, BaseLoading },
  4246. inject: [
  4247. "isLogin",
  4248. "post",
  4249. "pageType"
  4250. ],
  4251. data() {
  4252. return {
  4253. timer: null,
  4254. loading: false,
  4255. loading3: false
  4256. };
  4257. },
  4258. methods: {
  4259. checkIsLogin(emitName = "") {
  4260. if (!this.isLogin) {
  4261. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  4262. return false;
  4263. }
  4264. this.$emit(emitName);
  4265. return true;
  4266. },
  4267. async toggleFavorite() {
  4268. if (config.collectBrowserNotice) {
  4269. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "别忘记添加到书签哦" });
  4270. }
  4271. if (!this.checkIsLogin())
  4272. return;
  4273. let isFavorite = this.post.isFavorite;
  4274. let url = `${window.baseUrl}/${isFavorite ? "unfavorite" : "favorite"}/topic/${this.post.id}?once=${this.post.once}`;
  4275. this.loading = true;
  4276. let apiRes = await fetch(url);
  4277. this.loading = false;
  4278. if (apiRes.redirected) {
  4279. let htmlText = await apiRes.text();
  4280. if (htmlText.search(this.post.isFavorite ? "加入收藏" : "取消收藏")) {
  4281. eventBus.emit(CMD.MERGE, { collectCount: isFavorite ? this.post.collectCount - 1 : this.post.collectCount + 1 });
  4282. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: isFavorite ? "取消成功" : "收藏成功" });
  4283. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  4284. eventBus.emit(CMD.MERGE, { isFavorite: !isFavorite });
  4285. return;
  4286. }
  4287. }
  4288. eventBus.emit(CMD.REFRESH_ONCE);
  4289. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败" });
  4290. }
  4291. }
  4292. };
  4293. const _hoisted_1$c = { class: "toolbar" };
  4294. const _hoisted_2$9 = { class: "left" };
  4295. const _hoisted_3$8 = { class: "right" };
  4296. const _hoisted_4$7 = { key: 2 };
  4297. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  4298. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  4299. const _component_Icon = vue.resolveComponent("Icon");
  4300. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
  4301. vue.createElementVNode("div", _hoisted_2$9, [
  4302. vue.createElementVNode("div", null, vue.toDisplayString($options.post.createDate.substring(0, 16)), 1)
  4303. ]),
  4304. vue.createElementVNode("div", _hoisted_3$8, [
  4305. vue.createElementVNode("div", {
  4306. class: vue.normalizeClass(["tool", { disabled: $data.loading }]),
  4307. onClick: _cache[0] || (_cache[0] = (...args) => $options.toggleFavorite && $options.toggleFavorite(...args))
  4308. }, [
  4309. $data.loading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, {
  4310. key: 0,
  4311. size: "small"
  4312. })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  4313. $options.post.isFavorite ? (vue.openBlock(), vue.createBlock(_component_Icon, {
  4314. key: 0,
  4315. color: "rgb(224,42,42)",
  4316. icon: "iconoir:star-solid"
  4317. })) : (vue.openBlock(), vue.createBlock(_component_Icon, {
  4318. key: 1,
  4319. icon: "iconoir:star"
  4320. }))
  4321. ], 64)),
  4322. $options.post.collectCount !== 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$7, vue.toDisplayString($options.post.collectCount), 1)) : vue.createCommentVNode("", true)
  4323. ], 2),
  4324. vue.createElementVNode("div", {
  4325. class: "tool",
  4326. onClick: _cache[1] || (_cache[1] = ($event) => $options.checkIsLogin("reply"))
  4327. }, [
  4328. vue.createVNode(_component_Icon, { icon: "mynaui:message" })
  4329. ])
  4330. ])
  4331. ]);
  4332. }
  4333. const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$4], ["__scopeId", "data-v-6234240d"]]);
  4334. const _withScopeId$8 = (n2) => (vue.pushScopeId("data-v-0869dab5"), n2 = n2(), vue.popScopeId(), n2);
  4335. const _hoisted_1$b = {
  4336. class: "comment",
  4337. ref: "comment"
  4338. };
  4339. const _hoisted_2$8 = ["href"];
  4340. const _hoisted_3$7 = ["src"];
  4341. const _hoisted_4$6 = { class: "texts" };
  4342. const _hoisted_5$5 = {
  4343. key: 0,
  4344. class: "point"
  4345. };
  4346. const _hoisted_6$5 = { class: "link-num" };
  4347. const _hoisted_7$4 = { class: "my-tag" };
  4348. const _hoisted_8$4 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  4349. const _hoisted_9$4 = {
  4350. key: 2,
  4351. class: "ago"
  4352. };
  4353. const _hoisted_10$3 = {
  4354. key: 3,
  4355. class: "mod"
  4356. };
  4357. const _hoisted_11$3 = {
  4358. key: 4,
  4359. class: "owner"
  4360. };
  4361. const _hoisted_12$3 = ["href"];
  4362. const _hoisted_13$3 = {
  4363. key: 5,
  4364. class: "owner"
  4365. };
  4366. const _hoisted_14$2 = {
  4367. key: 6,
  4368. class: "mod"
  4369. };
  4370. const _hoisted_15$2 = {
  4371. key: 7,
  4372. class: "ago"
  4373. };
  4374. const _hoisted_16$2 = { class: "my-tag" };
  4375. const _hoisted_17$1 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  4376. const _hoisted_18$1 = {
  4377. key: 9,
  4378. class: "point"
  4379. };
  4380. const _hoisted_19$1 = { class: "link-num" };
  4381. const _hoisted_20$1 = ["href"];
  4382. const _hoisted_21$1 = ["src"];
  4383. const _hoisted_22$1 = { class: "Author-right" };
  4384. const _hoisted_23$1 = { class: "floor" };
  4385. const _hoisted_24$1 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  4386. const _hoisted_25$1 = [
  4387. _hoisted_24$1
  4388. ];
  4389. const _sfc_main$b = {
  4390. __name: "SingleComment",
  4391. props: {
  4392. comment: {
  4393. reply_content: ""
  4394. },
  4395. isRight: {
  4396. type: Boolean,
  4397. default() {
  4398. return false;
  4399. }
  4400. }
  4401. },
  4402. setup(__props) {
  4403. const config2 = vue.inject("config");
  4404. const isLogin = vue.inject("isLogin");
  4405. const tags = vue.inject("tags");
  4406. const props = __props;
  4407. const myTags = vue.computed(() => {
  4408. return tags[props.comment.username] ?? [];
  4409. });
  4410. function jump() {
  4411. eventBus.emit(CMD.JUMP, props.comment.floor);
  4412. }
  4413. return (_ctx, _cache) => {
  4414. return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
  4415. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  4416. key: 0,
  4417. class: "base-avatar",
  4418. href: `/member/${__props.comment.username}`
  4419. }, [
  4420. vue.createElementVNode("img", {
  4421. src: __props.comment.avatar,
  4422. alt: ""
  4423. }, null, 8, _hoisted_3$7)
  4424. ], 8, _hoisted_2$8)) : vue.createCommentVNode("", true),
  4425. vue.createElementVNode("div", {
  4426. class: vue.normalizeClass(["comment-body", { isRight: __props.isRight }])
  4427. }, [
  4428. vue.createElementVNode("div", _hoisted_4$6, [
  4429. __props.comment.thankCount && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$5, [
  4430. __props.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4431. key: 0,
  4432. color: "red",
  4433. icon: "icon-park-solid:like"
  4434. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4435. key: 1,
  4436. color: "rgb(224,42,42)",
  4437. icon: "icon-park-outline:like"
  4438. })),
  4439. vue.createElementVNode("div", _hoisted_6$5, vue.toDisplayString(__props.comment.thankCount), 1)
  4440. ])) : vue.createCommentVNode("", true),
  4441. vue.unref(isLogin) && vue.unref(config2).openTag && __props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(myTags.value, (i) => {
  4442. return vue.openBlock(), vue.createElementBlock("span", _hoisted_7$4, [
  4443. _hoisted_8$4,
  4444. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  4445. ]);
  4446. }), 256)) : vue.createCommentVNode("", true),
  4447. __props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$4, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  4448. __props.comment.isMod && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$3, "MOD")) : vue.createCommentVNode("", true),
  4449. __props.comment.isOp && __props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$3, "OP")) : vue.createCommentVNode("", true),
  4450. vue.createElementVNode("a", {
  4451. href: `/member/${__props.comment.username}`,
  4452. class: "username"
  4453. }, vue.toDisplayString(__props.comment.username), 9, _hoisted_12$3),
  4454. __props.comment.isOp && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$3, "OP")) : vue.createCommentVNode("", true),
  4455. __props.comment.isMod && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$2, "MOD")) : vue.createCommentVNode("", true),
  4456. !__props.isRight ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_15$2, vue.toDisplayString(__props.comment.date), 1)) : vue.createCommentVNode("", true),
  4457. vue.unref(isLogin) && vue.unref(config2).openTag && !__props.isRight ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 8 }, vue.renderList(myTags.value, (i) => {
  4458. return vue.openBlock(), vue.createElementBlock("span", _hoisted_16$2, [
  4459. _hoisted_17$1,
  4460. vue.createElementVNode("span", null, vue.toDisplayString(i), 1)
  4461. ]);
  4462. }), 256)) : vue.createCommentVNode("", true),
  4463. __props.comment.thankCount && !__props.isRight ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$1, [
  4464. __props.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4465. key: 0,
  4466. color: "red",
  4467. icon: "icon-park-solid:like"
  4468. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4469. key: 1,
  4470. color: "rgb(224,42,42)",
  4471. icon: "icon-park-outline:like"
  4472. })),
  4473. vue.createElementVNode("div", _hoisted_19$1, vue.toDisplayString(__props.comment.thankCount), 1)
  4474. ])) : vue.createCommentVNode("", true)
  4475. ]),
  4476. vue.createVNode(BaseHtmlRender, {
  4477. class: "reply_content",
  4478. html: __props.comment.reply_content
  4479. }, null, 8, ["html"])
  4480. ], 2),
  4481. __props.isRight ? (vue.openBlock(), vue.createElementBlock("a", {
  4482. key: 1,
  4483. class: "base-avatar",
  4484. href: `/member/${__props.comment.username}`
  4485. }, [
  4486. vue.createElementVNode("img", {
  4487. src: __props.comment.avatar,
  4488. alt: ""
  4489. }, null, 8, _hoisted_21$1)
  4490. ], 8, _hoisted_20$1)) : vue.createCommentVNode("", true),
  4491. vue.createElementVNode("div", _hoisted_22$1, [
  4492. vue.createElementVNode("div", _hoisted_23$1, vue.toDisplayString(__props.comment.floor) + "楼", 1),
  4493. vue.createElementVNode("div", {
  4494. class: "tool jump",
  4495. onClick: jump
  4496. }, _hoisted_25$1)
  4497. ])
  4498. ], 512);
  4499. };
  4500. }
  4501. };
  4502. const SingleComment = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-0869dab5"]]);
  4503. function debounce(fn, delay, scope) {
  4504. let timer = null;
  4505. return function() {
  4506. let context = scope || this, args = arguments;
  4507. clearTimeout(timer);
  4508. timer = setTimeout(function() {
  4509. fn.apply(context, args);
  4510. timer = null;
  4511. }, delay);
  4512. };
  4513. }
  4514. async function copy(text) {
  4515. if (navigator.clipboard) {
  4516. await navigator.clipboard.writeText(text);
  4517. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "复制成功" });
  4518. return true;
  4519. } else {
  4520. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "复制失败!浏览器不支持!" });
  4521. }
  4522. }
  4523. const _sfc_main$a = {
  4524. name: "FromBottomDialog",
  4525. props: {
  4526. modelValue: {
  4527. type: Boolean,
  4528. default: false
  4529. },
  4530. mode: {
  4531. type: String,
  4532. // default: 'dark'
  4533. default: "light"
  4534. // default: 'white'
  4535. },
  4536. maskMode: {
  4537. type: String,
  4538. default: "dark"
  4539. },
  4540. height: {
  4541. type: String,
  4542. default: "70vh"
  4543. },
  4544. showHengGang: {
  4545. type: Boolean,
  4546. default: true
  4547. },
  4548. pageId: {
  4549. type: String,
  4550. default: null,
  4551. required: true
  4552. },
  4553. borderRadius: {
  4554. type: String,
  4555. default: "1rem 1rem 0 0"
  4556. },
  4557. tag: {
  4558. type: String,
  4559. default: ""
  4560. }
  4561. },
  4562. watch: {
  4563. modelValue(newVal) {
  4564. let page = document.getElementById(this.pageId);
  4565. if (newVal) {
  4566. page.style.overflow = "hidden";
  4567. this.scroll = page.scrollTop;
  4568. let mask = $(`<div class="mask fade-in ${this.maskMode}"></div>`);
  4569. mask.on("click", (e2) => {
  4570. this.hide(false);
  4571. });
  4572. page.appendChild(mask[0]);
  4573. } else {
  4574. page.style.overflow = "unset";
  4575. let mask = $(".mask");
  4576. mask.removeClass("fade-in");
  4577. mask.addClass("fade-out");
  4578. setTimeout(() => {
  4579. mask.remove();
  4580. }, 250);
  4581. }
  4582. }
  4583. },
  4584. data() {
  4585. return {
  4586. scroll: 0,
  4587. startLocationY: 0,
  4588. moveYDistance: 0,
  4589. startTime: 0,
  4590. pagePosition: null
  4591. };
  4592. },
  4593. computed: {},
  4594. created() {
  4595. },
  4596. methods: {
  4597. beforeEnter(el) {
  4598. el.style["transition-duration"] = `250ms`;
  4599. el.style["transform"] = `translate3d(0,${this.height},0)`;
  4600. },
  4601. enter(el, done) {
  4602. setTimeout(() => {
  4603. el.style["transform"] = `translate3d(0,0,0)`;
  4604. }, 0);
  4605. setTimeout(() => {
  4606. el.style["transform"] = `none`;
  4607. done();
  4608. }, 250);
  4609. },
  4610. afterEnter() {
  4611. },
  4612. beforeLeave(el) {
  4613. el.style["transition-duration"] = `250ms`;
  4614. el.style["transform"] = `translate3d(0,0,0)`;
  4615. },
  4616. leave(el, done) {
  4617. let maxHeight = $(".FromBottomDialog").css("max-height");
  4618. el.style["transform"] = `translate3d(0,${maxHeight},0)`;
  4619. setTimeout(done, 250);
  4620. },
  4621. afterLeave() {
  4622. },
  4623. hide(val = false) {
  4624. this.$emit("update:modelValue", val);
  4625. this.$emit("cancel");
  4626. },
  4627. start(e2) {
  4628. if (this.$refs.dialog.scrollTop !== 0)
  4629. return;
  4630. this.startLocationY = e2.touches[0].pageY;
  4631. this.startTime = Date.now();
  4632. this.$refs.dialog.style["transition-duration"] = `0ms`;
  4633. },
  4634. move(e2) {
  4635. if (this.$refs.dialog.scrollTop !== 0)
  4636. return;
  4637. this.moveYDistance = e2.touches[0].pageY - this.startLocationY;
  4638. if (this.moveYDistance > 0) {
  4639. this.$refs.dialog.style["transform"] = `translate3d(0,${this.moveYDistance}px,0)`;
  4640. }
  4641. },
  4642. end(e2) {
  4643. if (Date.now() - this.startTime < 150 && Math.abs(this.moveYDistance) < 30) {
  4644. return;
  4645. }
  4646. if (this.$refs.dialog.scrollTop !== 0)
  4647. return;
  4648. let clientHeight = this.$refs.dialog.clientHeight;
  4649. this.$refs.dialog.style["transition-duration"] = `250ms`;
  4650. if (Math.abs(this.moveYDistance) > clientHeight / 2) {
  4651. this.$refs.dialog.style["transform"] = `translate3d(0,${clientHeight}px,0)`;
  4652. setTimeout(this.hide, 250);
  4653. } else {
  4654. this.$refs.dialog.style["transform"] = `translate3d(0,0,0)`;
  4655. setTimeout(() => {
  4656. if (this.$refs.dialog) {
  4657. this.$refs.dialog.style["transform"] = `none`;
  4658. }
  4659. }, 250);
  4660. }
  4661. this.moveYDistance = 0;
  4662. }
  4663. }
  4664. };
  4665. const __injectCSSVars__ = () => {
  4666. vue.useCssVars((_ctx) => ({
  4667. "0013fa15": _ctx.borderRadius
  4668. }));
  4669. };
  4670. const __setup__ = _sfc_main$a.setup;
  4671. _sfc_main$a.setup = __setup__ ? (props, ctx) => {
  4672. __injectCSSVars__();
  4673. return __setup__(props, ctx);
  4674. } : __injectCSSVars__;
  4675. const _withScopeId$7 = (n2) => (vue.pushScopeId("data-v-3a54f208"), n2 = n2(), vue.popScopeId(), n2);
  4676. const _hoisted_1$a = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "gang-content" }, null, -1));
  4677. const _hoisted_2$7 = [
  4678. _hoisted_1$a
  4679. ];
  4680. const _hoisted_3$6 = { class: "dialog-wrapper" };
  4681. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  4682. return vue.openBlock(), vue.createBlock(vue.Transition, {
  4683. onBeforeEnter: $options.beforeEnter,
  4684. onEnter: $options.enter,
  4685. onAfterEnter: $options.afterEnter,
  4686. onBeforeLeave: $options.beforeLeave,
  4687. onLeave: $options.leave,
  4688. onAfterLeave: $options.afterLeave,
  4689. css: false
  4690. }, {
  4691. default: vue.withCtx(() => [
  4692. $props.modelValue ? (vue.openBlock(), vue.createElementBlock("div", {
  4693. key: 0,
  4694. ref: "dialog",
  4695. class: vue.normalizeClass(["FromBottomDialog", [$props.mode, $props.showHengGang ? "" : "no-heng-gang"]]),
  4696. style: vue.normalizeStyle({ "max-height": $props.height }),
  4697. onTouchstart: _cache[0] || (_cache[0] = (...args) => $options.start && $options.start(...args)),
  4698. onTouchmove: _cache[1] || (_cache[1] = (...args) => $options.move && $options.move(...args)),
  4699. onTouchend: _cache[2] || (_cache[2] = (...args) => $options.end && $options.end(...args))
  4700. }, [
  4701. vue.renderSlot(_ctx.$slots, "header", {}, void 0, true),
  4702. $props.showHengGang ? (vue.openBlock(), vue.createElementBlock("div", {
  4703. key: 0,
  4704. class: vue.normalizeClass(["heng-gang", $props.mode])
  4705. }, _hoisted_2$7, 2)) : vue.createCommentVNode("", true),
  4706. vue.createElementVNode("div", _hoisted_3$6, [
  4707. vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
  4708. ])
  4709. ], 38)) : vue.createCommentVNode("", true)
  4710. ]),
  4711. _: 3
  4712. }, 8, ["onBeforeEnter", "onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"]);
  4713. }
  4714. const FromBottomDialog = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$3], ["__scopeId", "data-v-3a54f208"]]);
  4715. const _withScopeId$6 = (n2) => (vue.pushScopeId("data-v-ae322b31"), n2 = n2(), vue.popScopeId(), n2);
  4716. const _hoisted_1$9 = { class: "wrapper" };
  4717. const _hoisted_2$6 = { class: "options" };
  4718. const _hoisted_3$5 = { class: "icon-wrap" };
  4719. const _hoisted_4$5 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("span", null, "分享", -1));
  4720. const _hoisted_5$4 = { class: "icon-wrap" };
  4721. const _hoisted_6$4 = { class: "icon-wrap" };
  4722. const _hoisted_7$3 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("span", null, "回复", -1));
  4723. const _hoisted_8$3 = { class: "icon-wrap" };
  4724. const _hoisted_9$3 = { class: "icon-wrap" };
  4725. const _hoisted_10$2 = { class: "icon-wrap" };
  4726. const _hoisted_11$2 = { class: "icon-wrap" };
  4727. const _hoisted_12$2 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("span", null, "复制链接", -1));
  4728. const _hoisted_13$2 = { class: "icon-wrap" };
  4729. const _hoisted_14$1 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("span", null, "复制内容", -1));
  4730. const _hoisted_15$1 = { class: "icon-wrap" };
  4731. const _hoisted_16$1 = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ vue.createElementVNode("span", null, "刷新", -1));
  4732. const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
  4733. __name: "PostOptions",
  4734. props: {
  4735. modelValue: { type: Boolean },
  4736. post: {}
  4737. },
  4738. emits: ["close", "reply", "refresh", "merge", "update:modelValue"],
  4739. setup(__props, { emit: __emit }) {
  4740. let state = vue.reactive({
  4741. timer: null,
  4742. loading: false,
  4743. loading1: false,
  4744. loading2: false,
  4745. loading3: false,
  4746. loading4: false
  4747. });
  4748. const props = __props;
  4749. const emit = __emit;
  4750. const isLogin = vue.inject("isLogin");
  4751. const pageType = vue.inject("pageType");
  4752. const config2 = vue.inject("config");
  4753. function close() {
  4754. emit("close");
  4755. emit("update:modelValue", false);
  4756. }
  4757. function checkIsLogin() {
  4758. if (!isLogin.value) {
  4759. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  4760. return false;
  4761. }
  4762. return true;
  4763. }
  4764. async function copyLink() {
  4765. let text = props.post.url;
  4766. if (await copy(text)) {
  4767. close();
  4768. }
  4769. }
  4770. async function copyContent() {
  4771. let text = props.post.headerTemplate;
  4772. text = $(`<div>${text}</div>`).text();
  4773. if (await copy(text)) {
  4774. close();
  4775. }
  4776. }
  4777. function share() {
  4778. var _a;
  4779. let username = ((_a = window.user) == null ? void 0 : _a.username) ?? "";
  4780. let url = `https://twitter.com/intent/tweet?url=${location.origin}/t/${props.post.id}?r=${username}&related=v2ex&text=${props.post.title}`;
  4781. window.open(url, "_blank");
  4782. close();
  4783. }
  4784. function reply() {
  4785. if (!checkIsLogin())
  4786. return;
  4787. emit("reply");
  4788. close();
  4789. }
  4790. async function toggleIgnore() {
  4791. if (!checkIsLogin())
  4792. return;
  4793. if (state.loading2)
  4794. return;
  4795. let isIgnore = props.post.isIgnore;
  4796. let url = `${location.origin}/${isIgnore ? "unignore" : "ignore"}/topic/${props.post.id}?once=${props.post.once}`;
  4797. state.loading2 = true;
  4798. let apiRes = await fetch(url);
  4799. state.loading2 = false;
  4800. if (apiRes.redirected) {
  4801. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: isIgnore ? "取消成功" : "忽略成功" });
  4802. } else {
  4803. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "忽略失败" });
  4804. }
  4805. if (isIgnore) {
  4806. eventBus.emit(CMD.MERGE, { isIgnore: !isIgnore });
  4807. } else {
  4808. if (pageType.value === PageType.Post) {
  4809. location.href = location.origin;
  4810. } else {
  4811. eventBus.emit(CMD.IGNORE);
  4812. }
  4813. }
  4814. eventBus.emit(CMD.REFRESH_ONCE);
  4815. close();
  4816. }
  4817. async function toggleFavorite() {
  4818. if (!checkIsLogin())
  4819. return;
  4820. if (state.loading)
  4821. return;
  4822. let isFavorite = props.post.isFavorite;
  4823. if (!isFavorite && config2.value.collectBrowserNotice) {
  4824. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "别忘记添加到书签哦" });
  4825. }
  4826. let url = `${location.origin}/${isFavorite ? "unfavorite" : "favorite"}/topic/${props.post.id}?once=${props.post.once}`;
  4827. state.loading = true;
  4828. let apiRes = await fetch(url);
  4829. state.loading = false;
  4830. if (apiRes.redirected) {
  4831. let htmlText = await apiRes.text();
  4832. if (htmlText.search(isFavorite ? "加入收藏" : "取消收藏")) {
  4833. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: isFavorite ? "取消成功" : "收藏成功" });
  4834. eventBus.emit(CMD.MERGE, { collectCount: isFavorite ? props.post.collectCount - 1 : props.post.collectCount + 1 });
  4835. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  4836. eventBus.emit(CMD.MERGE, { isFavorite: !isFavorite });
  4837. return close();
  4838. }
  4839. }
  4840. eventBus.emit(CMD.REFRESH_ONCE);
  4841. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败,请重试" });
  4842. }
  4843. async function report() {
  4844. if (!checkIsLogin())
  4845. return;
  4846. if (state.loading1)
  4847. return;
  4848. let isReport = props.post.isReport;
  4849. if (isReport) {
  4850. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "你已对本主题进行了报告" });
  4851. return;
  4852. }
  4853. let url = `${location.origin}/report/topic/${props.post.id}?once=${props.post.once}`;
  4854. state.loading1 = true;
  4855. let apiRes = await fetch(url);
  4856. state.loading1 = false;
  4857. if (apiRes.redirected) {
  4858. let htmlText = await apiRes.text();
  4859. if (htmlText.search("你已对本主题进行了报告")) {
  4860. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "你已对本主题进行了报告" });
  4861. eventBus.emit(CMD.REFRESH_ONCE, htmlText);
  4862. eventBus.emit(CMD.MERGE, { isReport: !isReport });
  4863. return close();
  4864. }
  4865. }
  4866. eventBus.emit(CMD.REFRESH_ONCE);
  4867. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "操作失败,请重试" });
  4868. }
  4869. async function thank() {
  4870. if (!isLogin.value) {
  4871. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  4872. }
  4873. if (props.post.username === window.user.username) {
  4874. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "不能感谢自己" });
  4875. }
  4876. let isThanked = props.post.isThanked;
  4877. if (isThanked) {
  4878. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "已经感谢过了" });
  4879. }
  4880. if (state.loading4)
  4881. return;
  4882. eventBus.emit(CMD.MERGE, { isThanked: !isThanked });
  4883. let url = `${location.origin}/thank/reply/${props.post.id}?once=${props.post.once}`;
  4884. state.loading4 = true;
  4885. await fetch(url);
  4886. state.loading4 = false;
  4887. $.post(url).then((res) => {
  4888. if (!res.success) {
  4889. eventBus.emit(CMD.MERGE, { isThanked: !isThanked });
  4890. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: res.message });
  4891. }
  4892. eventBus.emit(CMD.REFRESH_ONCE, res.once);
  4893. }, (err) => {
  4894. state.loading4 = false;
  4895. eventBus.emit(CMD.MERGE, { isThanked: !isThanked });
  4896. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "感谢失败" });
  4897. eventBus.emit(CMD.REFRESH_ONCE);
  4898. });
  4899. close();
  4900. }
  4901. return (_ctx, _cache) => {
  4902. return vue.openBlock(), vue.createBlock(FromBottomDialog, {
  4903. "page-id": "post-detail",
  4904. height: "40rem",
  4905. "model-value": _ctx.modelValue,
  4906. onCancel: _cache[1] || (_cache[1] = ($event) => emit("update:modelValue", false))
  4907. }, {
  4908. default: vue.withCtx(() => [
  4909. vue.createElementVNode("div", _hoisted_1$9, [
  4910. vue.createElementVNode("div", _hoisted_2$6, [
  4911. vue.createElementVNode("div", {
  4912. class: "item",
  4913. onClick: share
  4914. }, [
  4915. vue.createElementVNode("div", _hoisted_3$5, [
  4916. vue.createVNode(vue.unref(Icon), {
  4917. color: "rgb(57,174,85)",
  4918. icon: "uil:share"
  4919. })
  4920. ]),
  4921. _hoisted_4$5
  4922. ]),
  4923. vue.createElementVNode("div", {
  4924. class: "item",
  4925. onClick: toggleIgnore
  4926. }, [
  4927. vue.createElementVNode("div", _hoisted_5$4, [
  4928. vue.unref(state).loading2 ? (vue.openBlock(), vue.createBlock(BaseLoading, { key: 0 })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  4929. _ctx.post.isIgnore ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4930. key: 0,
  4931. color: "rgb(224,42,42)",
  4932. icon: "mdi:eye-off-outline"
  4933. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4934. key: 1,
  4935. color: "rgb(57,174,85)",
  4936. icon: "mdi:eye-outline"
  4937. }))
  4938. ], 64))
  4939. ]),
  4940. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.post.isIgnore ? "取消" : "") + "忽略", 1)
  4941. ]),
  4942. vue.createElementVNode("div", {
  4943. class: "item",
  4944. onClick: reply
  4945. }, [
  4946. vue.createElementVNode("div", _hoisted_6$4, [
  4947. vue.createVNode(vue.unref(Icon), {
  4948. color: "rgb(57,174,85)",
  4949. icon: "mynaui:message"
  4950. })
  4951. ]),
  4952. _hoisted_7$3
  4953. ]),
  4954. vue.createElementVNode("div", {
  4955. class: "item",
  4956. onClick: thank
  4957. }, [
  4958. vue.createElementVNode("div", _hoisted_8$3, [
  4959. _ctx.post.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4960. key: 0,
  4961. icon: "flat-color-icons:like"
  4962. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4963. key: 1,
  4964. color: "rgb(57,174,85)",
  4965. icon: "icon-park-outline:like"
  4966. }))
  4967. ]),
  4968. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.post.isThanked ? "已" : "") + "感谢", 1)
  4969. ]),
  4970. vue.createElementVNode("div", {
  4971. class: "item",
  4972. onClick: toggleFavorite
  4973. }, [
  4974. vue.createElementVNode("div", _hoisted_9$3, [
  4975. vue.unref(state).loading ? (vue.openBlock(), vue.createBlock(BaseLoading, { key: 0 })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  4976. _ctx.post.isFavorite ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4977. key: 0,
  4978. color: "rgb(224,42,42)",
  4979. icon: "iconoir:star-solid"
  4980. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4981. key: 1,
  4982. color: "rgb(57,174,85)",
  4983. icon: "iconoir:star"
  4984. }))
  4985. ], 64))
  4986. ]),
  4987. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.post.isFavorite ? "取消" : "") + "收藏", 1)
  4988. ]),
  4989. vue.createElementVNode("div", {
  4990. class: vue.normalizeClass(["item", [_ctx.post.isReport && "disabled"]]),
  4991. onClick: report
  4992. }, [
  4993. vue.createElementVNode("div", _hoisted_10$2, [
  4994. vue.unref(state).loading1 ? (vue.openBlock(), vue.createBlock(BaseLoading, { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  4995. key: 1,
  4996. class: "black",
  4997. icon: "solar:danger-triangle-outline"
  4998. }))
  4999. ]),
  5000. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.post.isReport ? "已报告" : "报告问题"), 1)
  5001. ], 2),
  5002. vue.createElementVNode("div", {
  5003. class: "item",
  5004. onClick: copyLink
  5005. }, [
  5006. vue.createElementVNode("div", _hoisted_11$2, [
  5007. vue.createVNode(vue.unref(Icon), {
  5008. class: "black",
  5009. icon: "solar:link-broken"
  5010. })
  5011. ]),
  5012. _hoisted_12$2
  5013. ]),
  5014. vue.createElementVNode("div", {
  5015. class: "item",
  5016. onClick: copyContent
  5017. }, [
  5018. vue.createElementVNode("div", _hoisted_13$2, [
  5019. vue.createVNode(vue.unref(Icon), {
  5020. class: "black",
  5021. icon: "octicon:copy-24"
  5022. })
  5023. ]),
  5024. _hoisted_14$1
  5025. ]),
  5026. vue.createElementVNode("div", {
  5027. class: "item",
  5028. onClick: _cache[0] || (_cache[0] = ($event) => (emit("refresh"), close()))
  5029. }, [
  5030. vue.createElementVNode("div", _hoisted_15$1, [
  5031. vue.createVNode(vue.unref(Icon), {
  5032. class: "black",
  5033. icon: "ion:refresh"
  5034. })
  5035. ]),
  5036. _hoisted_16$1
  5037. ])
  5038. ]),
  5039. vue.createVNode(FontSizeType),
  5040. vue.createElementVNode("div", {
  5041. class: "cancel",
  5042. onClick: close
  5043. }, "取消")
  5044. ])
  5045. ]),
  5046. _: 1
  5047. }, 8, ["model-value"]);
  5048. };
  5049. }
  5050. });
  5051. const PostOptions = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-ae322b31"]]);
  5052. const _withScopeId$5 = (n2) => (vue.pushScopeId("data-v-8ef13a81"), n2 = n2(), vue.popScopeId(), n2);
  5053. const _hoisted_1$8 = { class: "wrapper" };
  5054. const _hoisted_2$5 = { class: "options" };
  5055. const _hoisted_3$4 = { class: "icon-wrap" };
  5056. const _hoisted_4$4 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "忽略", -1));
  5057. const _hoisted_5$3 = { class: "icon-wrap" };
  5058. const _hoisted_6$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "复制", -1));
  5059. const _hoisted_7$2 = { class: "icon-wrap" };
  5060. const _hoisted_8$2 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "上下文", -1));
  5061. const _hoisted_9$2 = { class: "icon-wrap" };
  5062. const _hoisted_10$1 = { class: "icon-wrap" };
  5063. const _hoisted_11$1 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "回复", -1));
  5064. const _hoisted_12$1 = { class: "icon-wrap" };
  5065. const _hoisted_13$1 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ vue.createElementVNode("span", null, "跳转", -1));
  5066. const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
  5067. __name: "CommentOptions",
  5068. props: {
  5069. modelValue: { type: Boolean },
  5070. comment: {},
  5071. post: {}
  5072. },
  5073. emits: ["close", "reply", "merge", "update:modelValue"],
  5074. setup(__props, { emit: __emit }) {
  5075. const props = __props;
  5076. const emit = __emit;
  5077. const config2 = vue.inject("config");
  5078. const isLogin = vue.inject("isLogin");
  5079. function close() {
  5080. emit("close");
  5081. emit("update:modelValue", false);
  5082. }
  5083. function checkIsLogin() {
  5084. if (!isLogin.value) {
  5085. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请先登录!" });
  5086. return false;
  5087. }
  5088. return true;
  5089. }
  5090. async function handleCopy() {
  5091. let text = props.comment.reply_content;
  5092. if (config2.value.commentDisplayType === CommentDisplayType.FloorInFloorNoCallUser) {
  5093. text = props.comment.hideCallUserReplyContent;
  5094. }
  5095. text = $(`<div>${text}</div>`).text();
  5096. if (await copy(text)) {
  5097. close();
  5098. }
  5099. }
  5100. async function hide() {
  5101. if (!checkIsLogin())
  5102. return;
  5103. let url = `${window.baseUrl}/ignore/reply/${props.comment.id}?once=${props.post.once}`;
  5104. eventBus.emit(CMD.REMOVE, props.comment.floor);
  5105. close();
  5106. $.post(url).then((res) => {
  5107. eventBus.emit(CMD.REFRESH_ONCE);
  5108. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "隐藏成功" });
  5109. }, (err) => {
  5110. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "隐藏成功,仅本次有效(接口调用失败!)" });
  5111. });
  5112. }
  5113. function jump() {
  5114. eventBus.emit(CMD.JUMP, props.comment.floor);
  5115. close();
  5116. }
  5117. function showRelationReply() {
  5118. if (!props.comment.replyUsers.length) {
  5119. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "该回复无上下文" });
  5120. return;
  5121. }
  5122. eventBus.emit(CMD.RELATION_REPLY, {
  5123. left: props.comment.replyUsers,
  5124. right: props.comment.username,
  5125. rightFloor: props.comment.floor
  5126. });
  5127. close();
  5128. }
  5129. function recallThank() {
  5130. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: props.comment.id, type: "recall" });
  5131. }
  5132. function thank() {
  5133. if (!checkIsLogin())
  5134. return;
  5135. if (props.comment.username === window.user.username) {
  5136. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "不能感谢自己" });
  5137. }
  5138. if (props.comment.isThanked) {
  5139. return eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "已经感谢过了" });
  5140. }
  5141. eventBus.emit(CMD.CHANGE_COMMENT_THANK, { id: props.comment.id, type: "add" });
  5142. let url = `${window.baseUrl}/thank/reply/${props.comment.id}?once=${props.post.once}`;
  5143. $.post(url).then((res) => {
  5144. if (!res.success) {
  5145. recallThank();
  5146. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: res.message });
  5147. }
  5148. eventBus.emit(CMD.REFRESH_ONCE, res.once);
  5149. }, (err) => {
  5150. recallThank();
  5151. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "感谢失败" });
  5152. eventBus.emit(CMD.REFRESH_ONCE);
  5153. });
  5154. close();
  5155. }
  5156. return (_ctx, _cache) => {
  5157. return vue.openBlock(), vue.createBlock(FromBottomDialog, {
  5158. "page-id": "post-detail",
  5159. height: "40rem",
  5160. "model-value": _ctx.modelValue,
  5161. onCancel: _cache[1] || (_cache[1] = ($event) => emit("update:modelValue", false))
  5162. }, {
  5163. default: vue.withCtx(() => [
  5164. vue.createElementVNode("div", _hoisted_1$8, [
  5165. vue.createElementVNode("div", _hoisted_2$5, [
  5166. vue.createElementVNode("div", {
  5167. class: "item",
  5168. onClick: hide
  5169. }, [
  5170. vue.createElementVNode("div", _hoisted_3$4, [
  5171. vue.createVNode(vue.unref(Icon), { icon: "solar:forbidden-circle-outline" })
  5172. ]),
  5173. _hoisted_4$4
  5174. ]),
  5175. vue.createElementVNode("div", {
  5176. class: "item",
  5177. onClick: handleCopy
  5178. }, [
  5179. vue.createElementVNode("div", _hoisted_5$3, [
  5180. vue.createVNode(vue.unref(Icon), { icon: "octicon:copy-24" })
  5181. ]),
  5182. _hoisted_6$3
  5183. ]),
  5184. vue.createElementVNode("div", {
  5185. class: vue.normalizeClass(["item", [!_ctx.comment.replyUsers.length && "disabled"]]),
  5186. onClick: showRelationReply
  5187. }, [
  5188. vue.createElementVNode("div", _hoisted_7$2, [
  5189. vue.createVNode(vue.unref(Icon), { icon: "iconoir:page-search" })
  5190. ]),
  5191. _hoisted_8$2
  5192. ], 2),
  5193. vue.createElementVNode("div", {
  5194. class: vue.normalizeClass(["item", [_ctx.comment.isThanked && "full"]]),
  5195. onClick: thank
  5196. }, [
  5197. vue.createElementVNode("div", _hoisted_9$2, [
  5198. _ctx.comment.isThanked ? (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5199. key: 0,
  5200. icon: "icon-park-solid:like"
  5201. })) : (vue.openBlock(), vue.createBlock(vue.unref(Icon), {
  5202. key: 1,
  5203. icon: "icon-park-outline:like"
  5204. }))
  5205. ]),
  5206. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.comment.isThanked ? "已" : "") + "感谢", 1)
  5207. ], 2),
  5208. vue.createElementVNode("div", {
  5209. class: "item",
  5210. onClick: _cache[0] || (_cache[0] = ($event) => emit("reply"))
  5211. }, [
  5212. vue.createElementVNode("div", _hoisted_10$1, [
  5213. vue.createVNode(vue.unref(Icon), { icon: "mynaui:message" })
  5214. ]),
  5215. _hoisted_11$1
  5216. ]),
  5217. _ctx.comment.top ? (vue.openBlock(), vue.createElementBlock("div", {
  5218. key: 0,
  5219. class: "item",
  5220. onClick: jump
  5221. }, [
  5222. vue.createElementVNode("div", _hoisted_12$1, [
  5223. vue.createVNode(vue.unref(Icon), { icon: "icon-park-outline:to-bottom" })
  5224. ]),
  5225. _hoisted_13$1
  5226. ])) : vue.createCommentVNode("", true)
  5227. ]),
  5228. vue.createElementVNode("div", {
  5229. class: "cancel",
  5230. onClick: close
  5231. }, "取消")
  5232. ])
  5233. ]),
  5234. _: 1
  5235. }, 8, ["model-value"]);
  5236. };
  5237. }
  5238. });
  5239. const CommentOptions = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-8ef13a81"]]);
  5240. const _hoisted_1$7 = { class: "comments" };
  5241. const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
  5242. __name: "RelationReply",
  5243. props: {
  5244. modelValue: { type: Boolean },
  5245. relationReply: {},
  5246. targetUser: {},
  5247. post: {}
  5248. },
  5249. emits: ["close", "reply", "merge", "update:modelValue"],
  5250. setup(__props, { emit: __emit }) {
  5251. const emit = __emit;
  5252. vue.inject("config");
  5253. vue.inject("isLogin");
  5254. return (_ctx, _cache) => {
  5255. return vue.openBlock(), vue.createBlock(FromBottomDialog, {
  5256. "page-id": "post-detail",
  5257. height: "70vh",
  5258. "model-value": _ctx.modelValue,
  5259. onCancel: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", false))
  5260. }, {
  5261. default: vue.withCtx(() => [
  5262. vue.createElementVNode("div", _hoisted_1$7, [
  5263. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.relationReply, (item, index) => {
  5264. return vue.openBlock(), vue.createBlock(SingleComment, {
  5265. "is-right": item.username === _ctx.targetUser.right,
  5266. key: item.floor,
  5267. comment: item
  5268. }, null, 8, ["is-right", "comment"]);
  5269. }), 128))
  5270. ])
  5271. ]),
  5272. _: 1
  5273. }, 8, ["model-value"]);
  5274. };
  5275. }
  5276. });
  5277. const _sfc_main$6 = {
  5278. name: "detail",
  5279. emits: ["saveReadList", "refresh"],
  5280. components: {
  5281. BackIcon: _sfc_main$p,
  5282. BaseSelect,
  5283. RelationReply: _sfc_main$7,
  5284. CommentOptions,
  5285. FromBottomDialog,
  5286. PostOptions,
  5287. MoreIcon,
  5288. BaseButton,
  5289. SingleComment,
  5290. Comment,
  5291. PostEditor,
  5292. Point,
  5293. Toolbar,
  5294. BaseHtmlRender,
  5295. Tooltip,
  5296. BaseLoading,
  5297. Icon
  5298. },
  5299. inject: ["allReplyUsers", "user", "post", "tags", "isLogin", "config", "pageType", "isNight"],
  5300. props: {
  5301. modelValue: {
  5302. type: Boolean,
  5303. default() {
  5304. return false;
  5305. }
  5306. },
  5307. loading: {
  5308. type: Boolean,
  5309. default() {
  5310. return false;
  5311. }
  5312. },
  5313. refreshLoading: {
  5314. type: Boolean,
  5315. default() {
  5316. return false;
  5317. }
  5318. },
  5319. displayType: CommentDisplayType.FloorInFloorNoCallUser
  5320. },
  5321. data() {
  5322. return {
  5323. isSticky: false,
  5324. showPostOptions: false,
  5325. showCommentOptions: false,
  5326. selectCallIndex: 0,
  5327. showCallList: false,
  5328. showRelationReply: false,
  5329. replyText: "",
  5330. callStyle: {
  5331. top: 0,
  5332. left: 0
  5333. },
  5334. targetUser: {
  5335. left: [],
  5336. right: "",
  5337. rightFloor: -1
  5338. },
  5339. debounceScroll: () => {
  5340. },
  5341. read: {
  5342. floor: 0,
  5343. total: 0
  5344. },
  5345. currentFloor: "",
  5346. showOpTag: false,
  5347. currentComment: null
  5348. };
  5349. },
  5350. computed: {
  5351. eventBus() {
  5352. return eventBus;
  5353. },
  5354. CMD() {
  5355. return CMD;
  5356. },
  5357. replyUser() {
  5358. if (this.currentComment)
  5359. return this.currentComment.username;
  5360. return null;
  5361. },
  5362. replyFloor() {
  5363. if (this.currentComment)
  5364. return this.currentComment.floor;
  5365. return null;
  5366. },
  5367. isMy() {
  5368. return this.post.member.username === window.user.username;
  5369. },
  5370. myTags() {
  5371. return this.tags[this.post.member.username] ?? [];
  5372. },
  5373. CommentDisplayType() {
  5374. return CommentDisplayType;
  5375. },
  5376. isPost() {
  5377. return this.pageType === PageType.Post;
  5378. },
  5379. filterCallList() {
  5380. if (this.showCallList) {
  5381. let list = ["管理员", "所有人"].concat(this.allReplyUsers);
  5382. if (this.replyText)
  5383. return list.filter((i) => i.search(this.replyText) > -1);
  5384. return list;
  5385. }
  5386. return [];
  5387. },
  5388. topReply() {
  5389. return this.post.replyList.filter((v) => v.thankCount >= this.config.topReplyLoveMinCount).sort((a, b) => b.thankCount - a.thankCount).slice(0, this.config.topReplyCount);
  5390. },
  5391. replyList() {
  5392. if ([CommentDisplayType.FloorInFloor, CommentDisplayType.FloorInFloorNoCallUser].includes(this.displayType))
  5393. return this.post.nestedReplies;
  5394. if (this.displayType === CommentDisplayType.Like) {
  5395. return window.clone(this.post.nestedReplies).sort((a, b) => b.thankCount - a.thankCount);
  5396. }
  5397. if (this.displayType === CommentDisplayType.V2exOrigin)
  5398. return this.post.replyList;
  5399. if (this.displayType === CommentDisplayType.FloorInFloorNested)
  5400. return this.post.nestedRedundReplies;
  5401. if (this.displayType === CommentDisplayType.OnlyOp)
  5402. return this.post.replyList.filter((v) => {
  5403. var _a;
  5404. return v.username === ((_a = this.post.member) == null ? void 0 : _a.username);
  5405. });
  5406. return [];
  5407. },
  5408. //关联回复
  5409. relationReply() {
  5410. if (this.targetUser.left.length && this.targetUser.right) {
  5411. return this.post.replyList.filter((v) => {
  5412. if (this.targetUser.left.includes(v.username)) {
  5413. if (v.floor > this.targetUser.rightFloor) {
  5414. if (v.replyUsers.includes(this.targetUser.right)) {
  5415. return true;
  5416. }
  5417. } else {
  5418. return true;
  5419. }
  5420. }
  5421. if (v.username === this.targetUser.right) {
  5422. for (let i = 0; i < this.targetUser.left.length; i++) {
  5423. if (v.replyUsers.includes(this.targetUser.left[i])) {
  5424. return true;
  5425. }
  5426. }
  5427. }
  5428. });
  5429. }
  5430. return [];
  5431. }
  5432. },
  5433. watch: {
  5434. "post.id"(n2, o) {
  5435. if (this.$refs["post-editor"]) {
  5436. this.$refs["post-editor"].content = "";
  5437. vue.nextTick(() => {
  5438. this.scrollTop(false);
  5439. });
  5440. }
  5441. },
  5442. "post.headerTemplate"(n2, o) {
  5443. let mountEl = document.querySelector(".main-wrapper .post-wrapper .html-wrapper .header");
  5444. if (mountEl) {
  5445. this.showOpTag = true;
  5446. }
  5447. },
  5448. modelValue: {
  5449. handler(newVal) {
  5450. if (this.isPost) {
  5451. return;
  5452. }
  5453. if (newVal) {
  5454. if (!window.history.state) {
  5455. window.history.pushState({}, 0, this.post.href);
  5456. }
  5457. this.read = this.post.read;
  5458. this.currentFloor = "";
  5459. vue.nextTick(() => {
  5460. window.document.title = this.post.title ?? "V2EX";
  5461. });
  5462. } else {
  5463. this.$emit("saveReadList");
  5464. window.document.title = "V2EX";
  5465. this.isSticky = false;
  5466. this.showRelationReply = false;
  5467. if (window.history.state) {
  5468. window.history.back();
  5469. }
  5470. }
  5471. }
  5472. }
  5473. },
  5474. mounted() {
  5475. this.debounceScroll = debounce(this.scroll, 300, false);
  5476. if (this.isLogin) {
  5477. const observer = new IntersectionObserver(
  5478. ([e2]) => e2.target.toggleAttribute("stuck", e2.intersectionRatio < 1),
  5479. { threshold: [1] }
  5480. );
  5481. observer.observe(this.$refs.replyBox);
  5482. window.addEventListener("keydown", this.onKeyDown);
  5483. }
  5484. eventBus.on(CMD.SHOW_CALL, (val) => {
  5485. if (val.show) {
  5486. this.showCallList = true;
  5487. this.replyText = val.text;
  5488. if (this.isPost) {
  5489. this.callStyle.top = val.top + $(window.win()).scrollTop() + -40 + "px";
  5490. } else {
  5491. this.callStyle.top = val.top + $(".post-detail").scrollTop() + 15 + "px";
  5492. }
  5493. this.callStyle.left = val.left - $(".main")[0].getBoundingClientRect().left + 10 + "px";
  5494. if (this.selectCallIndex >= this.filterCallList.length) {
  5495. this.selectCallIndex = 0;
  5496. }
  5497. } else {
  5498. this.replyText = "";
  5499. this.showCallList = false;
  5500. this.selectCallIndex = 0;
  5501. }
  5502. });
  5503. eventBus.on(CMD.RELATION_REPLY, (val) => {
  5504. this.targetUser = val;
  5505. this.showRelationReply = true;
  5506. });
  5507. eventBus.on(CMD.JUMP, this.jump);
  5508. if (this.isPost) {
  5509. window.addEventListener("scroll", this.debounceScroll);
  5510. }
  5511. eventBus.on(CMD.SHOW_COMMENT_OPTIONS, (comment) => {
  5512. this.currentComment = comment;
  5513. this.showCommentOptions = true;
  5514. });
  5515. eventBus.on(CMD.SHOW_EDITOR, (comment) => {
  5516. this.currentComment = comment;
  5517. this.isSticky = true;
  5518. setTimeout(() => {
  5519. var _a;
  5520. (_a = this.$refs["post-editor"]) == null ? void 0 : _a.focus();
  5521. }, 300);
  5522. });
  5523. },
  5524. beforeUnmount() {
  5525. window.removeEventListener("keydown", this.onKeyDown);
  5526. eventBus.off(CMD.SHOW_CALL);
  5527. },
  5528. methods: {
  5529. clickAvatar() {
  5530. window.functions.clickAvatar(".post-wrapper ");
  5531. },
  5532. addTag() {
  5533. eventBus.emit(CMD.ADD_TAG, this.post.member.username);
  5534. },
  5535. removeTag(tag) {
  5536. eventBus.emit(CMD.REMOVE_TAG, { username: this.post.member.username, tag });
  5537. },
  5538. scroll() {
  5539. if (!this.config.rememberLastReadFloor)
  5540. return;
  5541. let height = window.innerHeight * 0.3;
  5542. let comments = $(".comments .comment");
  5543. let forCount = 0;
  5544. for (let i = 0; i < comments.length; i++) {
  5545. forCount++;
  5546. let ins = comments[i];
  5547. let rect = ins.getBoundingClientRect();
  5548. if (rect.top > height) {
  5549. let lastReadFloor = Number(ins.dataset["floor"]);
  5550. console.log("当前阅读楼层", lastReadFloor);
  5551. eventBus.emit(CMD.ADD_READ, {
  5552. floor: lastReadFloor > 3 ? lastReadFloor : 0,
  5553. total: this.post.replyList.length
  5554. });
  5555. if (lastReadFloor > 3) {
  5556. this.read.floor = 0;
  5557. }
  5558. break;
  5559. }
  5560. }
  5561. if (forCount === comments.length) {
  5562. console.log("看到最后了");
  5563. eventBus.emit(CMD.ADD_READ, {
  5564. floor: forCount,
  5565. total: this.post.replyList.length
  5566. });
  5567. }
  5568. },
  5569. jump(floor) {
  5570. let lastItem = this.replyList[this.replyList.length - 1];
  5571. if (floor === "") {
  5572. floor = lastItem.floor;
  5573. } else {
  5574. try {
  5575. floor = Number(floor);
  5576. } catch (e2) {
  5577. floor = lastItem.floor;
  5578. }
  5579. if (floor === 0) {
  5580. floor = 1;
  5581. }
  5582. if (floor > lastItem.floor)
  5583. floor = lastItem.floor;
  5584. }
  5585. if (!this.post.replyList.length) {
  5586. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "没有回复可跳转!" });
  5587. this.read.floor = 0;
  5588. return;
  5589. }
  5590. if (floor > this.post.replyList.length) {
  5591. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  5592. this.read.floor = 0;
  5593. return;
  5594. }
  5595. let comment = $(`.c_${floor}`);
  5596. if (!comment.length) {
  5597. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有找到对应回复!" });
  5598. this.read.floor = 0;
  5599. return;
  5600. }
  5601. comment[0].scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
  5602. comment.addClass("ding");
  5603. this.read.floor = 0;
  5604. this.currentFloor = floor + 1;
  5605. setTimeout(() => {
  5606. comment.removeClass("ding");
  5607. }, 2e3);
  5608. },
  5609. jumpLastRead(floor) {
  5610. if (this.config.autoJumpLastReadFloor) {
  5611. if (!floor)
  5612. return;
  5613. setTimeout(() => {
  5614. console.log("上次跳转", floor);
  5615. this.jump(floor);
  5616. eventBus.emit(CMD.SHOW_MSG, { type: "success", text: "已跳转到上次阅读位置" });
  5617. }, 300);
  5618. }
  5619. },
  5620. collapseTopReplyList() {
  5621. $(this.$refs.topReply).slideToggle("fast");
  5622. },
  5623. goBottom() {
  5624. this.isSticky = false;
  5625. setTimeout(() => {
  5626. let postWrapper = document.querySelector(".post-wrapper");
  5627. postWrapper.scrollTo({ top: this.$refs["detail"].clientHeight, behavior: "smooth" });
  5628. });
  5629. },
  5630. close() {
  5631. this.$emit("update:modelValue", false);
  5632. },
  5633. setCall(e2) {
  5634. eventBus.emit(CMD.SET_CALL, e2);
  5635. this.showCallList = false;
  5636. },
  5637. onKeyDown(e2) {
  5638. if (!this.modelValue)
  5639. return;
  5640. if (!this.showCallList)
  5641. return;
  5642. let length = this.filterCallList.slice(0, 10).length;
  5643. if (e2.keyCode === 13) {
  5644. this.setCall(this.filterCallList[this.selectCallIndex]);
  5645. e2.preventDefault();
  5646. }
  5647. if (e2.keyCode === 38) {
  5648. this.selectCallIndex--;
  5649. if (this.selectCallIndex < 0) {
  5650. this.selectCallIndex = length - 1;
  5651. }
  5652. e2.preventDefault();
  5653. }
  5654. if (e2.keyCode === 40) {
  5655. this.selectCallIndex++;
  5656. if (this.selectCallIndex > length - 1) {
  5657. this.selectCallIndex = 0;
  5658. }
  5659. e2.preventDefault();
  5660. }
  5661. },
  5662. scrollTop(anim = true) {
  5663. document.querySelector(".post-wrapper").scrollTo({ top: 0, behavior: anim ? "smooth" : "instant" });
  5664. }
  5665. }
  5666. };
  5667. const _withScopeId$4 = (n2) => (vue.pushScopeId("data-v-546d3b11"), n2 = n2(), vue.popScopeId(), n2);
  5668. const _hoisted_1$6 = { class: "left" };
  5669. const _hoisted_2$4 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("a", { href: "/" }, "V2EX", -1));
  5670. const _hoisted_3$3 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "chevron" }, "  ›  ", -1));
  5671. const _hoisted_4$3 = ["href"];
  5672. const _hoisted_5$2 = { class: "right" };
  5673. const _hoisted_6$2 = ["src"];
  5674. const _hoisted_7$1 = { class: "my-box post-main-body" };
  5675. const _hoisted_8$1 = { class: "box-content" };
  5676. const _hoisted_9$1 = { class: "box-header" };
  5677. const _hoisted_10 = { class: "gray" };
  5678. const _hoisted_11 = ["href"];
  5679. const _hoisted_12 = ["src"];
  5680. const _hoisted_13 = { class: "info" };
  5681. const _hoisted_14 = { class: "top" };
  5682. const _hoisted_15 = ["href"];
  5683. const _hoisted_16 = {
  5684. key: 0,
  5685. class: "center"
  5686. };
  5687. const _hoisted_17 = { class: "my-tag" };
  5688. const _hoisted_18 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  5689. const _hoisted_19 = ["onClick"];
  5690. const _hoisted_20 = { class: "bottom" };
  5691. const _hoisted_21 = ["title"];
  5692. const _hoisted_22 = ["href"];
  5693. const _hoisted_23 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-info-circle" }, null, -1));
  5694. const _hoisted_24 = [
  5695. _hoisted_23
  5696. ];
  5697. const _hoisted_25 = ["href"];
  5698. const _hoisted_26 = {
  5699. key: 0,
  5700. class: "my-box"
  5701. };
  5702. const _hoisted_27 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "" }, "高赞回复", -1));
  5703. const _hoisted_28 = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "top-reply" }, [
  5704. /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-compress" })
  5705. ], -1));
  5706. const _hoisted_29 = [
  5707. _hoisted_27,
  5708. _hoisted_28
  5709. ];
  5710. const _hoisted_30 = { ref: "topReply" };
  5711. const _hoisted_31 = {
  5712. key: 1,
  5713. class: "my-cell flex comments-header"
  5714. };
  5715. const _hoisted_32 = {
  5716. key: 2,
  5717. class: "my-box comment-wrapper"
  5718. };
  5719. const _hoisted_33 = {
  5720. key: 0,
  5721. class: "loading-wrapper"
  5722. };
  5723. const _hoisted_34 = {
  5724. key: 1,
  5725. class: "comments"
  5726. };
  5727. const _hoisted_35 = {
  5728. key: 3,
  5729. id: "no-comments-yet"
  5730. };
  5731. const _hoisted_36 = { class: "my-cell flex" };
  5732. const _hoisted_37 = { class: "notice-right gray" };
  5733. const _hoisted_38 = { class: "p1" };
  5734. const _hoisted_39 = ["onClick"];
  5735. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  5736. const _component_BackIcon = vue.resolveComponent("BackIcon");
  5737. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  5738. const _component_MoreIcon = vue.resolveComponent("MoreIcon");
  5739. const _component_BaseHtmlRender = vue.resolveComponent("BaseHtmlRender");
  5740. const _component_Toolbar = vue.resolveComponent("Toolbar");
  5741. const _component_Comment = vue.resolveComponent("Comment");
  5742. const _component_BaseSelect = vue.resolveComponent("BaseSelect");
  5743. const _component_PostEditor = vue.resolveComponent("PostEditor");
  5744. const _component_post_options = vue.resolveComponent("post-options");
  5745. const _component_comment_options = vue.resolveComponent("comment-options");
  5746. const _component_relation_reply = vue.resolveComponent("relation-reply");
  5747. return vue.openBlock(), vue.createBlock(vue.Teleport, { to: ".post-wrapper" }, [
  5748. vue.createElementVNode("div", {
  5749. class: vue.normalizeClass(["post-detail", [
  5750. $options.isNight ? "isNight" : "",
  5751. $options.pageType
  5752. ]]),
  5753. ref: "detail",
  5754. id: "post-detail",
  5755. onScroll: _cache[20] || (_cache[20] = (...args) => $data.debounceScroll && $data.debounceScroll(...args))
  5756. }, [
  5757. vue.createElementVNode("div", {
  5758. class: "my-box nav-bar",
  5759. onDblclick: _cache[2] || (_cache[2] = vue.withModifiers((...args) => $options.scrollTop && $options.scrollTop(...args), ["stop"]))
  5760. }, [
  5761. vue.createElementVNode("div", _hoisted_1$6, [
  5762. !$options.isPost ? (vue.openBlock(), vue.createBlock(_component_BackIcon, {
  5763. key: 0,
  5764. onClick: vue.withModifiers($options.close, ["stop"])
  5765. }, null, 8, ["onClick"])) : vue.createCommentVNode("", true),
  5766. $options.isPost ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  5767. _hoisted_2$4,
  5768. _hoisted_3$3
  5769. ], 64)) : vue.createCommentVNode("", true),
  5770. vue.createElementVNode("a", {
  5771. href: $options.post.node.url
  5772. }, vue.toDisplayString($options.post.node.title), 9, _hoisted_4$3)
  5773. ]),
  5774. vue.createElementVNode("div", _hoisted_5$2, [
  5775. $props.refreshLoading ? (vue.openBlock(), vue.createBlock(_component_BaseLoading, { key: 0 })) : vue.createCommentVNode("", true),
  5776. vue.createVNode(_component_MoreIcon, {
  5777. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => $data.showPostOptions = true, ["stop"]))
  5778. }),
  5779. $options.user.avatar ? (vue.openBlock(), vue.createElementBlock("img", {
  5780. key: 1,
  5781. onClick: _cache[1] || (_cache[1] = (...args) => $options.clickAvatar && $options.clickAvatar(...args)),
  5782. style: { "margin-right": "0" },
  5783. class: "avatar mobile",
  5784. src: $options.user.avatar
  5785. }, null, 8, _hoisted_6$2)) : vue.createCommentVNode("", true)
  5786. ])
  5787. ], 32),
  5788. vue.createElementVNode("div", _hoisted_7$1, [
  5789. vue.createElementVNode("div", _hoisted_8$1, [
  5790. vue.createElementVNode("div", _hoisted_9$1, [
  5791. vue.createElementVNode("small", _hoisted_10, [
  5792. $options.post.member.avatar_large ? (vue.openBlock(), vue.createElementBlock("a", {
  5793. key: 0,
  5794. class: "base-avatar",
  5795. href: `/member/${$options.post.member.username}`
  5796. }, [
  5797. vue.createElementVNode("img", {
  5798. src: $options.post.member.avatar_large
  5799. }, null, 8, _hoisted_12)
  5800. ], 8, _hoisted_11)) : vue.createCommentVNode("", true),
  5801. vue.createElementVNode("div", _hoisted_13, [
  5802. vue.createElementVNode("div", _hoisted_14, [
  5803. vue.createElementVNode("a", {
  5804. href: `/member/${$options.post.member.username}`
  5805. }, vue.toDisplayString($options.post.member.username), 9, _hoisted_15),
  5806. $options.post.member.createDate ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  5807. vue.createTextVNode(" · "),
  5808. vue.createElementVNode("span", {
  5809. class: vue.normalizeClass($options.post.member.isNew && "danger")
  5810. }, vue.toDisplayString($options.post.member.createDate), 3)
  5811. ], 64)) : vue.createCommentVNode("", true)
  5812. ]),
  5813. $options.isLogin && $options.config.openTag ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, [
  5814. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.myTags, (i) => {
  5815. return vue.openBlock(), vue.createElementBlock("span", _hoisted_17, [
  5816. _hoisted_18,
  5817. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  5818. vue.createElementVNode("i", {
  5819. class: "fa fa-trash-o remove",
  5820. onClick: ($event) => $options.removeTag(i)
  5821. }, null, 8, _hoisted_19)
  5822. ]);
  5823. }), 256)),
  5824. vue.createElementVNode("span", {
  5825. class: "add-tag ago",
  5826. onClick: _cache[3] || (_cache[3] = (...args) => $options.addTag && $options.addTag(...args)),
  5827. title: "添加标签"
  5828. }, "+")
  5829. ])) : vue.createCommentVNode("", true),
  5830. vue.createElementVNode("div", _hoisted_20, [
  5831. $options.post.createDateAgo ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  5832. vue.createElementVNode("span", {
  5833. title: $options.post.createDate
  5834. }, vue.toDisplayString($options.post.createDateAgo), 9, _hoisted_21),
  5835. vue.createTextVNode(" · ")
  5836. ], 64)) : vue.createCommentVNode("", true),
  5837. vue.createTextVNode(" " + vue.toDisplayString($options.post.clickCount) + " 次点击 ", 1),
  5838. $options.isMy ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  5839. vue.createTextVNode("   "),
  5840. vue.createElementVNode("a", {
  5841. href: `/t/${$options.post.id}/info`
  5842. }, _hoisted_24, 8, _hoisted_22),
  5843. vue.createTextVNode("   "),
  5844. vue.createElementVNode("a", {
  5845. href: `/append/topic/${$options.post.id}`,
  5846. class: "op"
  5847. }, "APPEND", 8, _hoisted_25)
  5848. ], 64)) : vue.createCommentVNode("", true)
  5849. ])
  5850. ])
  5851. ]),
  5852. vue.createElementVNode("h1", null, vue.toDisplayString($options.post.title), 1)
  5853. ]),
  5854. vue.createVNode(_component_BaseHtmlRender, {
  5855. html: $options.post.headerTemplate
  5856. }, null, 8, ["html"])
  5857. ]),
  5858. vue.createVNode(_component_Toolbar, {
  5859. onReply: _cache[4] || (_cache[4] = ($event) => {
  5860. $data.isSticky = !$data.isSticky;
  5861. $data.currentComment = null;
  5862. })
  5863. })
  5864. ]),
  5865. $options.topReply.length && $options.config.showTopReply ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_26, [
  5866. vue.createElementVNode("div", {
  5867. class: "my-cell flex",
  5868. onClick: _cache[5] || (_cache[5] = (...args) => $options.collapseTopReplyList && $options.collapseTopReplyList(...args))
  5869. }, _hoisted_29),
  5870. vue.createElementVNode("div", _hoisted_30, [
  5871. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.topReply, (item, index) => {
  5872. return vue.openBlock(), vue.createBlock(_component_Comment, {
  5873. key: item.floor,
  5874. type: "top",
  5875. modelValue: $options.topReply[index],
  5876. "onUpdate:modelValue": ($event) => $options.topReply[index] = $event
  5877. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  5878. }), 128))
  5879. ], 512)
  5880. ])) : vue.createCommentVNode("", true),
  5881. $options.post.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_31, [
  5882. vue.createElementVNode("span", null, vue.toDisplayString($options.post.replyCount) + " 条回复", 1),
  5883. vue.createVNode(_component_BaseSelect, {
  5884. "display-type": $props.displayType,
  5885. "onUpdate:displayType": _cache[6] || (_cache[6] = (e2) => _ctx.$emit("update:displayType", e2))
  5886. }, null, 8, ["display-type"])
  5887. ])) : vue.createCommentVNode("", true),
  5888. $options.replyList.length || $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_32, [
  5889. $props.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_33, [
  5890. vue.createVNode(_component_BaseLoading, { size: "large" })
  5891. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_34, [
  5892. $props.modelValue ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList($options.replyList, (item, index) => {
  5893. return vue.openBlock(), vue.createBlock(_component_Comment, {
  5894. key: item.floor,
  5895. modelValue: $options.replyList[index],
  5896. "onUpdate:modelValue": ($event) => $options.replyList[index] = $event
  5897. }, null, 8, ["modelValue", "onUpdate:modelValue"]);
  5898. }), 128)) : vue.createCommentVNode("", true)
  5899. ]))
  5900. ])) : vue.createCommentVNode("", true),
  5901. !($options.replyList.length || $props.loading) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_35, "目前尚无回复")) : vue.createCommentVNode("", true),
  5902. $options.isLogin ? (vue.openBlock(), vue.createElementBlock("div", {
  5903. key: 4,
  5904. class: vue.normalizeClass(["my-box", { "sticky": $data.isSticky }]),
  5905. ref: "replyBox"
  5906. }, [
  5907. vue.createElementVNode("div", _hoisted_36, [
  5908. vue.createElementVNode("span", null, vue.toDisplayString($data.currentComment ? `回复${$data.currentComment.floor}楼` : "回复主题"), 1),
  5909. vue.createElementVNode("div", _hoisted_37, [
  5910. $data.isSticky ? (vue.openBlock(), vue.createElementBlock("a", {
  5911. key: 0,
  5912. style: { "margin-right": "2rem" },
  5913. onClick: _cache[7] || (_cache[7] = ($event) => {
  5914. $data.isSticky = false;
  5915. $data.currentComment = null;
  5916. })
  5917. }, "取消回复框停靠")) : vue.createCommentVNode("", true),
  5918. vue.createElementVNode("a", {
  5919. onClick: _cache[8] || (_cache[8] = (...args) => $options.scrollTop && $options.scrollTop(...args))
  5920. }, "回到顶部")
  5921. ])
  5922. ]),
  5923. vue.createElementVNode("div", _hoisted_38, [
  5924. vue.createVNode(_component_PostEditor, {
  5925. onClose: $options.goBottom,
  5926. ref: "post-editor",
  5927. useType: $data.currentComment ? "reply-comment" : "reply-post",
  5928. replyUser: $options.replyUser,
  5929. replyFloor: $options.replyFloor,
  5930. onClick: _cache[9] || (_cache[9] = ($event) => $data.isSticky = true)
  5931. }, null, 8, ["onClose", "useType", "replyUser", "replyFloor"])
  5932. ])
  5933. ], 2)) : vue.createCommentVNode("", true),
  5934. $data.showCallList && $options.filterCallList.length ? (vue.openBlock(), vue.createElementBlock("div", {
  5935. key: 5,
  5936. class: "call-list",
  5937. style: vue.normalizeStyle($data.callStyle)
  5938. }, [
  5939. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.filterCallList, (item, index) => {
  5940. return vue.openBlock(), vue.createElementBlock("div", {
  5941. class: vue.normalizeClass(["call-item", { select: index === $data.selectCallIndex }]),
  5942. onClick: ($event) => $options.setCall(item)
  5943. }, [
  5944. vue.createElementVNode("a", null, vue.toDisplayString(item), 1)
  5945. ], 10, _hoisted_39);
  5946. }), 256))
  5947. ], 4)) : vue.createCommentVNode("", true),
  5948. vue.createVNode(_component_post_options, {
  5949. onMerge: _cache[10] || (_cache[10] = (val) => {
  5950. $options.post = Object.assign($options.post, val);
  5951. console.log("va", val, $options.post);
  5952. }),
  5953. post: $options.post,
  5954. onReply: _cache[11] || (_cache[11] = ($event) => ($options.eventBus.emit($options.CMD.SHOW_EDITOR, null), $data.showPostOptions = false)),
  5955. onRefresh: _cache[12] || (_cache[12] = ($event) => _ctx.$emit("refresh")),
  5956. modelValue: $data.showPostOptions,
  5957. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.showPostOptions = $event)
  5958. }, null, 8, ["post", "modelValue"]),
  5959. vue.createVNode(_component_comment_options, {
  5960. onMerge: _cache[14] || (_cache[14] = (val) => $data.currentComment = Object.assign($data.currentComment, val)),
  5961. onRecallThank: _cache[15] || (_cache[15] = ($event) => $data.currentComment.isThanked = false),
  5962. post: $options.post,
  5963. comment: $data.currentComment,
  5964. onClose: _cache[16] || (_cache[16] = ($event) => $data.currentComment = null),
  5965. onReply: _cache[17] || (_cache[17] = ($event) => ($options.eventBus.emit($options.CMD.SHOW_EDITOR, $data.currentComment), $data.showCommentOptions = false)),
  5966. modelValue: $data.showCommentOptions,
  5967. "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => $data.showCommentOptions = $event)
  5968. }, null, 8, ["post", "comment", "modelValue"]),
  5969. vue.createVNode(_component_relation_reply, {
  5970. post: $options.post,
  5971. "relation-reply": $options.relationReply,
  5972. modelValue: $data.showRelationReply,
  5973. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.showRelationReply = $event),
  5974. "target-user": $data.targetUser
  5975. }, null, 8, ["post", "relation-reply", "modelValue", "target-user"])
  5976. ], 34)
  5977. ]);
  5978. }
  5979. const PostDetail = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$2], ["__scopeId", "data-v-546d3b11"]]);
  5980. const _withScopeId$3 = (n2) => (vue.pushScopeId("data-v-1988f33b"), n2 = n2(), vue.popScopeId(), n2);
  5981. const _hoisted_1$5 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("svg", {
  5982. width: "24",
  5983. height: "24",
  5984. viewBox: "0 0 48 48",
  5985. fill: "none",
  5986. xmlns: "http://www.w3.org/2000/svg"
  5987. }, [
  5988. /* @__PURE__ */ vue.createElementVNode("path", {
  5989. d: "M17 32L19.1875 27M31 32L28.8125 27M19.1875 27L24 16L28.8125 27M19.1875 27H28.8125",
  5990. stroke: "#929596",
  5991. "stroke-width": "4",
  5992. "stroke-linecap": "round",
  5993. "stroke-linejoin": "round"
  5994. }),
  5995. /* @__PURE__ */ vue.createElementVNode("path", {
  5996. d: "M43.1999 20C41.3468 10.871 33.2758 4 23.5999 4C13.9241 4 5.85308 10.871 4 20L10 18",
  5997. stroke: "#929596",
  5998. "stroke-width": "4",
  5999. "stroke-linecap": "round",
  6000. "stroke-linejoin": "round"
  6001. }),
  6002. /* @__PURE__ */ vue.createElementVNode("path", {
  6003. d: "M4 28C5.85308 37.129 13.9241 44 23.5999 44C33.2758 44 41.3468 37.129 43.1999 28L38 30",
  6004. stroke: "#929596",
  6005. "stroke-width": "4",
  6006. "stroke-linecap": "round",
  6007. "stroke-linejoin": "round"
  6008. })
  6009. ], -1));
  6010. const _hoisted_2$3 = { key: 1 };
  6011. const _sfc_main$5 = {
  6012. __name: "Base64Tooltip",
  6013. setup(__props) {
  6014. const tooltip = vue.ref(null);
  6015. const show = vue.ref(false);
  6016. const originalText = vue.ref("");
  6017. const decodeText = vue.ref("");
  6018. const styleObject = vue.reactive({
  6019. left: "-100vw",
  6020. top: "-100vh"
  6021. });
  6022. vue.onMounted(() => {
  6023. eventBus.on(CMD.SHOW_TOOLTIP, ({ text, e: e2 }) => {
  6024. setTimeout(() => show.value = true);
  6025. originalText.value = text;
  6026. decodeText.value = "";
  6027. styleObject.left = e2.clientX + "px";
  6028. styleObject.top = e2.clientY + 20 + "px";
  6029. });
  6030. window.addEventListener("click", (e2) => {
  6031. if (!tooltip.value)
  6032. return;
  6033. if (!tooltip.value.contains(e2.target) && show.value) {
  6034. show.value = false;
  6035. }
  6036. }, { capture: true });
  6037. const fn = () => show.value && (show.value = false);
  6038. $(".post-detail", window.win().doc).on("scroll", fn);
  6039. });
  6040. function base64ToArrayBuffer(base64) {
  6041. let binary_string = window.atob(base64);
  6042. let len = binary_string.length;
  6043. let bytes = new Uint8Array(len);
  6044. for (let i = 0; i < len; i++) {
  6045. bytes[i] = binary_string.charCodeAt(i);
  6046. }
  6047. return bytes.buffer;
  6048. }
  6049. function decode() {
  6050. try {
  6051. new Blob([base64ToArrayBuffer(originalText.value)]).text().then((r2) => {
  6052. decodeText.value = r2;
  6053. });
  6054. } catch (e2) {
  6055. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "Base64解码失败!不是标准数据!" });
  6056. }
  6057. }
  6058. return (_ctx, _cache) => {
  6059. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  6060. class: "base64_tooltip",
  6061. style: vue.normalizeStyle(styleObject),
  6062. onClick: decode,
  6063. ref_key: "tooltip",
  6064. ref: tooltip
  6065. }, [
  6066. !decodeText.value ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  6067. vue.createTextVNode(" Base64解码:" + vue.toDisplayString(originalText.value) + " ", 1),
  6068. _hoisted_1$5
  6069. ], 64)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, [
  6070. vue.createElementVNode("span", null, vue.toDisplayString(decodeText.value), 1),
  6071. vue.createVNode(BaseButton, {
  6072. class: "btn",
  6073. size: "small",
  6074. onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(copy)(decodeText.value))
  6075. }, {
  6076. default: vue.withCtx(() => [
  6077. vue.createTextVNode("点击复制")
  6078. ]),
  6079. _: 1
  6080. })
  6081. ]))
  6082. ], 4)), [
  6083. [vue.vShow, show.value]
  6084. ]);
  6085. };
  6086. }
  6087. };
  6088. const Base64Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-1988f33b"]]);
  6089. const _sfc_main$4 = {
  6090. name: "Msg",
  6091. components: { Icon },
  6092. props: {
  6093. type: "",
  6094. text: ""
  6095. },
  6096. created() {
  6097. setTimeout(() => {
  6098. this.$emit("close");
  6099. }, 3e3);
  6100. }
  6101. };
  6102. const _hoisted_1$4 = { class: "right" };
  6103. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  6104. const _component_Icon = vue.resolveComponent("Icon");
  6105. return vue.openBlock(), vue.createElementBlock("div", {
  6106. class: vue.normalizeClass(["msg", $props.type])
  6107. }, [
  6108. vue.createElementVNode("div", {
  6109. class: "left",
  6110. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  6111. }, [
  6112. vue.createVNode(_component_Icon, { icon: "ic:round-close" })
  6113. ]),
  6114. vue.createElementVNode("div", _hoisted_1$4, vue.toDisplayString($props.text), 1)
  6115. ], 2);
  6116. }
  6117. const Msg = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$1], ["__scopeId", "data-v-0dcc0508"]]);
  6118. const _withScopeId$2 = (n2) => (vue.pushScopeId("data-v-674b86aa"), n2 = n2(), vue.popScopeId(), n2);
  6119. const _hoisted_1$3 = {
  6120. key: 0,
  6121. class: "tag-modal modal"
  6122. };
  6123. const _hoisted_2$2 = { class: "wrapper" };
  6124. const _hoisted_3$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 添加标签 ", -1));
  6125. const _hoisted_4$2 = { class: "option" };
  6126. const _hoisted_5$1 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("span", null, "用户:", -1));
  6127. const _hoisted_6$1 = { class: "btns" };
  6128. const _sfc_main$3 = {
  6129. __name: "TagModal",
  6130. props: ["tags"],
  6131. emits: ["update:tags"],
  6132. setup(__props, { emit: __emit }) {
  6133. const tagModal = vue.reactive({
  6134. show: false,
  6135. currentUsername: "",
  6136. tag: ""
  6137. });
  6138. const props = __props;
  6139. const emit = __emit;
  6140. const inputRef = vue.ref();
  6141. vue.onMounted(() => {
  6142. eventBus.on(CMD.ADD_TAG, (username) => {
  6143. tagModal.currentUsername = username;
  6144. tagModal.show = true;
  6145. vue.nextTick(() => {
  6146. inputRef.value.focus();
  6147. });
  6148. });
  6149. });
  6150. async function addTag() {
  6151. if (!tagModal.tag) {
  6152. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "请输入标签" });
  6153. return;
  6154. }
  6155. let oldTag = window.clone(props.tags);
  6156. let tempTag = window.clone(props.tags);
  6157. let userTags = tempTag[tagModal.currentUsername] ?? [];
  6158. let rIndex = userTags.findIndex((v) => v === tagModal.tag);
  6159. if (rIndex > -1) {
  6160. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "标签已存在!" });
  6161. return;
  6162. } else {
  6163. userTags.push(tagModal.tag);
  6164. }
  6165. tempTag[tagModal.currentUsername] = userTags;
  6166. emit("update:tags", tempTag);
  6167. tagModal.tag = "";
  6168. tagModal.show = false;
  6169. let res = await window.parse.saveTags(tempTag);
  6170. if (!res) {
  6171. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签添加失败!" });
  6172. emit("update:tags", oldTag);
  6173. }
  6174. }
  6175. return (_ctx, _cache) => {
  6176. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  6177. default: vue.withCtx(() => [
  6178. tagModal.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
  6179. vue.createElementVNode("div", {
  6180. class: "mask",
  6181. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => tagModal.show = false, ["stop"]))
  6182. }),
  6183. vue.createElementVNode("div", _hoisted_2$2, [
  6184. _hoisted_3$2,
  6185. vue.createElementVNode("div", _hoisted_4$2, [
  6186. _hoisted_5$1,
  6187. vue.createElementVNode("div", null, [
  6188. vue.createElementVNode("b", null, vue.toDisplayString(tagModal.currentUsername), 1)
  6189. ])
  6190. ]),
  6191. vue.withDirectives(vue.createElementVNode("input", {
  6192. type: "text",
  6193. ref_key: "inputRef",
  6194. ref: inputRef,
  6195. style: { "width": "100%" },
  6196. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tagModal.tag = $event),
  6197. onKeydown: vue.withKeys(addTag, ["enter"])
  6198. }, null, 544), [
  6199. [vue.vModelText, tagModal.tag]
  6200. ]),
  6201. vue.createElementVNode("div", _hoisted_6$1, [
  6202. vue.createVNode(BaseButton, {
  6203. type: "link",
  6204. onClick: _cache[2] || (_cache[2] = ($event) => tagModal.show = false)
  6205. }, {
  6206. default: vue.withCtx(() => [
  6207. vue.createTextVNode("取消")
  6208. ]),
  6209. _: 1
  6210. }),
  6211. vue.createVNode(BaseButton, { onClick: addTag }, {
  6212. default: vue.withCtx(() => [
  6213. vue.createTextVNode("确定")
  6214. ]),
  6215. _: 1
  6216. })
  6217. ])
  6218. ])
  6219. ])) : vue.createCommentVNode("", true)
  6220. ]),
  6221. _: 1
  6222. });
  6223. };
  6224. }
  6225. };
  6226. const TagModal = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-674b86aa"]]);
  6227. const _hoisted_1$2 = { class: "msgs" };
  6228. const _sfc_main$2 = {
  6229. __name: "MsgModal",
  6230. setup(__props) {
  6231. const msgList = vue.reactive([
  6232. // {type: 'success', text: '123', id: Date.now()}
  6233. ]);
  6234. vue.onMounted(() => {
  6235. eventBus.on(CMD.SHOW_MSG, (val) => {
  6236. msgList.push({ ...val, id: Date.now() });
  6237. });
  6238. });
  6239. function removeMsg(id) {
  6240. let rIndex = msgList.findIndex((item) => item.id === id);
  6241. if (rIndex > -1) {
  6242. msgList.splice(rIndex, 1);
  6243. }
  6244. }
  6245. return (_ctx, _cache) => {
  6246. return vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
  6247. vue.createElementVNode("div", _hoisted_1$2, [
  6248. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(msgList, (v) => {
  6249. return vue.openBlock(), vue.createBlock(Msg, {
  6250. key: v.id,
  6251. type: v.type,
  6252. text: v.text,
  6253. onClose: ($event) => removeMsg(v.id)
  6254. }, null, 8, ["type", "text", "onClose"]);
  6255. }), 128))
  6256. ])
  6257. ]);
  6258. };
  6259. }
  6260. };
  6261. const MsgModal = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-93c4dec0"]]);
  6262. let u = ".__cf_email__", f = "data-cfemail", d = document.createElement("div");
  6263. function e(e2) {
  6264. console.error(e2);
  6265. }
  6266. function r(e2, t) {
  6267. let r2 = e2.substr(t, 2);
  6268. return parseInt(r2, 16);
  6269. }
  6270. function n(href, index) {
  6271. let o = "", a = r(href, index);
  6272. for (let i = index + 2; i < href.length; i += 2) {
  6273. let l = r(href, i) ^ a;
  6274. o += String.fromCharCode(l);
  6275. }
  6276. try {
  6277. o = decodeURIComponent(escape(o));
  6278. } catch (u2) {
  6279. e(u2);
  6280. }
  6281. d.innerHTML = '<a href="' + o.replace(/"/g, "&quot;") + '"></a>';
  6282. return d.childNodes[0].getAttribute("href") || "";
  6283. }
  6284. function decodeEmail(body) {
  6285. try {
  6286. let as = body.find(u);
  6287. as.each(function() {
  6288. try {
  6289. let o = this, a = o.parentNode, i = o.getAttribute(f);
  6290. if (i) {
  6291. let l = n(i, 0), d2 = document.createTextNode(l);
  6292. a.replaceChild(d2, o);
  6293. }
  6294. } catch (h2) {
  6295. e(h2);
  6296. }
  6297. });
  6298. } catch (s) {
  6299. e(s);
  6300. }
  6301. }
  6302. const _withScopeId$1 = (n2) => (vue.pushScopeId("data-v-19a5903e"), n2 = n2(), vue.popScopeId(), n2);
  6303. const _hoisted_1$1 = {
  6304. key: 0,
  6305. class: "tag-modal modal"
  6306. };
  6307. const _hoisted_2$1 = { class: "modal-root" };
  6308. const _hoisted_3$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "title" }, " 提醒系统 ", -1));
  6309. const _hoisted_4$1 = ["innerHTML"];
  6310. const _sfc_main$1 = {
  6311. __name: "NotificationModal",
  6312. props: ["modelValue", "h"],
  6313. emits: ["update:modelValue"],
  6314. setup(__props, { emit: __emit }) {
  6315. const emit = __emit;
  6316. vue.onMounted(() => {
  6317. });
  6318. function close() {
  6319. emit("update:modelValue", false);
  6320. }
  6321. return (_ctx, _cache) => {
  6322. return vue.openBlock(), vue.createBlock(vue.Transition, null, {
  6323. default: vue.withCtx(() => [
  6324. __props.modelValue ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
  6325. vue.createElementVNode("div", {
  6326. class: "mask",
  6327. onClick: vue.withModifiers(close, ["stop"])
  6328. }),
  6329. vue.createElementVNode("div", _hoisted_2$1, [
  6330. vue.createElementVNode("div", { class: "modal-header" }, [
  6331. _hoisted_3$1,
  6332. vue.createElementVNode("i", {
  6333. class: "fa fa-times",
  6334. onClick: close
  6335. })
  6336. ]),
  6337. vue.createElementVNode("div", {
  6338. innerHTML: __props.h,
  6339. class: "modal-body"
  6340. }, null, 8, _hoisted_4$1)
  6341. ])
  6342. ])) : vue.createCommentVNode("", true)
  6343. ]),
  6344. _: 1
  6345. });
  6346. };
  6347. }
  6348. };
  6349. const NotificationModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-19a5903e"]]);
  6350. const _sfc_main = {
  6351. components: {
  6352. BaseButton,
  6353. NotificationModal,
  6354. BaseLoading,
  6355. BaseSwitch,
  6356. MsgModal,
  6357. TagModal,
  6358. Tooltip,
  6359. Setting,
  6360. PostDetail,
  6361. Base64Tooltip,
  6362. Msg
  6363. },
  6364. provide() {
  6365. return {
  6366. user: vue.computed(() => window.user),
  6367. isLogin: vue.computed(() => this.isLogin),
  6368. isNight: vue.computed(() => this.isNight),
  6369. pageType: vue.computed(() => this.pageType),
  6370. tags: vue.computed(() => this.tags),
  6371. show: vue.computed(() => this.show),
  6372. post: vue.computed(() => this.current),
  6373. config: vue.computed(() => this.config),
  6374. allReplyUsers: vue.computed(() => {
  6375. var _a, _b, _c;
  6376. if ((_a = this.current) == null ? void 0 : _a.replyList) {
  6377. return Array.from(new Set(((_c = (_b = this.current) == null ? void 0 : _b.replyList) == null ? void 0 : _c.map((v) => v.username)) ?? []));
  6378. }
  6379. return [];
  6380. })
  6381. };
  6382. },
  6383. data() {
  6384. return {
  6385. loading: window.pageType === PageType.Post,
  6386. refreshLoading: false,
  6387. loadMore: false,
  6388. isLogin: !!window.user.username,
  6389. pageType: window.pageType,
  6390. isNight: window.isNight,
  6391. stopMe: window.stopMe,
  6392. //停止使用脚本
  6393. show: false,
  6394. current: window.clone(window.initPost),
  6395. list: [],
  6396. config: window.clone(window.config),
  6397. tags: window.user.tags,
  6398. readList: window.user.readList,
  6399. notificationModal: {
  6400. show: false,
  6401. h: ""
  6402. },
  6403. step: 0
  6404. };
  6405. },
  6406. computed: {
  6407. targetUserTags() {
  6408. return this.tags[window.targetUserName] ?? [];
  6409. },
  6410. isList() {
  6411. return [PageType.Home, PageType.Node].includes(this.pageType);
  6412. },
  6413. isPost() {
  6414. return this.pageType === PageType.Post;
  6415. },
  6416. isMember() {
  6417. return this.pageType === PageType.Member;
  6418. }
  6419. },
  6420. watch: {
  6421. config: {
  6422. handler(newVal) {
  6423. let config2 = { [window.user.username ?? "default"]: newVal };
  6424. localStorage.setItem("v2ex-config", JSON.stringify(config2));
  6425. window.config = newVal;
  6426. },
  6427. deep: true
  6428. },
  6429. tags(newVal) {
  6430. window.user.tags = newVal;
  6431. },
  6432. "config.viewType"(newVal) {
  6433. if (!newVal)
  6434. return;
  6435. if (newVal === "card") {
  6436. $(".post-item").each(function() {
  6437. $(this).addClass("preview");
  6438. });
  6439. } else {
  6440. $(".post-item").each(function() {
  6441. $(this).removeClass("preview");
  6442. });
  6443. }
  6444. },
  6445. "config.fontSizeType": {
  6446. handler(newVal) {
  6447. switch (newVal) {
  6448. case "small":
  6449. return $("html").css("font-size", "8px");
  6450. case "normal":
  6451. return $("html").css("font-size", "10px");
  6452. case "large":
  6453. return $("html").css("font-size", "12px");
  6454. case "big-large":
  6455. return $("html").css("font-size", "14px");
  6456. }
  6457. },
  6458. deep: true
  6459. },
  6460. show(n2) {
  6461. if (n2)
  6462. this.step++;
  6463. else
  6464. this.step--;
  6465. this.slide("post");
  6466. }
  6467. },
  6468. created() {
  6469. let that = this;
  6470. this.initEvent();
  6471. window.cb = this.winCb;
  6472. if (!window.canParseV2exPage)
  6473. return;
  6474. document.addEventListener("click", this.clickA, true);
  6475. $(document).on("click", ".post-item", function(e2) {
  6476. if (e2.currentTarget.getAttribute("script"))
  6477. return;
  6478. if (that.stopMe)
  6479. return true;
  6480. if (this.classList.contains("preview")) {
  6481. if (e2.target.tagName !== "A" && e2.target.tagName !== "IMG") {
  6482. console.log("点空白处", this);
  6483. let id = this.dataset["id"];
  6484. let href = this.dataset["href"];
  6485. if (id) {
  6486. that.clickPost(e2, id, href);
  6487. } else {
  6488. if (href)
  6489. location.href = href;
  6490. }
  6491. }
  6492. }
  6493. });
  6494. window.onpopstate = (event) => {
  6495. if (event.state) {
  6496. if (!this.show)
  6497. this.show = true;
  6498. } else {
  6499. if (this.show)
  6500. this.show = false;
  6501. }
  6502. };
  6503. window.onbeforeunload = () => {
  6504. };
  6505. window.deleteNotification = (nId, token) => {
  6506. console.log("deleteNotification", nId, token);
  6507. let item = $("#n_" + nId);
  6508. item.slideUp("fast");
  6509. $.post({
  6510. url: "/delete/notification/" + nId + "?once=" + token,
  6511. success() {
  6512. $.get({
  6513. url: "/notifications/below/" + window.notificationBottom,
  6514. success(data, status, request) {
  6515. item.remove();
  6516. $("#notifications").append(data);
  6517. window.notificationBottom = request.getResponseHeader("X-V2EX-New-Notification-Bottom");
  6518. },
  6519. error() {
  6520. item.slideDown("fast");
  6521. }
  6522. });
  6523. },
  6524. error() {
  6525. item.slideDown("fast");
  6526. }
  6527. });
  6528. };
  6529. },
  6530. beforeUnmount() {
  6531. eventBus.clear();
  6532. document.removeEventListener("click", this.clickA, true);
  6533. },
  6534. methods: {
  6535. async getUnreadMessagesCount() {
  6536. var _a, _b;
  6537. const res = await fetch(`${location.origin}/mission`);
  6538. const htmlText = await res.text();
  6539. const $page = $(htmlText);
  6540. const text = $page.find('#Rightbar a[href^="/notifications"]').text();
  6541. if (text.includes("未读提醒")) {
  6542. const countStr = (_a = text.match(/\d+/)) == null ? void 0 : _a.at(0);
  6543. if (countStr) {
  6544. return Number((_b = text.match(/\d+/)) == null ? void 0 : _b.at(0));
  6545. }
  6546. } else {
  6547. return 0;
  6548. }
  6549. throw new Error("无法获取未读消息数量");
  6550. },
  6551. clickA(e2) {
  6552. if (!(e2 == null ? void 0 : e2.target))
  6553. return;
  6554. if (e2.target.tagName !== "A")
  6555. return;
  6556. let that = this;
  6557. if (e2.target.getAttribute("script"))
  6558. return;
  6559. if (that.stopMe)
  6560. return true;
  6561. let { href, id, title } = functions.parseA(e2.target);
  6562. if (href.includes("/settings/night/toggle"))
  6563. return;
  6564. if (href.includes("/?tab="))
  6565. return;
  6566. if (href.includes("/go"))
  6567. return;
  6568. if (href === window.origin + "/#;")
  6569. return;
  6570. if (href === window.origin + "/")
  6571. return;
  6572. if (href === window.origin + "/recent")
  6573. return;
  6574. if (href.includes("/notifications"))
  6575. return;
  6576. if (href === window.origin + "/script-setting") {
  6577. window.functions.clickAvatar(this.show ? ".post-wrapper " : "");
  6578. this.slide("setting", this.step++);
  6579. that.stopEvent(e2);
  6580. return;
  6581. }
  6582. if (id) {
  6583. that.clickPost(e2, id, href, title);
  6584. } else {
  6585. if (that.config.newTabOpen) {
  6586. that.stopEvent(e2);
  6587. functions.openNewTab(href);
  6588. }
  6589. }
  6590. },
  6591. stopEvent(e2) {
  6592. e2.preventDefault();
  6593. e2.stopPropagation();
  6594. },
  6595. saveReadList() {
  6596. if (this.config.rememberLastReadFloor) {
  6597. window.parse.saveReadList(this.readList);
  6598. }
  6599. },
  6600. async clickPost(e2, id, href, title = "") {
  6601. if (id) {
  6602. if (this.config.clickPostItemOpenDetail) {
  6603. this.stopEvent(e2);
  6604. let index = this.list.findIndex((v) => v.id == id);
  6605. let postItem = this.clone(window.initPost);
  6606. if (index > -1) {
  6607. postItem = this.list[index];
  6608. }
  6609. if (!postItem.title) {
  6610. postItem.title = title ?? "加载中";
  6611. }
  6612. postItem.inList = index > -1;
  6613. if (postItem.inList) {
  6614. if (postItem.replyCount > MAX_REPLY_LIMIT) {
  6615. return functions.openNewTab(`${location.origin}/t/${id}?p=1&script=1`);
  6616. }
  6617. }
  6618. postItem.id = id;
  6619. postItem.href = href;
  6620. if (!postItem.headerTemplate) {
  6621. let template = `
  6622. <div class="cell">
  6623. <div class="topic_content">
  6624. <div class="markdown_body">
  6625. ${(postItem == null ? void 0 : postItem.content_rendered) ?? ""}
  6626. </div>
  6627. </div>
  6628. </div>
  6629. `;
  6630. postItem.headerTemplate = template;
  6631. }
  6632. this.getPostDetail(postItem);
  6633. return;
  6634. }
  6635. if (this.config.newTabOpen) {
  6636. this.stopEvent(e2);
  6637. functions.openNewTab(`https://www.v2ex.com/t/${id}?p=1`);
  6638. }
  6639. }
  6640. },
  6641. showPost() {
  6642. $(".slide-list").css("transition", `0s`);
  6643. setTimeout(() => {
  6644. $(".slide-list").css("transition", `transform .3s`);
  6645. }, 500);
  6646. this.show = true;
  6647. $("#site-header").css("margin-top", "-42px");
  6648. $(`#Wrapper .box:lt(5)`).each(function() {
  6649. $(this).hide();
  6650. });
  6651. },
  6652. slide(to = "post", v) {
  6653. if (this.step === 1) {
  6654. if (to === "post") {
  6655. $(".post-wrapper").css("z-index", 10);
  6656. $(".setting-wrapper").css("z-index", 9);
  6657. } else {
  6658. $(".post-wrapper").css("z-index", 9);
  6659. $(".setting-wrapper").css("z-index", 10);
  6660. }
  6661. }
  6662. $(".slide-list").css("transform", `translateX(-${this.step * 100}vw)`);
  6663. },
  6664. async winCb({ type, value }) {
  6665. console.log("回调的类型", type, value);
  6666. if (type === "syncList") {
  6667. this.list = Object.assign(this.list, window.postList);
  6668. }
  6669. if (type === "syncData") {
  6670. this.list = window.postList;
  6671. this.config = window.config;
  6672. this.stopMe = window.stopMe;
  6673. this.tags = window.user.tags;
  6674. this.readList = window.user.readList;
  6675. this.current.read = this.readList[this.current.id] ?? {};
  6676. if (this.show && this.isPost && this.current.read.floor) {
  6677. this.$refs.postDetail.read = this.current.read;
  6678. }
  6679. }
  6680. if (type === "warningNotice") {
  6681. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: value });
  6682. }
  6683. if (this.stopMe)
  6684. return;
  6685. if (type === "restorePost") {
  6686. this.show = false;
  6687. this.loading = false;
  6688. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "脚本无法查看此页面!" });
  6689. $(`#Wrapper #Main .box:lt(3)`).each(function() {
  6690. $(this).show();
  6691. });
  6692. }
  6693. if (type === "postContent") {
  6694. this.current = Object.assign(this.current, value);
  6695. this.current.inList = true;
  6696. this.showPost();
  6697. }
  6698. if (type === "postReplies") {
  6699. this.current = Object.assign(this.current, value);
  6700. this.list.push(this.clone(this.current));
  6701. this.loading = false;
  6702. }
  6703. },
  6704. clone(val) {
  6705. return functions.clone(val);
  6706. },
  6707. regenerateReplyList() {
  6708. if (this.current.replyList.length) {
  6709. this.current.replyCount = this.current.replyList.length;
  6710. let res = functions.createNestedList(this.current.replyList);
  6711. if (res) {
  6712. this.current.nestedReplies = res;
  6713. }
  6714. let dup_res = functions.createNestedRedundantList(this.current.replyList);
  6715. if (dup_res) {
  6716. this.current.nestedRedundReplies = dup_res;
  6717. }
  6718. } else {
  6719. this.current.replyCount = 0;
  6720. this.current.nestedReplies = [];
  6721. this.current.nestedRedundReplies = [];
  6722. }
  6723. if (this.list.length) {
  6724. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  6725. if (rIndex > -1) {
  6726. this.list[rIndex] = this.clone(this.current);
  6727. }
  6728. }
  6729. },
  6730. initEvent() {
  6731. eventBus.on(CMD.CHANGE_COMMENT_THANK, (val) => {
  6732. console.log("CHANGE_COMMENT_THANK", val);
  6733. const { id, type } = val;
  6734. let currentI = this.current.replyList.findIndex((i) => i.id === id);
  6735. if (currentI > -1) {
  6736. this.current.replyList[currentI].isThanked = type === "add";
  6737. if (type === "add") {
  6738. this.current.replyList[currentI].thankCount++;
  6739. } else {
  6740. this.current.replyList[currentI].thankCount--;
  6741. }
  6742. this.regenerateReplyList();
  6743. }
  6744. });
  6745. eventBus.on(CMD.CHANGE_POST_THANK, (val) => {
  6746. const { id, type } = val;
  6747. this.current.isThanked = type === "add";
  6748. if (type === "add") {
  6749. this.current.thankCount++;
  6750. } else {
  6751. this.current.thankCount--;
  6752. }
  6753. let currentI = this.list.findIndex((i) => i.id === id);
  6754. if (currentI > -1) {
  6755. this.list[currentI].isThanked = type === "add";
  6756. if (type === "add") {
  6757. this.list[currentI].thankCount++;
  6758. } else {
  6759. this.list[currentI].thankCount++;
  6760. }
  6761. }
  6762. });
  6763. eventBus.on(CMD.REMOVE, (val) => {
  6764. let removeIndex = this.current.replyList.findIndex((i) => i.floor === val);
  6765. if (removeIndex > -1) {
  6766. this.current.replyList.splice(removeIndex, 1);
  6767. }
  6768. this.regenerateReplyList();
  6769. });
  6770. eventBus.on(CMD.IGNORE, () => {
  6771. this.show = false;
  6772. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  6773. if (rIndex > -1) {
  6774. this.list.splice(rIndex, 1);
  6775. }
  6776. let el = document.querySelector(`.id_${this.current.id}`);
  6777. if (el)
  6778. el.remove();
  6779. this.current = this.clone(window.initPost);
  6780. });
  6781. eventBus.on(CMD.MERGE, (val) => {
  6782. this.current = Object.assign(this.current, val);
  6783. let rIndex = this.list.findIndex((i) => i.id === this.current.id);
  6784. if (rIndex > -1) {
  6785. this.list[rIndex] = this.clone(this.current);
  6786. }
  6787. });
  6788. eventBus.on(CMD.MERGE_CONFIG, (val) => {
  6789. this.config = Object.assign(this.config, val);
  6790. });
  6791. eventBus.on(CMD.ADD_READ, (val) => {
  6792. this.readList[this.current.id] = val;
  6793. });
  6794. eventBus.on(CMD.ADD_REPLY, (item) => {
  6795. this.current.replyList.push(item);
  6796. this.regenerateReplyList();
  6797. });
  6798. eventBus.on(CMD.REFRESH_ONCE, async (once) => {
  6799. if (once) {
  6800. if (typeof once === "string") {
  6801. let res = once.match(/var once = "([\d]+)";/);
  6802. if (res && res[1]) {
  6803. this.current.once = Number(res[1]);
  6804. return;
  6805. }
  6806. }
  6807. if (typeof once === "number") {
  6808. this.current.once = once;
  6809. return;
  6810. }
  6811. }
  6812. window.fetchOnce().then((r2) => {
  6813. this.current.once = r2;
  6814. });
  6815. });
  6816. eventBus.on(CMD.REMOVE_TAG, async ({ username, tag }) => {
  6817. let oldTag = this.clone(this.tags);
  6818. let tags = this.tags[username] ?? [];
  6819. let rIndex = tags.findIndex((v) => v === tag);
  6820. if (rIndex > -1) {
  6821. tags.splice(rIndex, 1);
  6822. }
  6823. this.tags[username] = tags;
  6824. let res = await window.parse.saveTags(this.tags);
  6825. if (!res) {
  6826. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "标签删除失败!" });
  6827. this.tags = oldTag;
  6828. }
  6829. });
  6830. eventBus.on(CMD.REFRESH_POST, () => this.getPostDetail(this.current));
  6831. },
  6832. async getPostDetail(post) {
  6833. console.log("getPostDetail", this.clone(post));
  6834. this.current = post;
  6835. this.current.read = this.readList[this.current.id] ?? { floor: 0, total: 0 };
  6836. this.show = true;
  6837. if (!this.current.inList) {
  6838. this.loading = true;
  6839. let r2 = await functions.checkPostReplies(post.id, true);
  6840. if (r2) {
  6841. eventBus.emit(CMD.SHOW_MSG, { type: "warning", text: "由于回复数量较多,已为您单独打开此主题" });
  6842. this.loading = this.show = false;
  6843. return;
  6844. }
  6845. }
  6846. let url = window.baseUrl + "/t/" + post.id;
  6847. this.current.url = url;
  6848. let alreadyHasReply = this.current.replyList.length;
  6849. if (alreadyHasReply) {
  6850. this.refreshLoading = true;
  6851. this.$refs.postDetail.jumpLastRead(this.current.read.floor);
  6852. } else {
  6853. this.loading = true;
  6854. }
  6855. let apiRes = await window.fetch(url + "?p=1");
  6856. if (apiRes.status === 404) {
  6857. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "主题未找到" });
  6858. return this.refreshLoading = this.loading = false;
  6859. }
  6860. if (apiRes.status === 403) {
  6861. this.refreshLoading = this.show = this.loading = false;
  6862. functions.openNewTab(`${location.origin}/t/${post.id}?p=1&script=0`);
  6863. return;
  6864. }
  6865. if (apiRes.redirected) {
  6866. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "没有权限" });
  6867. return this.refreshLoading = this.loading = false;
  6868. }
  6869. let htmlText = await apiRes.text();
  6870. let hasPermission = htmlText.search("你要查看的页面需要先登录");
  6871. if (hasPermission > -1) {
  6872. eventBus.emit(CMD.SHOW_MSG, { type: "error", text: "你要查看的页面需要先登录" });
  6873. return this.refreshLoading = this.loading = false;
  6874. }
  6875. let bodyText = htmlText.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  6876. let body = $(bodyText[0]);
  6877. decodeEmail(body);
  6878. await window.parse.getPostDetail(this.current, body, htmlText);
  6879. let index = this.list.findIndex((v) => v.id == this.current.id);
  6880. if (index > -1) {
  6881. this.list[index] = this.clone(this.current);
  6882. } else {
  6883. this.list.push(this.clone(this.current));
  6884. }
  6885. this.refreshLoading = this.loading = false;
  6886. if (!alreadyHasReply) {
  6887. vue.nextTick(() => {
  6888. this.$refs.postDetail.jumpLastRead(this.current.read.floor);
  6889. });
  6890. }
  6891. await window.parse.parseOp(this.current);
  6892. console.log("当前帖子", this.current);
  6893. },
  6894. addTargetUserTag() {
  6895. eventBus.emit(CMD.ADD_TAG, window.targetUserName);
  6896. },
  6897. removeTargetUserTag(tag) {
  6898. eventBus.emit(CMD.REMOVE_TAG, { username: window.targetUserName, tag });
  6899. }
  6900. }
  6901. };
  6902. const _withScopeId = (n2) => (vue.pushScopeId("data-v-cf079729"), n2 = n2(), vue.popScopeId(), n2);
  6903. const _hoisted_1 = {
  6904. key: 0,
  6905. class: "target-user-tags p1"
  6906. };
  6907. const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "标签:", -1));
  6908. const _hoisted_3 = { class: "my-tag" };
  6909. const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "fa fa-tag" }, null, -1));
  6910. const _hoisted_5 = ["onClick"];
  6911. const _hoisted_6 = {
  6912. key: 1,
  6913. class: "my-box p2",
  6914. style: { "margin-top": "2rem" }
  6915. };
  6916. const _hoisted_7 = {
  6917. key: 0,
  6918. class: "flex flex-center"
  6919. };
  6920. const _hoisted_8 = {
  6921. key: 1,
  6922. class: "loaded"
  6923. };
  6924. const _hoisted_9 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("span", null, "楼中楼解析完成", -1));
  6925. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  6926. const _component_Setting = vue.resolveComponent("Setting");
  6927. const _component_PostDetail = vue.resolveComponent("PostDetail");
  6928. const _component_TagModal = vue.resolveComponent("TagModal");
  6929. const _component_Base64Tooltip = vue.resolveComponent("Base64Tooltip");
  6930. const _component_MsgModal = vue.resolveComponent("MsgModal");
  6931. vue.resolveComponent("NotificationModal");
  6932. const _component_BaseLoading = vue.resolveComponent("BaseLoading");
  6933. const _component_BaseButton = vue.resolveComponent("BaseButton");
  6934. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  6935. vue.createVNode(_component_Setting, {
  6936. modelValue: $data.config,
  6937. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.config = $event),
  6938. onBack: _cache[1] || (_cache[1] = ($event) => $options.slide("post", $data.step--)),
  6939. to: ".setting-wrapper"
  6940. }, null, 8, ["modelValue"]),
  6941. vue.createVNode(_component_Setting, {
  6942. modelValue: $data.config,
  6943. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.config = $event),
  6944. onBack: _cache[3] || (_cache[3] = ($event) => $options.slide("post", $data.step--)),
  6945. to: ".setting-wrapper2"
  6946. }, null, 8, ["modelValue"]),
  6947. vue.createVNode(_component_PostDetail, {
  6948. modelValue: $data.show,
  6949. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.show = $event),
  6950. ref: "postDetail",
  6951. displayType: $data.config.commentDisplayType,
  6952. "onUpdate:displayType": _cache[5] || (_cache[5] = ($event) => $data.config.commentDisplayType = $event),
  6953. onSaveReadList: $options.saveReadList,
  6954. onRefresh: _cache[6] || (_cache[6] = ($event) => $options.getPostDetail($data.current)),
  6955. loading: $data.loading,
  6956. refreshLoading: $data.refreshLoading
  6957. }, null, 8, ["modelValue", "displayType", "onSaveReadList", "loading", "refreshLoading"]),
  6958. vue.createVNode(_component_TagModal, {
  6959. tags: $data.tags,
  6960. "onUpdate:tags": _cache[7] || (_cache[7] = ($event) => $data.tags = $event)
  6961. }, null, 8, ["tags"]),
  6962. vue.createVNode(_component_Base64Tooltip),
  6963. vue.createVNode(_component_MsgModal),
  6964. vue.createCommentVNode("", true),
  6965. !$data.stopMe ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  6966. $options.isMember && $data.isLogin && $data.config.openTag ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
  6967. _hoisted_2,
  6968. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.targetUserTags, (i) => {
  6969. return vue.openBlock(), vue.createElementBlock("span", _hoisted_3, [
  6970. _hoisted_4,
  6971. vue.createElementVNode("span", null, vue.toDisplayString(i), 1),
  6972. vue.createElementVNode("i", {
  6973. class: "fa fa-trash-o remove",
  6974. onClick: ($event) => $options.removeTargetUserTag(i)
  6975. }, null, 8, _hoisted_5)
  6976. ]);
  6977. }), 256)),
  6978. vue.createElementVNode("span", {
  6979. class: "add-tag ago",
  6980. onClick: _cache[9] || (_cache[9] = (...args) => $options.addTargetUserTag && $options.addTargetUserTag(...args)),
  6981. title: "添加标签"
  6982. }, "+")
  6983. ])) : vue.createCommentVNode("", true),
  6984. $options.isPost && !$data.show ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
  6985. $data.loading ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
  6986. vue.createVNode(_component_BaseLoading)
  6987. ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
  6988. _hoisted_9,
  6989. vue.createVNode(_component_BaseButton, {
  6990. size: "small",
  6991. onClick: $options.showPost
  6992. }, {
  6993. default: vue.withCtx(() => [
  6994. vue.createTextVNode("点击显示")
  6995. ]),
  6996. _: 1
  6997. }, 8, ["onClick"])
  6998. ]))
  6999. ])) : vue.createCommentVNode("", true)
  7000. ], 64)) : vue.createCommentVNode("", true)
  7001. ], 64);
  7002. }
  7003. const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cf079729"]]);
  7004. let isMobile = !document.querySelector("#Rightbar");
  7005. let $section = document.createElement("section");
  7006. $section.id = "app";
  7007. function run() {
  7008. window.baseUrl = location.origin;
  7009. window.initPost = DefaultPost;
  7010. window.win = function() {
  7011. return window;
  7012. };
  7013. window.win().doc = window.win().document;
  7014. window.win().query = (v) => window.win().document.querySelector(v);
  7015. window.query = (v) => window.win().document.querySelector(v);
  7016. window.clone = (val) => JSON.parse(JSON.stringify(val));
  7017. window.user = DefaultUser;
  7018. window.targetUserName = "";
  7019. window.pageType = void 0;
  7020. window.pageData = { pageNo: 1 };
  7021. window.config = { ...DefaultConfig, ...{ viewType: "card" } };
  7022. window.const = {
  7023. git: "https://github.com/zyronon/v2ex-script",
  7024. issue: "https://github.com/zyronon/v2ex-script/issues"
  7025. };
  7026. window.currentVersion = 1;
  7027. window.isNight = $(".Night").length === 1;
  7028. window.cb = null;
  7029. window.stopMe = false;
  7030. window.postList = [];
  7031. window.parse = {
  7032. //解析帖子内容
  7033. async parsePostContent(post, body, htmlText) {
  7034. var _a, _b;
  7035. let once = htmlText.match(/var once = "([\d]+)";/);
  7036. if (once && once[1]) {
  7037. post.once = once[1];
  7038. }
  7039. post.isReport = htmlText.includes("你已对本主题进行了报告");
  7040. let wrapperClass = "Wrapper";
  7041. let wrapper;
  7042. let boxs;
  7043. if (body.length > 1) {
  7044. body.each(function() {
  7045. if (this.id === wrapperClass) {
  7046. wrapper = $(this);
  7047. boxs = this.querySelectorAll(".box");
  7048. }
  7049. });
  7050. } else {
  7051. wrapper = body;
  7052. boxs = body.find(`#${wrapperClass} .box`);
  7053. }
  7054. let box1 = $(boxs[0]);
  7055. let header1 = wrapper.find(".header");
  7056. if (!post.title || !post.content_rendered) {
  7057. let h1 = wrapper.find("h1");
  7058. if (h1) {
  7059. post.title = h1[0].innerText;
  7060. }
  7061. }
  7062. let as = wrapper.find(".header > a");
  7063. if (as.length) {
  7064. post.node.title = as[1].innerText;
  7065. post.node.url = as[1].href;
  7066. }
  7067. let aName = header1.find("small.gray a:nth-child(1)");
  7068. if (aName) {
  7069. post.member.username = aName[0].innerText;
  7070. }
  7071. let small = header1.find("small.gray");
  7072. if (small[0]) {
  7073. let spanEl = (_b = (_a = small[0]) == null ? void 0 : _a.lastChild) == null ? void 0 : _b.nodeValue;
  7074. if (spanEl) {
  7075. let dianIndex = spanEl.indexOf("·");
  7076. post.createDateAgo = spanEl.substring(4, dianIndex - 1);
  7077. let text = spanEl.substring(dianIndex + 1).trim();
  7078. let reg3 = text.matchAll(/([\d]+)[\s]*次点击/g);
  7079. let clickCountReg = [...reg3];
  7080. if (clickCountReg.length) {
  7081. post.clickCount = Number(clickCountReg[0][1]);
  7082. }
  7083. reg3 = text.matchAll(/([\d]+)[\s]*views/g);
  7084. clickCountReg = [...reg3];
  7085. if (clickCountReg.length) {
  7086. post.clickCount = Number(clickCountReg[0][1]);
  7087. }
  7088. }
  7089. }
  7090. let avatarEl = header1.find(".avatar");
  7091. if (avatarEl) {
  7092. post.member.avatar_large = avatarEl[0].src;
  7093. }
  7094. let topic_buttons = box1.find(".inner .fr");
  7095. if (topic_buttons.length) {
  7096. let favoriteNode = topic_buttons.find(".op:first");
  7097. if (favoriteNode.length) {
  7098. post.isFavorite = favoriteNode[0].innerText === "取消收藏";
  7099. }
  7100. let ignoreNode = topic_buttons.find(".tb");
  7101. if (ignoreNode.length) {
  7102. post.isIgnore = ignoreNode[0].innerText === "取消忽略";
  7103. }
  7104. let thankNode = topic_buttons.find(".topic_thanked");
  7105. if (thankNode.length) {
  7106. post.isThanked = true;
  7107. }
  7108. let span = topic_buttons.find("span");
  7109. if (span.length) {
  7110. let text = span[0].innerText;
  7111. let reg1 = text.matchAll(/([\d]+)[\s]*人收藏/g);
  7112. let collectCountReg = [...reg1];
  7113. if (collectCountReg.length) {
  7114. post.collectCount = Number(collectCountReg[0][1]);
  7115. }
  7116. reg1 = text.matchAll(/([\d]+)[\s]*likes/g);
  7117. collectCountReg = [...reg1];
  7118. if (collectCountReg.length) {
  7119. post.collectCount = Number(collectCountReg[0][1]);
  7120. }
  7121. }
  7122. }
  7123. let header = $(boxs[0]);
  7124. let temp = header.clone();
  7125. temp.find(".topic_buttons").remove();
  7126. temp.find(".inner").remove();
  7127. temp.find(".header").remove();
  7128. let html = temp.html();
  7129. html = functions.checkPhotoLink2Img(html);
  7130. post.headerTemplate = html;
  7131. return post;
  7132. },
  7133. //解析OP信息
  7134. async parseOp(post) {
  7135. if (!post.member.id) {
  7136. let userRes = await fetch(window.baseUrl + "/api/members/show.json?username=" + post.member.username);
  7137. if (userRes.status === 200) {
  7138. post.member = await userRes.json();
  7139. }
  7140. }
  7141. if (post.member.id) {
  7142. let date = new Date(post.member.created * 1e3);
  7143. let createStr = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
  7144. date.setHours(0);
  7145. date.setMinutes(0);
  7146. date.setSeconds(0);
  7147. date.setMilliseconds(0);
  7148. let now = /* @__PURE__ */ new Date();
  7149. now.setHours(0);
  7150. now.setMinutes(0);
  7151. now.setSeconds(0);
  7152. now.setMilliseconds(0);
  7153. let d2 = now.getTime() - date.getTime();
  7154. let isNew = d2 <= 1e3 * 60 * 60 * 24 * 7;
  7155. post.member.createDate = createStr + " 注册";
  7156. post.member.isNew = isNew;
  7157. } else {
  7158. post.member.createDate = "用户已被注销/封禁";
  7159. post.member.isNew = true;
  7160. }
  7161. return post;
  7162. },
  7163. //获取帖子所有回复
  7164. async getPostAllReplies(post, body, htmlText, pageNo = 1) {
  7165. var _a, _b;
  7166. if (body.find("#no-comments-yet").length) {
  7167. return post;
  7168. }
  7169. let wrapperClass = "Wrapper";
  7170. let boxs;
  7171. let box;
  7172. if (body.length > 1) {
  7173. body.each(function() {
  7174. if (this.id === wrapperClass) {
  7175. boxs = this.querySelectorAll(".box");
  7176. box = boxs[1];
  7177. }
  7178. });
  7179. } else {
  7180. boxs = body.find(`#${wrapperClass} .box`);
  7181. box = boxs[1];
  7182. }
  7183. let cells = box.querySelectorAll(".cell");
  7184. if (cells && cells.length) {
  7185. cells = Array.from(cells);
  7186. let snow = cells[0].querySelector(".snow");
  7187. post.createDate = ((_b = (_a = snow == null ? void 0 : snow.nextSibling) == null ? void 0 : _a.nodeValue) == null ? void 0 : _b.trim()) || "";
  7188. let repliesMap = [];
  7189. if (cells[1].id) {
  7190. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(1)) });
  7191. let replyList = functions.getAllReply(repliesMap);
  7192. post.replyList = replyList;
  7193. post.replyCount = replyList.length;
  7194. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  7195. let nestedList = functions.createNestedList(replyList);
  7196. let nestedRedundantList = functions.createNestedRedundantList(replyList);
  7197. if (nestedList)
  7198. post.nestedReplies = nestedList;
  7199. if (nestedRedundantList)
  7200. post.nestedRedundReplies = nestedRedundantList;
  7201. return post;
  7202. } else {
  7203. let promiseList = [];
  7204. return new Promise((resolve, reject) => {
  7205. repliesMap.push({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  7206. let pages = cells[1].querySelectorAll("a.page_normal");
  7207. pages = Array.from(pages);
  7208. let url = window.baseUrl + "/t/" + post.id;
  7209. for (let i = 0; i < pages.length; i++) {
  7210. let currentPageNo = Number(pages[i].innerText);
  7211. promiseList.push(this.fetchPostOtherPageReplies(url + "?p=" + currentPageNo, currentPageNo));
  7212. }
  7213. Promise.allSettled(promiseList).then(
  7214. (results) => {
  7215. results.filter((result) => result.status === "fulfilled").map((v) => repliesMap.push(v.value));
  7216. let replyList = functions.getAllReply(repliesMap);
  7217. post.replyList = replyList;
  7218. post.replyCount = replyList.length;
  7219. post.allReplyUsers = Array.from(new Set(replyList.map((v) => v.username)));
  7220. let nestedList = functions.createNestedList(replyList);
  7221. let nestedRedundantList = functions.createNestedRedundantList(replyList);
  7222. if (nestedList)
  7223. post.nestedReplies = nestedList;
  7224. if (nestedRedundantList)
  7225. post.nestedRedundReplies = nestedRedundantList;
  7226. resolve(post);
  7227. }
  7228. );
  7229. });
  7230. }
  7231. }
  7232. },
  7233. //请求帖子其他页的回复
  7234. fetchPostOtherPageReplies(href, pageNo) {
  7235. return new Promise((resolve) => {
  7236. $.get(href).then((res) => {
  7237. let s = res.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7238. let wrapperClass = "Wrapper";
  7239. let box;
  7240. $(s[0]).each(function() {
  7241. if (this.id === wrapperClass) {
  7242. box = this.querySelectorAll(".box")[2];
  7243. }
  7244. });
  7245. let cells = box.querySelectorAll(".cell");
  7246. cells = Array.from(cells);
  7247. resolve({ i: pageNo, replyList: this.parsePageReplies(cells.slice(2, cells.length - 1)) });
  7248. }).catch((r2) => {
  7249. if (r2.status === 403) {
  7250. functions.cbChecker({ type: "restorePost", value: null });
  7251. }
  7252. });
  7253. });
  7254. },
  7255. //解析页面的回复
  7256. parsePageReplies(nodes) {
  7257. let replyList = [];
  7258. nodes.forEach((node, index) => {
  7259. if (!node.id)
  7260. return;
  7261. let item = {
  7262. level: 0,
  7263. thankCount: 0,
  7264. isThanked: false,
  7265. isOp: false,
  7266. isDup: false,
  7267. id: node.id.replace("r_", "")
  7268. };
  7269. let reply_content = node.querySelector(".reply_content");
  7270. item.reply_content = functions.checkPhotoLink2Img(reply_content.innerHTML);
  7271. item.reply_text = reply_content.textContent;
  7272. let { users, floor } = this.parseReplyContent(item.reply_content);
  7273. item.hideCallUserReplyContent = item.reply_content;
  7274. if (users.length === 1) {
  7275. item.hideCallUserReplyContent = item.reply_content.replace(/@<a href="\/member\/[\s\S]+?<\/a>(\s#[\d]+)?\s(<br>)?/, () => "");
  7276. }
  7277. item.replyUsers = users;
  7278. item.replyFloor = floor;
  7279. let spans = node.querySelectorAll("span");
  7280. let ago = spans[1];
  7281. item.date = ago.textContent;
  7282. let userNode = node.querySelector("strong a");
  7283. item.username = userNode.textContent;
  7284. let avatar = node.querySelector("td img");
  7285. item.avatar = avatar.src;
  7286. let no = node.querySelector(".no");
  7287. item.floor = Number(no.textContent);
  7288. let thank_area = node.querySelector(".thank_area");
  7289. if (thank_area) {
  7290. item.isThanked = thank_area.classList.contains("thanked");
  7291. }
  7292. let small = spans[2];
  7293. if (small) {
  7294. item.thankCount = Number(small.textContent);
  7295. }
  7296. let op = node.querySelector(".op");
  7297. if (op) {
  7298. item.isOp = true;
  7299. }
  7300. let mod = node.querySelector(".mod");
  7301. if (mod) {
  7302. item.isMod = true;
  7303. }
  7304. replyList.push(item);
  7305. });
  7306. return replyList;
  7307. },
  7308. //解析回复内容,解析出@用户,回复楼层。用于后续生成嵌套楼层
  7309. parseReplyContent(str) {
  7310. if (!str)
  7311. return;
  7312. let users = [];
  7313. let getUsername = (userStr) => {
  7314. let endIndex = userStr.indexOf('">');
  7315. if (endIndex > -1) {
  7316. let user = userStr.substring(0, endIndex);
  7317. if (!users.find((i) => i === user)) {
  7318. users.push(user);
  7319. }
  7320. }
  7321. };
  7322. let userReg = /@<a href="\/member\/([\s\S]+?)<\/a>/g;
  7323. let has = str.matchAll(userReg);
  7324. let res2 = [...has];
  7325. if (res2.length > 1) {
  7326. res2.map((item) => {
  7327. getUsername(item[1]);
  7328. });
  7329. }
  7330. if (res2.length === 1) {
  7331. getUsername(res2[0][1]);
  7332. }
  7333. let floor = -1;
  7334. if (users.length === 1) {
  7335. let floorReg = /@<a href="\/member\/[\s\S]+?<\/a>[\s]+#([\d]+)/g;
  7336. let hasFloor = str.matchAll(floorReg);
  7337. let res = [...hasFloor];
  7338. if (res.length) {
  7339. floor = Number(res[0][1]);
  7340. }
  7341. }
  7342. return { users, floor };
  7343. },
  7344. //获取帖子详情
  7345. async getPostDetail(post, body, htmlText, pageNo = 1) {
  7346. post = await this.parsePostContent(post, body, htmlText);
  7347. return await this.getPostAllReplies(post, body, htmlText, pageNo);
  7348. },
  7349. //解析页面帖子列表
  7350. parsePagePostList(list, box) {
  7351. list.forEach((itemDom) => {
  7352. let item = window.clone(window.initPost);
  7353. let item_title = itemDom.querySelector(".item_title");
  7354. itemDom.classList.add("post-item");
  7355. if (!item_title)
  7356. return;
  7357. let a = item_title.querySelector("a");
  7358. let { href, id } = functions.parseA(a);
  7359. item.id = Number(id);
  7360. a.href = item.href = href;
  7361. item.url = location.origin + "/api/topics/show.json?id=" + item.id;
  7362. itemDom.classList.add(`id_${id}`);
  7363. itemDom.dataset["href"] = href;
  7364. itemDom.dataset["id"] = id;
  7365. window.postList.push(item);
  7366. if (![PageType.Member].includes(window.pageType)) {
  7367. let headerWrap = $(`
  7368. <div class="new-item">
  7369. <div class="left">
  7370. <div class="top">
  7371. <div class="r">
  7372. <div class="small fade"></div>
  7373. <div class="small fade"></div>
  7374. </div>
  7375. </div>
  7376. <div class="bottom"></div>
  7377. </div>
  7378. <div class="right"></div>
  7379. </div>`);
  7380. headerWrap.find(".bottom").append(item_title);
  7381. headerWrap.find(".right").append(itemDom.querySelector(".count_livid"));
  7382. headerWrap.find(".top").prepend(itemDom.querySelector("td:first-child a"));
  7383. let info = itemDom.querySelector("td:nth-child(3)");
  7384. if (window.pageType === PageType.Node)
  7385. ;
  7386. if ([PageType.Changes, PageType.Home].includes(window.pageType)) {
  7387. let s1 = info.querySelector("span:first-child");
  7388. let t = headerWrap.find(".top .r div:first");
  7389. t.append(s1.querySelector("strong"));
  7390. t.append(` `);
  7391. t.append(s1.querySelector("a"));
  7392. }
  7393. let b = headerWrap.find(".top .r div:last");
  7394. b.append(info.querySelector("span:last-child").innerHTML);
  7395. itemDom.append(headerWrap[0]);
  7396. itemDom.querySelector("table").remove();
  7397. }
  7398. });
  7399. const setF = (res) => {
  7400. var _a;
  7401. let rIndex = window.postList.findIndex((w) => w.id === res.id);
  7402. if (rIndex > -1) {
  7403. window.postList[rIndex] = Object.assign(window.postList[rIndex], res);
  7404. }
  7405. let itemDom = box.querySelector(`.id_${res.id}`);
  7406. itemDom.classList.add("preview");
  7407. if (res.content_rendered) {
  7408. let a = document.createElement("a");
  7409. a.href = res.href;
  7410. a.classList.add("post-content");
  7411. let div = document.createElement("div");
  7412. div.innerHTML = res.content_rendered;
  7413. a.append(div);
  7414. itemDom.append(a);
  7415. if (div.clientHeight < 300) {
  7416. a.classList.add("show-all");
  7417. } else {
  7418. let showMore = document.createElement("div");
  7419. showMore.classList.add("show-more");
  7420. showMore.innerHTML = "显示更多/收起";
  7421. showMore.onclick = function(e2) {
  7422. e2.stopPropagation();
  7423. a.classList.toggle("show-all");
  7424. };
  7425. (_a = a.parentNode) == null ? void 0 : _a.append(showMore);
  7426. }
  7427. }
  7428. functions.cbChecker({ type: "syncList" });
  7429. };
  7430. if (window.config.viewType === "card") {
  7431. let cacheDataStr = localStorage.getItem("cacheData");
  7432. let cacheData = [];
  7433. if (cacheDataStr) {
  7434. cacheData = JSON.parse(cacheDataStr);
  7435. let now = Date.now();
  7436. cacheData = cacheData.filter((v) => {
  7437. return v.created > now / 1e3 - 60 * 60 * 24 * 3;
  7438. });
  7439. }
  7440. let fetchIndex = 0;
  7441. for (let i = 0; i < window.postList.length; i++) {
  7442. let item = window.postList[i];
  7443. let rItem = cacheData.find((w) => w.id === item.id);
  7444. if (rItem) {
  7445. rItem.href = item.href;
  7446. setF(rItem);
  7447. } else {
  7448. fetchIndex++;
  7449. setTimeout(() => {
  7450. $.get(item.url).then((v) => {
  7451. let res = v[0];
  7452. res.href = item.href;
  7453. cacheData.push(res);
  7454. localStorage.setItem("cacheData", JSON.stringify(cacheData));
  7455. setF(res);
  7456. });
  7457. }, fetchIndex < 4 ? 0 : (fetchIndex - 4) * 1e3);
  7458. }
  7459. }
  7460. } else {
  7461. functions.cbChecker({ type: "syncData" });
  7462. }
  7463. },
  7464. //创建记事本子条目
  7465. async createNoteItem(itemName) {
  7466. return;
  7467. },
  7468. //编辑记事本子条目
  7469. async editNoteItem(val, id) {
  7470. return;
  7471. },
  7472. //标签操作
  7473. async saveTags(val) {
  7474. return;
  7475. },
  7476. //已读楼层操作
  7477. async saveReadList(val) {
  7478. return;
  7479. },
  7480. //imgur图片删除hash操作
  7481. async saveImgurList(val) {
  7482. return;
  7483. }
  7484. };
  7485. window.vals = {};
  7486. window.functions = {
  7487. clickAvatar(prex) {
  7488. let menu = $(`${prex}#menu-body`);
  7489. if (menu.css("--show-dropdown") === "block") {
  7490. menu.css("--show-dropdown", "none");
  7491. } else {
  7492. menu.css("--show-dropdown", "block");
  7493. }
  7494. }
  7495. };
  7496. function initStyle() {
  7497. let style2 = `
  7498. }
  7499. `;
  7500. let addStyle2 = document.createElement("style");
  7501. addStyle2.rel = "stylesheet";
  7502. addStyle2.type = "text/css";
  7503. addStyle2.innerHTML = style2;
  7504. window.document.head.append(addStyle2);
  7505. }
  7506. function qianDao() {
  7507. let timeNow = (/* @__PURE__ */ new Date()).getUTCFullYear() + "/" + ((/* @__PURE__ */ new Date()).getUTCMonth() + 1) + "/" + (/* @__PURE__ */ new Date()).getUTCDate();
  7508. if (window.pageType === PageType.Home) {
  7509. let qiandao = window.query('.box .inner a[href="/mission/daily"]');
  7510. if (qiandao) {
  7511. qianDao_(qiandao, timeNow);
  7512. } else if (window.win().doc.getElementById("gift_v2excellent")) {
  7513. window.win().doc.getElementById("gift_v2excellent").click();
  7514. localStorage.setItem("menu_clockInTime", timeNow);
  7515. console.info("[V2EX - 超级增强] 自动签到完成!");
  7516. } else {
  7517. console.info("[V2EX - 超级增强] 自动签到完成!");
  7518. }
  7519. } else {
  7520. let timeOld = localStorage.getItem("menu_clockInTime");
  7521. if (!timeOld || timeOld != timeNow) {
  7522. qianDaoStatus_(timeNow);
  7523. } else {
  7524. console.info("[V2EX - 超级增强] 自动签到完成!");
  7525. }
  7526. }
  7527. }
  7528. function qianDao_(qiandao, timeNow) {
  7529. let url = window.baseUrl + "/mission/daily/redeem?" + RegExp("once\\=(\\d+)").exec(document.querySelector("div#Top .tools, #menu-body").innerHTML)[0];
  7530. console.log("url", url);
  7531. $.get(url).then((r2) => {
  7532. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7533. let html = $(bodyText[0]);
  7534. if (html.find("li.fa.fa-ok-sign").length) {
  7535. html = html.find("#Main").text().match(/已连续登录 (\d+?) 天/)[0];
  7536. localStorage.setItem("menu_clockInTime", timeNow);
  7537. console.info("[V2EX - 超级增强] 自动签到完成!");
  7538. if (qiandao) {
  7539. qiandao.textContent = `自动签到完成!${html}`;
  7540. qiandao.href = "javascript:void(0);";
  7541. }
  7542. } else {
  7543. _GM_notification({
  7544. text: "自动签到失败!请关闭其他插件或脚本。\n如果连续几天都签到失败,请联系作者解决!",
  7545. timeout: 4e3,
  7546. onclick() {
  7547. functions.feedback();
  7548. }
  7549. });
  7550. console.warn("[V2EX 增强] 自动签到失败!请关闭其他插件或脚本。如果连续几天都签到失败,请联系作者解决!");
  7551. if (qiandao)
  7552. qiandao.textContent = "自动签到失败!请尝试手动签到!";
  7553. }
  7554. });
  7555. }
  7556. function qianDaoStatus_(timeNow) {
  7557. $.get(window.baseUrl + "/mission/daily").then((r2) => {
  7558. let bodyText = r2.match(/<body[^>]*>([\s\S]+?)<\/body>/g);
  7559. let html = $(bodyText[0]);
  7560. if (html.find('input[value^="领取"]').length) {
  7561. qianDao_(null, timeNow);
  7562. } else {
  7563. console.info("[V2EX 增强] 已经签过到了。");
  7564. localStorage.setItem("menu_clockInTime", timeNow);
  7565. }
  7566. });
  7567. }
  7568. async function initNoteData() {
  7569. return;
  7570. }
  7571. function initConfig() {
  7572. return new Promise((resolve) => {
  7573. let configStr = localStorage.getItem("v2ex-config");
  7574. if (configStr) {
  7575. let configObj = JSON.parse(configStr);
  7576. configObj = configObj[window.user.username ?? "default"];
  7577. if (configObj) {
  7578. window.config = Object.assign(window.config, configObj);
  7579. }
  7580. }
  7581. resolve(window.config);
  7582. });
  7583. }
  7584. function addSettingText() {
  7585. let setting = $(`<a href="/script-setting" class="top">脚本管理</a>`);
  7586. $("#menu-body .cell:first").append(setting);
  7587. }
  7588. async function init() {
  7589. window.addEventListener("error", (e2) => {
  7590. let dom = e2.target;
  7591. let originImgUrl = dom.getAttribute("data-originurl");
  7592. if (originImgUrl) {
  7593. let a = document.createElement("a");
  7594. a.href = originImgUrl;
  7595. a.setAttribute("notice", "此标签由v2ex超级增强脚本转换图片失败后恢复");
  7596. a.innerText = originImgUrl;
  7597. dom.parentNode.replaceChild(a, dom);
  7598. }
  7599. }, true);
  7600. if (window.isNight) {
  7601. document.documentElement.classList.add("dark");
  7602. }
  7603. let { pageData, pageType } = functions.checkPageType();
  7604. window.pageType = pageType;
  7605. window.pageData = pageData;
  7606. addSettingText();
  7607. functions.initMonkeyMenu();
  7608. let s = $(`
  7609. <div class="slide">
  7610. <div class="slide-list">
  7611. <div class="slide-item page0"></div>
  7612. <div class="slide-item page1">
  7613. <div class="post-wrapper"></div>
  7614. <div class="setting-wrapper"></div>
  7615. </div>
  7616. <div class="slide-item page2">
  7617. <div class="setting-wrapper2"></div>
  7618. </div>
  7619. </div>
  7620. </div>`);
  7621. $("body").append(s);
  7622. $("body").children().slice(0, 4).each(function() {
  7623. $(".page0").append(this);
  7624. });
  7625. $(".post-wrapper").append($("#site-header").clone());
  7626. let top2 = $("#menu-body .cell:first .top:first");
  7627. if (top2.length && ["个人主页", "Profile"].includes(top2.text())) {
  7628. window.user.username = top2.attr("href").replace("/member/", "");
  7629. window.user.avatar = $("#menu-entry .avatar").attr("src");
  7630. }
  7631. initConfig().then(async (r2) => {
  7632. initStyle();
  7633. try {
  7634. if (window.config.autoSignin && window.user.username) {
  7635. qianDao();
  7636. }
  7637. } catch (e2) {
  7638. console.log("签到失败");
  7639. }
  7640. if (window.user.username) {
  7641. initNoteData();
  7642. }
  7643. let box;
  7644. let list;
  7645. let first;
  7646. let last;
  7647. switch (window.pageType) {
  7648. case PageType.Node:
  7649. box = document.querySelectorAll("#Wrapper .box");
  7650. box[1].style.background = "unset";
  7651. box[1].style.borderBottom = "none";
  7652. box[1].style["border-radius"] = "0";
  7653. box[1].style["box-shadow"] = "none";
  7654. first = $(box[1]).children().first();
  7655. first.addClass("cell post-item");
  7656. if (window.config.viewType === "card")
  7657. first[0].classList.add("preview");
  7658. last = $(box[1]).children().last();
  7659. last.addClass("cell post-item");
  7660. if (window.config.viewType === "card")
  7661. last[0].classList.add("preview");
  7662. list = box[1].querySelectorAll(".cell");
  7663. box[0].before($section);
  7664. window.parse.parsePagePostList(list, box[1]);
  7665. break;
  7666. case PageType.Home:
  7667. box = document.querySelector("#Wrapper .box");
  7668. let headerWrap = $('<div class="cell post-item"></div>');
  7669. if (window.config.viewType === "card")
  7670. headerWrap[0].classList.add("preview");
  7671. $(box).prepend(headerWrap);
  7672. $(box).children().slice(1, 3).each(function() {
  7673. headerWrap.append(this);
  7674. });
  7675. last = $(box).children().last();
  7676. last.addClass("cell post-item");
  7677. if (window.config.viewType === "card")
  7678. last[0].classList.add("preview");
  7679. box.style.background = "unset";
  7680. box.style["border-radius"] = "0";
  7681. box.style["box-shadow"] = "none";
  7682. list = box.querySelectorAll(".item");
  7683. list[0].before($section);
  7684. window.parse.parsePagePostList(list, box);
  7685. break;
  7686. case PageType.Changes:
  7687. box = document.querySelector("#Wrapper .box");
  7688. box.style.background = "unset";
  7689. box.style["border-radius"] = "0";
  7690. box.style["box-shadow"] = "none";
  7691. first = $(box).children().first();
  7692. first.addClass("cell post-item");
  7693. if (window.config.viewType === "card")
  7694. first[0].classList.add("preview");
  7695. last = $(box).children().last();
  7696. last.addClass("cell post-item");
  7697. if (window.config.viewType === "card")
  7698. last[0].classList.add("preview");
  7699. list = box.querySelectorAll(".item");
  7700. list[0].before($section);
  7701. window.parse.parsePagePostList(list, box);
  7702. break;
  7703. case PageType.Post:
  7704. box = document.querySelector("#Wrapper .box");
  7705. box.after($section);
  7706. let r22 = await functions.checkPostReplies(window.pageData.id, false);
  7707. if (r22) {
  7708. window.stopMe = true;
  7709. functions.cbChecker({ type: "syncData" });
  7710. functions.cbChecker({ type: "warningNotice", value: "由于回复数量较多,脚本已停止解析楼中楼" });
  7711. return;
  7712. }
  7713. let post = functions.clone(window.initPost);
  7714. post.id = window.pageData.id;
  7715. let body = $(document.body);
  7716. let htmlText = document.documentElement.outerHTML;
  7717. window.parse.parsePostContent(
  7718. post,
  7719. body,
  7720. htmlText
  7721. ).then(async (res) => {
  7722. await functions.cbChecker({ type: "postContent", value: res });
  7723. await window.parse.parseOp(res);
  7724. });
  7725. window.parse.getPostAllReplies(
  7726. post,
  7727. body,
  7728. htmlText,
  7729. window.pageData.pageNo
  7730. ).then(async (res1) => {
  7731. await functions.cbChecker({ type: "postReplies", value: res1 });
  7732. });
  7733. break;
  7734. case PageType.Member:
  7735. box = document.querySelectorAll("#Wrapper .box");
  7736. window.targetUserName = box[0].querySelector("h1").textContent;
  7737. if (window.config.openTag) {
  7738. box[0].style.borderBottom = "none";
  7739. box[0].style["border-bottom-left-radius"] = "0";
  7740. box[0].style["border-bottom-right-radius"] = "0";
  7741. }
  7742. list = box[2].querySelectorAll(".cell");
  7743. box[0].after($section);
  7744. window.parse.parsePagePostList(list, box[2]);
  7745. break;
  7746. default:
  7747. window.stopMe = true;
  7748. functions.cbChecker({ type: "syncData" });
  7749. console.error("未知页面");
  7750. break;
  7751. }
  7752. });
  7753. }
  7754. window.canParseV2exPage = !window.location.search.includes("script");
  7755. if (window.canParseV2exPage) {
  7756. init();
  7757. } else {
  7758. let box = document.querySelector("#Wrapper #Main .box");
  7759. box.after($section);
  7760. window.stopMe = true;
  7761. functions.cbChecker({ type: "syncData" });
  7762. if (window.location.search.includes("script=0")) {
  7763. functions.cbChecker({ type: "warningNotice", value: "脚本无法查看此主题,已为您单独打开此主题" });
  7764. }
  7765. if (window.location.search.includes("script=1")) {
  7766. functions.cbChecker({ type: "warningNotice", value: "由于回复数量较多,已为您单独打开此主题并停止解析楼中楼" });
  7767. }
  7768. }
  7769. }
  7770. if (isMobile) {
  7771. (e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const o=document.createElement("style");o.textContent=e,document.head.append(o)})(' .tip[data-v-ee672411]{position:fixed;font-size:1.6rem;z-index:9999;max-width:10rem;border-radius:.5rem;padding:1rem;color:var(--color-font-8);background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow)}.v-enter-active[data-v-e7c0fbef],.v-leave-active[data-v-e7c0fbef]{transition:opacity .3s ease}.v-enter-from[data-v-e7c0fbef],.v-leave-to[data-v-e7c0fbef]{opacity:0}.fade-in[data-v-e7c0fbef]{animation:fade-in-e7c0fbef .3s}.fade-out[data-v-e7c0fbef]{animation:fade-out-e7c0fbef .4s}@keyframes fade-in-e7c0fbef{0%{opacity:0}to{opacity:1}}@keyframes fade-out-e7c0fbef{0%{opacity:1}to{opacity:0;display:none}}.username[data-v-e7c0fbef]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-e7c0fbef]{font-size:1.4rem;color:#e02a2a}.owner[data-v-e7c0fbef]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-e7c0fbef]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-e7c0fbef]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag .remove[data-v-e7c0fbef]{margin-left:.5rem;display:none}.add-tag[data-v-e7c0fbef]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;position:absolute;display:none}.floor[data-v-e7c0fbef]{font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;color:var(--color-floor-font);cursor:default;margin-right:1rem}.base-avatar[data-v-e7c0fbef]{margin-right:1rem;display:inline-flex}.base-avatar img[data-v-e7c0fbef]{width:2.8rem;height:2.8rem;border-radius:.4rem}html[data-v-e7c0fbef]{font-size:10px}[data-v-e7c0fbef]:root{--box-border-radius: 8px}#site-header[data-v-e7c0fbef]{height:4rem}#site-header #site-header-menu #menu-body[data-v-e7c0fbef]{top:5rem;right:1rem}#Wrapper .cell .count_livid[data-v-e7c0fbef]{font-size:14px;font-weight:700;padding:3px 10px;border-radius:5px}a[data-v-e7c0fbef]{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-user-select:none;-moz-user-focus:none;-moz-user-select:none}.post-item[data-v-e7c0fbef]{background:var(--box-background-color)}.post-item .new-item[data-v-e7c0fbef]{display:flex;justify-content:space-between}.post-item .new-item .left .top[data-v-e7c0fbef]{display:flex;align-items:center;line-height:1.2;gap:1rem}.post-item .new-item .left .small[data-v-e7c0fbef],.post-item .new-item .left a.node[data-v-e7c0fbef]{font-size:1.2rem}.post-item .new-item .left .bottom[data-v-e7c0fbef]{margin:1rem 0 .5rem}.post-item .new-item .left .bottom .item_title[data-v-e7c0fbef]{font-size:1.6rem}.post-item .new-item .left .bottom a[data-v-e7c0fbef]{text-decoration:none!important}.post-item .new-item .right[data-v-e7c0fbef]{min-width:5rem;display:flex;justify-content:flex-end;align-items:center}.post-item .new-item .right .count_livid[data-v-e7c0fbef]{font-size:1.4rem!important;margin-right:0;padding:.3rem 1rem!important;border-radius:.5rem!important}.post-item .post-content[data-v-e7c0fbef]{display:block;max-height:30rem;overflow:hidden;line-break:anywhere;-webkit-mask-image:linear-gradient(180deg,#000 60%,transparent);height:0;color:#000;text-decoration:none!important}.post-item .post-content blockquote[data-v-e7c0fbef]{margin-top:.5rem}.post-item .post-content p[data-v-e7c0fbef]:first-child{margin-top:0}.post-item .post-content[data-v-e7c0fbef]:visited{color:var(--link-visited-color)}.post-item .show-more[data-v-e7c0fbef]{font-size:1.3rem;text-align:right;height:3rem;align-items:center;justify-content:center;position:relative;z-index:9;display:none}.preview[data-v-e7c0fbef]{margin-bottom:.7rem;border-radius:var(--box-border-radius)}.preview .topic-link[data-v-e7c0fbef]:link{color:#000!important}.preview .show-all[data-v-e7c0fbef]{max-height:unset;-webkit-mask-image:none}.preview .post-content[data-v-e7c0fbef]{height:unset!important}.preview .show-more[data-v-e7c0fbef]{display:flex}.preview .item_title[data-v-e7c0fbef]{font-weight:700}.Night .post-item[data-v-e7c0fbef]{background:#18222d!important}.Night .preview[data-v-e7c0fbef]{border:1px solid #3b536e}.Night .preview>.post-content[data-v-e7c0fbef]:link{color:#d1d5d9}.Night .preview>.post-content[data-v-e7c0fbef]:visited{color:#393f4e!important}.Night .preview .topic-link[data-v-e7c0fbef]:link{color:#c0dbff!important}[data-v-e7c0fbef]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-four-bg: #e7e9eb;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-line2: #cecece;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--space: 1rem}html.dark[data-v-e7c0fbef]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-four-bg: #22303f;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}.flex[data-v-e7c0fbef]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-e7c0fbef]{justify-content:flex-end}.flex-center[data-v-e7c0fbef]{justify-content:center}.p1[data-v-e7c0fbef]{padding:1rem}.p2[data-v-e7c0fbef]{padding:2rem}.p0[data-v-e7c0fbef]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-e7c0fbef]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a[data-v-e7c0fbef]{text-decoration:none}.tool[data-v-e7c0fbef]{position:relative;display:flex;align-items:center;border-radius:.3rem;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg[data-v-e7c0fbef]{width:2.2rem!important;height:2.2rem!important}.tool.disabled[data-v-e7c0fbef]{cursor:not-allowed}.tool span[data-v-e7c0fbef]{line-height:1rem}.my-node[data-v-e7c0fbef]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5}.msgs[data-v-e7c0fbef]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-e7c0fbef]{background:var(--box-background-color);margin-bottom:.5rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-box .box-content[data-v-e7c0fbef]{padding:.5rem}.my-cell[data-v-e7c0fbef]{color:var(--color-font);height:4.2rem;padding:0 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-e7c0fbef]{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-e7c0fbef]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-e7c0fbef]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-e7c0fbef]{position:relative}.radio-group2[data-v-e7c0fbef]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-e7c0fbef]{background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-e7c0fbef]:first-child{border-left:none}.radio-group2 .active[data-v-e7c0fbef]{background:var(--color-active);color:#fff}.pop-confirm[data-v-e7c0fbef]{position:relative;display:inline-flex;justify-content:center}input[data-v-e7c0fbef]{width:10rem;height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-e7c0fbef]:focus{border:1px solid var(--color-active)}.danger[data-v-e7c0fbef]{color:red!important}.topic_content[data-v-e7c0fbef],.reply_content[data-v-e7c0fbef]{font-size:1.6rem}.mask[data-v-e7c0fbef]{z-index:10;position:fixed;top:0;width:100vw;height:100vh;background:#000000bb}.mask.dark[data-v-e7c0fbef]{background:#000000bb}.mask.light[data-v-e7c0fbef]{background:transparent}.mask.lightgray[data-v-e7c0fbef]{background:rgba(0,0,0,.25)}.mask.white[data-v-e7c0fbef]{background:transparent}.slide[data-v-e7c0fbef]{flex:1;width:100vw;height:100vh;transition:height .3s;position:relative;overflow:hidden}.slide .slide-list[data-v-e7c0fbef]{height:100%;width:100%;display:flex;position:relative;transition:transform .3s}.slide .slide-list .slide-item[data-v-e7c0fbef]{height:100%;width:100%;flex-shrink:0;position:relative;overflow:auto}.page1[data-v-e7c0fbef]{overflow:hidden!important}.post-wrapper[data-v-e7c0fbef],.setting-wrapper[data-v-e7c0fbef]{position:absolute;left:0;top:0;height:100%;width:100%;background:var(--color-main-bg);overflow:auto}.setting-wrapper[data-v-e7c0fbef],.setting-wrapper2[data-v-e7c0fbef]{height:100%;overflow:hidden;background:var(--color-second-bg)}.mobile-page[data-v-e7c0fbef]{height:100%;overflow:hidden;font-size:1.8rem;display:flex;flex-direction:column}.mobile-page>.page-content[data-v-e7c0fbef]{padding:1rem;padding-top:0;box-sizing:border-box;overflow:auto}.switch[data-v-e7c0fbef]{width:4.5rem;height:2.2rem;border-radius:2rem;position:relative;display:flex;align-items:center;background:var(--color-swtich-bg);transition:all .3s}.switch.active[data-v-e7c0fbef]{background:var(--color-active)}.switch.active[data-v-e7c0fbef]:before{right:.2rem}.switch[data-v-e7c0fbef]:before{position:absolute;content:" ";transition:all .3s;right:calc(100% - 2rem);width:1.8rem;height:1.8rem;background:white;border-radius:50%}.nav-bar[data-v-fda0acaa]{box-sizing:border-box;width:100%;height:5rem;padding:0 var(--space);display:flex;align-items:center;justify-content:center;position:relative;font-size:2rem;color:var(--color-font-pure)}.nav-bar[data-v-fda0acaa] .back-icon{left:var(--space);position:absolute}.display-type[data-v-1d327f48]{height:3rem;padding:0 .3rem;background:var(--color-main-bg);border-radius:1rem;display:flex;font-size:1.4rem;align-items:center;color:#a9a9a9}.display-type .type[data-v-1d327f48]{border-radius:.8rem;padding:0 1.3rem;height:2.5rem;align-items:center;display:flex;position:relative}.display-type .type.active[data-v-1d327f48]{background:var(--color-second-bg);color:var(--color-font-pure);box-shadow:0 0 6px 0 var(--color-tooltip-shadow)}.display-type .type-list[data-v-1d327f48]{position:absolute;background:white;right:0;top:3rem;font-size:1.4rem;box-shadow:0 0 6px 0 var(--color-tooltip-shadow);border-radius:.6rem;z-index:9;color:var(--color-font)}.display-type .type-list .item[data-v-1d327f48]{word-break:keep-all;padding:.8rem 1rem}.display-type .type-list .item.active[data-v-1d327f48]{color:var(--color-font-pure)}.display-type svg[data-v-1d327f48]{width:1.5rem}.font-size[data-v-a64ba8b8]{margin-bottom:3rem;display:flex;flex-direction:column;align-items:center;justify-content:center}.font-size .steps[data-v-a64ba8b8]{width:100%;border-radius:10rpx;display:flex;justify-content:space-between;align-items:center;position:relative;z-index:2}.font-size .steps .step[data-v-a64ba8b8]{width:100%;font-size:20rpx;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:4.8rem;gap:1.5rem;color:gray}.font-size .steps .step .text[data-v-a64ba8b8]{font-size:1.4rem}.font-size .steps .step .point[data-v-a64ba8b8]{border-radius:50%;min-width:6px;min-height:6px;background:#adadad}.font-size .steps .step.active[data-v-a64ba8b8]{color:var(--color-font-pure)}.font-size .steps .step.active .point[data-v-a64ba8b8]{box-shadow:0 0 1px 1px #f1f1f1;background:white;transform:scale(3)}.font-size .line[data-v-a64ba8b8]{position:relative;z-index:1;margin-top:-4px;height:2px;width:76%;background:var(--color-font)}.row[data-v-424a2b09]{min-height:4rem;display:flex;justify-content:space-between;align-items:center;color:var(--color-font-8)}.row .wrapper[data-v-424a2b09]{height:3rem;flex:1;display:flex;justify-content:flex-end;align-items:center;gap:var(--space)}.row .main-title[data-v-424a2b09]{font-size:2.2rem;font-weight:700}.row .item-title[data-v-424a2b09]{font-size:1.8rem}.desc[data-v-424a2b09]{margin-bottom:1rem;font-size:1.4rem;text-align:left;color:var(--color-font)}.tool>svg[data-v-b7c6664e]{width:1.8rem!important;height:1.8rem!important}.more[data-v-e92e0529]{height:1.6rem;width:2.08rem;padding:1rem .8rem 1rem 0;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end}.more div[data-v-e92e0529]{background:var(--color-floor-font);width:.3rem;height:.3rem;border-radius:50%}.Author[data-v-9041586a]{display:flex;align-items:center;justify-content:space-between;font-size:1.2rem;position:relative}.Author.expand[data-v-9041586a]{margin-bottom:0}.Author .Author-left[data-v-9041586a]{display:flex;align-items:center;width:80%;word-break:break-all}.Author .Author-left .info[data-v-9041586a]{display:flex;flex-direction:column}.Author .Author-left .username[data-v-9041586a]{font-size:1.4rem;margin-right:1rem}.Author .Author-left .expand-icon[data-v-9041586a]{margin-right:.8rem;width:2.4rem;height:2.4rem;transform:rotate(90deg)}.Author .Author-left .texts[data-v-9041586a]{flex:1}.Author .Author-left .owner[data-v-9041586a]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.Author .Author-left .dup[data-v-9041586a]{display:inline-block;background-color:transparent;color:red;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid red;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.Author .Author-left .mod[data-v-9041586a]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.Author .Author-right[data-v-9041586a]{position:absolute;right:0;display:flex;align-items:center}.loading[data-v-2697baa2]{border:2px solid;border-color:var(--color-loading-2) var(--color-loading-1) var(--color-loading-1) var(--color-loading-1);border-radius:100%;animation:circle-2697baa2 infinite 1s linear;width:2rem;height:2rem}.loading.small[data-v-2697baa2]{width:1.2rem;height:1.2rem}.loading.large[data-v-2697baa2]{width:3rem;height:3rem}@keyframes circle-2697baa2{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.base-button[data-v-04f4c89d]{border-radius:.6rem;padding:0 1.5rem;display:inline-flex;align-items:center;justify-content:center;transition:all .3s;height:3.6rem;line-height:1;position:relative}.base-button .loading[data-v-04f4c89d]{position:absolute}.base-button.disabled[data-v-04f4c89d]{opacity:.6;cursor:not-allowed;-webkit-user-select:none;user-select:none}.base-button.small[data-v-04f4c89d]{height:3rem}.base-button.small>span[data-v-04f4c89d]{font-size:1.3rem}.base-button.large[data-v-04f4c89d]{height:5rem;font-size:1.8rem;padding:0 2.2rem}.base-button.large>span[data-v-04f4c89d]{font-size:1.8rem}.base-button.primary[data-v-04f4c89d]{background:var(--color-active)}.base-button.primary>span[data-v-04f4c89d]{color:#fff}.base-button.gary[data-v-04f4c89d]{background:#4b5563}.base-button.link[data-v-04f4c89d]{border-radius:0;border-bottom:2px solid transparent}.base-button.link>span[data-v-04f4c89d]{color:var(--color-font-8)}.base-button.active[data-v-04f4c89d]{opacity:.4}.key-notice[data-v-04f4c89d]{margin-left:1rem;display:flex;align-items:center;justify-content:center;font-size:1.2rem;color:#fff}.key-notice .key[data-v-04f4c89d]{transform:scale(.8)}.post-editor-wrapper[data-v-0612e02f]{width:100%;box-sizing:border-box;position:relative;overflow:hidden;transition:all .3s;color:var(--color-font)}.post-editor-wrapper.isFocus .post-editor[data-v-0612e02f]{border:1px solid var(--color-active)}.post-editor-wrapper .post-editor[data-v-0612e02f]{border:1px solid var(--color-line);border-radius:var(--box-border-radius);transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.6rem;min-height:13rem;resize:none;background:var(--box-background-color);color:var(--color-font-pure)}.post-editor-wrapper .toolbar[data-v-0612e02f]{box-sizing:border-box;padding:.5rem 1rem;width:100%;position:relative;display:flex;justify-content:space-between;align-items:center}.post-editor-wrapper .toolbar .left[data-v-0612e02f]{display:flex;gap:1rem}.post-editor-wrapper .toolbar .left .upload input[data-v-0612e02f]{position:absolute;width:20px;height:20px;opacity:0}.post-editor-wrapper .toolbar span[data-v-0612e02f]{color:gray;font-size:1.3rem}.post-editor-wrapper .get-cursor[data-v-0612e02f]{border:1px solid var(--color-line);border-radius:var(--box-border-radius);transition:border .3s;width:100%;max-width:100%;padding:.6rem 1.4rem;box-sizing:border-box;outline:none;font-family:Avenir,Helvetica,Arial,sans-serif;font-size:1.6rem;min-height:13rem;resize:none;background:var(--box-background-color);color:var(--color-font-pure);position:absolute;top:0;z-index:-100}.post-editor-wrapper .emoticon-pack[data-v-0612e02f]{z-index:999999999;border-radius:1rem;padding:1rem;width:31rem;max-width:31rem;height:30rem;max-height:30rem;overflow:auto;background:var(--color-third-bg);border:1px solid var(--color-font-3);box-shadow:0 9px 24px -3px #0000000f,0 4px 8px -1px #0000001f;position:fixed;bottom:11rem;left:14rem}.post-editor-wrapper .emoticon-pack i[data-v-0612e02f]{position:absolute;right:2rem;font-size:2rem;color:#e2e2e2}.post-editor-wrapper .emoticon-pack .list[data-v-0612e02f]{margin:1rem 0}.post-editor-wrapper .emoticon-pack img[data-v-0612e02f]{width:3rem;height:3rem;padding:.5rem}.post-editor-wrapper .emoticon-pack span[data-v-0612e02f]{display:inline-block;font-size:2.3rem;padding:.5rem}.v-enter-active[data-v-f8165980],.v-leave-active[data-v-f8165980]{transition:opacity .3s ease}.v-enter-from[data-v-f8165980],.v-leave-to[data-v-f8165980]{opacity:0}.fade-in[data-v-f8165980]{animation:fade-in-f8165980 .3s}.fade-out[data-v-f8165980]{animation:fade-out-f8165980 .4s}@keyframes fade-in-f8165980{0%{opacity:0}to{opacity:1}}@keyframes fade-out-f8165980{0%{opacity:1}to{opacity:0;display:none}}.username[data-v-f8165980]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-f8165980]{font-size:1.4rem;color:#e02a2a}.owner[data-v-f8165980]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-f8165980]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-f8165980]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag .remove[data-v-f8165980]{margin-left:.5rem;display:none}.add-tag[data-v-f8165980]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;position:absolute;display:none}.floor[data-v-f8165980]{font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;color:var(--color-floor-font);cursor:default;margin-right:1rem}.base-avatar[data-v-f8165980]{margin-right:1rem;display:inline-flex}.base-avatar img[data-v-f8165980]{width:2.8rem;height:2.8rem;border-radius:.4rem}html[data-v-f8165980]{font-size:10px}[data-v-f8165980]:root{--box-border-radius: 8px}#site-header[data-v-f8165980]{height:4rem}#site-header #site-header-menu #menu-body[data-v-f8165980]{top:5rem;right:1rem}#Wrapper .cell .count_livid[data-v-f8165980]{font-size:14px;font-weight:700;padding:3px 10px;border-radius:5px}a[data-v-f8165980]{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-user-select:none;-moz-user-focus:none;-moz-user-select:none}.post-item[data-v-f8165980]{background:var(--box-background-color)}.post-item .new-item[data-v-f8165980]{display:flex;justify-content:space-between}.post-item .new-item .left .top[data-v-f8165980]{display:flex;align-items:center;line-height:1.2;gap:1rem}.post-item .new-item .left .small[data-v-f8165980],.post-item .new-item .left a.node[data-v-f8165980]{font-size:1.2rem}.post-item .new-item .left .bottom[data-v-f8165980]{margin:1rem 0 .5rem}.post-item .new-item .left .bottom .item_title[data-v-f8165980]{font-size:1.6rem}.post-item .new-item .left .bottom a[data-v-f8165980]{text-decoration:none!important}.post-item .new-item .right[data-v-f8165980]{min-width:5rem;display:flex;justify-content:flex-end;align-items:center}.post-item .new-item .right .count_livid[data-v-f8165980]{font-size:1.4rem!important;margin-right:0;padding:.3rem 1rem!important;border-radius:.5rem!important}.post-item .post-content[data-v-f8165980]{display:block;max-height:30rem;overflow:hidden;line-break:anywhere;-webkit-mask-image:linear-gradient(180deg,#000 60%,transparent);height:0;color:#000;text-decoration:none!important}.post-item .post-content blockquote[data-v-f8165980]{margin-top:.5rem}.post-item .post-content p[data-v-f8165980]:first-child{margin-top:0}.post-item .post-content[data-v-f8165980]:visited{color:var(--link-visited-color)}.post-item .show-more[data-v-f8165980]{font-size:1.3rem;text-align:right;height:3rem;align-items:center;justify-content:center;position:relative;z-index:9;display:none}.preview[data-v-f8165980]{margin-bottom:.7rem;border-radius:var(--box-border-radius)}.preview .topic-link[data-v-f8165980]:link{color:#000!important}.preview .show-all[data-v-f8165980]{max-height:unset;-webkit-mask-image:none}.preview .post-content[data-v-f8165980]{height:unset!important}.preview .show-more[data-v-f8165980]{display:flex}.preview .item_title[data-v-f8165980]{font-weight:700}.Night .post-item[data-v-f8165980]{background:#18222d!important}.Night .preview[data-v-f8165980]{border:1px solid #3b536e}.Night .preview>.post-content[data-v-f8165980]:link{color:#d1d5d9}.Night .preview>.post-content[data-v-f8165980]:visited{color:#393f4e!important}.Night .preview .topic-link[data-v-f8165980]:link{color:#c0dbff!important}[data-v-f8165980]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-four-bg: #e7e9eb;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-line2: #cecece;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--space: 1rem}html.dark[data-v-f8165980]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-four-bg: #22303f;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}.flex[data-v-f8165980]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-f8165980]{justify-content:flex-end}.flex-center[data-v-f8165980]{justify-content:center}.p1[data-v-f8165980]{padding:1rem}.p2[data-v-f8165980]{padding:2rem}.p0[data-v-f8165980]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-f8165980]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a[data-v-f8165980]{text-decoration:none}.tool[data-v-f8165980]{position:relative;display:flex;align-items:center;border-radius:.3rem;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg[data-v-f8165980]{width:2.2rem!important;height:2.2rem!important}.tool.disabled[data-v-f8165980]{cursor:not-allowed}.tool span[data-v-f8165980]{line-height:1rem}.my-node[data-v-f8165980]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5}.msgs[data-v-f8165980]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-f8165980]{background:var(--box-background-color);margin-bottom:.5rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-box .box-content[data-v-f8165980]{padding:.5rem}.my-cell[data-v-f8165980]{color:var(--color-font);height:4.2rem;padding:0 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-f8165980]{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-f8165980]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-f8165980]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-f8165980]{position:relative}.radio-group2[data-v-f8165980]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-f8165980]{background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-f8165980]:first-child{border-left:none}.radio-group2 .active[data-v-f8165980]{background:var(--color-active);color:#fff}.pop-confirm[data-v-f8165980]{position:relative;display:inline-flex;justify-content:center}input[data-v-f8165980]{width:10rem;height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-f8165980]:focus{border:1px solid var(--color-active)}.danger[data-v-f8165980]{color:red!important}.topic_content[data-v-f8165980],.reply_content[data-v-f8165980]{font-size:1.6rem}.mask[data-v-f8165980]{z-index:10;position:fixed;top:0;width:100vw;height:100vh;background:#000000bb}.mask.dark[data-v-f8165980]{background:#000000bb}.mask.light[data-v-f8165980]{background:transparent}.mask.lightgray[data-v-f8165980]{background:rgba(0,0,0,.25)}.mask.white[data-v-f8165980]{background:transparent}.slide[data-v-f8165980]{flex:1;width:100vw;height:100vh;transition:height .3s;position:relative;overflow:hidden}.slide .slide-list[data-v-f8165980]{height:100%;width:100%;display:flex;position:relative;transition:transform .3s}.slide .slide-list .slide-item[data-v-f8165980]{height:100%;width:100%;flex-shrink:0;position:relative;overflow:auto}.page1[data-v-f8165980]{overflow:hidden!important}.post-wrapper[data-v-f8165980],.setting-wrapper[data-v-f8165980]{position:absolute;left:0;top:0;height:100%;width:100%;background:var(--color-main-bg);overflow:auto}.setting-wrapper[data-v-f8165980],.setting-wrapper2[data-v-f8165980]{height:100%;overflow:hidden;background:var(--color-second-bg)}.mobile-page[data-v-f8165980]{height:100%;overflow:hidden;font-size:1.8rem;display:flex;flex-direction:column}.mobile-page>.page-content[data-v-f8165980]{padding:1rem;padding-top:0;box-sizing:border-box;overflow:auto}.html-wrapper[data-v-f8165980]{position:relative}.html-wrapper .htmlMask[data-v-f8165980]{max-height:90rem;overflow:hidden;-webkit-mask-image:linear-gradient(180deg,#000 80%,transparent)}.html-wrapper .expand[data-v-f8165980]{position:absolute;z-index:1;bottom:2rem;padding:.2rem 1.5rem;border-radius:2rem;border:1px solid gray;background:white;color:gray;left:50%;transform:translate(-50%)}.comment[data-v-312e9541]{width:100%;box-sizing:border-box;margin-top:.6rem}.comment.isLevelOne[data-v-312e9541]{border-bottom:1px solid var(--color-line);padding:.8rem 1rem;margin-top:0}.comment.ding[data-v-312e9541]{background:rgba(255,255,0,.3)!important}.comment .comment-content-w .more[data-v-312e9541]{text-align:center;margin:1rem 0}.comment .comment-content[data-v-312e9541]{display:flex;position:relative}.comment .comment-content .expand-line[data-v-312e9541]{margin-top:.6rem;width:1.8rem;min-width:1.8rem;position:relative}.comment .comment-content .expand-line[data-v-312e9541]:after{position:absolute;left:30%;content:" ";height:100%;width:0;border-right:1px solid var(--color-line)}.comment .comment-content .right[data-v-312e9541]{flex:1;width:calc(100% - 3rem)}.comment .comment-content .right .w[data-v-312e9541]{margin:.5rem 0}.wrong-wrapper[data-v-312e9541]{font-size:1.4rem;margin-bottom:1rem}.wrong-wrapper .del-line[data-v-312e9541]{text-decoration:line-through}.wrong-wrapper .wrong-icon[data-v-312e9541]{margin-left:.5rem}.wrong-wrapper .warning[data-v-312e9541]{border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;padding:1rem 0;margin-top:1rem;font-size:1.2rem;color:red}.toolbar[data-v-6234240d]{border-top:1px solid var(--color-line);height:4rem;padding:0 1rem;display:flex;align-items:center;color:var(--color-font);font-size:1.4rem;justify-content:space-between}.toolbar .left[data-v-6234240d],.toolbar .right[data-v-6234240d]{gap:1rem;display:flex}.toolbar .right[data-v-6234240d]{gap:.6rem}.comment[data-v-0869dab5]{width:100%;box-sizing:border-box;display:flex;gap:1rem;padding:1rem;border-bottom:1px solid var(--color-line)}.comment .base-avatar[data-v-0869dab5]{display:flex;margin-right:0}.comment .base-avatar img[data-v-0869dab5]{width:2.8rem;height:2.8rem;border-radius:.3rem}.comment .comment-body[data-v-0869dab5]{flex:1;display:flex;flex-direction:column}.comment .comment-body .texts[data-v-0869dab5]{display:flex;align-items:center}.comment .comment-body .reply_content[data-v-0869dab5]{margin-top:1rem;max-width:calc(100% - 5rem)}.comment .isRight[data-v-0869dab5]{align-items:flex-end}.comment .isRight .owner[data-v-0869dab5],.comment .isRight .mod[data-v-0869dab5],.comment .isRight .username[data-v-0869dab5]{margin:0 0 0 1rem}.comment .Author-right[data-v-0869dab5]{display:flex;flex-direction:column;align-items:center}.comment .Author-right .floor[data-v-0869dab5]{margin:0;border-radius:.5rem;background-color:var(--color-floor);padding:3px 9px}.comment .Author-right .jump[data-v-0869dab5]{color:#929596;margin-top:.4rem;font-size:1.4rem}.comment .point[data-v-0869dab5]{margin:0 1rem;display:flex;gap:.5rem;align-items:center}.comment .point svg[data-v-0869dab5]{font-size:1.6rem}.FromBottomDialog[data-v-3a54f208]{z-index:11;position:fixed;width:100%;overflow-y:auto;bottom:0;box-sizing:border-box;border-radius:var(--0013fa15);transition:all .3s;background:var(--color-four-bg)}.FromBottomDialog.no-heng-gang[data-v-3a54f208]{padding-top:0}.FromBottomDialog .heng-gang[data-v-3a54f208]{border-radius:.5rem .5rem 0 0;border-radius:var(--0013fa15);z-index:3;width:100%;position:fixed;min-height:3rem;display:flex;justify-content:center;align-items:center}.FromBottomDialog .heng-gang .gang-content[data-v-3a54f208]{background:darkgray;border-radius:2px;height:.4rem;width:3rem}.FromBottomDialog .dialog-wrapper[data-v-3a54f208]{margin-top:3rem}.wrapper .options[data-v-ae322b31]{padding:1rem 2rem 3rem;display:grid;grid-template-columns:repeat(5,1fr);justify-content:space-between;gap:2rem}.wrapper .options .item[data-v-ae322b31]{display:flex;flex-direction:column;align-items:center;color:gray;font-size:1.2rem}.wrapper .options .item.disabled[data-v-ae322b31]{opacity:.5}.wrapper .options .item.disabled svg[data-v-ae322b31]{color:gray!important}.wrapper .options .item .icon-wrap[data-v-ae322b31]{margin-bottom:.5rem;width:100%;height:15vw;display:flex;justify-content:center;align-items:center;background:var(--color-second-bg);border-radius:1rem}.wrapper .options .item .icon-wrap svg[data-v-ae322b31]{font-size:3rem}.wrapper .options .black[data-v-ae322b31]{color:var(--color-font-pure)}.wrapper .cancel[data-v-ae322b31]{border-top:1px solid var(--color-tooltip-bg);display:flex;align-items:center;justify-content:center;font-size:1.6rem;height:5rem;color:#646f81}.wrapper .options[data-v-8ef13a81]{padding:1rem 2rem 3rem;display:grid;grid-template-columns:repeat(5,1fr);justify-content:space-between;gap:2rem}.wrapper .options .item[data-v-8ef13a81]{display:flex;flex-direction:column;align-items:center;color:gray;font-size:1.2rem}.wrapper .options .item.disabled[data-v-8ef13a81]{opacity:.5}.wrapper .options .item.disabled svg[data-v-8ef13a81]{color:gray!important}.wrapper .options .item.full svg[data-v-8ef13a81]{color:#e02a2a!important}.wrapper .options .item .icon-wrap[data-v-8ef13a81]{margin-bottom:.5rem;width:100%;height:15vw;display:flex;justify-content:center;align-items:center;background:var(--color-second-bg);border-radius:1rem}.wrapper .options .item .icon-wrap svg[data-v-8ef13a81]{font-size:3rem;color:#39ae55}.wrapper .cancel[data-v-8ef13a81]{border-top:1px solid var(--color-line2);display:flex;align-items:center;justify-content:center;font-size:1.6rem;height:5rem;color:#646f81}.sticky{position:sticky;bottom:-2px;z-index:2;background:var(--box-background-hover-color)!important}.sticky[stuck]{box-shadow:0 2px 20px #00000059!important}.v-enter-active[data-v-546d3b11],.v-leave-active[data-v-546d3b11]{transition:opacity .3s ease}.v-enter-from[data-v-546d3b11],.v-leave-to[data-v-546d3b11]{opacity:0}.fade-in[data-v-546d3b11]{animation:fade-in-546d3b11 .3s}.fade-out[data-v-546d3b11]{animation:fade-out-546d3b11 .4s}@keyframes fade-in-546d3b11{0%{opacity:0}to{opacity:1}}@keyframes fade-out-546d3b11{0%{opacity:1}to{opacity:0;display:none}}.username[data-v-546d3b11]{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num[data-v-546d3b11]{font-size:1.4rem;color:#e02a2a}.owner[data-v-546d3b11]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod[data-v-546d3b11]{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag[data-v-546d3b11]{font-size:1.4rem;color:red;margin-left:1rem}.my-tag .remove[data-v-546d3b11]{margin-left:.5rem;display:none}.add-tag[data-v-546d3b11]{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;position:absolute;display:none}.floor[data-v-546d3b11]{font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;color:var(--color-floor-font);cursor:default;margin-right:1rem}.base-avatar[data-v-546d3b11]{margin-right:1rem;display:inline-flex}.base-avatar img[data-v-546d3b11]{width:2.8rem;height:2.8rem;border-radius:.4rem}html[data-v-546d3b11]{font-size:10px}[data-v-546d3b11]:root{--box-border-radius: 8px}#site-header[data-v-546d3b11]{height:4rem}#site-header #site-header-menu #menu-body[data-v-546d3b11]{top:5rem;right:1rem}#Wrapper .cell .count_livid[data-v-546d3b11]{font-size:14px;font-weight:700;padding:3px 10px;border-radius:5px}a[data-v-546d3b11]{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-user-select:none;-moz-user-focus:none;-moz-user-select:none}.post-item[data-v-546d3b11]{background:var(--box-background-color)}.post-item .new-item[data-v-546d3b11]{display:flex;justify-content:space-between}.post-item .new-item .left .top[data-v-546d3b11]{display:flex;align-items:center;line-height:1.2;gap:1rem}.post-item .new-item .left .small[data-v-546d3b11],.post-item .new-item .left a.node[data-v-546d3b11]{font-size:1.2rem}.post-item .new-item .left .bottom[data-v-546d3b11]{margin:1rem 0 .5rem}.post-item .new-item .left .bottom .item_title[data-v-546d3b11]{font-size:1.6rem}.post-item .new-item .left .bottom a[data-v-546d3b11]{text-decoration:none!important}.post-item .new-item .right[data-v-546d3b11]{min-width:5rem;display:flex;justify-content:flex-end;align-items:center}.post-item .new-item .right .count_livid[data-v-546d3b11]{font-size:1.4rem!important;margin-right:0;padding:.3rem 1rem!important;border-radius:.5rem!important}.post-item .post-content[data-v-546d3b11]{display:block;max-height:30rem;overflow:hidden;line-break:anywhere;-webkit-mask-image:linear-gradient(180deg,#000 60%,transparent);height:0;color:#000;text-decoration:none!important}.post-item .post-content blockquote[data-v-546d3b11]{margin-top:.5rem}.post-item .post-content p[data-v-546d3b11]:first-child{margin-top:0}.post-item .post-content[data-v-546d3b11]:visited{color:var(--link-visited-color)}.post-item .show-more[data-v-546d3b11]{font-size:1.3rem;text-align:right;height:3rem;align-items:center;justify-content:center;position:relative;z-index:9;display:none}.preview[data-v-546d3b11]{margin-bottom:.7rem;border-radius:var(--box-border-radius)}.preview .topic-link[data-v-546d3b11]:link{color:#000!important}.preview .show-all[data-v-546d3b11]{max-height:unset;-webkit-mask-image:none}.preview .post-content[data-v-546d3b11]{height:unset!important}.preview .show-more[data-v-546d3b11]{display:flex}.preview .item_title[data-v-546d3b11]{font-weight:700}.Night .post-item[data-v-546d3b11]{background:#18222d!important}.Night .preview[data-v-546d3b11]{border:1px solid #3b536e}.Night .preview>.post-content[data-v-546d3b11]:link{color:#d1d5d9}.Night .preview>.post-content[data-v-546d3b11]:visited{color:#393f4e!important}.Night .preview .topic-link[data-v-546d3b11]:link{color:#c0dbff!important}[data-v-546d3b11]:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-four-bg: #e7e9eb;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-line2: #cecece;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--space: 1rem}html.dark[data-v-546d3b11]{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-four-bg: #22303f;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}.flex[data-v-546d3b11]{display:flex;align-items:center;justify-content:space-between}.flex-end[data-v-546d3b11]{justify-content:flex-end}.flex-center[data-v-546d3b11]{justify-content:center}.p1[data-v-546d3b11]{padding:1rem}.p2[data-v-546d3b11]{padding:2rem}.p0[data-v-546d3b11]{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http][data-v-546d3b11]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a[data-v-546d3b11]{text-decoration:none}.tool[data-v-546d3b11]{position:relative;display:flex;align-items:center;border-radius:.3rem;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg[data-v-546d3b11]{width:2.2rem!important;height:2.2rem!important}.tool.disabled[data-v-546d3b11]{cursor:not-allowed}.tool span[data-v-546d3b11]{line-height:1rem}.my-node[data-v-546d3b11]{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5}.msgs[data-v-546d3b11]{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box[data-v-546d3b11]{background:var(--box-background-color);margin-bottom:.5rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-box .box-content[data-v-546d3b11]{padding:.5rem}.my-cell[data-v-546d3b11]{color:var(--color-font);height:4.2rem;padding:0 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal[data-v-546d3b11]{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title[data-v-546d3b11]{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option[data-v-546d3b11]{display:flex;align-items:center;padding:.6rem 0}.modal .option>span[data-v-546d3b11]{position:relative}.radio-group2[data-v-546d3b11]{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio[data-v-546d3b11]{background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio[data-v-546d3b11]:first-child{border-left:none}.radio-group2 .active[data-v-546d3b11]{background:var(--color-active);color:#fff}.pop-confirm[data-v-546d3b11]{position:relative;display:inline-flex;justify-content:center}input[data-v-546d3b11]{width:10rem;height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input[data-v-546d3b11]:focus{border:1px solid var(--color-active)}.danger[data-v-546d3b11]{color:red!important}.topic_content[data-v-546d3b11],.reply_content[data-v-546d3b11]{font-size:1.6rem}.mask[data-v-546d3b11]{z-index:10;position:fixed;top:0;width:100vw;height:100vh;background:#000000bb}.mask.dark[data-v-546d3b11]{background:#000000bb}.mask.light[data-v-546d3b11]{background:transparent}.mask.lightgray[data-v-546d3b11]{background:rgba(0,0,0,.25)}.mask.white[data-v-546d3b11]{background:transparent}.slide[data-v-546d3b11]{flex:1;width:100vw;height:100vh;transition:height .3s;position:relative;overflow:hidden}.slide .slide-list[data-v-546d3b11]{height:100%;width:100%;display:flex;position:relative;transition:transform .3s}.slide .slide-list .slide-item[data-v-546d3b11]{height:100%;width:100%;flex-shrink:0;position:relative;overflow:auto}.page1[data-v-546d3b11]{overflow:hidden!important}.post-wrapper[data-v-546d3b11],.setting-wrapper[data-v-546d3b11]{position:absolute;left:0;top:0;height:100%;width:100%;background:var(--color-main-bg);overflow:auto}.setting-wrapper[data-v-546d3b11],.setting-wrapper2[data-v-546d3b11]{height:100%;overflow:hidden;background:var(--color-second-bg)}.mobile-page[data-v-546d3b11]{height:100%;overflow:hidden;font-size:1.8rem;display:flex;flex-direction:column}.mobile-page>.page-content[data-v-546d3b11]{padding:1rem;padding-top:0;box-sizing:border-box;overflow:auto}.post-detail[data-v-546d3b11]{text-align:start;background:var(--color-main-bg);font-size:1.6rem;display:flex;justify-content:center;flex-wrap:wrap;padding-bottom:10rem}.post-detail[data-v-546d3b11] .subtle{background-color:#ecfdf5e6;border-left:4px solid #a7f3d0}.post-detail.isNight[data-v-546d3b11] .subtle{background-color:#1a3332;border-left:4px solid #047857}.post-detail .nav-bar[data-v-546d3b11]{position:fixed;top:0;z-index:9;height:4.6rem;display:flex;justify-content:space-between;align-items:center;padding:1rem;margin-bottom:-1px}.post-detail .nav-bar svg[data-v-546d3b11]{width:2rem;height:2rem;color:var(--color-font)}.post-detail .nav-bar .left[data-v-546d3b11],.post-detail .nav-bar .right[data-v-546d3b11]{display:flex;align-items:center;gap:1rem}.post-detail .post-main-body .box-header[data-v-546d3b11]{padding:0 .5rem}.post-detail .post-main-body .box-header h1[data-v-546d3b11]{font-size:2.2rem;font-weight:700}.post-detail .post-main-body .box-header small[data-v-546d3b11]{display:flex;align-items:center}.post-detail .loading-wrapper[data-v-546d3b11]{height:20rem;display:flex;justify-content:center;align-items:center}.post-detail .comments-header[data-v-546d3b11]{width:100%;padding:0 1rem;box-sizing:border-box;background:var(--box-background-color)}.post-detail #no-comments-yet[data-v-546d3b11]{color:#a9a9a9;font-weight:700;text-align:center;width:100%;margin:2rem 1rem;box-sizing:border-box}.post-detail .relationReply[data-v-546d3b11]{position:fixed;width:25vw;top:6.5rem;bottom:15rem;z-index:100;transform:translate(calc(100% + 2rem));font-size:2rem;overflow:hidden}.post-detail .relationReply .my-cell[data-v-546d3b11]{background:var(--color-second-bg);border-radius:var(--box-border-radius) var(--box-border-radius) 0 0}.post-detail .relationReply .comments[data-v-546d3b11]{max-height:calc(100% - 4.2rem);overflow:auto;background:var(--color-second-bg);border-radius:0 0 var(--box-border-radius) var(--box-border-radius)}.post-detail .call-list[data-v-546d3b11]{z-index:9;position:absolute;top:12rem;border:1px solid var(--color-main-bg);background:var(--color-call-list-bg);box-shadow:0 5px 15px #0000001a;overflow:auto;max-height:30rem;border-radius:var(--box-border-radius);min-width:8rem;box-sizing:content-box}.post-detail .call-list .call-item[data-v-546d3b11]{border-top:1px solid var(--color-main-bg);height:3rem;display:flex;padding:0 1rem;align-items:center;font-size:14px;box-sizing:border-box}.post-detail .call-list .call-item .select[data-v-546d3b11],.post-detail .call-list .call-item.select[data-v-546d3b11]{background:var(--color-main-bg);text-decoration:none}.post-detail .call-list .call-item[data-v-546d3b11]:nth-child(1){border-top:1px solid transparent}.post-detail .top-reply[data-v-546d3b11]{color:var(--color-font-3);font-size:2rem;margin-right:1rem}.base64_tooltip[data-v-1988f33b]{box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;background:var(--color-third-bg);min-height:2.2rem;max-width:20rem;padding:1rem;position:fixed;z-index:9998;display:flex;align-items:center;border-radius:.5rem;line-break:anywhere;font-size:1.4rem;color:var(--color-font-8)}.base64_tooltip svg[data-v-1988f33b]{margin-left:1rem;min-width:1.8rem}.base64_tooltip[data-v-1988f33b] .base-button{margin-left:1rem;margin-top:1rem}.msg[data-v-0dcc0508]{cursor:default;margin-bottom:2rem;display:flex;font-size:1.4rem;box-sizing:border-box;border-radius:var(--box-border-radius);color:var(--color-font-8);background:var(--color-tooltip-bg);box-shadow:0 0 6px 1px var(--color-tooltip-shadow)}.msg.success .left[data-v-0dcc0508]{background:var(--color-active)}.msg.warning .left[data-v-0dcc0508]{background:#c8c002}.msg.error .left[data-v-0dcc0508]{background:red}.msg .left[data-v-0dcc0508]{border-radius:var(--box-border-radius) 0 0 var(--box-border-radius);display:flex;align-items:center;background:var(--color-active)}.msg .left svg[data-v-0dcc0508]{color:#fff;font-size:2.2rem;margin:0 .6rem}.msg .right[data-v-0dcc0508]{flex:1;padding:1rem 2rem;display:flex;justify-content:space-between;align-items:center}.tag-modal .wrapper[data-v-674b86aa]{z-index:9;background:var(--color-main-bg);color:var(--color-font-8);border-radius:1.6rem;font-size:1.4rem;padding:2rem 4rem;width:25rem}.tag-modal .wrapper .title[data-v-674b86aa]{font-weight:700}.tag-modal .wrapper .btns[data-v-674b86aa]{margin-top:1.5rem;display:flex;justify-content:flex-end;align-items:center;gap:1.5rem;font-size:1.4rem}.msgs[data-v-93c4dec0]{position:fixed;margin-left:calc(50% - 40vw);width:80vw;z-index:9999;bottom:0;left:0;right:0}.tag-modal .modal-root[data-v-19a5903e]{z-index:9;background:var(--color-second-bg);color:var(--color-font-8);border-radius:1.6rem;font-size:1.4rem;width:50vw;height:70vh;display:flex;flex-direction:column}.tag-modal .modal-root .modal-header[data-v-19a5903e]{padding:2.4rem;display:flex;justify-content:space-between}.tag-modal .modal-root .modal-header .title[data-v-19a5903e]{font-size:2.6rem;font-weight:700;text-align:left;margin-bottom:0}.tag-modal .modal-root .modal-header i[data-v-19a5903e]{font-size:2.2rem}.tag-modal .modal-root .modal-body[data-v-19a5903e]{padding:2rem;padding-top:0;flex:1;overflow:auto}.tag-modal .modal-root .modal-body[data-v-19a5903e] .cell{padding:2rem}.v-enter-active,.v-leave-active{transition:opacity .3s ease}.v-enter-from,.v-leave-to{opacity:0}.fade-in{animation:fade-in .3s}.fade-out{animation:fade-out .4s}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0;display:none}}.username{font-weight:700;font-size:1.4rem;margin-right:1rem}.link-num{font-size:1.4rem;color:#e02a2a}.owner{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;margin-right:1rem;transform:scale(.8)}.mod{display:inline-block;background-color:transparent;color:#1484cd;border-radius:.3rem;padding:0 .3rem;cursor:default;border:2px solid #1484cd;font-size:1.2rem;font-weight:700;transform:scale(.8);background:#1484cd;color:#fff;margin-right:1rem}.my-tag{font-size:1.4rem;color:red;margin-left:1rem}.my-tag .remove{margin-left:.5rem;display:none}.add-tag{font-size:2.4rem;transform:translateY(.2rem);line-height:1rem;display:inline-block;margin-left:1rem;position:absolute;display:none}.floor{font-size:1.1rem;line-height:1rem;border-radius:.5rem;display:inline-block;color:var(--color-floor-font);cursor:default;margin-right:1rem}.base-avatar{margin-right:1rem;display:inline-flex}.base-avatar img{width:2.8rem;height:2.8rem;border-radius:.4rem}html{font-size:10px}:root{--box-border-radius: 8px}#site-header{height:4rem}#site-header #site-header-menu #menu-body{top:5rem;right:1rem}#Wrapper .cell .count_livid{font-size:14px;font-weight:700;padding:3px 10px;border-radius:5px}a{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-user-select:none;-moz-user-focus:none;-moz-user-select:none}.post-item{background:var(--box-background-color)}.post-item .new-item{display:flex;justify-content:space-between}.post-item .new-item .left .top{display:flex;align-items:center;line-height:1.2;gap:1rem}.post-item .new-item .left .small,.post-item .new-item .left a.node{font-size:1.2rem}.post-item .new-item .left .bottom{margin:1rem 0 .5rem}.post-item .new-item .left .bottom .item_title{font-size:1.6rem}.post-item .new-item .left .bottom a{text-decoration:none!important}.post-item .new-item .right{min-width:5rem;display:flex;justify-content:flex-end;align-items:center}.post-item .new-item .right .count_livid{font-size:1.4rem!important;margin-right:0;padding:.3rem 1rem!important;border-radius:.5rem!important}.post-item .post-content{display:block;max-height:30rem;overflow:hidden;line-break:anywhere;-webkit-mask-image:linear-gradient(180deg,#000 60%,transparent);height:0;color:#000;text-decoration:none!important}.post-item .post-content blockquote{margin-top:.5rem}.post-item .post-content p:first-child{margin-top:0}.post-item .post-content:visited{color:var(--link-visited-color)}.post-item .show-more{font-size:1.3rem;text-align:right;height:3rem;align-items:center;justify-content:center;position:relative;z-index:9;display:none}.preview{margin-bottom:.7rem;border-radius:var(--box-border-radius)}.preview .topic-link:link{color:#000!important}.preview .show-all{max-height:unset;-webkit-mask-image:none}.preview .post-content{height:unset!important}.preview .show-more{display:flex}.preview .item_title{font-weight:700}.Night .post-item{background:#18222d!important}.Night .preview{border:1px solid #3b536e}.Night .preview>.post-content:link{color:#d1d5d9}.Night .preview>.post-content:visited{color:#393f4e!important}.Night .preview .topic-link:link{color:#c0dbff!important}:root{--color-main-bg: #e2e2e2;--color-second-bg: white;--color-third-bg: #e2e2e2;--color-four-bg: #e7e9eb;--color-item-bg: white;--color-swtich-bg: #dcdfe6;--color-active: #409eff;--color-font: #999;--color-font-8: rgba(0, 0, 0, .8);--color-font-3: rgba(0, 0, 0, .3);--color-font-pure: black;--color-input-bg: white;--color-input-border: #e2e2e2;--color-input-border-hover: #a3a6ad;--color-radio-border: #e2e2e2;--color-tooltip-bg: white;--color-tooltip-shadow: #bbbbbb;--color-scrollbar: #93ade3;--color-line: #e2e2e2;--color-line2: #cecece;--color-loading-1: #00000033;--color-loading-2: #000;--color-floor: #f0f0f0;--color-floor-font: #bdbdbd;--color-editor-toolbar: #f6f7f8;--color-sp-btn-bg: #f1f1f1;--color-call-list-bg: white;--space: 1rem}html.dark{--color-main-bg: #22303f;--color-second-bg: #18222d;--color-third-bg: #31475e;--color-four-bg: #22303f;--color-item-bg: #18222d;--color-swtich-bg: #4c4d4f;--color-active: #409eff;--color-font: rgba(255, 255, 255, .5);--color-font-8: rgba(255, 255, 255, .8);--color-font-3: rgba(255, 255, 255, .3);--color-font-pure: white;--color-input-bg: #333333;--color-input-border: #6c6e72;--color-input-border-hover: #a3a6ad;--color-radio-border: #454847;--color-tooltip-bg: #31475e;--color-tooltip-shadow: #3b3b3b;--color-scrollbar: #5c5d5e;--color-line: var(--box-border-color);--color-loading-1: rgba(178, 177, 177, .2);--color-loading-2: #ffffff;--color-floor: #293b4d;--color-floor-font: rgba(255, 255, 255, .3);--color-editor-toolbar: var(--box-background-hover-color);--color-sp-btn-bg: #31475e;--color-call-list-bg: #31475e}.flex{display:flex;align-items:center;justify-content:space-between}.flex-end{justify-content:flex-end}.flex-center{justify-content:center}.p1{padding:1rem}.p2{padding:2rem}.p0{padding:0!important}body :is(.topic_content,.reply_content) a[href^=http]{text-underline-offset:.46ex;color:currentcolor;text-decoration:underline 1.5px}a{text-decoration:none}.tool{position:relative;display:flex;align-items:center;border-radius:.3rem;height:2.6rem;padding:0 .5rem;gap:.6rem}.tool>svg{width:2.2rem!important;height:2.2rem!important}.tool.disabled{cursor:not-allowed}.tool span{line-height:1rem}.my-node{border-radius:.2rem;padding:.4rem;font-size:1rem;color:#999;background:#f5f5f5}.msgs{position:fixed;margin-left:calc(50% - 25rem);width:50rem;z-index:9999;bottom:0;left:0;right:0}.my-box{background:var(--box-background-color);margin-bottom:.5rem;width:100%;overflow:hidden;box-sizing:border-box;transition:background-color .3s}.my-box .box-content{padding:.5rem}.my-cell{color:var(--color-font);height:4.2rem;padding:0 1rem;font-size:1.4rem;line-height:150%;text-align:left;border-bottom:1px solid var(--color-line)}.modal{position:fixed;z-index:100;width:100vw;height:100vh;left:0;top:0;display:flex;justify-content:center;align-items:center}.modal .title{font-size:2.4rem;margin-bottom:1rem;text-align:center}.modal .option{display:flex;align-items:center;padding:.6rem 0}.modal .option>span{position:relative}.radio-group2{display:inline-flex;border-radius:.5rem;overflow:hidden;border:1px solid var(--color-radio-border);background:var(--box-background-alt-color)}.radio-group2 .radio{background:transparent;padding:.5rem 1.2rem;border-left:1px solid var(--color-radio-border);font-size:1.3rem;color:var(--color-gray)}.radio-group2 .radio:first-child{border-left:none}.radio-group2 .active{background:var(--color-active);color:#fff}.pop-confirm{position:relative;display:inline-flex;justify-content:center}input{width:10rem;height:3rem;outline:unset;border:1px solid var(--color-input-border);padding:0 .5rem;border-radius:5px;box-sizing:border-box;transition:all .3s;background:var(--color-input-bg);color:var(--color-font)}input:focus{border:1px solid var(--color-active)}.danger{color:red!important}.topic_content,.reply_content{font-size:1.6rem}.mask{z-index:10;position:fixed;top:0;width:100vw;height:100vh;background:#000000bb}.mask.dark{background:#000000bb}.mask.light{background:transparent}.mask.lightgray{background:rgba(0,0,0,.25)}.mask.white{background:transparent}.slide{flex:1;width:100vw;height:100vh;transition:height .3s;position:relative;overflow:hidden}.slide .slide-list{height:100%;width:100%;display:flex;position:relative;transition:transform .3s}.slide .slide-list .slide-item{height:100%;width:100%;flex-shrink:0;position:relative;overflow:auto}.page1{overflow:hidden!important}.post-wrapper,.setting-wrapper{position:absolute;left:0;top:0;height:100%;width:100%;background:var(--color-main-bg);overflow:auto}.setting-wrapper,.setting-wrapper2{height:100%;overflow:hidden;background:var(--color-second-bg)}.mobile-page{height:100%;overflow:hidden;font-size:1.8rem;display:flex;flex-direction:column}.mobile-page>.page-content{padding:1rem;padding-top:0;box-sizing:border-box;overflow:auto}.target-user-tags[data-v-cf079729]{background:var(--color-second-bg);color:var(--color-font);word-break:break-all;text-align:start;font-size:1.4rem;box-shadow:0 2px 3px #0000001a;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.target-user-tags .add-tag[data-v-cf079729]{display:inline-block}.loaded[data-v-cf079729]{font-size:1.4rem;display:flex;align-items:center;gap:1rem} ');
  7772. console.log("V2EX 移动端");
  7773. (function() {
  7774. if (/eruda=1/.test(location.href) || localStorage.getItem("active-eruda")) {
  7775. let src = "//cdn.jsdelivr.net/npm/eruda@3.0.1";
  7776. console.log(1);
  7777. let s = document.createElement("script");
  7778. s.src = src;
  7779. s.onload = () => {
  7780. let s1 = document.createElement("script");
  7781. s1.innerText = `eruda.init();`;
  7782. document.body.append(s1);
  7783. };
  7784. document.body.append(s);
  7785. }
  7786. })();
  7787. run();
  7788. let vueApp = vue.createApp(App);
  7789. vueApp.config.unwrapInjectedRef = true;
  7790. vueApp.mount($section);
  7791. }
  7792.  
  7793. })(Vue);