upload TRSS-Plugin¥ai-plugin (#8)
Browse files- upload TRSS-Plugin¥ai-plugin (cbf22086314f08e29b770c72de681d73b53b4652)
Co-authored-by: Erzaozi <erzaozi@users.noreply.huggingface.co>
This view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +9 -0
- Yunzai/plugins/TRSS-Plugin/.gitignore +5 -0
- Yunzai/plugins/TRSS-Plugin/Apps/AliyunPan.js +215 -0
- Yunzai/plugins/TRSS-Plugin/Apps/BaiduPan.js +215 -0
- Yunzai/plugins/TRSS-Plugin/Apps/File.js +150 -0
- Yunzai/plugins/TRSS-Plugin/Apps/Markdown.js +45 -0
- Yunzai/plugins/TRSS-Plugin/Apps/QRCode.js +23 -0
- Yunzai/plugins/TRSS-Plugin/Apps/RealESRGAN.js +106 -0
- Yunzai/plugins/TRSS-Plugin/Apps/RemBG.js +106 -0
- Yunzai/plugins/TRSS-Plugin/Apps/RemoteCommand.js +151 -0
- Yunzai/plugins/TRSS-Plugin/Apps/Script.js +61 -0
- Yunzai/plugins/TRSS-Plugin/Apps/SourceCode.js +45 -0
- Yunzai/plugins/TRSS-Plugin/Apps/SystemInfo.js +103 -0
- Yunzai/plugins/TRSS-Plugin/Apps/Voice.js +120 -0
- Yunzai/plugins/TRSS-Plugin/Apps/miHoYoLogin.js +280 -0
- Yunzai/plugins/TRSS-Plugin/Model/config.js +51 -0
- Yunzai/plugins/TRSS-Plugin/Model/uploadRecord.js +427 -0
- Yunzai/plugins/TRSS-Plugin/Picture/Microsoft_C++_/347/224/237/346/210/220/345/267/245/345/205/267.png +0 -0
- Yunzai/plugins/TRSS-Plugin/Picture/苏半夏.png +3 -0
- Yunzai/plugins/TRSS-Plugin/Picture/苏半夏D.png +3 -0
- Yunzai/plugins/TRSS-Plugin/README.md +278 -0
- Yunzai/plugins/TRSS-Plugin/Resources/Code/Code.css +20 -0
- Yunzai/plugins/TRSS-Plugin/Resources/Code/Code.html +10 -0
- Yunzai/plugins/TRSS-Plugin/Resources/Markdown/Markdown.css +18 -0
- Yunzai/plugins/TRSS-Plugin/Resources/Markdown/Markdown.html +19 -0
- Yunzai/plugins/TRSS-Plugin/Resources/SourceCode/SourceCode.css +18 -0
- Yunzai/plugins/TRSS-Plugin/Resources/SourceCode/SourceCode.html +19 -0
- Yunzai/plugins/TRSS-Plugin/Resources/fonts/InconsolataGo.ttf +0 -0
- Yunzai/plugins/TRSS-Plugin/index.js +56 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/.bin/markdown-it +17 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/.bin/markdown-it.CMD +12 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/.bin/markdown-it.ps1 +41 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/.bin/qrcode +17 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/.bin/qrcode.CMD +12 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/.bin/qrcode.ps1 +41 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/.notags +0 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/LICENSE +22 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/Makefile +24 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/Readme.md +205 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/ansi_up.d.ts +46 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/ansi_up.js +431 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/ansi_up.js.map +1 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/ansi_up.ts +783 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/browser.html +28 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/browser_amd.html +16 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/jquery-1.7.2.min.js +4 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/main.js +14 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/require.js +34 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/theme.css +34 -0
- Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/theme.scss +132 -0
.gitattributes
CHANGED
@@ -46,3 +46,12 @@ Yunzai/plugins/miao-plugin/resources/common/font/NZBZ.ttf filter=lfs diff=lfs me
|
|
46 |
Yunzai/plugins/miao-plugin/resources/help/icon.png filter=lfs diff=lfs merge=lfs -text
|
47 |
Yunzai/plugins/miao-plugin/resources/meta/character/莱欧斯利/imgs/splash.webp filter=lfs diff=lfs merge=lfs -text
|
48 |
Yunzai/plugins/Guoba-Plugin/server/static/assets/HYWH-65W.woff filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
Yunzai/plugins/miao-plugin/resources/help/icon.png filter=lfs diff=lfs merge=lfs -text
|
47 |
Yunzai/plugins/miao-plugin/resources/meta/character/莱欧斯利/imgs/splash.webp filter=lfs diff=lfs merge=lfs -text
|
48 |
Yunzai/plugins/Guoba-Plugin/server/static/assets/HYWH-65W.woff filter=lfs diff=lfs merge=lfs -text
|
49 |
+
Yunzai/plugins/TRSS-Plugin/Picture/苏半夏.png filter=lfs diff=lfs merge=lfs -text
|
50 |
+
Yunzai/plugins/TRSS-Plugin/Picture/苏半夏D.png filter=lfs diff=lfs merge=lfs -text
|
51 |
+
Yunzai/plugins/yenai-plugin/resources/admin/imgs/bg/default.jpg filter=lfs diff=lfs merge=lfs -text
|
52 |
+
Yunzai/plugins/yenai-plugin/resources/common/font/FZB.ttf filter=lfs diff=lfs merge=lfs -text
|
53 |
+
Yunzai/plugins/yenai-plugin/resources/common/font/FZB.woff filter=lfs diff=lfs merge=lfs -text
|
54 |
+
Yunzai/plugins/yenai-plugin/resources/common/font/HYWH-65W.ttf filter=lfs diff=lfs merge=lfs -text
|
55 |
+
Yunzai/plugins/yenai-plugin/resources/common/font/HYWH-65W.woff filter=lfs diff=lfs merge=lfs -text
|
56 |
+
Yunzai/plugins/yenai-plugin/resources/common/font/NZBZ.ttf filter=lfs diff=lfs merge=lfs -text
|
57 |
+
Yunzai/plugins/yenai-plugin/resources/help/imgs/default.png filter=lfs diff=lfs merge=lfs -text
|
Yunzai/plugins/TRSS-Plugin/.gitignore
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
node_modules
|
2 |
+
Real-ESRGAN
|
3 |
+
RemBG
|
4 |
+
GenshinVoice
|
5 |
+
ChatWaifu
|
Yunzai/plugins/TRSS-Plugin/Apps/AliyunPan.js
ADDED
@@ -0,0 +1,215 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const Commands = {
|
2 |
+
"": "help",
|
3 |
+
"帮助": "help",
|
4 |
+
"相簿": "album",
|
5 |
+
"下载": "download",
|
6 |
+
"链接": "locate",
|
7 |
+
"查看": "ls",
|
8 |
+
"创建目录": "mkdir",
|
9 |
+
"移动": "mv",
|
10 |
+
"回收站": "recycle",
|
11 |
+
"重命名": "rename",
|
12 |
+
"删除": "rm",
|
13 |
+
"分享": "share",
|
14 |
+
"同步备份": "sync",
|
15 |
+
"树形图": "tree",
|
16 |
+
"上传": "upload",
|
17 |
+
"在线网盘": "webdav",
|
18 |
+
"切换网盘": "drive",
|
19 |
+
"登录账号": "login",
|
20 |
+
"账号列表": "loglist",
|
21 |
+
"退出账号": "logout",
|
22 |
+
"空间配额": "quota",
|
23 |
+
"切换账号": "su",
|
24 |
+
"当前账号": "who"
|
25 |
+
}
|
26 |
+
|
27 |
+
let path
|
28 |
+
if (process.platform == "win32")
|
29 |
+
path = `${process.env.HOME}\\aliyunpan\\`
|
30 |
+
else
|
31 |
+
path = `${process.env.HOME}/aliyunpan/`
|
32 |
+
const cmdPath = `${path}aliyunpan`
|
33 |
+
const errorTips = "请使用脚本安装阿里云盘,并正常登录后再使用此功能\nhttps://Yunzai.TRSS.me\nhttps://TRSS.me"
|
34 |
+
let Running
|
35 |
+
let es
|
36 |
+
|
37 |
+
export class AliyunPan extends plugin {
|
38 |
+
constructor() {
|
39 |
+
super({
|
40 |
+
name: "阿里云盘",
|
41 |
+
dsc: "阿里云盘",
|
42 |
+
event: "message",
|
43 |
+
priority: 10,
|
44 |
+
rule: [
|
45 |
+
{
|
46 |
+
reg: "^阿里云盘上传",
|
47 |
+
fnc: "UploadDetect"
|
48 |
+
},
|
49 |
+
{
|
50 |
+
reg: "^阿里云盘下载",
|
51 |
+
fnc: "Download"
|
52 |
+
},
|
53 |
+
{
|
54 |
+
reg: "^阿里云盘",
|
55 |
+
fnc: "AliyunPan"
|
56 |
+
}
|
57 |
+
]
|
58 |
+
})
|
59 |
+
}
|
60 |
+
|
61 |
+
async execSync(cmd) {
|
62 |
+
return new Promise(resolve => {
|
63 |
+
exec(cmd, (error, stdout, stderr) => {
|
64 |
+
resolve({ error, stdout, stderr })
|
65 |
+
})
|
66 |
+
})
|
67 |
+
}
|
68 |
+
|
69 |
+
async execTask(e, cmd) {
|
70 |
+
logger.mark(`[阿里云盘] 执行:${logger.blue(cmd)}`)
|
71 |
+
const ret = await this.execSync(cmd)
|
72 |
+
logger.mark(`[阿里云盘]\n${ret.stdout.trim()}\n${logger.red(ret.stderr.trim())}`)
|
73 |
+
|
74 |
+
if (ret.stdout) {
|
75 |
+
await this.reply(ret.stdout.trim(), true)
|
76 |
+
}
|
77 |
+
|
78 |
+
if (ret.stderr) {
|
79 |
+
await this.reply(`标准错误输出:\n${ret.stderr.trim()}`, true)
|
80 |
+
}
|
81 |
+
|
82 |
+
if (ret.error) {
|
83 |
+
logger.error(`阿里云盘错误:${logger.red(ret.error)}`)
|
84 |
+
await this.reply(`阿里云盘错误:${ret.error}`, true)
|
85 |
+
await this.reply(errorTips)
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
async UploadDetect(e) {
|
90 |
+
es = this.e
|
91 |
+
this.setContext("Upload")
|
92 |
+
await this.reply("请发送文件", true)
|
93 |
+
}
|
94 |
+
|
95 |
+
async Upload(e) {
|
96 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
97 |
+
if(!this.e.file)return false
|
98 |
+
|
99 |
+
this.finish("Upload")
|
100 |
+
const filePath = `${path}${this.e.file.name}`
|
101 |
+
let fileUrl
|
102 |
+
if (this.e.file.url)
|
103 |
+
fileUrl = this.e.file.url
|
104 |
+
else if (this.e.group?.getFileUrl)
|
105 |
+
fileUrl = await this.e.group.getFileUrl(this.e.file.fid)
|
106 |
+
else if (this.e.friend?.getFileUrl)
|
107 |
+
fileUrl = await this.e.friend.getFileUrl(this.e.file.fid)
|
108 |
+
this.e = es
|
109 |
+
|
110 |
+
if (!fileUrl) {
|
111 |
+
await this.reply("文件链接获取失败", true)
|
112 |
+
return false
|
113 |
+
}
|
114 |
+
|
115 |
+
if (Running) {
|
116 |
+
await this.reply("有正在执行的阿里云盘任务,请稍等……", true)
|
117 |
+
return false
|
118 |
+
}
|
119 |
+
Running = true
|
120 |
+
await this.reply(`开始下载文件,请稍等……\n文件链接:${fileUrl}\n保存路径:${filePath}`, true)
|
121 |
+
|
122 |
+
const ret = await common.downFile(fileUrl, filePath)
|
123 |
+
if (!ret) {
|
124 |
+
await this.reply("文件下载错误", true)
|
125 |
+
Running = false
|
126 |
+
return true
|
127 |
+
}
|
128 |
+
|
129 |
+
const remotePath = this.e.msg.replace("阿里云盘上传", "").trim()
|
130 |
+
await this.reply(`文件下载完成,开始上传到:${remotePath}`, true)
|
131 |
+
const cmd = `'${cmdPath}' upload '${filePath}' '${remotePath}'`
|
132 |
+
|
133 |
+
await this.execTask(es, cmd)
|
134 |
+
await fs.unlinkSync(filePath)
|
135 |
+
Running = false
|
136 |
+
}
|
137 |
+
|
138 |
+
async Download(e) {
|
139 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
140 |
+
if (Running) {
|
141 |
+
await this.reply("有正在执行的阿里云盘任务,请稍等……", true)
|
142 |
+
return false
|
143 |
+
}
|
144 |
+
|
145 |
+
this.finish("Download")
|
146 |
+
const remotePath = this.e.msg.replace("阿里云盘下载", "").trim()
|
147 |
+
if (!remotePath) {
|
148 |
+
this.setContext("Download")
|
149 |
+
await this.reply("请发送文件路径", true)
|
150 |
+
return true
|
151 |
+
}
|
152 |
+
|
153 |
+
Running = true
|
154 |
+
await this.reply("开始下载文件,请稍等……", true)
|
155 |
+
|
156 |
+
const cmd = `'${cmdPath}' download '${remotePath}' --saveto '${path}'`
|
157 |
+
|
158 |
+
await this.execTask(e, cmd)
|
159 |
+
|
160 |
+
const filePath = `${path}${remotePath}`
|
161 |
+
if (!fs.existsSync(filePath)) {
|
162 |
+
await this.reply("文件下载错误", true)
|
163 |
+
Running = false
|
164 |
+
return true
|
165 |
+
}
|
166 |
+
if (!fs.statSync(filePath).isFile()) {
|
167 |
+
await this.reply("暂不支持发送文件夹", true)
|
168 |
+
Running = false
|
169 |
+
return true
|
170 |
+
}
|
171 |
+
|
172 |
+
try {
|
173 |
+
let res
|
174 |
+
if (this.e.isGroup) {
|
175 |
+
if (this.e.group.sendFile)
|
176 |
+
res = await this.e.group.sendFile(filePath)
|
177 |
+
else
|
178 |
+
res = await this.e.group.fs.upload(filePath)
|
179 |
+
} else {
|
180 |
+
res = await this.e.friend.sendFile(filePath)
|
181 |
+
}
|
182 |
+
|
183 |
+
if (res) {
|
184 |
+
let fileUrl
|
185 |
+
if (this.e.group?.getFileUrl)
|
186 |
+
fileUrl = await this.e.group.getFileUrl(res.fid)
|
187 |
+
else if (this.e.friend?.getFileUrl)
|
188 |
+
fileUrl = await this.e.friend.getFileUrl(res)
|
189 |
+
|
190 |
+
if (fileUrl)
|
191 |
+
await this.reply(`文件发送完成:${fileUrl}`, true)
|
192 |
+
else
|
193 |
+
await this.reply(`文件发送完成:${JSON.stringify(res)}`, true)
|
194 |
+
}
|
195 |
+
|
196 |
+
} catch(err) {
|
197 |
+
logger.error(`文件发送错误:${logger.red(JSON.stringify(err))}`)
|
198 |
+
await this.reply(`文件发送错误:${JSON.stringify(err)}`)
|
199 |
+
}
|
200 |
+
|
201 |
+
await fs.unlinkSync(filePath)
|
202 |
+
Running = false
|
203 |
+
}
|
204 |
+
|
205 |
+
async AliyunPan(e) {
|
206 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
207 |
+
let msg = this.e.msg.replace("阿里云盘", "").trim().split(" ")
|
208 |
+
if (msg[0] in Commands) {
|
209 |
+
msg[0] = Commands[msg[0]]
|
210 |
+
}
|
211 |
+
msg = msg.join(" ")
|
212 |
+
const cmd = `'${cmdPath}' ${msg}`
|
213 |
+
await this.execTask(e, cmd)
|
214 |
+
}
|
215 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Apps/BaiduPan.js
ADDED
@@ -0,0 +1,215 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const Commands = {
|
2 |
+
"": "help",
|
3 |
+
"帮助": "help",
|
4 |
+
"复制": "cp",
|
5 |
+
"下载": "download",
|
6 |
+
"链接": "locate",
|
7 |
+
"查看": "ls",
|
8 |
+
"元信息": "meta",
|
9 |
+
"创建目录": "mkdir",
|
10 |
+
"移动": "mv",
|
11 |
+
"离线下载": "od",
|
12 |
+
"空间配额": "quota",
|
13 |
+
"回收站": "recycle",
|
14 |
+
"删除": "rm",
|
15 |
+
"搜索": "search",
|
16 |
+
"分享": "share",
|
17 |
+
"转存": "transfer",
|
18 |
+
"树形图": "tree",
|
19 |
+
"上传": "upload",
|
20 |
+
"登录账号": "login",
|
21 |
+
"账号列表": "loglist",
|
22 |
+
"退出账号": "logout",
|
23 |
+
"切换账号": "su",
|
24 |
+
"当前账号": "who"
|
25 |
+
}
|
26 |
+
|
27 |
+
let path
|
28 |
+
if (process.platform == "win32")
|
29 |
+
path = `${process.env.HOME}\\BaiduPCS-Go\\`
|
30 |
+
else
|
31 |
+
path = `${process.env.HOME}/BaiduPCS-Go/`
|
32 |
+
const cmdPath = `${path}BaiduPCS-Go`
|
33 |
+
const errorTips = "请使用脚本安装百度网盘,并正常登录后再使用此功能\nhttps://Yunzai.TRSS.me\nhttps://TRSS.me"
|
34 |
+
let Running
|
35 |
+
let es
|
36 |
+
|
37 |
+
export class BaiduPan extends plugin {
|
38 |
+
constructor() {
|
39 |
+
super({
|
40 |
+
name: "百度网盘",
|
41 |
+
dsc: "百度网盘",
|
42 |
+
event: "message",
|
43 |
+
priority: 10,
|
44 |
+
rule: [
|
45 |
+
{
|
46 |
+
reg: "^百度网盘上传",
|
47 |
+
fnc: "UploadDetect"
|
48 |
+
},
|
49 |
+
{
|
50 |
+
reg: "^百度网盘下载",
|
51 |
+
fnc: "Download"
|
52 |
+
},
|
53 |
+
{
|
54 |
+
reg: "^百度网盘",
|
55 |
+
fnc: "BaiduPan"
|
56 |
+
}
|
57 |
+
]
|
58 |
+
})
|
59 |
+
}
|
60 |
+
|
61 |
+
async execSync(cmd) {
|
62 |
+
return new Promise(resolve => {
|
63 |
+
exec(cmd, (error, stdout, stderr) => {
|
64 |
+
resolve({ error, stdout, stderr })
|
65 |
+
})
|
66 |
+
})
|
67 |
+
}
|
68 |
+
|
69 |
+
async execTask(e, cmd) {
|
70 |
+
logger.mark(`[百度网盘] 执行:${logger.blue(cmd)}`)
|
71 |
+
const ret = await this.execSync(cmd)
|
72 |
+
logger.mark(`[百度网盘]\n${ret.stdout.trim()}\n${logger.red(ret.stderr.trim())}`)
|
73 |
+
|
74 |
+
if (ret.stdout) {
|
75 |
+
await this.reply(ret.stdout.trim(), true)
|
76 |
+
}
|
77 |
+
|
78 |
+
if (ret.stderr) {
|
79 |
+
await this.reply(`标准错误输出:\n${ret.stderr.trim()}`, true)
|
80 |
+
}
|
81 |
+
|
82 |
+
if (ret.error) {
|
83 |
+
logger.error(`百度网盘错误:${logger.red(ret.error)}`)
|
84 |
+
await this.reply(`百度网盘错误:${ret.error}`, true)
|
85 |
+
await this.reply(errorTips)
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
async UploadDetect(e) {
|
90 |
+
es = this.e
|
91 |
+
this.setContext("Upload")
|
92 |
+
await this.reply("请发送文件", true)
|
93 |
+
}
|
94 |
+
|
95 |
+
async Upload(e) {
|
96 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
97 |
+
if(!this.e.file)return false
|
98 |
+
|
99 |
+
this.finish("Upload")
|
100 |
+
const filePath = `${path}${this.e.file.name}`
|
101 |
+
let fileUrl
|
102 |
+
if (this.e.file.url)
|
103 |
+
fileUrl = this.e.file.url
|
104 |
+
else if (this.e.group?.getFileUrl)
|
105 |
+
fileUrl = await this.e.group.getFileUrl(this.e.file.fid)
|
106 |
+
else if (this.e.friend?.getFileUrl)
|
107 |
+
fileUrl = await this.e.friend.getFileUrl(this.e.file.fid)
|
108 |
+
this.e = es
|
109 |
+
|
110 |
+
if (!fileUrl) {
|
111 |
+
await this.reply("文件链接获取失败", true)
|
112 |
+
return false
|
113 |
+
}
|
114 |
+
|
115 |
+
if (Running) {
|
116 |
+
await this.reply("有正在执行的百度网盘任务,请稍等……", true)
|
117 |
+
return false
|
118 |
+
}
|
119 |
+
Running = true
|
120 |
+
await this.reply(`开始下载文件,请稍等……\n文件链接:${fileUrl}\n保存路径:${filePath}`, true)
|
121 |
+
|
122 |
+
const ret = await common.downFile(fileUrl, filePath)
|
123 |
+
if (!ret) {
|
124 |
+
await this.reply("文件下载错误", true)
|
125 |
+
Running = false
|
126 |
+
return true
|
127 |
+
}
|
128 |
+
|
129 |
+
const remotePath = this.e.msg.replace("百度网盘上传", "").trim()
|
130 |
+
await this.reply(`文件下载完成,开始上传到:${remotePath}`, true)
|
131 |
+
const cmd = `'${cmdPath}' upload '${filePath}' '${remotePath}'`
|
132 |
+
|
133 |
+
await this.execTask(es, cmd)
|
134 |
+
await fs.unlinkSync(filePath)
|
135 |
+
Running = false
|
136 |
+
}
|
137 |
+
|
138 |
+
async Download(e) {
|
139 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
140 |
+
if (Running) {
|
141 |
+
await this.reply("有正在执行的百度网盘任务,请稍等……", true)
|
142 |
+
return false
|
143 |
+
}
|
144 |
+
|
145 |
+
this.finish("Download")
|
146 |
+
const remotePath = this.e.msg.replace("百度网盘下载", "").trim()
|
147 |
+
if (!remotePath) {
|
148 |
+
this.setContext("Download")
|
149 |
+
await this.reply("请发送文件路径", true)
|
150 |
+
return true
|
151 |
+
}
|
152 |
+
|
153 |
+
Running = true
|
154 |
+
await this.reply("开始下载文件,请稍等……", true)
|
155 |
+
|
156 |
+
const cmd = `'${cmdPath}' download '${remotePath}' --saveto '${path}'`
|
157 |
+
|
158 |
+
await this.execTask(e, cmd)
|
159 |
+
|
160 |
+
const filePath = `${path}${remotePath.substr(remotePath.lastIndexOf("/")+1)}`
|
161 |
+
if (!fs.existsSync(filePath)) {
|
162 |
+
await this.reply("文件下载错误", true)
|
163 |
+
Running = false
|
164 |
+
return true
|
165 |
+
}
|
166 |
+
if (!fs.statSync(filePath).isFile()) {
|
167 |
+
await this.reply("暂不支持发送文件夹", true)
|
168 |
+
Running = false
|
169 |
+
return true
|
170 |
+
}
|
171 |
+
|
172 |
+
try {
|
173 |
+
let res
|
174 |
+
if (this.e.isGroup) {
|
175 |
+
if (this.e.group.sendFile)
|
176 |
+
res = await this.e.group.sendFile(filePath)
|
177 |
+
else
|
178 |
+
res = await this.e.group.fs.upload(filePath)
|
179 |
+
} else {
|
180 |
+
res = await this.e.friend.sendFile(filePath)
|
181 |
+
}
|
182 |
+
|
183 |
+
if (res) {
|
184 |
+
let fileUrl
|
185 |
+
if (this.e.group?.getFileUrl)
|
186 |
+
fileUrl = await this.e.group.getFileUrl(res.fid)
|
187 |
+
else if (this.e.friend?.getFileUrl)
|
188 |
+
fileUrl = await this.e.friend.getFileUrl(res)
|
189 |
+
|
190 |
+
if (fileUrl)
|
191 |
+
await this.reply(`文件发送完成:${fileUrl}`, true)
|
192 |
+
else
|
193 |
+
await this.reply(`文件发送完成:${JSON.stringify(res)}`, true)
|
194 |
+
}
|
195 |
+
|
196 |
+
} catch(err) {
|
197 |
+
logger.error(`文件发送错误:${logger.red(JSON.stringify(err))}`)
|
198 |
+
await this.reply(`文件发送错误:${JSON.stringify(err)}`)
|
199 |
+
}
|
200 |
+
|
201 |
+
await fs.unlinkSync(filePath)
|
202 |
+
Running = false
|
203 |
+
}
|
204 |
+
|
205 |
+
async BaiduPan(e) {
|
206 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
207 |
+
let msg = this.e.msg.replace("百度网盘", "").trim().split(" ")
|
208 |
+
if (msg[0] in Commands) {
|
209 |
+
msg[0] = Commands[msg[0]]
|
210 |
+
}
|
211 |
+
msg = msg.join(" ")
|
212 |
+
const cmd = `'${cmdPath}' ${msg}`
|
213 |
+
await this.execTask(e, cmd)
|
214 |
+
}
|
215 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Apps/File.js
ADDED
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
let Running
|
2 |
+
let es
|
3 |
+
|
4 |
+
export class File extends plugin {
|
5 |
+
constructor() {
|
6 |
+
super({
|
7 |
+
name: "文件操作",
|
8 |
+
dsc: "文件操作",
|
9 |
+
event: "message",
|
10 |
+
priority: 10,
|
11 |
+
rule: [
|
12 |
+
{
|
13 |
+
reg: "^文件查看",
|
14 |
+
fnc: "List"
|
15 |
+
},
|
16 |
+
{
|
17 |
+
reg: "^文件上传",
|
18 |
+
fnc: "Upload"
|
19 |
+
},
|
20 |
+
{
|
21 |
+
reg: "^文件下载",
|
22 |
+
fnc: "DownloadDetect"
|
23 |
+
}
|
24 |
+
]
|
25 |
+
})
|
26 |
+
}
|
27 |
+
|
28 |
+
async List(e) {
|
29 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
30 |
+
|
31 |
+
this.finish("List")
|
32 |
+
const filePath = this.e.msg.replace("文件查看", "").trim()
|
33 |
+
if (!filePath) {
|
34 |
+
this.setContext("List")
|
35 |
+
await this.reply("请发送文件路径", true)
|
36 |
+
return true
|
37 |
+
}
|
38 |
+
|
39 |
+
if (!fs.existsSync(filePath)) {
|
40 |
+
await this.reply("路径不存在", true)
|
41 |
+
return true
|
42 |
+
}
|
43 |
+
if (!fs.statSync(filePath).isDirectory()) {
|
44 |
+
await this.reply("该路径不是一个文件夹", true)
|
45 |
+
return true
|
46 |
+
}
|
47 |
+
|
48 |
+
await this.reply(fs.readdirSync(filePath).join("\n"), true)
|
49 |
+
}
|
50 |
+
|
51 |
+
async Upload(e) {
|
52 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
53 |
+
if (Running) {
|
54 |
+
await this.reply("有正在执行的文件任务,请稍等……", true)
|
55 |
+
return false
|
56 |
+
}
|
57 |
+
|
58 |
+
this.finish("Upload")
|
59 |
+
const filePath = this.e.msg.replace("文件上传", "").trim()
|
60 |
+
if (!filePath) {
|
61 |
+
this.setContext("Upload")
|
62 |
+
await this.reply("请发送文件路径", true)
|
63 |
+
return true
|
64 |
+
}
|
65 |
+
|
66 |
+
if (!fs.existsSync(filePath)) {
|
67 |
+
await this.reply("文件不存在", true)
|
68 |
+
return true
|
69 |
+
}
|
70 |
+
if (!fs.statSync(filePath).isFile()) {
|
71 |
+
await this.reply("暂不支持上传文件夹", true)
|
72 |
+
return true
|
73 |
+
}
|
74 |
+
|
75 |
+
Running = true
|
76 |
+
await this.reply("开始上传文件,请稍等……", true)
|
77 |
+
|
78 |
+
try {
|
79 |
+
let res
|
80 |
+
if (this.e.isGroup) {
|
81 |
+
if (this.e.group.sendFile)
|
82 |
+
res = await this.e.group.sendFile(filePath)
|
83 |
+
else
|
84 |
+
res = await this.e.group.fs.upload(filePath)
|
85 |
+
} else {
|
86 |
+
res = await this.e.friend.sendFile(filePath)
|
87 |
+
}
|
88 |
+
|
89 |
+
if (res) {
|
90 |
+
let fileUrl
|
91 |
+
if (this.e.group?.getFileUrl)
|
92 |
+
fileUrl = await this.e.group.getFileUrl(res.fid)
|
93 |
+
else if (this.e.friend?.getFileUrl)
|
94 |
+
fileUrl = await this.e.friend.getFileUrl(res)
|
95 |
+
|
96 |
+
if (fileUrl)
|
97 |
+
await this.reply(`文件上传完成:${fileUrl}`, true)
|
98 |
+
else
|
99 |
+
await this.reply(`文件上传完成:${JSON.stringify(res)}`, true)
|
100 |
+
}
|
101 |
+
|
102 |
+
} catch(err) {
|
103 |
+
logger.error(`文件上传错误:${logger.red(JSON.stringify(err))}`)
|
104 |
+
await this.reply(`文件上传错误:${JSON.stringify(err)}`)
|
105 |
+
}
|
106 |
+
Running = false
|
107 |
+
}
|
108 |
+
|
109 |
+
async DownloadDetect(e) {
|
110 |
+
es = this.e
|
111 |
+
this.setContext("Download")
|
112 |
+
await this.reply("请发送文件", true)
|
113 |
+
}
|
114 |
+
|
115 |
+
async Download(e) {
|
116 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
117 |
+
if(!this.e.file)return false
|
118 |
+
|
119 |
+
this.finish("Download")
|
120 |
+
const filePath = `${es.msg.replace("文件下载", "").trim()||process.cwd()}/${this.e.file.name}`
|
121 |
+
let fileUrl
|
122 |
+
if (this.e.file.url)
|
123 |
+
fileUrl = this.e.file.url
|
124 |
+
else if (this.e.group?.getFileUrl)
|
125 |
+
fileUrl = await this.e.group.getFileUrl(this.e.file.fid)
|
126 |
+
else if (this.e.friend?.getFileUrl)
|
127 |
+
fileUrl = await this.e.friend.getFileUrl(this.e.file.fid)
|
128 |
+
this.e = es
|
129 |
+
|
130 |
+
if (!fileUrl) {
|
131 |
+
await this.reply("文件链接获取失败", true)
|
132 |
+
return false
|
133 |
+
}
|
134 |
+
|
135 |
+
if (Running) {
|
136 |
+
await this.reply("有正在执行的文件任务,请稍等……", true)
|
137 |
+
return false
|
138 |
+
}
|
139 |
+
Running = true
|
140 |
+
await this.reply(`开始下载文件,请稍等……\n文件链接:${fileUrl}\n保存路径:${filePath}`, true)
|
141 |
+
|
142 |
+
const ret = await common.downFile(fileUrl, filePath)
|
143 |
+
if (ret) {
|
144 |
+
await this.reply("文件下载完成", true)
|
145 |
+
} else {
|
146 |
+
await this.reply("文件下载错误", true)
|
147 |
+
}
|
148 |
+
Running = false
|
149 |
+
}
|
150 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Apps/Markdown.js
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const htmlDir = `${process.cwd()}/plugins/TRSS-Plugin/Resources/Markdown/`
|
2 |
+
const tplFile = `${htmlDir}Markdown.html`
|
3 |
+
|
4 |
+
export class Markdown extends plugin {
|
5 |
+
constructor() {
|
6 |
+
super({
|
7 |
+
name: "Markdown",
|
8 |
+
dsc: "Markdown",
|
9 |
+
event: "message",
|
10 |
+
priority: 10,
|
11 |
+
rule: [
|
12 |
+
{
|
13 |
+
reg: "^md.+",
|
14 |
+
fnc: "Markdown"
|
15 |
+
}
|
16 |
+
]
|
17 |
+
})
|
18 |
+
}
|
19 |
+
|
20 |
+
async Markdown(e) {
|
21 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
22 |
+
const msg = this.e.msg.replace("md", "").trim()
|
23 |
+
logger.mark(`[Markdown] 查看:${logger.blue(msg)}`)
|
24 |
+
|
25 |
+
let mdFile = msg
|
26 |
+
if (/^https?:\/\//.test(msg)) {
|
27 |
+
mdFile =`${process.cwd()}/data/cache.md`
|
28 |
+
const ret = await common.downFile(msg, mdFile)
|
29 |
+
if (!ret) {
|
30 |
+
await this.reply("文件下载错误", true)
|
31 |
+
return false
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
if (!(fs.existsSync(mdFile) && fs.statSync(mdFile).isFile())) {
|
36 |
+
await this.reply("文件不存在", true)
|
37 |
+
return false
|
38 |
+
}
|
39 |
+
|
40 |
+
const Markdown = md.render(fs.readFileSync(mdFile, "utf-8"))
|
41 |
+
const img = await puppeteer.screenshot("Markdown", { tplFile, htmlDir, Markdown })
|
42 |
+
|
43 |
+
await this.reply(img, true)
|
44 |
+
}
|
45 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Apps/QRCode.js
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export class QRCode extends plugin {
|
2 |
+
constructor() {
|
3 |
+
super({
|
4 |
+
name: "二维码生成",
|
5 |
+
dsc: "二维码生成",
|
6 |
+
event: "message",
|
7 |
+
priority: 10,
|
8 |
+
rule: [
|
9 |
+
{
|
10 |
+
reg: "^二维码.+",
|
11 |
+
fnc: "QRCode"
|
12 |
+
}
|
13 |
+
]
|
14 |
+
})
|
15 |
+
}
|
16 |
+
|
17 |
+
async QRCode(e) {
|
18 |
+
const msg = this.e.msg.replace("二维码", "").trim()
|
19 |
+
logger.mark(`[二维码生成] 信息:${logger.blue(msg)}`)
|
20 |
+
const img = (await QR.toDataURL(msg)).replace("data:image/png;base64,", "base64://")
|
21 |
+
await this.reply(segment.image(img), true)
|
22 |
+
}
|
23 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Apps/RealESRGAN.js
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const path = `${process.cwd()}/plugins/TRSS-Plugin/Real-ESRGAN/`
|
2 |
+
const errorTips = "请查看安装使用教程:\nhttps://Yunzai.TRSS.me\n并将报错通过联系方式反馈给开发者"
|
3 |
+
let model
|
4 |
+
let Running
|
5 |
+
|
6 |
+
export class RealESRGAN extends plugin {
|
7 |
+
constructor() {
|
8 |
+
super({
|
9 |
+
name: "图片修复",
|
10 |
+
dsc: "图片修复",
|
11 |
+
event: "message",
|
12 |
+
priority: 10,
|
13 |
+
rule: [
|
14 |
+
{
|
15 |
+
reg: "^#?(动漫)?图片修复$",
|
16 |
+
fnc: "DetectImage"
|
17 |
+
}
|
18 |
+
]
|
19 |
+
})
|
20 |
+
}
|
21 |
+
|
22 |
+
async execSync(cmd) {
|
23 |
+
return new Promise(resolve => {
|
24 |
+
exec(cmd, (error, stdout, stderr) => {
|
25 |
+
resolve({ error, stdout, stderr })
|
26 |
+
})
|
27 |
+
})
|
28 |
+
}
|
29 |
+
|
30 |
+
async DetectImage(e) {
|
31 |
+
if (this.e.msg.match("动漫")) {
|
32 |
+
model = "RealESRGAN_x4plus_anime_6B"
|
33 |
+
} else {
|
34 |
+
model = "RealESRGAN_x4plus"
|
35 |
+
}
|
36 |
+
|
37 |
+
let reply
|
38 |
+
if (this.e.getReply) {
|
39 |
+
reply = await this.e.getReply()
|
40 |
+
} else if (this.e.source) {
|
41 |
+
if (this.e.group?.getChatHistory)
|
42 |
+
reply = (await this.e.group.getChatHistory(this.e.source.seq, 1)).pop()
|
43 |
+
else if (this.e.friend?.getChatHistory)
|
44 |
+
reply = (await this.e.friend.getChatHistory(this.e.source.time, 1)).pop()
|
45 |
+
}
|
46 |
+
if (reply?.message) for (const i of reply.message)
|
47 |
+
if (i.type == "image" || i.type == "file") {
|
48 |
+
this.e.img = [i.url]
|
49 |
+
break
|
50 |
+
}
|
51 |
+
|
52 |
+
if (!this.e.img) {
|
53 |
+
this.setContext("RealESRGAN")
|
54 |
+
await this.reply("请发送图片", true)
|
55 |
+
} else {
|
56 |
+
this.RealESRGAN()
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
async RealESRGAN(e) {
|
61 |
+
if (!this.e.img) {
|
62 |
+
return false
|
63 |
+
}
|
64 |
+
|
65 |
+
this.finish("RealESRGAN")
|
66 |
+
if (Running) {
|
67 |
+
await this.reply("正在生成,请稍等……", true)
|
68 |
+
return false
|
69 |
+
}
|
70 |
+
Running = true
|
71 |
+
await this.reply("开始生成,请稍等……", true)
|
72 |
+
|
73 |
+
let url
|
74 |
+
if (config.RealESRGAN.api) {
|
75 |
+
url = `${config.RealESRGAN.api}?user_id=${this.e.user_id}&bot_id=${this.e.self_id}&fp32=True&tile=100&model_name=${model}&input=${encodeURIComponent(this.e.img[0])}`
|
76 |
+
} else {
|
77 |
+
let ret = await common.downFile(this.e.img[0], `${path}input.${config.RealESRGAN.format}`)
|
78 |
+
if (!ret) {
|
79 |
+
await this.reply("下载图片错误", true)
|
80 |
+
await this.reply(errorTips)
|
81 |
+
Running = false
|
82 |
+
return true
|
83 |
+
}
|
84 |
+
|
85 |
+
logger.mark(`[图片修复] 图片保存成功:${logger.blue(this.e.img[0])}`)
|
86 |
+
|
87 |
+
const cmd = `bash '${path}main.sh' --fp32 --tile 100 -n ${model} -i input.${config.RealESRGAN.format}`
|
88 |
+
|
89 |
+
logger.mark(`[图片修复] 执行:${logger.blue(cmd)}`)
|
90 |
+
ret = await this.execSync(cmd)
|
91 |
+
logger.mark(`[图片修复]\n${ret.stdout.trim()}\n${logger.red(ret.stderr.trim())}`)
|
92 |
+
|
93 |
+
if (ret.error) {
|
94 |
+
logger.error(`图片修复错误:${logger.red(ret.error)}`)
|
95 |
+
await this.reply(`图片修复错误:${ret.error}`, true)
|
96 |
+
await this.reply(errorTips)
|
97 |
+
}
|
98 |
+
|
99 |
+
url = `file://${path}results/input_out.${config.RealESRGAN.format}`
|
100 |
+
}
|
101 |
+
|
102 |
+
logger.mark(`[图片修复] 发送图片:${logger.blue(url)}`)
|
103 |
+
Running = false
|
104 |
+
await this.reply(segment.image(url), true)
|
105 |
+
}
|
106 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Apps/RemBG.js
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const path = `${process.cwd()}/plugins/TRSS-Plugin/RemBG/`
|
2 |
+
const errorTips = "请查看安装使用教程:\nhttps://Yunzai.TRSS.me\n并将报错通过联系方式反馈给开发者"
|
3 |
+
let model
|
4 |
+
let Running
|
5 |
+
|
6 |
+
export class RemBG extends plugin {
|
7 |
+
constructor() {
|
8 |
+
super({
|
9 |
+
name: "图片背景去除",
|
10 |
+
dsc: "图片背景去除",
|
11 |
+
event: "message",
|
12 |
+
priority: 10,
|
13 |
+
rule: [
|
14 |
+
{
|
15 |
+
reg: "^#?(动漫)?(图片)?(去除?背景|背景去除?)$",
|
16 |
+
fnc: "DetectImage"
|
17 |
+
}
|
18 |
+
]
|
19 |
+
})
|
20 |
+
}
|
21 |
+
|
22 |
+
async execSync(cmd) {
|
23 |
+
return new Promise(resolve => {
|
24 |
+
exec(cmd, (error, stdout, stderr) => {
|
25 |
+
resolve({ error, stdout, stderr })
|
26 |
+
})
|
27 |
+
})
|
28 |
+
}
|
29 |
+
|
30 |
+
async DetectImage(e) {
|
31 |
+
if (this.e.msg.match("动漫")) {
|
32 |
+
model = "anime.sh"
|
33 |
+
} else {
|
34 |
+
model = "main.sh i"
|
35 |
+
}
|
36 |
+
|
37 |
+
let reply
|
38 |
+
if (this.e.getReply) {
|
39 |
+
reply = await this.e.getReply()
|
40 |
+
} else if (this.e.source) {
|
41 |
+
if (this.e.group?.getChatHistory)
|
42 |
+
reply = (await this.e.group.getChatHistory(this.e.source.seq, 1)).pop()
|
43 |
+
else if (this.e.friend?.getChatHistory)
|
44 |
+
reply = (await this.e.friend.getChatHistory(this.e.source.time, 1)).pop()
|
45 |
+
}
|
46 |
+
if (reply?.message) for (const i of reply.message)
|
47 |
+
if (i.type == "image" || i.type == "file") {
|
48 |
+
this.e.img = [i.url]
|
49 |
+
break
|
50 |
+
}
|
51 |
+
|
52 |
+
if (!this.e.img) {
|
53 |
+
this.setContext("RemBG")
|
54 |
+
await this.reply("请发送图片", true)
|
55 |
+
} else {
|
56 |
+
this.RemBG()
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
async RemBG(e) {
|
61 |
+
if (!this.e.img) {
|
62 |
+
return false
|
63 |
+
}
|
64 |
+
|
65 |
+
this.finish("RemBG")
|
66 |
+
if (Running) {
|
67 |
+
await this.reply("正在生成,请稍等……", true)
|
68 |
+
return false
|
69 |
+
}
|
70 |
+
Running = true
|
71 |
+
await this.reply("开始生成,请稍等……", true)
|
72 |
+
|
73 |
+
let url
|
74 |
+
if (config.RemBG.api) {
|
75 |
+
url = `${config.RemBG.api}?user_id=${this.e.user_id}&bot_id=${this.e.self_id}&url=${encodeURIComponent(this.e.img[0])}`
|
76 |
+
} else {
|
77 |
+
let ret = await common.downFile(this.e.img[0], `${path}input.png`)
|
78 |
+
if (!ret) {
|
79 |
+
await this.reply("下载图片错误", true)
|
80 |
+
await this.reply(errorTips)
|
81 |
+
Running = false
|
82 |
+
return true
|
83 |
+
}
|
84 |
+
|
85 |
+
logger.mark(`[图片背景去除] 图片保存成功:${logger.blue(this.e.img[0])}`)
|
86 |
+
|
87 |
+
const cmd = `bash '${path}'${model} input.png output.png`
|
88 |
+
|
89 |
+
logger.mark(`[图片背景去除] 执行:${logger.blue(cmd)}`)
|
90 |
+
ret = await this.execSync(cmd)
|
91 |
+
logger.mark(`[图片背景去除]\n${ret.stdout.trim()}\n${logger.red(ret.stderr.trim())}`)
|
92 |
+
|
93 |
+
if (ret.error) {
|
94 |
+
logger.error(`图片背景去除错误:${logger.red(ret.error)}`)
|
95 |
+
await this.reply(`图片背景去除错误:${ret.error}`, true)
|
96 |
+
await this.reply(errorTips)
|
97 |
+
}
|
98 |
+
|
99 |
+
url = `file://${path}output.png`
|
100 |
+
}
|
101 |
+
|
102 |
+
logger.mark(`[图片背景去除] 发送图片:${logger.blue(url)}`)
|
103 |
+
Running = false
|
104 |
+
await this.reply(segment.image(url), true)
|
105 |
+
}
|
106 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Apps/RemoteCommand.js
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const htmlDir = `${process.cwd()}/plugins/TRSS-Plugin/Resources/Code/`
|
2 |
+
const tplFile = `${htmlDir}Code.html`
|
3 |
+
|
4 |
+
export class RemoteCommand extends plugin {
|
5 |
+
constructor() {
|
6 |
+
super({
|
7 |
+
name: "远程命令",
|
8 |
+
dsc: "远程命令",
|
9 |
+
event: "message",
|
10 |
+
priority: 10,
|
11 |
+
rule: [
|
12 |
+
{
|
13 |
+
reg: "^rcjp.+",
|
14 |
+
fnc: "RemoteCommandJsPic"
|
15 |
+
},
|
16 |
+
{
|
17 |
+
reg: "^rcj.+",
|
18 |
+
fnc: "RemoteCommandJs"
|
19 |
+
},
|
20 |
+
{
|
21 |
+
reg: "^rcp.+",
|
22 |
+
fnc: "RemoteCommandPic"
|
23 |
+
},
|
24 |
+
{
|
25 |
+
reg: "^rc.+",
|
26 |
+
fnc: "RemoteCommand"
|
27 |
+
}
|
28 |
+
]
|
29 |
+
})
|
30 |
+
}
|
31 |
+
|
32 |
+
toStr(data) {
|
33 |
+
switch (typeof data) {
|
34 |
+
case "string":
|
35 |
+
return data
|
36 |
+
case "number":
|
37 |
+
return String(data)
|
38 |
+
case "object":
|
39 |
+
if (util.isError(data))
|
40 |
+
return data.stack
|
41 |
+
if (Buffer.isBuffer(data))
|
42 |
+
return Buffer.from(data, "utf8").toString()
|
43 |
+
else
|
44 |
+
return JSON.stringify(data)
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
async execSync(cmd) {
|
49 |
+
return new Promise(resolve => {
|
50 |
+
exec(cmd, (error, stdout, stderr) => {
|
51 |
+
resolve({ error, stdout, stderr })
|
52 |
+
})
|
53 |
+
})
|
54 |
+
}
|
55 |
+
|
56 |
+
async evalSync(cmd) {
|
57 |
+
const ret = {}
|
58 |
+
try {
|
59 |
+
ret.stdout = this.toStr(await eval(cmd))
|
60 |
+
} catch (err) {
|
61 |
+
ret.stderr = this.toStr(err)
|
62 |
+
}
|
63 |
+
return ret
|
64 |
+
}
|
65 |
+
|
66 |
+
async RemoteCommandJs(e) {
|
67 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
68 |
+
const cmd = this.e.msg.replace("rcj", "").trim()
|
69 |
+
|
70 |
+
logger.mark(`[远程命令] 执行Js:${logger.blue(cmd)}`)
|
71 |
+
const ret = await this.evalSync(cmd)
|
72 |
+
logger.mark(`[远程命令]\n${ret.stdout}\n${logger.red(ret.stderr)}`)
|
73 |
+
|
74 |
+
if (ret.stdout) {
|
75 |
+
await this.reply(ret.stdout, true)
|
76 |
+
}
|
77 |
+
|
78 |
+
if (ret.stderr) {
|
79 |
+
await this.reply(`错误输出:\n${ret.stderr}`, true)
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
async RemoteCommandJsPic(e) {
|
84 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
85 |
+
const cmd = this.e.msg.replace("rcjp", "").trim()
|
86 |
+
|
87 |
+
logger.mark(`[远程命令] 执行Js:${logger.blue(cmd)}`)
|
88 |
+
const ret = await this.evalSync(cmd)
|
89 |
+
logger.mark(`[远程命令]\n${ret.stdout}\n${logger.red(ret.stderr)}`)
|
90 |
+
|
91 |
+
if (ret.stdout) {
|
92 |
+
const Code = await ansi_up.ansi_to_html(ret.stdout)
|
93 |
+
const img = await puppeteer.screenshot("Code", { tplFile, htmlDir, Code })
|
94 |
+
await this.reply(img, true)
|
95 |
+
}
|
96 |
+
|
97 |
+
if (ret.stderr) {
|
98 |
+
const Code = await ansi_up.ansi_to_html(ret.stderr)
|
99 |
+
const img = await puppeteer.screenshot("Code", { tplFile, htmlDir, Code })
|
100 |
+
await this.reply(["错误输出:", img], true)
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
async RemoteCommand(e) {
|
105 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
106 |
+
const cmd = this.e.msg.replace("rc", "").trim()
|
107 |
+
|
108 |
+
logger.mark(`[远程命令] 执行:${logger.blue(cmd)}`)
|
109 |
+
const ret = await this.execSync(cmd)
|
110 |
+
logger.mark(`[远程命令]\n${ret.stdout.trim()}\n${logger.red(ret.stderr.trim())}`)
|
111 |
+
|
112 |
+
if (ret.stdout) {
|
113 |
+
await this.reply(ret.stdout.trim(), true)
|
114 |
+
}
|
115 |
+
|
116 |
+
if (ret.stderr) {
|
117 |
+
await this.reply(`标准错误输出:\n${ret.stderr.trim()}`, true)
|
118 |
+
}
|
119 |
+
|
120 |
+
if (ret.error) {
|
121 |
+
logger.error(`远程命令错误:${logger.red(ret.error)}`)
|
122 |
+
await this.reply(`远程命令错误:${ret.error}`, true)
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
async RemoteCommandPic(e) {
|
127 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
128 |
+
const cmd = this.e.msg.replace("rcp", "").trim()
|
129 |
+
|
130 |
+
logger.mark(`[远程命令] 执行:${logger.blue(cmd)}`)
|
131 |
+
const ret = await this.execSync(cmd)
|
132 |
+
logger.mark(`[远程命令]\n${ret.stdout.trim()}\n${logger.red(ret.stderr.trim())}`)
|
133 |
+
|
134 |
+
if (ret.stdout) {
|
135 |
+
const Code = await ansi_up.ansi_to_html(ret.stdout.trim())
|
136 |
+
const img = await puppeteer.screenshot("Code", { tplFile, htmlDir, Code })
|
137 |
+
await this.reply(img, true)
|
138 |
+
}
|
139 |
+
|
140 |
+
if (ret.stderr) {
|
141 |
+
const Code = await ansi_up.ansi_to_html(ret.stderr.trim())
|
142 |
+
const img = await puppeteer.screenshot("Code", { tplFile, htmlDir, Code })
|
143 |
+
await this.reply(["标准错误输出:", img], true)
|
144 |
+
}
|
145 |
+
|
146 |
+
if (ret.error) {
|
147 |
+
logger.error(`远程命令错误:${logger.red(ret.error)}`)
|
148 |
+
await this.reply(`远程命令错误:${ret.error}`, true)
|
149 |
+
}
|
150 |
+
}
|
151 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Apps/Script.js
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const htmlDir = `${process.cwd()}/plugins/TRSS-Plugin/Resources/Code/`
|
2 |
+
const tplFile = `${htmlDir}Code.html`
|
3 |
+
const path = `${process.env.HOME}/../`
|
4 |
+
const cmdPath = `${path}Main.sh`
|
5 |
+
const errorTips = "请使用脚本安装,再使用此功能\nhttps://Yunzai.TRSS.me\nhttps://TRSS.me"
|
6 |
+
|
7 |
+
export class Script extends plugin {
|
8 |
+
constructor() {
|
9 |
+
super({
|
10 |
+
name: "脚本执行",
|
11 |
+
dsc: "脚本执行",
|
12 |
+
event: "message",
|
13 |
+
priority: 10,
|
14 |
+
rule: [
|
15 |
+
{
|
16 |
+
reg: "^脚本执行.+",
|
17 |
+
fnc: "Script"
|
18 |
+
}
|
19 |
+
]
|
20 |
+
})
|
21 |
+
}
|
22 |
+
|
23 |
+
async execSync(cmd) {
|
24 |
+
return new Promise(resolve => {
|
25 |
+
exec(cmd, (error, stdout, stderr) => {
|
26 |
+
resolve({ error, stdout, stderr })
|
27 |
+
})
|
28 |
+
})
|
29 |
+
}
|
30 |
+
|
31 |
+
async execTask(e, cmd) {
|
32 |
+
logger.mark(`[脚本执行] 执行:${logger.blue(cmd)}`)
|
33 |
+
const ret = await this.execSync(cmd)
|
34 |
+
logger.mark(`[脚本执行]\n${ret.stdout.trim()}\n${logger.red(ret.stderr.trim())}`)
|
35 |
+
|
36 |
+
if (ret.stdout) {
|
37 |
+
const Code = await ansi_up.ansi_to_html(ret.stdout.trim())
|
38 |
+
const img = await puppeteer.screenshot("Code", { tplFile, htmlDir, Code })
|
39 |
+
await this.reply(img, true)
|
40 |
+
}
|
41 |
+
|
42 |
+
if (ret.stderr) {
|
43 |
+
const Code = await ansi_up.ansi_to_html(ret.stderr.trim())
|
44 |
+
const img = await puppeteer.screenshot("Code", { tplFile, htmlDir, Code })
|
45 |
+
await this.reply(["标准错误输出:", img], true)
|
46 |
+
}
|
47 |
+
|
48 |
+
if (ret.error) {
|
49 |
+
logger.error(`脚本执行错误:${logger.red(ret.error)}`)
|
50 |
+
await this.reply(`脚本执行错误:${ret.error}`, true)
|
51 |
+
await this.reply(errorTips)
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
async Script(e) {
|
56 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
57 |
+
const msg = this.e.msg.replace("脚本执行", "").trim()
|
58 |
+
const cmd = `bash "${cmdPath}" cmd "${msg}"`
|
59 |
+
await this.execTask(e, cmd)
|
60 |
+
}
|
61 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Apps/SourceCode.js
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const htmlDir = `${process.cwd()}/plugins/TRSS-Plugin/Resources/SourceCode/`
|
2 |
+
const tplFile = `${htmlDir}SourceCode.html`
|
3 |
+
|
4 |
+
export class SourceCode extends plugin {
|
5 |
+
constructor() {
|
6 |
+
super({
|
7 |
+
name: "SourceCode",
|
8 |
+
dsc: "SourceCode",
|
9 |
+
event: "message",
|
10 |
+
priority: 10,
|
11 |
+
rule: [
|
12 |
+
{
|
13 |
+
reg: "^sc.+",
|
14 |
+
fnc: "SourceCode"
|
15 |
+
}
|
16 |
+
]
|
17 |
+
})
|
18 |
+
}
|
19 |
+
|
20 |
+
async SourceCode(e) {
|
21 |
+
if(!(this.e.isMaster||this.e.user_id == 2536554304))return false
|
22 |
+
const msg = this.e.msg.replace("sc", "").trim()
|
23 |
+
logger.mark(`[SourceCode] 查看:${logger.blue(msg)}`)
|
24 |
+
|
25 |
+
let scFile = msg
|
26 |
+
if (/^https?:\/\//.test(msg)) {
|
27 |
+
scFile =`${process.cwd()}/data/cache.sc`
|
28 |
+
const ret = await common.downFile(msg, scFile)
|
29 |
+
if (!ret) {
|
30 |
+
await this.reply("文件下载错误", true)
|
31 |
+
return false
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
if (!(fs.existsSync(scFile) && fs.statSync(scFile).isFile())) {
|
36 |
+
await this.reply("文件不存在", true)
|
37 |
+
return false
|
38 |
+
}
|
39 |
+
|
40 |
+
const SourceCode = fs.readFileSync(scFile, "utf-8").replace(/ /g, " ")
|
41 |
+
const img = await puppeteer.screenshot("SourceCode", { tplFile, htmlDir, SourceCode })
|
42 |
+
|
43 |
+
await this.reply(img, true)
|
44 |
+
}
|
45 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Apps/SystemInfo.js
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const htmlDir = `${process.cwd()}/plugins/TRSS-Plugin/Resources/Code/`
|
2 |
+
const tplFile = `${htmlDir}Code.html`
|
3 |
+
const errorTips = "未使用脚本安装,此功能出错属于正常情况\nhttps://TRSS.me"
|
4 |
+
|
5 |
+
let cmd = "fastfetch"
|
6 |
+
let cmds
|
7 |
+
let benchcmd = "bash <(curl -L bench.sh)"
|
8 |
+
let Running
|
9 |
+
|
10 |
+
if (process.platform == "win32") {
|
11 |
+
cmds = `bash -c "${cmd} --stdout"`
|
12 |
+
cmd = `bash -c "${cmd}"`
|
13 |
+
benchcmd = `bash -c "${benchcmd}"`
|
14 |
+
} else {
|
15 |
+
cmds = `${cmd} --pipe`
|
16 |
+
}
|
17 |
+
|
18 |
+
export class SystemInfo extends plugin {
|
19 |
+
constructor() {
|
20 |
+
super({
|
21 |
+
name: "系统信息",
|
22 |
+
dsc: "系统信息",
|
23 |
+
event: "message",
|
24 |
+
priority: 10,
|
25 |
+
rule: [
|
26 |
+
{
|
27 |
+
reg: "^#?系统信息$",
|
28 |
+
fnc: "SystemInfo"
|
29 |
+
},
|
30 |
+
{
|
31 |
+
reg: "^#?系统信息图片$",
|
32 |
+
fnc: "SystemInfoPic"
|
33 |
+
},
|
34 |
+
{
|
35 |
+
reg: "^#?系统测试$",
|
36 |
+
fnc: "SystemBench"
|
37 |
+
}
|
38 |
+
]
|
39 |
+
})
|
40 |
+
}
|
41 |
+
|
42 |
+
async execSync(cmd) {
|
43 |
+
return new Promise(resolve => {
|
44 |
+
exec(cmd, (error, stdout, stderr) => {
|
45 |
+
resolve({ error, stdout, stderr })
|
46 |
+
})
|
47 |
+
})
|
48 |
+
}
|
49 |
+
|
50 |
+
async SystemInfo(e) {
|
51 |
+
logger.mark(`[系统信息] 执行:${logger.blue(cmds)}`)
|
52 |
+
const ret = await this.execSync(cmds)
|
53 |
+
logger.mark(`[系统信息]\n${ret.stdout.trim()}\n${logger.red(ret.stderr.trim())}`)
|
54 |
+
|
55 |
+
if (ret.error) {
|
56 |
+
logger.error(`系统信息错误:${logger.red(ret.error)}`)
|
57 |
+
await this.reply(`系统信息错误:${ret.error}`, true)
|
58 |
+
await this.reply(errorTips)
|
59 |
+
}
|
60 |
+
|
61 |
+
await this.reply(ret.stdout.trim(), true)
|
62 |
+
}
|
63 |
+
|
64 |
+
async SystemInfoPic(e) {
|
65 |
+
logger.mark(`[系统信息] 执行:${logger.blue(cmd)}`)
|
66 |
+
const ret = await this.execSync(`${cmd}`)
|
67 |
+
logger.mark(`[系统信息]\n${ret.stdout.trim()}\n${logger.red(ret.stderr.trim())}`)
|
68 |
+
|
69 |
+
if (ret.error) {
|
70 |
+
logger.error(`系统信息错误:${logger.red(ret.error)}`)
|
71 |
+
await this.reply(`系统信息错误:${ret.error}`, true)
|
72 |
+
await this.reply(errorTips)
|
73 |
+
}
|
74 |
+
|
75 |
+
const Code = await ansi_up.ansi_to_html(ret.stdout.trim())
|
76 |
+
const img = await puppeteer.screenshot("Code", { tplFile, htmlDir, Code })
|
77 |
+
await this.reply(img, true)
|
78 |
+
}
|
79 |
+
|
80 |
+
async SystemBench(e) {
|
81 |
+
if (Running) {
|
82 |
+
await this.reply("正在测试,请稍等……", true)
|
83 |
+
return false
|
84 |
+
}
|
85 |
+
Running = true
|
86 |
+
await this.reply("开始测试,请稍等……", true)
|
87 |
+
|
88 |
+
logger.mark(`[系统测试] 执行:${logger.blue(benchcmd)}`)
|
89 |
+
const ret = await this.execSync(`${benchcmd}`)
|
90 |
+
logger.mark(`[系统测试]\n${ret.stdout.trim()}\n${logger.red(ret.stderr.trim())}`)
|
91 |
+
|
92 |
+
if (ret.error) {
|
93 |
+
logger.error(`系统测试错误:${logger.red(ret.error)}`)
|
94 |
+
await this.reply(`系统测试错误:${ret.error}`, true)
|
95 |
+
await this.reply(errorTips)
|
96 |
+
}
|
97 |
+
|
98 |
+
const Code = await ansi_up.ansi_to_html(ret.stdout.trim())
|
99 |
+
const img = await puppeteer.screenshot("Code", { tplFile, htmlDir, Code })
|
100 |
+
await this.reply(img, true)
|
101 |
+
Running = false
|
102 |
+
}
|
103 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Apps/Voice.js
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gsCfg from "../../genshin/model/gsCfg.js"
|
2 |
+
|
3 |
+
const GenshinVoicePath = `${process.cwd()}/plugins/TRSS-Plugin/GenshinVoice/`
|
4 |
+
const ChatWaifuPath = `${process.cwd()}/plugins/TRSS-Plugin/ChatWaifu/`
|
5 |
+
const errorTips = "请查看安装使用教程:\nhttps://Yunzai.TRSS.me\n并将报错通过联系方式反馈给开发者"
|
6 |
+
|
7 |
+
const AllAbbr = gsCfg.getAllAbbr()
|
8 |
+
const GenshinVoiceSpeakers = ["派蒙", "凯亚", "安柏", "丽莎", "琴", "香菱", "枫原万叶", "迪卢克", "温迪", "可莉", "早柚", "托马", "芭芭拉", "优菈", "云堇", "钟离", "魈", "凝光", "雷电将军", "北斗", "甘雨", "七七", "刻晴", "神里绫华", "戴因斯雷布", "雷泽", "神里绫人", "罗莎莉亚", "阿贝多", "八重神子", "宵宫", "荒泷一斗", "九条裟罗", "夜兰", "珊瑚宫心海", "五郎", "散兵", "女士", "达达利亚", "莫娜", "班尼特", "申鹤", "行秋", "烟绯", "久岐忍", "辛焱", "砂糖", "胡桃", "重云", "菲谢尔", "诺艾尔", "迪奥娜", "鹿野院平藏"]
|
9 |
+
const ChatWaifuSpeakers = ["綾地寧々", "在原七海", "小茸", "唐乐吟", "綾地寧々J", "因幡めぐるJ", "朝武芳乃J", "常陸茉子J", "ムラサメJ", "鞍馬小春J", "在原七海J", "綾地寧々H", "因幡めぐるH", "朝武芳乃H", "常陸茉子H", "ムラサメH", "鞍馬小春H", "在原七海H"]
|
10 |
+
|
11 |
+
let Running
|
12 |
+
|
13 |
+
export class Voice extends plugin {
|
14 |
+
constructor() {
|
15 |
+
super({
|
16 |
+
name: "语音合成",
|
17 |
+
dsc: "语音合成",
|
18 |
+
event: "message",
|
19 |
+
priority: 10,
|
20 |
+
rule: [
|
21 |
+
{
|
22 |
+
reg: ".+(转码)?说.+",
|
23 |
+
fnc: "Voice"
|
24 |
+
},
|
25 |
+
{
|
26 |
+
reg: "#?语音(合成)?(角色)?列表$",
|
27 |
+
fnc: "VoiceList"
|
28 |
+
}
|
29 |
+
]
|
30 |
+
})
|
31 |
+
}
|
32 |
+
|
33 |
+
async execSync(cmd) {
|
34 |
+
return new Promise(resolve => {
|
35 |
+
exec(cmd, (error, stdout, stderr) => {
|
36 |
+
resolve({ error, stdout, stderr })
|
37 |
+
})
|
38 |
+
})
|
39 |
+
}
|
40 |
+
|
41 |
+
async Voice() {
|
42 |
+
const msg = this.e.msg.split("说")
|
43 |
+
let speaker = msg.shift()
|
44 |
+
const text = msg.join("说").replace("'", "").trim()
|
45 |
+
|
46 |
+
let transcoding = false
|
47 |
+
if (speaker.match("转码")) {
|
48 |
+
speaker = speaker.replace("转码", "")
|
49 |
+
transcoding = true
|
50 |
+
}
|
51 |
+
|
52 |
+
let url
|
53 |
+
let path
|
54 |
+
let speakerid
|
55 |
+
if (ChatWaifuSpeakers.indexOf(speaker) != -1){
|
56 |
+
speakerid = ChatWaifuSpeakers.indexOf(speaker)
|
57 |
+
if (config.Voice.ChatWaifuApi) {
|
58 |
+
url = `${config.Voice.ChatWaifuApi}?user_id=${this.e.user_id}&bot_id=${this.e.self_id}&id=${speakerid}&text=${encodeURIComponent(text)}`
|
59 |
+
} else {
|
60 |
+
path = ChatWaifuPath
|
61 |
+
}
|
62 |
+
} else {
|
63 |
+
if (GenshinVoiceSpeakers.indexOf(speaker) == -1) {
|
64 |
+
for (const rolename of Object.values(AllAbbr)) {
|
65 |
+
if (rolename.includes(speaker)) {
|
66 |
+
speaker = rolename[0]
|
67 |
+
break
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
if (GenshinVoiceSpeakers.indexOf(speaker) == -1) {
|
72 |
+
logger.warn(`[语音合成] 不存在该角色:${logger.yellow(speaker)}`)
|
73 |
+
return false
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
speakerid = GenshinVoiceSpeakers.indexOf(speaker)
|
78 |
+
if (config.Voice.GenshinVoiceApi) {
|
79 |
+
url = `${config.Voice.GenshinVoiceApi}?user_id=${this.e.user_id}&bot_id=${this.e.self_id}&id=${speakerid}&text=${encodeURIComponent(text)}`
|
80 |
+
} else {
|
81 |
+
path = GenshinVoicePath
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
logger.mark(`[语音合成] ${logger.blue(`${speaker}(${speakerid})`)} 说 ${logger.cyan(text)}`)
|
86 |
+
|
87 |
+
if (Running) {
|
88 |
+
await this.reply("正在生成,请稍等……", true)
|
89 |
+
return false
|
90 |
+
}
|
91 |
+
Running = true
|
92 |
+
|
93 |
+
if (path) {
|
94 |
+
const cmd = `bash '${path}main.sh' output.wav ${speakerid} '${text}'`
|
95 |
+
|
96 |
+
logger.mark(`[语音合成] 执行:${logger.blue(cmd)}`)
|
97 |
+
const ret = await this.execSync(cmd)
|
98 |
+
logger.mark(`[语音合成]\n${ret.stdout.trim()}\n${logger.red(ret.stderr.trim())}`)
|
99 |
+
|
100 |
+
if (ret.error) {
|
101 |
+
logger.error(`语音合成错误:${logger.red(ret.error)}`)
|
102 |
+
await this.reply(`语音合成错误:${ret.error}`, true)
|
103 |
+
await this.reply(errorTips)
|
104 |
+
}
|
105 |
+
url = `file://${path}output.wav`
|
106 |
+
}
|
107 |
+
|
108 |
+
logger.mark(`[语音合成] 发送语音:${logger.blue(url)}`)
|
109 |
+
Running = false
|
110 |
+
await this.reply(await uploadRecord(url, 68714, transcoding))
|
111 |
+
}
|
112 |
+
|
113 |
+
async VoiceList() {
|
114 |
+
await this.reply(await common.makeForwardMsg(this.e, [
|
115 |
+
"https://Yunzai.TRSS.me",
|
116 |
+
GenshinVoiceSpeakers.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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import _ from "lodash"
|
2 |
+
import crypto from "crypto"
|
3 |
+
import fetch from "node-fetch"
|
4 |
+
|
5 |
+
const regex = "^#?(米哈?游社?登(录|陆|入)|登(录|陆|入)米哈?游社?)"
|
6 |
+
const publicKey = `-----BEGIN PUBLIC KEY-----
|
7 |
+
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDvekdPMHN3AYhm/vktJT+YJr7cI5DcsNKqdsx5DZX0gDuWFuIjzdwButrIYPNmRJ1G8ybDIF7oDW2eEpm5sMbL9zs
|
8 |
+
9ExXCdvqrn51qELbqj0XxtMTIpaCHFSI50PfPpTFV9Xt/hmyVwokoOXFlAEgCn+Q
|
9 |
+
CgGs52bFoYMtyi+xEQIDAQAB
|
10 |
+
-----END PUBLIC KEY-----`
|
11 |
+
const app_id = 8
|
12 |
+
|
13 |
+
function random_string(n) {
|
14 |
+
return _.sampleSize("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", n).join("")
|
15 |
+
}
|
16 |
+
|
17 |
+
function encrypt_data(data) {
|
18 |
+
return crypto.publicEncrypt({
|
19 |
+
key: publicKey,
|
20 |
+
padding: crypto.constants.RSA_PKCS1_PADDING
|
21 |
+
}, data).toString("base64")
|
22 |
+
}
|
23 |
+
|
24 |
+
function md5(data) {
|
25 |
+
return crypto.createHash("md5").update(data).digest("hex")
|
26 |
+
}
|
27 |
+
|
28 |
+
function ds(data) {
|
29 |
+
const t = Math.floor(Date.now()/1000)
|
30 |
+
const r = random_string(6)
|
31 |
+
const h = md5(`salt=JwYDpKvLj6MrMqqYU6jTKF17KNO2PXoS&t=${t}&r=${r}&b=${data}&q=`)
|
32 |
+
return `${t},${r},${h}`
|
33 |
+
}
|
34 |
+
|
35 |
+
function sleep(ms) {
|
36 |
+
return new Promise(resolve=>setTimeout(resolve, ms))
|
37 |
+
}
|
38 |
+
|
39 |
+
async function request(url, data, aigis) {
|
40 |
+
return await fetch(url, {
|
41 |
+
method: "post",
|
42 |
+
body: data,
|
43 |
+
headers: {
|
44 |
+
"x-rpc-app_version": "2.41.0",
|
45 |
+
"DS": ds(data),
|
46 |
+
"x-rpc-aigis": aigis,
|
47 |
+
"Content-Type": "application/json",
|
48 |
+
"Accept": "application/json",
|
49 |
+
"x-rpc-game_biz": "bbs_cn",
|
50 |
+
"x-rpc-sys_version": "12",
|
51 |
+
"x-rpc-device_id": random_string(16),
|
52 |
+
"x-rpc-device_fp": random_string(13),
|
53 |
+
"x-rpc-device_name": random_string(16),
|
54 |
+
"x-rpc-device_model": random_string(16),
|
55 |
+
"x-rpc-app_id": "bll8iq97cem8",
|
56 |
+
"x-rpc-client_type": "2",
|
57 |
+
"User-Agent": "okhttp/4.8.0"
|
58 |
+
}
|
59 |
+
})
|
60 |
+
}
|
61 |
+
|
62 |
+
const errorTips = "登录失败,请检查日志\nhttps://Yunzai.TRSS.me"
|
63 |
+
const accounts = {}
|
64 |
+
const Running = {}
|
65 |
+
|
66 |
+
export class miHoYoLogin extends plugin {
|
67 |
+
constructor() {
|
68 |
+
super({
|
69 |
+
name: "米哈游登录",
|
70 |
+
dsc: "米哈游登录",
|
71 |
+
event: "message",
|
72 |
+
priority: 10,
|
73 |
+
rule: [
|
74 |
+
{
|
75 |
+
reg: `${regex}$`,
|
76 |
+
fnc: "miHoYoLoginQRCode"
|
77 |
+
},
|
78 |
+
{
|
79 |
+
reg: `${regex}.+$`,
|
80 |
+
fnc: "miHoYoLoginDetect"
|
81 |
+
},
|
82 |
+
{
|
83 |
+
reg: "^#?(体力|(c|C)(oo)?k(ie)?|(s|S)(to)?k(en)?)(帮助|教程)$",
|
84 |
+
fnc: "miHoYoLoginHelp"
|
85 |
+
}
|
86 |
+
]
|
87 |
+
})
|
88 |
+
}
|
89 |
+
|
90 |
+
miHoYoLoginDetect() {
|
91 |
+
accounts[this.e.user_id] = this.e
|
92 |
+
this.setContext("miHoYoLogin")
|
93 |
+
this.reply("请发送密码", true, { recallMsg: 60 })
|
94 |
+
}
|
95 |
+
|
96 |
+
async crack_geetest(gt, challenge) {
|
97 |
+
let res
|
98 |
+
this.reply(`请完成验证:https://challenge.minigg.cn/manual/index.html?gt=${gt}&challenge=${challenge}`, true, { recallMsg: 60 })
|
99 |
+
for (let n=1;n<60;n++) {
|
100 |
+
await sleep(5000)
|
101 |
+
try {
|
102 |
+
res = await fetch(`https://challenge.minigg.cn/manual/?callback=${challenge}`)
|
103 |
+
res = await res.json()
|
104 |
+
if (res.retcode == 200)
|
105 |
+
return res.data
|
106 |
+
} catch (err) {
|
107 |
+
logger.error(`[米哈游登录] 错误:${logger.red(err)}`)
|
108 |
+
}
|
109 |
+
}
|
110 |
+
this.reply("验证超时", true)
|
111 |
+
return false
|
112 |
+
}
|
113 |
+
|
114 |
+
async miHoYoLogin() {
|
115 |
+
if(!this.e.msg)return false
|
116 |
+
this.finish("miHoYoLogin")
|
117 |
+
if (Running[this.e.user_id]) {
|
118 |
+
this.reply("有正在进行的登录操作,请完成后再试……", true, { recallMsg: 60 })
|
119 |
+
return false
|
120 |
+
}
|
121 |
+
Running[this.e.user_id] = true
|
122 |
+
|
123 |
+
const password = this.e.msg.trim()
|
124 |
+
this.e = accounts[this.e.user_id]
|
125 |
+
const account = this.e.msg.replace(new RegExp(regex), "").trim()
|
126 |
+
|
127 |
+
const data = JSON.stringify({
|
128 |
+
account: encrypt_data(account),
|
129 |
+
password: encrypt_data(password)
|
130 |
+
})
|
131 |
+
|
132 |
+
const url = "https://passport-api.mihoyo.com/account/ma-cn-passport/app/loginByPassword"
|
133 |
+
let res = await request(url, data, "")
|
134 |
+
const aigis_data = JSON.parse(res.headers.get("x-rpc-aigis"))
|
135 |
+
res = await res.json()
|
136 |
+
logger.mark(`[米哈游登录] ${logger.blue(JSON.stringify(res))}`)
|
137 |
+
|
138 |
+
if (res.retcode == -3101) {
|
139 |
+
logger.mark("[米哈游登录] 正在验证")
|
140 |
+
const aigis_captcha_data = JSON.parse(aigis_data.data)
|
141 |
+
const challenge = aigis_captcha_data.challenge
|
142 |
+
const validate = await this.crack_geetest(aigis_captcha_data.gt, challenge)
|
143 |
+
if (validate.geetest_validate) {
|
144 |
+
logger.mark("[米哈游登录] 验证成功")
|
145 |
+
} else {
|
146 |
+
logger.error("[米哈游登录] 验证失败")
|
147 |
+
Running[this.e.user_id] = false
|
148 |
+
return false
|
149 |
+
}
|
150 |
+
|
151 |
+
const aigis = aigis_data.session_id + ";" + Buffer.from(JSON.stringify({
|
152 |
+
geetest_challenge: challenge,
|
153 |
+
geetest_seccode: validate.geetest_validate + "|jordan",
|
154 |
+
geetest_validate: validate.geetest_validate
|
155 |
+
})).toString("base64")
|
156 |
+
|
157 |
+
res = await request(url, data, aigis)
|
158 |
+
res = await res.json()
|
159 |
+
logger.mark(`[米哈游登录] ${logger.blue(JSON.stringify(res))}`)
|
160 |
+
}
|
161 |
+
|
162 |
+
if (res.retcode != 0) {
|
163 |
+
this.reply(`错误:${JSON.stringify(res)}`, true)
|
164 |
+
Running[this.e.user_id] = false
|
165 |
+
return false
|
166 |
+
}
|
167 |
+
|
168 |
+
let cookie = await fetch(`https://api-takumi.mihoyo.com/auth/api/getCookieAccountInfoBySToken?stoken=${res.data.token.token}&mid=${res.data.user_info.mid}`)
|
169 |
+
cookie = await cookie.json()
|
170 |
+
logger.mark(`[米哈游登录] ${logger.blue(JSON.stringify(cookie))}`)
|
171 |
+
cookie = [
|
172 |
+
`ltoken=${res.data.token.token};ltuid=${res.data.user_info.aid};cookie_token=${cookie.data.cookie_token};login_ticket=${res.data.login_ticket}`,
|
173 |
+
`stoken=${res.data.token.token};stuid=${res.data.user_info.aid};mid=${res.data.user_info.mid}`,
|
174 |
+
]
|
175 |
+
for (const i of cookie) this.makeMessage(i)
|
176 |
+
if (this.e.isPrivate)
|
177 |
+
this.reply(await common.makeForwardMsg(this.e, cookie, "登录完成,以下分别是 Cookie 和 Stoken,将会自动绑定"))
|
178 |
+
|
179 |
+
Running[this.e.user_id] = false
|
180 |
+
}
|
181 |
+
|
182 |
+
async miHoYoLoginQRCode() {
|
183 |
+
if (Running[this.e.user_id]) {
|
184 |
+
this.reply("有正在进行的登录操作,请完成后再试……", true, { recallMsg: 60 })
|
185 |
+
return false
|
186 |
+
}
|
187 |
+
Running[this.e.user_id] = true
|
188 |
+
|
189 |
+
const device = random_string(64)
|
190 |
+
let res = await fetch("https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/fetch", {
|
191 |
+
method: "post",
|
192 |
+
body: JSON.stringify({ app_id, device })
|
193 |
+
})
|
194 |
+
res = await res.json()
|
195 |
+
logger.mark(`[米哈游登录] ${logger.blue(JSON.stringify(res))}`)
|
196 |
+
|
197 |
+
const url = res.data.url
|
198 |
+
const ticket = url.split("ticket=")[1]
|
199 |
+
const img = (await QR.toDataURL(url)).replace("data:image/png;base64,", "base64://")
|
200 |
+
this.reply(["请使用米游社扫码登录", segment.image(img)], true, { recallMsg: 60 })
|
201 |
+
|
202 |
+
let data
|
203 |
+
let Scanned
|
204 |
+
for (let n=1;n<60;n++) {
|
205 |
+
await sleep(5000)
|
206 |
+
try {
|
207 |
+
res = await fetch("https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/query", {
|
208 |
+
method: "post",
|
209 |
+
body: JSON.stringify({ app_id, device, ticket })
|
210 |
+
})
|
211 |
+
res = await res.json()
|
212 |
+
|
213 |
+
if (res.retcode != 0) {
|
214 |
+
this.reply("二维码已过期,请重新登录", true, { recallMsg: 60 })
|
215 |
+
Running[this.e.user_id] = false
|
216 |
+
return false
|
217 |
+
}
|
218 |
+
|
219 |
+
if (res.data.stat == "Scanned" && !Scanned) {
|
220 |
+
logger.mark(`[米哈游登录] ${logger.blue(JSON.stringify(res))}`)
|
221 |
+
Scanned = true
|
222 |
+
this.reply("二维码已扫描,请确认登录", true, { recallMsg: 60 })
|
223 |
+
}
|
224 |
+
|
225 |
+
if (res.data.stat == "Confirmed") {
|
226 |
+
logger.mark(`[米哈游登录] ${logger.blue(JSON.stringify(res))}`)
|
227 |
+
data = JSON.parse(res.data.payload.raw)
|
228 |
+
break
|
229 |
+
}
|
230 |
+
} catch (err) {
|
231 |
+
logger.error(`[米哈游登录] 错误:${logger.red(err)}`)
|
232 |
+
}
|
233 |
+
}
|
234 |
+
|
235 |
+
if (!(data.uid&&data.token)) {
|
236 |
+
this.reply(errorTips, true)
|
237 |
+
Running[this.e.user_id] = false
|
238 |
+
return false
|
239 |
+
}
|
240 |
+
|
241 |
+
res = await request(
|
242 |
+
"https://passport-api.mihoyo.com/account/ma-cn-session/app/getTokenByGameToken",
|
243 |
+
JSON.stringify({ account_id: parseInt(data.uid), game_token: data.token }),
|
244 |
+
""
|
245 |
+
)
|
246 |
+
res = await res.json()
|
247 |
+
logger.mark(`[米哈游登录] ${logger.blue(JSON.stringify(res))}`)
|
248 |
+
|
249 |
+
let cookie = await fetch(`https://api-takumi.mihoyo.com/auth/api/getCookieAccountInfoByGameToken?account_id=${data.uid}&game_token=${data.token}`)
|
250 |
+
cookie = await cookie.json()
|
251 |
+
logger.mark(`[米哈游登录] ${logger.blue(JSON.stringify(cookie))}`)
|
252 |
+
|
253 |
+
cookie = [
|
254 |
+
`ltoken=${res.data.token.token};ltuid=${res.data.user_info.aid};cookie_token=${cookie.data.cookie_token}`,
|
255 |
+
`stoken=${res.data.token.token};stuid=${res.data.user_info.aid};mid=${res.data.user_info.mid}`,
|
256 |
+
]
|
257 |
+
for (const i of cookie) this.makeMessage(i)
|
258 |
+
if (this.e.isPrivate)
|
259 |
+
this.reply(await common.makeForwardMsg(this.e, cookie, "登录完成,以下分别是 Cookie 和 Stoken,将会自动绑定"))
|
260 |
+
|
261 |
+
Running[this.e.user_id] = false
|
262 |
+
}
|
263 |
+
|
264 |
+
makeMessage(msg) {
|
265 |
+
Bot.emit("message", {
|
266 |
+
...this.e,
|
267 |
+
isGroup: undefined,
|
268 |
+
msg: undefined,
|
269 |
+
original_msg: undefined,
|
270 |
+
message_type: "private",
|
271 |
+
message: [{ type: "text", text: msg }],
|
272 |
+
raw_message: msg,
|
273 |
+
})
|
274 |
+
}
|
275 |
+
|
276 |
+
miHoYoLoginHelp() {
|
277 |
+
if (!config.miHoYoLogin.help) return false
|
278 |
+
this.reply("二维码登录:发送【米哈游登录】\n账号密码登录:发送【米哈游登录 账号】", true)
|
279 |
+
}
|
280 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Model/config.js
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import fs from "fs"
|
2 |
+
import YAML from "yaml"
|
3 |
+
import _ from "lodash"
|
4 |
+
|
5 |
+
const configFile = "config/TRSS.yaml"
|
6 |
+
const configFileOld = "plugins/TRSS-Plugin/config.yaml"
|
7 |
+
if (fs.existsSync(configFileOld))
|
8 |
+
fs.renameSync(configFileOld, configFile)
|
9 |
+
|
10 |
+
const config = {
|
11 |
+
tips: "",
|
12 |
+
|
13 |
+
Voice: {
|
14 |
+
GenshinVoiceApi: "",
|
15 |
+
ChatWaifuApi: ""
|
16 |
+
},
|
17 |
+
|
18 |
+
RealESRGAN: {
|
19 |
+
api: "",
|
20 |
+
format: "jpg"
|
21 |
+
},
|
22 |
+
|
23 |
+
RemBG: {
|
24 |
+
api: ""
|
25 |
+
},
|
26 |
+
|
27 |
+
miHoYoLogin: {
|
28 |
+
help: true
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
let configData
|
33 |
+
|
34 |
+
if (fs.existsSync(configFile))
|
35 |
+
try {
|
36 |
+
configData = YAML.parse(fs.readFileSync(configFile, "utf-8"))
|
37 |
+
_.merge(config, configData)
|
38 |
+
} catch (err) {
|
39 |
+
logger.error(`配置文件 读取失败:${logger.red(err)}`)
|
40 |
+
}
|
41 |
+
|
42 |
+
config.tips = [
|
43 |
+
"欢迎使用 TRSS Yunzai Plugin ! 作者:时雨🌌星空",
|
44 |
+
"按 Ctrl+Q Y 保存退出",
|
45 |
+
"参考:https://Yunzai.TRSS.me"
|
46 |
+
]
|
47 |
+
|
48 |
+
if (YAML.stringify(config) != YAML.stringify(configData))
|
49 |
+
fs.writeFileSync(configFile, YAML.stringify(config), "utf-8")
|
50 |
+
|
51 |
+
export default config
|
Yunzai/plugins/TRSS-Plugin/Model/uploadRecord.js
ADDED
@@ -0,0 +1,427 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { core } from "oicq"
|
2 |
+
import common from "oicq"
|
3 |
+
import Contactable from "oicq"
|
4 |
+
import querystring from "querystring"
|
5 |
+
import fetch from "node-fetch"
|
6 |
+
import fs from "fs"
|
7 |
+
import path from "path"
|
8 |
+
import os from "os"
|
9 |
+
import util from "util"
|
10 |
+
import stream from "stream"
|
11 |
+
import crypto from "crypto"
|
12 |
+
import child_process from "child_process"
|
13 |
+
var errors = {};
|
14 |
+
|
15 |
+
|
16 |
+
async function uploadRecord(record_url, seconds = 0,transcoding = true) {
|
17 |
+
const result = await getPttBuffer(record_url, Bot.config.ffmpeg_path, transcoding);
|
18 |
+
if(!result.buffer){
|
19 |
+
return false;
|
20 |
+
}
|
21 |
+
let buf = result.buffer;
|
22 |
+
if(seconds == 0 && result.time) seconds = result.time.seconds;
|
23 |
+
const hash = (0, md5)(buf);
|
24 |
+
const codec = String(buf.slice(0, 7)).includes("SILK") ? (transcoding ? 1 : 0) : 0;
|
25 |
+
const body = core.pb.encode({
|
26 |
+
1: 3,
|
27 |
+
2: 3,
|
28 |
+
5: {
|
29 |
+
1: Contactable.target,
|
30 |
+
2: Bot.uin,
|
31 |
+
3: 0,
|
32 |
+
4: hash,
|
33 |
+
5: buf.length,
|
34 |
+
6: hash,
|
35 |
+
7: 5,
|
36 |
+
8: 9,
|
37 |
+
9: 4,
|
38 |
+
11: 0,
|
39 |
+
10: Bot.apk.version,
|
40 |
+
12: 1,
|
41 |
+
13: 1,
|
42 |
+
14: codec,
|
43 |
+
15: 1,
|
44 |
+
},
|
45 |
+
});
|
46 |
+
const payload = await Bot.sendUni("PttStore.GroupPttUp", body);
|
47 |
+
const rsp = core.pb.decode(payload)[5];
|
48 |
+
rsp[2] && (0, errors.drop)(rsp[2], rsp[3]);
|
49 |
+
const ip = rsp[5]?.[0] || rsp[5], port = rsp[6]?.[0] || rsp[6];
|
50 |
+
const ukey = rsp[7].toHex(), filekey = rsp[11].toHex();
|
51 |
+
const params = {
|
52 |
+
ver: 4679,
|
53 |
+
ukey, filekey,
|
54 |
+
filesize: buf.length,
|
55 |
+
bmd5: hash.toString("hex"),
|
56 |
+
mType: "pttDu",
|
57 |
+
voice_encodec: codec
|
58 |
+
};
|
59 |
+
const url = `http://${(0, int32ip2str)(ip)}:${port}/?` + querystring.stringify(params);
|
60 |
+
const headers = {
|
61 |
+
"User-Agent": `QQ/${Bot.apk.version} CFNetwork/1126`,
|
62 |
+
"Net-Type": "Wifi"
|
63 |
+
};
|
64 |
+
await fetch(url,{
|
65 |
+
method: 'POST',//post请求
|
66 |
+
headers: headers,
|
67 |
+
body: buf
|
68 |
+
});
|
69 |
+
//await axios.post(url, buf, { headers });
|
70 |
+
|
71 |
+
const fid = rsp[11].toBuffer();
|
72 |
+
const b = core.pb.encode({
|
73 |
+
1: 4,
|
74 |
+
2: Bot.uin,
|
75 |
+
3: fid,
|
76 |
+
4: hash,
|
77 |
+
5: hash.toString("hex") + ".amr",
|
78 |
+
6: seconds,
|
79 |
+
11: 1,
|
80 |
+
18: fid,
|
81 |
+
19: seconds,
|
82 |
+
30: Buffer.from([8, 0, 40, 0, 56, 0]),
|
83 |
+
});
|
84 |
+
return {
|
85 |
+
type: "record", file: "protobuf://" + Buffer.from(b).toString("base64")
|
86 |
+
};
|
87 |
+
}
|
88 |
+
|
89 |
+
export default uploadRecord
|
90 |
+
|
91 |
+
async function getPttBuffer(file, ffmpeg = "ffmpeg", transcoding = true) {
|
92 |
+
let buffer;
|
93 |
+
let time;
|
94 |
+
if (file instanceof Buffer || file.startsWith("base64://")) {
|
95 |
+
// Buffer或base64
|
96 |
+
const buf = file instanceof Buffer ? file : Buffer.from(file.slice(9), "base64");
|
97 |
+
const head = buf.slice(0, 7).toString();
|
98 |
+
if (head.includes("SILK") || head.includes("AMR") || !transcoding) {
|
99 |
+
const tmpfile = path.join(TMP_DIR, (0, uuid)());
|
100 |
+
await fs.promises.writeFile(tmpfile, buf);
|
101 |
+
let result = await getAudioTime(tmpfile,ffmpeg);
|
102 |
+
if(result.code == 1) time = result.data;
|
103 |
+
fs.unlink(tmpfile,NOOP);
|
104 |
+
buffer = buf;
|
105 |
+
}else {
|
106 |
+
const tmpfile = path.join(TMP_DIR, (0, uuid)());
|
107 |
+
let result = await getAudioTime(tmpfile,ffmpeg);
|
108 |
+
if(result.code == 1) time = result.data;
|
109 |
+
await fs.promises.writeFile(tmpfile, buf);
|
110 |
+
buffer = await audioTrans(tmpfile, ffmpeg);
|
111 |
+
}
|
112 |
+
}
|
113 |
+
else if (file.startsWith("http://") || file.startsWith("https://")) {
|
114 |
+
// 网络文件
|
115 |
+
//const readable = (await axios.get(file, { responseType: "stream" })).data;
|
116 |
+
try{
|
117 |
+
const headers = {
|
118 |
+
"User-Agent": `Dalvik/2.1.0 (Linux; U; Android 12; MI 9 Build/SKQ1.211230.001)`,
|
119 |
+
};
|
120 |
+
let response = await fetch(file,{
|
121 |
+
method: 'GET',//post请求
|
122 |
+
headers: headers
|
123 |
+
});
|
124 |
+
const buf = Buffer.from(await response.arrayBuffer());
|
125 |
+
const tmpfile = path.join(TMP_DIR, (0, uuid)());
|
126 |
+
await fs.promises.writeFile(tmpfile, buf);
|
127 |
+
//await (0, pipeline)(readable.pipe(new DownloadTransform), fs.createWriteStream(tmpfile));
|
128 |
+
const head = await read7Bytes(tmpfile);
|
129 |
+
let result = await getAudioTime(tmpfile,ffmpeg);
|
130 |
+
if(result.code == 1) time = result.data;
|
131 |
+
if (head.includes("SILK") || head.includes("AMR") || !transcoding) {
|
132 |
+
//const buf = await fs.promises.readFile(tmpfile);
|
133 |
+
fs.unlink(tmpfile,NOOP);
|
134 |
+
buffer = buf;
|
135 |
+
} else {
|
136 |
+
buffer = await audioTrans(tmpfile, ffmpeg);
|
137 |
+
}
|
138 |
+
}catch(err){}
|
139 |
+
}
|
140 |
+
else {
|
141 |
+
// 本地文件
|
142 |
+
file = String(file).replace(/^file:\/{2}/, "");
|
143 |
+
IS_WIN && file.startsWith("/") && (file = file.slice(1));
|
144 |
+
const head = await read7Bytes(file);
|
145 |
+
let result = await getAudioTime(file,ffmpeg);
|
146 |
+
if(result.code == 1) time = result.data;
|
147 |
+
if (head.includes("SILK") || head.includes("AMR") || !transcoding) {
|
148 |
+
buffer = await fs.promises.readFile(file);
|
149 |
+
} else {
|
150 |
+
buffer = await audioTrans(file, ffmpeg);
|
151 |
+
}
|
152 |
+
}
|
153 |
+
return {buffer: buffer, time: time}
|
154 |
+
}
|
155 |
+
|
156 |
+
async function getAudioTime(file, ffmpeg = "ffmpeg") {
|
157 |
+
return new Promise((resolve, reject) => {
|
158 |
+
(0, child_process.exec)(`${ffmpeg} -i "${file}"`, async (error, stdout, stderr) => {
|
159 |
+
try {
|
160 |
+
let time = stderr.split('Duration:')[1]?.split(',')[0].trim();
|
161 |
+
let arr = time?.split(':');
|
162 |
+
arr.reverse();
|
163 |
+
let n = 1;
|
164 |
+
let s = 0;
|
165 |
+
for(let val of arr){
|
166 |
+
if(parseInt(val) > 0) s += parseInt(val) * n;
|
167 |
+
n *= 60;
|
168 |
+
}
|
169 |
+
resolve({code: 1,data: {
|
170 |
+
time: time,
|
171 |
+
seconds: s,
|
172 |
+
exec_text: stderr
|
173 |
+
}});
|
174 |
+
}
|
175 |
+
catch {
|
176 |
+
resolve({code: -1});
|
177 |
+
}
|
178 |
+
});
|
179 |
+
});
|
180 |
+
}
|
181 |
+
|
182 |
+
async function audioTrans(file, ffmpeg = "ffmpeg") {
|
183 |
+
return new Promise((resolve, reject) => {
|
184 |
+
const tmpfile = path.join(TMP_DIR, (0, uuid)());
|
185 |
+
(0, child_process.exec)(`${ffmpeg} -y -i "${file}" -ac 1 -ar 8000 -f amr "${tmpfile}"`, async (error, stdout, stderr) => {
|
186 |
+
try {
|
187 |
+
const amr = await fs.promises.readFile(tmpfile);
|
188 |
+
resolve(amr);
|
189 |
+
}
|
190 |
+
catch {
|
191 |
+
reject(new core.ApiRejection(errors.ErrorCode.FFmpegPttTransError, "音频转码到amr失败,请确认你的ffmpeg可以处理此转换"));
|
192 |
+
}
|
193 |
+
finally {
|
194 |
+
fs.unlink(tmpfile, NOOP);
|
195 |
+
}
|
196 |
+
});
|
197 |
+
});
|
198 |
+
}
|
199 |
+
|
200 |
+
async function read7Bytes(file) {
|
201 |
+
const fd = await fs.promises.open(file, "r");
|
202 |
+
const buf = (await fd.read(Buffer.alloc(7), 0, 7, 0)).buffer;
|
203 |
+
fd.close();
|
204 |
+
return buf;
|
205 |
+
}
|
206 |
+
|
207 |
+
function uuid() {
|
208 |
+
let hex = crypto.randomBytes(16).toString("hex");
|
209 |
+
return hex.substr(0, 8) + "-" + hex.substr(8, 4) + "-" + hex.substr(12, 4) + "-" + hex.substr(16, 4) + "-" + hex.substr(20);
|
210 |
+
}
|
211 |
+
|
212 |
+
/** 计算流的md5 */
|
213 |
+
function md5Stream(readable) {
|
214 |
+
return new Promise((resolve, reject) => {
|
215 |
+
readable.on("error", reject);
|
216 |
+
readable.pipe(crypto.createHash("md5")
|
217 |
+
.on("error", reject)
|
218 |
+
.on("data", resolve));
|
219 |
+
});
|
220 |
+
}
|
221 |
+
|
222 |
+
/** 计算文件的md5和sha */
|
223 |
+
function fileHash(filepath) {
|
224 |
+
const readable = fs.createReadStream(filepath);
|
225 |
+
const sha = new Promise((resolve, reject) => {
|
226 |
+
readable.on("error", reject);
|
227 |
+
readable.pipe(crypto.createHash("sha1")
|
228 |
+
.on("error", reject)
|
229 |
+
.on("data", resolve));
|
230 |
+
});
|
231 |
+
return Promise.all([md5Stream(readable), sha]);
|
232 |
+
}
|
233 |
+
|
234 |
+
/** 群号转uin */
|
235 |
+
function code2uin(code) {
|
236 |
+
let left = Math.floor(code / 1000000);
|
237 |
+
if (left >= 0 && left <= 10)
|
238 |
+
left += 202;
|
239 |
+
else if (left >= 11 && left <= 19)
|
240 |
+
left += 469;
|
241 |
+
else if (left >= 20 && left <= 66)
|
242 |
+
left += 2080;
|
243 |
+
else if (left >= 67 && left <= 156)
|
244 |
+
left += 1943;
|
245 |
+
else if (left >= 157 && left <= 209)
|
246 |
+
left += 1990;
|
247 |
+
else if (left >= 210 && left <= 309)
|
248 |
+
left += 3890;
|
249 |
+
else if (left >= 310 && left <= 335)
|
250 |
+
left += 3490;
|
251 |
+
else if (left >= 336 && left <= 386)
|
252 |
+
left += 2265;
|
253 |
+
else if (left >= 387 && left <= 499)
|
254 |
+
left += 3490;
|
255 |
+
return left * 1000000 + code % 1000000;
|
256 |
+
}
|
257 |
+
|
258 |
+
/** uin转群号 */
|
259 |
+
function uin2code(uin) {
|
260 |
+
let left = Math.floor(uin / 1000000);
|
261 |
+
if (left >= 202 && left <= 212)
|
262 |
+
left -= 202;
|
263 |
+
else if (left >= 480 && left <= 488)
|
264 |
+
left -= 469;
|
265 |
+
else if (left >= 2100 && left <= 2146)
|
266 |
+
left -= 2080;
|
267 |
+
else if (left >= 2010 && left <= 2099)
|
268 |
+
left -= 1943;
|
269 |
+
else if (left >= 2147 && left <= 2199)
|
270 |
+
left -= 1990;
|
271 |
+
else if (left >= 2600 && left <= 2651)
|
272 |
+
left -= 2265;
|
273 |
+
else if (left >= 3800 && left <= 3989)
|
274 |
+
left -= 3490;
|
275 |
+
else if (left >= 4100 && left <= 4199)
|
276 |
+
left -= 3890;
|
277 |
+
return left * 1000000 + uin % 1000000;
|
278 |
+
}
|
279 |
+
|
280 |
+
function int32ip2str(ip) {
|
281 |
+
if (typeof ip === "string")
|
282 |
+
return ip;
|
283 |
+
ip = ip & 0xffffffff;
|
284 |
+
return [
|
285 |
+
ip & 0xff,
|
286 |
+
(ip & 0xff00) >> 8,
|
287 |
+
(ip & 0xff0000) >> 16,
|
288 |
+
(ip & 0xff000000) >> 24 & 0xff,
|
289 |
+
].join(".");
|
290 |
+
}
|
291 |
+
|
292 |
+
/** 解析彩色群名片 */
|
293 |
+
function parseFunString(buf) {
|
294 |
+
if (buf[0] === 0xA) {
|
295 |
+
let res = "";
|
296 |
+
try {
|
297 |
+
let arr = core.pb.decode(buf)[1];
|
298 |
+
if (!Array.isArray(arr))
|
299 |
+
arr = [arr];
|
300 |
+
for (let v of arr) {
|
301 |
+
if (v[2])
|
302 |
+
res += String(v[2]);
|
303 |
+
}
|
304 |
+
}
|
305 |
+
catch { }
|
306 |
+
return res;
|
307 |
+
}
|
308 |
+
else {
|
309 |
+
return String(buf);
|
310 |
+
}
|
311 |
+
}
|
312 |
+
|
313 |
+
/** xml转义 */
|
314 |
+
function escapeXml(str) {
|
315 |
+
return str.replace(/[&"><]/g, function (s) {
|
316 |
+
if (s === "&")
|
317 |
+
return "&";
|
318 |
+
if (s === "<")
|
319 |
+
return "<";
|
320 |
+
if (s === ">")
|
321 |
+
return ">";
|
322 |
+
if (s === "\"")
|
323 |
+
return """;
|
324 |
+
return "";
|
325 |
+
});
|
326 |
+
}
|
327 |
+
|
328 |
+
/** 用于下载限量 */
|
329 |
+
class DownloadTransform extends stream.Transform {
|
330 |
+
constructor() {
|
331 |
+
super(...arguments);
|
332 |
+
this._size = 0;
|
333 |
+
}
|
334 |
+
_transform(data, encoding, callback) {
|
335 |
+
this._size += data.length;
|
336 |
+
let error = null;
|
337 |
+
if (this._size <= MAX_UPLOAD_SIZE)
|
338 |
+
this.push(data);
|
339 |
+
else
|
340 |
+
error = new Error("downloading over 30MB is refused");
|
341 |
+
callback(error);
|
342 |
+
}
|
343 |
+
}
|
344 |
+
const IS_WIN = os.platform() === "win32";
|
345 |
+
/** 系统临时目录,用于临时存放下载的图片等内容 */
|
346 |
+
const TMP_DIR = os.tmpdir();
|
347 |
+
/** 最大上传和下载大小,以图片上传限制为准:30MB */
|
348 |
+
const MAX_UPLOAD_SIZE = 31457280;
|
349 |
+
|
350 |
+
/** no operation */
|
351 |
+
const NOOP = () => { };
|
352 |
+
|
353 |
+
/** promisified pipeline */
|
354 |
+
const pipeline = (0, util.promisify)(stream.pipeline);
|
355 |
+
/** md5 hash */
|
356 |
+
const md5 = (data) => (0, crypto.createHash)("md5").update(data).digest();
|
357 |
+
|
358 |
+
|
359 |
+
errors.LoginErrorCode = errors.drop = errors.ErrorCode = void 0;
|
360 |
+
var ErrorCode;
|
361 |
+
(function (ErrorCode) {
|
362 |
+
/** 客户端离线 */
|
363 |
+
ErrorCode[ErrorCode["ClientNotOnline"] = -1] = "ClientNotOnline";
|
364 |
+
/** 发包超时未收到服务器回应 */
|
365 |
+
ErrorCode[ErrorCode["PacketTimeout"] = -2] = "PacketTimeout";
|
366 |
+
/** 用户不存在 */
|
367 |
+
ErrorCode[ErrorCode["UserNotExists"] = -10] = "UserNotExists";
|
368 |
+
/** 群不存在(未加入) */
|
369 |
+
ErrorCode[ErrorCode["GroupNotJoined"] = -20] = "GroupNotJoined";
|
370 |
+
/** 群员不存在 */
|
371 |
+
ErrorCode[ErrorCode["MemberNotExists"] = -30] = "MemberNotExists";
|
372 |
+
/** 发消息时传入的参数不正确 */
|
373 |
+
ErrorCode[ErrorCode["MessageBuilderError"] = -60] = "MessageBuilderError";
|
374 |
+
/** 群消息被风控发送失败 */
|
375 |
+
ErrorCode[ErrorCode["RiskMessageError"] = -70] = "RiskMessageError";
|
376 |
+
/** 群消息有敏感词发送失败 */
|
377 |
+
ErrorCode[ErrorCode["SensitiveWordsError"] = -80] = "SensitiveWordsError";
|
378 |
+
/** 上传图片/文件/视频等数据超时 */
|
379 |
+
ErrorCode[ErrorCode["HighwayTimeout"] = -110] = "HighwayTimeout";
|
380 |
+
/** 上传图片/文件/视频等数据遇到网络错误 */
|
381 |
+
ErrorCode[ErrorCode["HighwayNetworkError"] = -120] = "HighwayNetworkError";
|
382 |
+
/** 没有上传通道 */
|
383 |
+
ErrorCode[ErrorCode["NoUploadChannel"] = -130] = "NoUploadChannel";
|
384 |
+
/** 不支持的file类型(没有流) */
|
385 |
+
ErrorCode[ErrorCode["HighwayFileTypeError"] = -140] = "HighwayFileTypeError";
|
386 |
+
/** 文件安全校验未通过不存在 */
|
387 |
+
ErrorCode[ErrorCode["UnsafeFile"] = -150] = "UnsafeFile";
|
388 |
+
/** 离线(私聊)文件不存在 */
|
389 |
+
ErrorCode[ErrorCode["OfflineFileNotExists"] = -160] = "OfflineFileNotExists";
|
390 |
+
/** 群文件不存在(无法转发) */
|
391 |
+
ErrorCode[ErrorCode["GroupFileNotExists"] = -170] = "GroupFileNotExists";
|
392 |
+
/** 获取视频中的图片失败 */
|
393 |
+
ErrorCode[ErrorCode["FFmpegVideoThumbError"] = -210] = "FFmpegVideoThumbError";
|
394 |
+
/** 音频转换失败 */
|
395 |
+
ErrorCode[ErrorCode["FFmpegPttTransError"] = -220] = "FFmpegPttTransError";
|
396 |
+
})(ErrorCode = errors.ErrorCode || (errors.ErrorCode = {}));
|
397 |
+
const ErrorMessage = {
|
398 |
+
[ErrorCode.UserNotExists]: "查无此人",
|
399 |
+
[ErrorCode.GroupNotJoined]: "未加入的群",
|
400 |
+
[ErrorCode.MemberNotExists]: "幽灵群员",
|
401 |
+
[ErrorCode.RiskMessageError]: "群消息发送失败,可能被风控",
|
402 |
+
[ErrorCode.SensitiveWordsError]: "群消息发送失败,请检查消息内容",
|
403 |
+
10: "消息过长",
|
404 |
+
34: "消息过长",
|
405 |
+
120: "在该群被禁言",
|
406 |
+
121: "AT全体剩余次数不足"
|
407 |
+
};
|
408 |
+
function drop(code, message) {
|
409 |
+
if (!message || !message.length)
|
410 |
+
message = ErrorMessage[code];
|
411 |
+
throw new core.ApiRejection(code, message);
|
412 |
+
}
|
413 |
+
errors.drop = drop;
|
414 |
+
/** 登录时可能出现的错误,不在列的都属于未知错误,暂时无法解决 */
|
415 |
+
var LoginErrorCode;
|
416 |
+
(function (LoginErrorCode) {
|
417 |
+
/** 密码错误 */
|
418 |
+
LoginErrorCode[LoginErrorCode["WrongPassword"] = 1] = "WrongPassword";
|
419 |
+
/** 账号被冻结 */
|
420 |
+
LoginErrorCode[LoginErrorCode["AccountFrozen"] = 40] = "AccountFrozen";
|
421 |
+
/** 发短信太频繁 */
|
422 |
+
LoginErrorCode[LoginErrorCode["TooManySms"] = 162] = "TooManySms";
|
423 |
+
/** 短信验证码错误 */
|
424 |
+
LoginErrorCode[LoginErrorCode["WrongSmsCode"] = 163] = "WrongSmsCode";
|
425 |
+
/** 滑块ticket错误 */
|
426 |
+
LoginErrorCode[LoginErrorCode["WrongTicket"] = 237] = "WrongTicket";
|
427 |
+
})(LoginErrorCode = errors.LoginErrorCode || (errors.LoginErrorCode = {}));
|
Yunzai/plugins/TRSS-Plugin/Picture/Microsoft_C++_/347/224/237/346/210/220/345/267/245/345/205/267.png
ADDED
![]() |
Yunzai/plugins/TRSS-Plugin/Picture/苏半夏.png
ADDED
![]() |
Git LFS Details
|
Yunzai/plugins/TRSS-Plugin/Picture/苏半夏D.png
ADDED
![]() |
Git LFS Details
|
Yunzai/plugins/TRSS-Plugin/README.md
ADDED
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div align="center">
|
2 |
+
|
3 |
+
<a href="https://moegirl.org.cn/苏半夏">
|
4 |
+
<picture>
|
5 |
+
<source media="(prefers-color-scheme: dark)" srcset="Picture/苏半夏D.png">
|
6 |
+
<img alt="苏半夏" src="Picture/苏半夏.png">
|
7 |
+
</picture>
|
8 |
+
</a>
|
9 |
+
|
10 |
+
# TRSS Yunzai Plugin
|
11 |
+
|
12 |
+
云崽机器人插件
|
13 |
+
|
14 |
+
[](https://github.com/TimeRainStarSky/TRSS-Plugin)
|
15 |
+
[](../../stargazers)
|
16 |
+
[](Install.sh)
|
17 |
+
[](../../releases/latest)
|
18 |
+
|
19 |
+
[](https://github.com/TimeRainStarSky/TRSS-Plugin)
|
20 |
+
|
21 |
+
</div>
|
22 |
+
|
23 |
+
## 安装教程
|
24 |
+
|
25 |
+
- 推荐使用 [TRSS Yunzai 管理脚本](https://TRSS.me) 安装
|
26 |
+
|
27 |
+
[](../../../TRSS_Yunzai)
|
28 |
+
|
29 |
+
1. 准备:[Yunzai-Bot](https://github.com/Le-niao/Yunzai-Bot)
|
30 |
+
|
31 |
+
2. 安装:[GitHub](https://github.com/TimeRainStarSky/TRSS-Plugin) 或 [Gitee](https://gitee.com/TimeRainStarSky/TRSS-Plugin)
|
32 |
+
|
33 |
+
```
|
34 |
+
git clone --depth 1 https://Yunzai.TRSS.me plugins/TRSS-Plugin
|
35 |
+
pnpm i
|
36 |
+
```
|
37 |
+
|
38 |
+
3. 安装 `图片修复` | `图片背景去除` | `语音合成`,不用可忽略
|
39 |
+
|
40 |
+
<details><summary>展开</summary>
|
41 |
+
|
42 |
+
安装 [Python 3.10-3.11](https://python.org) 和 [Poetry](https://python-poetry.org),并在插件目录执行以下操作
|
43 |
+
|
44 |
+
```
|
45 |
+
poetry install
|
46 |
+
```
|
47 |
+
|
48 |
+
- 图片修复:
|
49 |
+
|
50 |
+
```
|
51 |
+
git clone --depth 1 https://gitee.com/TimeRainStarSky/Real-ESRGAN
|
52 |
+
cd Real-ESRGAN
|
53 |
+
poetry run python setup.py develop
|
54 |
+
```
|
55 |
+
|
56 |
+
- 图片背景去除:
|
57 |
+
|
58 |
+
```
|
59 |
+
git clone --depth 1 https://gitee.com/TimeRainStarSky/RemBG
|
60 |
+
cd RemBG
|
61 |
+
curl -LO https://github.com/TimeRainStarSky/TRSS-Plugin/releases/download/latest/u2net.onnx.xz
|
62 |
+
curl -LO https://github.com/TimeRainStarSky/TRSS-Plugin/releases/download/latest/isnetis.onnx.xz
|
63 |
+
xz -dv u2net.onnx.xz isnetis.onnx.xz
|
64 |
+
```
|
65 |
+
|
66 |
+
- 语音合成:
|
67 |
+
|
68 |
+
```
|
69 |
+
poetry run pip install monotonic-align
|
70 |
+
git clone --depth 1 https://gitee.com/TimeRainStarSky/ChatWaifu
|
71 |
+
git clone --depth 1 https://gitee.com/TimeRainStarSky/GenshinVoice
|
72 |
+
```
|
73 |
+
|
74 |
+
- 语音合成 汉语模型:
|
75 |
+
|
76 |
+
```
|
77 |
+
cd ChatWaifu
|
78 |
+
curl -LO https://github.com/TimeRainStarSky/TRSS-Plugin/releases/download/latest/ChatWaifuCN.txz
|
79 |
+
tar -xvJf ChatWaifuCN.txz
|
80 |
+
```
|
81 |
+
|
82 |
+
- 语音合成 日语模型:
|
83 |
+
|
84 |
+
```
|
85 |
+
cd ChatWaifu
|
86 |
+
curl -LO https://github.com/TimeRainStarSky/TRSS-Plugin/releases/download/latest/ChatWaifuJP.txz
|
87 |
+
tar -xvJf ChatWaifuJP.txz
|
88 |
+
```
|
89 |
+
|
90 |
+
- 语音合成 原神模型:
|
91 |
+
```
|
92 |
+
cd GenshinVoice
|
93 |
+
curl -LO https://github.com/TimeRainStarSky/TRSS-Plugin/releases/download/latest/G_809000.pth.xz
|
94 |
+
xz -dv G_809000.pth.xz
|
95 |
+
```
|
96 |
+
|
97 |
+
<details><summary>部署为 API 服务器</summary>
|
98 |
+
|
99 |
+
```
|
100 |
+
bash server.sh [端口]
|
101 |
+
```
|
102 |
+
|
103 |
+
</details>
|
104 |
+
|
105 |
+
- 阿里云盘 / 百度网盘:
|
106 |
+
|
107 |
+
使用脚本安装后,启动 CLI,输入 `login -h`,按提示登录
|
108 |
+
|
109 |
+
</details>
|
110 |
+
|
111 |
+
## 使用教程
|
112 |
+
|
113 |
+
<details><summary>图片修复</summary>
|
114 |
+
|
115 |
+
- 图片修复 / 动漫图片修复 + `图片`
|
116 |
+
|
117 |
+
</details>
|
118 |
+
|
119 |
+
<details><summary>图片背景去除</summary>
|
120 |
+
|
121 |
+
- 图片背景去除 / 动漫图片背景去除 + `图片`
|
122 |
+
|
123 |
+
</details>
|
124 |
+
|
125 |
+
<details><summary>语音合成</summary>
|
126 |
+
|
127 |
+
- `角色名` + (转码)?说 + `中文`
|
128 |
+
- 语音合成角色列表
|
129 |
+
|
130 |
+
</details>
|
131 |
+
|
132 |
+
<details><summary>系统信息</summary>
|
133 |
+
|
134 |
+
- 系统信息 / 系统信息图片 / 系统测试
|
135 |
+
|
136 |
+
</details>
|
137 |
+
|
138 |
+
<details><summary>二维码生成</summary>
|
139 |
+
|
140 |
+
- 二维码 + `文字`
|
141 |
+
|
142 |
+
</details>
|
143 |
+
|
144 |
+
<details><summary>米哈游登录</summary>
|
145 |
+
|
146 |
+
- 二维码登录:米哈游登录
|
147 |
+
- 账号密码登录:米哈游登录 + `账号`
|
148 |
+
|
149 |
+
</details>
|
150 |
+
|
151 |
+
<details><summary>Markdown(权限:主人)</summary>
|
152 |
+
|
153 |
+
- md + `文件` / `URL`
|
154 |
+
|
155 |
+
</details>
|
156 |
+
|
157 |
+
<details><summary>代码高亮(权限:主人)</summary>
|
158 |
+
|
159 |
+
- sc + `文件` / `URL`
|
160 |
+
|
161 |
+
</details>
|
162 |
+
|
163 |
+
<details><summary>远程命令(权限:主人)</summary>
|
164 |
+
|
165 |
+
- rc / rcp / rcj / rcjp + `命令`
|
166 |
+
|
167 |
+
</details>
|
168 |
+
|
169 |
+
<details><summary>文件操作(权限:主人)</summary>
|
170 |
+
|
171 |
+
- 文件查看 / 文件上传 / 文件下载 + `路径`
|
172 |
+
|
173 |
+
</details>
|
174 |
+
|
175 |
+
<details><summary>阿里云盘(权限:主人)</summary>
|
176 |
+
|
177 |
+
阿里云盘 +
|
178 |
+
|
179 |
+
- 帮助
|
180 |
+
- 上传
|
181 |
+
- 下载
|
182 |
+
- 相簿
|
183 |
+
- 链接
|
184 |
+
- 查看
|
185 |
+
- 创建目录
|
186 |
+
- 移动
|
187 |
+
- 回收站
|
188 |
+
- 重命名
|
189 |
+
- 删除
|
190 |
+
- 分享
|
191 |
+
- 同步备份
|
192 |
+
- 树形图
|
193 |
+
- 在线网盘
|
194 |
+
- 切换网盘
|
195 |
+
- 登录账号
|
196 |
+
- 账号列表
|
197 |
+
- 退出账号
|
198 |
+
- 空间配额
|
199 |
+
- 切换账号
|
200 |
+
- 当前账号
|
201 |
+
|
202 |
+
</details>
|
203 |
+
|
204 |
+
<details><summary>百度网盘(权限:主人)</summary>
|
205 |
+
|
206 |
+
百度网盘 +
|
207 |
+
|
208 |
+
- 帮助
|
209 |
+
- 上传
|
210 |
+
- 下载
|
211 |
+
- 复制
|
212 |
+
- 链接
|
213 |
+
- 查看
|
214 |
+
- 元信息
|
215 |
+
- 创建目录
|
216 |
+
- 移动
|
217 |
+
- 离线下载
|
218 |
+
- 空间配额
|
219 |
+
- 回收站
|
220 |
+
- 删除
|
221 |
+
- 搜索
|
222 |
+
- 分享
|
223 |
+
- 转存
|
224 |
+
- 树形图
|
225 |
+
- 登录账号
|
226 |
+
- 账号列表
|
227 |
+
- 退出账号
|
228 |
+
- 切换账号
|
229 |
+
- 当前账号
|
230 |
+
|
231 |
+
</details>
|
232 |
+
|
233 |
+
## 常见问题
|
234 |
+
|
235 |
+
<details><summary>展开</summary>
|
236 |
+
|
237 |
+
- 问:`ModuleNotFoundError: No module named 'xxx'`
|
238 |
+
- 答:未正确执行 `poetry install`
|
239 |
+
|
240 |
+
- 问:`已杀死` | `Signal 9` | `MemoryError`
|
241 |
+
- 答:`清理内存` 或 `增加 SWAP`
|
242 |
+
|
243 |
+
- 问:使用 `Git Bash` 执行 `poetry install` 失败
|
244 |
+
- 答:改用 `命令提示符` 或 `Windows PowerShell`
|
245 |
+
|
246 |
+
- 问:`error: Microsoft Visual C++ 14.0 or greater is required.`
|
247 |
+
- 答:下载安装 [Microsoft C++ 生成工具](https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools)
|
248 |
+

|
249 |
+
|
250 |
+
- 问:`'bash' 不是内部或外部命令,也不是可运行的程序或批处理文件` `bash : 无法将“sh”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。`
|
251 |
+
- 答:改用 `Git Bash`
|
252 |
+
|
253 |
+
- 问:手动安装过程中出现问题
|
254 |
+
- 答:建议自行解决,不会就用脚本一键安装
|
255 |
+
|
256 |
+
- 问:我有其他问题
|
257 |
+
- 答:提供详细问题描述,通过下方 联系方式 反馈问题
|
258 |
+
|
259 |
+
</details>
|
260 |
+
|
261 |
+
## 联系方式
|
262 |
+
|
263 |
+
- QQ 群组:
|
264 |
+
1. [659945190](https://jq.qq.com/?k=VBuHGPv3)
|
265 |
+
2. [1027131254](https://jq.qq.com/?k=Af0pTDHU)
|
266 |
+
3. [300714227](https://jq.qq.com/?k=V2xVpaR7)
|
267 |
+
|
268 |
+
### 时雨 🌌 星空
|
269 |
+
|
270 |
+
- GitHub:[TimeRainStarSky](https://github.com/TimeRainStarSky)
|
271 |
+
- 酷安:[时雨丶星空](https://coolapk.com/u/2650948)
|
272 |
+
- QQ:[2536554304](https://qm.qq.com/cgi-bin/qm/qr?k=x8LtlP8vwZs7qLwmsbCsyLoAHy7Et1Pj)
|
273 |
+
- Telegram:[TimeRainStarSky](https://t.me/TimeRainStarSky)
|
274 |
+
|
275 |
+
## 赞助支持
|
276 |
+
|
277 |
+
- 爱发电:<https://afdian.net/a/TimeRainStarSky>
|
278 |
+
- Partme:<https://partme.com/TimeRainStarSky>
|
Yunzai/plugins/TRSS-Plugin/Resources/Code/Code.css
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@font-face {
|
2 |
+
font-family: InconsolataGo;
|
3 |
+
src: url("../fonts/InconsolataGo.ttf");
|
4 |
+
}
|
5 |
+
body {
|
6 |
+
background: url("https://api.gmit.vip/Api/DmImg?format=image") white center top no-repeat;
|
7 |
+
background-size: cover;
|
8 |
+
padding: 10px 20px;
|
9 |
+
}
|
10 |
+
.box {
|
11 |
+
padding: 10px;
|
12 |
+
background: rgba(255, 255, 255, 0.45);
|
13 |
+
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
|
14 |
+
backdrop-filter: blur(6px);
|
15 |
+
-webkit-backdrop-filter: blur(6px);
|
16 |
+
border-radius: 10px;
|
17 |
+
border: 1px solid rgba(255, 255, 255, 0.18);
|
18 |
+
white-space: pre-wrap;
|
19 |
+
font-family: InconsolataGo, monospace;
|
20 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Resources/Code/Code.html
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<head>
|
2 |
+
<link rel="stylesheet" type="text/css" href="{{htmlDir}}Code.css">
|
3 |
+
</head>
|
4 |
+
<div align="center">
|
5 |
+
<span style="font-size: 50px">代码展示框</span>
|
6 |
+
</div>
|
7 |
+
<div class="box">{{@Code}}</div>
|
8 |
+
<div align="center">
|
9 |
+
<span style="font-size: 50px">TRSS-Plugin</span>
|
10 |
+
</div>
|
Yunzai/plugins/TRSS-Plugin/Resources/Markdown/Markdown.css
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@font-face {
|
2 |
+
font-family: InconsolataGo;
|
3 |
+
src: url("../fonts/InconsolataGo.ttf");
|
4 |
+
}
|
5 |
+
body {
|
6 |
+
background: url("https://api.gmit.vip/Api/DmImg?format=image") white center top no-repeat;
|
7 |
+
background-size: cover;
|
8 |
+
padding: 10px 20px;
|
9 |
+
}
|
10 |
+
.box {
|
11 |
+
padding: 10px;
|
12 |
+
background: rgba(255, 255, 255, 0.45);
|
13 |
+
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
|
14 |
+
backdrop-filter: blur(6px);
|
15 |
+
-webkit-backdrop-filter: blur(6px);
|
16 |
+
border-radius: 10px;
|
17 |
+
border: 1px solid rgba(255, 255, 255, 0.18);
|
18 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Resources/Markdown/Markdown.html
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<head>
|
2 |
+
<link rel="stylesheet" type="text/css" href="{{htmlDir}}Markdown.css">
|
3 |
+
</head>
|
4 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@latest/build/styles/github.min.css">
|
5 |
+
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@latest/build/highlight.min.js"></script>
|
6 |
+
<script src="https://cdn.jsdelivr.net/gh/wcoder/highlightjs-line-numbers.js@latest/dist/highlightjs-line-numbers.min.js"></script>
|
7 |
+
<script>
|
8 |
+
hljs.initHighlightingOnLoad()
|
9 |
+
hljs.initLineNumbersOnLoad()
|
10 |
+
</script>
|
11 |
+
<div align="center">
|
12 |
+
<span style="font-size: 50px">Markdown 展示框</span>
|
13 |
+
</div>
|
14 |
+
<div class="box">
|
15 |
+
{{@Markdown}}
|
16 |
+
</div>
|
17 |
+
<div align="center">
|
18 |
+
<span style="font-size: 50px">TRSS-Plugin</span>
|
19 |
+
</div>
|
Yunzai/plugins/TRSS-Plugin/Resources/SourceCode/SourceCode.css
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@font-face {
|
2 |
+
font-family: InconsolataGo;
|
3 |
+
src: url("../fonts/InconsolataGo.ttf");
|
4 |
+
}
|
5 |
+
body {
|
6 |
+
background: url("https://api.gmit.vip/Api/DmImg?format=image") white center top no-repeat;
|
7 |
+
background-size: cover;
|
8 |
+
padding: 10px 20px;
|
9 |
+
}
|
10 |
+
.box {
|
11 |
+
padding: 10px;
|
12 |
+
background: rgba(255, 255, 255, 0.45);
|
13 |
+
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
|
14 |
+
backdrop-filter: blur(6px);
|
15 |
+
-webkit-backdrop-filter: blur(6px);
|
16 |
+
border-radius: 10px;
|
17 |
+
border: 1px solid rgba(255, 255, 255, 0.18);
|
18 |
+
}
|
Yunzai/plugins/TRSS-Plugin/Resources/SourceCode/SourceCode.html
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<head>
|
2 |
+
<link rel="stylesheet" type="text/css" href="{{htmlDir}}SourceCode.css">
|
3 |
+
</head>
|
4 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@latest/build/styles/github.min.css">
|
5 |
+
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@latest/build/highlight.min.js"></script>
|
6 |
+
<script src="https://cdn.jsdelivr.net/gh/wcoder/highlightjs-line-numbers.js@latest/dist/highlightjs-line-numbers.min.js"></script>
|
7 |
+
<script>
|
8 |
+
hljs.initHighlightingOnLoad()
|
9 |
+
hljs.initLineNumbersOnLoad()
|
10 |
+
</script>
|
11 |
+
<div align="center">
|
12 |
+
<span style="font-size: 50px">源码展示框</span>
|
13 |
+
</div>
|
14 |
+
<div class="box">
|
15 |
+
<pre><code>{{@SourceCode}}</code></pre>
|
16 |
+
</div>
|
17 |
+
<div align="center">
|
18 |
+
<span style="font-size: 50px">TRSS-Plugin</span>
|
19 |
+
</div>
|
Yunzai/plugins/TRSS-Plugin/Resources/fonts/InconsolataGo.ttf
ADDED
Binary file (870 kB). View file
|
|
Yunzai/plugins/TRSS-Plugin/index.js
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
logger.info(logger.yellow("- 正在加载 TRSS 插件"))
|
2 |
+
|
3 |
+
import fs from "node:fs"
|
4 |
+
import util from "node:util"
|
5 |
+
import QR from "qrcode"
|
6 |
+
import config from "./Model/config.js"
|
7 |
+
import common from "../../lib/common/common.js"
|
8 |
+
import puppeteer from "../../lib/puppeteer/puppeteer.js"
|
9 |
+
import { exec } from "child_process"
|
10 |
+
import MarkdownIt from "markdown-it"
|
11 |
+
import { AnsiUp } from "ansi_up"
|
12 |
+
|
13 |
+
global.fs = fs
|
14 |
+
global.util = util
|
15 |
+
global.QR = QR
|
16 |
+
global.config = config
|
17 |
+
global.common = common
|
18 |
+
global.puppeteer = puppeteer
|
19 |
+
global.exec = exec
|
20 |
+
global.md = new MarkdownIt
|
21 |
+
global.ansi_up = new AnsiUp
|
22 |
+
|
23 |
+
if (!global.segment) {
|
24 |
+
logger.warn(logger.red("! 未找到 segment,建议更新 Yunzai"))
|
25 |
+
global.segment = (await import("oicq")).segment
|
26 |
+
}
|
27 |
+
|
28 |
+
try {
|
29 |
+
global.uploadRecord = (await import("./Model/uploadRecord.js")).default
|
30 |
+
} catch (err) {
|
31 |
+
global.uploadRecord = segment.record
|
32 |
+
}
|
33 |
+
|
34 |
+
const files = fs
|
35 |
+
.readdirSync("plugins/TRSS-Plugin/Apps")
|
36 |
+
.filter((file) => file.endsWith(".js"))
|
37 |
+
|
38 |
+
let ret = []
|
39 |
+
files.forEach((file) => {
|
40 |
+
ret.push(import(`./Apps/${file}`))
|
41 |
+
})
|
42 |
+
ret = await Promise.allSettled(ret)
|
43 |
+
|
44 |
+
const apps = {}
|
45 |
+
for (const i in files) {
|
46 |
+
const name = files[i].replace(".js", "")
|
47 |
+
if (ret[i].status != "fulfilled") {
|
48 |
+
logger.error("载入插件错误:" + logger.red(name))
|
49 |
+
logger.error(ret[i].reason)
|
50 |
+
continue
|
51 |
+
}
|
52 |
+
apps[name] = ret[i].value[name]
|
53 |
+
}
|
54 |
+
export { apps }
|
55 |
+
|
56 |
+
logger.info(logger.green("- TRSS 插件 加载完成"))
|
Yunzai/plugins/TRSS-Plugin/node_modules/.bin/markdown-it
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/sh
|
2 |
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
3 |
+
|
4 |
+
case `uname` in
|
5 |
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
6 |
+
esac
|
7 |
+
|
8 |
+
if [ -z "$NODE_PATH" ]; then
|
9 |
+
export NODE_PATH="/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/bin/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/markdown-it@13.0.1/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/node_modules"
|
10 |
+
else
|
11 |
+
export NODE_PATH="/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/bin/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/markdown-it@13.0.1/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/node_modules:$NODE_PATH"
|
12 |
+
fi
|
13 |
+
if [ -x "$basedir/node" ]; then
|
14 |
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/bin/markdown-it.js" "$@"
|
15 |
+
else
|
16 |
+
exec node "$basedir/../../../../node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/bin/markdown-it.js" "$@"
|
17 |
+
fi
|
Yunzai/plugins/TRSS-Plugin/node_modules/.bin/markdown-it.CMD
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@SETLOCAL
|
2 |
+
@IF NOT DEFINED NODE_PATH (
|
3 |
+
@SET "NODE_PATH=E:\bot\yunzai\Yunzai\node_modules\.pnpm\markdown-it@13.0.1\node_modules\markdown-it\bin\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\markdown-it@13.0.1\node_modules\markdown-it\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\markdown-it@13.0.1\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\node_modules"
|
4 |
+
) ELSE (
|
5 |
+
@SET "NODE_PATH=E:\bot\yunzai\Yunzai\node_modules\.pnpm\markdown-it@13.0.1\node_modules\markdown-it\bin\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\markdown-it@13.0.1\node_modules\markdown-it\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\markdown-it@13.0.1\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\node_modules;%NODE_PATH%"
|
6 |
+
)
|
7 |
+
@IF EXIST "%~dp0\node.exe" (
|
8 |
+
"%~dp0\node.exe" "%~dp0\..\..\..\..\node_modules\.pnpm\markdown-it@13.0.1\node_modules\markdown-it\bin\markdown-it.js" %*
|
9 |
+
) ELSE (
|
10 |
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
11 |
+
node "%~dp0\..\..\..\..\node_modules\.pnpm\markdown-it@13.0.1\node_modules\markdown-it\bin\markdown-it.js" %*
|
12 |
+
)
|
Yunzai/plugins/TRSS-Plugin/node_modules/.bin/markdown-it.ps1
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env pwsh
|
2 |
+
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
3 |
+
|
4 |
+
$exe=""
|
5 |
+
$pathsep=":"
|
6 |
+
$env_node_path=$env:NODE_PATH
|
7 |
+
$new_node_path="E:\bot\yunzai\Yunzai\node_modules\.pnpm\markdown-it@13.0.1\node_modules\markdown-it\bin\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\markdown-it@13.0.1\node_modules\markdown-it\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\markdown-it@13.0.1\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\node_modules"
|
8 |
+
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
9 |
+
# Fix case when both the Windows and Linux builds of Node
|
10 |
+
# are installed in the same directory
|
11 |
+
$exe=".exe"
|
12 |
+
$pathsep=";"
|
13 |
+
} else {
|
14 |
+
$new_node_path="/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/bin/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/markdown-it@13.0.1/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/node_modules"
|
15 |
+
}
|
16 |
+
if ([string]::IsNullOrEmpty($env_node_path)) {
|
17 |
+
$env:NODE_PATH=$new_node_path
|
18 |
+
} else {
|
19 |
+
$env:NODE_PATH="$new_node_path$pathsep$env_node_path"
|
20 |
+
}
|
21 |
+
|
22 |
+
$ret=0
|
23 |
+
if (Test-Path "$basedir/node$exe") {
|
24 |
+
# Support pipeline input
|
25 |
+
if ($MyInvocation.ExpectingInput) {
|
26 |
+
$input | & "$basedir/node$exe" "$basedir/../../../../node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/bin/markdown-it.js" $args
|
27 |
+
} else {
|
28 |
+
& "$basedir/node$exe" "$basedir/../../../../node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/bin/markdown-it.js" $args
|
29 |
+
}
|
30 |
+
$ret=$LASTEXITCODE
|
31 |
+
} else {
|
32 |
+
# Support pipeline input
|
33 |
+
if ($MyInvocation.ExpectingInput) {
|
34 |
+
$input | & "node$exe" "$basedir/../../../../node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/bin/markdown-it.js" $args
|
35 |
+
} else {
|
36 |
+
& "node$exe" "$basedir/../../../../node_modules/.pnpm/markdown-it@13.0.1/node_modules/markdown-it/bin/markdown-it.js" $args
|
37 |
+
}
|
38 |
+
$ret=$LASTEXITCODE
|
39 |
+
}
|
40 |
+
$env:NODE_PATH=$env_node_path
|
41 |
+
exit $ret
|
Yunzai/plugins/TRSS-Plugin/node_modules/.bin/qrcode
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/sh
|
2 |
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
3 |
+
|
4 |
+
case `uname` in
|
5 |
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
6 |
+
esac
|
7 |
+
|
8 |
+
if [ -z "$NODE_PATH" ]; then
|
9 |
+
export NODE_PATH="/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/bin/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/qrcode@1.5.3/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/node_modules"
|
10 |
+
else
|
11 |
+
export NODE_PATH="/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/bin/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/qrcode@1.5.3/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/node_modules:$NODE_PATH"
|
12 |
+
fi
|
13 |
+
if [ -x "$basedir/node" ]; then
|
14 |
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/bin/qrcode" "$@"
|
15 |
+
else
|
16 |
+
exec node "$basedir/../../../../node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/bin/qrcode" "$@"
|
17 |
+
fi
|
Yunzai/plugins/TRSS-Plugin/node_modules/.bin/qrcode.CMD
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@SETLOCAL
|
2 |
+
@IF NOT DEFINED NODE_PATH (
|
3 |
+
@SET "NODE_PATH=E:\bot\yunzai\Yunzai\node_modules\.pnpm\qrcode@1.5.3\node_modules\qrcode\bin\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\qrcode@1.5.3\node_modules\qrcode\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\qrcode@1.5.3\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\node_modules"
|
4 |
+
) ELSE (
|
5 |
+
@SET "NODE_PATH=E:\bot\yunzai\Yunzai\node_modules\.pnpm\qrcode@1.5.3\node_modules\qrcode\bin\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\qrcode@1.5.3\node_modules\qrcode\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\qrcode@1.5.3\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\node_modules;%NODE_PATH%"
|
6 |
+
)
|
7 |
+
@IF EXIST "%~dp0\node.exe" (
|
8 |
+
"%~dp0\node.exe" "%~dp0\..\..\..\..\node_modules\.pnpm\qrcode@1.5.3\node_modules\qrcode\bin\qrcode" %*
|
9 |
+
) ELSE (
|
10 |
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
11 |
+
node "%~dp0\..\..\..\..\node_modules\.pnpm\qrcode@1.5.3\node_modules\qrcode\bin\qrcode" %*
|
12 |
+
)
|
Yunzai/plugins/TRSS-Plugin/node_modules/.bin/qrcode.ps1
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env pwsh
|
2 |
+
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
3 |
+
|
4 |
+
$exe=""
|
5 |
+
$pathsep=":"
|
6 |
+
$env_node_path=$env:NODE_PATH
|
7 |
+
$new_node_path="E:\bot\yunzai\Yunzai\node_modules\.pnpm\qrcode@1.5.3\node_modules\qrcode\bin\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\qrcode@1.5.3\node_modules\qrcode\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\qrcode@1.5.3\node_modules;E:\bot\yunzai\Yunzai\node_modules\.pnpm\node_modules"
|
8 |
+
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
9 |
+
# Fix case when both the Windows and Linux builds of Node
|
10 |
+
# are installed in the same directory
|
11 |
+
$exe=".exe"
|
12 |
+
$pathsep=";"
|
13 |
+
} else {
|
14 |
+
$new_node_path="/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/bin/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/qrcode@1.5.3/node_modules:/mnt/e/bot/yunzai/Yunzai/node_modules/.pnpm/node_modules"
|
15 |
+
}
|
16 |
+
if ([string]::IsNullOrEmpty($env_node_path)) {
|
17 |
+
$env:NODE_PATH=$new_node_path
|
18 |
+
} else {
|
19 |
+
$env:NODE_PATH="$new_node_path$pathsep$env_node_path"
|
20 |
+
}
|
21 |
+
|
22 |
+
$ret=0
|
23 |
+
if (Test-Path "$basedir/node$exe") {
|
24 |
+
# Support pipeline input
|
25 |
+
if ($MyInvocation.ExpectingInput) {
|
26 |
+
$input | & "$basedir/node$exe" "$basedir/../../../../node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/bin/qrcode" $args
|
27 |
+
} else {
|
28 |
+
& "$basedir/node$exe" "$basedir/../../../../node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/bin/qrcode" $args
|
29 |
+
}
|
30 |
+
$ret=$LASTEXITCODE
|
31 |
+
} else {
|
32 |
+
# Support pipeline input
|
33 |
+
if ($MyInvocation.ExpectingInput) {
|
34 |
+
$input | & "node$exe" "$basedir/../../../../node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/bin/qrcode" $args
|
35 |
+
} else {
|
36 |
+
& "node$exe" "$basedir/../../../../node_modules/.pnpm/qrcode@1.5.3/node_modules/qrcode/bin/qrcode" $args
|
37 |
+
}
|
38 |
+
$ret=$LASTEXITCODE
|
39 |
+
}
|
40 |
+
$env:NODE_PATH=$env_node_path
|
41 |
+
exit $ret
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/.notags
ADDED
File without changes
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(The MIT License)
|
2 |
+
|
3 |
+
Copyright (c) 2011 Dru Nelson
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
6 |
+
a copy of this software and associated documentation files (the
|
7 |
+
'Software'), to deal in the Software without restriction, including
|
8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
11 |
+
the following conditions:
|
12 |
+
|
13 |
+
The above copyright notice and this permission notice shall be
|
14 |
+
included in all copies or substantial portions of the Software.
|
15 |
+
|
16 |
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19 |
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20 |
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21 |
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22 |
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/Makefile
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
SOURCE = *.ts
|
3 |
+
TESTS = test/*.js
|
4 |
+
REPORTER = dot
|
5 |
+
|
6 |
+
typescript:
|
7 |
+
./node_modules/.bin/tsc -p .
|
8 |
+
|
9 |
+
test:
|
10 |
+
@NODE_ENV=test ./node_modules/.bin/mocha \
|
11 |
+
--require should \
|
12 |
+
--reporter $(REPORTER) \
|
13 |
+
$(TESTS)
|
14 |
+
|
15 |
+
test_verbose:
|
16 |
+
@NODE_ENV=test ./node_modules/.bin/mocha \
|
17 |
+
--require should \
|
18 |
+
--reporter spec \
|
19 |
+
$(TESTS)
|
20 |
+
|
21 |
+
clean:
|
22 |
+
rm -rf ./node_modules ansi_up.js
|
23 |
+
|
24 |
+
.PHONY: test
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/Readme.md
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ansi_up.js
|
2 |
+
|
3 |
+
__ansi_up__ is an easy to use library that transforms text containing
|
4 |
+
[ANSI color escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors) into HTML.
|
5 |
+
|
6 |
+
This module is a single ES6 Javascript file with no dependencies.
|
7 |
+
It is "isomorphic" javascript. This is just another way of saying that
|
8 |
+
the ansi_up.js file will work in both the browser or node.js.
|
9 |
+
The js library is compiled from TypeScript and its type description ships with the NPM.
|
10 |
+
This code has been used in production since 2011 and is actively maintained.
|
11 |
+
|
12 |
+
For example, turn this terminal output:
|
13 |
+
|
14 |
+
ESC[1;Foreground
|
15 |
+
[1;30m 30 [1;30m 30 [1;30m 30 [1;30m 30 [1;30m 30 [1;30m 30 [1;30m 30 [1;30m 30 [0m
|
16 |
+
[1;31m 31 [1;31m 31 [1;31m 31 [1;31m 31 [1;31m 31 [1;31m 31 [1;31m 31 [1;31m 31 [0m
|
17 |
+
[1;32m 32 [1;32m 32 [1;32m 32 [1;32m 32 [1;32m 32 [1;32m 32 [1;32m 32 [1;32m 32 [0m
|
18 |
+
...
|
19 |
+
|
20 |
+
...into this browser output:
|
21 |
+
|
22 |
+

|
23 |
+
|
24 |
+
|
25 |
+
## Browser Example
|
26 |
+
|
27 |
+
```HTML
|
28 |
+
|
29 |
+
<script type="module" type="text/javascript">
|
30 |
+
|
31 |
+
var txt = "\n\n\033[1;33;40m 33;40 \033[1;33;41m 33;41 \033[1;33;42m 33;42 \033[1;33;43m 33;43 \033[1;33;44m 33;44 \033[1;33;45m 33;45 \033[1;33;46m 33;46 \033[1m\033[0\n\n\033[1;33;42m >> Tests OK\n\n"
|
32 |
+
|
33 |
+
import { AnsiUp } from './ansi_up.js'
|
34 |
+
var ansi_up = new AnsiUp();
|
35 |
+
|
36 |
+
var html = ansi_up.ansi_to_html(txt);
|
37 |
+
|
38 |
+
var cdiv = document.getElementById("console");
|
39 |
+
|
40 |
+
cdiv.innerHTML = html;
|
41 |
+
|
42 |
+
</script>
|
43 |
+
```
|
44 |
+
|
45 |
+
## Node Example
|
46 |
+
|
47 |
+
```JavaScript
|
48 |
+
import { AnsiUp } from './ansi_up.js'
|
49 |
+
var ansi_up = new AnsiUp();
|
50 |
+
|
51 |
+
var txt = "\n\n\033[1;33;40m 33;40 \033[1;33;41m 33;41 \033[1;33;42m 33;42 \033[1;33;43m 33;43 \033[1;33;44m 33;44 \033[1;33;45m 33;45 \033[1;33;46m 33;46 \033[1m\033[0\n\n\033[1;33;42m >> Tests OK\n\n"
|
52 |
+
|
53 |
+
var html = ansi_up.ansi_to_html(txt);
|
54 |
+
```
|
55 |
+
|
56 |
+
More examples are in the 'examples' directory in the repo.
|
57 |
+
|
58 |
+
## Typescript Example
|
59 |
+
|
60 |
+
```TypeScript
|
61 |
+
import { AnsiUp } from './ansi_up.js'
|
62 |
+
const ansi_up = new AnsiUp();
|
63 |
+
|
64 |
+
const txt = "\n\n\x1B[1;33;40m 33;40 \x1B[1;33;41m 33;41 \x1B[1;33;42m 33;42 \x1B[1;33;43m 33;43 \x1B[1;33;44m 33;44 \x1B[1;33;45m 33;45 \x1B[1;33;46m 33;46 \x1B[1m\x1B[0\n\n\x1B[1;33;42m >> Tests OK\n\n"
|
65 |
+
|
66 |
+
let html = ansi_up.ansi_to_html(txt);
|
67 |
+
```
|
68 |
+
|
69 |
+
## Installation
|
70 |
+
|
71 |
+
$ npm install ansi_up
|
72 |
+
|
73 |
+
## Versions
|
74 |
+
* Version 6.0 - Switch to ES6 module. Add faint styles. Style css configurable.
|
75 |
+
* Version 5.1 - Add italic and underline styles (@DaoDaoNoCode)
|
76 |
+
* Version 5.0 - Security fix for OSC URLs
|
77 |
+
* Version 4.0 - Re-architect code to support [terminal URL codes](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda).
|
78 |
+
* Version 3.0 - now treats ANSI bold sequences as CSS font-weight:bold
|
79 |
+
* Version 2.0 - moved to a stateful, streaming version of the API
|
80 |
+
* Version 1.3 - was the last of the older, deprecated API.
|
81 |
+
|
82 |
+
## Quick Start
|
83 |
+
|
84 |
+
1. Use whatever module system to import the _ansi_up_ module.
|
85 |
+
2. Instantiate the object.
|
86 |
+
3. For every piece of ansi escaped text string, call **ansi_to_html**.
|
87 |
+
4. Append the emitted HTML to the previous HTML already emitted.
|
88 |
+
5. DONE
|
89 |
+
|
90 |
+
|
91 |
+
## API Methods and Recommended Settings
|
92 |
+
|
93 |
+
You only need the ansi_to_html method. The other properties listed below allow you to
|
94 |
+
override some of the escaping behaviour. You probably don't need to change these
|
95 |
+
from their default values.
|
96 |
+
|
97 |
+
It is recommended that the HTML container that holds the span tags is styled with a monospace font.
|
98 |
+
A PRE tag would work just fine for this.
|
99 |
+
It is also recommended that the HTML container is styled with a black background.
|
100 |
+
See the examples, for more CSS theming.
|
101 |
+
|
102 |
+
|
103 |
+
#### ansi_to_html (txt)
|
104 |
+
|
105 |
+
This transforms ANSI terminal escape codes/sequences into SPAN tags that wrap and style the content.
|
106 |
+
|
107 |
+
This method only interprets ANSI SGR (Select Graphic Rendition) codes or escaped URL codes.
|
108 |
+
For example, cursor movement codes are ignored and hidden from output.
|
109 |
+
|
110 |
+
This method also safely escapes any unsafe HTML characters.
|
111 |
+
|
112 |
+
The default style uses colors that are very close to the prescribed standard.
|
113 |
+
The standard assumes that the text will have a black background.
|
114 |
+
These colors are set as inline styles on the SPAN tags.
|
115 |
+
Another option is to set the 'use_classes' property to true'.
|
116 |
+
This will instead set classes on the spans so the colors can be set via CSS.
|
117 |
+
The class names used are of the format ````ansi-*-fg/bg```` and ````ansi-bright-*-fg/bg```` where * is the colour name, i.e black/red/green/yellow/blue/magenta/cyan/white.
|
118 |
+
See the examples directory for a complete CSS theme for these classes.
|
119 |
+
|
120 |
+
## Properties
|
121 |
+
|
122 |
+
#### escape_html
|
123 |
+
(default: true)
|
124 |
+
|
125 |
+
By default, HTML's reserved characters `& < > " '` are replaced with <a href="https://www.w3schools.com/html/html_entities.asp">HTML entities</a> to make them appear as literal characters in your application, rather than being interpreted as HTML structure. If you prefer keeping HTML's reserved characters untouched, you can set this to false.
|
126 |
+
|
127 |
+
#### use_classes
|
128 |
+
(default: false)
|
129 |
+
|
130 |
+
This causes the SPAN tags to use classes to style the SPAN tags instead
|
131 |
+
of specified RGB values.
|
132 |
+
|
133 |
+
#### url_allowlist
|
134 |
+
(default: { 'http':1, 'https':1 })
|
135 |
+
|
136 |
+
This mapping is an 'allow' list of URI schemes that will be allowed to render HTML anchor tags.
|
137 |
+
|
138 |
+
#### boldStyle
|
139 |
+
(default: 'font-weight:bold')
|
140 |
+
#### faintStyle
|
141 |
+
(default: 'opacity:0.7')
|
142 |
+
#### italicStyle
|
143 |
+
(default: 'font-style:italic')
|
144 |
+
#### underlineStyle
|
145 |
+
(default: 'text-decoration:underline')
|
146 |
+
|
147 |
+
## Buffering
|
148 |
+
|
149 |
+
In general, the ansi_to_html *should* emit HTML output when invoked with a non-empty string.
|
150 |
+
The only exceptions are an incomplete ESC sequence or an incomplete OSC URL sequence.
|
151 |
+
For those cases, the library will buffer (not emit output), until it receives input that completes those sequences.
|
152 |
+
|
153 |
+
### Example of a Use Case
|
154 |
+
|
155 |
+
I have used this library to 'tail' a file.
|
156 |
+
|
157 |
+
On a remote machine, I had process generating a log file.
|
158 |
+
I had a web server running on the same machine.
|
159 |
+
The server hosted a simple HTML page that used AJAX to poll an object with a range query.
|
160 |
+
Specifically I used an HTTP/1.1 GET request with RFC 7233 Range query.
|
161 |
+
The first range query would start at 0, but then progressively move forward after
|
162 |
+
new data was received.
|
163 |
+
|
164 |
+
For each new chunk of data received, I would transform the data with _ansi_up_, and append the new
|
165 |
+
spans to the innerHTML of a PRE tag.
|
166 |
+
|
167 |
+
|
168 |
+
### UTF8 note
|
169 |
+
|
170 |
+
One last important note, _ansi_up_ takes its input in the form of a Javascript string.
|
171 |
+
These strings are UTF8. When you take the output of some program and send it to
|
172 |
+
Javascript, there will be buffering. Be sure that you do not send incomplete UTF8 sequences.
|
173 |
+
Javascript will ignore or drop the sequence from the stream when it converts it to a
|
174 |
+
string.
|
175 |
+
|
176 |
+
|
177 |
+
## Building
|
178 |
+
|
179 |
+
To build, a simple Makefile handles it all.
|
180 |
+
|
181 |
+
```shell
|
182 |
+
$ make
|
183 |
+
```
|
184 |
+
|
185 |
+
## Running tests
|
186 |
+
|
187 |
+
To run the tests for _ansi_up_, run `npm install` to install dev dependencies. Then:
|
188 |
+
|
189 |
+
```shell
|
190 |
+
$ make test
|
191 |
+
```
|
192 |
+
|
193 |
+
## Credits
|
194 |
+
|
195 |
+
This code was developed by Dru Nelson (<https://github.com/drudru>).
|
196 |
+
|
197 |
+
Thanks goes to the following contributors for their patches:
|
198 |
+
|
199 |
+
- Juntao Wang (<https://github.com/DaoDaoNoCode>)
|
200 |
+
- AIZAWA Hina (<https://github.com/fetus-hina>)
|
201 |
+
- James R. White (<https://github.com/jamesrwhite>)
|
202 |
+
- Aaron Stone (<https://github.com/sodabrew>)
|
203 |
+
- Maximilian Antoni (<https://github.com/mantoni>)
|
204 |
+
- Jim Bauwens (<https://github.com/jimbauwens>)
|
205 |
+
- Jacek Jędrzejewski (<https://github.com/eXtreme>)
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/ansi_up.d.ts
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export declare class AnsiUp {
|
2 |
+
VERSION: string;
|
3 |
+
private ansi_colors;
|
4 |
+
private palette_256;
|
5 |
+
private fg;
|
6 |
+
private bg;
|
7 |
+
private bold;
|
8 |
+
private faint;
|
9 |
+
private italic;
|
10 |
+
private underline;
|
11 |
+
private _use_classes;
|
12 |
+
private _csi_regex;
|
13 |
+
private _osc_st;
|
14 |
+
private _osc_regex;
|
15 |
+
private _url_allowlist;
|
16 |
+
private _escape_html;
|
17 |
+
private _buffer;
|
18 |
+
private _boldStyle;
|
19 |
+
private _faintStyle;
|
20 |
+
private _italicStyle;
|
21 |
+
private _underlineStyle;
|
22 |
+
constructor();
|
23 |
+
set use_classes(arg: boolean);
|
24 |
+
get use_classes(): boolean;
|
25 |
+
set url_allowlist(arg: {});
|
26 |
+
get url_allowlist(): {};
|
27 |
+
set escape_html(arg: boolean);
|
28 |
+
get escape_html(): boolean;
|
29 |
+
set boldStyle(arg: string);
|
30 |
+
get boldStyle(): string;
|
31 |
+
set faintStyle(arg: string);
|
32 |
+
get faintStyle(): string;
|
33 |
+
set italicStyle(arg: string);
|
34 |
+
get italicStyle(): string;
|
35 |
+
set underlineStyle(arg: string);
|
36 |
+
get underlineStyle(): string;
|
37 |
+
private setup_palettes;
|
38 |
+
private escape_txt_for_html;
|
39 |
+
private append_buffer;
|
40 |
+
private get_next_packet;
|
41 |
+
ansi_to_html(txt: string): string;
|
42 |
+
private with_state;
|
43 |
+
private process_ansi;
|
44 |
+
private transform_to_html;
|
45 |
+
private process_hyperlink;
|
46 |
+
}
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/ansi_up.js
ADDED
@@ -0,0 +1,431 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use strict";
|
2 |
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
3 |
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
4 |
+
return cooked;
|
5 |
+
};
|
6 |
+
var PacketKind;
|
7 |
+
(function (PacketKind) {
|
8 |
+
PacketKind[PacketKind["EOS"] = 0] = "EOS";
|
9 |
+
PacketKind[PacketKind["Text"] = 1] = "Text";
|
10 |
+
PacketKind[PacketKind["Incomplete"] = 2] = "Incomplete";
|
11 |
+
PacketKind[PacketKind["ESC"] = 3] = "ESC";
|
12 |
+
PacketKind[PacketKind["Unknown"] = 4] = "Unknown";
|
13 |
+
PacketKind[PacketKind["SGR"] = 5] = "SGR";
|
14 |
+
PacketKind[PacketKind["OSCURL"] = 6] = "OSCURL";
|
15 |
+
})(PacketKind || (PacketKind = {}));
|
16 |
+
export class AnsiUp {
|
17 |
+
constructor() {
|
18 |
+
this.VERSION = "6.0.2";
|
19 |
+
this.setup_palettes();
|
20 |
+
this._use_classes = false;
|
21 |
+
this.bold = false;
|
22 |
+
this.faint = false;
|
23 |
+
this.italic = false;
|
24 |
+
this.underline = false;
|
25 |
+
this.fg = this.bg = null;
|
26 |
+
this._buffer = '';
|
27 |
+
this._url_allowlist = { 'http': 1, 'https': 1 };
|
28 |
+
this._escape_html = true;
|
29 |
+
this.boldStyle = 'font-weight:bold';
|
30 |
+
this.faintStyle = 'opacity:0.7';
|
31 |
+
this.italicStyle = 'font-style:italic';
|
32 |
+
this.underlineStyle = 'text-decoration:underline';
|
33 |
+
}
|
34 |
+
set use_classes(arg) {
|
35 |
+
this._use_classes = arg;
|
36 |
+
}
|
37 |
+
get use_classes() {
|
38 |
+
return this._use_classes;
|
39 |
+
}
|
40 |
+
set url_allowlist(arg) {
|
41 |
+
this._url_allowlist = arg;
|
42 |
+
}
|
43 |
+
get url_allowlist() {
|
44 |
+
return this._url_allowlist;
|
45 |
+
}
|
46 |
+
set escape_html(arg) {
|
47 |
+
this._escape_html = arg;
|
48 |
+
}
|
49 |
+
get escape_html() {
|
50 |
+
return this._escape_html;
|
51 |
+
}
|
52 |
+
set boldStyle(arg) { this._boldStyle = arg; }
|
53 |
+
get boldStyle() { return this._boldStyle; }
|
54 |
+
set faintStyle(arg) { this._faintStyle = arg; }
|
55 |
+
get faintStyle() { return this._faintStyle; }
|
56 |
+
set italicStyle(arg) { this._italicStyle = arg; }
|
57 |
+
get italicStyle() { return this._italicStyle; }
|
58 |
+
set underlineStyle(arg) { this._underlineStyle = arg; }
|
59 |
+
get underlineStyle() { return this._underlineStyle; }
|
60 |
+
setup_palettes() {
|
61 |
+
this.ansi_colors =
|
62 |
+
[
|
63 |
+
[
|
64 |
+
{ rgb: [0, 0, 0], class_name: "ansi-black" },
|
65 |
+
{ rgb: [187, 0, 0], class_name: "ansi-red" },
|
66 |
+
{ rgb: [0, 187, 0], class_name: "ansi-green" },
|
67 |
+
{ rgb: [187, 187, 0], class_name: "ansi-yellow" },
|
68 |
+
{ rgb: [0, 0, 187], class_name: "ansi-blue" },
|
69 |
+
{ rgb: [187, 0, 187], class_name: "ansi-magenta" },
|
70 |
+
{ rgb: [0, 187, 187], class_name: "ansi-cyan" },
|
71 |
+
{ rgb: [255, 255, 255], class_name: "ansi-white" }
|
72 |
+
],
|
73 |
+
[
|
74 |
+
{ rgb: [85, 85, 85], class_name: "ansi-bright-black" },
|
75 |
+
{ rgb: [255, 85, 85], class_name: "ansi-bright-red" },
|
76 |
+
{ rgb: [0, 255, 0], class_name: "ansi-bright-green" },
|
77 |
+
{ rgb: [255, 255, 85], class_name: "ansi-bright-yellow" },
|
78 |
+
{ rgb: [85, 85, 255], class_name: "ansi-bright-blue" },
|
79 |
+
{ rgb: [255, 85, 255], class_name: "ansi-bright-magenta" },
|
80 |
+
{ rgb: [85, 255, 255], class_name: "ansi-bright-cyan" },
|
81 |
+
{ rgb: [255, 255, 255], class_name: "ansi-bright-white" }
|
82 |
+
]
|
83 |
+
];
|
84 |
+
this.palette_256 = [];
|
85 |
+
this.ansi_colors.forEach(palette => {
|
86 |
+
palette.forEach(rec => {
|
87 |
+
this.palette_256.push(rec);
|
88 |
+
});
|
89 |
+
});
|
90 |
+
let levels = [0, 95, 135, 175, 215, 255];
|
91 |
+
for (let r = 0; r < 6; ++r) {
|
92 |
+
for (let g = 0; g < 6; ++g) {
|
93 |
+
for (let b = 0; b < 6; ++b) {
|
94 |
+
let col = { rgb: [levels[r], levels[g], levels[b]], class_name: 'truecolor' };
|
95 |
+
this.palette_256.push(col);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
}
|
99 |
+
let grey_level = 8;
|
100 |
+
for (let i = 0; i < 24; ++i, grey_level += 10) {
|
101 |
+
let gry = { rgb: [grey_level, grey_level, grey_level], class_name: 'truecolor' };
|
102 |
+
this.palette_256.push(gry);
|
103 |
+
}
|
104 |
+
}
|
105 |
+
escape_txt_for_html(txt) {
|
106 |
+
if (!this._escape_html)
|
107 |
+
return txt;
|
108 |
+
return txt.replace(/[&<>"']/gm, (str) => {
|
109 |
+
if (str === "&")
|
110 |
+
return "&";
|
111 |
+
if (str === "<")
|
112 |
+
return "<";
|
113 |
+
if (str === ">")
|
114 |
+
return ">";
|
115 |
+
if (str === "\"")
|
116 |
+
return """;
|
117 |
+
if (str === "'")
|
118 |
+
return "'";
|
119 |
+
});
|
120 |
+
}
|
121 |
+
append_buffer(txt) {
|
122 |
+
var str = this._buffer + txt;
|
123 |
+
this._buffer = str;
|
124 |
+
}
|
125 |
+
get_next_packet() {
|
126 |
+
var pkt = {
|
127 |
+
kind: PacketKind.EOS,
|
128 |
+
text: '',
|
129 |
+
url: ''
|
130 |
+
};
|
131 |
+
var len = this._buffer.length;
|
132 |
+
if (len == 0)
|
133 |
+
return pkt;
|
134 |
+
var pos = this._buffer.indexOf("\x1B");
|
135 |
+
if (pos == -1) {
|
136 |
+
pkt.kind = PacketKind.Text;
|
137 |
+
pkt.text = this._buffer;
|
138 |
+
this._buffer = '';
|
139 |
+
return pkt;
|
140 |
+
}
|
141 |
+
if (pos > 0) {
|
142 |
+
pkt.kind = PacketKind.Text;
|
143 |
+
pkt.text = this._buffer.slice(0, pos);
|
144 |
+
this._buffer = this._buffer.slice(pos);
|
145 |
+
return pkt;
|
146 |
+
}
|
147 |
+
if (pos == 0) {
|
148 |
+
if (len < 3) {
|
149 |
+
pkt.kind = PacketKind.Incomplete;
|
150 |
+
return pkt;
|
151 |
+
}
|
152 |
+
var next_char = this._buffer.charAt(1);
|
153 |
+
if ((next_char != '[') && (next_char != ']') && (next_char != '(')) {
|
154 |
+
pkt.kind = PacketKind.ESC;
|
155 |
+
pkt.text = this._buffer.slice(0, 1);
|
156 |
+
this._buffer = this._buffer.slice(1);
|
157 |
+
return pkt;
|
158 |
+
}
|
159 |
+
if (next_char == '[') {
|
160 |
+
if (!this._csi_regex) {
|
161 |
+
this._csi_regex = rgx(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \u001B[ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \u001B[ # CSI\n [ -~]* # anything legal\n ([\0-\u001F:]) # anything illegal\n )\n "], ["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "])));
|
162 |
+
}
|
163 |
+
let match = this._buffer.match(this._csi_regex);
|
164 |
+
if (match === null) {
|
165 |
+
pkt.kind = PacketKind.Incomplete;
|
166 |
+
return pkt;
|
167 |
+
}
|
168 |
+
if (match[4]) {
|
169 |
+
pkt.kind = PacketKind.ESC;
|
170 |
+
pkt.text = this._buffer.slice(0, 1);
|
171 |
+
this._buffer = this._buffer.slice(1);
|
172 |
+
return pkt;
|
173 |
+
}
|
174 |
+
if ((match[1] != '') || (match[3] != 'm'))
|
175 |
+
pkt.kind = PacketKind.Unknown;
|
176 |
+
else
|
177 |
+
pkt.kind = PacketKind.SGR;
|
178 |
+
pkt.text = match[2];
|
179 |
+
var rpos = match[0].length;
|
180 |
+
this._buffer = this._buffer.slice(rpos);
|
181 |
+
return pkt;
|
182 |
+
}
|
183 |
+
else if (next_char == ']') {
|
184 |
+
if (len < 4) {
|
185 |
+
pkt.kind = PacketKind.Incomplete;
|
186 |
+
return pkt;
|
187 |
+
}
|
188 |
+
if ((this._buffer.charAt(2) != '8')
|
189 |
+
|| (this._buffer.charAt(3) != ';')) {
|
190 |
+
pkt.kind = PacketKind.ESC;
|
191 |
+
pkt.text = this._buffer.slice(0, 1);
|
192 |
+
this._buffer = this._buffer.slice(1);
|
193 |
+
return pkt;
|
194 |
+
}
|
195 |
+
if (!this._osc_st) {
|
196 |
+
this._osc_st = rgxG(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n (?: # legal sequence\n (\u001B\\) # ESC | # alternate\n (\u0007) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\0-\u0006] # anything illegal\n | # alternate\n [\b-\u001A] # anything illegal\n | # alternate\n [\u001C-\u001F] # anything illegal\n )\n "], ["\n (?: # legal sequence\n (\\x1b\\\\) # ESC \\\n | # alternate\n (\\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\\x00-\\x06] # anything illegal\n | # alternate\n [\\x08-\\x1a] # anything illegal\n | # alternate\n [\\x1c-\\x1f] # anything illegal\n )\n "])));
|
197 |
+
}
|
198 |
+
this._osc_st.lastIndex = 0;
|
199 |
+
{
|
200 |
+
let match = this._osc_st.exec(this._buffer);
|
201 |
+
if (match === null) {
|
202 |
+
pkt.kind = PacketKind.Incomplete;
|
203 |
+
return pkt;
|
204 |
+
}
|
205 |
+
if (match[3]) {
|
206 |
+
pkt.kind = PacketKind.ESC;
|
207 |
+
pkt.text = this._buffer.slice(0, 1);
|
208 |
+
this._buffer = this._buffer.slice(1);
|
209 |
+
return pkt;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
{
|
213 |
+
let match = this._osc_st.exec(this._buffer);
|
214 |
+
if (match === null) {
|
215 |
+
pkt.kind = PacketKind.Incomplete;
|
216 |
+
return pkt;
|
217 |
+
}
|
218 |
+
if (match[3]) {
|
219 |
+
pkt.kind = PacketKind.ESC;
|
220 |
+
pkt.text = this._buffer.slice(0, 1);
|
221 |
+
this._buffer = this._buffer.slice(1);
|
222 |
+
return pkt;
|
223 |
+
}
|
224 |
+
}
|
225 |
+
if (!this._osc_regex) {
|
226 |
+
this._osc_regex = rgx(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ^ # beginning of line\n #\n \u001B]8; # OSC Hyperlink\n [ -:<-~]* # params (excluding ;)\n ; # end of params\n ([!-~]{0,512}) # URL capture\n (?: # ST\n (?:\u001B\\) # ESC | # alternate\n (?:\u0007) # BEL (what xterm did)\n )\n ([ -~]+) # TEXT capture\n \u001B]8;; # OSC Hyperlink End\n (?: # ST\n (?:\u001B\\) # ESC | # alternate\n (?:\u0007) # BEL (what xterm did)\n )\n "], ["\n ^ # beginning of line\n #\n \\x1b\\]8; # OSC Hyperlink\n [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)\n ; # end of params\n ([\\x21-\\x7e]{0,512}) # URL capture\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n ([\\x20-\\x7e]+) # TEXT capture\n \\x1b\\]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n "])));
|
227 |
+
}
|
228 |
+
let match = this._buffer.match(this._osc_regex);
|
229 |
+
if (match === null) {
|
230 |
+
pkt.kind = PacketKind.ESC;
|
231 |
+
pkt.text = this._buffer.slice(0, 1);
|
232 |
+
this._buffer = this._buffer.slice(1);
|
233 |
+
return pkt;
|
234 |
+
}
|
235 |
+
pkt.kind = PacketKind.OSCURL;
|
236 |
+
pkt.url = match[1];
|
237 |
+
pkt.text = match[2];
|
238 |
+
var rpos = match[0].length;
|
239 |
+
this._buffer = this._buffer.slice(rpos);
|
240 |
+
return pkt;
|
241 |
+
}
|
242 |
+
else if (next_char == '(') {
|
243 |
+
pkt.kind = PacketKind.Unknown;
|
244 |
+
this._buffer = this._buffer.slice(3);
|
245 |
+
return pkt;
|
246 |
+
}
|
247 |
+
}
|
248 |
+
}
|
249 |
+
ansi_to_html(txt) {
|
250 |
+
this.append_buffer(txt);
|
251 |
+
var blocks = [];
|
252 |
+
while (true) {
|
253 |
+
var packet = this.get_next_packet();
|
254 |
+
if ((packet.kind == PacketKind.EOS)
|
255 |
+
|| (packet.kind == PacketKind.Incomplete))
|
256 |
+
break;
|
257 |
+
if ((packet.kind == PacketKind.ESC)
|
258 |
+
|| (packet.kind == PacketKind.Unknown))
|
259 |
+
continue;
|
260 |
+
if (packet.kind == PacketKind.Text)
|
261 |
+
blocks.push(this.transform_to_html(this.with_state(packet)));
|
262 |
+
else if (packet.kind == PacketKind.SGR)
|
263 |
+
this.process_ansi(packet);
|
264 |
+
else if (packet.kind == PacketKind.OSCURL)
|
265 |
+
blocks.push(this.process_hyperlink(packet));
|
266 |
+
}
|
267 |
+
return blocks.join("");
|
268 |
+
}
|
269 |
+
with_state(pkt) {
|
270 |
+
return { bold: this.bold, faint: this.faint, italic: this.italic, underline: this.underline, fg: this.fg, bg: this.bg, text: pkt.text };
|
271 |
+
}
|
272 |
+
process_ansi(pkt) {
|
273 |
+
let sgr_cmds = pkt.text.split(';');
|
274 |
+
while (sgr_cmds.length > 0) {
|
275 |
+
let sgr_cmd_str = sgr_cmds.shift();
|
276 |
+
let num = parseInt(sgr_cmd_str, 10);
|
277 |
+
if (isNaN(num) || num === 0) {
|
278 |
+
this.fg = null;
|
279 |
+
this.bg = null;
|
280 |
+
this.bold = false;
|
281 |
+
this.faint = false;
|
282 |
+
this.italic = false;
|
283 |
+
this.underline = false;
|
284 |
+
}
|
285 |
+
else if (num === 1) {
|
286 |
+
this.bold = true;
|
287 |
+
}
|
288 |
+
else if (num === 2) {
|
289 |
+
this.faint = true;
|
290 |
+
}
|
291 |
+
else if (num === 3) {
|
292 |
+
this.italic = true;
|
293 |
+
}
|
294 |
+
else if (num === 4) {
|
295 |
+
this.underline = true;
|
296 |
+
}
|
297 |
+
else if (num === 21) {
|
298 |
+
this.bold = false;
|
299 |
+
}
|
300 |
+
else if (num === 22) {
|
301 |
+
this.faint = false;
|
302 |
+
this.bold = false;
|
303 |
+
}
|
304 |
+
else if (num === 23) {
|
305 |
+
this.italic = false;
|
306 |
+
}
|
307 |
+
else if (num === 24) {
|
308 |
+
this.underline = false;
|
309 |
+
}
|
310 |
+
else if (num === 39) {
|
311 |
+
this.fg = null;
|
312 |
+
}
|
313 |
+
else if (num === 49) {
|
314 |
+
this.bg = null;
|
315 |
+
}
|
316 |
+
else if ((num >= 30) && (num < 38)) {
|
317 |
+
this.fg = this.ansi_colors[0][(num - 30)];
|
318 |
+
}
|
319 |
+
else if ((num >= 40) && (num < 48)) {
|
320 |
+
this.bg = this.ansi_colors[0][(num - 40)];
|
321 |
+
}
|
322 |
+
else if ((num >= 90) && (num < 98)) {
|
323 |
+
this.fg = this.ansi_colors[1][(num - 90)];
|
324 |
+
}
|
325 |
+
else if ((num >= 100) && (num < 108)) {
|
326 |
+
this.bg = this.ansi_colors[1][(num - 100)];
|
327 |
+
}
|
328 |
+
else if (num === 38 || num === 48) {
|
329 |
+
if (sgr_cmds.length > 0) {
|
330 |
+
let is_foreground = (num === 38);
|
331 |
+
let mode_cmd = sgr_cmds.shift();
|
332 |
+
if (mode_cmd === '5' && sgr_cmds.length > 0) {
|
333 |
+
let palette_index = parseInt(sgr_cmds.shift(), 10);
|
334 |
+
if (palette_index >= 0 && palette_index <= 255) {
|
335 |
+
if (is_foreground)
|
336 |
+
this.fg = this.palette_256[palette_index];
|
337 |
+
else
|
338 |
+
this.bg = this.palette_256[palette_index];
|
339 |
+
}
|
340 |
+
}
|
341 |
+
if (mode_cmd === '2' && sgr_cmds.length > 2) {
|
342 |
+
let r = parseInt(sgr_cmds.shift(), 10);
|
343 |
+
let g = parseInt(sgr_cmds.shift(), 10);
|
344 |
+
let b = parseInt(sgr_cmds.shift(), 10);
|
345 |
+
if ((r >= 0 && r <= 255) && (g >= 0 && g <= 255) && (b >= 0 && b <= 255)) {
|
346 |
+
let c = { rgb: [r, g, b], class_name: 'truecolor' };
|
347 |
+
if (is_foreground)
|
348 |
+
this.fg = c;
|
349 |
+
else
|
350 |
+
this.bg = c;
|
351 |
+
}
|
352 |
+
}
|
353 |
+
}
|
354 |
+
}
|
355 |
+
}
|
356 |
+
}
|
357 |
+
transform_to_html(fragment) {
|
358 |
+
let txt = fragment.text;
|
359 |
+
if (txt.length === 0)
|
360 |
+
return txt;
|
361 |
+
txt = this.escape_txt_for_html(txt);
|
362 |
+
if (!fragment.bold && !fragment.italic && !fragment.underline && fragment.fg === null && fragment.bg === null)
|
363 |
+
return txt;
|
364 |
+
let styles = [];
|
365 |
+
let classes = [];
|
366 |
+
let fg = fragment.fg;
|
367 |
+
let bg = fragment.bg;
|
368 |
+
if (fragment.bold)
|
369 |
+
styles.push(this._boldStyle);
|
370 |
+
if (fragment.faint)
|
371 |
+
styles.push(this._faintStyle);
|
372 |
+
if (fragment.italic)
|
373 |
+
styles.push(this._italicStyle);
|
374 |
+
if (fragment.underline)
|
375 |
+
styles.push(this._underlineStyle);
|
376 |
+
if (!this._use_classes) {
|
377 |
+
if (fg)
|
378 |
+
styles.push(`color:rgb(${fg.rgb.join(',')})`);
|
379 |
+
if (bg)
|
380 |
+
styles.push(`background-color:rgb(${bg.rgb})`);
|
381 |
+
}
|
382 |
+
else {
|
383 |
+
if (fg) {
|
384 |
+
if (fg.class_name !== 'truecolor') {
|
385 |
+
classes.push(`${fg.class_name}-fg`);
|
386 |
+
}
|
387 |
+
else {
|
388 |
+
styles.push(`color:rgb(${fg.rgb.join(',')})`);
|
389 |
+
}
|
390 |
+
}
|
391 |
+
if (bg) {
|
392 |
+
if (bg.class_name !== 'truecolor') {
|
393 |
+
classes.push(`${bg.class_name}-bg`);
|
394 |
+
}
|
395 |
+
else {
|
396 |
+
styles.push(`background-color:rgb(${bg.rgb.join(',')})`);
|
397 |
+
}
|
398 |
+
}
|
399 |
+
}
|
400 |
+
let class_string = '';
|
401 |
+
let style_string = '';
|
402 |
+
if (classes.length)
|
403 |
+
class_string = ` class="${classes.join(' ')}"`;
|
404 |
+
if (styles.length)
|
405 |
+
style_string = ` style="${styles.join(';')}"`;
|
406 |
+
return `<span${style_string}${class_string}>${txt}</span>`;
|
407 |
+
}
|
408 |
+
;
|
409 |
+
process_hyperlink(pkt) {
|
410 |
+
let parts = pkt.url.split(':');
|
411 |
+
if (parts.length < 1)
|
412 |
+
return '';
|
413 |
+
if (!this._url_allowlist[parts[0]])
|
414 |
+
return '';
|
415 |
+
let result = `<a href="${this.escape_txt_for_html(pkt.url)}">${this.escape_txt_for_html(pkt.text)}</a>`;
|
416 |
+
return result;
|
417 |
+
}
|
418 |
+
}
|
419 |
+
function rgx(tmplObj, ...subst) {
|
420 |
+
let regexText = tmplObj.raw[0];
|
421 |
+
let wsrgx = /^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;
|
422 |
+
let txt2 = regexText.replace(wsrgx, '');
|
423 |
+
return new RegExp(txt2);
|
424 |
+
}
|
425 |
+
function rgxG(tmplObj, ...subst) {
|
426 |
+
let regexText = tmplObj.raw[0];
|
427 |
+
let wsrgx = /^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;
|
428 |
+
let txt2 = regexText.replace(wsrgx, '');
|
429 |
+
return new RegExp(txt2, 'g');
|
430 |
+
}
|
431 |
+
var templateObject_1, templateObject_2, templateObject_3;
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/ansi_up.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"ansi_up.js","sourceRoot":"","sources":["ansi_up.ts"],"names":[],"mappings":"AAMA,YAAY,CAAC;;;;;AA0Bb,IAAK,UAQJ;AARD,WAAK,UAAU;IACX,yCAAG,CAAA;IACH,2CAAI,CAAA;IACJ,uDAAU,CAAA;IACV,yCAAG,CAAA;IACH,iDAAO,CAAA;IACP,yCAAG,CAAA;IACH,+CAAM,CAAA;AACV,CAAC,E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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ansi_up.js
|
2 |
+
* author : Dru Nelson
|
3 |
+
* license : MIT
|
4 |
+
* http://github.com/drudru/ansi_up
|
5 |
+
*/
|
6 |
+
|
7 |
+
"use strict";
|
8 |
+
|
9 |
+
//
|
10 |
+
// INTERFACES
|
11 |
+
//
|
12 |
+
|
13 |
+
interface AU_Color
|
14 |
+
{
|
15 |
+
rgb:number[];
|
16 |
+
class_name:string;
|
17 |
+
}
|
18 |
+
|
19 |
+
// Represents the output of process_ansi(): a snapshot of the AnsiUp state machine
|
20 |
+
// at a given point in time, which wraps a fragment of text. This would allow deferred
|
21 |
+
// processing of text fragments and colors, if ever needed.
|
22 |
+
interface TextWithAttr {
|
23 |
+
fg:AU_Color;
|
24 |
+
bg:AU_Color;
|
25 |
+
bold:boolean;
|
26 |
+
faint:boolean;
|
27 |
+
italic: boolean;
|
28 |
+
underline: boolean;
|
29 |
+
text:string;
|
30 |
+
}
|
31 |
+
|
32 |
+
// Used internally when breaking up the raw text into packets
|
33 |
+
|
34 |
+
enum PacketKind {
|
35 |
+
EOS,
|
36 |
+
Text,
|
37 |
+
Incomplete, // An Incomplete ESC sequence
|
38 |
+
ESC, // A single ESC char - random
|
39 |
+
Unknown, // A valid CSI but not an SGR code
|
40 |
+
SGR, // Select Graphic Rendition
|
41 |
+
OSCURL, // Operating System Command
|
42 |
+
}
|
43 |
+
|
44 |
+
interface TextPacket {
|
45 |
+
kind:PacketKind;
|
46 |
+
text:string;
|
47 |
+
url:string;
|
48 |
+
}
|
49 |
+
|
50 |
+
//
|
51 |
+
// MAIN CLASS
|
52 |
+
//
|
53 |
+
|
54 |
+
export class AnsiUp
|
55 |
+
{
|
56 |
+
VERSION = "6.0.2";
|
57 |
+
|
58 |
+
//
|
59 |
+
// *** SEE README ON GITHUB FOR PUBLIC API ***
|
60 |
+
//
|
61 |
+
|
62 |
+
// 256 Colors Palette
|
63 |
+
// CSS RGB strings - ex. "255, 255, 255"
|
64 |
+
private ansi_colors:AU_Color[][];
|
65 |
+
private palette_256:AU_Color[];
|
66 |
+
|
67 |
+
private fg:AU_Color;
|
68 |
+
private bg:AU_Color;
|
69 |
+
private bold:boolean;
|
70 |
+
private faint:boolean;
|
71 |
+
private italic: boolean;
|
72 |
+
private underline:boolean;
|
73 |
+
private _use_classes:boolean;
|
74 |
+
|
75 |
+
private _csi_regex:RegExp;
|
76 |
+
|
77 |
+
private _osc_st:RegExp;
|
78 |
+
private _osc_regex:RegExp;
|
79 |
+
|
80 |
+
private _url_allowlist:{};
|
81 |
+
private _escape_html:boolean;
|
82 |
+
|
83 |
+
private _buffer:string;
|
84 |
+
|
85 |
+
private _boldStyle:string;
|
86 |
+
private _faintStyle:string;
|
87 |
+
private _italicStyle:string;
|
88 |
+
private _underlineStyle:string;
|
89 |
+
|
90 |
+
|
91 |
+
constructor()
|
92 |
+
{
|
93 |
+
// All construction occurs here
|
94 |
+
this.setup_palettes();
|
95 |
+
this._use_classes = false;
|
96 |
+
|
97 |
+
this.bold = false;
|
98 |
+
this.faint = false;
|
99 |
+
this.italic = false;
|
100 |
+
this.underline = false;
|
101 |
+
this.fg = this.bg = null;
|
102 |
+
|
103 |
+
this._buffer = '';
|
104 |
+
|
105 |
+
this._url_allowlist = { 'http':1, 'https':1 };
|
106 |
+
this._escape_html = true;
|
107 |
+
|
108 |
+
this.boldStyle = 'font-weight:bold';
|
109 |
+
this.faintStyle = 'opacity:0.7';
|
110 |
+
this.italicStyle = 'font-style:italic';
|
111 |
+
this.underlineStyle = 'text-decoration:underline'
|
112 |
+
}
|
113 |
+
|
114 |
+
set use_classes(arg:boolean)
|
115 |
+
{
|
116 |
+
this._use_classes = arg;
|
117 |
+
}
|
118 |
+
|
119 |
+
get use_classes():boolean
|
120 |
+
{
|
121 |
+
return this._use_classes;
|
122 |
+
}
|
123 |
+
|
124 |
+
set url_allowlist(arg:{})
|
125 |
+
{
|
126 |
+
this._url_allowlist = arg;
|
127 |
+
}
|
128 |
+
|
129 |
+
get url_allowlist():{}
|
130 |
+
{
|
131 |
+
return this._url_allowlist;
|
132 |
+
}
|
133 |
+
|
134 |
+
set escape_html(arg:boolean)
|
135 |
+
{
|
136 |
+
this._escape_html = arg;
|
137 |
+
}
|
138 |
+
|
139 |
+
get escape_html():boolean
|
140 |
+
{
|
141 |
+
return this._escape_html;
|
142 |
+
}
|
143 |
+
|
144 |
+
set boldStyle(arg:string) { this._boldStyle = arg; }
|
145 |
+
get boldStyle():string { return this._boldStyle; }
|
146 |
+
set faintStyle(arg:string) { this._faintStyle = arg; }
|
147 |
+
get faintStyle():string { return this._faintStyle; }
|
148 |
+
set italicStyle(arg:string) { this._italicStyle = arg; }
|
149 |
+
get italicStyle():string { return this._italicStyle; }
|
150 |
+
set underlineStyle(arg:string) { this._underlineStyle = arg; }
|
151 |
+
get underlineStyle():string { return this._underlineStyle; }
|
152 |
+
|
153 |
+
|
154 |
+
private setup_palettes():void
|
155 |
+
{
|
156 |
+
this.ansi_colors =
|
157 |
+
[
|
158 |
+
// Normal colors
|
159 |
+
[
|
160 |
+
{ rgb: [ 0, 0, 0], class_name: "ansi-black" },
|
161 |
+
{ rgb: [187, 0, 0], class_name: "ansi-red" },
|
162 |
+
{ rgb: [ 0, 187, 0], class_name: "ansi-green" },
|
163 |
+
{ rgb: [187, 187, 0], class_name: "ansi-yellow" },
|
164 |
+
{ rgb: [ 0, 0, 187], class_name: "ansi-blue" },
|
165 |
+
{ rgb: [187, 0, 187], class_name: "ansi-magenta" },
|
166 |
+
{ rgb: [ 0, 187, 187], class_name: "ansi-cyan" },
|
167 |
+
{ rgb: [255, 255, 255], class_name: "ansi-white" }
|
168 |
+
],
|
169 |
+
|
170 |
+
// Bright colors
|
171 |
+
[
|
172 |
+
{ rgb: [ 85, 85, 85], class_name: "ansi-bright-black" },
|
173 |
+
{ rgb: [255, 85, 85], class_name: "ansi-bright-red" },
|
174 |
+
{ rgb: [ 0, 255, 0], class_name: "ansi-bright-green" },
|
175 |
+
{ rgb: [255, 255, 85], class_name: "ansi-bright-yellow" },
|
176 |
+
{ rgb: [ 85, 85, 255], class_name: "ansi-bright-blue" },
|
177 |
+
{ rgb: [255, 85, 255], class_name: "ansi-bright-magenta" },
|
178 |
+
{ rgb: [ 85, 255, 255], class_name: "ansi-bright-cyan" },
|
179 |
+
{ rgb: [255, 255, 255], class_name: "ansi-bright-white" }
|
180 |
+
]
|
181 |
+
];
|
182 |
+
|
183 |
+
this.palette_256 = [];
|
184 |
+
|
185 |
+
// Index 0..15 : Ansi-Colors
|
186 |
+
this.ansi_colors.forEach( palette => {
|
187 |
+
palette.forEach( rec => {
|
188 |
+
this.palette_256.push(rec);
|
189 |
+
});
|
190 |
+
});
|
191 |
+
|
192 |
+
// Index 16..231 : RGB 6x6x6
|
193 |
+
// https://gist.github.com/jasonm23/2868981#file-xterm-256color-yaml
|
194 |
+
let levels = [0, 95, 135, 175, 215, 255];
|
195 |
+
for (let r = 0; r < 6; ++r) {
|
196 |
+
for (let g = 0; g < 6; ++g) {
|
197 |
+
for (let b = 0; b < 6; ++b) {
|
198 |
+
let col = {rgb:[levels[r], levels[g], levels[b]], class_name:'truecolor'};
|
199 |
+
this.palette_256.push(col);
|
200 |
+
}
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
// Index 232..255 : Grayscale
|
205 |
+
let grey_level = 8;
|
206 |
+
for (let i = 0; i < 24; ++i, grey_level += 10) {
|
207 |
+
let gry = {rgb:[grey_level, grey_level, grey_level], class_name:'truecolor'};
|
208 |
+
this.palette_256.push(gry);
|
209 |
+
}
|
210 |
+
}
|
211 |
+
|
212 |
+
private escape_txt_for_html(txt:string):string
|
213 |
+
{
|
214 |
+
if (!this._escape_html)
|
215 |
+
return txt;
|
216 |
+
return txt.replace(/[&<>"']/gm, (str) => {
|
217 |
+
if (str === "&") return "&";
|
218 |
+
if (str === "<") return "<";
|
219 |
+
if (str === ">") return ">";
|
220 |
+
if (str === "\"") return """;
|
221 |
+
if (str === "'") return "'";
|
222 |
+
});
|
223 |
+
}
|
224 |
+
|
225 |
+
private append_buffer(txt:string) {
|
226 |
+
|
227 |
+
var str = this._buffer + txt;
|
228 |
+
this._buffer = str;
|
229 |
+
}
|
230 |
+
|
231 |
+
private get_next_packet():TextPacket {
|
232 |
+
|
233 |
+
var pkt =
|
234 |
+
{
|
235 |
+
kind: PacketKind.EOS,
|
236 |
+
text: '',
|
237 |
+
url: ''
|
238 |
+
} ;
|
239 |
+
|
240 |
+
var len = this._buffer.length;
|
241 |
+
if (len == 0)
|
242 |
+
return pkt;
|
243 |
+
|
244 |
+
var pos = this._buffer.indexOf("\x1B");
|
245 |
+
|
246 |
+
// The most common case, no ESC codes
|
247 |
+
if (pos == -1)
|
248 |
+
{
|
249 |
+
pkt.kind = PacketKind.Text;
|
250 |
+
pkt.text = this._buffer;
|
251 |
+
this._buffer = '';
|
252 |
+
return pkt;
|
253 |
+
}
|
254 |
+
|
255 |
+
if (pos > 0)
|
256 |
+
{
|
257 |
+
pkt.kind = PacketKind.Text;
|
258 |
+
pkt.text = this._buffer.slice(0, pos);
|
259 |
+
this._buffer = this._buffer.slice(pos);
|
260 |
+
return pkt;
|
261 |
+
}
|
262 |
+
|
263 |
+
// NOW WE HANDLE ESCAPES
|
264 |
+
if (pos == 0)
|
265 |
+
{
|
266 |
+
// All of the sequences typically need at least 3 characters
|
267 |
+
// So, wait until we have at least that many
|
268 |
+
if (len < 3)
|
269 |
+
{
|
270 |
+
pkt.kind = PacketKind.Incomplete;
|
271 |
+
return pkt;
|
272 |
+
}
|
273 |
+
|
274 |
+
var next_char = this._buffer.charAt(1);
|
275 |
+
|
276 |
+
// We treat this as a single ESC
|
277 |
+
// No transformation
|
278 |
+
if ((next_char != '[') && (next_char != ']') && (next_char != '('))
|
279 |
+
{
|
280 |
+
pkt.kind = PacketKind.ESC;
|
281 |
+
pkt.text = this._buffer.slice(0, 1);
|
282 |
+
this._buffer = this._buffer.slice(1);
|
283 |
+
return pkt;
|
284 |
+
}
|
285 |
+
|
286 |
+
// OK is this an SGR or OSC that we handle
|
287 |
+
|
288 |
+
// SGR CHECK
|
289 |
+
if (next_char == '[')
|
290 |
+
{
|
291 |
+
// We do this regex initialization here so
|
292 |
+
// we can keep the regex close to its use (Readability)
|
293 |
+
|
294 |
+
// All ansi codes are typically in the following format.
|
295 |
+
// We parse it and focus specifically on the
|
296 |
+
// graphics commands (SGR)
|
297 |
+
//
|
298 |
+
// CONTROL-SEQUENCE-INTRODUCER CSI (ESC, '[')
|
299 |
+
// PRIVATE-MODE-CHAR (!, <, >, ?)
|
300 |
+
// Numeric parameters separated by semicolons ('0' - '9', ';')
|
301 |
+
// Intermediate-modifiers (0x20 - 0x2f)
|
302 |
+
// COMMAND-CHAR (0x40 - 0x7e)
|
303 |
+
//
|
304 |
+
|
305 |
+
if (!this._csi_regex) {
|
306 |
+
|
307 |
+
this._csi_regex = rgx`
|
308 |
+
^ # beginning of line
|
309 |
+
#
|
310 |
+
# First attempt
|
311 |
+
(?: # legal sequence
|
312 |
+
\x1b\[ # CSI
|
313 |
+
([\x3c-\x3f]?) # private-mode char
|
314 |
+
([\d;]*) # any digits or semicolons
|
315 |
+
([\x20-\x2f]? # an intermediate modifier
|
316 |
+
[\x40-\x7e]) # the command
|
317 |
+
)
|
318 |
+
| # alternate (second attempt)
|
319 |
+
(?: # illegal sequence
|
320 |
+
\x1b\[ # CSI
|
321 |
+
[\x20-\x7e]* # anything legal
|
322 |
+
([\x00-\x1f:]) # anything illegal
|
323 |
+
)
|
324 |
+
`;
|
325 |
+
}
|
326 |
+
|
327 |
+
let match = this._buffer.match(this._csi_regex);
|
328 |
+
|
329 |
+
// This match is guaranteed to terminate (even on
|
330 |
+
// invalid input). The key is to match on legal and
|
331 |
+
// illegal sequences.
|
332 |
+
// The first alternate matches everything legal and
|
333 |
+
// the second matches everything illegal.
|
334 |
+
//
|
335 |
+
// If it doesn't match, then we have not received
|
336 |
+
// either the full sequence or an illegal sequence.
|
337 |
+
// If it does match, the presence of field 4 tells
|
338 |
+
// us whether it was legal or illegal.
|
339 |
+
|
340 |
+
if (match === null)
|
341 |
+
{
|
342 |
+
pkt.kind = PacketKind.Incomplete;
|
343 |
+
return pkt;
|
344 |
+
}
|
345 |
+
|
346 |
+
// match is an array
|
347 |
+
// 0 - total match
|
348 |
+
// 1 - private mode chars group
|
349 |
+
// 2 - digits and semicolons group
|
350 |
+
// 3 - command
|
351 |
+
// 4 - illegal char
|
352 |
+
|
353 |
+
if (match[4])
|
354 |
+
{
|
355 |
+
// Illegal sequence, just remove the ESC
|
356 |
+
pkt.kind = PacketKind.ESC;
|
357 |
+
pkt.text = this._buffer.slice(0, 1);
|
358 |
+
this._buffer = this._buffer.slice(1);
|
359 |
+
return pkt;
|
360 |
+
}
|
361 |
+
|
362 |
+
// If not a valid SGR, we don't handle
|
363 |
+
if ( (match[1] != '') || (match[3] != 'm'))
|
364 |
+
pkt.kind = PacketKind.Unknown;
|
365 |
+
else
|
366 |
+
pkt.kind = PacketKind.SGR;
|
367 |
+
|
368 |
+
pkt.text = match[2] // Just the parameters
|
369 |
+
|
370 |
+
var rpos = match[0].length;
|
371 |
+
this._buffer = this._buffer.slice(rpos);
|
372 |
+
return pkt;
|
373 |
+
}
|
374 |
+
else
|
375 |
+
// OSC CHECK
|
376 |
+
if (next_char == ']')
|
377 |
+
{
|
378 |
+
if (len < 4)
|
379 |
+
{
|
380 |
+
pkt.kind = PacketKind.Incomplete;
|
381 |
+
return pkt;
|
382 |
+
}
|
383 |
+
|
384 |
+
if ( (this._buffer.charAt(2) != '8')
|
385 |
+
|| (this._buffer.charAt(3) != ';') )
|
386 |
+
{
|
387 |
+
// This is not a match, so we'll just treat it as ESC
|
388 |
+
pkt.kind = PacketKind.ESC;
|
389 |
+
pkt.text = this._buffer.slice(0, 1);
|
390 |
+
this._buffer = this._buffer.slice(1);
|
391 |
+
return pkt;
|
392 |
+
}
|
393 |
+
|
394 |
+
// We do this regex initialization here so
|
395 |
+
// we can keep the regex close to its use (Readability)
|
396 |
+
|
397 |
+
// Matching a Hyperlink OSC with a regex is difficult
|
398 |
+
// because Javascript's regex engine doesn't support
|
399 |
+
// 'partial match' support.
|
400 |
+
//
|
401 |
+
// Therefore, we require the system to match the
|
402 |
+
// string-terminator(ST) before attempting a match.
|
403 |
+
// Once we find it, we attempt the Hyperlink-Begin
|
404 |
+
// match.
|
405 |
+
// If that goes ok, we scan forward for the next
|
406 |
+
// ST.
|
407 |
+
// Finally, we try to match it all and return
|
408 |
+
// the sequence.
|
409 |
+
// Also, it is important to note that we consider
|
410 |
+
// certain control characters as an invalidation of
|
411 |
+
// the entire sequence.
|
412 |
+
|
413 |
+
// We do regex initializations here so
|
414 |
+
// we can keep the regex close to its use (Readability)
|
415 |
+
|
416 |
+
|
417 |
+
// STRING-TERMINATOR
|
418 |
+
// This is likely to terminate in most scenarios
|
419 |
+
// because it will terminate on a newline
|
420 |
+
|
421 |
+
if (!this._osc_st) {
|
422 |
+
|
423 |
+
this._osc_st = rgxG`
|
424 |
+
(?: # legal sequence
|
425 |
+
(\x1b\\) # ESC \
|
426 |
+
| # alternate
|
427 |
+
(\x07) # BEL (what xterm did)
|
428 |
+
)
|
429 |
+
| # alternate (second attempt)
|
430 |
+
( # illegal sequence
|
431 |
+
[\x00-\x06] # anything illegal
|
432 |
+
| # alternate
|
433 |
+
[\x08-\x1a] # anything illegal
|
434 |
+
| # alternate
|
435 |
+
[\x1c-\x1f] # anything illegal
|
436 |
+
)
|
437 |
+
`;
|
438 |
+
}
|
439 |
+
|
440 |
+
// VERY IMPORTANT
|
441 |
+
// We do a stateful regex match with exec.
|
442 |
+
// If the regex is global, and it used with 'exec',
|
443 |
+
// then it will search starting at the 'lastIndex'
|
444 |
+
// If it matches, the regex can be used again to
|
445 |
+
// find the next match.
|
446 |
+
this._osc_st.lastIndex = 0;
|
447 |
+
|
448 |
+
|
449 |
+
{
|
450 |
+
let match = this._osc_st.exec( this._buffer );
|
451 |
+
|
452 |
+
if (match === null)
|
453 |
+
{
|
454 |
+
pkt.kind = PacketKind.Incomplete;
|
455 |
+
return pkt;
|
456 |
+
}
|
457 |
+
|
458 |
+
// If an illegal character was found, bail on the match
|
459 |
+
if (match[3])
|
460 |
+
{
|
461 |
+
// Illegal sequence, just remove the ESC
|
462 |
+
pkt.kind = PacketKind.ESC;
|
463 |
+
pkt.text = this._buffer.slice(0, 1);
|
464 |
+
this._buffer = this._buffer.slice(1);
|
465 |
+
return pkt;
|
466 |
+
}
|
467 |
+
}
|
468 |
+
|
469 |
+
|
470 |
+
|
471 |
+
// OK - we might have the prefix and URI
|
472 |
+
// Lets start our search for the next ST
|
473 |
+
// past this index
|
474 |
+
|
475 |
+
{
|
476 |
+
let match = this._osc_st.exec( this._buffer );
|
477 |
+
|
478 |
+
if (match === null)
|
479 |
+
{
|
480 |
+
pkt.kind = PacketKind.Incomplete;
|
481 |
+
return pkt;
|
482 |
+
}
|
483 |
+
|
484 |
+
// If an illegal character was found, bail on the match
|
485 |
+
if (match[3])
|
486 |
+
{
|
487 |
+
// Illegal sequence, just remove the ESC
|
488 |
+
pkt.kind = PacketKind.ESC;
|
489 |
+
pkt.text = this._buffer.slice(0, 1);
|
490 |
+
this._buffer = this._buffer.slice(1);
|
491 |
+
return pkt;
|
492 |
+
}
|
493 |
+
}
|
494 |
+
|
495 |
+
// OK, at this point we should have a FULL match!
|
496 |
+
//
|
497 |
+
// Lets try to match that now
|
498 |
+
|
499 |
+
if (!this._osc_regex) {
|
500 |
+
|
501 |
+
this._osc_regex = rgx`
|
502 |
+
^ # beginning of line
|
503 |
+
#
|
504 |
+
\x1b\]8; # OSC Hyperlink
|
505 |
+
[\x20-\x3a\x3c-\x7e]* # params (excluding ;)
|
506 |
+
; # end of params
|
507 |
+
([\x21-\x7e]{0,512}) # URL capture
|
508 |
+
(?: # ST
|
509 |
+
(?:\x1b\\) # ESC \
|
510 |
+
| # alternate
|
511 |
+
(?:\x07) # BEL (what xterm did)
|
512 |
+
)
|
513 |
+
([\x20-\x7e]+) # TEXT capture
|
514 |
+
\x1b\]8;; # OSC Hyperlink End
|
515 |
+
(?: # ST
|
516 |
+
(?:\x1b\\) # ESC \
|
517 |
+
| # alternate
|
518 |
+
(?:\x07) # BEL (what xterm did)
|
519 |
+
)
|
520 |
+
`;
|
521 |
+
}
|
522 |
+
|
523 |
+
let match = this._buffer.match(this._osc_regex);
|
524 |
+
|
525 |
+
if (match === null)
|
526 |
+
{
|
527 |
+
// Illegal sequence, just remove the ESC
|
528 |
+
pkt.kind = PacketKind.ESC;
|
529 |
+
pkt.text = this._buffer.slice(0, 1);
|
530 |
+
this._buffer = this._buffer.slice(1);
|
531 |
+
return pkt;
|
532 |
+
}
|
533 |
+
|
534 |
+
// match is an array
|
535 |
+
// 0 - total match
|
536 |
+
// 1 - URL
|
537 |
+
// 2 - Text
|
538 |
+
|
539 |
+
// If a valid SGR
|
540 |
+
pkt.kind = PacketKind.OSCURL;
|
541 |
+
pkt.url = match[1];
|
542 |
+
pkt.text = match[2];
|
543 |
+
|
544 |
+
var rpos = match[0].length;
|
545 |
+
this._buffer = this._buffer.slice(rpos);
|
546 |
+
return pkt;
|
547 |
+
}
|
548 |
+
else
|
549 |
+
// Other ESC CHECK
|
550 |
+
if (next_char == '(')
|
551 |
+
{
|
552 |
+
// This specifies the character set, which
|
553 |
+
// should just be ignored
|
554 |
+
|
555 |
+
// We have at least 3, so drop the sequence
|
556 |
+
pkt.kind = PacketKind.Unknown;
|
557 |
+
this._buffer = this._buffer.slice(3);
|
558 |
+
return pkt;
|
559 |
+
}
|
560 |
+
}
|
561 |
+
}
|
562 |
+
|
563 |
+
ansi_to_html(txt:string):string {
|
564 |
+
|
565 |
+
this.append_buffer(txt);
|
566 |
+
|
567 |
+
var blocks:string[] = [];
|
568 |
+
|
569 |
+
while (true)
|
570 |
+
{
|
571 |
+
var packet = this.get_next_packet();
|
572 |
+
|
573 |
+
if ( (packet.kind == PacketKind.EOS)
|
574 |
+
|| (packet.kind == PacketKind.Incomplete) )
|
575 |
+
break;
|
576 |
+
|
577 |
+
//Drop single ESC or Unknown CSI
|
578 |
+
if ( (packet.kind == PacketKind.ESC)
|
579 |
+
|| (packet.kind == PacketKind.Unknown) )
|
580 |
+
continue;
|
581 |
+
|
582 |
+
if (packet.kind == PacketKind.Text)
|
583 |
+
blocks.push( this.transform_to_html(this.with_state(packet)) );
|
584 |
+
else
|
585 |
+
if (packet.kind == PacketKind.SGR)
|
586 |
+
this.process_ansi(packet);
|
587 |
+
else
|
588 |
+
if (packet.kind == PacketKind.OSCURL)
|
589 |
+
blocks.push( this.process_hyperlink(packet) );
|
590 |
+
}
|
591 |
+
|
592 |
+
return blocks.join("");
|
593 |
+
}
|
594 |
+
|
595 |
+
private with_state(pkt:TextPacket):TextWithAttr {
|
596 |
+
return { bold: this.bold, faint: this.faint, italic: this.italic, underline: this.underline, fg: this.fg, bg: this.bg, text: pkt.text };
|
597 |
+
}
|
598 |
+
|
599 |
+
private process_ansi(pkt:TextPacket)
|
600 |
+
{
|
601 |
+
// Ok - we have a valid "SGR" (Select Graphic Rendition)
|
602 |
+
|
603 |
+
let sgr_cmds = pkt.text.split(';');
|
604 |
+
|
605 |
+
// Each of these params affects the SGR state
|
606 |
+
|
607 |
+
// Why do we shift through the array instead of a forEach??
|
608 |
+
// ... because some commands consume the params that follow !
|
609 |
+
|
610 |
+
while (sgr_cmds.length > 0) {
|
611 |
+
let sgr_cmd_str = sgr_cmds.shift();
|
612 |
+
let num = parseInt(sgr_cmd_str, 10);
|
613 |
+
|
614 |
+
// TODO
|
615 |
+
// AT SOME POINT, JUST CONVERT TO A LOOKUP TABLE
|
616 |
+
if (isNaN(num) || num === 0) {
|
617 |
+
this.fg = null;
|
618 |
+
this.bg = null;
|
619 |
+
this.bold = false;
|
620 |
+
this.faint = false;
|
621 |
+
this.italic = false;
|
622 |
+
this.underline = false;
|
623 |
+
|
624 |
+
} else if (num === 1) { this.bold = true;
|
625 |
+
} else if (num === 2) { this.faint = true;
|
626 |
+
} else if (num === 3) { this.italic = true;
|
627 |
+
} else if (num === 4) { this.underline = true;
|
628 |
+
} else if (num === 21) { this.bold = false;
|
629 |
+
} else if (num === 22) { this.faint = false; this.bold = false;
|
630 |
+
} else if (num === 23) { this.italic = false;
|
631 |
+
} else if (num === 24) { this.underline = false;
|
632 |
+
|
633 |
+
} else if (num === 39) { this.fg = null;
|
634 |
+
} else if (num === 49) { this.bg = null;
|
635 |
+
|
636 |
+
} else if ((num >= 30) && (num < 38)) { this.fg = this.ansi_colors[0][(num - 30)];
|
637 |
+
} else if ((num >= 40) && (num < 48)) { this.bg = this.ansi_colors[0][(num - 40)];
|
638 |
+
} else if ((num >= 90) && (num < 98)) { this.fg = this.ansi_colors[1][(num - 90)];
|
639 |
+
} else if ((num >= 100) && (num < 108)) { this.bg = this.ansi_colors[1][(num - 100)];
|
640 |
+
|
641 |
+
} else if (num === 38 || num === 48) {
|
642 |
+
|
643 |
+
// extended set foreground/background color
|
644 |
+
|
645 |
+
// validate that param exists
|
646 |
+
if (sgr_cmds.length > 0) {
|
647 |
+
// extend color (38=fg, 48=bg)
|
648 |
+
let is_foreground = (num === 38);
|
649 |
+
|
650 |
+
let mode_cmd = sgr_cmds.shift();
|
651 |
+
|
652 |
+
// MODE '5' - 256 color palette
|
653 |
+
if (mode_cmd === '5' && sgr_cmds.length > 0) {
|
654 |
+
let palette_index = parseInt(sgr_cmds.shift(), 10);
|
655 |
+
if (palette_index >= 0 && palette_index <= 255) {
|
656 |
+
if (is_foreground)
|
657 |
+
this.fg = this.palette_256[palette_index];
|
658 |
+
else
|
659 |
+
this.bg = this.palette_256[palette_index];
|
660 |
+
}
|
661 |
+
}
|
662 |
+
|
663 |
+
// MODE '2' - True Color
|
664 |
+
if (mode_cmd === '2' && sgr_cmds.length > 2) {
|
665 |
+
let r = parseInt(sgr_cmds.shift(), 10);
|
666 |
+
let g = parseInt(sgr_cmds.shift(), 10);
|
667 |
+
let b = parseInt(sgr_cmds.shift(), 10);
|
668 |
+
|
669 |
+
if ((r >= 0 && r <= 255) && (g >= 0 && g <= 255) && (b >= 0 && b <= 255)) {
|
670 |
+
let c = { rgb: [r,g,b], class_name: 'truecolor'};
|
671 |
+
if (is_foreground)
|
672 |
+
this.fg = c;
|
673 |
+
else
|
674 |
+
this.bg = c;
|
675 |
+
}
|
676 |
+
}
|
677 |
+
}
|
678 |
+
}
|
679 |
+
}
|
680 |
+
}
|
681 |
+
|
682 |
+
private transform_to_html(fragment:TextWithAttr):string {
|
683 |
+
let txt = fragment.text;
|
684 |
+
|
685 |
+
if (txt.length === 0)
|
686 |
+
return txt;
|
687 |
+
|
688 |
+
txt = this.escape_txt_for_html(txt);
|
689 |
+
|
690 |
+
// If colors not set, default style is used
|
691 |
+
if (!fragment.bold && !fragment.italic && !fragment.underline && fragment.fg === null && fragment.bg === null)
|
692 |
+
return txt;
|
693 |
+
|
694 |
+
let styles:string[] = [];
|
695 |
+
let classes:string[] = [];
|
696 |
+
|
697 |
+
let fg = fragment.fg;
|
698 |
+
let bg = fragment.bg;
|
699 |
+
|
700 |
+
// Note on bold: https://stackoverflow.com/questions/6737005/what-are-some-advantages-to-using-span-style-font-weightbold-rather-than-b?rq=1
|
701 |
+
if (fragment.bold) styles.push(this._boldStyle);
|
702 |
+
if (fragment.faint) styles.push(this._faintStyle);
|
703 |
+
if (fragment.italic) styles.push(this._italicStyle);
|
704 |
+
if (fragment.underline) styles.push(this._underlineStyle);
|
705 |
+
|
706 |
+
if (!this._use_classes) {
|
707 |
+
// USE INLINE STYLES
|
708 |
+
if (fg)
|
709 |
+
styles.push(`color:rgb(${fg.rgb.join(',')})`);
|
710 |
+
if (bg)
|
711 |
+
styles.push(`background-color:rgb(${bg.rgb})`);
|
712 |
+
} else {
|
713 |
+
// USE CLASSES
|
714 |
+
if (fg) {
|
715 |
+
if (fg.class_name !== 'truecolor') {
|
716 |
+
classes.push(`${fg.class_name}-fg`);
|
717 |
+
} else {
|
718 |
+
styles.push(`color:rgb(${fg.rgb.join(',')})`);
|
719 |
+
}
|
720 |
+
}
|
721 |
+
if (bg) {
|
722 |
+
if (bg.class_name !== 'truecolor') {
|
723 |
+
classes.push(`${bg.class_name}-bg`);
|
724 |
+
} else {
|
725 |
+
styles.push(`background-color:rgb(${bg.rgb.join(',')})`);
|
726 |
+
}
|
727 |
+
}
|
728 |
+
}
|
729 |
+
|
730 |
+
let class_string = '';
|
731 |
+
let style_string = '';
|
732 |
+
|
733 |
+
if (classes.length)
|
734 |
+
class_string = ` class="${classes.join(' ')}"`;
|
735 |
+
|
736 |
+
if (styles.length)
|
737 |
+
style_string = ` style="${styles.join(';')}"`;
|
738 |
+
|
739 |
+
return `<span${style_string}${class_string}>${txt}</span>`;
|
740 |
+
};
|
741 |
+
|
742 |
+
private process_hyperlink(pkt:TextPacket):string
|
743 |
+
{
|
744 |
+
// Check URL scheme
|
745 |
+
let parts = pkt.url.split(':');
|
746 |
+
if (parts.length < 1)
|
747 |
+
return '';
|
748 |
+
|
749 |
+
if (! this._url_allowlist[parts[0]])
|
750 |
+
return '';
|
751 |
+
|
752 |
+
let result = `<a href="${this.escape_txt_for_html(pkt.url)}">${this.escape_txt_for_html(pkt.text)}</a>`;
|
753 |
+
return result;
|
754 |
+
}
|
755 |
+
}
|
756 |
+
|
757 |
+
//
|
758 |
+
// PRIVATE FUNCTIONS
|
759 |
+
//
|
760 |
+
|
761 |
+
// ES5 template string transformer
|
762 |
+
function rgx(tmplObj, ...subst) {
|
763 |
+
// Use the 'raw' value so we don't have to double backslash in a template string
|
764 |
+
let regexText:string = tmplObj.raw[0];
|
765 |
+
|
766 |
+
// Remove white-space and comments
|
767 |
+
let wsrgx = /^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;
|
768 |
+
let txt2 = regexText.replace(wsrgx, '');
|
769 |
+
return new RegExp(txt2);
|
770 |
+
}
|
771 |
+
|
772 |
+
// ES5 template string transformer
|
773 |
+
// Multi-Line On
|
774 |
+
function rgxG(tmplObj, ...subst) {
|
775 |
+
// Use the 'raw' value so we don't have to double backslash in a template string
|
776 |
+
let regexText:string = tmplObj.raw[0];
|
777 |
+
|
778 |
+
// Remove white-space and comments
|
779 |
+
let wsrgx = /^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;
|
780 |
+
let txt2 = regexText.replace(wsrgx, '');
|
781 |
+
return new RegExp(txt2, 'g');
|
782 |
+
}
|
783 |
+
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/browser.html
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html>
|
2 |
+
<head>
|
3 |
+
<style type="text/css">
|
4 |
+
pre {
|
5 |
+
margin: 0;
|
6 |
+
font-family: monaco, "Courier New", Courier, monospace;
|
7 |
+
line-height: 1.3;
|
8 |
+
background: black;
|
9 |
+
}
|
10 |
+
</style>
|
11 |
+
</head>
|
12 |
+
<body>
|
13 |
+
<pre id="console"></pre>
|
14 |
+
</body>
|
15 |
+
<script src="../ansi_up.js" type="text/javascript"></script>
|
16 |
+
<script type="text/javascript">
|
17 |
+
var ansi_up = new AnsiUp;
|
18 |
+
|
19 |
+
var txt = "\n\n\033[1;33;40m 33;40 \033[1;33;41m 33;41 \033[1;33;42m 33;42 \033[1;33;43m 33;43 \033[1;33;44m 33;44 \033[1;33;45m 33;45 \033[1;33;46m 33;46 \033[1m\033[0\n\n\033[1;33;42m >> Tests OK\n\n"
|
20 |
+
|
21 |
+
var html = ansi_up.ansi_to_html(txt);
|
22 |
+
|
23 |
+
var cdiv = document.getElementById("console");
|
24 |
+
|
25 |
+
cdiv.innerHTML = html;
|
26 |
+
|
27 |
+
</script>
|
28 |
+
</html>
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/browser_amd.html
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<html>
|
2 |
+
<head>
|
3 |
+
<style type="text/css">
|
4 |
+
pre {
|
5 |
+
margin: 0;
|
6 |
+
font-family: monaco, "Courier New", Courier, monospace;
|
7 |
+
line-height: 1.3;
|
8 |
+
background: black;
|
9 |
+
}
|
10 |
+
</style>
|
11 |
+
<script data-main="main.js" src="require.js"></script>
|
12 |
+
</head>
|
13 |
+
<body>
|
14 |
+
<pre id="console"></pre>
|
15 |
+
</body>
|
16 |
+
</html>
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/jquery-1.7.2.min.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! jQuery v1.7.2 jquery.com | jquery.org/license */
|
2 |
+
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
|
3 |
+
a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
|
4 |
+
.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/main.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// For browser_amd.html
|
2 |
+
require(['ansi_up',"jquery-1.7.2.min.js"], function(au) {
|
3 |
+
|
4 |
+
var a2h = new au.default;
|
5 |
+
|
6 |
+
var txt = "\n\n\033[1;33;40m 33;40 \033[1;33;41m 33;41 \033[1;33;42m 33;42 \033[1;33;43m 33;43 \033[1;33;44m 33;44 \033[1;33;45m 33;45 \033[1;33;46m 33;46 \033[1m\033[0\n\n\033[1;33;42m >> Tests OK\n\n"
|
7 |
+
|
8 |
+
$(function () {
|
9 |
+
|
10 |
+
$("#console").html( a2h.ansi_to_html(txt) );
|
11 |
+
|
12 |
+
});
|
13 |
+
|
14 |
+
});
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/require.js
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
RequireJS 2.1.0 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
|
3 |
+
Available via the MIT or new BSD license.
|
4 |
+
see: http://github.com/jrburke/requirejs for details
|
5 |
+
*/
|
6 |
+
var requirejs,require,define;
|
7 |
+
(function(U){function D(b){return M.call(b)==="[object Function]"}function E(b){return M.call(b)==="[object Array]"}function s(b,c){if(b){var d;for(d=0;d<b.length;d+=1)if(b[d]&&c(b[d],d,b))break}}function N(b,c){if(b){var d;for(d=b.length-1;d>-1;d-=1)if(b[d]&&c(b[d],d,b))break}}function F(b,c){for(var d in b)if(b.hasOwnProperty(d)&&c(b[d],d))break}function J(b,c,d,h){c&&F(c,function(c,j){if(d||!G.call(b,j))h&&typeof c!=="string"?(b[j]||(b[j]={}),J(b[j],c,d,h)):b[j]=c});return b}function q(b,c){return function(){return c.apply(b,
|
8 |
+
arguments)}}function V(b){if(!b)return b;var c=U;s(b.split("."),function(b){c=c[b]});return c}function H(b,c,d,h){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=h;if(d)c.originalError=d;return c}function aa(){if(I&&I.readyState==="interactive")return I;N(document.getElementsByTagName("script"),function(b){if(b.readyState==="interactive")return I=b});return I}var h,r,u,y,p,A,I,B,W,X,ba=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ca=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
|
9 |
+
Y=/\.js$/,da=/^\.\//;r=Object.prototype;var M=r.toString,G=r.hasOwnProperty,ea=Array.prototype.splice,v=!!(typeof window!=="undefined"&&navigator&&document),Z=!v&&typeof importScripts!=="undefined",fa=v&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,Q=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",w={},n={},O=[],K=!1;if(typeof define==="undefined"){if(typeof requirejs!=="undefined"){if(D(requirejs))return;n=requirejs;requirejs=void 0}typeof require!=="undefined"&&
|
10 |
+
!D(require)&&(n=require,require=void 0);h=requirejs=function(b,c,d,t){var g,j="_";!E(b)&&typeof b!=="string"&&(g=b,E(c)?(b=c,c=d,d=t):b=[]);if(g&&g.context)j=g.context;(t=w[j])||(t=w[j]=h.s.newContext(j));g&&t.configure(g);return t.require(b,c,d)};h.config=function(b){return h(b)};h.nextTick=typeof setTimeout!=="undefined"?function(b){setTimeout(b,4)}:function(b){b()};require||(require=h);h.version="2.1.0";h.jsExtRegExp=/^\/|:|\?|\.js$/;h.isBrowser=v;r=h.s={contexts:w,newContext:function(b){function c(a,
|
11 |
+
f,x){var e,b,k,c,d,i,g,h=f&&f.split("/");e=h;var j=m.map,l=j&&j["*"];if(a&&a.charAt(0)===".")if(f){e=m.pkgs[f]?h=[f]:h.slice(0,h.length-1);f=a=e.concat(a.split("/"));for(e=0;f[e];e+=1)if(b=f[e],b===".")f.splice(e,1),e-=1;else if(b==="..")if(e===1&&(f[2]===".."||f[0]===".."))break;else e>0&&(f.splice(e-1,2),e-=2);e=m.pkgs[f=a[0]];a=a.join("/");e&&a===f+"/"+e.main&&(a=f)}else a.indexOf("./")===0&&(a=a.substring(2));if(x&&(h||l)&&j){f=a.split("/");for(e=f.length;e>0;e-=1){k=f.slice(0,e).join("/");if(h)for(b=
|
12 |
+
h.length;b>0;b-=1)if(x=j[h.slice(0,b).join("/")])if(x=x[k]){c=x;d=e;break}if(c)break;!i&&l&&l[k]&&(i=l[k],g=e)}!c&&i&&(c=i,d=g);c&&(f.splice(0,d,c),a=f.join("/"))}return a}function d(a){v&&s(document.getElementsByTagName("script"),function(f){if(f.getAttribute("data-requiremodule")===a&&f.getAttribute("data-requirecontext")===i.contextName)return f.parentNode.removeChild(f),!0})}function t(a){var f=m.paths[a];if(f&&E(f)&&f.length>1)return d(a),f.shift(),i.require.undef(a),i.require([a]),!0}function g(a){var f,
|
13 |
+
b=a?a.indexOf("!"):-1;b>-1&&(f=a.substring(0,b),a=a.substring(b+1,a.length));return[f,a]}function j(a,f,b,e){var $,k,d=null,h=f?f.name:null,j=a,m=!0,l="";a||(m=!1,a="_@r"+(M+=1));a=g(a);d=a[0];a=a[1];d&&(d=c(d,h,e),k=o[d]);a&&(d?l=k&&k.normalize?k.normalize(a,function(a){return c(a,h,e)}):c(a,h,e):(l=c(a,h,e),a=g(l),d=a[0],l=a[1],b=!0,$=i.nameToUrl(l)));b=d&&!k&&!b?"_unnormalized"+(N+=1):"";return{prefix:d,name:l,parentMap:f,unnormalized:!!b,url:$,originalName:j,isDefine:m,id:(d?d+"!"+l:l)+b}}function n(a){var f=
|
14 |
+
a.id,b=l[f];b||(b=l[f]=new i.Module(a));return b}function p(a,f,b){var e=a.id,c=l[e];if(G.call(o,e)&&(!c||c.defineEmitComplete))f==="defined"&&b(o[e]);else n(a).on(f,b)}function z(a,f){var b=a.requireModules,e=!1;if(f)f(a);else if(s(b,function(f){if(f=l[f])f.error=a,f.events.error&&(e=!0,f.emit("error",a))}),!e)h.onError(a)}function r(){O.length&&(ea.apply(C,[C.length-1,0].concat(O)),O=[])}function u(a,f,b){var e=a.map.id;a.error?a.emit("error",a.error):(f[e]=!0,s(a.depMaps,function(e,k){var c=e.id,
|
15 |
+
d=l[c];d&&!a.depMatched[k]&&!b[c]&&(f[c]?(a.defineDep(k,o[c]),a.check()):u(d,f,b))}),b[e]=!0)}function w(){var a,f,b,e,c=(b=m.waitSeconds*1E3)&&i.startTime+b<(new Date).getTime(),k=[],h=[],g=!1,j=!0;if(!B){B=!0;F(l,function(b){a=b.map;f=a.id;if(b.enabled&&(a.isDefine||h.push(b),!b.error))if(!b.inited&&c)t(f)?g=e=!0:(k.push(f),d(f));else if(!b.inited&&b.fetched&&a.isDefine&&(g=!0,!a.prefix))return j=!1});if(c&&k.length)return b=H("timeout","Load timeout for modules: "+k,null,k),b.contextName=i.contextName,
|
16 |
+
z(b);j&&s(h,function(a){u(a,{},{})});if((!c||e)&&g)if((v||Z)&&!R)R=setTimeout(function(){R=0;w()},50);B=!1}}function y(a){n(j(a[0],null,!0)).init(a[1],a[2])}function A(a){var a=a.currentTarget||a.srcElement,b=i.onScriptLoad;a.detachEvent&&!Q?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=i.onScriptError;a.detachEvent&&!Q||a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}var B,S,i,L,R,m={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},
|
17 |
+
shim:{}},l={},T={},C=[],o={},P={},M=1,N=1;L={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?a.exports:a.exports=o[a.map.id]={}},module:function(a){return a.module?a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return m.config&&m.config[a.map.id]||{}},exports:o[a.map.id]}}};S=function(a){this.events=T[a.id]||{};this.map=a;this.shim=m.shim[a.id];this.depExports=[];this.depMaps=[];
|
18 |
+
this.depMatched=[];this.pluginMaps={};this.depCount=0};S.prototype={init:function(a,b,c,e){e=e||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=q(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=c;this.inited=!0;this.ignore=e.ignore;e.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=
|
19 |
+
!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],q(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=this.map.url;P[a]||(P[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var e=this.exports,d=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);
|
20 |
+
else{if(!this.defining){this.defining=!0;if(this.depCount<1&&!this.defined){if(D(d)){if(this.events.error)try{e=i.execCb(c,d,b,e)}catch(k){a=k}else e=i.execCb(c,d,b,e);if(this.map.isDefine)if((b=this.module)&&b.exports!==void 0&&b.exports!==this.exports)e=b.exports;else if(e===void 0&&this.usingExports)e=this.exports;if(a)return a.requireMap=this.map,a.requireModules=[this.map.id],a.requireType="define",z(this.error=a)}else e=d;this.exports=e;if(this.map.isDefine&&!this.ignore&&(o[c]=e,h.onResourceLoad))h.onResourceLoad(i,
|
21 |
+
this.map,this.depMaps);delete l[c];this.defined=!0}this.defining=!1;if(this.defined&&!this.defineEmitted)this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0}}else this.fetch()}},callPlugin:function(){var a=this.map,b=a.id,d=j(a.prefix);this.depMaps.push(d);p(d,"defined",q(this,function(e){var d,k;k=this.map.name;var x=this.map.parentMap?this.map.parentMap.name:null,g=i.makeRequire(a.parentMap,{enableBuildCallback:!0,skipMap:!0});if(this.map.unnormalized){if(e.normalize&&
|
22 |
+
(k=e.normalize(k,function(a){return c(a,x,!0)})||""),e=j(a.prefix+"!"+k,this.map.parentMap),p(e,"defined",q(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),k=l[e.id]){this.depMaps.push(e);if(this.events.error)k.on("error",q(this,function(a){this.emit("error",a)}));k.enable()}}else d=q(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),d.error=q(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];F(l,function(a){a.map.id.indexOf(b+
|
23 |
+
"_unnormalized")===0&&delete l[a.map.id]});z(a)}),d.fromText=q(this,function(b,e){var f=a.name,c=j(f),k=K;e&&(b=e);k&&(K=!1);n(c);try{h.exec(b)}catch(x){throw Error("fromText eval for "+f+" failed: "+x);}k&&(K=!0);this.depMaps.push(c);i.completeLoad(f);g([f],d)}),e.load(a.name,g,d,m)}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){this.enabling=this.enabled=!0;s(this.depMaps,q(this,function(a,b){var c,e;if(typeof a==="string"){a=j(a,this.map.isDefine?this.map:this.map.parentMap,!1,
|
24 |
+
!this.skipMap);this.depMaps[b]=a;if(c=L[a.id]){this.depExports[b]=c(this);return}this.depCount+=1;p(a,"defined",q(this,function(a){this.defineDep(b,a);this.check()}));this.errback&&p(a,"error",this.errback)}c=a.id;e=l[c];!L[c]&&e&&!e.enabled&&i.enable(a,this)}));F(this.pluginMaps,q(this,function(a){var b=l[a.id];b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){s(this.events[a],function(a){a(b)});
|
25 |
+
a==="error"&&delete this.events[a]}};i={config:m,contextName:b,registry:l,defined:o,urlFetched:P,defQueue:C,Module:S,makeModuleMap:j,nextTick:h.nextTick,configure:function(a){a.baseUrl&&a.baseUrl.charAt(a.baseUrl.length-1)!=="/"&&(a.baseUrl+="/");var b=m.pkgs,c=m.shim,e=m.paths,d=m.map;J(m,a,!0);m.paths=J(e,a.paths,!0);if(a.map)m.map=J(d||{},a.map,!0,!0);if(a.shim)F(a.shim,function(a,b){E(a)&&(a={deps:a});if(a.exports&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);c[b]=a}),m.shim=c;if(a.packages)s(a.packages,
|
26 |
+
function(a){a=typeof a==="string"?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||"main").replace(da,"").replace(Y,"")}}),m.pkgs=b;F(l,function(a,b){if(!a.inited&&!a.map.unnormalized)a.map=j(b)});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(U,arguments));return b||V(a.exports)}},makeRequire:function(a,f){function d(e,c,k){var g,m;if(f.enableBuildCallback&&c&&D(c))c.__requireJsBuild=!0;
|
27 |
+
if(typeof e==="string"){if(D(c))return z(H("requireargs","Invalid require call"),k);if(a&&L[e])return L[e](l[a.id]);if(h.get)return h.get(i,e,a);g=j(e,a,!1,!0);g=g.id;return!G.call(o,g)?z(H("notloaded",'Module name "'+g+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):o[g]}for(r();C.length;)if(g=C.shift(),g[0]===null)return z(H("mismatch","Mismatched anonymous define() module: "+g[g.length-1]));else y(g);i.nextTick(function(){m=n(j(null,a));m.skipMap=f.skipMap;m.init(e,c,k,
|
28 |
+
{enabled:!0});w()});return d}f=f||{};J(d,{isBrowser:v,toUrl:function(b){var f=b.lastIndexOf("."),d=null;f!==-1&&(d=b.substring(f,b.length),b=b.substring(0,f));return i.nameToUrl(c(b,a&&a.id,!0),d)},defined:function(b){b=j(b,a,!1,!0).id;return G.call(o,b)},specified:function(b){b=j(b,a,!1,!0).id;return G.call(o,b)||G.call(l,b)}});if(!a)d.undef=function(b){r();var c=j(b,a,!0),f=l[b];delete o[b];delete P[c.url];delete T[b];if(f){if(f.events.defined)T[b]=f.events;delete l[b]}};return d},enable:function(a){l[a.id]&&
|
29 |
+
n(a).enable()},completeLoad:function(a){var b,c,e=m.shim[a]||{},d=e.exports;for(r();C.length;){c=C.shift();if(c[0]===null){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);y(c)}c=l[a];if(!b&&!o[a]&&c&&!c.inited)if(m.enforceDefine&&(!d||!V(d)))if(t(a))return;else return z(H("nodefine","No define call for "+a,null,[a]));else y([a,e.deps||[],e.exportsFn]);w()},nameToUrl:function(a,b){var c,e,d,g,i,j;if(h.jsExtRegExp.test(a))g=a+(b||"");else{c=m.paths;e=m.pkgs;g=a.split("/");for(i=g.length;i>0;i-=1)if(j=
|
30 |
+
g.slice(0,i).join("/"),d=e[j],j=c[j]){E(j)&&(j=j[0]);g.splice(0,i,j);break}else if(d){c=a===d.name?d.location+"/"+d.main:d.location;g.splice(0,i,c);break}g=g.join("/");g+=b||(/\?/.test(g)?"":".js");g=(g.charAt(0)==="/"||g.match(/^[\w\+\.\-]+:/)?"":m.baseUrl)+g}return m.urlArgs?g+((g.indexOf("?")===-1?"?":"&")+m.urlArgs):g},load:function(a,b){h.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if(a.type==="load"||fa.test((a.currentTarget||a.srcElement).readyState))I=
|
31 |
+
null,a=A(a),i.completeLoad(a.id)},onScriptError:function(a){var b=A(a);if(!t(b.id))return z(H("scripterror","Script error",a,[b.id]))}};i.require=i.makeRequire();return i}};h({});s(["toUrl","undef","defined","specified"],function(b){h[b]=function(){var c=w._;return c.require[b].apply(c,arguments)}});if(v&&(u=r.head=document.getElementsByTagName("head")[0],y=document.getElementsByTagName("base")[0]))u=r.head=y.parentNode;h.onError=function(b){throw b;};h.load=function(b,c,d){var h=b&&b.config||{},
|
32 |
+
g;if(v)return g=h.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),g.type=h.scriptType||"text/javascript",g.charset="utf-8",g.async=!0,g.setAttribute("data-requirecontext",b.contextName),g.setAttribute("data-requiremodule",c),g.attachEvent&&!(g.attachEvent.toString&&g.attachEvent.toString().indexOf("[native code")<0)&&!Q?(K=!0,g.attachEvent("onreadystatechange",b.onScriptLoad)):(g.addEventListener("load",b.onScriptLoad,!1),g.addEventListener("error",
|
33 |
+
b.onScriptError,!1)),g.src=d,B=g,y?u.insertBefore(g,y):u.appendChild(g),B=null,g;else Z&&(importScripts(d),b.completeLoad(c))};v&&N(document.getElementsByTagName("script"),function(b){if(!u)u=b.parentNode;if(p=b.getAttribute("data-main")){if(!n.baseUrl)A=p.split("/"),W=A.pop(),X=A.length?A.join("/")+"/":"./",n.baseUrl=X,p=W;p=p.replace(Y,"");n.deps=n.deps?n.deps.concat(p):[p];return!0}});define=function(b,c,d){var h,g;typeof b!=="string"&&(d=c,c=b,b=null);E(c)||(d=c,c=[]);!c.length&&D(d)&&d.length&&
|
34 |
+
(d.toString().replace(ba,"").replace(ca,function(b,d){c.push(d)}),c=(d.length===1?["require"]:["require","exports","module"]).concat(c));if(K&&(h=B||aa()))b||(b=h.getAttribute("data-requiremodule")),g=w[h.getAttribute("data-requirecontext")];(g?g.defQueue:O).push([b,c,d])};define.amd={jQuery:!0};h.exec=function(b){return eval(b)};h(n)}})(this);
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/theme.css
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Tomorrow Night Ansi Colour Scheme
|
2 |
+
.tomorrow-night-eighties-ansi-theme.ansi-black-fg { color: #3A3A3A; }
|
3 |
+
.tomorrow-night-eighties-ansi-theme.ansi-red-fg { color: #DD948E; }
|
4 |
+
.tomorrow-night-eighties-ansi-theme.ansi-green-fg { color: #B6D1AA; }
|
5 |
+
.tomorrow-night-eighties-ansi-theme.ansi-yellow-fg { color: #F3D57C; }
|
6 |
+
.tomorrow-night-eighties-ansi-theme.ansi-blue-fg { color: #8AA9D5; }
|
7 |
+
.tomorrow-night-eighties-ansi-theme.ansi-magenta-fg { color: #CBAFD5; }
|
8 |
+
.tomorrow-night-eighties-ansi-theme.ansi-cyan-fg { color: #9AD1D4; }
|
9 |
+
.tomorrow-night-eighties-ansi-theme.ansi-white-fg { color: #EFEFEF; }
|
10 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-black-fg { color: #5E5D5E; }
|
11 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-red-fg { color: #E69B94; }
|
12 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-green-fg { color: #D1F0C3; }
|
13 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-yellow-fg { color: #F4D799; }
|
14 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-blue-fg { color: #A6CBFE; }
|
15 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-magenta-fg { color: #E7C7F2; }
|
16 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-cyan-fg { color: #B0F0F5; }
|
17 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-white-fg { color: #FFF; }
|
18 |
+
|
19 |
+
.tomorrow-night-eighties-ansi-theme.ansi-black-bg { background-color: #3A3A3A; }
|
20 |
+
.tomorrow-night-eighties-ansi-theme.ansi-red-bg { background-color: #DD948E; }
|
21 |
+
.tomorrow-night-eighties-ansi-theme.ansi-green-bg { background-color: #B6D1AA; }
|
22 |
+
.tomorrow-night-eighties-ansi-theme.ansi-yellow-bg { background-color: #F3D57C; }
|
23 |
+
.tomorrow-night-eighties-ansi-theme.ansi-blue-bg { background-color: #8AA9D5; }
|
24 |
+
.tomorrow-night-eighties-ansi-theme.ansi-magenta-bg { background-color: #CBAFD5; }
|
25 |
+
.tomorrow-night-eighties-ansi-theme.ansi-cyan-bg { background-color: #9AD1D4; }
|
26 |
+
.tomorrow-night-eighties-ansi-theme.ansi-white-bg { background-color: #EFEFEF; }
|
27 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-black-bg { background-color: #5E5D5E; }
|
28 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-red-bg { background-color: #E69B94; }
|
29 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-green-bg { background-color: #D1F0C3; }
|
30 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-yellow-bg { background-color: #F4D799; }
|
31 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-blue-bg { background-color: #A6CBFE; }
|
32 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-magenta-bg { background-color: #E7C7F2; }
|
33 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-cyan-bg { background-color: #B0F0F5; }
|
34 |
+
.tomorrow-night-eighties-ansi-theme.ansi-bright-white-bg { background-color: #FFF; }
|
Yunzai/plugins/TRSS-Plugin/node_modules/ansi_up/examples/theme.scss
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Tomorrow Night Ansi Colour Scheme
|
2 |
+
|
3 |
+
.tomorrow-night-eighties-ansi-theme {
|
4 |
+
|
5 |
+
.ansi-black-fg {
|
6 |
+
color: #3A3A3A;
|
7 |
+
}
|
8 |
+
|
9 |
+
.ansi-red-fg {
|
10 |
+
color: #DD948E;
|
11 |
+
}
|
12 |
+
|
13 |
+
.ansi-green-fg {
|
14 |
+
color: #B6D1AA;
|
15 |
+
}
|
16 |
+
|
17 |
+
.ansi-yellow-fg {
|
18 |
+
color: #F3D57C;
|
19 |
+
}
|
20 |
+
|
21 |
+
.ansi-blue-fg {
|
22 |
+
color: #8AA9D5;
|
23 |
+
}
|
24 |
+
|
25 |
+
.ansi-magenta-fg {
|
26 |
+
color: #CBAFD5;
|
27 |
+
}
|
28 |
+
|
29 |
+
.ansi-cyan-fg {
|
30 |
+
color: #9AD1D4;
|
31 |
+
}
|
32 |
+
|
33 |
+
.ansi-white-fg {
|
34 |
+
color: #EFEFEF;
|
35 |
+
}
|
36 |
+
|
37 |
+
.ansi-bright-black-fg {
|
38 |
+
color: #5E5D5E;
|
39 |
+
}
|
40 |
+
|
41 |
+
.ansi-bright-red-fg {
|
42 |
+
color: #E69B94;
|
43 |
+
}
|
44 |
+
|
45 |
+
.ansi-bright-green-fg {
|
46 |
+
color: #D1F0C3;
|
47 |
+
}
|
48 |
+
|
49 |
+
.ansi-bright-yellow-fg {
|
50 |
+
color: #F4D799;
|
51 |
+
}
|
52 |
+
|
53 |
+
.ansi-bright-blue-fg {
|
54 |
+
color: #A6CBFE;
|
55 |
+
}
|
56 |
+
|
57 |
+
.ansi-bright-magenta-fg {
|
58 |
+
color: #E7C7F2;
|
59 |
+
}
|
60 |
+
|
61 |
+
.ansi-bright-cyan-fg {
|
62 |
+
color: #B0F0F5;
|
63 |
+
}
|
64 |
+
|
65 |
+
.ansi-bright-white-fg {
|
66 |
+
color: #FFF;
|
67 |
+
}
|
68 |
+
|
69 |
+
.ansi-black-bg {
|
70 |
+
background-color: #3A3A3A;
|
71 |
+
}
|
72 |
+
|
73 |
+
.ansi-red-bg {
|
74 |
+
background-color: #DD948E;
|
75 |
+
}
|
76 |
+
|
77 |
+
.ansi-green-bg {
|
78 |
+
background-color: #B6D1AA;
|
79 |
+
}
|
80 |
+
|
81 |
+
.ansi-yellow-bg {
|
82 |
+
background-color: #F3D57C;
|
83 |
+
}
|
84 |
+
|
85 |
+
.ansi-blue-bg {
|
86 |
+
background-color: #8AA9D5;
|
87 |
+
}
|
88 |
+
|
89 |
+
.ansi-magenta-bg {
|
90 |
+
background-color: #CBAFD5;
|
91 |
+
}
|
92 |
+
|
93 |
+
.ansi-cyan-bg {
|
94 |
+
background-color: #9AD1D4;
|
95 |
+
}
|
96 |
+
|
97 |
+
.ansi-white-bg {
|
98 |
+
background-color: #EFEFEF;
|
99 |
+
}
|
100 |
+
|
101 |
+
.ansi-bright-black-bg {
|
102 |
+
background-color: #5E5D5E;
|
103 |
+
}
|
104 |
+
|
105 |
+
.ansi-bright-red-bg {
|
106 |
+
background-color: #E69B94;
|
107 |
+
}
|
108 |
+
|
109 |
+
.ansi-bright-green-bg {
|
110 |
+
background-color: #D1F0C3;
|
111 |
+
}
|
112 |
+
|
113 |
+
.ansi-bright-yellow-bg {
|
114 |
+
background-color: #F4D799;
|
115 |
+
}
|
116 |
+
|
117 |
+
.ansi-bright-blue-bg {
|
118 |
+
background-color: #A6CBFE;
|
119 |
+
}
|
120 |
+
|
121 |
+
.ansi-bright-magenta-bg {
|
122 |
+
background-color: #E7C7F2;
|
123 |
+
}
|
124 |
+
|
125 |
+
.ansi-bright-cyan-bg {
|
126 |
+
background-color: #B0F0F5;
|
127 |
+
}
|
128 |
+
|
129 |
+
.ansi-bright-white-bg {
|
130 |
+
background-color: #FFF;
|
131 |
+
}
|
132 |
+
}
|