karin-plugin-kkk 2.31.1 → 2.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/lib/build-metadata.json +5 -5
- package/lib/core_chunk/main.js +366 -1053
- package/lib/core_chunk/template.d.mts +446 -631
- package/lib/core_chunk/vendor.js +94568 -167504
- package/lib/karin-plugin-kkk.css +70 -270
- package/package.json +3 -2
package/lib/core_chunk/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __toESM } from "./rolldown-runtime.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as SiGooglephotos, $t as Moon, A as RiHashtag, An as CircleEllipsis, At as Square, B as RiThumbUpFill, Bn as Bookmark, Bt as ScanLine, C as AiFillHeart, Cn as CornerDownLeft, Ct as UserPlus, D as Markdown, Dn as Clapperboard, Dt as Terminal, E as AiOutlineVideoCamera, En as Clock, Et as Trash2, F as RiMessage3Fill, Fn as ChartColumn, Ft as Shield, G as RiVideoLine, Gn as clsx, Gt as Quote, H as RiTrophyFill, Hn as ArrowDownToLine, Ht as RotateCcw, I as RiPieChart2Fill, In as Camera, It as ShieldCheck, J as SiSamsung, Jn as require_react, Jt as Plus, K as SiXiaomi, Kn as require_jsx_runtime, Kt as QrCode, L as RiShareForwardFill, Ln as Calendar, Lt as Share2, M as RiHeart3Line, Mn as CircleCheckBig, Mt as Sparkles, N as RiHeartLine, Nn as CircleAlert, Nt as Smartphone, O as RiArrowRightFill, On as CircleQuestionMark, Ot as Sun, P as RiLiveLine, Pn as Check, Pt as ShoppingBag, Q as SiHonor, Qn as zod_default, Qt as Music, R as RiStarFill, Rn as Box, Rt as Settings2, S as BiImage, Sn as Cpu, St as User, T as AiFillStar, Tn as Code, Tt as TriangleAlert, U as RiUserFollowLine, Un as Chip, Ut as RefreshCw, V as RiTiktokFill, Vn as BellRing, Vt as Save, W as RiVerifiedBadgeFill, Wn as Button, Wt as Radio, X as SiOneplus, Xn as Chalk, Xt as Pencil, Y as SiOppo, Yn as require_protobufjs, Yt as Play, Z as SiHuawei, Zn as Xhshow, Zt as Palette, _ as MdSchedule, _n as Eye, _t as X, a as VictoryScatter, an as LoaderCircle, at as m, b as FaTiktok, bn as Download, bt as Users, c as VictoryChart, cn as Info, ct as c, d as VictoryTheme, dn as Hash, dt as fromUnixTime, en as Monitor, et as SiGithub, f as rehypeHighlight, fn as GitBranch, ft as formatDistanceToNow, g as MdLocationOn, gn as FilePlay, gt as Zap, h as MdLightbulbOutline, hn as FileText, ht as twMerge, i as require_heic_decode, in as MapPin, it as o, j as RiHeart3Fill, jn as CircleCheck, jt as SquarePen, k as RiGroupLine, kn as CircleFadingArrowUp, kt as Star, l as VictoryAxis, ln as Image$1, lt as zhCN, m as MdInfoOutline, mn as Gamepad2, mt as differenceInSeconds, n as require_lib, nn as Menu, nt as SiApple, o as VictoryPie, on as Link, ot as a, p as MdFitScreen, pn as Gift, pt as format, q as SiVivo, qn as require_server_node, qt as Puzzle, r as require_jpeg_js, rn as Maximize, rt as SiAnthropic, s as VictoryLine, sn as LayoutTemplate, st as n, t as createProxyMiddleware, tn as MessageCircle, tt as SiBilibili, u as VictoryLabel, un as Heart, ut as parse, v as FaCommentDots, vn as EyeOff, vt as WandSparkles, w as AiFillPushpin, wn as Copy, wt as Upload, x as FaUserGroup, xn as Crown, xt as UsersRound, y as FaMusic, yn as ExternalLink, yt as Video, z as RiStarLine, zn as Bot, zt as Search } from "./vendor.js";
|
|
3
3
|
import "node:module";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path, { resolve } from "node:path";
|
|
@@ -15,8 +15,10 @@ import { karinPathBase, karinPathTemp as karinPathTemp$1 } from "node-karin/root
|
|
|
15
15
|
import sqlite3 from "node-karin/sqlite3";
|
|
16
16
|
import YAML from "node-karin/yaml";
|
|
17
17
|
import util from "node:util";
|
|
18
|
+
import { generate, scan } from "@ikenxuan/qrcode";
|
|
18
19
|
import { Transform } from "node:stream";
|
|
19
20
|
import { pipeline } from "node:stream/promises";
|
|
21
|
+
import { inflateSync } from "node:zlib";
|
|
20
22
|
import { embedWatermarkToPngBytes } from "@ikenxuan/watermark";
|
|
21
23
|
import { snapka } from "@karinjs/plugin-puppeteer";
|
|
22
24
|
import { newInjectedPage } from "fingerprint-injector";
|
|
@@ -3280,7 +3282,6 @@ var XBogus = class {
|
|
|
3280
3282
|
const array2 = this.md5StrToArray(this.md5(this.md5StrToArray("d41d8cd98f00b204e9800998ecf8427e")));
|
|
3281
3283
|
const urlEncryptedArray = this.md5Encrypt(urlPath);
|
|
3282
3284
|
const timestamp = Math.floor(Date.now() / 1e3);
|
|
3283
|
-
const ct = 536919696;
|
|
3284
3285
|
const newArray = [
|
|
3285
3286
|
64,
|
|
3286
3287
|
1,
|
|
@@ -3296,10 +3297,10 @@ var XBogus = class {
|
|
|
3296
3297
|
timestamp >> 16 & 255,
|
|
3297
3298
|
timestamp >> 8 & 255,
|
|
3298
3299
|
timestamp & 255,
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3300
|
+
32,
|
|
3301
|
+
0,
|
|
3302
|
+
190,
|
|
3303
|
+
144
|
|
3303
3304
|
];
|
|
3304
3305
|
let xorResult = newArray[0];
|
|
3305
3306
|
for (let i = 1; i < newArray.length; i++) xorResult ^= newArray[i];
|
|
@@ -6296,7 +6297,7 @@ var captureKuaishouEncodeStack = () => {
|
|
|
6296
6297
|
* @returns 用于 `SECS.s` 的栈尾字符串
|
|
6297
6298
|
*/
|
|
6298
6299
|
var deriveKuaishouSecsStackTail = (stack = captureKuaishouEncodeStack()) => {
|
|
6299
|
-
return stack.length > KUAISHOU_SECS_STACK_LIMIT ? stack.slice(-
|
|
6300
|
+
return stack.length > KUAISHOU_SECS_STACK_LIMIT ? stack.slice(-100) : stack;
|
|
6300
6301
|
};
|
|
6301
6302
|
/**
|
|
6302
6303
|
* 构造快手 `window.SECS` 的纯算法等价状态。
|
|
@@ -10906,585 +10907,6 @@ var formatBuildTime = (isoString) => {
|
|
|
10906
10907
|
const date = new Date(isoString);
|
|
10907
10908
|
return `${date.getFullYear()}年${String(date.getMonth() + 1).padStart(2, "0")}月${String(date.getDate()).padStart(2, "0")}日 ${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}`;
|
|
10908
10909
|
};
|
|
10909
|
-
//#endregion
|
|
10910
|
-
//#region src/module/utils/QRCodeScanner.ts
|
|
10911
|
-
var import_heic_decode = /* @__PURE__ */ __toESM(require_heic_decode(), 1);
|
|
10912
|
-
var import_jpeg_js = /* @__PURE__ */ __toESM(require_jpeg_js(), 1);
|
|
10913
|
-
var import_jsQR = /* @__PURE__ */ __toESM(require_jsQR(), 1);
|
|
10914
|
-
var import_png = require_png();
|
|
10915
|
-
/**
|
|
10916
|
-
* 二维码扫描工具类
|
|
10917
|
-
*
|
|
10918
|
-
* 使用纯 JavaScript 实现,无需任何 native 模块依赖
|
|
10919
|
-
*
|
|
10920
|
-
* 支持的图片格式:
|
|
10921
|
-
* - PNG (使用 pngjs)
|
|
10922
|
-
* - JPEG/JPG (使用 jpeg-js)
|
|
10923
|
-
* - HEIC/HEIF (使用 heic-decode,基于 WASM)
|
|
10924
|
-
*
|
|
10925
|
-
* 注意:所有图片解码库均为纯 JavaScript/WASM 实现,
|
|
10926
|
-
* 不依赖任何 native 模块,可在任何平台上运行
|
|
10927
|
-
*/
|
|
10928
|
-
var QRCodeScanner = class {
|
|
10929
|
-
/**
|
|
10930
|
-
* 从图片 URL 识别二维码
|
|
10931
|
-
* @param imageUrl 图片 URL
|
|
10932
|
-
* @returns 二维码内容,如果没有识别到则返回 null
|
|
10933
|
-
*/
|
|
10934
|
-
static async scanFromUrl(imageUrl) {
|
|
10935
|
-
try {
|
|
10936
|
-
const response = await axios.get(imageUrl, { responseType: "arraybuffer" });
|
|
10937
|
-
const buffer = Buffer.from(response.data);
|
|
10938
|
-
if (!this.detectImageFormat(buffer)) {
|
|
10939
|
-
logger.debug("URL 内容不是支持的图片格式,跳过二维码扫描");
|
|
10940
|
-
return null;
|
|
10941
|
-
}
|
|
10942
|
-
return this.scanFromBuffer(buffer);
|
|
10943
|
-
} catch (error) {
|
|
10944
|
-
logger.error("识别二维码时发生错误:", error);
|
|
10945
|
-
return null;
|
|
10946
|
-
}
|
|
10947
|
-
}
|
|
10948
|
-
/**
|
|
10949
|
-
* 提取图片的一个区域
|
|
10950
|
-
* @param imageData 原始图片数据
|
|
10951
|
-
* @param x 起始 x 坐标
|
|
10952
|
-
* @param y 起始 y 坐标
|
|
10953
|
-
* @param width 区域宽度
|
|
10954
|
-
* @param height 区域高度
|
|
10955
|
-
* @returns 区域图片数据
|
|
10956
|
-
*/
|
|
10957
|
-
static extractRegion(imageData, x, y, width, height) {
|
|
10958
|
-
const newData = new Uint8ClampedArray(width * height * 4);
|
|
10959
|
-
for (let dy = 0; dy < height; dy++) for (let dx = 0; dx < width; dx++) {
|
|
10960
|
-
const srcX = x + dx;
|
|
10961
|
-
const srcY = y + dy;
|
|
10962
|
-
if (srcX >= imageData.width || srcY >= imageData.height) continue;
|
|
10963
|
-
const srcIndex = (srcY * imageData.width + srcX) * 4;
|
|
10964
|
-
const dstIndex = (dy * width + dx) * 4;
|
|
10965
|
-
newData[dstIndex] = imageData.data[srcIndex];
|
|
10966
|
-
newData[dstIndex + 1] = imageData.data[srcIndex + 1];
|
|
10967
|
-
newData[dstIndex + 2] = imageData.data[srcIndex + 2];
|
|
10968
|
-
newData[dstIndex + 3] = imageData.data[srcIndex + 3];
|
|
10969
|
-
}
|
|
10970
|
-
return {
|
|
10971
|
-
width,
|
|
10972
|
-
height,
|
|
10973
|
-
data: newData
|
|
10974
|
-
};
|
|
10975
|
-
}
|
|
10976
|
-
/**
|
|
10977
|
-
* 增强图片对比度(用于提高二维码识别率)
|
|
10978
|
-
* @param imageData 图片数据
|
|
10979
|
-
* @returns 增强后的图片数据
|
|
10980
|
-
*/
|
|
10981
|
-
static enhanceContrast(imageData) {
|
|
10982
|
-
const { width, height, data } = imageData;
|
|
10983
|
-
const newData = new Uint8ClampedArray(data.length);
|
|
10984
|
-
const histogram = new Array(256).fill(0);
|
|
10985
|
-
for (let i = 0; i < data.length; i += 4) {
|
|
10986
|
-
const gray = Math.floor(.299 * data[i] + .587 * data[i + 1] + .114 * data[i + 2]);
|
|
10987
|
-
histogram[gray]++;
|
|
10988
|
-
}
|
|
10989
|
-
const cdf = new Array(256).fill(0);
|
|
10990
|
-
cdf[0] = histogram[0];
|
|
10991
|
-
for (let i = 1; i < 256; i++) cdf[i] = cdf[i - 1] + histogram[i];
|
|
10992
|
-
const totalPixels = width * height;
|
|
10993
|
-
const cdfMin = cdf.find((v) => v > 0) || 0;
|
|
10994
|
-
for (let i = 0; i < data.length; i += 4) {
|
|
10995
|
-
const gray = Math.floor(.299 * data[i] + .587 * data[i + 1] + .114 * data[i + 2]);
|
|
10996
|
-
const newGray = Math.floor((cdf[gray] - cdfMin) / (totalPixels - cdfMin) * 255);
|
|
10997
|
-
newData[i] = newGray;
|
|
10998
|
-
newData[i + 1] = newGray;
|
|
10999
|
-
newData[i + 2] = newGray;
|
|
11000
|
-
newData[i + 3] = data[i + 3];
|
|
11001
|
-
}
|
|
11002
|
-
return {
|
|
11003
|
-
width,
|
|
11004
|
-
height,
|
|
11005
|
-
data: newData
|
|
11006
|
-
};
|
|
11007
|
-
}
|
|
11008
|
-
/**
|
|
11009
|
-
* 二值化处理(用于提高小二维码识别率)
|
|
11010
|
-
* @param imageData 图片数据
|
|
11011
|
-
* @param threshold 阈值(0-255),默认自动计算
|
|
11012
|
-
* @returns 二值化后的图片数据
|
|
11013
|
-
*/
|
|
11014
|
-
static binarize(imageData, threshold) {
|
|
11015
|
-
const { width, height, data } = imageData;
|
|
11016
|
-
const newData = new Uint8ClampedArray(data.length);
|
|
11017
|
-
if (threshold === void 0) {
|
|
11018
|
-
const histogram = new Array(256).fill(0);
|
|
11019
|
-
for (let i = 0; i < data.length; i += 4) {
|
|
11020
|
-
const gray = Math.floor(.299 * data[i] + .587 * data[i + 1] + .114 * data[i + 2]);
|
|
11021
|
-
histogram[gray]++;
|
|
11022
|
-
}
|
|
11023
|
-
const total = width * height;
|
|
11024
|
-
let sum = 0;
|
|
11025
|
-
for (let i = 0; i < 256; i++) sum += i * histogram[i];
|
|
11026
|
-
let sumB = 0;
|
|
11027
|
-
let wB = 0;
|
|
11028
|
-
let wF = 0;
|
|
11029
|
-
let maxVariance = 0;
|
|
11030
|
-
threshold = 0;
|
|
11031
|
-
for (let t = 0; t < 256; t++) {
|
|
11032
|
-
wB += histogram[t];
|
|
11033
|
-
if (wB === 0) continue;
|
|
11034
|
-
wF = total - wB;
|
|
11035
|
-
if (wF === 0) break;
|
|
11036
|
-
sumB += t * histogram[t];
|
|
11037
|
-
const mB = sumB / wB;
|
|
11038
|
-
const mF = (sum - sumB) / wF;
|
|
11039
|
-
const variance = wB * wF * (mB - mF) * (mB - mF);
|
|
11040
|
-
if (variance > maxVariance) {
|
|
11041
|
-
maxVariance = variance;
|
|
11042
|
-
threshold = t;
|
|
11043
|
-
}
|
|
11044
|
-
}
|
|
11045
|
-
}
|
|
11046
|
-
for (let i = 0; i < data.length; i += 4) {
|
|
11047
|
-
const binary = Math.floor(.299 * data[i] + .587 * data[i + 1] + .114 * data[i + 2]) > threshold ? 255 : 0;
|
|
11048
|
-
newData[i] = binary;
|
|
11049
|
-
newData[i + 1] = binary;
|
|
11050
|
-
newData[i + 2] = binary;
|
|
11051
|
-
newData[i + 3] = data[i + 3];
|
|
11052
|
-
}
|
|
11053
|
-
return {
|
|
11054
|
-
width,
|
|
11055
|
-
height,
|
|
11056
|
-
data: newData
|
|
11057
|
-
};
|
|
11058
|
-
}
|
|
11059
|
-
/**
|
|
11060
|
-
* 锐化处理(增强边缘)
|
|
11061
|
-
* @param imageData 图片数据
|
|
11062
|
-
* @returns 锐化后的图片数据
|
|
11063
|
-
*/
|
|
11064
|
-
static sharpen(imageData) {
|
|
11065
|
-
const { width, height, data } = imageData;
|
|
11066
|
-
const newData = new Uint8ClampedArray(data.length);
|
|
11067
|
-
const kernel = [
|
|
11068
|
-
0,
|
|
11069
|
-
-1,
|
|
11070
|
-
0,
|
|
11071
|
-
-1,
|
|
11072
|
-
5,
|
|
11073
|
-
-1,
|
|
11074
|
-
0,
|
|
11075
|
-
-1,
|
|
11076
|
-
0
|
|
11077
|
-
];
|
|
11078
|
-
for (let y = 1; y < height - 1; y++) for (let x = 1; x < width - 1; x++) {
|
|
11079
|
-
let r = 0, g = 0, b = 0;
|
|
11080
|
-
for (let ky = -1; ky <= 1; ky++) for (let kx = -1; kx <= 1; kx++) {
|
|
11081
|
-
const idx = ((y + ky) * width + (x + kx)) * 4;
|
|
11082
|
-
const k = kernel[(ky + 1) * 3 + (kx + 1)];
|
|
11083
|
-
r += data[idx] * k;
|
|
11084
|
-
g += data[idx + 1] * k;
|
|
11085
|
-
b += data[idx + 2] * k;
|
|
11086
|
-
}
|
|
11087
|
-
const idx = (y * width + x) * 4;
|
|
11088
|
-
newData[idx] = Math.max(0, Math.min(255, r));
|
|
11089
|
-
newData[idx + 1] = Math.max(0, Math.min(255, g));
|
|
11090
|
-
newData[idx + 2] = Math.max(0, Math.min(255, b));
|
|
11091
|
-
newData[idx + 3] = data[idx + 3];
|
|
11092
|
-
}
|
|
11093
|
-
for (let x = 0; x < width; x++) {
|
|
11094
|
-
const topIdx = x * 4;
|
|
11095
|
-
const bottomIdx = ((height - 1) * width + x) * 4;
|
|
11096
|
-
for (let c = 0; c < 4; c++) {
|
|
11097
|
-
newData[topIdx + c] = data[topIdx + c];
|
|
11098
|
-
newData[bottomIdx + c] = data[bottomIdx + c];
|
|
11099
|
-
}
|
|
11100
|
-
}
|
|
11101
|
-
for (let y = 0; y < height; y++) {
|
|
11102
|
-
const leftIdx = y * width * 4;
|
|
11103
|
-
const rightIdx = (y * width + width - 1) * 4;
|
|
11104
|
-
for (let c = 0; c < 4; c++) {
|
|
11105
|
-
newData[leftIdx + c] = data[leftIdx + c];
|
|
11106
|
-
newData[rightIdx + c] = data[rightIdx + c];
|
|
11107
|
-
}
|
|
11108
|
-
}
|
|
11109
|
-
return {
|
|
11110
|
-
width,
|
|
11111
|
-
height,
|
|
11112
|
-
data: newData
|
|
11113
|
-
};
|
|
11114
|
-
}
|
|
11115
|
-
/**
|
|
11116
|
-
* 在图片区域中尝试识别二维码
|
|
11117
|
-
* @param imageData 图片数据
|
|
11118
|
-
* @param regionName 区域名称(用于日志)
|
|
11119
|
-
* @returns 二维码内容或 null
|
|
11120
|
-
*/
|
|
11121
|
-
static tryRecognizeInRegion(imageData, regionName) {
|
|
11122
|
-
for (const strategy of [
|
|
11123
|
-
{
|
|
11124
|
-
name: "默认",
|
|
11125
|
-
enhance: false,
|
|
11126
|
-
binarize: false,
|
|
11127
|
-
sharpen: false,
|
|
11128
|
-
options: void 0
|
|
11129
|
-
},
|
|
11130
|
-
{
|
|
11131
|
-
name: "二值化",
|
|
11132
|
-
enhance: false,
|
|
11133
|
-
binarize: true,
|
|
11134
|
-
sharpen: false,
|
|
11135
|
-
options: void 0
|
|
11136
|
-
},
|
|
11137
|
-
{
|
|
11138
|
-
name: "锐化",
|
|
11139
|
-
enhance: false,
|
|
11140
|
-
binarize: false,
|
|
11141
|
-
sharpen: true,
|
|
11142
|
-
options: void 0
|
|
11143
|
-
},
|
|
11144
|
-
{
|
|
11145
|
-
name: "增强对比度",
|
|
11146
|
-
enhance: true,
|
|
11147
|
-
binarize: false,
|
|
11148
|
-
sharpen: false,
|
|
11149
|
-
options: void 0
|
|
11150
|
-
},
|
|
11151
|
-
{
|
|
11152
|
-
name: "增强+二值化",
|
|
11153
|
-
enhance: true,
|
|
11154
|
-
binarize: true,
|
|
11155
|
-
sharpen: false,
|
|
11156
|
-
options: void 0
|
|
11157
|
-
},
|
|
11158
|
-
{
|
|
11159
|
-
name: "锐化+二值化",
|
|
11160
|
-
enhance: false,
|
|
11161
|
-
binarize: true,
|
|
11162
|
-
sharpen: true,
|
|
11163
|
-
options: void 0
|
|
11164
|
-
},
|
|
11165
|
-
{
|
|
11166
|
-
name: "attemptBoth",
|
|
11167
|
-
enhance: false,
|
|
11168
|
-
binarize: false,
|
|
11169
|
-
sharpen: false,
|
|
11170
|
-
options: { inversionAttempts: "attemptBoth" }
|
|
11171
|
-
},
|
|
11172
|
-
{
|
|
11173
|
-
name: "二值化+attemptBoth",
|
|
11174
|
-
enhance: false,
|
|
11175
|
-
binarize: true,
|
|
11176
|
-
sharpen: false,
|
|
11177
|
-
options: { inversionAttempts: "attemptBoth" }
|
|
11178
|
-
}
|
|
11179
|
-
]) try {
|
|
11180
|
-
logger.debug(` 尝试策略: ${strategy.name}`);
|
|
11181
|
-
let processedData = imageData;
|
|
11182
|
-
if (strategy.sharpen) processedData = this.sharpen(processedData);
|
|
11183
|
-
if (strategy.enhance) processedData = this.enhanceContrast(processedData);
|
|
11184
|
-
if (strategy.binarize) processedData = this.binarize(processedData);
|
|
11185
|
-
const code = (0, import_jsQR.default)(processedData.data, processedData.width, processedData.height, strategy.options);
|
|
11186
|
-
if (code && code.data) {
|
|
11187
|
-
logger.debug(`✓ 成功识别二维码 [区域: ${regionName}] [策略: ${strategy.name}]`);
|
|
11188
|
-
logger.debug(` 二维码内容: ${code.data}`);
|
|
11189
|
-
return code.data;
|
|
11190
|
-
} else logger.debug(` 策略 ${strategy.name} 未识别到二维码`);
|
|
11191
|
-
} catch (err) {
|
|
11192
|
-
logger.debug(` 策略 ${strategy.name} 执行失败: ${err}`);
|
|
11193
|
-
}
|
|
11194
|
-
logger.debug(` 区域 ${regionName} 识别失败,尝试下一个区域`);
|
|
11195
|
-
return null;
|
|
11196
|
-
}
|
|
11197
|
-
/**
|
|
11198
|
-
* 检测图片格式
|
|
11199
|
-
* @param buffer 图片 Buffer
|
|
11200
|
-
* @returns 图片格式或 null
|
|
11201
|
-
*/
|
|
11202
|
-
static detectImageFormat(buffer) {
|
|
11203
|
-
if (buffer.length >= 8 && buffer[0] === 137 && buffer[1] === 80 && buffer[2] === 78 && buffer[3] === 71) return "png";
|
|
11204
|
-
if (buffer.length >= 3 && buffer[0] === 255 && buffer[1] === 216 && buffer[2] === 255) return "jpeg";
|
|
11205
|
-
if (buffer.length >= 12) {
|
|
11206
|
-
if (buffer.toString("ascii", 4, 8) === "ftyp") {
|
|
11207
|
-
const brand = buffer.toString("ascii", 8, 12);
|
|
11208
|
-
if (brand === "heic" || brand === "heix" || brand === "hevc" || brand === "hevx" || brand === "mif1" || brand === "msf1") return "heic";
|
|
11209
|
-
}
|
|
11210
|
-
}
|
|
11211
|
-
if (buffer.length >= 6 && buffer[0] === 71 && buffer[1] === 73 && buffer[2] === 70 && buffer[3] === 56) return "gif";
|
|
11212
|
-
if (buffer.length >= 2 && buffer[0] === 66 && buffer[1] === 77) return "bmp";
|
|
11213
|
-
if (buffer.length >= 12 && buffer[0] === 82 && buffer[1] === 73 && buffer[2] === 70 && buffer[3] === 70 && buffer[8] === 87 && buffer[9] === 69 && buffer[10] === 66 && buffer[11] === 80) return "webp";
|
|
11214
|
-
return null;
|
|
11215
|
-
}
|
|
11216
|
-
/**
|
|
11217
|
-
* 解析 PNG 图片
|
|
11218
|
-
* @param buffer 图片 Buffer
|
|
11219
|
-
* @returns 图片数据或 null
|
|
11220
|
-
*/
|
|
11221
|
-
static parsePNG(buffer) {
|
|
11222
|
-
try {
|
|
11223
|
-
const png = import_png.PNG.sync.read(buffer);
|
|
11224
|
-
logger.debug(`PNG 解析成功: ${png.width}x${png.height}`);
|
|
11225
|
-
return {
|
|
11226
|
-
width: png.width,
|
|
11227
|
-
height: png.height,
|
|
11228
|
-
data: Uint8ClampedArray.from(png.data)
|
|
11229
|
-
};
|
|
11230
|
-
} catch (err) {
|
|
11231
|
-
logger.warn("PNG 解析失败:", err);
|
|
11232
|
-
return null;
|
|
11233
|
-
}
|
|
11234
|
-
}
|
|
11235
|
-
/**
|
|
11236
|
-
* 解析 JPEG 图片
|
|
11237
|
-
* @param buffer 图片 Buffer
|
|
11238
|
-
* @returns 图片数据或 null
|
|
11239
|
-
*/
|
|
11240
|
-
static parseJPEG(buffer) {
|
|
11241
|
-
try {
|
|
11242
|
-
const decoded = import_jpeg_js.default.decode(buffer, { useTArray: true });
|
|
11243
|
-
logger.debug(`JPEG 解析成功: ${decoded.width}x${decoded.height}`);
|
|
11244
|
-
return {
|
|
11245
|
-
width: decoded.width,
|
|
11246
|
-
height: decoded.height,
|
|
11247
|
-
data: Uint8ClampedArray.from(decoded.data)
|
|
11248
|
-
};
|
|
11249
|
-
} catch (err) {
|
|
11250
|
-
logger.warn("JPEG 解析失败:", err);
|
|
11251
|
-
return null;
|
|
11252
|
-
}
|
|
11253
|
-
}
|
|
11254
|
-
/**
|
|
11255
|
-
* 解析 HEIC/HEIF 图片
|
|
11256
|
-
* @param buffer 图片 Buffer
|
|
11257
|
-
* @returns 图片数据或 null
|
|
11258
|
-
*/
|
|
11259
|
-
static async parseHEIC(buffer) {
|
|
11260
|
-
try {
|
|
11261
|
-
const decoded = await (0, import_heic_decode.default)({ buffer });
|
|
11262
|
-
logger.debug(`HEIC 解析成功: ${decoded.width}x${decoded.height}`);
|
|
11263
|
-
return {
|
|
11264
|
-
width: decoded.width,
|
|
11265
|
-
height: decoded.height,
|
|
11266
|
-
data: Uint8ClampedArray.from(decoded.data)
|
|
11267
|
-
};
|
|
11268
|
-
} catch (err) {
|
|
11269
|
-
logger.warn("HEIC 解析失败:", err);
|
|
11270
|
-
return null;
|
|
11271
|
-
}
|
|
11272
|
-
}
|
|
11273
|
-
/**
|
|
11274
|
-
* 解析图片 Buffer 为像素数据
|
|
11275
|
-
* @param buffer 图片 Buffer
|
|
11276
|
-
* @returns 图片数据或 null
|
|
11277
|
-
*/
|
|
11278
|
-
static async parseImageBuffer(buffer) {
|
|
11279
|
-
try {
|
|
11280
|
-
const format = this.detectImageFormat(buffer);
|
|
11281
|
-
logger.debug(`检测到图片格式: ${format || "未知"}`);
|
|
11282
|
-
if (!format) {
|
|
11283
|
-
logger.warn("无法识别图片格式");
|
|
11284
|
-
return null;
|
|
11285
|
-
}
|
|
11286
|
-
switch (format) {
|
|
11287
|
-
case "png": return this.parsePNG(buffer);
|
|
11288
|
-
case "jpeg": return this.parseJPEG(buffer);
|
|
11289
|
-
case "heic": return await this.parseHEIC(buffer);
|
|
11290
|
-
default:
|
|
11291
|
-
logger.warn(`不支持的图片格式: ${format}`);
|
|
11292
|
-
return null;
|
|
11293
|
-
}
|
|
11294
|
-
} catch (err) {
|
|
11295
|
-
logger.warn("图片解析失败:", err);
|
|
11296
|
-
return null;
|
|
11297
|
-
}
|
|
11298
|
-
}
|
|
11299
|
-
/**
|
|
11300
|
-
* 从图片 Buffer 识别二维码
|
|
11301
|
-
* @param buffer 图片 Buffer
|
|
11302
|
-
* @returns 二维码内容,如果没有识别到则返回 null
|
|
11303
|
-
*/
|
|
11304
|
-
static async scanFromBuffer(buffer) {
|
|
11305
|
-
try {
|
|
11306
|
-
const imageData = await this.parseImageBuffer(buffer);
|
|
11307
|
-
if (!imageData) return null;
|
|
11308
|
-
const { width, height } = imageData;
|
|
11309
|
-
const dataSizeMB = (width * height * 4 / 1024 / 1024).toFixed(2);
|
|
11310
|
-
logger.debug(`图片数据: ${width}x${height}, 内存占用: ${dataSizeMB}MB`);
|
|
11311
|
-
if (width <= 1024 && height <= 1024) {
|
|
11312
|
-
logger.debug("图片尺寸较小,使用全图识别策略");
|
|
11313
|
-
const result = this.tryRecognizeInRegion(imageData, "全图");
|
|
11314
|
-
if (result) return result;
|
|
11315
|
-
}
|
|
11316
|
-
logger.debug(`使用分块扫描策略 (${width}x${height})`);
|
|
11317
|
-
const scanRegions = [];
|
|
11318
|
-
const smallBlock = Math.min(400, Math.floor(Math.min(width, height) * .3));
|
|
11319
|
-
const mediumBlock = Math.min(600, Math.floor(Math.min(width, height) * .5));
|
|
11320
|
-
const largeBlock = Math.min(800, Math.floor(Math.max(width, height) * .6));
|
|
11321
|
-
logger.debug("添加四角小块扫描区域(优先)");
|
|
11322
|
-
scanRegions.push({
|
|
11323
|
-
name: "左上角-小",
|
|
11324
|
-
x: 0,
|
|
11325
|
-
y: 0,
|
|
11326
|
-
w: Math.min(smallBlock, width),
|
|
11327
|
-
h: Math.min(smallBlock, height)
|
|
11328
|
-
});
|
|
11329
|
-
scanRegions.push({
|
|
11330
|
-
name: "右上角-小",
|
|
11331
|
-
x: Math.max(0, width - smallBlock),
|
|
11332
|
-
y: 0,
|
|
11333
|
-
w: Math.min(smallBlock, width),
|
|
11334
|
-
h: Math.min(smallBlock, height)
|
|
11335
|
-
});
|
|
11336
|
-
scanRegions.push({
|
|
11337
|
-
name: "左下角-小",
|
|
11338
|
-
x: 0,
|
|
11339
|
-
y: Math.max(0, height - smallBlock),
|
|
11340
|
-
w: Math.min(smallBlock, width),
|
|
11341
|
-
h: Math.min(smallBlock, height)
|
|
11342
|
-
});
|
|
11343
|
-
scanRegions.push({
|
|
11344
|
-
name: "右下角-小",
|
|
11345
|
-
x: Math.max(0, width - smallBlock),
|
|
11346
|
-
y: Math.max(0, height - smallBlock),
|
|
11347
|
-
w: Math.min(smallBlock, width),
|
|
11348
|
-
h: Math.min(smallBlock, height)
|
|
11349
|
-
});
|
|
11350
|
-
logger.debug("添加四角中块扫描区域");
|
|
11351
|
-
scanRegions.push({
|
|
11352
|
-
name: "左上角-中",
|
|
11353
|
-
x: 0,
|
|
11354
|
-
y: 0,
|
|
11355
|
-
w: Math.min(mediumBlock, width),
|
|
11356
|
-
h: Math.min(mediumBlock, height)
|
|
11357
|
-
});
|
|
11358
|
-
scanRegions.push({
|
|
11359
|
-
name: "右上角-中",
|
|
11360
|
-
x: Math.max(0, width - mediumBlock),
|
|
11361
|
-
y: 0,
|
|
11362
|
-
w: Math.min(mediumBlock, width),
|
|
11363
|
-
h: Math.min(mediumBlock, height)
|
|
11364
|
-
});
|
|
11365
|
-
scanRegions.push({
|
|
11366
|
-
name: "左下角-中",
|
|
11367
|
-
x: 0,
|
|
11368
|
-
y: Math.max(0, height - mediumBlock),
|
|
11369
|
-
w: Math.min(mediumBlock, width),
|
|
11370
|
-
h: Math.min(mediumBlock, height)
|
|
11371
|
-
});
|
|
11372
|
-
scanRegions.push({
|
|
11373
|
-
name: "右下角-中",
|
|
11374
|
-
x: Math.max(0, width - mediumBlock),
|
|
11375
|
-
y: Math.max(0, height - mediumBlock),
|
|
11376
|
-
w: Math.min(mediumBlock, width),
|
|
11377
|
-
h: Math.min(mediumBlock, height)
|
|
11378
|
-
});
|
|
11379
|
-
logger.debug("添加四角大块扫描区域");
|
|
11380
|
-
const blockW = Math.min(largeBlock, width);
|
|
11381
|
-
const blockH = Math.min(largeBlock, height);
|
|
11382
|
-
scanRegions.push({
|
|
11383
|
-
name: "左上角-大",
|
|
11384
|
-
x: 0,
|
|
11385
|
-
y: 0,
|
|
11386
|
-
w: blockW,
|
|
11387
|
-
h: blockH
|
|
11388
|
-
});
|
|
11389
|
-
scanRegions.push({
|
|
11390
|
-
name: "右上角-大",
|
|
11391
|
-
x: Math.max(0, width - blockW),
|
|
11392
|
-
y: 0,
|
|
11393
|
-
w: blockW,
|
|
11394
|
-
h: blockH
|
|
11395
|
-
});
|
|
11396
|
-
scanRegions.push({
|
|
11397
|
-
name: "左下角-大",
|
|
11398
|
-
x: 0,
|
|
11399
|
-
y: Math.max(0, height - blockH),
|
|
11400
|
-
w: blockW,
|
|
11401
|
-
h: blockH
|
|
11402
|
-
});
|
|
11403
|
-
scanRegions.push({
|
|
11404
|
-
name: "右下角-大",
|
|
11405
|
-
x: Math.max(0, width - blockW),
|
|
11406
|
-
y: Math.max(0, height - blockH),
|
|
11407
|
-
w: blockW,
|
|
11408
|
-
h: blockH
|
|
11409
|
-
});
|
|
11410
|
-
if (width > mediumBlock * 1.5) {
|
|
11411
|
-
logger.debug("添加顶部/底部中间扫描区域");
|
|
11412
|
-
scanRegions.push({
|
|
11413
|
-
name: "顶部中-小",
|
|
11414
|
-
x: Math.floor((width - smallBlock) / 2),
|
|
11415
|
-
y: 0,
|
|
11416
|
-
w: Math.min(smallBlock, width),
|
|
11417
|
-
h: Math.min(smallBlock, height)
|
|
11418
|
-
});
|
|
11419
|
-
if (height > mediumBlock * 1.5) scanRegions.push({
|
|
11420
|
-
name: "底部中-小",
|
|
11421
|
-
x: Math.floor((width - smallBlock) / 2),
|
|
11422
|
-
y: Math.max(0, height - smallBlock),
|
|
11423
|
-
w: Math.min(smallBlock, width),
|
|
11424
|
-
h: Math.min(smallBlock, height)
|
|
11425
|
-
});
|
|
11426
|
-
}
|
|
11427
|
-
if (height > mediumBlock * 1.5) {
|
|
11428
|
-
logger.debug("添加左右中间扫描区域");
|
|
11429
|
-
const middleY = Math.floor((height - smallBlock) / 2);
|
|
11430
|
-
scanRegions.push({
|
|
11431
|
-
name: "左中-小",
|
|
11432
|
-
x: 0,
|
|
11433
|
-
y: middleY,
|
|
11434
|
-
w: Math.min(smallBlock, width),
|
|
11435
|
-
h: Math.min(smallBlock, height)
|
|
11436
|
-
});
|
|
11437
|
-
if (width > mediumBlock * 1.5) scanRegions.push({
|
|
11438
|
-
name: "右中-小",
|
|
11439
|
-
x: Math.max(0, width - smallBlock),
|
|
11440
|
-
y: middleY,
|
|
11441
|
-
w: Math.min(smallBlock, width),
|
|
11442
|
-
h: Math.min(smallBlock, height)
|
|
11443
|
-
});
|
|
11444
|
-
}
|
|
11445
|
-
if (width > mediumBlock && height > mediumBlock) {
|
|
11446
|
-
logger.debug("添加中心区域");
|
|
11447
|
-
scanRegions.push({
|
|
11448
|
-
name: "中心-小",
|
|
11449
|
-
x: Math.floor((width - smallBlock) / 2),
|
|
11450
|
-
y: Math.floor((height - smallBlock) / 2),
|
|
11451
|
-
w: Math.min(smallBlock, width),
|
|
11452
|
-
h: Math.min(smallBlock, height)
|
|
11453
|
-
});
|
|
11454
|
-
}
|
|
11455
|
-
logger.debug(`共生成 ${scanRegions.length} 个扫描区域,开始逐个扫描`);
|
|
11456
|
-
for (let i = 0; i < scanRegions.length; i++) {
|
|
11457
|
-
const region = scanRegions[i];
|
|
11458
|
-
logger.debug(`[${i + 1}/${scanRegions.length}] 扫描区域: ${region.name} (位置: ${region.x},${region.y}, 尺寸: ${region.w}x${region.h})`);
|
|
11459
|
-
const regionData = this.extractRegion(imageData, region.x, region.y, region.w, region.h);
|
|
11460
|
-
const result = this.tryRecognizeInRegion(regionData, region.name);
|
|
11461
|
-
if (result) {
|
|
11462
|
-
logger.debug(`二维码识别完成,共扫描了 ${i + 1}/${scanRegions.length} 个区域`);
|
|
11463
|
-
return result;
|
|
11464
|
-
}
|
|
11465
|
-
}
|
|
11466
|
-
logger.warn(`图片中未识别到二维码,已扫描所有 ${scanRegions.length} 个区域`);
|
|
11467
|
-
return null;
|
|
11468
|
-
} catch (error) {
|
|
11469
|
-
logger.error("解析图片时发生错误:", error);
|
|
11470
|
-
return null;
|
|
11471
|
-
}
|
|
11472
|
-
}
|
|
11473
|
-
/**
|
|
11474
|
-
* 检查二维码内容是否包含支持的平台链接
|
|
11475
|
-
* @param qrContent 二维码内容
|
|
11476
|
-
* @returns 是否包含支持的平台链接
|
|
11477
|
-
*/
|
|
11478
|
-
static isSupportedPlatform(qrContent) {
|
|
11479
|
-
return [
|
|
11480
|
-
/(https?:\/\/)?(www|v|jx|m|jingxuan)\.(douyin|iesdouyin)\.com/i,
|
|
11481
|
-
/https:\/\/aweme\.snssdk\.com\/aweme\/v1\/play/i,
|
|
11482
|
-
/(bilibili\.com|b23\.tv|t\.bilibili\.com|bili2233\.cn|\bBV[1-9a-zA-Z]{10}\b|\bav\d+\b)/i,
|
|
11483
|
-
/(快手.*快手|v\.kuaishou\.com|kuaishou\.com)/,
|
|
11484
|
-
/(xiaohongshu\.com|xhslink\.com)/
|
|
11485
|
-
].some((pattern) => pattern.test(qrContent));
|
|
11486
|
-
}
|
|
11487
|
-
};
|
|
11488
10910
|
/** 常用工具合集 */
|
|
11489
10911
|
var Common = new class Tools {
|
|
11490
10912
|
static VIDEO_PREVIEW_REMOVED_RETENTION_MS = 300 * 1e3;
|
|
@@ -11525,8 +10947,15 @@ var Common = new class Tools {
|
|
|
11525
10947
|
async tryScanImageQrCode(imageUrl, source) {
|
|
11526
10948
|
try {
|
|
11527
10949
|
logger.debug(`检测到${source}为图片,尝试识别二维码...`);
|
|
11528
|
-
const
|
|
11529
|
-
|
|
10950
|
+
const response = await axios.get(imageUrl, { responseType: "arraybuffer" });
|
|
10951
|
+
const qrContent = scan(Buffer.from(response.data));
|
|
10952
|
+
if (qrContent && [
|
|
10953
|
+
/(https?:\/\/)?(www|v|jx|m|jingxuan)\.(douyin|iesdouyin)\.com/i,
|
|
10954
|
+
/https:\/\/aweme\.snssdk\.com\/aweme\/v1\/play/i,
|
|
10955
|
+
/(bilibili\.com|b23\.tv|t\.bilibili\.com|bili2233\.cn|\bBV[1-9a-zA-Z]{10}\b|\bav\d+\b)/i,
|
|
10956
|
+
/(快手.*快手|v\.kuaishou\.com|kuaishou\.com)/,
|
|
10957
|
+
/(xiaohongshu\.com|xhslink\.com)/
|
|
10958
|
+
].some((pattern) => pattern.test(qrContent))) {
|
|
11530
10959
|
logger.debug(`从${source}二维码中识别到支持的平台链接: ${qrContent}`);
|
|
11531
10960
|
return qrContent;
|
|
11532
10961
|
} else if (qrContent) logger.debug(`识别到二维码内容但不是支持的平台: ${qrContent}`);
|
|
@@ -13565,6 +12994,11 @@ var PreviewLayout = ({ state }) => {
|
|
|
13565
12994
|
});
|
|
13566
12995
|
};
|
|
13567
12996
|
//#endregion
|
|
12997
|
+
//#region ../template/src/utils/cn.ts
|
|
12998
|
+
function cn(...inputs) {
|
|
12999
|
+
return twMerge(clsx(inputs));
|
|
13000
|
+
}
|
|
13001
|
+
//#endregion
|
|
13568
13002
|
//#region ../template/src/components/common/GlowImage.tsx
|
|
13569
13003
|
var GlowImage = ({ src, children, alt, className, imgClassName, mode = "blur-layer", blurRadius = 18, glowStrength = .6, scale = 1.06, shadowRadius = 28, crossOrigin }) => {
|
|
13570
13004
|
const [shadowColor, setShadowColor] = import_react.useState("rgba(255,255,255,0.5)");
|
|
@@ -14592,7 +14026,7 @@ var ViteLogo = ({ className = "w-auto h-12" }) => /* @__PURE__ */ (0, import_jsx
|
|
|
14592
14026
|
var DefaultLayout = ({ children, version, data, scale = 3, className = "", style = {}, watermarkTextBitSize }) => {
|
|
14593
14027
|
const { useDarkTheme } = data;
|
|
14594
14028
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
14595
|
-
className:
|
|
14029
|
+
className: cn("w-360 shrink-0 bg-background text-foreground font-[HarmonyOSHans-Regular]", useDarkTheme ? "dark" : "light", className),
|
|
14596
14030
|
"data-theme": useDarkTheme ? "dark" : "light",
|
|
14597
14031
|
id: "container",
|
|
14598
14032
|
style: {
|
|
@@ -14668,12 +14102,12 @@ var DefaultLayout = ({ children, version, data, scale = 3, className = "", style
|
|
|
14668
14102
|
className: "w-4 h-4"
|
|
14669
14103
|
}),
|
|
14670
14104
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
14671
|
-
className:
|
|
14105
|
+
className: cn(version.hasUpdate && "text-success", !version.hasUpdate && version.releaseType === "Preview" && "text-warning"),
|
|
14672
14106
|
children: version.hasUpdate ? "有可用更新" : version.releaseType
|
|
14673
14107
|
})
|
|
14674
14108
|
]
|
|
14675
14109
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
14676
|
-
className:
|
|
14110
|
+
className: cn("text-5xl font-bold tracking-wide", version.hasUpdate && "text-success", !version.hasUpdate && version.releaseType === "Preview" && "text-warning"),
|
|
14677
14111
|
children: ["v", version.pluginVersion]
|
|
14678
14112
|
})]
|
|
14679
14113
|
}),
|
|
@@ -14750,7 +14184,7 @@ var DefaultLayout = ({ children, version, data, scale = 3, className = "", style
|
|
|
14750
14184
|
var UsernameDisplay = ({ metadata, className, style }) => {
|
|
14751
14185
|
const vipColor = metadata.vipStatus === 1 ? metadata.nicknameColor ?? "#FB7299" : null;
|
|
14752
14186
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
14753
|
-
className:
|
|
14187
|
+
className: cn(!vipColor && "text-foreground", "font-bold", className),
|
|
14754
14188
|
style: {
|
|
14755
14189
|
...style,
|
|
14756
14190
|
...vipColor ? { color: vipColor } : {}
|
|
@@ -15182,14 +14616,14 @@ var BangumiBilibiliEpisodes = (props) => {
|
|
|
15182
14616
|
className: "flex justify-center items-center text-7xl font-bold select-text text-foreground",
|
|
15183
14617
|
children: day
|
|
15184
14618
|
}),
|
|
15185
|
-
!isLastOfAll && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className:
|
|
14619
|
+
!isLastOfAll && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn("mt-8 w-1 bg-divider", episodesInSameDate > 1 ? "h-110" : "h-95") })
|
|
15186
14620
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
15187
14621
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-1 h-10 bg-divider" }),
|
|
15188
14622
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "my-2 w-4 h-4 rounded-full bg-divider" }),
|
|
15189
|
-
(!isLastOfAll || episodesInSameDate > 1) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className:
|
|
14623
|
+
(!isLastOfAll || episodesInSameDate > 1) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn("w-1 bg-divider", isLastOfDate ? "h-110" : "h-130") })
|
|
15190
14624
|
] })
|
|
15191
14625
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
15192
|
-
className:
|
|
14626
|
+
className: cn("flex-1 min-w-0", !isLastOfAll && isLastOfDate && "mb-20"),
|
|
15193
14627
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
15194
14628
|
className: "flex justify-between items-center mb-10",
|
|
15195
14629
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -15893,6 +15327,34 @@ var renderRichTextToReact = (document, options = {}) => {
|
|
|
15893
15327
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: document.nodes.map((node, index) => renderNodeToReact(node, index, options)) });
|
|
15894
15328
|
};
|
|
15895
15329
|
//#endregion
|
|
15330
|
+
//#region ../template/src/utils/QRcode.ts
|
|
15331
|
+
/**
|
|
15332
|
+
* Generates a QR code image in base64 format for the given text.
|
|
15333
|
+
*
|
|
15334
|
+
* @param {string} text - The text to encode in the QR code.
|
|
15335
|
+
* @param {boolean} [useDarkTheme=false] - Whether to use a dark theme for the QR code.
|
|
15336
|
+
* @return {string} The base64-encoded QR code image.
|
|
15337
|
+
*/
|
|
15338
|
+
var generateQRCode = (text, useDarkTheme = false) => {
|
|
15339
|
+
return `data:image/webp;base64,${generate({
|
|
15340
|
+
data: text,
|
|
15341
|
+
size: 1e3,
|
|
15342
|
+
dotsOptions: {
|
|
15343
|
+
dotType: "rounded",
|
|
15344
|
+
color: useDarkTheme ? "rgba(255, 255, 255, 0.9)" : "rgba(0, 0, 0, 0.8)"
|
|
15345
|
+
},
|
|
15346
|
+
cornersSquareOptions: {
|
|
15347
|
+
cornerType: "extra-rounded",
|
|
15348
|
+
color: useDarkTheme ? "rgba(255, 255, 255, 0.9)" : "rgba(0, 0, 0, 0.8)"
|
|
15349
|
+
},
|
|
15350
|
+
cornersDotOptions: {
|
|
15351
|
+
cornerType: "dot",
|
|
15352
|
+
color: useDarkTheme ? "rgba(255, 255, 255, 0.9)" : "rgba(0, 0, 0, 0.8)"
|
|
15353
|
+
},
|
|
15354
|
+
backgroundOptions: { transparent: true }
|
|
15355
|
+
}, "webp", "base64")}`;
|
|
15356
|
+
};
|
|
15357
|
+
//#endregion
|
|
15896
15358
|
//#region ../template/src/components/platforms/bilibili/Icons.tsx
|
|
15897
15359
|
/** B站官方点赞图标 */
|
|
15898
15360
|
var ThumbUpIcon = ({ className, size, variant = "solid" }) => {
|
|
@@ -16109,7 +15571,7 @@ var FansMedal = ({ detail }) => {
|
|
|
16109
15571
|
const nameColor = intToRgba(detail.medal_color_name);
|
|
16110
15572
|
const levelColor = intToRgba(detail.medal_color_level);
|
|
16111
15573
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
16112
|
-
className:
|
|
15574
|
+
className: cn("inline-flex items-center shrink-0", "h-14 rounded-full border"),
|
|
16113
15575
|
style: {
|
|
16114
15576
|
borderColor,
|
|
16115
15577
|
backgroundImage: `linear-gradient(90deg, ${bgStart}, ${bgEnd})`
|
|
@@ -16121,7 +15583,7 @@ var FansMedal = ({ detail }) => {
|
|
|
16121
15583
|
referrerPolicy: "no-referrer",
|
|
16122
15584
|
crossOrigin: "anonymous"
|
|
16123
15585
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
16124
|
-
className:
|
|
15586
|
+
className: cn("flex items-center", detail.first_icon ? "pr-4" : "px-4"),
|
|
16125
15587
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
16126
15588
|
className: "font-medium whitespace-nowrap text-3xl",
|
|
16127
15589
|
style: { color: nameColor },
|
|
@@ -16139,7 +15601,7 @@ var FansMedal = ({ detail }) => {
|
|
|
16139
15601
|
*/
|
|
16140
15602
|
var TopBadge = () => {
|
|
16141
15603
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
16142
|
-
className:
|
|
15604
|
+
className: cn("inline-flex justify-center items-center", "px-4 py-2 mr-4 mb-1 rounded-xl", "text-[45px] font-light leading-none", "align-baseline", "bg-[#ffedf5] text-[#ff799e]", "dark:bg-[#321b26] dark:text-[#cb5775]"),
|
|
16143
15605
|
children: "置顶"
|
|
16144
15606
|
});
|
|
16145
15607
|
};
|
|
@@ -16213,21 +15675,15 @@ var BilibiliLogo = () => {
|
|
|
16213
15675
|
* @param props 组件属性
|
|
16214
15676
|
* @returns JSX元素
|
|
16215
15677
|
*/
|
|
16216
|
-
var QRCodeSection$
|
|
15678
|
+
var QRCodeSection$1 = ({ share_url, useDarkTheme }) => {
|
|
16217
15679
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
16218
15680
|
className: "flex flex-col items-center",
|
|
16219
15681
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
16220
15682
|
className: "flex justify-center items-center w-100 h-100 p-4",
|
|
16221
|
-
children:
|
|
16222
|
-
src:
|
|
15683
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
15684
|
+
src: generateQRCode(share_url, useDarkTheme),
|
|
16223
15685
|
alt: "二维码",
|
|
16224
15686
|
className: "object-contain w-full h-full rounded-lg"
|
|
16225
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
16226
|
-
className: "flex flex-col justify-center items-center text-muted",
|
|
16227
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
16228
|
-
className: "text-lg",
|
|
16229
|
-
children: "二维码生成失败"
|
|
16230
|
-
})
|
|
16231
15687
|
})
|
|
16232
15688
|
})
|
|
16233
15689
|
});
|
|
@@ -16314,7 +15770,10 @@ var VideoInfoHeader$1 = (props) => {
|
|
|
16314
15770
|
})]
|
|
16315
15771
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
16316
15772
|
className: "shrink-0",
|
|
16317
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QRCodeSection$
|
|
15773
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QRCodeSection$1, {
|
|
15774
|
+
share_url: props.share_url,
|
|
15775
|
+
useDarkTheme: props.useDarkTheme
|
|
15776
|
+
})
|
|
16318
15777
|
})]
|
|
16319
15778
|
})
|
|
16320
15779
|
});
|
|
@@ -16326,7 +15785,7 @@ var VideoInfoHeader$1 = (props) => {
|
|
|
16326
15785
|
*/
|
|
16327
15786
|
var CommentItemComponent$2 = ({ isLast = false, ...props }) => {
|
|
16328
15787
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
16329
|
-
className:
|
|
15788
|
+
className: cn("flex relative px-10 py-10 max-w-full", { "pb-0": isLast }),
|
|
16330
15789
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
16331
15790
|
className: "relative mr-[33.75px] shrink-0 w-50 h-50 flex items-center justify-center",
|
|
16332
15791
|
children: [
|
|
@@ -16675,10 +16134,7 @@ var BilibiliComment = import_react.memo((props) => {
|
|
|
16675
16134
|
className: "p-5",
|
|
16676
16135
|
children: [
|
|
16677
16136
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-20" }),
|
|
16678
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoInfoHeader$1, {
|
|
16679
|
-
...processedData,
|
|
16680
|
-
qrCodeDataUrl: props.qrCodeDataUrl
|
|
16681
|
-
}),
|
|
16137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoInfoHeader$1, { ...processedData }),
|
|
16682
16138
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
16683
16139
|
className: "overflow-hidden mt-8",
|
|
16684
16140
|
children: processedData.CommentsData.length > 0 ? processedData.CommentsData.map((comment, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommentItemComponent$2, {
|
|
@@ -16981,16 +16437,10 @@ var BilibiliArticleFooter = import_react.memo((props) => {
|
|
|
16981
16437
|
})]
|
|
16982
16438
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
16983
16439
|
className: "flex flex-col items-center gap-4",
|
|
16984
|
-
children:
|
|
16985
|
-
src: props.
|
|
16440
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
16441
|
+
src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
|
|
16986
16442
|
alt: "二维码",
|
|
16987
16443
|
className: "h-auto w-75 rounded-2xl"
|
|
16988
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
16989
|
-
className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
|
|
16990
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
16991
|
-
className: "text-muted",
|
|
16992
|
-
children: "二维码"
|
|
16993
|
-
})
|
|
16994
16444
|
})
|
|
16995
16445
|
})]
|
|
16996
16446
|
});
|
|
@@ -17145,15 +16595,12 @@ var BilibiliDynamicFooter = (props) => {
|
|
|
17145
16595
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
17146
16596
|
className: "text-7xl font-bold select-text",
|
|
17147
16597
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UsernameDisplay, { metadata: props.usernameMeta })
|
|
17148
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.
|
|
16598
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
17149
16599
|
className: "flex gap-2 items-center text-4xl text-muted",
|
|
17150
|
-
children:
|
|
17151
|
-
className: "text-muted",
|
|
17152
|
-
children: "#"
|
|
17153
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
16600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
17154
16601
|
className: "text-muted select-text",
|
|
17155
16602
|
children: ["UID: ", props.user_shortid]
|
|
17156
|
-
})
|
|
16603
|
+
})
|
|
17157
16604
|
})]
|
|
17158
16605
|
})]
|
|
17159
16606
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -17217,16 +16664,10 @@ var BilibiliDynamicFooter = (props) => {
|
|
|
17217
16664
|
})]
|
|
17218
16665
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
17219
16666
|
className: "flex flex-col items-center gap-4",
|
|
17220
|
-
children:
|
|
17221
|
-
src: props.
|
|
16667
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
16668
|
+
src: generateQRCode(props.share_url, props.useDarkTheme),
|
|
17222
16669
|
alt: "二维码",
|
|
17223
16670
|
className: "h-auto w-75 rounded-2xl"
|
|
17224
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
17225
|
-
className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
|
|
17226
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
17227
|
-
className: "text-muted",
|
|
17228
|
-
children: "二维码"
|
|
17229
|
-
})
|
|
17230
16671
|
})
|
|
17231
16672
|
})]
|
|
17232
16673
|
});
|
|
@@ -17443,20 +16884,9 @@ var BilibiliVideoDynamic = import_react.memo((props) => {
|
|
|
17443
16884
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliVideoContent, { ...props }),
|
|
17444
16885
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
17445
16886
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicStatus, { ...props.data }),
|
|
17446
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className:
|
|
16887
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn(props.data.staff && props.data.staff.length > 0 && "h-23", !props.data.staff && "h-40") }),
|
|
17447
16888
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliVideoStaff, { ...props }),
|
|
17448
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, {
|
|
17449
|
-
avatar_url: props.data.avatar_url,
|
|
17450
|
-
frame: props.data.frame,
|
|
17451
|
-
usernameMeta: props.data.usernameMeta,
|
|
17452
|
-
user_shortid: props.data.user_shortid,
|
|
17453
|
-
total_favorited: props.data.total_favorited,
|
|
17454
|
-
following_count: props.data.following_count,
|
|
17455
|
-
fans: props.data.fans,
|
|
17456
|
-
dynamicTYPE: props.data.dynamicTYPE,
|
|
17457
|
-
share_url: props.data.share_url,
|
|
17458
|
-
qrCodeDataUrl: props.qrCodeDataUrl
|
|
17459
|
-
})
|
|
16889
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, { ...props.data })
|
|
17460
16890
|
]
|
|
17461
16891
|
})
|
|
17462
16892
|
});
|
|
@@ -17647,7 +17077,7 @@ var BilibiliUgcCard = ({ ugc }) => {
|
|
|
17647
17077
|
var BilibiliAdditionalCard = ({ additional, gap = true, className }) => {
|
|
17648
17078
|
if (!additional) return null;
|
|
17649
17079
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
17650
|
-
className:
|
|
17080
|
+
className: cn(gap && "px-20 pb-20", className),
|
|
17651
17081
|
children: [
|
|
17652
17082
|
additional.type === "ADDITIONAL_TYPE_RESERVE" && additional.reserve && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliReserveCard, { reserve: additional.reserve }),
|
|
17653
17083
|
additional.type === "ADDITIONAL_TYPE_VOTE" && additional.vote && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliVoteCard, { vote: additional.vote }),
|
|
@@ -17770,16 +17200,16 @@ var BilibiliDynamicContent = (props) => {
|
|
|
17770
17200
|
})]
|
|
17771
17201
|
}),
|
|
17772
17202
|
layoutType === "vertical" && props.image_url.map((img, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
17773
|
-
className: "flex
|
|
17203
|
+
className: "flex items-center",
|
|
17774
17204
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
17775
17205
|
className: "flex overflow-hidden flex-col flex-1 items-center rounded-4xl shadow-large",
|
|
17776
17206
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EnhancedImage, {
|
|
17777
17207
|
src: img.image_src,
|
|
17778
17208
|
alt: "封面",
|
|
17779
|
-
className: "object-contain w-full h-full rounded-
|
|
17209
|
+
className: "object-contain w-full h-full rounded-5xl"
|
|
17780
17210
|
})
|
|
17781
17211
|
})
|
|
17782
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-
|
|
17212
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-10" })] }, index)),
|
|
17783
17213
|
(layoutType === "waterfall" || layoutType === "grid") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-18" })
|
|
17784
17214
|
]
|
|
17785
17215
|
}),
|
|
@@ -17806,19 +17236,8 @@ var BilibiliDrawDynamic = import_react.memo((props) => {
|
|
|
17806
17236
|
additional: props.data.additional
|
|
17807
17237
|
}),
|
|
17808
17238
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicStatus, { ...props.data }),
|
|
17809
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-
|
|
17810
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, {
|
|
17811
|
-
avatar_url: props.data.avatar_url,
|
|
17812
|
-
frame: props.data.frame,
|
|
17813
|
-
usernameMeta: props.data.usernameMeta,
|
|
17814
|
-
user_shortid: props.data.user_shortid,
|
|
17815
|
-
total_favorited: props.data.total_favorited,
|
|
17816
|
-
following_count: props.data.following_count,
|
|
17817
|
-
fans: props.data.fans,
|
|
17818
|
-
dynamicTYPE: props.data.dynamicTYPE,
|
|
17819
|
-
share_url: props.data.share_url,
|
|
17820
|
-
qrCodeDataUrl: props.qrCodeDataUrl
|
|
17821
|
-
})
|
|
17239
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-40" }),
|
|
17240
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, { ...props.data })
|
|
17822
17241
|
]
|
|
17823
17242
|
})
|
|
17824
17243
|
});
|
|
@@ -17831,7 +17250,7 @@ BilibiliDrawDynamic.displayName = "BilibiliDrawDynamic";
|
|
|
17831
17250
|
*/
|
|
17832
17251
|
var OriginalUserInfo = (props) => {
|
|
17833
17252
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
17834
|
-
className: "flex justify-between items-center
|
|
17253
|
+
className: "flex justify-between items-center pl-8 pr-0",
|
|
17835
17254
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
17836
17255
|
className: "flex gap-10 items-center min-w-0",
|
|
17837
17256
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -17868,6 +17287,7 @@ var OriginalAVContent = ({ content }) => {
|
|
|
17868
17287
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
17869
17288
|
className: "px-12 py-8 mt-4 w-full rounded-8xl bg-surface-secondary",
|
|
17870
17289
|
children: [
|
|
17290
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-10" }),
|
|
17871
17291
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(OriginalUserInfo, {
|
|
17872
17292
|
avatar_url: content.avatar_url,
|
|
17873
17293
|
frame: content.frame,
|
|
@@ -17875,10 +17295,11 @@ var OriginalAVContent = ({ content }) => {
|
|
|
17875
17295
|
create_time: content.create_time,
|
|
17876
17296
|
decoration_card: content.decoration_card
|
|
17877
17297
|
}),
|
|
17298
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
17878
17299
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
17879
|
-
className: "flex flex-col items-center
|
|
17300
|
+
className: "flex flex-col items-center",
|
|
17880
17301
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
17881
|
-
className: "flex overflow-hidden relative flex-col items-center w-
|
|
17302
|
+
className: "flex overflow-hidden relative flex-col items-center w-full rounded-4xl rounded-10 aspect-video shadow-large",
|
|
17882
17303
|
children: [
|
|
17883
17304
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(EnhancedImage, {
|
|
17884
17305
|
src: content.cover,
|
|
@@ -17902,8 +17323,9 @@ var OriginalAVContent = ({ content }) => {
|
|
|
17902
17323
|
]
|
|
17903
17324
|
})
|
|
17904
17325
|
}),
|
|
17326
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-10" }),
|
|
17905
17327
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
17906
|
-
className: "
|
|
17328
|
+
className: "pl-2 text-6xl font-bold select-text leading-20 text-foreground",
|
|
17907
17329
|
children: content.title && renderRichTextToReact(content.title, {
|
|
17908
17330
|
at: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
|
|
17909
17331
|
topic: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
|
|
@@ -17912,7 +17334,8 @@ var OriginalAVContent = ({ content }) => {
|
|
|
17912
17334
|
vote: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
|
|
17913
17335
|
viewPicture: { className: "text-[#006A9E] dark:text-[#58B0D5]" }
|
|
17914
17336
|
})
|
|
17915
|
-
})
|
|
17337
|
+
}),
|
|
17338
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-4" })
|
|
17916
17339
|
]
|
|
17917
17340
|
});
|
|
17918
17341
|
};
|
|
@@ -17930,27 +17353,25 @@ var OriginalDrawContent = ({ content }) => {
|
|
|
17930
17353
|
create_time: content.create_time,
|
|
17931
17354
|
decoration_card: content.decoration_card
|
|
17932
17355
|
}),
|
|
17933
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
17934
|
-
|
|
17935
|
-
|
|
17936
|
-
|
|
17937
|
-
|
|
17938
|
-
|
|
17939
|
-
|
|
17940
|
-
|
|
17941
|
-
|
|
17942
|
-
|
|
17943
|
-
|
|
17944
|
-
|
|
17945
|
-
|
|
17946
|
-
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
17951
|
-
|
|
17952
|
-
})]
|
|
17953
|
-
})
|
|
17356
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-15" }),
|
|
17357
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
17358
|
+
className: "text-5xl leading-relaxed text-foreground wrap-break-word",
|
|
17359
|
+
children: [content.title && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
17360
|
+
className: "text-6xl font-bold",
|
|
17361
|
+
children: [
|
|
17362
|
+
content.title,
|
|
17363
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
|
|
17364
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {})
|
|
17365
|
+
]
|
|
17366
|
+
}), content.text && renderRichTextToReact(content.text, {
|
|
17367
|
+
at: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
|
|
17368
|
+
topic: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
|
|
17369
|
+
lottery: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
|
|
17370
|
+
webLink: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
|
|
17371
|
+
vote: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
|
|
17372
|
+
viewPicture: { className: "text-[#006A9E] dark:text-[#58B0D5]" },
|
|
17373
|
+
iconScale: .8
|
|
17374
|
+
})]
|
|
17954
17375
|
}),
|
|
17955
17376
|
content.image_url && content.image_url.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
17956
17377
|
className: "flex justify-center py-11 pb-0",
|
|
@@ -18143,20 +17564,8 @@ var BilibiliForwardDynamic = import_react.memo((props) => {
|
|
|
18143
17564
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliForwardContent, { ...props.data }),
|
|
18144
17565
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-25" }),
|
|
18145
17566
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicStatus, { ...props.data }),
|
|
18146
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-
|
|
18147
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, {
|
|
18148
|
-
avatar_url: props.data.avatar_url,
|
|
18149
|
-
frame: props.data.frame,
|
|
18150
|
-
usernameMeta: props.data.usernameMeta,
|
|
18151
|
-
user_shortid: props.data.user_shortid,
|
|
18152
|
-
total_favorited: props.data.total_favorited,
|
|
18153
|
-
following_count: props.data.following_count,
|
|
18154
|
-
fans: props.data.fans,
|
|
18155
|
-
dynamicTYPE: props.data.dynamicTYPE,
|
|
18156
|
-
share_url: props.data.share_url,
|
|
18157
|
-
qrCodeDataUrl: props.qrCodeDataUrl,
|
|
18158
|
-
showUidHash: true
|
|
18159
|
-
})
|
|
17567
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-40" }),
|
|
17568
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, { ...props.data })
|
|
18160
17569
|
]
|
|
18161
17570
|
})
|
|
18162
17571
|
});
|
|
@@ -18211,7 +17620,7 @@ var getSingleLineFontSize = (content, base, min) => {
|
|
|
18211
17620
|
return min;
|
|
18212
17621
|
};
|
|
18213
17622
|
var BilibiliLiveDynamic = import_react.memo((props) => {
|
|
18214
|
-
const { data
|
|
17623
|
+
const { data } = props;
|
|
18215
17624
|
const isDark = data.useDarkTheme === true;
|
|
18216
17625
|
const { bgColor, primaryColor, secondaryColor, mutedColor, accentColor, deepColor, coverShade } = props.posterPalettes ? isDark ? props.posterPalettes.dark : props.posterPalettes.light : props.posterPalette ?? (isDark ? DARK_FALLBACK : LIGHT_FALLBACK);
|
|
18217
17626
|
const logo = isDark ? "/image/bilibili/bilibili-light.png" : "/image/bilibili/bilibili.png";
|
|
@@ -18671,8 +18080,8 @@ var BilibiliLiveDynamic = import_react.memo((props) => {
|
|
|
18671
18080
|
className: "absolute right-22 top-1/2 h-52 w-52 -translate-y-1/2 rounded-full blur-[48px]",
|
|
18672
18081
|
style: { backgroundColor: withAlphaFromCss(accentColor, isDark ? .16 : .1) }
|
|
18673
18082
|
}),
|
|
18674
|
-
|
|
18675
|
-
src:
|
|
18083
|
+
data.share_url ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
18084
|
+
src: generateQRCode(data.share_url, isDark),
|
|
18676
18085
|
alt: "二维码",
|
|
18677
18086
|
className: "relative h-100 w-100 object-contain drop-shadow-[0_20px_38px_rgba(0,0,0,0.18)]"
|
|
18678
18087
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -18737,18 +18146,7 @@ var BilibiliWordDynamic = import_react.memo((props) => {
|
|
|
18737
18146
|
}),
|
|
18738
18147
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicStatus, { ...props.data }),
|
|
18739
18148
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-23" }),
|
|
18740
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, {
|
|
18741
|
-
avatar_url: props.data.avatar_url,
|
|
18742
|
-
frame: props.data.frame,
|
|
18743
|
-
usernameMeta: props.data.usernameMeta,
|
|
18744
|
-
user_shortid: props.data.user_shortid,
|
|
18745
|
-
total_favorited: props.data.total_favorited,
|
|
18746
|
-
following_count: props.data.following_count,
|
|
18747
|
-
fans: props.data.fans,
|
|
18748
|
-
dynamicTYPE: props.data.dynamicTYPE,
|
|
18749
|
-
share_url: props.data.share_url,
|
|
18750
|
-
qrCodeDataUrl: props.qrCodeDataUrl
|
|
18751
|
-
})
|
|
18149
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BilibiliDynamicFooter, { ...props.data })
|
|
18752
18150
|
]
|
|
18753
18151
|
})
|
|
18754
18152
|
});
|
|
@@ -18763,7 +18161,7 @@ BilibiliWordDynamic.displayName = "BilibiliWordDynamic";
|
|
|
18763
18161
|
*/
|
|
18764
18162
|
var BilibiliQrcodeImg = import_react.memo((props) => {
|
|
18765
18163
|
const isDark = props.data?.useDarkTheme ?? false;
|
|
18766
|
-
const
|
|
18164
|
+
const qrCodeDataUrl = generateQRCode(props.data.share_url, isDark);
|
|
18767
18165
|
const theme = {
|
|
18768
18166
|
bg: isDark ? "#000000" : "#FFFFFF",
|
|
18769
18167
|
text: isDark ? "#FFFFFF" : "#000000",
|
|
@@ -19869,16 +19267,10 @@ var DouyinArticleWork = (props) => {
|
|
|
19869
19267
|
className: "flex justify-between items-start px-20 pb-20",
|
|
19870
19268
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection$3, { ...props }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
19871
19269
|
className: "flex flex-col items-center gap-4",
|
|
19872
|
-
children:
|
|
19873
|
-
src: props.
|
|
19270
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
19271
|
+
src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
|
|
19874
19272
|
alt: "二维码",
|
|
19875
19273
|
className: "h-auto w-75 rounded-xl"
|
|
19876
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
19877
|
-
className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
|
|
19878
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
19879
|
-
className: "text-muted",
|
|
19880
|
-
children: "二维码"
|
|
19881
|
-
})
|
|
19882
19274
|
})
|
|
19883
19275
|
})]
|
|
19884
19276
|
})
|
|
@@ -19925,24 +19317,15 @@ var formatPublishTime = (timestamp) => {
|
|
|
19925
19317
|
* @param props 组件属性
|
|
19926
19318
|
* @returns JSX元素
|
|
19927
19319
|
*/
|
|
19928
|
-
var QRCodeSection
|
|
19320
|
+
var QRCodeSection = (props) => {
|
|
19929
19321
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
19930
19322
|
className: "flex flex-col items-center",
|
|
19931
19323
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
19932
19324
|
className: "flex justify-center items-center w-100 h-100 p-4",
|
|
19933
|
-
children:
|
|
19934
|
-
src:
|
|
19325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
19326
|
+
src: generateQRCode(props.share_url, props.useDarkTheme),
|
|
19935
19327
|
alt: "二维码",
|
|
19936
19328
|
className: "object-contain w-full h-full rounded-lg"
|
|
19937
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
19938
|
-
className: "flex flex-col justify-center items-center text-muted",
|
|
19939
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(QrCode, {
|
|
19940
|
-
width: 80,
|
|
19941
|
-
className: "mb-4"
|
|
19942
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
19943
|
-
className: "text-lg",
|
|
19944
|
-
children: "二维码生成失败"
|
|
19945
|
-
})]
|
|
19946
19329
|
})
|
|
19947
19330
|
})
|
|
19948
19331
|
});
|
|
@@ -20073,7 +19456,7 @@ var VideoInfoHeader = (props) => {
|
|
|
20073
19456
|
]
|
|
20074
19457
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20075
19458
|
className: "shrink-0",
|
|
20076
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QRCodeSection
|
|
19459
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QRCodeSection, { ...props })
|
|
20077
19460
|
})]
|
|
20078
19461
|
})
|
|
20079
19462
|
});
|
|
@@ -20203,26 +19586,26 @@ var ReplyItemComponent = ({ reply, depth = 0, isLast, maxDepth = 6 }) => {
|
|
|
20203
19586
|
})
|
|
20204
19587
|
}), reply.children.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-0.5 bg-border-secondary h-full grow mt-3 rounded-t-full" })]
|
|
20205
19588
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20206
|
-
className:
|
|
19589
|
+
className: cn("flex flex-col pl-6 min-w-0 gap-2", isLast && reply.children.length === 0 ? "pb-16" : "pb-6"),
|
|
20207
19590
|
children: [
|
|
20208
19591
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20209
19592
|
className: "flex flex-nowrap items-center content-center w-full overflow-hidden",
|
|
20210
19593
|
children: [
|
|
20211
19594
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20212
|
-
className:
|
|
19595
|
+
className: cn("mr-2 text-4xl font-normal text-muted", isNicknameLonger ? "min-w-0 truncate shrink" : "shrink-0"),
|
|
20213
19596
|
children: reply.nickname
|
|
20214
19597
|
}),
|
|
20215
19598
|
reply.label_text !== "" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20216
|
-
className:
|
|
19599
|
+
className: cn("px-4 py-1 text-3xl rounded-xl mr-2", reply.label_text === "作者" ? "bg-[#fe2c55] text-white" : "bg-surface text-muted"),
|
|
20217
19600
|
children: reply.label_text
|
|
20218
19601
|
}),
|
|
20219
19602
|
reply.reply_to_username && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20220
|
-
className:
|
|
19603
|
+
className: cn("flex items-center", !isNicknameLonger ? "overflow-hidden min-w-0 shrink" : "shrink-0"),
|
|
20221
19604
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(a, {
|
|
20222
19605
|
weight: "fill",
|
|
20223
19606
|
className: "w-7 h-auto mr-3.5 mx-1 text-muted shrink-0"
|
|
20224
19607
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20225
|
-
className:
|
|
19608
|
+
className: cn("text-4xl font-normal text-muted", !isNicknameLonger && "truncate"),
|
|
20226
19609
|
children: reply.reply_to_username
|
|
20227
19610
|
})]
|
|
20228
19611
|
})
|
|
@@ -20292,7 +19675,7 @@ var ReplyItemComponent = ({ reply, depth = 0, isLast, maxDepth = 6 }) => {
|
|
|
20292
19675
|
*/
|
|
20293
19676
|
var CommentItemComponent$1 = (props) => {
|
|
20294
19677
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20295
|
-
className:
|
|
19678
|
+
className: cn("flex flex-col px-6 pt-8", {
|
|
20296
19679
|
"pb-0": props.isLast,
|
|
20297
19680
|
"pb-10": !props.isLast
|
|
20298
19681
|
}),
|
|
@@ -20409,10 +19792,7 @@ var DouyinComment = import_react.memo((props) => {
|
|
|
20409
19792
|
className: "p-5 px-15",
|
|
20410
19793
|
children: [
|
|
20411
19794
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-20" }),
|
|
20412
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoInfoHeader, {
|
|
20413
|
-
...props.data,
|
|
20414
|
-
qrCodeDataUrl: props.qrCodeDataUrl
|
|
20415
|
-
}),
|
|
19795
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoInfoHeader, { ...props.data }),
|
|
20416
19796
|
randomSuggestWord && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20417
19797
|
className: "mx-auto my-20 mb-5 ml-10",
|
|
20418
19798
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -20756,16 +20136,10 @@ var DouyinDynamic = (props) => {
|
|
|
20756
20136
|
className: "flex justify-between items-start px-20 pb-20",
|
|
20757
20137
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection$2, { ...props }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20758
20138
|
className: "flex flex-col items-center gap-4",
|
|
20759
|
-
children:
|
|
20760
|
-
src: props.
|
|
20139
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20140
|
+
src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
|
|
20761
20141
|
alt: "二维码",
|
|
20762
20142
|
className: "h-auto w-75 rounded-xl"
|
|
20763
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20764
|
-
className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
|
|
20765
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
20766
|
-
className: "text-muted",
|
|
20767
|
-
children: "二维码"
|
|
20768
|
-
})
|
|
20769
20143
|
})
|
|
20770
20144
|
})]
|
|
20771
20145
|
})]
|
|
@@ -20924,8 +20298,8 @@ var DouyinFavoriteList = (props) => {
|
|
|
20924
20298
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-px w-full bg-linear-to-r from-surface-secondary via-border to-transparent" }),
|
|
20925
20299
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
20926
20300
|
className: "flex items-end gap-6",
|
|
20927
|
-
children: [
|
|
20928
|
-
src: props.
|
|
20301
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20302
|
+
src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
|
|
20929
20303
|
className: "w-65 h-auto rounded-2xl mix-blend-multiply",
|
|
20930
20304
|
alt: "QR"
|
|
20931
20305
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -21340,16 +20714,10 @@ var DouyinImageWork = (props) => {
|
|
|
21340
20714
|
className: "flex justify-between items-start px-20 pb-20",
|
|
21341
20715
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection$1, { ...props }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
21342
20716
|
className: "flex flex-col items-center gap-4",
|
|
21343
|
-
children:
|
|
21344
|
-
src: props.
|
|
20717
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
20718
|
+
src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
|
|
21345
20719
|
alt: "二维码",
|
|
21346
20720
|
className: "h-auto w-75 rounded-xl"
|
|
21347
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
21348
|
-
className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
|
|
21349
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
21350
|
-
className: "text-muted",
|
|
21351
|
-
children: "二维码"
|
|
21352
|
-
})
|
|
21353
20721
|
})
|
|
21354
20722
|
})]
|
|
21355
20723
|
})]
|
|
@@ -21582,7 +20950,7 @@ var InfoSection$1 = ({ data }) => {
|
|
|
21582
20950
|
/**
|
|
21583
20951
|
* 底部区域 - 主播信息 + 二维码 + 抖音Logo
|
|
21584
20952
|
*/
|
|
21585
|
-
var BottomSection = ({ data
|
|
20953
|
+
var BottomSection = ({ data }) => {
|
|
21586
20954
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
21587
20955
|
className: "flex justify-between items-end px-16 pt-24 pb-16",
|
|
21588
20956
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -21675,8 +21043,8 @@ var BottomSection = ({ data, qrCodeDataUrl }) => {
|
|
|
21675
21043
|
alt: "抖音",
|
|
21676
21044
|
className: "w-60 h-auto opacity-80 dark:opacity-70"
|
|
21677
21045
|
}),
|
|
21678
|
-
|
|
21679
|
-
src:
|
|
21046
|
+
generateQRCode(data.share_url, data.useDarkTheme) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
21047
|
+
src: generateQRCode(data.share_url, data.useDarkTheme),
|
|
21680
21048
|
alt: "二维码",
|
|
21681
21049
|
className: "h-auto w-75"
|
|
21682
21050
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -21698,7 +21066,6 @@ var BottomSection = ({ data, qrCodeDataUrl }) => {
|
|
|
21698
21066
|
* 抖音直播组件
|
|
21699
21067
|
*/
|
|
21700
21068
|
var DouyinLive = (props) => {
|
|
21701
|
-
const { qrCodeDataUrl } = props;
|
|
21702
21069
|
const d = props.data;
|
|
21703
21070
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DefaultLayout, {
|
|
21704
21071
|
...props,
|
|
@@ -21708,10 +21075,7 @@ var DouyinLive = (props) => {
|
|
|
21708
21075
|
children: [
|
|
21709
21076
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CoverSection$1, { imageUrl: d.image_url }),
|
|
21710
21077
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(InfoSection$1, { data: d }),
|
|
21711
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BottomSection, {
|
|
21712
|
-
data: d,
|
|
21713
|
-
qrCodeDataUrl
|
|
21714
|
-
})
|
|
21078
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BottomSection, { data: d })
|
|
21715
21079
|
]
|
|
21716
21080
|
})]
|
|
21717
21081
|
});
|
|
@@ -21841,7 +21205,7 @@ var MusicAuthorInfoSection = ({ avatarUrl, username, userShortId, totalFavorited
|
|
|
21841
21205
|
* @param props 组件属性
|
|
21842
21206
|
* @returns JSX元素
|
|
21843
21207
|
*/
|
|
21844
|
-
var MusicQRCodeSection = ({
|
|
21208
|
+
var MusicQRCodeSection = ({ share_url, useDarkTheme }) => {
|
|
21845
21209
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
21846
21210
|
className: "flex flex-col-reverse items-center -mb-12 mr-18",
|
|
21847
21211
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -21850,7 +21214,7 @@ var MusicQRCodeSection = ({ qrCodeDataUrl }) => {
|
|
|
21850
21214
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
21851
21215
|
className: "p-2.5 rounded-sm border-[7px] border-dashed border-border",
|
|
21852
21216
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
21853
|
-
src:
|
|
21217
|
+
src: generateQRCode(share_url, useDarkTheme),
|
|
21854
21218
|
alt: "二维码",
|
|
21855
21219
|
className: "w-87.5 h-87.5 select-text"
|
|
21856
21220
|
})
|
|
@@ -21863,7 +21227,7 @@ var MusicQRCodeSection = ({ qrCodeDataUrl }) => {
|
|
|
21863
21227
|
* @returns JSX元素
|
|
21864
21228
|
*/
|
|
21865
21229
|
var DouyinMusicInfo = (props) => {
|
|
21866
|
-
const { data
|
|
21230
|
+
const { data } = props;
|
|
21867
21231
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DefaultLayout, {
|
|
21868
21232
|
...props,
|
|
21869
21233
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
@@ -21897,7 +21261,7 @@ var DouyinMusicInfo = (props) => {
|
|
|
21897
21261
|
fans: data.fans,
|
|
21898
21262
|
useDarkTheme: data.useDarkTheme
|
|
21899
21263
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MusicQRCodeSection, {
|
|
21900
|
-
|
|
21264
|
+
share_url: data.share_url,
|
|
21901
21265
|
useDarkTheme: data.useDarkTheme
|
|
21902
21266
|
})]
|
|
21903
21267
|
})
|
|
@@ -21913,7 +21277,7 @@ var DouyinMusicInfo = (props) => {
|
|
|
21913
21277
|
*/
|
|
21914
21278
|
var DouyinQrcodeImg = import_react.memo((props) => {
|
|
21915
21279
|
const isDark = props.data?.useDarkTheme ?? false;
|
|
21916
|
-
const qrCodeImage = props.data.
|
|
21280
|
+
const qrCodeImage = generateQRCode(props.data.share_url || "", isDark);
|
|
21917
21281
|
const theme = {
|
|
21918
21282
|
bg: isDark ? "#000000" : "#FFFFFF",
|
|
21919
21283
|
text: isDark ? "#FFFFFF" : "#000000",
|
|
@@ -22273,8 +21637,8 @@ var DouyinRecommendList = (props) => {
|
|
|
22273
21637
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-px w-full bg-linear-to-r from-surface-secondary via-border to-transparent" }),
|
|
22274
21638
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
22275
21639
|
className: "flex items-end gap-6",
|
|
22276
|
-
children: [
|
|
22277
|
-
src: props.
|
|
21640
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
21641
|
+
src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
|
|
22278
21642
|
className: "w-65 h-auto rounded-2xl mix-blend-multiply",
|
|
22279
21643
|
alt: "QR"
|
|
22280
21644
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -23534,16 +22898,10 @@ var DouyinVideoWork = (props) => {
|
|
|
23534
22898
|
className: "flex justify-between items-start px-20 pb-20",
|
|
23535
22899
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(UserInfoSection, { ...props }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23536
22900
|
className: "flex flex-col items-center gap-4",
|
|
23537
|
-
children:
|
|
23538
|
-
src: props.
|
|
22901
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
22902
|
+
src: generateQRCode(props.data.share_url, props.data.useDarkTheme),
|
|
23539
22903
|
alt: "二维码",
|
|
23540
22904
|
className: "h-auto w-75 rounded-xl"
|
|
23541
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23542
|
-
className: "flex justify-center items-center rounded-2xl bg-surface w-100 h-100",
|
|
23543
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23544
|
-
className: "text-muted",
|
|
23545
|
-
children: "二维码"
|
|
23546
|
-
})
|
|
23547
22905
|
})
|
|
23548
22906
|
})]
|
|
23549
22907
|
})]
|
|
@@ -23577,28 +22935,19 @@ var formatKuaishouLikeCount = (count) => {
|
|
|
23577
22935
|
* @param props 组件属性
|
|
23578
22936
|
* @returns JSX元素
|
|
23579
22937
|
*/
|
|
23580
|
-
var KuaishouQRCodeSection = (
|
|
22938
|
+
var KuaishouQRCodeSection = (props) => {
|
|
23581
22939
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23582
22940
|
className: "flex flex-col items-center -mr-10",
|
|
23583
22941
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23584
22942
|
className: "mt-20 flex items-center justify-center w-150 h-150 bg-surface rounded-lg shadow-medium",
|
|
23585
|
-
children:
|
|
23586
|
-
src:
|
|
22943
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
22944
|
+
src: generateQRCode(props.share_url, props.useDarkTheme),
|
|
23587
22945
|
alt: "二维码",
|
|
23588
22946
|
className: "object-contain w-full h-full"
|
|
23589
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23590
|
-
className: "flex flex-col justify-center items-center text-muted",
|
|
23591
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(QrCode, {
|
|
23592
|
-
width: 80,
|
|
23593
|
-
className: "mb-4"
|
|
23594
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23595
|
-
className: "text-lg",
|
|
23596
|
-
children: "二维码生成失败"
|
|
23597
|
-
})]
|
|
23598
22947
|
})
|
|
23599
22948
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23600
22949
|
className: "mt-5 text-[45px] text-center text-foreground",
|
|
23601
|
-
children:
|
|
22950
|
+
children: props.Type === "视频" ? "视频直链(永久)" : props.Type === "图集" ? `图集分享链接 共${props.ImageLength}张` : "分享链接"
|
|
23602
22951
|
})]
|
|
23603
22952
|
});
|
|
23604
22953
|
};
|
|
@@ -23607,7 +22956,7 @@ var KuaishouQRCodeSection = ({ qrCodeDataUrl, type, imageLength }) => {
|
|
|
23607
22956
|
* @param props 组件属性
|
|
23608
22957
|
* @returns JSX元素
|
|
23609
22958
|
*/
|
|
23610
|
-
var KuaishouVideoInfoHeader = (
|
|
22959
|
+
var KuaishouVideoInfoHeader = (props) => {
|
|
23611
22960
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23612
22961
|
className: "flex justify-between items-center max-w-300 mx-auto p-5",
|
|
23613
22962
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -23632,33 +22981,33 @@ var KuaishouVideoInfoHeader = ({ type, commentLength, videoSize, likeCount, view
|
|
|
23632
22981
|
className: "flex items-center p-2.5 tracking-[6px] text-[45px] text-left",
|
|
23633
22982
|
children: [
|
|
23634
22983
|
"评论数量:",
|
|
23635
|
-
|
|
22984
|
+
props.CommentLength,
|
|
23636
22985
|
"条"
|
|
23637
22986
|
]
|
|
23638
22987
|
}),
|
|
23639
|
-
|
|
22988
|
+
props.Type === "视频" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
23640
22989
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23641
22990
|
className: "flex items-center p-2.5 tracking-[6px] text-[45px] text-left",
|
|
23642
22991
|
children: [
|
|
23643
22992
|
"视频大小:",
|
|
23644
|
-
|
|
22993
|
+
props.VideoSize,
|
|
23645
22994
|
"MB"
|
|
23646
22995
|
]
|
|
23647
22996
|
}),
|
|
23648
22997
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23649
22998
|
className: "flex items-center p-2.5 tracking-[6px] text-[45px] text-left",
|
|
23650
|
-
children: ["点赞数量:", likeCount]
|
|
22999
|
+
children: ["点赞数量:", props.likeCount]
|
|
23651
23000
|
}),
|
|
23652
23001
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23653
23002
|
className: "flex items-center p-2.5 tracking-[6px] text-[45px] text-left",
|
|
23654
|
-
children: ["观看次数:", viewCount]
|
|
23003
|
+
children: ["观看次数:", props.viewCount]
|
|
23655
23004
|
})
|
|
23656
23005
|
] }),
|
|
23657
|
-
|
|
23006
|
+
props.Type === "图集" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23658
23007
|
className: "flex items-center p-2.5 tracking-[6px] text-[45px] text-left",
|
|
23659
23008
|
children: [
|
|
23660
23009
|
"图片数量:",
|
|
23661
|
-
|
|
23010
|
+
props.ImageLength,
|
|
23662
23011
|
"张"
|
|
23663
23012
|
]
|
|
23664
23013
|
})
|
|
@@ -23672,11 +23021,11 @@ var KuaishouVideoInfoHeader = ({ type, commentLength, videoSize, likeCount, view
|
|
|
23672
23021
|
* @param props 组件属性
|
|
23673
23022
|
* @returns JSX元素
|
|
23674
23023
|
*/
|
|
23675
|
-
var KuaishouCommentItemComponent = ({
|
|
23024
|
+
var KuaishouCommentItemComponent = ({ ...props }, isLast = false) => {
|
|
23676
23025
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23677
23026
|
className: `flex px-10 pt-10 ${isLast ? "pb-0" : "pb-10"}`,
|
|
23678
23027
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
23679
|
-
src:
|
|
23028
|
+
src: props.userimageurl,
|
|
23680
23029
|
className: "mb-12.5 w-[187.5px] h-[187.5px] rounded-full mr-8 object-cover shadow-lg",
|
|
23681
23030
|
alt: "用户头像"
|
|
23682
23031
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -23686,7 +23035,7 @@ var KuaishouCommentItemComponent = ({ comment, isLast = false }) => {
|
|
|
23686
23035
|
className: "mb-12.5 text-[50px] text-foreground/70 relative flex items-center",
|
|
23687
23036
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23688
23037
|
className: "font-medium",
|
|
23689
|
-
children:
|
|
23038
|
+
children: props.nickname
|
|
23690
23039
|
})
|
|
23691
23040
|
}),
|
|
23692
23041
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -23695,13 +23044,13 @@ var KuaishouCommentItemComponent = ({ comment, isLast = false }) => {
|
|
|
23695
23044
|
wordBreak: "break-word",
|
|
23696
23045
|
overflowWrap: "break-word"
|
|
23697
23046
|
},
|
|
23698
|
-
children: renderKuaishouCommentRichText(
|
|
23047
|
+
children: renderKuaishouCommentRichText(props.text)
|
|
23699
23048
|
}),
|
|
23700
|
-
(
|
|
23049
|
+
(props.commentimage || props.sticker) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23701
23050
|
className: "flex my-5 overflow-hidden shadow-md rounded-2xl w-[95%] flex-1",
|
|
23702
23051
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
23703
23052
|
className: "object-contain w-full h-full rounded-2xl",
|
|
23704
|
-
src:
|
|
23053
|
+
src: props.commentimage || props.sticker,
|
|
23705
23054
|
alt: "评论图片"
|
|
23706
23055
|
})
|
|
23707
23056
|
}),
|
|
@@ -23712,17 +23061,17 @@ var KuaishouCommentItemComponent = ({ comment, isLast = false }) => {
|
|
|
23712
23061
|
children: [
|
|
23713
23062
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23714
23063
|
className: "text-[45px] select-text",
|
|
23715
|
-
children: formatKuaishouCommentTime(
|
|
23064
|
+
children: formatKuaishouCommentTime(props.create_time)
|
|
23716
23065
|
}),
|
|
23717
|
-
|
|
23066
|
+
props.ip_label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23718
23067
|
className: "text-[45px] select-text",
|
|
23719
|
-
children:
|
|
23068
|
+
children: props.ip_label
|
|
23720
23069
|
}),
|
|
23721
|
-
|
|
23070
|
+
props.reply_comment_total && props.reply_comment_total > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
23722
23071
|
className: "text-[40px] text-foreground/70",
|
|
23723
23072
|
children: [
|
|
23724
23073
|
"共",
|
|
23725
|
-
|
|
23074
|
+
props.reply_comment_total,
|
|
23726
23075
|
"条回复"
|
|
23727
23076
|
]
|
|
23728
23077
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
@@ -23739,7 +23088,7 @@ var KuaishouCommentItemComponent = ({ comment, isLast = false }) => {
|
|
|
23739
23088
|
className: "stroke-current"
|
|
23740
23089
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
23741
23090
|
className: "text-[50px] select-text",
|
|
23742
|
-
children: formatKuaishouLikeCount(
|
|
23091
|
+
children: formatKuaishouLikeCount(props.digg_count)
|
|
23743
23092
|
})]
|
|
23744
23093
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23745
23094
|
className: "flex items-center transition-colors cursor-pointer hover:text-accent",
|
|
@@ -23767,24 +23116,11 @@ var KuaishouComment = import_react.memo((props) => {
|
|
|
23767
23116
|
className: "p-5",
|
|
23768
23117
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
23769
23118
|
className: "flex justify-between items-center max-w-300 mx-auto p-5",
|
|
23770
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(KuaishouVideoInfoHeader, {
|
|
23771
|
-
type: props.data?.Type || "视频",
|
|
23772
|
-
commentLength: props.data?.CommentLength || 0,
|
|
23773
|
-
videoSize: props.data?.VideoSize,
|
|
23774
|
-
likeCount: props.data?.likeCount,
|
|
23775
|
-
viewCount: props.data?.viewCount,
|
|
23776
|
-
imageLength: props.data?.ImageLength,
|
|
23777
|
-
useDarkTheme: props.data?.useDarkTheme
|
|
23778
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KuaishouQRCodeSection, {
|
|
23779
|
-
qrCodeDataUrl: props.qrCodeDataUrl || "",
|
|
23780
|
-
type: props.data?.Type || "视频",
|
|
23781
|
-
imageLength: props.data?.ImageLength,
|
|
23782
|
-
useDarkTheme: props.data?.useDarkTheme
|
|
23783
|
-
})]
|
|
23119
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(KuaishouVideoInfoHeader, { ...props.data }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KuaishouQRCodeSection, { ...props.data })]
|
|
23784
23120
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23785
23121
|
className: "overflow-auto mx-auto max-w-full",
|
|
23786
23122
|
children: commentsArray.length > 0 ? commentsArray.map((comment, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(KuaishouCommentItemComponent, {
|
|
23787
|
-
comment,
|
|
23123
|
+
...comment,
|
|
23788
23124
|
isLast: index === commentsArray.length - 1
|
|
23789
23125
|
}, comment.cid || index)) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
23790
23126
|
className: "flex justify-center items-center py-20 text-muted",
|
|
@@ -23820,7 +23156,7 @@ var InlineCalloutCode = ({ children, className }) => /* @__PURE__ */ (0, import_
|
|
|
23820
23156
|
*/
|
|
23821
23157
|
var Changelog = import_react.memo((props) => {
|
|
23822
23158
|
const isDark = props.data.useDarkTheme ?? false;
|
|
23823
|
-
const
|
|
23159
|
+
const share_url = props.data?.share_url || "";
|
|
23824
23160
|
const backgroundColors = isDark ? {
|
|
23825
23161
|
base: "#0a0a0a",
|
|
23826
23162
|
primary: "rgba(212, 175, 55, 0.28)",
|
|
@@ -24132,12 +23468,12 @@ var Changelog = import_react.memo((props) => {
|
|
|
24132
23468
|
children: props.data?.markdown ?? ""
|
|
24133
23469
|
})
|
|
24134
23470
|
}),
|
|
24135
|
-
|
|
23471
|
+
share_url && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
24136
23472
|
className: "flex flex-col items-center gap-12 py-8",
|
|
24137
23473
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
24138
23474
|
className: "w-120 h-auto",
|
|
24139
23475
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
24140
|
-
src:
|
|
23476
|
+
src: generateQRCode(share_url, isDark),
|
|
24141
23477
|
alt: "二维码",
|
|
24142
23478
|
className: "w-full h-full object-contain"
|
|
24143
23479
|
})
|
|
@@ -25644,7 +24980,7 @@ var SectionTitle = ({ icon, en, zh, color }) => /* @__PURE__ */ (0, import_jsx_r
|
|
|
25644
24980
|
* API错误显示组件 - 手机端 Apple 风格
|
|
25645
24981
|
*/
|
|
25646
24982
|
var handlerError = (props) => {
|
|
25647
|
-
const { data
|
|
24983
|
+
const { data } = props;
|
|
25648
24984
|
const isDark = data.useDarkTheme === true;
|
|
25649
24985
|
const businessError = data.type === "business_error" ? data.error : null;
|
|
25650
24986
|
const displayMethod = businessError?.businessName || data.method;
|
|
@@ -25919,7 +25255,7 @@ var handlerError = (props) => {
|
|
|
25919
25255
|
children: displayMethod
|
|
25920
25256
|
})]
|
|
25921
25257
|
}),
|
|
25922
|
-
data.isVerification &&
|
|
25258
|
+
data.isVerification && data.verificationUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
25923
25259
|
className: "mb-16 p-12 rounded-[40px]",
|
|
25924
25260
|
style: { backgroundColor: isDark ? "rgba(0,0,0,0.25)" : "rgba(255,255,255,0.6)" },
|
|
25925
25261
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -25935,7 +25271,7 @@ var handlerError = (props) => {
|
|
|
25935
25271
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
25936
25272
|
className: "flex gap-16 items-center",
|
|
25937
25273
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
25938
|
-
src:
|
|
25274
|
+
src: generateQRCode(data.verificationUrl, isDark),
|
|
25939
25275
|
alt: "验证二维码",
|
|
25940
25276
|
className: "w-64 h-64 rounded-3xl"
|
|
25941
25277
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -27086,7 +26422,7 @@ var LivePhotoTip = import_react.memo((props) => {
|
|
|
27086
26422
|
]
|
|
27087
26423
|
}),
|
|
27088
26424
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
27089
|
-
className: "relative z-10 flex flex-col min-h-360 px-
|
|
26425
|
+
className: "relative z-10 flex flex-col min-h-360 px-16 py-16",
|
|
27090
26426
|
children: [
|
|
27091
26427
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-20" }),
|
|
27092
26428
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -27095,7 +26431,7 @@ var LivePhotoTip = import_react.memo((props) => {
|
|
|
27095
26431
|
className: "rounded-full p-5 shrink-0",
|
|
27096
26432
|
style: { background: "radial-gradient(circle, " + (isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.06)") + " 0%, transparent 70%)" },
|
|
27097
26433
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowDownToLine, {
|
|
27098
|
-
className: "w-
|
|
26434
|
+
className: "w-30 h-auto",
|
|
27099
26435
|
style: { color: primaryColor }
|
|
27100
26436
|
})
|
|
27101
26437
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
|
|
@@ -27103,9 +26439,9 @@ var LivePhotoTip = import_react.memo((props) => {
|
|
|
27103
26439
|
style: { color: accentColor },
|
|
27104
26440
|
children: "保存原图"
|
|
27105
26441
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
27106
|
-
className: "text-
|
|
26442
|
+
className: "text-5xl mt-1",
|
|
27107
26443
|
style: { color: mutedColor },
|
|
27108
|
-
children: "
|
|
26444
|
+
children: "点击「查看原图」后保存到相册即可识别为实况照片"
|
|
27109
26445
|
})] })]
|
|
27110
26446
|
}),
|
|
27111
26447
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -27191,7 +26527,7 @@ LivePhotoTip.displayName = "LivePhotoTip";
|
|
|
27191
26527
|
* @returns JSX元素
|
|
27192
26528
|
*/
|
|
27193
26529
|
var QrLogin = import_react.memo((props) => {
|
|
27194
|
-
const qrCodeDataUrl = props.
|
|
26530
|
+
const qrCodeDataUrl = props.data.qr_url ? generateQRCode(props.data.qr_url, props.data.useDarkTheme ?? false) : "";
|
|
27195
26531
|
const isDark = props.data.useDarkTheme ?? false;
|
|
27196
26532
|
const bgColor = isDark ? "#0f0f1a" : "#f8f6ff";
|
|
27197
26533
|
const secondaryColor = isDark ? "#a78bfa" : "#8b5cf6";
|
|
@@ -27978,7 +27314,7 @@ var VersionWarning = (props) => {
|
|
|
27978
27314
|
})
|
|
27979
27315
|
}),
|
|
27980
27316
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Puzzle, {
|
|
27981
|
-
className:
|
|
27317
|
+
className: cn("w-10 h-auto"),
|
|
27982
27318
|
style: { color: mutedColor }
|
|
27983
27319
|
}),
|
|
27984
27320
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
@@ -28248,35 +27584,11 @@ var formatXiaohongshuLikeCount = (count) => {
|
|
|
28248
27584
|
return count || "0";
|
|
28249
27585
|
};
|
|
28250
27586
|
/**
|
|
28251
|
-
* 二维码区域组件
|
|
28252
|
-
* @param props 组件属性
|
|
28253
|
-
* @returns JSX元素
|
|
28254
|
-
*/
|
|
28255
|
-
var QRCodeSection = ({ qrCodeDataUrl }) => {
|
|
28256
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
28257
|
-
className: "flex flex-col justify-center items-center p-5",
|
|
28258
|
-
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
28259
|
-
className: "flex overflow-hidden justify-center items-center bg-white w-110 h-110",
|
|
28260
|
-
children: qrCodeDataUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
28261
|
-
src: qrCodeDataUrl,
|
|
28262
|
-
alt: "二维码",
|
|
28263
|
-
className: "object-contain"
|
|
28264
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QrCode, {
|
|
28265
|
-
width: 200,
|
|
28266
|
-
className: "text-muted"
|
|
28267
|
-
})
|
|
28268
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
28269
|
-
className: "mt-5 text-[40px] text-muted text-center",
|
|
28270
|
-
children: "扫码查看原笔记"
|
|
28271
|
-
})]
|
|
28272
|
-
});
|
|
28273
|
-
};
|
|
28274
|
-
/**
|
|
28275
27587
|
* 笔记信息头部组件
|
|
28276
27588
|
* @param props 组件属性
|
|
28277
27589
|
* @returns JSX元素
|
|
28278
27590
|
*/
|
|
28279
|
-
var NoteInfoHeader = (
|
|
27591
|
+
var NoteInfoHeader = (props) => {
|
|
28280
27592
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
28281
27593
|
className: "flex justify-between items-center max-w-300 mx-auto p-5",
|
|
28282
27594
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -28299,27 +27611,40 @@ var NoteInfoHeader = ({ type, commentLength, imageLength, qrCodeDataUrl }) => {
|
|
|
28299
27611
|
children: [
|
|
28300
27612
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
28301
27613
|
className: "tracking-[6px] text-[45px] select-text",
|
|
28302
|
-
children: ["笔记类型:",
|
|
27614
|
+
children: ["笔记类型:", props.Type]
|
|
28303
27615
|
}),
|
|
28304
27616
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
28305
27617
|
className: "tracking-[6px] text-[45px] select-text",
|
|
28306
27618
|
children: [
|
|
28307
27619
|
"评论数量:",
|
|
28308
|
-
|
|
27620
|
+
props.CommentLength,
|
|
28309
27621
|
"条"
|
|
28310
27622
|
]
|
|
28311
27623
|
}),
|
|
28312
|
-
|
|
27624
|
+
props.Type === "图文" && props.ImageLength && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
28313
27625
|
className: "tracking-[6px] text-[45px] select-text",
|
|
28314
27626
|
children: [
|
|
28315
27627
|
"图片数量:",
|
|
28316
|
-
|
|
27628
|
+
props.ImageLength,
|
|
28317
27629
|
"张"
|
|
28318
27630
|
]
|
|
28319
27631
|
})
|
|
28320
27632
|
]
|
|
28321
27633
|
})]
|
|
28322
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.
|
|
27634
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
27635
|
+
className: "flex flex-col justify-center items-center p-5",
|
|
27636
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
27637
|
+
className: "flex overflow-hidden justify-center items-center bg-white w-110 h-110",
|
|
27638
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
27639
|
+
src: generateQRCode(props.share_url, props.useDarkTheme),
|
|
27640
|
+
alt: "二维码",
|
|
27641
|
+
className: "object-contain"
|
|
27642
|
+
})
|
|
27643
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
27644
|
+
className: "mt-5 text-[40px] text-muted text-center",
|
|
27645
|
+
children: "扫码查看原笔记"
|
|
27646
|
+
})]
|
|
27647
|
+
})]
|
|
28323
27648
|
});
|
|
28324
27649
|
};
|
|
28325
27650
|
/**
|
|
@@ -28327,11 +27652,11 @@ var NoteInfoHeader = ({ type, commentLength, imageLength, qrCodeDataUrl }) => {
|
|
|
28327
27652
|
* @param props 组件属性
|
|
28328
27653
|
* @returns JSX元素
|
|
28329
27654
|
*/
|
|
28330
|
-
var CommentItemComponent = ({
|
|
27655
|
+
var CommentItemComponent = ({ ...props }, isLast = false) => {
|
|
28331
27656
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
28332
27657
|
className: `flex px-10 pt-15 ${isLast ? "pb-0" : "pb-15"}`,
|
|
28333
27658
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
28334
|
-
src:
|
|
27659
|
+
src: props.user_info.image,
|
|
28335
27660
|
className: "mb-12.5 w-[187.5px] h-[187.5px] rounded-full mr-8 object-cover shadow-lg",
|
|
28336
27661
|
alt: "用户头像"
|
|
28337
27662
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -28341,8 +27666,8 @@ var CommentItemComponent = ({ comment, isLast = false }) => {
|
|
|
28341
27666
|
className: "mb-12.5 text-[50px] text-foreground/70 relative flex items-center select-text",
|
|
28342
27667
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
28343
27668
|
className: "text-5xl",
|
|
28344
|
-
children:
|
|
28345
|
-
}),
|
|
27669
|
+
children: props.user_info.nickname
|
|
27670
|
+
}), props.show_tags && props.show_tags.length > 0 && props.show_tags.map((tag, index) => {
|
|
28346
27671
|
if (tag === "is_author") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
28347
27672
|
className: "inline-block px-6 py-3 ml-3 text-4xl rounded-full bg-surface text-muted",
|
|
28348
27673
|
children: "作者"
|
|
@@ -28360,13 +27685,13 @@ var CommentItemComponent = ({ comment, isLast = false }) => {
|
|
|
28360
27685
|
wordBreak: "break-word",
|
|
28361
27686
|
overflowWrap: "break-word"
|
|
28362
27687
|
},
|
|
28363
|
-
children: renderXiaohongshuCommentRichText(
|
|
27688
|
+
children: renderXiaohongshuCommentRichText(props.content)
|
|
28364
27689
|
}),
|
|
28365
|
-
|
|
27690
|
+
props.pictures && props.pictures.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
28366
27691
|
className: "flex my-5 overflow-hidden shadow-md rounded-2xl w-[95%] flex-1",
|
|
28367
27692
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
28368
27693
|
className: "object-contain w-full h-full rounded-2xl",
|
|
28369
|
-
src:
|
|
27694
|
+
src: props.pictures[0].url_default,
|
|
28370
27695
|
alt: "评论图片"
|
|
28371
27696
|
})
|
|
28372
27697
|
}),
|
|
@@ -28377,17 +27702,17 @@ var CommentItemComponent = ({ comment, isLast = false }) => {
|
|
|
28377
27702
|
children: [
|
|
28378
27703
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
28379
27704
|
className: "text-[45px]",
|
|
28380
|
-
children: formatXiaohongshuCommentTime(
|
|
27705
|
+
children: formatXiaohongshuCommentTime(props.create_time)
|
|
28381
27706
|
}),
|
|
28382
27707
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
28383
27708
|
className: "text-[45px]",
|
|
28384
|
-
children:
|
|
27709
|
+
children: props.ip_location
|
|
28385
27710
|
}),
|
|
28386
|
-
parseInt(
|
|
27711
|
+
parseInt(props.sub_comment_count) > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
28387
27712
|
className: "text-[40px] text-foreground/70",
|
|
28388
27713
|
children: [
|
|
28389
27714
|
"共",
|
|
28390
|
-
|
|
27715
|
+
props.sub_comment_count,
|
|
28391
27716
|
"条回复"
|
|
28392
27717
|
]
|
|
28393
27718
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
@@ -28401,10 +27726,10 @@ var CommentItemComponent = ({ comment, isLast = false }) => {
|
|
|
28401
27726
|
className: "flex items-center space-x-2 transition-colors cursor-pointer",
|
|
28402
27727
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Heart, {
|
|
28403
27728
|
size: 60,
|
|
28404
|
-
className:
|
|
27729
|
+
className: props.liked ? "text-red-500 fill-current" : "text-muted"
|
|
28405
27730
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
28406
27731
|
className: "text-[50px] select-text",
|
|
28407
|
-
children: formatXiaohongshuLikeCount(
|
|
27732
|
+
children: formatXiaohongshuLikeCount(props.like_count)
|
|
28408
27733
|
})]
|
|
28409
27734
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
28410
27735
|
className: "flex items-center transition-colors cursor-pointer",
|
|
@@ -28415,10 +27740,10 @@ var CommentItemComponent = ({ comment, isLast = false }) => {
|
|
|
28415
27740
|
})]
|
|
28416
27741
|
})]
|
|
28417
27742
|
}),
|
|
28418
|
-
|
|
27743
|
+
props.sub_comments && props.sub_comments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
28419
27744
|
className: "pl-6 mt-6",
|
|
28420
|
-
children:
|
|
28421
|
-
className: `py-4 ${index !==
|
|
27745
|
+
children: props.sub_comments.map((subComment, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
27746
|
+
className: `py-4 ${index !== props.sub_comments.length - 1 ? "border-b border-divider" : ""}`,
|
|
28422
27747
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
28423
27748
|
className: "flex items-start space-x-4",
|
|
28424
27749
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
|
@@ -28487,18 +27812,13 @@ var XiaohongshuComment = import_react.memo((props) => {
|
|
|
28487
27812
|
...props,
|
|
28488
27813
|
children: [
|
|
28489
27814
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-30" }),
|
|
28490
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NoteInfoHeader, {
|
|
28491
|
-
type: props.data.Type,
|
|
28492
|
-
commentLength: props.data.CommentLength,
|
|
28493
|
-
imageLength: props.data.ImageLength,
|
|
28494
|
-
qrCodeDataUrl: props.qrCodeDataUrl
|
|
28495
|
-
}),
|
|
27815
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NoteInfoHeader, { ...props.data }),
|
|
28496
27816
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
28497
27817
|
className: "overflow-auto mx-20 max-w-full",
|
|
28498
27818
|
children: props.data.CommentsData.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
28499
27819
|
className: "divide-y divide-divider",
|
|
28500
27820
|
children: props.data.CommentsData.map((comment, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommentItemComponent, {
|
|
28501
|
-
comment,
|
|
27821
|
+
...comment,
|
|
28502
27822
|
isLast: index === props.data.CommentsData.length - 1
|
|
28503
27823
|
}, comment.id))
|
|
28504
27824
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -30031,6 +29351,7 @@ var SSRRender = class {
|
|
|
30031
29351
|
async render(request) {
|
|
30032
29352
|
try {
|
|
30033
29353
|
logger$1.debug("[SSR] 开始渲染组件,预设模板:", `${logger$1.yellow(`${request.templateType}/`)}${request.templateName}`);
|
|
29354
|
+
const startTime = Date.now();
|
|
30034
29355
|
const ctx = {
|
|
30035
29356
|
request,
|
|
30036
29357
|
outputDir: this.outputDir,
|
|
@@ -30053,6 +29374,8 @@ var SSRRender = class {
|
|
|
30053
29374
|
const fullHtml = this.htmlWrapper.wrapContent(ctx.state.html ?? htmlContent, filePath, request.data.useDarkTheme ?? false);
|
|
30054
29375
|
fs.writeFileSync(filePath, fullHtml, "utf-8");
|
|
30055
29376
|
if (process.env.NODE_ENV === "development") DevDataManager.saveRenderData(request.templateType, request.templateName, buildDevPreviewPayload(request.data, ctx.state.props));
|
|
29377
|
+
const endTime = Date.now();
|
|
29378
|
+
logger$1.debug(`[SSR] ${logger$1.yellow(`${request.templateType}/`)}${request.templateName} Done! ${endTime - startTime >= 1e3 ? logger$1.green(`${((endTime - startTime) / 1e3).toFixed(2)} s`) : logger$1.green(`${endTime - startTime} ms`)}`);
|
|
30056
29379
|
return {
|
|
30057
29380
|
success: true,
|
|
30058
29381
|
htmlPath: filePath
|
|
@@ -30247,114 +29570,12 @@ var isSemverGreater = (remote, local) => {
|
|
|
30247
29570
|
};
|
|
30248
29571
|
//#endregion
|
|
30249
29572
|
//#region src/module/utils/Render/plugins.ts
|
|
30250
|
-
var import_qr_code_styling = /* @__PURE__ */ __toESM(require_qr_code_styling(), 1);
|
|
30251
|
-
/**
|
|
30252
|
-
* 创建 DOMPurify 实例
|
|
30253
|
-
* 使用 happy-dom 的 Window 来创建隔离的 DOM 环境
|
|
30254
|
-
*/
|
|
30255
|
-
var createDomPurify = () => {
|
|
30256
|
-
return purify(new Window());
|
|
30257
|
-
};
|
|
30258
|
-
/**
|
|
30259
|
-
* 对值进行消毒处理
|
|
30260
|
-
* 如果是字符串则进行 HTML 消毒
|
|
30261
|
-
* 如果是数组则递归处理每个元素
|
|
30262
|
-
* 如果是对象则递归处理每个属性值
|
|
30263
|
-
* 其他类型直接返回原值
|
|
30264
|
-
* @param value 需要消毒的值
|
|
30265
|
-
* @returns 消毒后的值
|
|
30266
|
-
*/
|
|
30267
|
-
var sanitizeValue = (value) => {
|
|
30268
|
-
const domPurify = createDomPurify();
|
|
30269
|
-
if (typeof value === "string") return domPurify.sanitize(value);
|
|
30270
|
-
if (Array.isArray(value)) return value.map((item) => sanitizeValue(item));
|
|
30271
|
-
if (value && typeof value === "object") {
|
|
30272
|
-
const output = {};
|
|
30273
|
-
for (const [key, item] of Object.entries(value)) output[key] = sanitizeValue(item);
|
|
30274
|
-
return output;
|
|
30275
|
-
}
|
|
30276
|
-
return value;
|
|
30277
|
-
};
|
|
30278
|
-
/**
|
|
30279
|
-
* 对渲染数据进行消毒处理,防止 XSS 攻击。
|
|
30280
|
-
* 在渲染前调用,确保数据安全。
|
|
30281
|
-
*/
|
|
30282
|
-
var createSanitizeContentPlugin = () => {
|
|
30283
|
-
return {
|
|
30284
|
-
name: "数据消毒",
|
|
30285
|
-
enforce: "pre",
|
|
30286
|
-
beforeRender(ctx) {
|
|
30287
|
-
ctx.request.data = sanitizeValue(ctx.request.data);
|
|
30288
|
-
ctx.state.props = sanitizeValue(ctx.state.props);
|
|
30289
|
-
}
|
|
30290
|
-
};
|
|
30291
|
-
};
|
|
30292
|
-
/**
|
|
30293
|
-
* 二维码插件工厂
|
|
30294
|
-
* 为指定字段生成二维码数据 URL
|
|
30295
|
-
* @param options 插件配置选项
|
|
30296
|
-
* @returns 二维码插件实例
|
|
30297
|
-
*/
|
|
30298
|
-
var createQrCodePlugin = () => {
|
|
30299
|
-
return {
|
|
30300
|
-
name: "生成二维码",
|
|
30301
|
-
enforce: "pre",
|
|
30302
|
-
async beforeRender(ctx) {
|
|
30303
|
-
const data = ctx.request.data || {};
|
|
30304
|
-
const useDarkTheme = Boolean(data.useDarkTheme);
|
|
30305
|
-
const toDataUrl = async (url) => {
|
|
30306
|
-
const buffer = await new import_qr_code_styling.default({
|
|
30307
|
-
jsdom: Window,
|
|
30308
|
-
type: "svg",
|
|
30309
|
-
shape: "square",
|
|
30310
|
-
width: 2e3,
|
|
30311
|
-
height: 2e3,
|
|
30312
|
-
data: url,
|
|
30313
|
-
margin: 0,
|
|
30314
|
-
qrOptions: {
|
|
30315
|
-
typeNumber: 0,
|
|
30316
|
-
mode: "Byte",
|
|
30317
|
-
errorCorrectionLevel: "L"
|
|
30318
|
-
},
|
|
30319
|
-
imageOptions: {
|
|
30320
|
-
hideBackgroundDots: false,
|
|
30321
|
-
imageSize: .4,
|
|
30322
|
-
margin: 0
|
|
30323
|
-
},
|
|
30324
|
-
dotsOptions: {
|
|
30325
|
-
type: "rounded",
|
|
30326
|
-
color: useDarkTheme ? "#C3C3C3" : "#3A3A3A",
|
|
30327
|
-
roundSize: false
|
|
30328
|
-
},
|
|
30329
|
-
backgroundOptions: { color: "transparent" },
|
|
30330
|
-
cornersSquareOptions: {
|
|
30331
|
-
type: "extra-rounded",
|
|
30332
|
-
color: useDarkTheme ? "#C3C3C3" : "#3A3A3A"
|
|
30333
|
-
},
|
|
30334
|
-
cornersDotOptions: { color: useDarkTheme ? "#C3C3C3" : "#3A3A3A" }
|
|
30335
|
-
}).getRawData("svg");
|
|
30336
|
-
if (!buffer) throw new Error("Failed to generate QR code");
|
|
30337
|
-
return `data:image/svg+xml;base64,${buffer.toString("base64")}`;
|
|
30338
|
-
};
|
|
30339
|
-
const props = ctx.state.props || {};
|
|
30340
|
-
if (!props.qrCodes) props.qrCodes = {};
|
|
30341
|
-
if (!props.qrCodeDataUrl) props.qrCodeDataUrl = void 0;
|
|
30342
|
-
if (typeof data.share_url === "string" && data.share_url.length > 0) {
|
|
30343
|
-
const dataUrl = await toDataUrl(data.share_url);
|
|
30344
|
-
const qrCodes = props.qrCodes;
|
|
30345
|
-
qrCodes.share_url = dataUrl;
|
|
30346
|
-
if (!props.qrCodeDataUrl) props.qrCodeDataUrl = dataUrl;
|
|
30347
|
-
}
|
|
30348
|
-
ctx.state.props = props;
|
|
30349
|
-
}
|
|
30350
|
-
};
|
|
30351
|
-
};
|
|
30352
29573
|
var clamp = (value, min, max) => {
|
|
30353
29574
|
return Math.min(max, Math.max(min, value));
|
|
30354
29575
|
};
|
|
30355
29576
|
var buildProxyImageUrl = (url) => {
|
|
30356
29577
|
if (!url || !url.startsWith("http")) return url;
|
|
30357
|
-
return `https://images.weserv.nl/?url=${encodeURIComponent(url)}&w=96&h=96&fit=cover&output=
|
|
29578
|
+
return `https://images.weserv.nl/?url=${encodeURIComponent(url)}&w=96&h=96&fit=cover&output=png`;
|
|
30358
29579
|
};
|
|
30359
29580
|
var mixRgb = (a, b, weight) => {
|
|
30360
29581
|
const w = clamp(weight, 0, 1);
|
|
@@ -30432,20 +29653,80 @@ var tuneRgb = (rgb, saturationMin, lightnessTarget) => {
|
|
|
30432
29653
|
const { h, s } = rgbToHsl(rgb);
|
|
30433
29654
|
return hslToRgb(h, Math.max(s, saturationMin), clamp(lightnessTarget, 0, 1));
|
|
30434
29655
|
};
|
|
30435
|
-
var
|
|
30436
|
-
if (
|
|
30437
|
-
|
|
30438
|
-
|
|
30439
|
-
|
|
30440
|
-
|
|
30441
|
-
|
|
30442
|
-
|
|
29656
|
+
var decodePngToPixels = (buffer) => {
|
|
29657
|
+
if (buffer[0] !== 137 || buffer[1] !== 80) return null;
|
|
29658
|
+
let offset = 8;
|
|
29659
|
+
let width = 0;
|
|
29660
|
+
let height = 0;
|
|
29661
|
+
let bitDepth = 0;
|
|
29662
|
+
let colorType = 0;
|
|
29663
|
+
const idatChunks = [];
|
|
29664
|
+
while (offset < buffer.length) {
|
|
29665
|
+
const length = buffer.readUInt32BE(offset);
|
|
29666
|
+
const type = buffer.toString("ascii", offset + 4, offset + 8);
|
|
29667
|
+
const chunkData = buffer.subarray(offset + 8, offset + 8 + length);
|
|
29668
|
+
if (type === "IHDR") {
|
|
29669
|
+
width = chunkData.readUInt32BE(0);
|
|
29670
|
+
height = chunkData.readUInt32BE(4);
|
|
29671
|
+
bitDepth = chunkData[8];
|
|
29672
|
+
colorType = chunkData[9];
|
|
29673
|
+
} else if (type === "IDAT") idatChunks.push(chunkData);
|
|
29674
|
+
else if (type === "IEND") break;
|
|
29675
|
+
offset += 12 + length;
|
|
29676
|
+
}
|
|
29677
|
+
if (!width || !height || bitDepth !== 8) return null;
|
|
29678
|
+
const channels = colorType === 6 ? 4 : colorType === 2 ? 3 : 0;
|
|
29679
|
+
if (!channels) return null;
|
|
29680
|
+
const raw = inflateSync(Buffer.concat(idatChunks));
|
|
29681
|
+
const stride = width * channels;
|
|
29682
|
+
const pixels = Buffer.alloc(width * height * 4);
|
|
29683
|
+
const prevRow = Buffer.alloc(stride);
|
|
29684
|
+
let rawOffset = 0;
|
|
29685
|
+
for (let y = 0; y < height; y++) {
|
|
29686
|
+
const filter = raw[rawOffset++];
|
|
29687
|
+
const curRow = Buffer.alloc(stride);
|
|
29688
|
+
for (let x = 0; x < stride; x++) {
|
|
29689
|
+
const val = raw[rawOffset++];
|
|
29690
|
+
const a = x >= channels ? curRow[x - channels] : 0;
|
|
29691
|
+
const b = prevRow[x];
|
|
29692
|
+
const c = x >= channels ? prevRow[x - channels] : 0;
|
|
29693
|
+
switch (filter) {
|
|
29694
|
+
case 0:
|
|
29695
|
+
curRow[x] = val;
|
|
29696
|
+
break;
|
|
29697
|
+
case 1:
|
|
29698
|
+
curRow[x] = val + a & 255;
|
|
29699
|
+
break;
|
|
29700
|
+
case 2:
|
|
29701
|
+
curRow[x] = val + b & 255;
|
|
29702
|
+
break;
|
|
29703
|
+
case 3:
|
|
29704
|
+
curRow[x] = val + (a + b >> 1) & 255;
|
|
29705
|
+
break;
|
|
29706
|
+
case 4: {
|
|
29707
|
+
const p = a + b - c;
|
|
29708
|
+
const pa = Math.abs(p - a);
|
|
29709
|
+
const pb = Math.abs(p - b);
|
|
29710
|
+
const pc = Math.abs(p - c);
|
|
29711
|
+
curRow[x] = val + (pa <= pb && pa <= pc ? a : pb <= pc ? b : c) & 255;
|
|
29712
|
+
break;
|
|
29713
|
+
}
|
|
29714
|
+
}
|
|
29715
|
+
}
|
|
29716
|
+
for (let x = 0; x < width; x++) {
|
|
29717
|
+
const pi = (y * width + x) * 4;
|
|
29718
|
+
const ci = x * channels;
|
|
29719
|
+
pixels[pi] = curRow[ci];
|
|
29720
|
+
pixels[pi + 1] = curRow[ci + 1];
|
|
29721
|
+
pixels[pi + 2] = curRow[ci + 2];
|
|
29722
|
+
pixels[pi + 3] = channels === 4 ? curRow[ci + 3] : 255;
|
|
29723
|
+
}
|
|
29724
|
+
curRow.copy(prevRow);
|
|
30443
29725
|
}
|
|
30444
|
-
const decoded = import_jpeg_js.default.decode(buffer, { useTArray: true });
|
|
30445
29726
|
return {
|
|
30446
|
-
data:
|
|
30447
|
-
width
|
|
30448
|
-
height
|
|
29727
|
+
data: pixels,
|
|
29728
|
+
width,
|
|
29729
|
+
height
|
|
30449
29730
|
};
|
|
30450
29731
|
};
|
|
30451
29732
|
var createPosterPalette = (seed, isDark) => {
|
|
@@ -30480,8 +29761,10 @@ var createPosterPalette = (seed, isDark) => {
|
|
|
30480
29761
|
coverShade: isDark ? "rgba(0, 0, 0, 0.42)" : "rgba(10, 24, 32, 0.34)"
|
|
30481
29762
|
};
|
|
30482
29763
|
};
|
|
30483
|
-
var extractPosterPaletteSeedFromBuffer = (buffer
|
|
30484
|
-
const
|
|
29764
|
+
var extractPosterPaletteSeedFromBuffer = (buffer) => {
|
|
29765
|
+
const decoded = decodePngToPixels(buffer);
|
|
29766
|
+
if (!decoded) return null;
|
|
29767
|
+
const { data } = decoded;
|
|
30485
29768
|
let weightedR = 0;
|
|
30486
29769
|
let weightedG = 0;
|
|
30487
29770
|
let weightedB = 0;
|
|
@@ -30536,9 +29819,11 @@ var createPosterPalettePlugin = () => {
|
|
|
30536
29819
|
const useDarkTheme = Boolean(ctx.request.useDarkTheme ?? data.useDarkTheme);
|
|
30537
29820
|
const candidates = [buildProxyImageUrl(imageUrl), imageUrl];
|
|
30538
29821
|
for (const candidate of candidates) try {
|
|
30539
|
-
const response = await
|
|
30540
|
-
|
|
30541
|
-
|
|
29822
|
+
const response = await axios.get(candidate, {
|
|
29823
|
+
responseType: "arraybuffer",
|
|
29824
|
+
headers: { accept: "image/png,image/apng,image/*,*/*;q=0.8" }
|
|
29825
|
+
});
|
|
29826
|
+
const paletteSeed = extractPosterPaletteSeedFromBuffer(Buffer.from(response.data));
|
|
30542
29827
|
if (paletteSeed) {
|
|
30543
29828
|
const lightPalette = createPosterPalette(paletteSeed, false);
|
|
30544
29829
|
const darkPalette = createPosterPalette(paletteSeed, true);
|
|
@@ -30596,9 +29881,10 @@ var embedWatermark = (pngBytes, watermarkText) => {
|
|
|
30596
29881
|
* @template P 渲染路径,必须是有效的动态路径
|
|
30597
29882
|
* @param path 渲染路径,格式为 "平台/组件ID" 或 "平台/分类/组件ID"
|
|
30598
29883
|
* @param data 渲染数据,类型根据路径自动推断
|
|
29884
|
+
* @options 渲染选项
|
|
30599
29885
|
* @returns 渲染结果图片元素数组的 Promise
|
|
30600
29886
|
*/
|
|
30601
|
-
var Render = async (event, path$1, data) => {
|
|
29887
|
+
var Render = async (event, path$1, data, options) => {
|
|
30602
29888
|
const pathParts = path$1.split("/");
|
|
30603
29889
|
let templateType;
|
|
30604
29890
|
let templateName;
|
|
@@ -30641,11 +29927,7 @@ var Render = async (event, path$1, data) => {
|
|
|
30641
29927
|
}
|
|
30642
29928
|
},
|
|
30643
29929
|
outputDir,
|
|
30644
|
-
plugins: [
|
|
30645
|
-
createQrCodePlugin(),
|
|
30646
|
-
createPosterPalettePlugin(),
|
|
30647
|
-
createSanitizeContentPlugin()
|
|
30648
|
-
]
|
|
29930
|
+
plugins: [createPosterPalettePlugin()]
|
|
30649
29931
|
}).then((res) => {
|
|
30650
29932
|
if (!res.success || !res.htmlPath) throw new Error(res.error);
|
|
30651
29933
|
return res;
|
|
@@ -30656,7 +29938,7 @@ var Render = async (event, path$1, data) => {
|
|
|
30656
29938
|
const renderResult = await render.render({
|
|
30657
29939
|
name: `${Root.pluginName}/${templateType}`,
|
|
30658
29940
|
file: result.htmlPath,
|
|
30659
|
-
multiPage: Config.app.multiPageRender && event.bot.adapter.
|
|
29941
|
+
multiPage: Config.app.multiPageRender && event.bot.adapter.protocol !== "qqbot" ? Config.app.multiPageHeight : false,
|
|
30660
29942
|
selector: "#container",
|
|
30661
29943
|
fullPage: false,
|
|
30662
29944
|
type: "png",
|
|
@@ -30671,7 +29953,9 @@ var Render = async (event, path$1, data) => {
|
|
|
30671
29953
|
const imageStats = [];
|
|
30672
29954
|
for (const image of images) {
|
|
30673
29955
|
const imageBuffer = Buffer.from(image, "base64");
|
|
30674
|
-
|
|
29956
|
+
let finalImageBuffer;
|
|
29957
|
+
if (options?.skipWatermark) finalImageBuffer = imageBuffer;
|
|
29958
|
+
else finalImageBuffer = embedWatermark(imageBuffer, watermarkText) ?? imageBuffer;
|
|
30675
29959
|
const metadata = getImageMetadata(finalImageBuffer);
|
|
30676
29960
|
const dimensions = metadata.width && metadata.height ? `${metadata.width}x${metadata.height}` : "unknown";
|
|
30677
29961
|
imageStats.push({
|
|
@@ -30707,6 +29991,24 @@ var getImageMetadata = (buffer) => {
|
|
|
30707
29991
|
};
|
|
30708
29992
|
return {};
|
|
30709
29993
|
};
|
|
29994
|
+
/**
|
|
29995
|
+
* 对已渲染的图片元素数组应用水印
|
|
29996
|
+
* 用于推送场景:渲染一次,按目标群逐个嵌入不同 bot 的水印
|
|
29997
|
+
*/
|
|
29998
|
+
var applyWatermarkToImages = (images, event) => {
|
|
29999
|
+
if (Config.app.RemoveWatermark) return images;
|
|
30000
|
+
const watermarkText = JSON.stringify({
|
|
30001
|
+
a: Date.now(),
|
|
30002
|
+
b: `Generated by karin-plugin-kkk v${Root.pluginVersion}, with source code open-sourced under the GPL-3.0 license`,
|
|
30003
|
+
c: `Sent by ${event?.bot?.account.selfId ?? "unknown"}|${event?.bot?.account.name ?? "unknown"}`
|
|
30004
|
+
});
|
|
30005
|
+
return images.map((img) => {
|
|
30006
|
+
const base64Data = img.file.replace(/^base64:\/\//, "");
|
|
30007
|
+
const buffer = Buffer.from(base64Data, "base64");
|
|
30008
|
+
const watermarked = embedWatermark(buffer, watermarkText) ?? buffer;
|
|
30009
|
+
return segment.image("base64://" + watermarked.toString("base64"));
|
|
30010
|
+
});
|
|
30011
|
+
};
|
|
30710
30012
|
//#endregion
|
|
30711
30013
|
//#region src/module/db/bilibili.ts
|
|
30712
30014
|
/** 数据库操作类 */
|
|
@@ -36591,7 +35893,7 @@ var Bilibili = class extends Base {
|
|
|
36591
35893
|
outputPath,
|
|
36592
35894
|
loopCount,
|
|
36593
35895
|
staticImagePath: staticImg.filepath,
|
|
36594
|
-
transitionEnabled:
|
|
35896
|
+
transitionEnabled: true
|
|
36595
35897
|
})).success) {
|
|
36596
35898
|
const filePath = Common.tempDri.video + `tmp_${Date.now()}.mp4`;
|
|
36597
35899
|
fs.renameSync(outputPath, filePath);
|
|
@@ -38247,7 +37549,7 @@ var Bilibilipush = class extends Base {
|
|
|
38247
37549
|
additional: parseAdditionalCard(data[dynamicId].Dynamic_Data.modules.module_dynamic.additional),
|
|
38248
37550
|
dynamicTYPE: "图文动态推送",
|
|
38249
37551
|
dynamic_id: dynamicId
|
|
38250
|
-
});
|
|
37552
|
+
}, { skipWatermark: true });
|
|
38251
37553
|
break;
|
|
38252
37554
|
/** 处理纯文动态 */
|
|
38253
37555
|
case DynamicType.WORD: {
|
|
@@ -38284,7 +37586,7 @@ var Bilibilipush = class extends Base {
|
|
|
38284
37586
|
additional: parseAdditionalCard(data[dynamicId].Dynamic_Data.modules.module_dynamic.additional),
|
|
38285
37587
|
dynamicTYPE: "纯文动态推送",
|
|
38286
37588
|
dynamic_id: dynamicId
|
|
38287
|
-
});
|
|
37589
|
+
}, { skipWatermark: true });
|
|
38288
37590
|
break;
|
|
38289
37591
|
}
|
|
38290
37592
|
/** 处理视频动态 */
|
|
@@ -38357,7 +37659,7 @@ var Bilibilipush = class extends Base {
|
|
|
38357
37659
|
dynamicTYPE: "视频动态推送",
|
|
38358
37660
|
dynamic_id: dynamicId,
|
|
38359
37661
|
staff
|
|
38360
|
-
});
|
|
37662
|
+
}, { skipWatermark: true });
|
|
38361
37663
|
}
|
|
38362
37664
|
break;
|
|
38363
37665
|
/** 处理直播动态 */
|
|
@@ -38375,7 +37677,7 @@ var Bilibilipush = class extends Base {
|
|
|
38375
37677
|
now_time: TimeFormatter.now(),
|
|
38376
37678
|
share_url: "https://live.bilibili.com/" + liveInfo.live_play_info.room_id,
|
|
38377
37679
|
dynamicTYPE: "直播动态推送"
|
|
38378
|
-
});
|
|
37680
|
+
}, { skipWatermark: true });
|
|
38379
37681
|
break;
|
|
38380
37682
|
}
|
|
38381
37683
|
/** 处理转发动态 */
|
|
@@ -38515,7 +37817,7 @@ var Bilibilipush = class extends Base {
|
|
|
38515
37817
|
original_content: { [data[dynamicId].Dynamic_Data.orig.type]: param },
|
|
38516
37818
|
imgList: imgList.length > 0 ? imgList : null,
|
|
38517
37819
|
dynamic_id: dynamicId
|
|
38518
|
-
});
|
|
37820
|
+
}, { skipWatermark: true });
|
|
38519
37821
|
break;
|
|
38520
37822
|
}
|
|
38521
37823
|
/** 文章/专栏动态 */
|
|
@@ -38549,7 +37851,7 @@ var Bilibilipush = class extends Base {
|
|
|
38549
37851
|
render_time: TimeFormatter.now(),
|
|
38550
37852
|
share_url: articleContent.dyn_id_str ? `https://www.bilibili.com/opus/${articleContent.dyn_id_str}` : `https://www.bilibili.com/read/cv${articleContent.id}`,
|
|
38551
37853
|
dynamicTYPE: "专栏动态推送"
|
|
38552
|
-
});
|
|
37854
|
+
}, { skipWatermark: true });
|
|
38553
37855
|
break;
|
|
38554
37856
|
}
|
|
38555
37857
|
/** 未处理的动态类型 */
|
|
@@ -38567,7 +37869,11 @@ var Bilibilipush = class extends Base {
|
|
|
38567
37869
|
const { groupId, botId } = target;
|
|
38568
37870
|
const bot = karin$1.getBot(botId);
|
|
38569
37871
|
const Contact = karin$1.contactGroup(groupId);
|
|
38570
|
-
|
|
37872
|
+
const eventWithBot = this.e;
|
|
37873
|
+
eventWithBot.bot = bot;
|
|
37874
|
+
eventWithBot.selfId = botId;
|
|
37875
|
+
const watermarkedImg = img ? applyWatermarkToImages(img, this.e) : [];
|
|
37876
|
+
status = await karin$1.sendMsg(botId, Contact, [...watermarkedImg]);
|
|
38571
37877
|
if (Config.bilibili.push.parsedynamic && status.messageId) switch (data[dynamicId].dynamic_type) {
|
|
38572
37878
|
case "DYNAMIC_TYPE_AV":
|
|
38573
37879
|
if (send_video) {
|
|
@@ -38699,7 +38005,7 @@ var Bilibilipush = class extends Base {
|
|
|
38699
38005
|
outputPath,
|
|
38700
38006
|
loopCount,
|
|
38701
38007
|
staticImagePath: staticImg.filepath,
|
|
38702
|
-
transitionEnabled:
|
|
38008
|
+
transitionEnabled: true
|
|
38703
38009
|
})).success) {
|
|
38704
38010
|
const filePath = Common.tempDri.video + `tmp_${Date.now()}.mp4`;
|
|
38705
38011
|
fs.renameSync(outputPath, filePath);
|
|
@@ -39128,6 +38434,8 @@ registerErrorStrategy({
|
|
|
39128
38434
|
});
|
|
39129
38435
|
//#endregion
|
|
39130
38436
|
//#region src/platform/douyin/comments.ts
|
|
38437
|
+
var import_heic_decode = /* @__PURE__ */ __toESM(require_heic_decode(), 1);
|
|
38438
|
+
var import_jpeg_js = /* @__PURE__ */ __toESM(require_jpeg_js(), 1);
|
|
39131
38439
|
/**
|
|
39132
38440
|
* @description 提取评论里的 @ 用户 sec_uid 列表
|
|
39133
38441
|
*/
|
|
@@ -41197,7 +40505,7 @@ var DouYinpush = class extends Base {
|
|
|
41197
40505
|
following_count: this.count(Detail_Data.user_info.data.user.following_count),
|
|
41198
40506
|
total_favorited: this.count(Detail_Data.user_info.data.user.total_favorited),
|
|
41199
40507
|
has_commerce_goods: liveItem.has_commerce_goods
|
|
41200
|
-
});
|
|
40508
|
+
}, { skipWatermark: true });
|
|
41201
40509
|
} else {
|
|
41202
40510
|
const realUrl = Config.douyin.push.shareType === "web" && await new Network({
|
|
41203
40511
|
url: Detail_Data.share_url,
|
|
@@ -41227,7 +40535,7 @@ var DouYinpush = class extends Base {
|
|
|
41227
40535
|
author_avatar: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + authorUserInfo.data.user.avatar_larger.uri,
|
|
41228
40536
|
author_douyin_id: authorUserInfo.data.user.unique_id === "" ? authorUserInfo.data.user.short_id : authorUserInfo.data.user.unique_id,
|
|
41229
40537
|
share_url: Config.douyin.push.shareType === "web" ? realUrl : `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0`
|
|
41230
|
-
});
|
|
40538
|
+
}, { skipWatermark: true });
|
|
41231
40539
|
} else if (pushItem.pushType === "recommend") {
|
|
41232
40540
|
const authorUserInfo = "author_user_info" in Detail_Data ? Detail_Data.author_user_info : void 0;
|
|
41233
40541
|
const coverUrl = getWorkCoverUrl(getWorkTypeInfo(Detail_Data), Detail_Data);
|
|
@@ -41247,7 +40555,7 @@ var DouYinpush = class extends Base {
|
|
|
41247
40555
|
author_avatar: "https://p3-pc.douyinpic.com/aweme/1080x1080/" + authorUserInfo.data.user.avatar_larger.uri,
|
|
41248
40556
|
author_douyin_id: authorUserInfo.data.user.unique_id === "" ? authorUserInfo.data.user.short_id : authorUserInfo.data.user.unique_id,
|
|
41249
40557
|
share_url: Config.douyin.push.shareType === "web" ? realUrl : `https://aweme.snssdk.com/aweme/v1/play/?video_id=${Detail_Data.video.play_addr.uri}&ratio=1080p&line=0`
|
|
41250
|
-
});
|
|
40558
|
+
}, { skipWatermark: true });
|
|
41251
40559
|
} else {
|
|
41252
40560
|
const dynamicTypeLabel = "作品动态推送";
|
|
41253
40561
|
const workTypeInfo = getWorkTypeInfo(Detail_Data);
|
|
@@ -41273,7 +40581,7 @@ var DouYinpush = class extends Base {
|
|
|
41273
40581
|
粉丝: this.count(Detail_Data.user_info.data.user.follower_count),
|
|
41274
40582
|
share_url: Detail_Data.share_url,
|
|
41275
40583
|
useDarkTheme: false
|
|
41276
|
-
});
|
|
40584
|
+
}, { skipWatermark: true });
|
|
41277
40585
|
} else img = await Render(this.e, workTypeInfo.templatePath, {
|
|
41278
40586
|
image_url: coverUrl,
|
|
41279
40587
|
desc: this.desc(Detail_Data, Detail_Data.desc),
|
|
@@ -41315,7 +40623,7 @@ var DouYinpush = class extends Base {
|
|
|
41315
40623
|
subscriber_role: subscriberInCreators?.role_title ?? (subscriberUid && Detail_Data.author?.uid && subscriberUid === Detail_Data.author.uid || subscriberSecUid && Detail_Data.author?.sec_uid && subscriberSecUid === Detail_Data.author.sec_uid || Detail_Data.user_info.data.user.nickname && Detail_Data.author?.nickname && Detail_Data.user_info.data.user.nickname === Detail_Data.author.nickname ? "作者" : void 0)
|
|
41316
40624
|
};
|
|
41317
40625
|
})()
|
|
41318
|
-
});
|
|
40626
|
+
}, { skipWatermark: true });
|
|
41319
40627
|
}
|
|
41320
40628
|
}
|
|
41321
40629
|
for (const target of pushItem.targets) {
|
|
@@ -41323,7 +40631,12 @@ var DouYinpush = class extends Base {
|
|
|
41323
40631
|
const { groupId, botId } = target;
|
|
41324
40632
|
if (!skip) {
|
|
41325
40633
|
const Contact = karin$1.contactGroup(groupId);
|
|
41326
|
-
|
|
40634
|
+
const bot = karin$1.getBot(botId);
|
|
40635
|
+
const eventWithBot = this.e;
|
|
40636
|
+
eventWithBot.bot = bot;
|
|
40637
|
+
eventWithBot.selfId = botId;
|
|
40638
|
+
const watermarkedImg = img ? applyWatermarkToImages(img, this.e) : [];
|
|
40639
|
+
status = await karin$1.sendMsg(botId, Contact, [...watermarkedImg]);
|
|
41327
40640
|
if (pushItem.pushType === "live" && "room_data" in pushItem.Detail_Data && status.message_id) await douyinDBInstance.updateLiveStatus(pushItem.sec_uid, true);
|
|
41328
40641
|
if (Config.douyin.push.parsedynamic && status.message_id) {
|
|
41329
40642
|
const workTypeInfo = getWorkTypeInfo(Detail_Data);
|
|
@@ -42429,7 +41742,7 @@ var Xiaohongshu = class extends Base {
|
|
|
42429
41742
|
if (livePhoto.filepath) {
|
|
42430
41743
|
if (shouldGenerateVideo) {
|
|
42431
41744
|
const outputPath = Common.tempDri.video + `xhs_live_${Date.now()}_${index}.mp4`;
|
|
42432
|
-
const transitionEnabled =
|
|
41745
|
+
const transitionEnabled = Boolean(staticImgPath);
|
|
42433
41746
|
const safeStaticPath = staticImgPath || livePhoto.filepath;
|
|
42434
41747
|
const result = await loopVideoWithTransition({
|
|
42435
41748
|
inputPath: livePhoto.filepath,
|
|
@@ -42441,7 +41754,7 @@ var Xiaohongshu = class extends Base {
|
|
|
42441
41754
|
context: bgmContext ?? void 0
|
|
42442
41755
|
});
|
|
42443
41756
|
const success = result.success;
|
|
42444
|
-
if (
|
|
41757
|
+
if (result.context) bgmContext = result.context;
|
|
42445
41758
|
if (success) {
|
|
42446
41759
|
const filePath = Common.tempDri.video + `tmp_${Date.now()}.mp4`;
|
|
42447
41760
|
fs.renameSync(outputPath, filePath);
|
|
@@ -42785,7 +42098,7 @@ var douyinLogin = async (e) => {
|
|
|
42785
42098
|
}
|
|
42786
42099
|
let gcInterval;
|
|
42787
42100
|
try {
|
|
42788
|
-
const loginQRcode = await Render(e, "douyin/qrcodeImg", qrCodeData.url ? { share_url: qrCodeData.url } : {
|
|
42101
|
+
const loginQRcode = await Render(e, "douyin/qrcodeImg", qrCodeData.url ? { share_url: qrCodeData.url } : { share_url: qrCodeData.originalImage });
|
|
42789
42102
|
const base64Data = loginQRcode[0]?.file;
|
|
42790
42103
|
if (!base64Data) throw new Error("生成二维码图片失败");
|
|
42791
42104
|
const cleanBase64 = base64Data.replace(/^base64:\/\//, "");
|
|
@@ -43027,7 +42340,7 @@ var waitQrcode = async (page) => {
|
|
|
43027
42340
|
const response = await fetch(originalImage);
|
|
43028
42341
|
imageBuffer = Buffer.from(await response.arrayBuffer());
|
|
43029
42342
|
}
|
|
43030
|
-
const qrContent =
|
|
42343
|
+
const qrContent = scan(imageBuffer);
|
|
43031
42344
|
if (qrContent) {
|
|
43032
42345
|
logger.mark("二维码解码成功:", qrContent);
|
|
43033
42346
|
return {
|