@spacex110/core 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/channel-manager.d.ts +276 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +485 -469
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api.ts +2 -2
- package/src/models.ts +5 -0
- package/src/providers.ts +11 -0
- package/src/strategies.ts +9 -6
- package/dist/index.umd.js +0 -16
- package/dist/index.umd.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -66,7 +66,7 @@ const na = {
|
|
|
66
66
|
video: { type: "video", label: "Video", labelZh: "视频", icon: "🎬" },
|
|
67
67
|
embedding: { type: "embedding", label: "Embedding", labelZh: "嵌入", icon: "📐" },
|
|
68
68
|
reasoning: { type: "reasoning", label: "Reasoning", labelZh: "推理", icon: "🧠" }
|
|
69
|
-
}, G = "https://registry.npmmirror.com/@lobehub/icons-static-svg/1.77.0/files/icons",
|
|
69
|
+
}, G = "https://registry.npmmirror.com/@lobehub/icons-static-svg/1.77.0/files/icons", M = {
|
|
70
70
|
OPENAI: "openai",
|
|
71
71
|
ANTHROPIC: "anthropic",
|
|
72
72
|
GEMINI: "gemini",
|
|
@@ -87,10 +87,11 @@ const na = {
|
|
|
87
87
|
OLLAMA: "ollama",
|
|
88
88
|
DOUBAO: "doubao",
|
|
89
89
|
MINIMAX: "minimax",
|
|
90
|
+
MINIMAX_CN: "minimax-cn",
|
|
90
91
|
CUSTOM: "custom"
|
|
91
92
|
}, re = {
|
|
92
|
-
[
|
|
93
|
-
id:
|
|
93
|
+
[M.OPENAI]: {
|
|
94
|
+
id: M.OPENAI,
|
|
94
95
|
name: "OpenAI",
|
|
95
96
|
baseUrl: "https://api.openai.com/v1",
|
|
96
97
|
needsApiKey: !0,
|
|
@@ -98,8 +99,8 @@ const na = {
|
|
|
98
99
|
supportsModelsApi: !0,
|
|
99
100
|
icon: `${G}/openai.svg`
|
|
100
101
|
},
|
|
101
|
-
[
|
|
102
|
-
id:
|
|
102
|
+
[M.ANTHROPIC]: {
|
|
103
|
+
id: M.ANTHROPIC,
|
|
103
104
|
name: "Anthropic (Claude)",
|
|
104
105
|
baseUrl: "https://api.anthropic.com/v1",
|
|
105
106
|
needsApiKey: !0,
|
|
@@ -107,8 +108,8 @@ const na = {
|
|
|
107
108
|
supportsModelsApi: !0,
|
|
108
109
|
icon: `${G}/anthropic.svg`
|
|
109
110
|
},
|
|
110
|
-
[
|
|
111
|
-
id:
|
|
111
|
+
[M.GEMINI]: {
|
|
112
|
+
id: M.GEMINI,
|
|
112
113
|
name: "Google Gemini",
|
|
113
114
|
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
|
|
114
115
|
needsApiKey: !0,
|
|
@@ -116,8 +117,8 @@ const na = {
|
|
|
116
117
|
supportsModelsApi: !0,
|
|
117
118
|
icon: `${G}/gemini.svg`
|
|
118
119
|
},
|
|
119
|
-
[
|
|
120
|
-
id:
|
|
120
|
+
[M.OPENROUTER]: {
|
|
121
|
+
id: M.OPENROUTER,
|
|
121
122
|
name: "OpenRouter",
|
|
122
123
|
baseUrl: "https://openrouter.ai/api/v1",
|
|
123
124
|
needsApiKey: !0,
|
|
@@ -125,8 +126,8 @@ const na = {
|
|
|
125
126
|
supportsModelsApi: !0,
|
|
126
127
|
icon: `${G}/openrouter.svg`
|
|
127
128
|
},
|
|
128
|
-
[
|
|
129
|
-
id:
|
|
129
|
+
[M.DEEPSEEK]: {
|
|
130
|
+
id: M.DEEPSEEK,
|
|
130
131
|
name: "DeepSeek",
|
|
131
132
|
baseUrl: "https://api.deepseek.com",
|
|
132
133
|
needsApiKey: !0,
|
|
@@ -134,8 +135,8 @@ const na = {
|
|
|
134
135
|
supportsModelsApi: !0,
|
|
135
136
|
icon: `${G}/deepseek.svg`
|
|
136
137
|
},
|
|
137
|
-
[
|
|
138
|
-
id:
|
|
138
|
+
[M.MOONSHOT]: {
|
|
139
|
+
id: M.MOONSHOT,
|
|
139
140
|
name: "Moonshot (Kimi)",
|
|
140
141
|
baseUrl: "https://api.moonshot.cn/v1",
|
|
141
142
|
needsApiKey: !0,
|
|
@@ -143,8 +144,8 @@ const na = {
|
|
|
143
144
|
supportsModelsApi: !0,
|
|
144
145
|
icon: `${G}/moonshot.svg`
|
|
145
146
|
},
|
|
146
|
-
[
|
|
147
|
-
id:
|
|
147
|
+
[M.QWEN]: {
|
|
148
|
+
id: M.QWEN,
|
|
148
149
|
name: "通义千问 (Qwen)",
|
|
149
150
|
baseUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
150
151
|
needsApiKey: !0,
|
|
@@ -152,8 +153,8 @@ const na = {
|
|
|
152
153
|
supportsModelsApi: !0,
|
|
153
154
|
icon: `${G}/qwen.svg`
|
|
154
155
|
},
|
|
155
|
-
[
|
|
156
|
-
id:
|
|
156
|
+
[M.ZHIPU]: {
|
|
157
|
+
id: M.ZHIPU,
|
|
157
158
|
name: "智谱 AI (GLM)",
|
|
158
159
|
baseUrl: "https://open.bigmodel.cn/api/paas/v4",
|
|
159
160
|
needsApiKey: !0,
|
|
@@ -161,8 +162,8 @@ const na = {
|
|
|
161
162
|
supportsModelsApi: !0,
|
|
162
163
|
icon: `${G}/zhipu.svg`
|
|
163
164
|
},
|
|
164
|
-
[
|
|
165
|
-
id:
|
|
165
|
+
[M.SILICONFLOW]: {
|
|
166
|
+
id: M.SILICONFLOW,
|
|
166
167
|
name: "硅基流动 (siliconflow)",
|
|
167
168
|
baseUrl: "https://api.siliconflow.cn/v1",
|
|
168
169
|
needsApiKey: !0,
|
|
@@ -170,8 +171,8 @@ const na = {
|
|
|
170
171
|
supportsModelsApi: !0,
|
|
171
172
|
icon: `${G}/siliconcloud.svg`
|
|
172
173
|
},
|
|
173
|
-
[
|
|
174
|
-
id:
|
|
174
|
+
[M.DOUBAO]: {
|
|
175
|
+
id: M.DOUBAO,
|
|
175
176
|
name: "火山方舟 (Doubao)",
|
|
176
177
|
baseUrl: "https://ark.cn-beijing.volces.com/api/v3",
|
|
177
178
|
needsApiKey: !0,
|
|
@@ -179,8 +180,8 @@ const na = {
|
|
|
179
180
|
supportsModelsApi: !0,
|
|
180
181
|
icon: `${G}/doubao.svg`
|
|
181
182
|
},
|
|
182
|
-
[
|
|
183
|
-
id:
|
|
183
|
+
[M.MINIMAX]: {
|
|
184
|
+
id: M.MINIMAX,
|
|
184
185
|
name: "MiniMax",
|
|
185
186
|
baseUrl: "https://api.minimax.io/v1",
|
|
186
187
|
needsApiKey: !0,
|
|
@@ -188,8 +189,18 @@ const na = {
|
|
|
188
189
|
supportsModelsApi: !1,
|
|
189
190
|
icon: `${G}/minimax.svg`
|
|
190
191
|
},
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
// MiniMax 中文站(同服务商,独立域名;模型列表与海外版一致)
|
|
193
|
+
[M.MINIMAX_CN]: {
|
|
194
|
+
id: M.MINIMAX_CN,
|
|
195
|
+
name: "MiniMax (国内)",
|
|
196
|
+
baseUrl: "https://api.minimaxi.com/v1",
|
|
197
|
+
needsApiKey: !0,
|
|
198
|
+
apiFormat: "openai",
|
|
199
|
+
supportsModelsApi: !1,
|
|
200
|
+
icon: `${G}/minimax.svg`
|
|
201
|
+
},
|
|
202
|
+
[M.XAI]: {
|
|
203
|
+
id: M.XAI,
|
|
193
204
|
name: "xAI (Grok)",
|
|
194
205
|
baseUrl: "https://api.x.ai/v1",
|
|
195
206
|
needsApiKey: !0,
|
|
@@ -197,8 +208,8 @@ const na = {
|
|
|
197
208
|
supportsModelsApi: !0,
|
|
198
209
|
icon: `${G}/grok.svg`
|
|
199
210
|
},
|
|
200
|
-
[
|
|
201
|
-
id:
|
|
211
|
+
[M.GROQ]: {
|
|
212
|
+
id: M.GROQ,
|
|
202
213
|
name: "Groq",
|
|
203
214
|
baseUrl: "https://api.groq.com/openai/v1",
|
|
204
215
|
needsApiKey: !0,
|
|
@@ -206,8 +217,8 @@ const na = {
|
|
|
206
217
|
supportsModelsApi: !0,
|
|
207
218
|
icon: `${G}/groq.svg`
|
|
208
219
|
},
|
|
209
|
-
[
|
|
210
|
-
id:
|
|
220
|
+
[M.MISTRAL]: {
|
|
221
|
+
id: M.MISTRAL,
|
|
211
222
|
name: "Mistral AI",
|
|
212
223
|
baseUrl: "https://api.mistral.ai/v1",
|
|
213
224
|
needsApiKey: !0,
|
|
@@ -215,8 +226,8 @@ const na = {
|
|
|
215
226
|
supportsModelsApi: !0,
|
|
216
227
|
icon: `${G}/mistral.svg`
|
|
217
228
|
},
|
|
218
|
-
[
|
|
219
|
-
id:
|
|
229
|
+
[M.TOGETHER]: {
|
|
230
|
+
id: M.TOGETHER,
|
|
220
231
|
name: "Together AI",
|
|
221
232
|
baseUrl: "https://api.together.xyz/v1",
|
|
222
233
|
needsApiKey: !0,
|
|
@@ -224,8 +235,8 @@ const na = {
|
|
|
224
235
|
supportsModelsApi: !0,
|
|
225
236
|
icon: `${G}/together.svg`
|
|
226
237
|
},
|
|
227
|
-
[
|
|
228
|
-
id:
|
|
238
|
+
[M.FIREWORKS]: {
|
|
239
|
+
id: M.FIREWORKS,
|
|
229
240
|
name: "Fireworks AI",
|
|
230
241
|
baseUrl: "https://api.fireworks.ai/inference/v1",
|
|
231
242
|
needsApiKey: !0,
|
|
@@ -233,8 +244,8 @@ const na = {
|
|
|
233
244
|
supportsModelsApi: !0,
|
|
234
245
|
icon: `${G}/fireworks.svg`
|
|
235
246
|
},
|
|
236
|
-
[
|
|
237
|
-
id:
|
|
247
|
+
[M.DEEPINFRA]: {
|
|
248
|
+
id: M.DEEPINFRA,
|
|
238
249
|
name: "DeepInfra",
|
|
239
250
|
baseUrl: "https://api.deepinfra.com/v1/openai",
|
|
240
251
|
needsApiKey: !0,
|
|
@@ -242,8 +253,8 @@ const na = {
|
|
|
242
253
|
supportsModelsApi: !0,
|
|
243
254
|
icon: `${G}/deepinfra.svg`
|
|
244
255
|
},
|
|
245
|
-
[
|
|
246
|
-
id:
|
|
256
|
+
[M.PERPLEXITY]: {
|
|
257
|
+
id: M.PERPLEXITY,
|
|
247
258
|
name: "Perplexity",
|
|
248
259
|
baseUrl: "https://api.perplexity.ai",
|
|
249
260
|
needsApiKey: !0,
|
|
@@ -251,8 +262,8 @@ const na = {
|
|
|
251
262
|
supportsModelsApi: !1,
|
|
252
263
|
icon: `${G}/perplexity.svg`
|
|
253
264
|
},
|
|
254
|
-
[
|
|
255
|
-
id:
|
|
265
|
+
[M.COHERE]: {
|
|
266
|
+
id: M.COHERE,
|
|
256
267
|
name: "Cohere",
|
|
257
268
|
baseUrl: "https://api.cohere.com/v2",
|
|
258
269
|
needsApiKey: !0,
|
|
@@ -260,8 +271,8 @@ const na = {
|
|
|
260
271
|
supportsModelsApi: !0,
|
|
261
272
|
icon: `${G}/cohere.svg`
|
|
262
273
|
},
|
|
263
|
-
[
|
|
264
|
-
id:
|
|
274
|
+
[M.OLLAMA]: {
|
|
275
|
+
id: M.OLLAMA,
|
|
265
276
|
name: "Ollama (Local)",
|
|
266
277
|
baseUrl: "http://localhost:11434/v1",
|
|
267
278
|
needsApiKey: !1,
|
|
@@ -269,8 +280,8 @@ const na = {
|
|
|
269
280
|
supportsModelsApi: !0,
|
|
270
281
|
icon: `${G}/ollama.svg`
|
|
271
282
|
},
|
|
272
|
-
[
|
|
273
|
-
id:
|
|
283
|
+
[M.CUSTOM]: {
|
|
284
|
+
id: M.CUSTOM,
|
|
274
285
|
name: "自定义 (Custom)",
|
|
275
286
|
baseUrl: "",
|
|
276
287
|
needsApiKey: !1,
|
|
@@ -289,7 +300,7 @@ function _r(p) {
|
|
|
289
300
|
return or().filter((r) => r.apiFormat === p);
|
|
290
301
|
}
|
|
291
302
|
const wr = {
|
|
292
|
-
[
|
|
303
|
+
[M.OPENAI]: [
|
|
293
304
|
{ id: "gpt-5.2-pro", name: "GPT-5.2 Pro" },
|
|
294
305
|
{ id: "gpt-5.2", name: "GPT-5.2" },
|
|
295
306
|
{ id: "gpt-5", name: "GPT-5" },
|
|
@@ -297,7 +308,7 @@ const wr = {
|
|
|
297
308
|
{ id: "gpt-5-nano", name: "GPT-5 Nano" },
|
|
298
309
|
{ id: "gpt-4.1", name: "GPT-4.1" }
|
|
299
310
|
],
|
|
300
|
-
[
|
|
311
|
+
[M.ANTHROPIC]: [
|
|
301
312
|
{ id: "claude-opus-4.5-20251101", name: "Claude Opus 4.5" },
|
|
302
313
|
{ id: "claude-opus-4.5-20251101-thinking", name: "Claude Opus 4.5 Thinking" },
|
|
303
314
|
{ id: "claude-sonnet-4.5-20250929", name: "Claude Sonnet 4.5" },
|
|
@@ -307,18 +318,18 @@ const wr = {
|
|
|
307
318
|
{ id: "claude-opus-4.1-20250805", name: "Claude Opus 4.1" },
|
|
308
319
|
{ id: "claude-opus-4.1-20250805-thinking", name: "Claude Opus 4.1 Thinking" }
|
|
309
320
|
],
|
|
310
|
-
[
|
|
321
|
+
[M.GEMINI]: [
|
|
311
322
|
{ id: "gemini-3-flash-preview", name: "Gemini 3 Flash Preview" },
|
|
312
323
|
{ id: "gemini-3-pro-preview", name: "Gemini 3 Pro Preview" },
|
|
313
324
|
{ id: "gemini-2.5-pro", name: "Gemini 2.5 Pro" },
|
|
314
325
|
{ id: "gemini-2.5-flash", name: "Gemini 2.5 Flash" },
|
|
315
326
|
{ id: "gemini-2.5-flash-lite", name: "Gemini 2.5 Flash-Lite" }
|
|
316
327
|
],
|
|
317
|
-
[
|
|
328
|
+
[M.DEEPSEEK]: [
|
|
318
329
|
{ id: "deepseek-chat", name: "Deepseek Chat" },
|
|
319
330
|
{ id: "deepseek-reasoner", name: "Deepseek Reasoner" }
|
|
320
331
|
],
|
|
321
|
-
[
|
|
332
|
+
[M.MISTRAL]: [
|
|
322
333
|
{ id: "mistral-large-latest", name: "Mistral Large" },
|
|
323
334
|
{ id: "mistral-medium-latest", name: "Mistral Medium" },
|
|
324
335
|
{ id: "mistral-small-latest", name: "Mistral Small" },
|
|
@@ -330,7 +341,7 @@ const wr = {
|
|
|
330
341
|
{ id: "ministral-8b-latest", name: "Ministral 8B" },
|
|
331
342
|
{ id: "ministral-3b-latest", name: "Ministral 3B" }
|
|
332
343
|
],
|
|
333
|
-
[
|
|
344
|
+
[M.GROQ]: [
|
|
334
345
|
{ id: "canopylabs/orpheus-v1-english", name: "Orpheus V1 English" },
|
|
335
346
|
{ id: "canopylabs/orpheus-arabic-saudi", name: "Orpheus Arabic Saudi" },
|
|
336
347
|
{ id: "moonshotai/kimi-k2-instruct", name: "Kimi K2 Instruct" },
|
|
@@ -341,7 +352,7 @@ const wr = {
|
|
|
341
352
|
{ id: "groq/compound", name: "Compound" },
|
|
342
353
|
{ id: "meta-llama/llama-4-maverick-17b-128e-instruct", name: "Llama 4 Maverick 17B 128E Instruct" }
|
|
343
354
|
],
|
|
344
|
-
[
|
|
355
|
+
[M.XAI]: [
|
|
345
356
|
{ id: "grok-4", name: "Grok 4" },
|
|
346
357
|
{ id: "grok-4-fast", name: "Grok 4 Fast" },
|
|
347
358
|
{ id: "grok-3-latest", name: "Grok 3" },
|
|
@@ -350,7 +361,7 @@ const wr = {
|
|
|
350
361
|
{ id: "grok-3-mini-fast", name: "Grok 3 Mini Fast" },
|
|
351
362
|
{ id: "grok-vision-beta", name: "Grok Vision (Beta)" }
|
|
352
363
|
],
|
|
353
|
-
[
|
|
364
|
+
[M.TOGETHER]: [
|
|
354
365
|
{ id: "Qwen/Qwen2.5-72B-Instruct-Turbo", name: "Qwen2.5 72B Instruct Turbo" },
|
|
355
366
|
{ id: "Qwen/Qwen3-235B-A22B-Thinking-2507", name: "Qwen3 235B A22B Thinking 2507" },
|
|
356
367
|
{ id: "deepseek-ai/DeepSeek-R1", name: "Deepseek R1" },
|
|
@@ -359,7 +370,7 @@ const wr = {
|
|
|
359
370
|
{ id: "meta-llama/Llama-3.3-70B-Instruct-Turbo", name: "Llama 3.3 70B Instruct Turbo" },
|
|
360
371
|
{ id: "meta-llama/Llama-3.3-70B-Instruct-Turbo-Free", name: "Llama 3.3 70B Instruct Turbo Free" }
|
|
361
372
|
],
|
|
362
|
-
[
|
|
373
|
+
[M.FIREWORKS]: [
|
|
363
374
|
{ id: "accounts/fireworks/models/llama4-scout-instruct-basic", name: "Llama4 Scout Instruct Basic" },
|
|
364
375
|
{ id: "accounts/fireworks/models/qwen3-vl-235b-a22b-thinking", name: "Qwen3 Vl 235B A22B Thinking" },
|
|
365
376
|
{ id: "accounts/fireworks/models/deepseek-v3p2", name: "Deepseek V3P2" },
|
|
@@ -371,7 +382,7 @@ const wr = {
|
|
|
371
382
|
{ id: "accounts/fireworks/models/qwen3-235b-a22b-thinking-2507", name: "Qwen3 235B A22B Thinking 2507" },
|
|
372
383
|
{ id: "accounts/fireworks/models/qwen3-coder-480b-a35b-instruct", name: "Qwen3 Coder 480B A35B Instruct" }
|
|
373
384
|
],
|
|
374
|
-
[
|
|
385
|
+
[M.DEEPINFRA]: [
|
|
375
386
|
{ id: "meta-llama/Llama-3.2-11B-Vision-Instruct", name: "Llama 3.2 11B Vision Instruct" },
|
|
376
387
|
{ id: "Qwen/Qwen3-32B", name: "Qwen3 32B" },
|
|
377
388
|
{ id: "NousResearch/Hermes-3-Llama-3.1-70B", name: "Hermes 3 Llama 3.1 70B" },
|
|
@@ -383,7 +394,7 @@ const wr = {
|
|
|
383
394
|
{ id: "meta-llama/Meta-Llama-3.1-8B-Instruct", name: "Meta Llama 3.1 8B Instruct" },
|
|
384
395
|
{ id: "Qwen/Qwen3-Coder-480B-A35B-Instruct-Turbo", name: "Qwen3 Coder 480B A35B Instruct Turbo" }
|
|
385
396
|
],
|
|
386
|
-
[
|
|
397
|
+
[M.OPENROUTER]: [
|
|
387
398
|
{ id: "google/gemini-3-flash-preview", name: "Gemini 3 Flash Preview" },
|
|
388
399
|
{ id: "mistralai/mistral-small-creative", name: "Mistral Small Creative" },
|
|
389
400
|
{ id: "openai/gpt-5.2-chat", name: "Gpt 5.2 Chat" },
|
|
@@ -397,7 +408,7 @@ const wr = {
|
|
|
397
408
|
{ id: "mistralai/mistral-large-2512", name: "Mistral Large 2512" },
|
|
398
409
|
{ id: "deepseek/deepseek-v3.2-speciale", name: "Deepseek V3.2 Speciale" }
|
|
399
410
|
],
|
|
400
|
-
[
|
|
411
|
+
[M.PERPLEXITY]: [
|
|
401
412
|
{ id: "codellama-34b-instruct", name: "Codellama 34B Instruct" },
|
|
402
413
|
{ id: "codellama-70b-instruct", name: "Codellama 70B Instruct" },
|
|
403
414
|
{ id: "llama-2-70b-chat", name: "Llama 2 70B Chat" },
|
|
@@ -408,21 +419,21 @@ const wr = {
|
|
|
408
419
|
{ id: "llama-3.1-sonar-large-128k-online", name: "Llama 3.1 Sonar Large 128K Online" },
|
|
409
420
|
{ id: "llama-3.1-sonar-small-128k-chat", name: "Llama 3.1 Sonar Small 128K Chat" }
|
|
410
421
|
],
|
|
411
|
-
[
|
|
422
|
+
[M.COHERE]: [
|
|
412
423
|
{ id: "command-a-vision-07-2025", name: "Command A Vision 07 2025" },
|
|
413
424
|
{ id: "command-a-reasoning-08-2025", name: "Command A Reasoning 08 2025" },
|
|
414
425
|
{ id: "command-r-08-2024", name: "Command R 08 2024" },
|
|
415
426
|
{ id: "command-r7b-arabic-02-2025", name: "Command R7B Arabic 02 2025" },
|
|
416
427
|
{ id: "command-r7b-12-2024", name: "Command R7B 12 2024" }
|
|
417
428
|
],
|
|
418
|
-
[
|
|
429
|
+
[M.MOONSHOT]: [
|
|
419
430
|
{ id: "moonshot-v1-128k", name: "Moonshot 128K" },
|
|
420
431
|
{ id: "moonshot-v1-32k", name: "Moonshot 32K" },
|
|
421
432
|
{ id: "moonshot-v1-8k", name: "Moonshot 8K" },
|
|
422
433
|
{ id: "kimi-k2-0711-chat", name: "Kimi K2 Chat" },
|
|
423
434
|
{ id: "moonshot-v1-auto", name: "Moonshot Auto" }
|
|
424
435
|
],
|
|
425
|
-
[
|
|
436
|
+
[M.QWEN]: [
|
|
426
437
|
{ id: "qwen-flash", name: "Qwen Flash" },
|
|
427
438
|
{ id: "qwen3-vl-plus-2025-12-19", name: "Qwen3 Vl Plus 2025 12 19" },
|
|
428
439
|
{ id: "qwen3-tts-vd-realtime-2025-12-16", name: "Qwen3 Tts Vd Realtime 2025 12 16" },
|
|
@@ -434,13 +445,13 @@ const wr = {
|
|
|
434
445
|
{ id: "qwen-plus-2025-12-01", name: "Qwen Plus 2025 12 01" },
|
|
435
446
|
{ id: "qwen3-tts-vc-realtime-2025-11-27", name: "Qwen3 Tts Vc Realtime 2025 11 27" }
|
|
436
447
|
],
|
|
437
|
-
[
|
|
448
|
+
[M.ZHIPU]: [
|
|
438
449
|
{ id: "glm-4.5", name: "Glm 4.5" },
|
|
439
450
|
{ id: "glm-4.5-air", name: "Glm 4.5 Air" },
|
|
440
451
|
{ id: "glm-4.6", name: "Glm 4.6" },
|
|
441
452
|
{ id: "glm-4.7", name: "Glm 4.7" }
|
|
442
453
|
],
|
|
443
|
-
[
|
|
454
|
+
[M.SILICONFLOW]: [
|
|
444
455
|
{ id: "deepseek-ai/DeepSeek-V3.2", name: "Deepseek V3.2" },
|
|
445
456
|
{ id: "deepseek-ai/DeepSeek-V3.1-Terminus", name: "Deepseek V3.1 Terminus" },
|
|
446
457
|
{ id: "deepseek-ai/DeepSeek-R1", name: "Deepseek R1" },
|
|
@@ -450,7 +461,7 @@ const wr = {
|
|
|
450
461
|
{ id: "Pro/zai-org/GLM-4.7", name: "Glm 4.7" },
|
|
451
462
|
{ id: "Qwen/Qwen3-VL-32B-Instruct", name: "Qwen3 Vl 32B Instruct" }
|
|
452
463
|
],
|
|
453
|
-
[
|
|
464
|
+
[M.OLLAMA]: [
|
|
454
465
|
{ id: "llama3.3", name: "Llama 3.3" },
|
|
455
466
|
{ id: "llama3.2", name: "Llama 3.2" },
|
|
456
467
|
{ id: "qwq", name: "QwQ (推理)" },
|
|
@@ -462,14 +473,19 @@ const wr = {
|
|
|
462
473
|
{ id: "phi4", name: "Phi 4" },
|
|
463
474
|
{ id: "codellama", name: "Code Llama" }
|
|
464
475
|
],
|
|
465
|
-
[
|
|
476
|
+
[M.DOUBAO]: [
|
|
466
477
|
{ id: "doubao-seed-1-8-251215", name: "Doubao 1.8" },
|
|
467
478
|
{ id: "doubao-seed-1-6-251015", name: "Doubao 1.6" },
|
|
468
479
|
{ id: "doubao-seed-1-6-lite-251015", name: "Doubao 1.6 Lite" },
|
|
469
480
|
{ id: "doubao-seed-1-6-flash-250828", name: "Doubao 1.6 Flash" },
|
|
470
481
|
{ id: "doubao-seed-1-6-thinking-250615", name: "Doubao 1.6 Thinking" }
|
|
471
482
|
],
|
|
472
|
-
[
|
|
483
|
+
[M.MINIMAX]: [
|
|
484
|
+
{ id: "MiniMax-M2.1", name: "MiniMax M2.1" },
|
|
485
|
+
{ id: "MiniMax-M2.1-lightning", name: "MiniMax M2.1 Lightning" },
|
|
486
|
+
{ id: "MiniMax-M2", name: "MiniMax M2" }
|
|
487
|
+
],
|
|
488
|
+
[M.MINIMAX_CN]: [
|
|
473
489
|
{ id: "MiniMax-M2.1", name: "MiniMax M2.1" },
|
|
474
490
|
{ id: "MiniMax-M2.1-lightning", name: "MiniMax M2.1 Lightning" },
|
|
475
491
|
{ id: "MiniMax-M2", name: "MiniMax M2" }
|
|
@@ -488,7 +504,7 @@ function le(p) {
|
|
|
488
504
|
const e = p.capabilities;
|
|
489
505
|
if (e && ((e.vision || e.image) && (r.add("vision"), r.add("text")), e.audio && r.add("audio"), e.video && r.add("video"), e.embeddings && r.add("embedding"), r.size > 0))
|
|
490
506
|
return Array.from(r);
|
|
491
|
-
const
|
|
507
|
+
const s = (p.id || "").toLowerCase(), c = (p.name || "").toLowerCase(), b = `${s} ${c}`;
|
|
492
508
|
return r.add("text"), /vision|image|visual|multimodal|vl|pixtral|llava|bakllava/.test(b) && r.add("vision"), /audio|speech|whisper|tts|stt/.test(b) && r.add("audio"), /video/.test(b) && r.add("video"), /embedding|embed/.test(b) && r.add("embedding"), /reasoner|reasoning|thinking|qwq/.test(b) && r.add("reasoning"), Array.from(r);
|
|
493
509
|
}
|
|
494
510
|
const Sr = (p) => Array.isArray(p == null ? void 0 : p.data) ? p.data.filter((r) => r.id).map((r) => {
|
|
@@ -507,17 +523,17 @@ const Sr = (p) => Array.isArray(p == null ? void 0 : p.data) ? p.data.filter((r)
|
|
|
507
523
|
format: "openai",
|
|
508
524
|
getModelsEndpoint: (p) => `${p}/models`,
|
|
509
525
|
getChatEndpoint: (p) => `${p}/chat/completions`,
|
|
510
|
-
buildHeaders: (p) => {
|
|
511
|
-
const
|
|
526
|
+
buildHeaders: (p, r) => {
|
|
527
|
+
const t = {
|
|
512
528
|
"Content-Type": "application/json",
|
|
513
529
|
Authorization: `Bearer ${p}`
|
|
514
530
|
};
|
|
515
|
-
if (typeof window < "u" && window.location) {
|
|
516
|
-
|
|
517
|
-
const
|
|
518
|
-
|
|
531
|
+
if (!!r && /openrouter\.ai/i.test(r) && typeof window < "u" && window.location) {
|
|
532
|
+
t["HTTP-Referer"] = window.location.origin;
|
|
533
|
+
const s = document.title ? document.title.replace(/[^\x20-\x7E]/g, "").slice(0, 80) : "AI Selector";
|
|
534
|
+
t["X-Title"] = s || "AI Selector";
|
|
519
535
|
}
|
|
520
|
-
return
|
|
536
|
+
return t;
|
|
521
537
|
},
|
|
522
538
|
buildChatPayload: (p, r, t) => {
|
|
523
539
|
const e = {
|
|
@@ -534,7 +550,7 @@ const Sr = (p) => Array.isArray(p == null ? void 0 : p.data) ? p.data.filter((r)
|
|
|
534
550
|
var r, t, e;
|
|
535
551
|
return ((e = (t = (r = p.choices) == null ? void 0 : r[0]) == null ? void 0 : t.delta) == null ? void 0 : e.content) || "";
|
|
536
552
|
}
|
|
537
|
-
},
|
|
553
|
+
}, Ir = {
|
|
538
554
|
format: "anthropic",
|
|
539
555
|
getModelsEndpoint: (p) => `${p}/models`,
|
|
540
556
|
getChatEndpoint: (p) => `${p}/messages`,
|
|
@@ -566,7 +582,7 @@ const Sr = (p) => Array.isArray(p == null ? void 0 : p.data) ? p.data.filter((r)
|
|
|
566
582
|
created: r.created_at ? new Date(r.created_at).getTime() / 1e3 : 0,
|
|
567
583
|
capabilities: le(r)
|
|
568
584
|
})).sort((r, t) => (t.created || 0) - (r.created || 0)) : []
|
|
569
|
-
},
|
|
585
|
+
}, Pr = {
|
|
570
586
|
format: "gemini",
|
|
571
587
|
getModelsEndpoint: (p, r) => `${p}/models?key=${r}`,
|
|
572
588
|
getChatEndpoint: (p, r, t) => `${p}/models/${t}:generateContent?key=${r}`,
|
|
@@ -574,19 +590,19 @@ const Sr = (p) => Array.isArray(p == null ? void 0 : p.data) ? p.data.filter((r)
|
|
|
574
590
|
"Content-Type": "application/json"
|
|
575
591
|
}),
|
|
576
592
|
buildChatPayload: (p, r, t) => {
|
|
577
|
-
const
|
|
593
|
+
const s = { contents: r.map((c) => ({
|
|
578
594
|
role: c.role === "assistant" ? "model" : "user",
|
|
579
595
|
parts: [{ text: c.content }]
|
|
580
596
|
})) };
|
|
581
|
-
return t && (
|
|
597
|
+
return t && (s.generationConfig = { maxOutputTokens: t }), s;
|
|
582
598
|
},
|
|
583
599
|
parseChatResponse: (p) => {
|
|
584
|
-
var r, t, e,
|
|
585
|
-
return ((c = (
|
|
600
|
+
var r, t, e, s, c;
|
|
601
|
+
return ((c = (s = (e = (t = (r = p.candidates) == null ? void 0 : r[0]) == null ? void 0 : t.content) == null ? void 0 : e.parts) == null ? void 0 : s[0]) == null ? void 0 : c.text) || "";
|
|
586
602
|
},
|
|
587
603
|
parseStreamChunk: (p) => {
|
|
588
|
-
var r, t, e,
|
|
589
|
-
return ((c = (
|
|
604
|
+
var r, t, e, s, c;
|
|
605
|
+
return ((c = (s = (e = (t = (r = p.candidates) == null ? void 0 : r[0]) == null ? void 0 : t.content) == null ? void 0 : e.parts) == null ? void 0 : s[0]) == null ? void 0 : c.text) || "";
|
|
590
606
|
},
|
|
591
607
|
// Gemini 返回格式: { models: [{ name: "models/gemini-pro", ... }] }
|
|
592
608
|
parseModelsResponse: (p) => Array.isArray(p.models) ? p.models.filter((r) => {
|
|
@@ -619,21 +635,21 @@ const Sr = (p) => Array.isArray(p == null ? void 0 : p.data) ? p.data.filter((r)
|
|
|
619
635
|
return ((e = (t = (r = p.message) == null ? void 0 : r.content) == null ? void 0 : t[0]) == null ? void 0 : e.text) || "";
|
|
620
636
|
},
|
|
621
637
|
parseStreamChunk: (p) => {
|
|
622
|
-
var r, t, e,
|
|
623
|
-
return p.type === "content-delta" && ((
|
|
638
|
+
var r, t, e, s;
|
|
639
|
+
return p.type === "content-delta" && ((s = (e = (t = (r = p.delta) == null ? void 0 : r.message) == null ? void 0 : t.content) == null ? void 0 : e[0]) == null ? void 0 : s.text) || "";
|
|
624
640
|
}
|
|
625
|
-
},
|
|
641
|
+
}, Mr = {
|
|
626
642
|
openai: xr,
|
|
627
|
-
anthropic:
|
|
628
|
-
gemini:
|
|
643
|
+
anthropic: Ir,
|
|
644
|
+
gemini: Pr,
|
|
629
645
|
cohere: Rr
|
|
630
646
|
};
|
|
631
647
|
function ae(p) {
|
|
632
|
-
return
|
|
648
|
+
return Mr[p] || xr;
|
|
633
649
|
}
|
|
634
650
|
async function cr(p) {
|
|
635
651
|
var i;
|
|
636
|
-
const { apiFormat: r, baseUrl: t, apiKey: e, model:
|
|
652
|
+
const { apiFormat: r, baseUrl: t, apiKey: e, model: s, messages: c, maxTokens: b } = p, u = ae(r), f = u.getChatEndpoint(t, e, s), a = u.buildHeaders(e, t), n = u.buildChatPayload(s, c, b), B = performance.now();
|
|
637
653
|
try {
|
|
638
654
|
const l = await fetch(f, {
|
|
639
655
|
method: "POST",
|
|
@@ -659,12 +675,12 @@ async function cr(p) {
|
|
|
659
675
|
};
|
|
660
676
|
}
|
|
661
677
|
}
|
|
662
|
-
async function
|
|
678
|
+
async function Hr(p) {
|
|
663
679
|
var d;
|
|
664
|
-
const { apiFormat: r, baseUrl: t, apiKey: e, model:
|
|
665
|
-
let n = a.getChatEndpoint(t, e,
|
|
666
|
-
r === "gemini" && (n = `${t}/models/${
|
|
667
|
-
const B = a.buildHeaders(e), i = a.buildChatPayload(
|
|
680
|
+
const { apiFormat: r, baseUrl: t, apiKey: e, model: s, messages: c, maxTokens: b, onDelta: u, signal: f } = p, a = ae(r);
|
|
681
|
+
let n = a.getChatEndpoint(t, e, s);
|
|
682
|
+
r === "gemini" && (n = `${t}/models/${s}:streamGenerateContent?alt=sse&key=${encodeURIComponent(e)}`);
|
|
683
|
+
const B = a.buildHeaders(e, t), i = a.buildChatPayload(s, c, b);
|
|
668
684
|
i.stream = !0;
|
|
669
685
|
const l = performance.now();
|
|
670
686
|
try {
|
|
@@ -686,14 +702,14 @@ async function Mr(p) {
|
|
|
686
702
|
return { success: !1, message: F, latencyMs: Math.round(performance.now() - l) };
|
|
687
703
|
}
|
|
688
704
|
const h = C.body.getReader(), A = new TextDecoder();
|
|
689
|
-
let
|
|
705
|
+
let o = "", x = "";
|
|
690
706
|
for (; ; ) {
|
|
691
707
|
const { done: v, value: F } = await h.read();
|
|
692
708
|
if (v) break;
|
|
693
|
-
|
|
694
|
-
const E =
|
|
709
|
+
o += A.decode(F, { stream: !0 });
|
|
710
|
+
const E = o.split(`
|
|
695
711
|
`);
|
|
696
|
-
|
|
712
|
+
o = E.pop() || "";
|
|
697
713
|
for (const g of E) {
|
|
698
714
|
const y = g.trim();
|
|
699
715
|
if (!y.startsWith("data:") && !y.startsWith("event:") || y.startsWith("event:")) continue;
|
|
@@ -730,7 +746,7 @@ async function Or(p) {
|
|
|
730
746
|
};
|
|
731
747
|
}
|
|
732
748
|
async function sa(p) {
|
|
733
|
-
const { provider: r, apiKey: t, model: e, baseUrl:
|
|
749
|
+
const { provider: r, apiKey: t, model: e, baseUrl: s, proxyUrl: c } = p, b = s || r.baseUrl, u = Date.now();
|
|
734
750
|
try {
|
|
735
751
|
if (c) {
|
|
736
752
|
const h = await (await fetch(`${c}/test`, {
|
|
@@ -740,7 +756,7 @@ async function sa(p) {
|
|
|
740
756
|
provider_id: r.id,
|
|
741
757
|
api_key: t,
|
|
742
758
|
model: e || "",
|
|
743
|
-
base_url:
|
|
759
|
+
base_url: s || r.baseUrl,
|
|
744
760
|
api_format: r.apiFormat
|
|
745
761
|
})
|
|
746
762
|
})).json();
|
|
@@ -757,7 +773,7 @@ async function sa(p) {
|
|
|
757
773
|
latencyMs: 0,
|
|
758
774
|
message: "请先选择模型 (Please select a model)"
|
|
759
775
|
};
|
|
760
|
-
const n = f.buildHeaders(t), B = f.buildChatPayload(a, [{ role: "user", content: "Hi" }]), i = f.getChatEndpoint(b, t, a), l = await fetch(i, {
|
|
776
|
+
const n = f.buildHeaders(t, b), B = f.buildChatPayload(a, [{ role: "user", content: "Hi" }]), i = f.getChatEndpoint(b, t, a), l = await fetch(i, {
|
|
761
777
|
method: "POST",
|
|
762
778
|
headers: n,
|
|
763
779
|
body: JSON.stringify(B)
|
|
@@ -782,10 +798,10 @@ async function sa(p) {
|
|
|
782
798
|
}
|
|
783
799
|
async function $r(p) {
|
|
784
800
|
var b, u;
|
|
785
|
-
const { provider: r, apiKey: t, baseUrl: e, proxyUrl:
|
|
786
|
-
if (
|
|
801
|
+
const { provider: r, apiKey: t, baseUrl: e, proxyUrl: s, fallbackToStatic: c = !0 } = p;
|
|
802
|
+
if (s)
|
|
787
803
|
try {
|
|
788
|
-
const a = await (await fetch(`${
|
|
804
|
+
const a = await (await fetch(`${s}/models`, {
|
|
789
805
|
method: "POST",
|
|
790
806
|
headers: { "Content-Type": "application/json" },
|
|
791
807
|
body: JSON.stringify({
|
|
@@ -799,11 +815,11 @@ async function $r(p) {
|
|
|
799
815
|
} catch (f) {
|
|
800
816
|
if (console.warn("Failed to fetch models via proxy:", f), !c) throw f;
|
|
801
817
|
}
|
|
802
|
-
if (!
|
|
818
|
+
if (!s && r.supportsModelsApi)
|
|
803
819
|
try {
|
|
804
820
|
const f = ae(r.apiFormat);
|
|
805
821
|
if (f.getModelsEndpoint) {
|
|
806
|
-
const a = f.getModelsEndpoint(e || r.baseUrl, t || ""), n = f.buildHeaders(t || ""), B = await fetch(a, {
|
|
822
|
+
const a = f.getModelsEndpoint(e || r.baseUrl, t || ""), n = f.buildHeaders(t || "", e || r.baseUrl), B = await fetch(a, {
|
|
807
823
|
method: "GET",
|
|
808
824
|
headers: n
|
|
809
825
|
});
|
|
@@ -836,8 +852,8 @@ function Lr(p) {
|
|
|
836
852
|
t.prototype = r.prototype;
|
|
837
853
|
} else t = {};
|
|
838
854
|
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(p).forEach(function(e) {
|
|
839
|
-
var
|
|
840
|
-
Object.defineProperty(t, e,
|
|
855
|
+
var s = Object.getOwnPropertyDescriptor(p, e);
|
|
856
|
+
Object.defineProperty(t, e, s.get ? s : {
|
|
841
857
|
enumerable: !0,
|
|
842
858
|
get: function() {
|
|
843
859
|
return p[e];
|
|
@@ -860,7 +876,7 @@ function L() {
|
|
|
860
876
|
(function(t, e) {
|
|
861
877
|
p.exports = e();
|
|
862
878
|
})(Nr, function() {
|
|
863
|
-
var t = t || (function(e,
|
|
879
|
+
var t = t || (function(e, s) {
|
|
864
880
|
var c;
|
|
865
881
|
if (typeof window < "u" && window.crypto && (c = window.crypto), typeof self < "u" && self.crypto && (c = self.crypto), typeof globalThis < "u" && globalThis.crypto && (c = globalThis.crypto), !c && typeof window < "u" && window.msCrypto && (c = window.msCrypto), !c && typeof oe < "u" && oe.crypto && (c = oe.crypto), !c && typeof Kr == "function")
|
|
866
882
|
try {
|
|
@@ -882,11 +898,11 @@ function L() {
|
|
|
882
898
|
}
|
|
883
899
|
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
884
900
|
}, u = Object.create || /* @__PURE__ */ (function() {
|
|
885
|
-
function
|
|
901
|
+
function o() {
|
|
886
902
|
}
|
|
887
903
|
return function(x) {
|
|
888
904
|
var v;
|
|
889
|
-
return
|
|
905
|
+
return o.prototype = x, v = new o(), o.prototype = null, v;
|
|
890
906
|
};
|
|
891
907
|
})(), f = {}, a = f.lib = {}, n = a.Base = /* @__PURE__ */ (function() {
|
|
892
908
|
return {
|
|
@@ -908,9 +924,9 @@ function L() {
|
|
|
908
924
|
* }
|
|
909
925
|
* });
|
|
910
926
|
*/
|
|
911
|
-
extend: function(
|
|
927
|
+
extend: function(o) {
|
|
912
928
|
var x = u(this);
|
|
913
|
-
return
|
|
929
|
+
return o && x.mixIn(o), (!x.hasOwnProperty("init") || this.init === x.init) && (x.init = function() {
|
|
914
930
|
x.$super.init.apply(this, arguments);
|
|
915
931
|
}), x.init.prototype = x, x.$super = this, x;
|
|
916
932
|
},
|
|
@@ -927,8 +943,8 @@ function L() {
|
|
|
927
943
|
* var instance = MyType.create();
|
|
928
944
|
*/
|
|
929
945
|
create: function() {
|
|
930
|
-
var
|
|
931
|
-
return
|
|
946
|
+
var o = this.extend();
|
|
947
|
+
return o.init.apply(o, arguments), o;
|
|
932
948
|
},
|
|
933
949
|
/**
|
|
934
950
|
* Initializes a newly created object.
|
|
@@ -955,10 +971,10 @@ function L() {
|
|
|
955
971
|
* field: 'value'
|
|
956
972
|
* });
|
|
957
973
|
*/
|
|
958
|
-
mixIn: function(
|
|
959
|
-
for (var x in
|
|
960
|
-
|
|
961
|
-
|
|
974
|
+
mixIn: function(o) {
|
|
975
|
+
for (var x in o)
|
|
976
|
+
o.hasOwnProperty(x) && (this[x] = o[x]);
|
|
977
|
+
o.hasOwnProperty("toString") && (this.toString = o.toString);
|
|
962
978
|
},
|
|
963
979
|
/**
|
|
964
980
|
* Creates a copy of this object.
|
|
@@ -986,8 +1002,8 @@ function L() {
|
|
|
986
1002
|
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
|
|
987
1003
|
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
|
|
988
1004
|
*/
|
|
989
|
-
init: function(
|
|
990
|
-
|
|
1005
|
+
init: function(o, x) {
|
|
1006
|
+
o = this.words = o || [], x != s ? this.sigBytes = x : this.sigBytes = o.length * 4;
|
|
991
1007
|
},
|
|
992
1008
|
/**
|
|
993
1009
|
* Converts this word array to a string.
|
|
@@ -1002,8 +1018,8 @@ function L() {
|
|
|
1002
1018
|
* var string = wordArray.toString();
|
|
1003
1019
|
* var string = wordArray.toString(CryptoJS.enc.Utf8);
|
|
1004
1020
|
*/
|
|
1005
|
-
toString: function(
|
|
1006
|
-
return (
|
|
1021
|
+
toString: function(o) {
|
|
1022
|
+
return (o || l).stringify(this);
|
|
1007
1023
|
},
|
|
1008
1024
|
/**
|
|
1009
1025
|
* Concatenates a word array to this word array.
|
|
@@ -1016,8 +1032,8 @@ function L() {
|
|
|
1016
1032
|
*
|
|
1017
1033
|
* wordArray1.concat(wordArray2);
|
|
1018
1034
|
*/
|
|
1019
|
-
concat: function(
|
|
1020
|
-
var x = this.words, v =
|
|
1035
|
+
concat: function(o) {
|
|
1036
|
+
var x = this.words, v = o.words, F = this.sigBytes, E = o.sigBytes;
|
|
1021
1037
|
if (this.clamp(), F % 4)
|
|
1022
1038
|
for (var g = 0; g < E; g++) {
|
|
1023
1039
|
var y = v[g >>> 2] >>> 24 - g % 4 * 8 & 255;
|
|
@@ -1036,8 +1052,8 @@ function L() {
|
|
|
1036
1052
|
* wordArray.clamp();
|
|
1037
1053
|
*/
|
|
1038
1054
|
clamp: function() {
|
|
1039
|
-
var
|
|
1040
|
-
|
|
1055
|
+
var o = this.words, x = this.sigBytes;
|
|
1056
|
+
o[x >>> 2] &= 4294967295 << 32 - x % 4 * 8, o.length = e.ceil(x / 4);
|
|
1041
1057
|
},
|
|
1042
1058
|
/**
|
|
1043
1059
|
* Creates a copy of this word array.
|
|
@@ -1049,8 +1065,8 @@ function L() {
|
|
|
1049
1065
|
* var clone = wordArray.clone();
|
|
1050
1066
|
*/
|
|
1051
1067
|
clone: function() {
|
|
1052
|
-
var
|
|
1053
|
-
return
|
|
1068
|
+
var o = n.clone.call(this);
|
|
1069
|
+
return o.words = this.words.slice(0), o;
|
|
1054
1070
|
},
|
|
1055
1071
|
/**
|
|
1056
1072
|
* Creates a word array filled with random bytes.
|
|
@@ -1065,10 +1081,10 @@ function L() {
|
|
|
1065
1081
|
*
|
|
1066
1082
|
* var wordArray = CryptoJS.lib.WordArray.random(16);
|
|
1067
1083
|
*/
|
|
1068
|
-
random: function(
|
|
1069
|
-
for (var x = [], v = 0; v <
|
|
1084
|
+
random: function(o) {
|
|
1085
|
+
for (var x = [], v = 0; v < o; v += 4)
|
|
1070
1086
|
x.push(b());
|
|
1071
|
-
return new B.init(x,
|
|
1087
|
+
return new B.init(x, o);
|
|
1072
1088
|
}
|
|
1073
1089
|
}), i = f.enc = {}, l = i.Hex = {
|
|
1074
1090
|
/**
|
|
@@ -1084,8 +1100,8 @@ function L() {
|
|
|
1084
1100
|
*
|
|
1085
1101
|
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
|
|
1086
1102
|
*/
|
|
1087
|
-
stringify: function(
|
|
1088
|
-
for (var x =
|
|
1103
|
+
stringify: function(o) {
|
|
1104
|
+
for (var x = o.words, v = o.sigBytes, F = [], E = 0; E < v; E++) {
|
|
1089
1105
|
var g = x[E >>> 2] >>> 24 - E % 4 * 8 & 255;
|
|
1090
1106
|
F.push((g >>> 4).toString(16)), F.push((g & 15).toString(16));
|
|
1091
1107
|
}
|
|
@@ -1104,9 +1120,9 @@ function L() {
|
|
|
1104
1120
|
*
|
|
1105
1121
|
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
|
|
1106
1122
|
*/
|
|
1107
|
-
parse: function(
|
|
1108
|
-
for (var x =
|
|
1109
|
-
v[F >>> 3] |= parseInt(
|
|
1123
|
+
parse: function(o) {
|
|
1124
|
+
for (var x = o.length, v = [], F = 0; F < x; F += 2)
|
|
1125
|
+
v[F >>> 3] |= parseInt(o.substr(F, 2), 16) << 24 - F % 8 * 4;
|
|
1110
1126
|
return new B.init(v, x / 2);
|
|
1111
1127
|
}
|
|
1112
1128
|
}, d = i.Latin1 = {
|
|
@@ -1123,8 +1139,8 @@ function L() {
|
|
|
1123
1139
|
*
|
|
1124
1140
|
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
|
|
1125
1141
|
*/
|
|
1126
|
-
stringify: function(
|
|
1127
|
-
for (var x =
|
|
1142
|
+
stringify: function(o) {
|
|
1143
|
+
for (var x = o.words, v = o.sigBytes, F = [], E = 0; E < v; E++) {
|
|
1128
1144
|
var g = x[E >>> 2] >>> 24 - E % 4 * 8 & 255;
|
|
1129
1145
|
F.push(String.fromCharCode(g));
|
|
1130
1146
|
}
|
|
@@ -1143,9 +1159,9 @@ function L() {
|
|
|
1143
1159
|
*
|
|
1144
1160
|
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
|
|
1145
1161
|
*/
|
|
1146
|
-
parse: function(
|
|
1147
|
-
for (var x =
|
|
1148
|
-
v[F >>> 2] |= (
|
|
1162
|
+
parse: function(o) {
|
|
1163
|
+
for (var x = o.length, v = [], F = 0; F < x; F++)
|
|
1164
|
+
v[F >>> 2] |= (o.charCodeAt(F) & 255) << 24 - F % 4 * 8;
|
|
1149
1165
|
return new B.init(v, x);
|
|
1150
1166
|
}
|
|
1151
1167
|
}, C = i.Utf8 = {
|
|
@@ -1162,9 +1178,9 @@ function L() {
|
|
|
1162
1178
|
*
|
|
1163
1179
|
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
|
|
1164
1180
|
*/
|
|
1165
|
-
stringify: function(
|
|
1181
|
+
stringify: function(o) {
|
|
1166
1182
|
try {
|
|
1167
|
-
return decodeURIComponent(escape(d.stringify(
|
|
1183
|
+
return decodeURIComponent(escape(d.stringify(o)));
|
|
1168
1184
|
} catch {
|
|
1169
1185
|
throw new Error("Malformed UTF-8 data");
|
|
1170
1186
|
}
|
|
@@ -1182,8 +1198,8 @@ function L() {
|
|
|
1182
1198
|
*
|
|
1183
1199
|
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
|
|
1184
1200
|
*/
|
|
1185
|
-
parse: function(
|
|
1186
|
-
return d.parse(unescape(encodeURIComponent(
|
|
1201
|
+
parse: function(o) {
|
|
1202
|
+
return d.parse(unescape(encodeURIComponent(o)));
|
|
1187
1203
|
}
|
|
1188
1204
|
}, h = a.BufferedBlockAlgorithm = n.extend({
|
|
1189
1205
|
/**
|
|
@@ -1206,8 +1222,8 @@ function L() {
|
|
|
1206
1222
|
* bufferedBlockAlgorithm._append('data');
|
|
1207
1223
|
* bufferedBlockAlgorithm._append(wordArray);
|
|
1208
1224
|
*/
|
|
1209
|
-
_append: function(
|
|
1210
|
-
typeof
|
|
1225
|
+
_append: function(o) {
|
|
1226
|
+
typeof o == "string" && (o = C.parse(o)), this._data.concat(o), this._nDataBytes += o.sigBytes;
|
|
1211
1227
|
},
|
|
1212
1228
|
/**
|
|
1213
1229
|
* Processes available data blocks.
|
|
@@ -1223,9 +1239,9 @@ function L() {
|
|
|
1223
1239
|
* var processedData = bufferedBlockAlgorithm._process();
|
|
1224
1240
|
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
|
|
1225
1241
|
*/
|
|
1226
|
-
_process: function(
|
|
1242
|
+
_process: function(o) {
|
|
1227
1243
|
var x, v = this._data, F = v.words, E = v.sigBytes, g = this.blockSize, y = g * 4, R = E / y;
|
|
1228
|
-
|
|
1244
|
+
o ? R = e.ceil(R) : R = e.max((R | 0) - this._minBufferSize, 0);
|
|
1229
1245
|
var m = R * g, D = e.min(m * 4, E);
|
|
1230
1246
|
if (m) {
|
|
1231
1247
|
for (var w = 0; w < m; w += g)
|
|
@@ -1244,8 +1260,8 @@ function L() {
|
|
|
1244
1260
|
* var clone = bufferedBlockAlgorithm.clone();
|
|
1245
1261
|
*/
|
|
1246
1262
|
clone: function() {
|
|
1247
|
-
var
|
|
1248
|
-
return
|
|
1263
|
+
var o = n.clone.call(this);
|
|
1264
|
+
return o._data = this._data.clone(), o;
|
|
1249
1265
|
},
|
|
1250
1266
|
_minBufferSize: 0
|
|
1251
1267
|
});
|
|
@@ -1263,8 +1279,8 @@ function L() {
|
|
|
1263
1279
|
*
|
|
1264
1280
|
* var hasher = CryptoJS.algo.SHA256.create();
|
|
1265
1281
|
*/
|
|
1266
|
-
init: function(
|
|
1267
|
-
this.cfg = this.cfg.extend(
|
|
1282
|
+
init: function(o) {
|
|
1283
|
+
this.cfg = this.cfg.extend(o), this.reset();
|
|
1268
1284
|
},
|
|
1269
1285
|
/**
|
|
1270
1286
|
* Resets this hasher to its initial state.
|
|
@@ -1288,8 +1304,8 @@ function L() {
|
|
|
1288
1304
|
* hasher.update('message');
|
|
1289
1305
|
* hasher.update(wordArray);
|
|
1290
1306
|
*/
|
|
1291
|
-
update: function(
|
|
1292
|
-
return this._append(
|
|
1307
|
+
update: function(o) {
|
|
1308
|
+
return this._append(o), this._process(), this;
|
|
1293
1309
|
},
|
|
1294
1310
|
/**
|
|
1295
1311
|
* Finalizes the hash computation.
|
|
@@ -1305,8 +1321,8 @@ function L() {
|
|
|
1305
1321
|
* var hash = hasher.finalize('message');
|
|
1306
1322
|
* var hash = hasher.finalize(wordArray);
|
|
1307
1323
|
*/
|
|
1308
|
-
finalize: function(
|
|
1309
|
-
|
|
1324
|
+
finalize: function(o) {
|
|
1325
|
+
o && this._append(o);
|
|
1310
1326
|
var x = this._doFinalize();
|
|
1311
1327
|
return x;
|
|
1312
1328
|
},
|
|
@@ -1324,9 +1340,9 @@ function L() {
|
|
|
1324
1340
|
*
|
|
1325
1341
|
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
|
1326
1342
|
*/
|
|
1327
|
-
_createHelper: function(
|
|
1343
|
+
_createHelper: function(o) {
|
|
1328
1344
|
return function(x, v) {
|
|
1329
|
-
return new
|
|
1345
|
+
return new o.init(v).finalize(x);
|
|
1330
1346
|
};
|
|
1331
1347
|
},
|
|
1332
1348
|
/**
|
|
@@ -1342,9 +1358,9 @@ function L() {
|
|
|
1342
1358
|
*
|
|
1343
1359
|
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
|
1344
1360
|
*/
|
|
1345
|
-
_createHmacHelper: function(
|
|
1361
|
+
_createHmacHelper: function(o) {
|
|
1346
1362
|
return function(x, v) {
|
|
1347
|
-
return new A.HMAC.init(
|
|
1363
|
+
return new A.HMAC.init(o, v).finalize(x);
|
|
1348
1364
|
};
|
|
1349
1365
|
}
|
|
1350
1366
|
});
|
|
@@ -1362,7 +1378,7 @@ function ne() {
|
|
|
1362
1378
|
p.exports = e(L());
|
|
1363
1379
|
})(Wr, function(t) {
|
|
1364
1380
|
return (function(e) {
|
|
1365
|
-
var
|
|
1381
|
+
var s = t, c = s.lib, b = c.Base, u = c.WordArray, f = s.x64 = {};
|
|
1366
1382
|
f.Word = b.extend({
|
|
1367
1383
|
/**
|
|
1368
1384
|
* Initializes a newly created 64-bit word.
|
|
@@ -1593,7 +1609,7 @@ function Qr() {
|
|
|
1593
1609
|
})(Gr, function(t) {
|
|
1594
1610
|
return (function() {
|
|
1595
1611
|
if (typeof ArrayBuffer == "function") {
|
|
1596
|
-
var e = t,
|
|
1612
|
+
var e = t, s = e.lib, c = s.WordArray, b = c.init, u = c.init = function(f) {
|
|
1597
1613
|
if (f instanceof ArrayBuffer && (f = new Uint8Array(f)), (f instanceof Int8Array || typeof Uint8ClampedArray < "u" && f instanceof Uint8ClampedArray || f instanceof Int16Array || f instanceof Uint16Array || f instanceof Int32Array || f instanceof Uint32Array || f instanceof Float32Array || f instanceof Float64Array) && (f = new Uint8Array(f.buffer, f.byteOffset, f.byteLength)), f instanceof Uint8Array) {
|
|
1598
1614
|
for (var a = f.byteLength, n = [], B = 0; B < a; B++)
|
|
1599
1615
|
n[B >>> 2] |= f[B] << 24 - B % 4 * 8;
|
|
@@ -1614,7 +1630,7 @@ function Vr() {
|
|
|
1614
1630
|
p.exports = e(L());
|
|
1615
1631
|
})(Xr, function(t) {
|
|
1616
1632
|
return (function() {
|
|
1617
|
-
var e = t,
|
|
1633
|
+
var e = t, s = e.lib, c = s.WordArray, b = e.enc;
|
|
1618
1634
|
b.Utf16 = b.Utf16BE = {
|
|
1619
1635
|
/**
|
|
1620
1636
|
* Converts a word array to a UTF-16 BE string.
|
|
@@ -1708,7 +1724,7 @@ function n0() {
|
|
|
1708
1724
|
p.exports = e(L());
|
|
1709
1725
|
})(jr, function(t) {
|
|
1710
1726
|
return (function() {
|
|
1711
|
-
var e = t,
|
|
1727
|
+
var e = t, s = e.lib, c = s.WordArray, b = e.enc;
|
|
1712
1728
|
b.Base64 = {
|
|
1713
1729
|
/**
|
|
1714
1730
|
* Converts a word array to a Base64 string.
|
|
@@ -1727,8 +1743,8 @@ function n0() {
|
|
|
1727
1743
|
var a = f.words, n = f.sigBytes, B = this._map;
|
|
1728
1744
|
f.clamp();
|
|
1729
1745
|
for (var i = [], l = 0; l < n; l += 3)
|
|
1730
|
-
for (var d = a[l >>> 2] >>> 24 - l % 4 * 8 & 255, C = a[l + 1 >>> 2] >>> 24 - (l + 1) % 4 * 8 & 255, h = a[l + 2 >>> 2] >>> 24 - (l + 2) % 4 * 8 & 255, A = d << 16 | C << 8 | h,
|
|
1731
|
-
i.push(B.charAt(A >>> 6 * (3 -
|
|
1746
|
+
for (var d = a[l >>> 2] >>> 24 - l % 4 * 8 & 255, C = a[l + 1 >>> 2] >>> 24 - (l + 1) % 4 * 8 & 255, h = a[l + 2 >>> 2] >>> 24 - (l + 2) % 4 * 8 & 255, A = d << 16 | C << 8 | h, o = 0; o < 4 && l + o * 0.75 < n; o++)
|
|
1747
|
+
i.push(B.charAt(A >>> 6 * (3 - o) & 63));
|
|
1732
1748
|
var x = B.charAt(64);
|
|
1733
1749
|
if (x)
|
|
1734
1750
|
for (; i.length % 4; )
|
|
@@ -1783,7 +1799,7 @@ function Yr() {
|
|
|
1783
1799
|
p.exports = e(L());
|
|
1784
1800
|
})(Zr, function(t) {
|
|
1785
1801
|
return (function() {
|
|
1786
|
-
var e = t,
|
|
1802
|
+
var e = t, s = e.lib, c = s.WordArray, b = e.enc;
|
|
1787
1803
|
b.Base64url = {
|
|
1788
1804
|
/**
|
|
1789
1805
|
* Converts a word array to a Base64url string.
|
|
@@ -1805,8 +1821,8 @@ function Yr() {
|
|
|
1805
1821
|
var n = f.words, B = f.sigBytes, i = a ? this._safe_map : this._map;
|
|
1806
1822
|
f.clamp();
|
|
1807
1823
|
for (var l = [], d = 0; d < B; d += 3)
|
|
1808
|
-
for (var C = n[d >>> 2] >>> 24 - d % 4 * 8 & 255, h = n[d + 1 >>> 2] >>> 24 - (d + 1) % 4 * 8 & 255, A = n[d + 2 >>> 2] >>> 24 - (d + 2) % 4 * 8 & 255,
|
|
1809
|
-
l.push(i.charAt(
|
|
1824
|
+
for (var C = n[d >>> 2] >>> 24 - d % 4 * 8 & 255, h = n[d + 1 >>> 2] >>> 24 - (d + 1) % 4 * 8 & 255, A = n[d + 2 >>> 2] >>> 24 - (d + 2) % 4 * 8 & 255, o = C << 16 | h << 8 | A, x = 0; x < 4 && d + x * 0.75 < B; x++)
|
|
1825
|
+
l.push(i.charAt(o >>> 6 * (3 - x) & 63));
|
|
1810
1826
|
var v = i.charAt(64);
|
|
1811
1827
|
if (v)
|
|
1812
1828
|
for (; l.length % 4; )
|
|
@@ -1858,14 +1874,14 @@ function Yr() {
|
|
|
1858
1874
|
});
|
|
1859
1875
|
})(b0)), b0.exports;
|
|
1860
1876
|
}
|
|
1861
|
-
var y0 = { exports: {} }, Jr = y0.exports,
|
|
1877
|
+
var y0 = { exports: {} }, Jr = y0.exports, Ie;
|
|
1862
1878
|
function i0() {
|
|
1863
|
-
return
|
|
1879
|
+
return Ie || (Ie = 1, (function(p, r) {
|
|
1864
1880
|
(function(t, e) {
|
|
1865
1881
|
p.exports = e(L());
|
|
1866
1882
|
})(Jr, function(t) {
|
|
1867
1883
|
return (function(e) {
|
|
1868
|
-
var
|
|
1884
|
+
var s = t, c = s.lib, b = c.WordArray, u = c.Hasher, f = s.algo, a = [];
|
|
1869
1885
|
(function() {
|
|
1870
1886
|
for (var C = 0; C < 64; C++)
|
|
1871
1887
|
a[C] = e.abs(e.sin(C + 1)) * 4294967296 | 0;
|
|
@@ -1881,17 +1897,17 @@ function i0() {
|
|
|
1881
1897
|
},
|
|
1882
1898
|
_doProcessBlock: function(C, h) {
|
|
1883
1899
|
for (var A = 0; A < 16; A++) {
|
|
1884
|
-
var
|
|
1885
|
-
C[
|
|
1900
|
+
var o = h + A, x = C[o];
|
|
1901
|
+
C[o] = (x << 8 | x >>> 24) & 16711935 | (x << 24 | x >>> 8) & 4278255360;
|
|
1886
1902
|
}
|
|
1887
|
-
var v = this._hash.words, F = C[h + 0], E = C[h + 1], g = C[h + 2], y = C[h + 3], R = C[h + 4], m = C[h + 5], D = C[h + 6], w = C[h + 7], k = C[h + 8],
|
|
1888
|
-
_ = B(_,
|
|
1903
|
+
var v = this._hash.words, F = C[h + 0], E = C[h + 1], g = C[h + 2], y = C[h + 3], R = C[h + 4], m = C[h + 5], D = C[h + 6], w = C[h + 7], k = C[h + 8], H = C[h + 9], O = C[h + 10], $ = C[h + 11], N = C[h + 12], K = C[h + 13], q = C[h + 14], U = C[h + 15], _ = v[0], I = v[1], P = v[2], S = v[3];
|
|
1904
|
+
_ = B(_, I, P, S, F, 7, a[0]), S = B(S, _, I, P, E, 12, a[1]), P = B(P, S, _, I, g, 17, a[2]), I = B(I, P, S, _, y, 22, a[3]), _ = B(_, I, P, S, R, 7, a[4]), S = B(S, _, I, P, m, 12, a[5]), P = B(P, S, _, I, D, 17, a[6]), I = B(I, P, S, _, w, 22, a[7]), _ = B(_, I, P, S, k, 7, a[8]), S = B(S, _, I, P, H, 12, a[9]), P = B(P, S, _, I, O, 17, a[10]), I = B(I, P, S, _, $, 22, a[11]), _ = B(_, I, P, S, N, 7, a[12]), S = B(S, _, I, P, K, 12, a[13]), P = B(P, S, _, I, q, 17, a[14]), I = B(I, P, S, _, U, 22, a[15]), _ = i(_, I, P, S, E, 5, a[16]), S = i(S, _, I, P, D, 9, a[17]), P = i(P, S, _, I, $, 14, a[18]), I = i(I, P, S, _, F, 20, a[19]), _ = i(_, I, P, S, m, 5, a[20]), S = i(S, _, I, P, O, 9, a[21]), P = i(P, S, _, I, U, 14, a[22]), I = i(I, P, S, _, R, 20, a[23]), _ = i(_, I, P, S, H, 5, a[24]), S = i(S, _, I, P, q, 9, a[25]), P = i(P, S, _, I, y, 14, a[26]), I = i(I, P, S, _, k, 20, a[27]), _ = i(_, I, P, S, K, 5, a[28]), S = i(S, _, I, P, g, 9, a[29]), P = i(P, S, _, I, w, 14, a[30]), I = i(I, P, S, _, N, 20, a[31]), _ = l(_, I, P, S, m, 4, a[32]), S = l(S, _, I, P, k, 11, a[33]), P = l(P, S, _, I, $, 16, a[34]), I = l(I, P, S, _, q, 23, a[35]), _ = l(_, I, P, S, E, 4, a[36]), S = l(S, _, I, P, R, 11, a[37]), P = l(P, S, _, I, w, 16, a[38]), I = l(I, P, S, _, O, 23, a[39]), _ = l(_, I, P, S, K, 4, a[40]), S = l(S, _, I, P, F, 11, a[41]), P = l(P, S, _, I, y, 16, a[42]), I = l(I, P, S, _, D, 23, a[43]), _ = l(_, I, P, S, H, 4, a[44]), S = l(S, _, I, P, N, 11, a[45]), P = l(P, S, _, I, U, 16, a[46]), I = l(I, P, S, _, g, 23, a[47]), _ = d(_, I, P, S, F, 6, a[48]), S = d(S, _, I, P, w, 10, a[49]), P = d(P, S, _, I, q, 15, a[50]), I = d(I, P, S, _, m, 21, a[51]), _ = d(_, I, P, S, N, 6, a[52]), S = d(S, _, I, P, y, 10, a[53]), P = d(P, S, _, I, O, 15, a[54]), I = d(I, P, S, _, E, 21, a[55]), _ = d(_, I, P, S, k, 6, a[56]), S = d(S, _, I, P, U, 10, a[57]), P = d(P, S, _, I, D, 15, a[58]), I = d(I, P, S, _, K, 21, a[59]), _ = d(_, I, P, S, R, 6, a[60]), S = d(S, _, I, P, $, 10, a[61]), P = d(P, S, _, I, g, 15, a[62]), I = d(I, P, S, _, H, 21, a[63]), v[0] = v[0] + _ | 0, v[1] = v[1] + I | 0, v[2] = v[2] + P | 0, v[3] = v[3] + S | 0;
|
|
1889
1905
|
},
|
|
1890
1906
|
_doFinalize: function() {
|
|
1891
|
-
var C = this._data, h = C.words, A = this._nDataBytes * 8,
|
|
1892
|
-
h[
|
|
1907
|
+
var C = this._data, h = C.words, A = this._nDataBytes * 8, o = C.sigBytes * 8;
|
|
1908
|
+
h[o >>> 5] |= 128 << 24 - o % 32;
|
|
1893
1909
|
var x = e.floor(A / 4294967296), v = A;
|
|
1894
|
-
h[(
|
|
1910
|
+
h[(o + 64 >>> 9 << 4) + 15] = (x << 8 | x >>> 24) & 16711935 | (x << 24 | x >>> 8) & 4278255360, h[(o + 64 >>> 9 << 4) + 14] = (v << 8 | v >>> 24) & 16711935 | (v << 24 | v >>> 8) & 4278255360, C.sigBytes = (h.length + 1) * 4, this._process();
|
|
1895
1911
|
for (var F = this._hash, E = F.words, g = 0; g < 4; g++) {
|
|
1896
1912
|
var y = E[g];
|
|
1897
1913
|
E[g] = (y << 8 | y >>> 24) & 16711935 | (y << 24 | y >>> 8) & 4278255360;
|
|
@@ -1903,35 +1919,35 @@ function i0() {
|
|
|
1903
1919
|
return C._hash = this._hash.clone(), C;
|
|
1904
1920
|
}
|
|
1905
1921
|
});
|
|
1906
|
-
function B(C, h, A,
|
|
1907
|
-
var E = C + (h & A | ~h &
|
|
1922
|
+
function B(C, h, A, o, x, v, F) {
|
|
1923
|
+
var E = C + (h & A | ~h & o) + x + F;
|
|
1908
1924
|
return (E << v | E >>> 32 - v) + h;
|
|
1909
1925
|
}
|
|
1910
|
-
function i(C, h, A,
|
|
1911
|
-
var E = C + (h &
|
|
1926
|
+
function i(C, h, A, o, x, v, F) {
|
|
1927
|
+
var E = C + (h & o | A & ~o) + x + F;
|
|
1912
1928
|
return (E << v | E >>> 32 - v) + h;
|
|
1913
1929
|
}
|
|
1914
|
-
function l(C, h, A,
|
|
1915
|
-
var E = C + (h ^ A ^
|
|
1930
|
+
function l(C, h, A, o, x, v, F) {
|
|
1931
|
+
var E = C + (h ^ A ^ o) + x + F;
|
|
1916
1932
|
return (E << v | E >>> 32 - v) + h;
|
|
1917
1933
|
}
|
|
1918
|
-
function d(C, h, A,
|
|
1919
|
-
var E = C + (A ^ (h | ~
|
|
1934
|
+
function d(C, h, A, o, x, v, F) {
|
|
1935
|
+
var E = C + (A ^ (h | ~o)) + x + F;
|
|
1920
1936
|
return (E << v | E >>> 32 - v) + h;
|
|
1921
1937
|
}
|
|
1922
|
-
|
|
1938
|
+
s.MD5 = u._createHelper(n), s.HmacMD5 = u._createHmacHelper(n);
|
|
1923
1939
|
})(Math), t.MD5;
|
|
1924
1940
|
});
|
|
1925
1941
|
})(y0)), y0.exports;
|
|
1926
1942
|
}
|
|
1927
|
-
var _0 = { exports: {} }, et = _0.exports,
|
|
1943
|
+
var _0 = { exports: {} }, et = _0.exports, Pe;
|
|
1928
1944
|
function lr() {
|
|
1929
|
-
return
|
|
1945
|
+
return Pe || (Pe = 1, (function(p, r) {
|
|
1930
1946
|
(function(t, e) {
|
|
1931
1947
|
p.exports = e(L());
|
|
1932
1948
|
})(et, function(t) {
|
|
1933
1949
|
return (function() {
|
|
1934
|
-
var e = t,
|
|
1950
|
+
var e = t, s = e.lib, c = s.WordArray, b = s.Hasher, u = e.algo, f = [], a = u.SHA1 = b.extend({
|
|
1935
1951
|
_doReset: function() {
|
|
1936
1952
|
this._hash = new c.init([
|
|
1937
1953
|
1732584193,
|
|
@@ -1942,15 +1958,15 @@ function lr() {
|
|
|
1942
1958
|
]);
|
|
1943
1959
|
},
|
|
1944
1960
|
_doProcessBlock: function(n, B) {
|
|
1945
|
-
for (var i = this._hash.words, l = i[0], d = i[1], C = i[2], h = i[3], A = i[4],
|
|
1946
|
-
if (
|
|
1947
|
-
f[
|
|
1961
|
+
for (var i = this._hash.words, l = i[0], d = i[1], C = i[2], h = i[3], A = i[4], o = 0; o < 80; o++) {
|
|
1962
|
+
if (o < 16)
|
|
1963
|
+
f[o] = n[B + o] | 0;
|
|
1948
1964
|
else {
|
|
1949
|
-
var x = f[
|
|
1950
|
-
f[
|
|
1965
|
+
var x = f[o - 3] ^ f[o - 8] ^ f[o - 14] ^ f[o - 16];
|
|
1966
|
+
f[o] = x << 1 | x >>> 31;
|
|
1951
1967
|
}
|
|
1952
|
-
var v = (l << 5 | l >>> 27) + A + f[
|
|
1953
|
-
|
|
1968
|
+
var v = (l << 5 | l >>> 27) + A + f[o];
|
|
1969
|
+
o < 20 ? v += (d & C | ~d & h) + 1518500249 : o < 40 ? v += (d ^ C ^ h) + 1859775393 : o < 60 ? v += (d & C | d & h | C & h) - 1894007588 : v += (d ^ C ^ h) - 899497514, A = h, h = C, C = d << 30 | d >>> 2, d = l, l = v;
|
|
1954
1970
|
}
|
|
1955
1971
|
i[0] = i[0] + l | 0, i[1] = i[1] + d | 0, i[2] = i[2] + C | 0, i[3] = i[3] + h | 0, i[4] = i[4] + A | 0;
|
|
1956
1972
|
},
|
|
@@ -1975,10 +1991,10 @@ function de() {
|
|
|
1975
1991
|
p.exports = e(L());
|
|
1976
1992
|
})(rt, function(t) {
|
|
1977
1993
|
return (function(e) {
|
|
1978
|
-
var
|
|
1994
|
+
var s = t, c = s.lib, b = c.WordArray, u = c.Hasher, f = s.algo, a = [], n = [];
|
|
1979
1995
|
(function() {
|
|
1980
1996
|
function l(A) {
|
|
1981
|
-
for (var
|
|
1997
|
+
for (var o = e.sqrt(A), x = 2; x <= o; x++)
|
|
1982
1998
|
if (!(A % x))
|
|
1983
1999
|
return !1;
|
|
1984
2000
|
return !0;
|
|
@@ -1994,17 +2010,17 @@ function de() {
|
|
|
1994
2010
|
this._hash = new b.init(a.slice(0));
|
|
1995
2011
|
},
|
|
1996
2012
|
_doProcessBlock: function(l, d) {
|
|
1997
|
-
for (var C = this._hash.words, h = C[0], A = C[1],
|
|
2013
|
+
for (var C = this._hash.words, h = C[0], A = C[1], o = C[2], x = C[3], v = C[4], F = C[5], E = C[6], g = C[7], y = 0; y < 64; y++) {
|
|
1998
2014
|
if (y < 16)
|
|
1999
2015
|
B[y] = l[d + y] | 0;
|
|
2000
2016
|
else {
|
|
2001
2017
|
var R = B[y - 15], m = (R << 25 | R >>> 7) ^ (R << 14 | R >>> 18) ^ R >>> 3, D = B[y - 2], w = (D << 15 | D >>> 17) ^ (D << 13 | D >>> 19) ^ D >>> 10;
|
|
2002
2018
|
B[y] = m + B[y - 7] + w + B[y - 16];
|
|
2003
2019
|
}
|
|
2004
|
-
var k = v & F ^ ~v & E,
|
|
2005
|
-
g = E, E = F, F = v, v = x + N | 0, x =
|
|
2020
|
+
var k = v & F ^ ~v & E, H = h & A ^ h & o ^ A & o, O = (h << 30 | h >>> 2) ^ (h << 19 | h >>> 13) ^ (h << 10 | h >>> 22), $ = (v << 26 | v >>> 6) ^ (v << 21 | v >>> 11) ^ (v << 7 | v >>> 25), N = g + $ + k + n[y] + B[y], K = O + H;
|
|
2021
|
+
g = E, E = F, F = v, v = x + N | 0, x = o, o = A, A = h, h = N + K | 0;
|
|
2006
2022
|
}
|
|
2007
|
-
C[0] = C[0] + h | 0, C[1] = C[1] + A | 0, C[2] = C[2] +
|
|
2023
|
+
C[0] = C[0] + h | 0, C[1] = C[1] + A | 0, C[2] = C[2] + o | 0, C[3] = C[3] + x | 0, C[4] = C[4] + v | 0, C[5] = C[5] + F | 0, C[6] = C[6] + E | 0, C[7] = C[7] + g | 0;
|
|
2008
2024
|
},
|
|
2009
2025
|
_doFinalize: function() {
|
|
2010
2026
|
var l = this._data, d = l.words, C = this._nDataBytes * 8, h = l.sigBytes * 8;
|
|
@@ -2015,19 +2031,19 @@ function de() {
|
|
|
2015
2031
|
return l._hash = this._hash.clone(), l;
|
|
2016
2032
|
}
|
|
2017
2033
|
});
|
|
2018
|
-
|
|
2034
|
+
s.SHA256 = u._createHelper(i), s.HmacSHA256 = u._createHmacHelper(i);
|
|
2019
2035
|
})(Math), t.SHA256;
|
|
2020
2036
|
});
|
|
2021
2037
|
})(w0)), w0.exports;
|
|
2022
2038
|
}
|
|
2023
|
-
var k0 = { exports: {} }, tt = k0.exports,
|
|
2039
|
+
var k0 = { exports: {} }, tt = k0.exports, Me;
|
|
2024
2040
|
function at() {
|
|
2025
|
-
return
|
|
2026
|
-
(function(t, e,
|
|
2041
|
+
return Me || (Me = 1, (function(p, r) {
|
|
2042
|
+
(function(t, e, s) {
|
|
2027
2043
|
p.exports = e(L(), de());
|
|
2028
2044
|
})(tt, function(t) {
|
|
2029
2045
|
return (function() {
|
|
2030
|
-
var e = t,
|
|
2046
|
+
var e = t, s = e.lib, c = s.WordArray, b = e.algo, u = b.SHA256, f = b.SHA224 = u.extend({
|
|
2031
2047
|
_doReset: function() {
|
|
2032
2048
|
this._hash = new c.init([
|
|
2033
2049
|
3238371032,
|
|
@@ -2050,14 +2066,14 @@ function at() {
|
|
|
2050
2066
|
});
|
|
2051
2067
|
})(k0)), k0.exports;
|
|
2052
2068
|
}
|
|
2053
|
-
var S0 = { exports: {} }, nt = S0.exports,
|
|
2069
|
+
var S0 = { exports: {} }, nt = S0.exports, He;
|
|
2054
2070
|
function dr() {
|
|
2055
|
-
return
|
|
2056
|
-
(function(t, e,
|
|
2071
|
+
return He || (He = 1, (function(p, r) {
|
|
2072
|
+
(function(t, e, s) {
|
|
2057
2073
|
p.exports = e(L(), ne());
|
|
2058
2074
|
})(nt, function(t) {
|
|
2059
2075
|
return (function() {
|
|
2060
|
-
var e = t,
|
|
2076
|
+
var e = t, s = e.lib, c = s.Hasher, b = e.x64, u = b.Word, f = b.WordArray, a = e.algo;
|
|
2061
2077
|
function n() {
|
|
2062
2078
|
return u.create.apply(u, arguments);
|
|
2063
2079
|
}
|
|
@@ -2161,7 +2177,7 @@ function dr() {
|
|
|
2161
2177
|
]);
|
|
2162
2178
|
},
|
|
2163
2179
|
_doProcessBlock: function(d, C) {
|
|
2164
|
-
for (var h = this._hash.words, A = h[0],
|
|
2180
|
+
for (var h = this._hash.words, A = h[0], o = h[1], x = h[2], v = h[3], F = h[4], E = h[5], g = h[6], y = h[7], R = A.high, m = A.low, D = o.high, w = o.low, k = x.high, H = x.low, O = v.high, $ = v.low, N = F.high, K = F.low, q = E.high, U = E.low, _ = g.high, I = g.low, P = y.high, S = y.low, W = R, z = m, X = D, T = w, c0 = k, s0 = H, ie = O, l0 = $, Y = N, V = K, p0 = q, d0 = U, C0 = _, f0 = I, se = P, u0 = S, J = 0; J < 80; J++) {
|
|
2165
2181
|
var Z, e0, B0 = i[J];
|
|
2166
2182
|
if (J < 16)
|
|
2167
2183
|
e0 = B0.high = d[C + J * 2] | 0, Z = B0.low = d[C + J * 2 + 1] | 0;
|
|
@@ -2172,13 +2188,13 @@ function dr() {
|
|
|
2172
2188
|
var mr = Y & p0 ^ ~Y & C0, Ae = V & d0 ^ ~V & f0, Ar = W & X ^ W & c0 ^ X & c0, Er = z & T ^ z & s0 ^ T & s0, Fr = (W >>> 28 | z << 4) ^ (W << 30 | z >>> 2) ^ (W << 25 | z >>> 7), Ee = (z >>> 28 | W << 4) ^ (z << 30 | W >>> 2) ^ (z << 25 | W >>> 7), Dr = (Y >>> 14 | V << 18) ^ (Y >>> 18 | V << 14) ^ (Y << 23 | V >>> 9), gr = (V >>> 14 | Y << 18) ^ (V >>> 18 | Y << 14) ^ (V << 23 | Y >>> 9), Fe = B[J], br = Fe.high, De = Fe.low, j = u0 + gr, r0 = se + Dr + (j >>> 0 < u0 >>> 0 ? 1 : 0), j = j + Ae, r0 = r0 + mr + (j >>> 0 < Ae >>> 0 ? 1 : 0), j = j + De, r0 = r0 + br + (j >>> 0 < De >>> 0 ? 1 : 0), j = j + Z, r0 = r0 + e0 + (j >>> 0 < Z >>> 0 ? 1 : 0), ge = Ee + Er, yr = Fr + Ar + (ge >>> 0 < Ee >>> 0 ? 1 : 0);
|
|
2173
2189
|
se = C0, u0 = f0, C0 = p0, f0 = d0, p0 = Y, d0 = V, V = l0 + j | 0, Y = ie + r0 + (V >>> 0 < l0 >>> 0 ? 1 : 0) | 0, ie = c0, l0 = s0, c0 = X, s0 = T, X = W, T = z, z = j + ge | 0, W = r0 + yr + (z >>> 0 < j >>> 0 ? 1 : 0) | 0;
|
|
2174
2190
|
}
|
|
2175
|
-
m = A.low = m + z, A.high = R + W + (m >>> 0 < z >>> 0 ? 1 : 0), w =
|
|
2191
|
+
m = A.low = m + z, A.high = R + W + (m >>> 0 < z >>> 0 ? 1 : 0), w = o.low = w + T, o.high = D + X + (w >>> 0 < T >>> 0 ? 1 : 0), H = x.low = H + s0, x.high = k + c0 + (H >>> 0 < s0 >>> 0 ? 1 : 0), $ = v.low = $ + l0, v.high = O + ie + ($ >>> 0 < l0 >>> 0 ? 1 : 0), K = F.low = K + V, F.high = N + Y + (K >>> 0 < V >>> 0 ? 1 : 0), U = E.low = U + d0, E.high = q + p0 + (U >>> 0 < d0 >>> 0 ? 1 : 0), I = g.low = I + f0, g.high = _ + C0 + (I >>> 0 < f0 >>> 0 ? 1 : 0), S = y.low = S + u0, y.high = P + se + (S >>> 0 < u0 >>> 0 ? 1 : 0);
|
|
2176
2192
|
},
|
|
2177
2193
|
_doFinalize: function() {
|
|
2178
2194
|
var d = this._data, C = d.words, h = this._nDataBytes * 8, A = d.sigBytes * 8;
|
|
2179
2195
|
C[A >>> 5] |= 128 << 24 - A % 32, C[(A + 128 >>> 10 << 5) + 30] = Math.floor(h / 4294967296), C[(A + 128 >>> 10 << 5) + 31] = h, d.sigBytes = C.length * 4, this._process();
|
|
2180
|
-
var
|
|
2181
|
-
return
|
|
2196
|
+
var o = this._hash.toX32();
|
|
2197
|
+
return o;
|
|
2182
2198
|
},
|
|
2183
2199
|
clone: function() {
|
|
2184
2200
|
var d = c.clone.call(this);
|
|
@@ -2191,14 +2207,14 @@ function dr() {
|
|
|
2191
2207
|
});
|
|
2192
2208
|
})(S0)), S0.exports;
|
|
2193
2209
|
}
|
|
2194
|
-
var
|
|
2210
|
+
var I0 = { exports: {} }, it = I0.exports, Oe;
|
|
2195
2211
|
function st() {
|
|
2196
2212
|
return Oe || (Oe = 1, (function(p, r) {
|
|
2197
|
-
(function(t, e,
|
|
2213
|
+
(function(t, e, s) {
|
|
2198
2214
|
p.exports = e(L(), ne(), dr());
|
|
2199
2215
|
})(it, function(t) {
|
|
2200
2216
|
return (function() {
|
|
2201
|
-
var e = t,
|
|
2217
|
+
var e = t, s = e.x64, c = s.Word, b = s.WordArray, u = e.algo, f = u.SHA512, a = u.SHA384 = f.extend({
|
|
2202
2218
|
_doReset: function() {
|
|
2203
2219
|
this._hash = new b.init([
|
|
2204
2220
|
new c.init(3418070365, 3238371032),
|
|
@@ -2219,19 +2235,19 @@ function st() {
|
|
|
2219
2235
|
e.SHA384 = f._createHelper(a), e.HmacSHA384 = f._createHmacHelper(a);
|
|
2220
2236
|
})(), t.SHA384;
|
|
2221
2237
|
});
|
|
2222
|
-
})(
|
|
2238
|
+
})(I0)), I0.exports;
|
|
2223
2239
|
}
|
|
2224
|
-
var
|
|
2240
|
+
var P0 = { exports: {} }, ot = P0.exports, $e;
|
|
2225
2241
|
function xt() {
|
|
2226
2242
|
return $e || ($e = 1, (function(p, r) {
|
|
2227
|
-
(function(t, e,
|
|
2243
|
+
(function(t, e, s) {
|
|
2228
2244
|
p.exports = e(L(), ne());
|
|
2229
2245
|
})(ot, function(t) {
|
|
2230
2246
|
return (function(e) {
|
|
2231
|
-
var
|
|
2247
|
+
var s = t, c = s.lib, b = c.WordArray, u = c.Hasher, f = s.x64, a = f.Word, n = s.algo, B = [], i = [], l = [];
|
|
2232
2248
|
(function() {
|
|
2233
|
-
for (var h = 1, A = 0,
|
|
2234
|
-
B[h + 5 * A] = (
|
|
2249
|
+
for (var h = 1, A = 0, o = 0; o < 24; o++) {
|
|
2250
|
+
B[h + 5 * A] = (o + 1) * (o + 2) / 2 % 64;
|
|
2235
2251
|
var x = A % 5, v = (2 * h + 3 * A) % 5;
|
|
2236
2252
|
h = x, A = v;
|
|
2237
2253
|
}
|
|
@@ -2272,48 +2288,48 @@ function xt() {
|
|
|
2272
2288
|
this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
|
|
2273
2289
|
},
|
|
2274
2290
|
_doProcessBlock: function(h, A) {
|
|
2275
|
-
for (var
|
|
2291
|
+
for (var o = this._state, x = this.blockSize / 2, v = 0; v < x; v++) {
|
|
2276
2292
|
var F = h[A + 2 * v], E = h[A + 2 * v + 1];
|
|
2277
2293
|
F = (F << 8 | F >>> 24) & 16711935 | (F << 24 | F >>> 8) & 4278255360, E = (E << 8 | E >>> 24) & 16711935 | (E << 24 | E >>> 8) & 4278255360;
|
|
2278
|
-
var g =
|
|
2294
|
+
var g = o[v];
|
|
2279
2295
|
g.high ^= E, g.low ^= F;
|
|
2280
2296
|
}
|
|
2281
2297
|
for (var y = 0; y < 24; y++) {
|
|
2282
2298
|
for (var R = 0; R < 5; R++) {
|
|
2283
2299
|
for (var m = 0, D = 0, w = 0; w < 5; w++) {
|
|
2284
|
-
var g =
|
|
2300
|
+
var g = o[R + 5 * w];
|
|
2285
2301
|
m ^= g.high, D ^= g.low;
|
|
2286
2302
|
}
|
|
2287
2303
|
var k = d[R];
|
|
2288
2304
|
k.high = m, k.low = D;
|
|
2289
2305
|
}
|
|
2290
2306
|
for (var R = 0; R < 5; R++)
|
|
2291
|
-
for (var
|
|
2292
|
-
var g =
|
|
2307
|
+
for (var H = d[(R + 4) % 5], O = d[(R + 1) % 5], $ = O.high, N = O.low, m = H.high ^ ($ << 1 | N >>> 31), D = H.low ^ (N << 1 | $ >>> 31), w = 0; w < 5; w++) {
|
|
2308
|
+
var g = o[R + 5 * w];
|
|
2293
2309
|
g.high ^= m, g.low ^= D;
|
|
2294
2310
|
}
|
|
2295
2311
|
for (var K = 1; K < 25; K++) {
|
|
2296
|
-
var m, D, g =
|
|
2312
|
+
var m, D, g = o[K], q = g.high, U = g.low, _ = B[K];
|
|
2297
2313
|
_ < 32 ? (m = q << _ | U >>> 32 - _, D = U << _ | q >>> 32 - _) : (m = U << _ - 32 | q >>> 64 - _, D = q << _ - 32 | U >>> 64 - _);
|
|
2298
|
-
var
|
|
2299
|
-
|
|
2314
|
+
var I = d[i[K]];
|
|
2315
|
+
I.high = m, I.low = D;
|
|
2300
2316
|
}
|
|
2301
|
-
var
|
|
2302
|
-
|
|
2317
|
+
var P = d[0], S = o[0];
|
|
2318
|
+
P.high = S.high, P.low = S.low;
|
|
2303
2319
|
for (var R = 0; R < 5; R++)
|
|
2304
2320
|
for (var w = 0; w < 5; w++) {
|
|
2305
|
-
var K = R + 5 * w, g =
|
|
2321
|
+
var K = R + 5 * w, g = o[K], W = d[K], z = d[(R + 1) % 5 + 5 * w], X = d[(R + 2) % 5 + 5 * w];
|
|
2306
2322
|
g.high = W.high ^ ~z.high & X.high, g.low = W.low ^ ~z.low & X.low;
|
|
2307
2323
|
}
|
|
2308
|
-
var g =
|
|
2324
|
+
var g = o[0], T = l[y];
|
|
2309
2325
|
g.high ^= T.high, g.low ^= T.low;
|
|
2310
2326
|
}
|
|
2311
2327
|
},
|
|
2312
2328
|
_doFinalize: function() {
|
|
2313
2329
|
var h = this._data, A = h.words;
|
|
2314
2330
|
this._nDataBytes * 8;
|
|
2315
|
-
var
|
|
2316
|
-
A[
|
|
2331
|
+
var o = h.sigBytes * 8, x = this.blockSize * 32;
|
|
2332
|
+
A[o >>> 5] |= 1 << 24 - o % 32, A[(e.ceil((o + 1) / x) * x >>> 5) - 1] |= 128, h.sigBytes = A.length * 4, this._process();
|
|
2317
2333
|
for (var v = this._state, F = this.cfg.outputLength / 8, E = F / 8, g = [], y = 0; y < E; y++) {
|
|
2318
2334
|
var R = v[y], m = R.high, D = R.low;
|
|
2319
2335
|
m = (m << 8 | m >>> 24) & 16711935 | (m << 24 | m >>> 8) & 4278255360, D = (D << 8 | D >>> 24) & 16711935 | (D << 24 | D >>> 8) & 4278255360, g.push(D), g.push(m);
|
|
@@ -2321,15 +2337,15 @@ function xt() {
|
|
|
2321
2337
|
return new b.init(g, F);
|
|
2322
2338
|
},
|
|
2323
2339
|
clone: function() {
|
|
2324
|
-
for (var h = u.clone.call(this), A = h._state = this._state.slice(0),
|
|
2325
|
-
A[
|
|
2340
|
+
for (var h = u.clone.call(this), A = h._state = this._state.slice(0), o = 0; o < 25; o++)
|
|
2341
|
+
A[o] = A[o].clone();
|
|
2326
2342
|
return h;
|
|
2327
2343
|
}
|
|
2328
2344
|
});
|
|
2329
|
-
|
|
2345
|
+
s.SHA3 = u._createHelper(C), s.HmacSHA3 = u._createHmacHelper(C);
|
|
2330
2346
|
})(Math), t.SHA3;
|
|
2331
2347
|
});
|
|
2332
|
-
})(
|
|
2348
|
+
})(P0)), P0.exports;
|
|
2333
2349
|
}
|
|
2334
2350
|
var R0 = { exports: {} }, ct = R0.exports, Te;
|
|
2335
2351
|
function lt() {
|
|
@@ -2348,7 +2364,7 @@ function lt() {
|
|
|
2348
2364
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
2349
2365
|
*/
|
|
2350
2366
|
return (function(e) {
|
|
2351
|
-
var
|
|
2367
|
+
var s = t, c = s.lib, b = c.WordArray, u = c.Hasher, f = s.algo, a = b.create([
|
|
2352
2368
|
0,
|
|
2353
2369
|
1,
|
|
2354
2370
|
2,
|
|
@@ -2681,11 +2697,11 @@ function lt() {
|
|
|
2681
2697
|
var R = g + y, m = E[R];
|
|
2682
2698
|
E[R] = (m << 8 | m >>> 24) & 16711935 | (m << 24 | m >>> 8) & 4278255360;
|
|
2683
2699
|
}
|
|
2684
|
-
var D = this._hash.words, w = l.words, k = d.words,
|
|
2685
|
-
|
|
2700
|
+
var D = this._hash.words, w = l.words, k = d.words, H = a.words, O = n.words, $ = B.words, N = i.words, K, q, U, _, I, P, S, W, z, X;
|
|
2701
|
+
P = K = D[0], S = q = D[1], W = U = D[2], z = _ = D[3], X = I = D[4];
|
|
2686
2702
|
for (var T, y = 0; y < 80; y += 1)
|
|
2687
|
-
T = K + E[g +
|
|
2688
|
-
T = D[1] + U + z | 0, D[1] = D[2] + _ + X | 0, D[2] = D[3] +
|
|
2703
|
+
T = K + E[g + H[y]] | 0, y < 16 ? T += h(q, U, _) + w[0] : y < 32 ? T += A(q, U, _) + w[1] : y < 48 ? T += o(q, U, _) + w[2] : y < 64 ? T += x(q, U, _) + w[3] : T += v(q, U, _) + w[4], T = T | 0, T = F(T, $[y]), T = T + I | 0, K = I, I = _, _ = F(U, 10), U = q, q = T, T = P + E[g + O[y]] | 0, y < 16 ? T += v(S, W, z) + k[0] : y < 32 ? T += x(S, W, z) + k[1] : y < 48 ? T += o(S, W, z) + k[2] : y < 64 ? T += A(S, W, z) + k[3] : T += h(S, W, z) + k[4], T = T | 0, T = F(T, N[y]), T = T + X | 0, P = X, X = z, z = F(W, 10), W = S, S = T;
|
|
2704
|
+
T = D[1] + U + z | 0, D[1] = D[2] + _ + X | 0, D[2] = D[3] + I + P | 0, D[3] = D[4] + K + S | 0, D[4] = D[0] + q + W | 0, D[0] = T;
|
|
2689
2705
|
},
|
|
2690
2706
|
_doFinalize: function() {
|
|
2691
2707
|
var E = this._data, g = E.words, y = this._nDataBytes * 8, R = E.sigBytes * 8;
|
|
@@ -2707,7 +2723,7 @@ function lt() {
|
|
|
2707
2723
|
function A(E, g, y) {
|
|
2708
2724
|
return E & g | ~E & y;
|
|
2709
2725
|
}
|
|
2710
|
-
function
|
|
2726
|
+
function o(E, g, y) {
|
|
2711
2727
|
return (E | ~g) ^ y;
|
|
2712
2728
|
}
|
|
2713
2729
|
function x(E, g, y) {
|
|
@@ -2719,19 +2735,19 @@ function lt() {
|
|
|
2719
2735
|
function F(E, g) {
|
|
2720
2736
|
return E << g | E >>> 32 - g;
|
|
2721
2737
|
}
|
|
2722
|
-
|
|
2738
|
+
s.RIPEMD160 = u._createHelper(C), s.HmacRIPEMD160 = u._createHmacHelper(C);
|
|
2723
2739
|
})(), t.RIPEMD160;
|
|
2724
2740
|
});
|
|
2725
2741
|
})(R0)), R0.exports;
|
|
2726
2742
|
}
|
|
2727
|
-
var
|
|
2743
|
+
var M0 = { exports: {} }, dt = M0.exports, Le;
|
|
2728
2744
|
function fe() {
|
|
2729
2745
|
return Le || (Le = 1, (function(p, r) {
|
|
2730
2746
|
(function(t, e) {
|
|
2731
2747
|
p.exports = e(L());
|
|
2732
2748
|
})(dt, function(t) {
|
|
2733
2749
|
(function() {
|
|
2734
|
-
var e = t,
|
|
2750
|
+
var e = t, s = e.lib, c = s.Base, b = e.enc, u = b.Utf8, f = e.algo;
|
|
2735
2751
|
f.HMAC = c.extend({
|
|
2736
2752
|
/**
|
|
2737
2753
|
* Initializes a newly created HMAC.
|
|
@@ -2800,16 +2816,16 @@ function fe() {
|
|
|
2800
2816
|
});
|
|
2801
2817
|
})();
|
|
2802
2818
|
});
|
|
2803
|
-
})(
|
|
2819
|
+
})(M0)), M0.exports;
|
|
2804
2820
|
}
|
|
2805
|
-
var
|
|
2821
|
+
var H0 = { exports: {} }, ft = H0.exports, Ke;
|
|
2806
2822
|
function ut() {
|
|
2807
2823
|
return Ke || (Ke = 1, (function(p, r) {
|
|
2808
|
-
(function(t, e,
|
|
2824
|
+
(function(t, e, s) {
|
|
2809
2825
|
p.exports = e(L(), de(), fe());
|
|
2810
2826
|
})(ft, function(t) {
|
|
2811
2827
|
return (function() {
|
|
2812
|
-
var e = t,
|
|
2828
|
+
var e = t, s = e.lib, c = s.Base, b = s.WordArray, u = e.algo, f = u.SHA256, a = u.HMAC, n = u.PBKDF2 = c.extend({
|
|
2813
2829
|
/**
|
|
2814
2830
|
* Configuration options.
|
|
2815
2831
|
*
|
|
@@ -2849,7 +2865,7 @@ function ut() {
|
|
|
2849
2865
|
* var key = kdf.compute(password, salt);
|
|
2850
2866
|
*/
|
|
2851
2867
|
compute: function(B, i) {
|
|
2852
|
-
for (var l = this.cfg, d = a.create(l.hasher, B), C = b.create(), h = b.create([1]), A = C.words,
|
|
2868
|
+
for (var l = this.cfg, d = a.create(l.hasher, B), C = b.create(), h = b.create([1]), A = C.words, o = h.words, x = l.keySize, v = l.iterations; A.length < x; ) {
|
|
2853
2869
|
var F = d.update(i).finalize(h);
|
|
2854
2870
|
d.reset();
|
|
2855
2871
|
for (var E = F.words, g = E.length, y = F, R = 1; R < v; R++) {
|
|
@@ -2857,7 +2873,7 @@ function ut() {
|
|
|
2857
2873
|
for (var m = y.words, D = 0; D < g; D++)
|
|
2858
2874
|
E[D] ^= m[D];
|
|
2859
2875
|
}
|
|
2860
|
-
C.concat(F),
|
|
2876
|
+
C.concat(F), o[0]++;
|
|
2861
2877
|
}
|
|
2862
2878
|
return C.sigBytes = x * 4, C;
|
|
2863
2879
|
}
|
|
@@ -2867,16 +2883,16 @@ function ut() {
|
|
|
2867
2883
|
};
|
|
2868
2884
|
})(), t.PBKDF2;
|
|
2869
2885
|
});
|
|
2870
|
-
})(
|
|
2886
|
+
})(H0)), H0.exports;
|
|
2871
2887
|
}
|
|
2872
2888
|
var O0 = { exports: {} }, ht = O0.exports, Ue;
|
|
2873
2889
|
function a0() {
|
|
2874
2890
|
return Ue || (Ue = 1, (function(p, r) {
|
|
2875
|
-
(function(t, e,
|
|
2891
|
+
(function(t, e, s) {
|
|
2876
2892
|
p.exports = e(L(), lr(), fe());
|
|
2877
2893
|
})(ht, function(t) {
|
|
2878
2894
|
return (function() {
|
|
2879
|
-
var e = t,
|
|
2895
|
+
var e = t, s = e.lib, c = s.Base, b = s.WordArray, u = e.algo, f = u.MD5, a = u.EvpKDF = c.extend({
|
|
2880
2896
|
/**
|
|
2881
2897
|
* Configuration options.
|
|
2882
2898
|
*
|
|
@@ -2916,9 +2932,9 @@ function a0() {
|
|
|
2916
2932
|
* var key = kdf.compute(password, salt);
|
|
2917
2933
|
*/
|
|
2918
2934
|
compute: function(n, B) {
|
|
2919
|
-
for (var i, l = this.cfg, d = l.hasher.create(), C = b.create(), h = C.words, A = l.keySize,
|
|
2935
|
+
for (var i, l = this.cfg, d = l.hasher.create(), C = b.create(), h = C.words, A = l.keySize, o = l.iterations; h.length < A; ) {
|
|
2920
2936
|
i && d.update(i), i = d.update(n).finalize(B), d.reset();
|
|
2921
|
-
for (var x = 1; x <
|
|
2937
|
+
for (var x = 1; x < o; x++)
|
|
2922
2938
|
i = d.finalize(i), d.reset();
|
|
2923
2939
|
C.concat(i);
|
|
2924
2940
|
}
|
|
@@ -2935,13 +2951,13 @@ function a0() {
|
|
|
2935
2951
|
var $0 = { exports: {} }, vt = $0.exports, qe;
|
|
2936
2952
|
function Q() {
|
|
2937
2953
|
return qe || (qe = 1, (function(p, r) {
|
|
2938
|
-
(function(t, e,
|
|
2954
|
+
(function(t, e, s) {
|
|
2939
2955
|
p.exports = e(L(), a0());
|
|
2940
2956
|
})(vt, function(t) {
|
|
2941
2957
|
t.lib.Cipher || (function(e) {
|
|
2942
|
-
var
|
|
2958
|
+
var s = t, c = s.lib, b = c.Base, u = c.WordArray, f = c.BufferedBlockAlgorithm, a = s.enc;
|
|
2943
2959
|
a.Utf8;
|
|
2944
|
-
var n = a.Base64, B =
|
|
2960
|
+
var n = a.Base64, B = s.algo, i = B.EvpKDF, l = c.Cipher = f.extend({
|
|
2945
2961
|
/**
|
|
2946
2962
|
* Configuration options.
|
|
2947
2963
|
*
|
|
@@ -3063,11 +3079,11 @@ function Q() {
|
|
|
3063
3079
|
}
|
|
3064
3080
|
return function(D) {
|
|
3065
3081
|
return {
|
|
3066
|
-
encrypt: function(w, k,
|
|
3067
|
-
return m(k).encrypt(D, w, k,
|
|
3082
|
+
encrypt: function(w, k, H) {
|
|
3083
|
+
return m(k).encrypt(D, w, k, H);
|
|
3068
3084
|
},
|
|
3069
|
-
decrypt: function(w, k,
|
|
3070
|
-
return m(k).decrypt(D, w, k,
|
|
3085
|
+
decrypt: function(w, k, H) {
|
|
3086
|
+
return m(k).decrypt(D, w, k, H);
|
|
3071
3087
|
}
|
|
3072
3088
|
};
|
|
3073
3089
|
};
|
|
@@ -3080,7 +3096,7 @@ function Q() {
|
|
|
3080
3096
|
},
|
|
3081
3097
|
blockSize: 1
|
|
3082
3098
|
});
|
|
3083
|
-
var d =
|
|
3099
|
+
var d = s.mode = {}, C = c.BlockCipherMode = b.extend({
|
|
3084
3100
|
/**
|
|
3085
3101
|
* Creates this mode for encryption.
|
|
3086
3102
|
*
|
|
@@ -3138,8 +3154,8 @@ function Q() {
|
|
|
3138
3154
|
* mode.processBlock(data.words, offset);
|
|
3139
3155
|
*/
|
|
3140
3156
|
processBlock: function(w, k) {
|
|
3141
|
-
var
|
|
3142
|
-
D.call(this, w, k, O),
|
|
3157
|
+
var H = this._cipher, O = H.blockSize;
|
|
3158
|
+
D.call(this, w, k, O), H.encryptBlock(w, k), this._prevBlock = w.slice(k, k + O);
|
|
3143
3159
|
}
|
|
3144
3160
|
}), m.Decryptor = m.extend({
|
|
3145
3161
|
/**
|
|
@@ -3153,18 +3169,18 @@ function Q() {
|
|
|
3153
3169
|
* mode.processBlock(data.words, offset);
|
|
3154
3170
|
*/
|
|
3155
3171
|
processBlock: function(w, k) {
|
|
3156
|
-
var
|
|
3157
|
-
|
|
3172
|
+
var H = this._cipher, O = H.blockSize, $ = w.slice(k, k + O);
|
|
3173
|
+
H.decryptBlock(w, k), D.call(this, w, k, O), this._prevBlock = $;
|
|
3158
3174
|
}
|
|
3159
3175
|
});
|
|
3160
|
-
function D(w, k,
|
|
3176
|
+
function D(w, k, H) {
|
|
3161
3177
|
var O, $ = this._iv;
|
|
3162
3178
|
$ ? (O = $, this._iv = e) : O = this._prevBlock;
|
|
3163
|
-
for (var N = 0; N <
|
|
3179
|
+
for (var N = 0; N < H; N++)
|
|
3164
3180
|
w[k + N] ^= O[N];
|
|
3165
3181
|
}
|
|
3166
3182
|
return m;
|
|
3167
|
-
})(), A =
|
|
3183
|
+
})(), A = s.pad = {}, o = A.Pkcs7 = {
|
|
3168
3184
|
/**
|
|
3169
3185
|
* Pads data using the algorithm defined in PKCS #5/7.
|
|
3170
3186
|
*
|
|
@@ -3178,8 +3194,8 @@ function Q() {
|
|
|
3178
3194
|
* CryptoJS.pad.Pkcs7.pad(wordArray, 4);
|
|
3179
3195
|
*/
|
|
3180
3196
|
pad: function(m, D) {
|
|
3181
|
-
for (var w = D * 4, k = w - m.sigBytes % w,
|
|
3182
|
-
O.push(
|
|
3197
|
+
for (var w = D * 4, k = w - m.sigBytes % w, H = k << 24 | k << 16 | k << 8 | k, O = [], $ = 0; $ < k; $ += 4)
|
|
3198
|
+
O.push(H);
|
|
3183
3199
|
var N = u.create(O, k);
|
|
3184
3200
|
m.concat(N);
|
|
3185
3201
|
},
|
|
@@ -3208,7 +3224,7 @@ function Q() {
|
|
|
3208
3224
|
*/
|
|
3209
3225
|
cfg: l.cfg.extend({
|
|
3210
3226
|
mode: h,
|
|
3211
|
-
padding:
|
|
3227
|
+
padding: o
|
|
3212
3228
|
}),
|
|
3213
3229
|
reset: function() {
|
|
3214
3230
|
var m;
|
|
@@ -3266,7 +3282,7 @@ function Q() {
|
|
|
3266
3282
|
toString: function(m) {
|
|
3267
3283
|
return (m || this.formatter).stringify(this);
|
|
3268
3284
|
}
|
|
3269
|
-
}), v =
|
|
3285
|
+
}), v = s.format = {}, F = v.OpenSSL = {
|
|
3270
3286
|
/**
|
|
3271
3287
|
* Converts a cipher params object to an OpenSSL-compatible string.
|
|
3272
3288
|
*
|
|
@@ -3330,7 +3346,7 @@ function Q() {
|
|
|
3330
3346
|
*/
|
|
3331
3347
|
encrypt: function(m, D, w, k) {
|
|
3332
3348
|
k = this.cfg.extend(k);
|
|
3333
|
-
var
|
|
3349
|
+
var H = m.createEncryptor(w, k), O = H.finalize(D), $ = H.cfg;
|
|
3334
3350
|
return x.create({
|
|
3335
3351
|
ciphertext: O,
|
|
3336
3352
|
key: w,
|
|
@@ -3361,8 +3377,8 @@ function Q() {
|
|
|
3361
3377
|
*/
|
|
3362
3378
|
decrypt: function(m, D, w, k) {
|
|
3363
3379
|
k = this.cfg.extend(k), D = this._parse(D, k.format);
|
|
3364
|
-
var
|
|
3365
|
-
return
|
|
3380
|
+
var H = m.createDecryptor(w, k).finalize(D.ciphertext);
|
|
3381
|
+
return H;
|
|
3366
3382
|
},
|
|
3367
3383
|
/**
|
|
3368
3384
|
* Converts serialized ciphertext to CipherParams,
|
|
@@ -3382,7 +3398,7 @@ function Q() {
|
|
|
3382
3398
|
_parse: function(m, D) {
|
|
3383
3399
|
return typeof m == "string" ? D.parse(m, this) : m;
|
|
3384
3400
|
}
|
|
3385
|
-
}), g =
|
|
3401
|
+
}), g = s.kdf = {}, y = g.OpenSSL = {
|
|
3386
3402
|
/**
|
|
3387
3403
|
* Derives a key and IV from a password.
|
|
3388
3404
|
*
|
|
@@ -3400,9 +3416,9 @@ function Q() {
|
|
|
3400
3416
|
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
|
|
3401
3417
|
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
|
|
3402
3418
|
*/
|
|
3403
|
-
execute: function(m, D, w, k,
|
|
3404
|
-
if (k || (k = u.random(64 / 8)),
|
|
3405
|
-
var O = i.create({ keySize: D + w, hasher:
|
|
3419
|
+
execute: function(m, D, w, k, H) {
|
|
3420
|
+
if (k || (k = u.random(64 / 8)), H)
|
|
3421
|
+
var O = i.create({ keySize: D + w, hasher: H }).compute(m, k);
|
|
3406
3422
|
else
|
|
3407
3423
|
var O = i.create({ keySize: D + w }).compute(m, k);
|
|
3408
3424
|
var $ = u.create(O.words.slice(D), w * 4);
|
|
@@ -3436,10 +3452,10 @@ function Q() {
|
|
|
3436
3452
|
*/
|
|
3437
3453
|
encrypt: function(m, D, w, k) {
|
|
3438
3454
|
k = this.cfg.extend(k);
|
|
3439
|
-
var
|
|
3440
|
-
k.iv =
|
|
3441
|
-
var O = E.encrypt.call(this, m, D,
|
|
3442
|
-
return O.mixIn(
|
|
3455
|
+
var H = k.kdf.execute(w, m.keySize, m.ivSize, k.salt, k.hasher);
|
|
3456
|
+
k.iv = H.iv;
|
|
3457
|
+
var O = E.encrypt.call(this, m, D, H.key, k);
|
|
3458
|
+
return O.mixIn(H), O;
|
|
3443
3459
|
},
|
|
3444
3460
|
/**
|
|
3445
3461
|
* Decrypts serialized ciphertext using a password.
|
|
@@ -3460,9 +3476,9 @@ function Q() {
|
|
|
3460
3476
|
*/
|
|
3461
3477
|
decrypt: function(m, D, w, k) {
|
|
3462
3478
|
k = this.cfg.extend(k), D = this._parse(D, k.format);
|
|
3463
|
-
var
|
|
3464
|
-
k.iv =
|
|
3465
|
-
var O = E.decrypt.call(this, m, D,
|
|
3479
|
+
var H = k.kdf.execute(w, m.keySize, m.ivSize, D.salt, k.hasher);
|
|
3480
|
+
k.iv = H.iv;
|
|
3481
|
+
var O = E.decrypt.call(this, m, D, H.key, k);
|
|
3466
3482
|
return O;
|
|
3467
3483
|
}
|
|
3468
3484
|
});
|
|
@@ -3473,7 +3489,7 @@ function Q() {
|
|
|
3473
3489
|
var T0 = { exports: {} }, pt = T0.exports, ze;
|
|
3474
3490
|
function Ct() {
|
|
3475
3491
|
return ze || (ze = 1, (function(p, r) {
|
|
3476
|
-
(function(t, e,
|
|
3492
|
+
(function(t, e, s) {
|
|
3477
3493
|
p.exports = e(L(), Q());
|
|
3478
3494
|
})(pt, function(t) {
|
|
3479
3495
|
return t.mode.CFB = (function() {
|
|
@@ -3481,15 +3497,15 @@ function Ct() {
|
|
|
3481
3497
|
e.Encryptor = e.extend({
|
|
3482
3498
|
processBlock: function(c, b) {
|
|
3483
3499
|
var u = this._cipher, f = u.blockSize;
|
|
3484
|
-
|
|
3500
|
+
s.call(this, c, b, f, u), this._prevBlock = c.slice(b, b + f);
|
|
3485
3501
|
}
|
|
3486
3502
|
}), e.Decryptor = e.extend({
|
|
3487
3503
|
processBlock: function(c, b) {
|
|
3488
3504
|
var u = this._cipher, f = u.blockSize, a = c.slice(b, b + f);
|
|
3489
|
-
|
|
3505
|
+
s.call(this, c, b, f, u), this._prevBlock = a;
|
|
3490
3506
|
}
|
|
3491
3507
|
});
|
|
3492
|
-
function
|
|
3508
|
+
function s(c, b, u, f) {
|
|
3493
3509
|
var a, n = this._iv;
|
|
3494
3510
|
n ? (a = n.slice(0), this._iv = void 0) : a = this._prevBlock, f.encryptBlock(a, 0);
|
|
3495
3511
|
for (var B = 0; B < u; B++)
|
|
@@ -3503,11 +3519,11 @@ function Ct() {
|
|
|
3503
3519
|
var L0 = { exports: {} }, Bt = L0.exports, Ne;
|
|
3504
3520
|
function mt() {
|
|
3505
3521
|
return Ne || (Ne = 1, (function(p, r) {
|
|
3506
|
-
(function(t, e,
|
|
3522
|
+
(function(t, e, s) {
|
|
3507
3523
|
p.exports = e(L(), Q());
|
|
3508
3524
|
})(Bt, function(t) {
|
|
3509
3525
|
return t.mode.CTR = (function() {
|
|
3510
|
-
var e = t.lib.BlockCipherMode.extend(),
|
|
3526
|
+
var e = t.lib.BlockCipherMode.extend(), s = e.Encryptor = e.extend({
|
|
3511
3527
|
processBlock: function(c, b) {
|
|
3512
3528
|
var u = this._cipher, f = u.blockSize, a = this._iv, n = this._counter;
|
|
3513
3529
|
a && (n = this._counter = a.slice(0), this._iv = void 0);
|
|
@@ -3517,7 +3533,7 @@ function mt() {
|
|
|
3517
3533
|
c[b + i] ^= B[i];
|
|
3518
3534
|
}
|
|
3519
3535
|
});
|
|
3520
|
-
return e.Decryptor =
|
|
3536
|
+
return e.Decryptor = s, e;
|
|
3521
3537
|
})(), t.mode.CTR;
|
|
3522
3538
|
});
|
|
3523
3539
|
})(L0)), L0.exports;
|
|
@@ -3525,7 +3541,7 @@ function mt() {
|
|
|
3525
3541
|
var K0 = { exports: {} }, At = K0.exports, We;
|
|
3526
3542
|
function Et() {
|
|
3527
3543
|
return We || (We = 1, (function(p, r) {
|
|
3528
|
-
(function(t, e,
|
|
3544
|
+
(function(t, e, s) {
|
|
3529
3545
|
p.exports = e(L(), Q());
|
|
3530
3546
|
})(At, function(t) {
|
|
3531
3547
|
/** @preserve
|
|
@@ -3535,7 +3551,7 @@ function Et() {
|
|
|
3535
3551
|
*/
|
|
3536
3552
|
return t.mode.CTRGladman = (function() {
|
|
3537
3553
|
var e = t.lib.BlockCipherMode.extend();
|
|
3538
|
-
function
|
|
3554
|
+
function s(u) {
|
|
3539
3555
|
if ((u >> 24 & 255) === 255) {
|
|
3540
3556
|
var f = u >> 16 & 255, a = u >> 8 & 255, n = u & 255;
|
|
3541
3557
|
f === 255 ? (f = 0, a === 255 ? (a = 0, n === 255 ? n = 0 : ++n) : ++a) : ++f, u = 0, u += f << 16, u += a << 8, u += n;
|
|
@@ -3544,7 +3560,7 @@ function Et() {
|
|
|
3544
3560
|
return u;
|
|
3545
3561
|
}
|
|
3546
3562
|
function c(u) {
|
|
3547
|
-
return (u[0] =
|
|
3563
|
+
return (u[0] = s(u[0])) === 0 && (u[1] = s(u[1])), u;
|
|
3548
3564
|
}
|
|
3549
3565
|
var b = e.Encryptor = e.extend({
|
|
3550
3566
|
processBlock: function(u, f) {
|
|
@@ -3564,11 +3580,11 @@ function Et() {
|
|
|
3564
3580
|
var U0 = { exports: {} }, Ft = U0.exports, Ge;
|
|
3565
3581
|
function Dt() {
|
|
3566
3582
|
return Ge || (Ge = 1, (function(p, r) {
|
|
3567
|
-
(function(t, e,
|
|
3583
|
+
(function(t, e, s) {
|
|
3568
3584
|
p.exports = e(L(), Q());
|
|
3569
3585
|
})(Ft, function(t) {
|
|
3570
3586
|
return t.mode.OFB = (function() {
|
|
3571
|
-
var e = t.lib.BlockCipherMode.extend(),
|
|
3587
|
+
var e = t.lib.BlockCipherMode.extend(), s = e.Encryptor = e.extend({
|
|
3572
3588
|
processBlock: function(c, b) {
|
|
3573
3589
|
var u = this._cipher, f = u.blockSize, a = this._iv, n = this._keystream;
|
|
3574
3590
|
a && (n = this._keystream = a.slice(0), this._iv = void 0), u.encryptBlock(n, 0);
|
|
@@ -3576,7 +3592,7 @@ function Dt() {
|
|
|
3576
3592
|
c[b + B] ^= n[B];
|
|
3577
3593
|
}
|
|
3578
3594
|
});
|
|
3579
|
-
return e.Decryptor =
|
|
3595
|
+
return e.Decryptor = s, e;
|
|
3580
3596
|
})(), t.mode.OFB;
|
|
3581
3597
|
});
|
|
3582
3598
|
})(U0)), U0.exports;
|
|
@@ -3584,18 +3600,18 @@ function Dt() {
|
|
|
3584
3600
|
var q0 = { exports: {} }, gt = q0.exports, Qe;
|
|
3585
3601
|
function bt() {
|
|
3586
3602
|
return Qe || (Qe = 1, (function(p, r) {
|
|
3587
|
-
(function(t, e,
|
|
3603
|
+
(function(t, e, s) {
|
|
3588
3604
|
p.exports = e(L(), Q());
|
|
3589
3605
|
})(gt, function(t) {
|
|
3590
3606
|
return t.mode.ECB = (function() {
|
|
3591
3607
|
var e = t.lib.BlockCipherMode.extend();
|
|
3592
3608
|
return e.Encryptor = e.extend({
|
|
3593
|
-
processBlock: function(
|
|
3594
|
-
this._cipher.encryptBlock(
|
|
3609
|
+
processBlock: function(s, c) {
|
|
3610
|
+
this._cipher.encryptBlock(s, c);
|
|
3595
3611
|
}
|
|
3596
3612
|
}), e.Decryptor = e.extend({
|
|
3597
|
-
processBlock: function(
|
|
3598
|
-
this._cipher.decryptBlock(
|
|
3613
|
+
processBlock: function(s, c) {
|
|
3614
|
+
this._cipher.decryptBlock(s, c);
|
|
3599
3615
|
}
|
|
3600
3616
|
}), e;
|
|
3601
3617
|
})(), t.mode.ECB;
|
|
@@ -3605,17 +3621,17 @@ function bt() {
|
|
|
3605
3621
|
var z0 = { exports: {} }, yt = z0.exports, Xe;
|
|
3606
3622
|
function _t() {
|
|
3607
3623
|
return Xe || (Xe = 1, (function(p, r) {
|
|
3608
|
-
(function(t, e,
|
|
3624
|
+
(function(t, e, s) {
|
|
3609
3625
|
p.exports = e(L(), Q());
|
|
3610
3626
|
})(yt, function(t) {
|
|
3611
3627
|
return t.pad.AnsiX923 = {
|
|
3612
|
-
pad: function(e,
|
|
3613
|
-
var c = e.sigBytes, b =
|
|
3628
|
+
pad: function(e, s) {
|
|
3629
|
+
var c = e.sigBytes, b = s * 4, u = b - c % b, f = c + u - 1;
|
|
3614
3630
|
e.clamp(), e.words[f >>> 2] |= u << 24 - f % 4 * 8, e.sigBytes += u;
|
|
3615
3631
|
},
|
|
3616
3632
|
unpad: function(e) {
|
|
3617
|
-
var
|
|
3618
|
-
e.sigBytes -=
|
|
3633
|
+
var s = e.words[e.sigBytes - 1 >>> 2] & 255;
|
|
3634
|
+
e.sigBytes -= s;
|
|
3619
3635
|
}
|
|
3620
3636
|
}, t.pad.Ansix923;
|
|
3621
3637
|
});
|
|
@@ -3624,31 +3640,31 @@ function _t() {
|
|
|
3624
3640
|
var N0 = { exports: {} }, wt = N0.exports, Ve;
|
|
3625
3641
|
function kt() {
|
|
3626
3642
|
return Ve || (Ve = 1, (function(p, r) {
|
|
3627
|
-
(function(t, e,
|
|
3643
|
+
(function(t, e, s) {
|
|
3628
3644
|
p.exports = e(L(), Q());
|
|
3629
3645
|
})(wt, function(t) {
|
|
3630
3646
|
return t.pad.Iso10126 = {
|
|
3631
|
-
pad: function(e,
|
|
3632
|
-
var c =
|
|
3647
|
+
pad: function(e, s) {
|
|
3648
|
+
var c = s * 4, b = c - e.sigBytes % c;
|
|
3633
3649
|
e.concat(t.lib.WordArray.random(b - 1)).concat(t.lib.WordArray.create([b << 24], 1));
|
|
3634
3650
|
},
|
|
3635
3651
|
unpad: function(e) {
|
|
3636
|
-
var
|
|
3637
|
-
e.sigBytes -=
|
|
3652
|
+
var s = e.words[e.sigBytes - 1 >>> 2] & 255;
|
|
3653
|
+
e.sigBytes -= s;
|
|
3638
3654
|
}
|
|
3639
3655
|
}, t.pad.Iso10126;
|
|
3640
3656
|
});
|
|
3641
3657
|
})(N0)), N0.exports;
|
|
3642
3658
|
}
|
|
3643
3659
|
var W0 = { exports: {} }, St = W0.exports, je;
|
|
3644
|
-
function
|
|
3660
|
+
function It() {
|
|
3645
3661
|
return je || (je = 1, (function(p, r) {
|
|
3646
|
-
(function(t, e,
|
|
3662
|
+
(function(t, e, s) {
|
|
3647
3663
|
p.exports = e(L(), Q());
|
|
3648
3664
|
})(St, function(t) {
|
|
3649
3665
|
return t.pad.Iso97971 = {
|
|
3650
|
-
pad: function(e,
|
|
3651
|
-
e.concat(t.lib.WordArray.create([2147483648], 1)), t.pad.ZeroPadding.pad(e,
|
|
3666
|
+
pad: function(e, s) {
|
|
3667
|
+
e.concat(t.lib.WordArray.create([2147483648], 1)), t.pad.ZeroPadding.pad(e, s);
|
|
3652
3668
|
},
|
|
3653
3669
|
unpad: function(e) {
|
|
3654
3670
|
t.pad.ZeroPadding.unpad(e), e.sigBytes--;
|
|
@@ -3657,20 +3673,20 @@ function Pt() {
|
|
|
3657
3673
|
});
|
|
3658
3674
|
})(W0)), W0.exports;
|
|
3659
3675
|
}
|
|
3660
|
-
var G0 = { exports: {} },
|
|
3676
|
+
var G0 = { exports: {} }, Pt = G0.exports, Ze;
|
|
3661
3677
|
function Rt() {
|
|
3662
3678
|
return Ze || (Ze = 1, (function(p, r) {
|
|
3663
|
-
(function(t, e,
|
|
3679
|
+
(function(t, e, s) {
|
|
3664
3680
|
p.exports = e(L(), Q());
|
|
3665
|
-
})(
|
|
3681
|
+
})(Pt, function(t) {
|
|
3666
3682
|
return t.pad.ZeroPadding = {
|
|
3667
|
-
pad: function(e,
|
|
3668
|
-
var c =
|
|
3683
|
+
pad: function(e, s) {
|
|
3684
|
+
var c = s * 4;
|
|
3669
3685
|
e.clamp(), e.sigBytes += c - (e.sigBytes % c || c);
|
|
3670
3686
|
},
|
|
3671
3687
|
unpad: function(e) {
|
|
3672
|
-
for (var
|
|
3673
|
-
if (
|
|
3688
|
+
for (var s = e.words, c = e.sigBytes - 1, c = e.sigBytes - 1; c >= 0; c--)
|
|
3689
|
+
if (s[c >>> 2] >>> 24 - c % 4 * 8 & 255) {
|
|
3674
3690
|
e.sigBytes = c + 1;
|
|
3675
3691
|
break;
|
|
3676
3692
|
}
|
|
@@ -3679,12 +3695,12 @@ function Rt() {
|
|
|
3679
3695
|
});
|
|
3680
3696
|
})(G0)), G0.exports;
|
|
3681
3697
|
}
|
|
3682
|
-
var Q0 = { exports: {} },
|
|
3683
|
-
function
|
|
3698
|
+
var Q0 = { exports: {} }, Mt = Q0.exports, Ye;
|
|
3699
|
+
function Ht() {
|
|
3684
3700
|
return Ye || (Ye = 1, (function(p, r) {
|
|
3685
|
-
(function(t, e,
|
|
3701
|
+
(function(t, e, s) {
|
|
3686
3702
|
p.exports = e(L(), Q());
|
|
3687
|
-
})(
|
|
3703
|
+
})(Mt, function(t) {
|
|
3688
3704
|
return t.pad.NoPadding = {
|
|
3689
3705
|
pad: function() {
|
|
3690
3706
|
},
|
|
@@ -3697,11 +3713,11 @@ function Mt() {
|
|
|
3697
3713
|
var X0 = { exports: {} }, Ot = X0.exports, Je;
|
|
3698
3714
|
function $t() {
|
|
3699
3715
|
return Je || (Je = 1, (function(p, r) {
|
|
3700
|
-
(function(t, e,
|
|
3716
|
+
(function(t, e, s) {
|
|
3701
3717
|
p.exports = e(L(), Q());
|
|
3702
3718
|
})(Ot, function(t) {
|
|
3703
3719
|
return (function(e) {
|
|
3704
|
-
var
|
|
3720
|
+
var s = t, c = s.lib, b = c.CipherParams, u = s.enc, f = u.Hex, a = s.format;
|
|
3705
3721
|
a.Hex = {
|
|
3706
3722
|
/**
|
|
3707
3723
|
* Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
|
|
@@ -3744,11 +3760,11 @@ function $t() {
|
|
|
3744
3760
|
var V0 = { exports: {} }, Tt = V0.exports, er;
|
|
3745
3761
|
function Lt() {
|
|
3746
3762
|
return er || (er = 1, (function(p, r) {
|
|
3747
|
-
(function(t, e,
|
|
3763
|
+
(function(t, e, s) {
|
|
3748
3764
|
p.exports = e(L(), n0(), i0(), a0(), Q());
|
|
3749
3765
|
})(Tt, function(t) {
|
|
3750
3766
|
return (function() {
|
|
3751
|
-
var e = t,
|
|
3767
|
+
var e = t, s = e.lib, c = s.BlockCipher, b = e.algo, u = [], f = [], a = [], n = [], B = [], i = [], l = [], d = [], C = [], h = [];
|
|
3752
3768
|
(function() {
|
|
3753
3769
|
for (var x = [], v = 0; v < 256; v++)
|
|
3754
3770
|
v < 128 ? x[v] = v << 1 : x[v] = v << 1 ^ 283;
|
|
@@ -3761,7 +3777,7 @@ function Lt() {
|
|
|
3761
3777
|
l[g] = D << 24 | D >>> 8, d[g] = D << 16 | D >>> 16, C[g] = D << 8 | D >>> 24, h[g] = D, F ? (F = y ^ x[x[x[m ^ y]]], E ^= x[x[E]]) : F = E = 1;
|
|
3762
3778
|
}
|
|
3763
3779
|
})();
|
|
3764
|
-
var A = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54],
|
|
3780
|
+
var A = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], o = b.AES = c.extend({
|
|
3765
3781
|
_doReset: function() {
|
|
3766
3782
|
var x;
|
|
3767
3783
|
if (!(this._nRounds && this._keyPriorReset === this._key)) {
|
|
@@ -3787,16 +3803,16 @@ function Lt() {
|
|
|
3787
3803
|
x[v + 1] = x[v + 3], x[v + 3] = F;
|
|
3788
3804
|
},
|
|
3789
3805
|
_doCryptBlock: function(x, v, F, E, g, y, R, m) {
|
|
3790
|
-
for (var D = this._nRounds, w = x[v] ^ F[0], k = x[v + 1] ^ F[1],
|
|
3791
|
-
var K = E[w >>> 24] ^ g[k >>> 16 & 255] ^ y[
|
|
3792
|
-
w = K, k = q,
|
|
3806
|
+
for (var D = this._nRounds, w = x[v] ^ F[0], k = x[v + 1] ^ F[1], H = x[v + 2] ^ F[2], O = x[v + 3] ^ F[3], $ = 4, N = 1; N < D; N++) {
|
|
3807
|
+
var K = E[w >>> 24] ^ g[k >>> 16 & 255] ^ y[H >>> 8 & 255] ^ R[O & 255] ^ F[$++], q = E[k >>> 24] ^ g[H >>> 16 & 255] ^ y[O >>> 8 & 255] ^ R[w & 255] ^ F[$++], U = E[H >>> 24] ^ g[O >>> 16 & 255] ^ y[w >>> 8 & 255] ^ R[k & 255] ^ F[$++], _ = E[O >>> 24] ^ g[w >>> 16 & 255] ^ y[k >>> 8 & 255] ^ R[H & 255] ^ F[$++];
|
|
3808
|
+
w = K, k = q, H = U, O = _;
|
|
3793
3809
|
}
|
|
3794
|
-
var K = (m[w >>> 24] << 24 | m[k >>> 16 & 255] << 16 | m[
|
|
3810
|
+
var K = (m[w >>> 24] << 24 | m[k >>> 16 & 255] << 16 | m[H >>> 8 & 255] << 8 | m[O & 255]) ^ F[$++], q = (m[k >>> 24] << 24 | m[H >>> 16 & 255] << 16 | m[O >>> 8 & 255] << 8 | m[w & 255]) ^ F[$++], U = (m[H >>> 24] << 24 | m[O >>> 16 & 255] << 16 | m[w >>> 8 & 255] << 8 | m[k & 255]) ^ F[$++], _ = (m[O >>> 24] << 24 | m[w >>> 16 & 255] << 16 | m[k >>> 8 & 255] << 8 | m[H & 255]) ^ F[$++];
|
|
3795
3811
|
x[v] = K, x[v + 1] = q, x[v + 2] = U, x[v + 3] = _;
|
|
3796
3812
|
},
|
|
3797
3813
|
keySize: 256 / 32
|
|
3798
3814
|
});
|
|
3799
|
-
e.AES = c._createHelper(
|
|
3815
|
+
e.AES = c._createHelper(o);
|
|
3800
3816
|
})(), t.AES;
|
|
3801
3817
|
});
|
|
3802
3818
|
})(V0)), V0.exports;
|
|
@@ -3804,11 +3820,11 @@ function Lt() {
|
|
|
3804
3820
|
var j0 = { exports: {} }, Kt = j0.exports, rr;
|
|
3805
3821
|
function Ut() {
|
|
3806
3822
|
return rr || (rr = 1, (function(p, r) {
|
|
3807
|
-
(function(t, e,
|
|
3823
|
+
(function(t, e, s) {
|
|
3808
3824
|
p.exports = e(L(), n0(), i0(), a0(), Q());
|
|
3809
3825
|
})(Kt, function(t) {
|
|
3810
3826
|
return (function() {
|
|
3811
|
-
var e = t,
|
|
3827
|
+
var e = t, s = e.lib, c = s.WordArray, b = s.BlockCipher, u = e.algo, f = [
|
|
3812
3828
|
57,
|
|
3813
3829
|
49,
|
|
3814
3830
|
41,
|
|
@@ -4454,9 +4470,9 @@ function Ut() {
|
|
|
4454
4470
|
2147483679
|
|
4455
4471
|
], l = u.DES = b.extend({
|
|
4456
4472
|
_doReset: function() {
|
|
4457
|
-
for (var A = this._key,
|
|
4473
|
+
for (var A = this._key, o = A.words, x = [], v = 0; v < 56; v++) {
|
|
4458
4474
|
var F = f[v] - 1;
|
|
4459
|
-
x[v] =
|
|
4475
|
+
x[v] = o[F >>> 5] >>> 31 - F % 32 & 1;
|
|
4460
4476
|
}
|
|
4461
4477
|
for (var E = this._subKeys = [], g = 0; g < 16; g++) {
|
|
4462
4478
|
for (var y = E[g] = [], R = n[g], v = 0; v < 24; v++)
|
|
@@ -4469,48 +4485,48 @@ function Ut() {
|
|
|
4469
4485
|
for (var m = this._invSubKeys = [], v = 0; v < 16; v++)
|
|
4470
4486
|
m[v] = E[15 - v];
|
|
4471
4487
|
},
|
|
4472
|
-
encryptBlock: function(A,
|
|
4473
|
-
this._doCryptBlock(A,
|
|
4488
|
+
encryptBlock: function(A, o) {
|
|
4489
|
+
this._doCryptBlock(A, o, this._subKeys);
|
|
4474
4490
|
},
|
|
4475
|
-
decryptBlock: function(A,
|
|
4476
|
-
this._doCryptBlock(A,
|
|
4491
|
+
decryptBlock: function(A, o) {
|
|
4492
|
+
this._doCryptBlock(A, o, this._invSubKeys);
|
|
4477
4493
|
},
|
|
4478
|
-
_doCryptBlock: function(A,
|
|
4479
|
-
this._lBlock = A[
|
|
4494
|
+
_doCryptBlock: function(A, o, x) {
|
|
4495
|
+
this._lBlock = A[o], this._rBlock = A[o + 1], d.call(this, 4, 252645135), d.call(this, 16, 65535), C.call(this, 2, 858993459), C.call(this, 8, 16711935), d.call(this, 1, 1431655765);
|
|
4480
4496
|
for (var v = 0; v < 16; v++) {
|
|
4481
4497
|
for (var F = x[v], E = this._lBlock, g = this._rBlock, y = 0, R = 0; R < 8; R++)
|
|
4482
4498
|
y |= B[R][((g ^ F[R]) & i[R]) >>> 0];
|
|
4483
4499
|
this._lBlock = g, this._rBlock = E ^ y;
|
|
4484
4500
|
}
|
|
4485
4501
|
var m = this._lBlock;
|
|
4486
|
-
this._lBlock = this._rBlock, this._rBlock = m, d.call(this, 1, 1431655765), C.call(this, 8, 16711935), C.call(this, 2, 858993459), d.call(this, 16, 65535), d.call(this, 4, 252645135), A[
|
|
4502
|
+
this._lBlock = this._rBlock, this._rBlock = m, d.call(this, 1, 1431655765), C.call(this, 8, 16711935), C.call(this, 2, 858993459), d.call(this, 16, 65535), d.call(this, 4, 252645135), A[o] = this._lBlock, A[o + 1] = this._rBlock;
|
|
4487
4503
|
},
|
|
4488
4504
|
keySize: 64 / 32,
|
|
4489
4505
|
ivSize: 64 / 32,
|
|
4490
4506
|
blockSize: 64 / 32
|
|
4491
4507
|
});
|
|
4492
|
-
function d(A,
|
|
4493
|
-
var x = (this._lBlock >>> A ^ this._rBlock) &
|
|
4508
|
+
function d(A, o) {
|
|
4509
|
+
var x = (this._lBlock >>> A ^ this._rBlock) & o;
|
|
4494
4510
|
this._rBlock ^= x, this._lBlock ^= x << A;
|
|
4495
4511
|
}
|
|
4496
|
-
function C(A,
|
|
4497
|
-
var x = (this._rBlock >>> A ^ this._lBlock) &
|
|
4512
|
+
function C(A, o) {
|
|
4513
|
+
var x = (this._rBlock >>> A ^ this._lBlock) & o;
|
|
4498
4514
|
this._lBlock ^= x, this._rBlock ^= x << A;
|
|
4499
4515
|
}
|
|
4500
4516
|
e.DES = b._createHelper(l);
|
|
4501
4517
|
var h = u.TripleDES = b.extend({
|
|
4502
4518
|
_doReset: function() {
|
|
4503
|
-
var A = this._key,
|
|
4504
|
-
if (
|
|
4519
|
+
var A = this._key, o = A.words;
|
|
4520
|
+
if (o.length !== 2 && o.length !== 4 && o.length < 6)
|
|
4505
4521
|
throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");
|
|
4506
|
-
var x =
|
|
4522
|
+
var x = o.slice(0, 2), v = o.length < 4 ? o.slice(0, 2) : o.slice(2, 4), F = o.length < 6 ? o.slice(0, 2) : o.slice(4, 6);
|
|
4507
4523
|
this._des1 = l.createEncryptor(c.create(x)), this._des2 = l.createEncryptor(c.create(v)), this._des3 = l.createEncryptor(c.create(F));
|
|
4508
4524
|
},
|
|
4509
|
-
encryptBlock: function(A,
|
|
4510
|
-
this._des1.encryptBlock(A,
|
|
4525
|
+
encryptBlock: function(A, o) {
|
|
4526
|
+
this._des1.encryptBlock(A, o), this._des2.decryptBlock(A, o), this._des3.encryptBlock(A, o);
|
|
4511
4527
|
},
|
|
4512
|
-
decryptBlock: function(A,
|
|
4513
|
-
this._des3.decryptBlock(A,
|
|
4528
|
+
decryptBlock: function(A, o) {
|
|
4529
|
+
this._des3.decryptBlock(A, o), this._des2.encryptBlock(A, o), this._des1.decryptBlock(A, o);
|
|
4514
4530
|
},
|
|
4515
4531
|
keySize: 192 / 32,
|
|
4516
4532
|
ivSize: 64 / 32,
|
|
@@ -4524,19 +4540,19 @@ function Ut() {
|
|
|
4524
4540
|
var Z0 = { exports: {} }, qt = Z0.exports, tr;
|
|
4525
4541
|
function zt() {
|
|
4526
4542
|
return tr || (tr = 1, (function(p, r) {
|
|
4527
|
-
(function(t, e,
|
|
4543
|
+
(function(t, e, s) {
|
|
4528
4544
|
p.exports = e(L(), n0(), i0(), a0(), Q());
|
|
4529
4545
|
})(qt, function(t) {
|
|
4530
4546
|
return (function() {
|
|
4531
|
-
var e = t,
|
|
4547
|
+
var e = t, s = e.lib, c = s.StreamCipher, b = e.algo, u = b.RC4 = c.extend({
|
|
4532
4548
|
_doReset: function() {
|
|
4533
4549
|
for (var n = this._key, B = n.words, i = n.sigBytes, l = this._S = [], d = 0; d < 256; d++)
|
|
4534
4550
|
l[d] = d;
|
|
4535
4551
|
for (var d = 0, C = 0; d < 256; d++) {
|
|
4536
4552
|
var h = d % i, A = B[h >>> 2] >>> 24 - h % 4 * 8 & 255;
|
|
4537
4553
|
C = (C + l[d] + A) % 256;
|
|
4538
|
-
var
|
|
4539
|
-
l[d] = l[C], l[C] =
|
|
4554
|
+
var o = l[d];
|
|
4555
|
+
l[d] = l[C], l[C] = o;
|
|
4540
4556
|
}
|
|
4541
4557
|
this._i = this._j = 0;
|
|
4542
4558
|
},
|
|
@@ -4578,11 +4594,11 @@ function zt() {
|
|
|
4578
4594
|
var Y0 = { exports: {} }, Nt = Y0.exports, ar;
|
|
4579
4595
|
function Wt() {
|
|
4580
4596
|
return ar || (ar = 1, (function(p, r) {
|
|
4581
|
-
(function(t, e,
|
|
4597
|
+
(function(t, e, s) {
|
|
4582
4598
|
p.exports = e(L(), n0(), i0(), a0(), Q());
|
|
4583
4599
|
})(Nt, function(t) {
|
|
4584
4600
|
return (function() {
|
|
4585
|
-
var e = t,
|
|
4601
|
+
var e = t, s = e.lib, c = s.StreamCipher, b = e.algo, u = [], f = [], a = [], n = b.Rabbit = c.extend({
|
|
4586
4602
|
_doReset: function() {
|
|
4587
4603
|
for (var i = this._key.words, l = this.cfg.iv, d = 0; d < 4; d++)
|
|
4588
4604
|
i[d] = (i[d] << 8 | i[d] >>> 24) & 16711935 | (i[d] << 24 | i[d] >>> 8) & 4278255360;
|
|
@@ -4611,7 +4627,7 @@ function Wt() {
|
|
|
4611
4627
|
for (var d = 0; d < 8; d++)
|
|
4612
4628
|
h[d] ^= C[d + 4 & 7];
|
|
4613
4629
|
if (l) {
|
|
4614
|
-
var A = l.words,
|
|
4630
|
+
var A = l.words, o = A[0], x = A[1], v = (o << 8 | o >>> 24) & 16711935 | (o << 24 | o >>> 8) & 4278255360, F = (x << 8 | x >>> 24) & 16711935 | (x << 24 | x >>> 8) & 4278255360, E = v >>> 16 | F & 4294901760, g = F << 16 | v & 65535;
|
|
4615
4631
|
h[0] ^= v, h[1] ^= E, h[2] ^= F, h[3] ^= g, h[4] ^= v, h[5] ^= E, h[6] ^= F, h[7] ^= g;
|
|
4616
4632
|
for (var d = 0; d < 4; d++)
|
|
4617
4633
|
B.call(this);
|
|
@@ -4631,8 +4647,8 @@ function Wt() {
|
|
|
4631
4647
|
f[d] = l[d];
|
|
4632
4648
|
l[0] = l[0] + 1295307597 + this._b | 0, l[1] = l[1] + 3545052371 + (l[0] >>> 0 < f[0] >>> 0 ? 1 : 0) | 0, l[2] = l[2] + 886263092 + (l[1] >>> 0 < f[1] >>> 0 ? 1 : 0) | 0, l[3] = l[3] + 1295307597 + (l[2] >>> 0 < f[2] >>> 0 ? 1 : 0) | 0, l[4] = l[4] + 3545052371 + (l[3] >>> 0 < f[3] >>> 0 ? 1 : 0) | 0, l[5] = l[5] + 886263092 + (l[4] >>> 0 < f[4] >>> 0 ? 1 : 0) | 0, l[6] = l[6] + 1295307597 + (l[5] >>> 0 < f[5] >>> 0 ? 1 : 0) | 0, l[7] = l[7] + 3545052371 + (l[6] >>> 0 < f[6] >>> 0 ? 1 : 0) | 0, this._b = l[7] >>> 0 < f[7] >>> 0 ? 1 : 0;
|
|
4633
4649
|
for (var d = 0; d < 8; d++) {
|
|
4634
|
-
var C = i[d] + l[d], h = C & 65535, A = C >>> 16,
|
|
4635
|
-
a[d] =
|
|
4650
|
+
var C = i[d] + l[d], h = C & 65535, A = C >>> 16, o = ((h * h >>> 17) + h * A >>> 15) + A * A, x = ((C & 4294901760) * C | 0) + ((C & 65535) * C | 0);
|
|
4651
|
+
a[d] = o ^ x;
|
|
4636
4652
|
}
|
|
4637
4653
|
i[0] = a[0] + (a[7] << 16 | a[7] >>> 16) + (a[6] << 16 | a[6] >>> 16) | 0, i[1] = a[1] + (a[0] << 8 | a[0] >>> 24) + a[7] | 0, i[2] = a[2] + (a[1] << 16 | a[1] >>> 16) + (a[0] << 16 | a[0] >>> 16) | 0, i[3] = a[3] + (a[2] << 8 | a[2] >>> 24) + a[1] | 0, i[4] = a[4] + (a[3] << 16 | a[3] >>> 16) + (a[2] << 16 | a[2] >>> 16) | 0, i[5] = a[5] + (a[4] << 8 | a[4] >>> 24) + a[3] | 0, i[6] = a[6] + (a[5] << 16 | a[5] >>> 16) + (a[4] << 16 | a[4] >>> 16) | 0, i[7] = a[7] + (a[6] << 8 | a[6] >>> 24) + a[5] | 0;
|
|
4638
4654
|
}
|
|
@@ -4644,11 +4660,11 @@ function Wt() {
|
|
|
4644
4660
|
var J0 = { exports: {} }, Gt = J0.exports, nr;
|
|
4645
4661
|
function Qt() {
|
|
4646
4662
|
return nr || (nr = 1, (function(p, r) {
|
|
4647
|
-
(function(t, e,
|
|
4663
|
+
(function(t, e, s) {
|
|
4648
4664
|
p.exports = e(L(), n0(), i0(), a0(), Q());
|
|
4649
4665
|
})(Gt, function(t) {
|
|
4650
4666
|
return (function() {
|
|
4651
|
-
var e = t,
|
|
4667
|
+
var e = t, s = e.lib, c = s.StreamCipher, b = e.algo, u = [], f = [], a = [], n = b.RabbitLegacy = c.extend({
|
|
4652
4668
|
_doReset: function() {
|
|
4653
4669
|
var i = this._key.words, l = this.cfg.iv, d = this._X = [
|
|
4654
4670
|
i[0],
|
|
@@ -4675,7 +4691,7 @@ function Qt() {
|
|
|
4675
4691
|
for (var h = 0; h < 8; h++)
|
|
4676
4692
|
C[h] ^= d[h + 4 & 7];
|
|
4677
4693
|
if (l) {
|
|
4678
|
-
var A = l.words,
|
|
4694
|
+
var A = l.words, o = A[0], x = A[1], v = (o << 8 | o >>> 24) & 16711935 | (o << 24 | o >>> 8) & 4278255360, F = (x << 8 | x >>> 24) & 16711935 | (x << 24 | x >>> 8) & 4278255360, E = v >>> 16 | F & 4294901760, g = F << 16 | v & 65535;
|
|
4679
4695
|
C[0] ^= v, C[1] ^= E, C[2] ^= F, C[3] ^= g, C[4] ^= v, C[5] ^= E, C[6] ^= F, C[7] ^= g;
|
|
4680
4696
|
for (var h = 0; h < 4; h++)
|
|
4681
4697
|
B.call(this);
|
|
@@ -4695,8 +4711,8 @@ function Qt() {
|
|
|
4695
4711
|
f[d] = l[d];
|
|
4696
4712
|
l[0] = l[0] + 1295307597 + this._b | 0, l[1] = l[1] + 3545052371 + (l[0] >>> 0 < f[0] >>> 0 ? 1 : 0) | 0, l[2] = l[2] + 886263092 + (l[1] >>> 0 < f[1] >>> 0 ? 1 : 0) | 0, l[3] = l[3] + 1295307597 + (l[2] >>> 0 < f[2] >>> 0 ? 1 : 0) | 0, l[4] = l[4] + 3545052371 + (l[3] >>> 0 < f[3] >>> 0 ? 1 : 0) | 0, l[5] = l[5] + 886263092 + (l[4] >>> 0 < f[4] >>> 0 ? 1 : 0) | 0, l[6] = l[6] + 1295307597 + (l[5] >>> 0 < f[5] >>> 0 ? 1 : 0) | 0, l[7] = l[7] + 3545052371 + (l[6] >>> 0 < f[6] >>> 0 ? 1 : 0) | 0, this._b = l[7] >>> 0 < f[7] >>> 0 ? 1 : 0;
|
|
4697
4713
|
for (var d = 0; d < 8; d++) {
|
|
4698
|
-
var C = i[d] + l[d], h = C & 65535, A = C >>> 16,
|
|
4699
|
-
a[d] =
|
|
4714
|
+
var C = i[d] + l[d], h = C & 65535, A = C >>> 16, o = ((h * h >>> 17) + h * A >>> 15) + A * A, x = ((C & 4294901760) * C | 0) + ((C & 65535) * C | 0);
|
|
4715
|
+
a[d] = o ^ x;
|
|
4700
4716
|
}
|
|
4701
4717
|
i[0] = a[0] + (a[7] << 16 | a[7] >>> 16) + (a[6] << 16 | a[6] >>> 16) | 0, i[1] = a[1] + (a[0] << 8 | a[0] >>> 24) + a[7] | 0, i[2] = a[2] + (a[1] << 16 | a[1] >>> 16) + (a[0] << 16 | a[0] >>> 16) | 0, i[3] = a[3] + (a[2] << 8 | a[2] >>> 24) + a[1] | 0, i[4] = a[4] + (a[3] << 16 | a[3] >>> 16) + (a[2] << 16 | a[2] >>> 16) | 0, i[5] = a[5] + (a[4] << 8 | a[4] >>> 24) + a[3] | 0, i[6] = a[6] + (a[5] << 16 | a[5] >>> 16) + (a[4] << 16 | a[4] >>> 16) | 0, i[7] = a[7] + (a[6] << 8 | a[6] >>> 24) + a[5] | 0;
|
|
4702
4718
|
}
|
|
@@ -4708,11 +4724,11 @@ function Qt() {
|
|
|
4708
4724
|
var ee = { exports: {} }, Xt = ee.exports, ir;
|
|
4709
4725
|
function Vt() {
|
|
4710
4726
|
return ir || (ir = 1, (function(p, r) {
|
|
4711
|
-
(function(t, e,
|
|
4727
|
+
(function(t, e, s) {
|
|
4712
4728
|
p.exports = e(L(), n0(), i0(), a0(), Q());
|
|
4713
4729
|
})(Xt, function(t) {
|
|
4714
4730
|
return (function() {
|
|
4715
|
-
var e = t,
|
|
4731
|
+
var e = t, s = e.lib, c = s.BlockCipher, b = e.algo;
|
|
4716
4732
|
const u = 16, f = [
|
|
4717
4733
|
608135816,
|
|
4718
4734
|
2242054355,
|
|
@@ -5771,22 +5787,22 @@ function Vt() {
|
|
|
5771
5787
|
sbox: []
|
|
5772
5788
|
};
|
|
5773
5789
|
function B(h, A) {
|
|
5774
|
-
let
|
|
5790
|
+
let o = A >> 24 & 255, x = A >> 16 & 255, v = A >> 8 & 255, F = A & 255, E = h.sbox[0][o] + h.sbox[1][x];
|
|
5775
5791
|
return E = E ^ h.sbox[2][v], E = E + h.sbox[3][F], E;
|
|
5776
5792
|
}
|
|
5777
|
-
function i(h, A,
|
|
5778
|
-
let x = A, v =
|
|
5793
|
+
function i(h, A, o) {
|
|
5794
|
+
let x = A, v = o, F;
|
|
5779
5795
|
for (let E = 0; E < u; ++E)
|
|
5780
5796
|
x = x ^ h.pbox[E], v = B(h, x) ^ v, F = x, x = v, v = F;
|
|
5781
5797
|
return F = x, x = v, v = F, v = v ^ h.pbox[u], x = x ^ h.pbox[u + 1], { left: x, right: v };
|
|
5782
5798
|
}
|
|
5783
|
-
function l(h, A,
|
|
5784
|
-
let x = A, v =
|
|
5799
|
+
function l(h, A, o) {
|
|
5800
|
+
let x = A, v = o, F;
|
|
5785
5801
|
for (let E = u + 1; E > 1; --E)
|
|
5786
5802
|
x = x ^ h.pbox[E], v = B(h, x) ^ v, F = x, x = v, v = F;
|
|
5787
5803
|
return F = x, x = v, v = F, v = v ^ h.pbox[1], x = x ^ h.pbox[0], { left: x, right: v };
|
|
5788
5804
|
}
|
|
5789
|
-
function d(h, A,
|
|
5805
|
+
function d(h, A, o) {
|
|
5790
5806
|
for (let g = 0; g < 4; g++) {
|
|
5791
5807
|
h.sbox[g] = [];
|
|
5792
5808
|
for (let y = 0; y < 256; y++)
|
|
@@ -5794,7 +5810,7 @@ function Vt() {
|
|
|
5794
5810
|
}
|
|
5795
5811
|
let x = 0;
|
|
5796
5812
|
for (let g = 0; g < u + 2; g++)
|
|
5797
|
-
h.pbox[g] = f[g] ^ A[x], x++, x >=
|
|
5813
|
+
h.pbox[g] = f[g] ^ A[x], x++, x >= o && (x = 0);
|
|
5798
5814
|
let v = 0, F = 0, E = 0;
|
|
5799
5815
|
for (let g = 0; g < u + 2; g += 2)
|
|
5800
5816
|
E = i(h, v, F), v = E.left, F = E.right, h.pbox[g] = v, h.pbox[g + 1] = F;
|
|
@@ -5806,17 +5822,17 @@ function Vt() {
|
|
|
5806
5822
|
var C = b.Blowfish = c.extend({
|
|
5807
5823
|
_doReset: function() {
|
|
5808
5824
|
if (this._keyPriorReset !== this._key) {
|
|
5809
|
-
var h = this._keyPriorReset = this._key, A = h.words,
|
|
5810
|
-
d(n, A,
|
|
5825
|
+
var h = this._keyPriorReset = this._key, A = h.words, o = h.sigBytes / 4;
|
|
5826
|
+
d(n, A, o);
|
|
5811
5827
|
}
|
|
5812
5828
|
},
|
|
5813
5829
|
encryptBlock: function(h, A) {
|
|
5814
|
-
var
|
|
5815
|
-
h[A] =
|
|
5830
|
+
var o = i(n, h[A], h[A + 1]);
|
|
5831
|
+
h[A] = o.left, h[A + 1] = o.right;
|
|
5816
5832
|
},
|
|
5817
5833
|
decryptBlock: function(h, A) {
|
|
5818
|
-
var
|
|
5819
|
-
h[A] =
|
|
5834
|
+
var o = l(n, h[A], h[A + 1]);
|
|
5835
|
+
h[A] = o.left, h[A + 1] = o.right;
|
|
5820
5836
|
},
|
|
5821
5837
|
blockSize: 64 / 32,
|
|
5822
5838
|
keySize: 128 / 32,
|
|
@@ -5830,8 +5846,8 @@ function Vt() {
|
|
|
5830
5846
|
var jt = m0.exports, sr;
|
|
5831
5847
|
function Zt() {
|
|
5832
5848
|
return sr || (sr = 1, (function(p, r) {
|
|
5833
|
-
(function(t, e,
|
|
5834
|
-
p.exports = e(L(), ne(), Qr(), Vr(), n0(), Yr(), i0(), lr(), de(), at(), dr(), st(), xt(), lt(), fe(), ut(), a0(), Q(), Ct(), mt(), Et(), Dt(), bt(), _t(), kt(),
|
|
5849
|
+
(function(t, e, s) {
|
|
5850
|
+
p.exports = e(L(), ne(), Qr(), Vr(), n0(), Yr(), i0(), lr(), de(), at(), dr(), st(), xt(), lt(), fe(), ut(), a0(), Q(), Ct(), mt(), Et(), Dt(), bt(), _t(), kt(), It(), Rt(), Ht(), $t(), Lt(), Ut(), zt(), Wt(), Qt(), Vt());
|
|
5835
5851
|
})(jt, function(t) {
|
|
5836
5852
|
return t;
|
|
5837
5853
|
});
|
|
@@ -5888,9 +5904,9 @@ function xa(p = ur, r = {}) {
|
|
|
5888
5904
|
/**
|
|
5889
5905
|
* Save AI config
|
|
5890
5906
|
*/
|
|
5891
|
-
save(
|
|
5907
|
+
save(s) {
|
|
5892
5908
|
try {
|
|
5893
|
-
const c = t(
|
|
5909
|
+
const c = t(s);
|
|
5894
5910
|
p.set(xe, c);
|
|
5895
5911
|
} catch (c) {
|
|
5896
5912
|
console.error("Failed to save config:", c);
|
|
@@ -5900,10 +5916,10 @@ function xa(p = ur, r = {}) {
|
|
|
5900
5916
|
* Load AI config
|
|
5901
5917
|
*/
|
|
5902
5918
|
load() {
|
|
5903
|
-
const
|
|
5904
|
-
if (!
|
|
5919
|
+
const s = p.get(xe);
|
|
5920
|
+
if (!s) return null;
|
|
5905
5921
|
try {
|
|
5906
|
-
return e(
|
|
5922
|
+
return e(s);
|
|
5907
5923
|
} catch (c) {
|
|
5908
5924
|
return console.error("Failed to load config:", c), null;
|
|
5909
5925
|
}
|
|
@@ -5922,15 +5938,15 @@ function aa(p) {
|
|
|
5922
5938
|
providers: Object.values(re),
|
|
5923
5939
|
getModels: (f) => te(f)
|
|
5924
5940
|
};
|
|
5925
|
-
const { mode: r, include: t, exclude: e, custom:
|
|
5941
|
+
const { mode: r, include: t, exclude: e, custom: s } = p;
|
|
5926
5942
|
let c = [];
|
|
5927
5943
|
if (r === "default") {
|
|
5928
5944
|
let f = Object.values(re);
|
|
5929
5945
|
t && t.length > 0 && (f = f.filter((a) => t.includes(a.id))), e && e.length > 0 && (f = f.filter((a) => !e.includes(a.id))), c = [...f];
|
|
5930
5946
|
}
|
|
5931
5947
|
const b = {};
|
|
5932
|
-
if (
|
|
5933
|
-
for (const [f, a] of Object.entries(
|
|
5948
|
+
if (s)
|
|
5949
|
+
for (const [f, a] of Object.entries(s)) {
|
|
5934
5950
|
const n = {
|
|
5935
5951
|
id: f,
|
|
5936
5952
|
name: a.name,
|
|
@@ -5968,7 +5984,7 @@ class la {
|
|
|
5968
5984
|
}
|
|
5969
5985
|
emit(r, t) {
|
|
5970
5986
|
var e;
|
|
5971
|
-
(e = this.listeners.get(r)) == null || e.forEach((
|
|
5987
|
+
(e = this.listeners.get(r)) == null || e.forEach((s) => s(t));
|
|
5972
5988
|
}
|
|
5973
5989
|
// ==================== 存储相关 ====================
|
|
5974
5990
|
getStorageKey(r) {
|
|
@@ -6049,10 +6065,10 @@ class la {
|
|
|
6049
6065
|
const e = t0(r.providerId);
|
|
6050
6066
|
if (!e)
|
|
6051
6067
|
throw new Error(`Provider not found: ${r.providerId}`);
|
|
6052
|
-
let
|
|
6068
|
+
let s = r.modelName || r.model, c = [], b;
|
|
6053
6069
|
try {
|
|
6054
6070
|
const n = (await this.getProviderModels(r.providerId, r.apiKey, r.baseUrl)).find((B) => B.id === r.model);
|
|
6055
|
-
n && (
|
|
6071
|
+
n && (s = n.name, c = n.capabilities || [], b = n.contextLength);
|
|
6056
6072
|
} catch (a) {
|
|
6057
6073
|
console.warn("Failed to fetch models, using static info:", a);
|
|
6058
6074
|
}
|
|
@@ -6061,7 +6077,7 @@ class la {
|
|
|
6061
6077
|
providerId: r.providerId,
|
|
6062
6078
|
providerName: e.name,
|
|
6063
6079
|
model: r.model,
|
|
6064
|
-
modelName:
|
|
6080
|
+
modelName: s,
|
|
6065
6081
|
apiKey: r.apiKey,
|
|
6066
6082
|
baseUrl: r.baseUrl,
|
|
6067
6083
|
apiFormat: e.apiFormat,
|
|
@@ -6082,10 +6098,10 @@ class la {
|
|
|
6082
6098
|
}
|
|
6083
6099
|
/** 更新通道 */
|
|
6084
6100
|
async updateChannel(r, t, e) {
|
|
6085
|
-
const
|
|
6086
|
-
if (!
|
|
6101
|
+
const s = this.channels.find((u) => u.id === r);
|
|
6102
|
+
if (!s)
|
|
6087
6103
|
throw new Error(`Channel not found: ${r}`);
|
|
6088
|
-
const c = { ...
|
|
6104
|
+
const c = { ...s, ...t };
|
|
6089
6105
|
if (e !== void 0 && (c.name = e), t.providerId || t.model || t.baseUrl) {
|
|
6090
6106
|
const u = t0(c.providerId);
|
|
6091
6107
|
if (u) {
|
|
@@ -6135,8 +6151,8 @@ class la {
|
|
|
6135
6151
|
var e;
|
|
6136
6152
|
if (r.providerId && t.providerId !== r.providerId || r.apiFormat && t.apiFormat !== r.apiFormat || r.capability && !((e = t.capabilities) != null && e.includes(r.capability)) || r.status && t.status !== r.status) return !1;
|
|
6137
6153
|
if (r.keyword) {
|
|
6138
|
-
const
|
|
6139
|
-
if (!`${t.name || ""} ${t.modelName} ${t.providerName} ${t.model}`.toLowerCase().includes(
|
|
6154
|
+
const s = r.keyword.toLowerCase();
|
|
6155
|
+
if (!`${t.name || ""} ${t.modelName} ${t.providerName} ${t.model}`.toLowerCase().includes(s)) return !1;
|
|
6140
6156
|
}
|
|
6141
6157
|
return !0;
|
|
6142
6158
|
});
|
|
@@ -6157,7 +6173,7 @@ class la {
|
|
|
6157
6173
|
if (!t)
|
|
6158
6174
|
throw new Error(`Channel not found: ${r}`);
|
|
6159
6175
|
this.activeChannelId = r, this.saveActiveChannel();
|
|
6160
|
-
const e = this.channels.findIndex((
|
|
6176
|
+
const e = this.channels.findIndex((s) => s.id === r);
|
|
6161
6177
|
this.channels[e].lastUsedAt = Date.now(), this.saveChannel(this.channels[e]), this.emit("activate", t);
|
|
6162
6178
|
}
|
|
6163
6179
|
/** 清除当前激活的通道 */
|
|
@@ -6211,27 +6227,27 @@ class la {
|
|
|
6211
6227
|
}
|
|
6212
6228
|
const e = this.getChannelsByCapability(r).filter((c) => c.lastUsedAt).sort((c, b) => (b.lastUsedAt || 0) - (c.lastUsedAt || 0));
|
|
6213
6229
|
if (e.length > 0) return e[0];
|
|
6214
|
-
const
|
|
6215
|
-
return
|
|
6230
|
+
const s = this.getActiveChannel();
|
|
6231
|
+
return s || this.channels[0];
|
|
6216
6232
|
}
|
|
6217
6233
|
/**
|
|
6218
6234
|
* 使用指定能力类型的默认通道发送聊天请求
|
|
6219
6235
|
* 自动选择合适的通道,无需手动指定 channelId
|
|
6220
6236
|
*/
|
|
6221
6237
|
async chatForCapability(r, t, e) {
|
|
6222
|
-
const
|
|
6223
|
-
if (!
|
|
6238
|
+
const s = this.getChannelForCapability(r);
|
|
6239
|
+
if (!s)
|
|
6224
6240
|
throw new Error(`No available channel for capability: ${r}`);
|
|
6225
|
-
return this.chatWith(
|
|
6241
|
+
return this.chatWith(s.id, t, e);
|
|
6226
6242
|
}
|
|
6227
6243
|
/**
|
|
6228
6244
|
* 使用指定能力类型的默认通道发送流式聊天请求
|
|
6229
6245
|
*/
|
|
6230
6246
|
async chatStreamForCapability(r, t, e) {
|
|
6231
|
-
const
|
|
6232
|
-
if (!
|
|
6247
|
+
const s = this.getChannelForCapability(r);
|
|
6248
|
+
if (!s)
|
|
6233
6249
|
throw new Error(`No available channel for capability: ${r}`);
|
|
6234
|
-
return this.chatWithStream(
|
|
6250
|
+
return this.chatWithStream(s.id, t, {
|
|
6235
6251
|
...e,
|
|
6236
6252
|
onDelta: (e == null ? void 0 : e.onDelta) || ((c) => {
|
|
6237
6253
|
})
|
|
@@ -6240,11 +6256,11 @@ class la {
|
|
|
6240
6256
|
// ==================== 模型查询 ====================
|
|
6241
6257
|
/** 获取 Provider 的可用模型列表(动态获取 + 静态兜底) */
|
|
6242
6258
|
async getProviderModels(r, t, e) {
|
|
6243
|
-
const
|
|
6244
|
-
if (!
|
|
6259
|
+
const s = t0(r);
|
|
6260
|
+
if (!s)
|
|
6245
6261
|
throw new Error(`Provider not found: ${r}`);
|
|
6246
6262
|
return $r({
|
|
6247
|
-
provider:
|
|
6263
|
+
provider: s,
|
|
6248
6264
|
apiKey: t,
|
|
6249
6265
|
baseUrl: e,
|
|
6250
6266
|
proxyUrl: this.proxyUrl,
|
|
@@ -6265,8 +6281,8 @@ class la {
|
|
|
6265
6281
|
/** 按能力过滤模型列表 */
|
|
6266
6282
|
getModelsByCapability(r, t) {
|
|
6267
6283
|
return r.filter((e) => {
|
|
6268
|
-
var
|
|
6269
|
-
return (
|
|
6284
|
+
var s;
|
|
6285
|
+
return (s = e.capabilities) == null ? void 0 : s.includes(t);
|
|
6270
6286
|
});
|
|
6271
6287
|
}
|
|
6272
6288
|
/** 获取所有已配置的模型摘要列表 */
|
|
@@ -6311,29 +6327,29 @@ class la {
|
|
|
6311
6327
|
}
|
|
6312
6328
|
/** 使用指定通道发送聊天请求 */
|
|
6313
6329
|
async chatWith(r, t, e) {
|
|
6314
|
-
const
|
|
6315
|
-
if (!
|
|
6330
|
+
const s = this.getChannel(r);
|
|
6331
|
+
if (!s)
|
|
6316
6332
|
throw new Error(`Channel not found: ${r}`);
|
|
6317
|
-
const c = t0(
|
|
6333
|
+
const c = t0(s.providerId);
|
|
6318
6334
|
if (!c)
|
|
6319
|
-
throw new Error(`Provider not found: ${
|
|
6335
|
+
throw new Error(`Provider not found: ${s.providerId}`);
|
|
6320
6336
|
const b = (e == null ? void 0 : e.messages) || [{ role: "user", content: t }], u = await cr({
|
|
6321
|
-
apiFormat:
|
|
6322
|
-
baseUrl:
|
|
6323
|
-
apiKey:
|
|
6324
|
-
model:
|
|
6337
|
+
apiFormat: s.apiFormat,
|
|
6338
|
+
baseUrl: s.baseUrl || c.baseUrl,
|
|
6339
|
+
apiKey: s.apiKey,
|
|
6340
|
+
model: s.model,
|
|
6325
6341
|
messages: b,
|
|
6326
6342
|
maxTokens: e == null ? void 0 : e.maxTokens
|
|
6327
6343
|
}), f = {
|
|
6328
6344
|
...u,
|
|
6329
|
-
channelId:
|
|
6330
|
-
model:
|
|
6345
|
+
channelId: s.id,
|
|
6346
|
+
model: s.model
|
|
6331
6347
|
};
|
|
6332
6348
|
if (u.success) {
|
|
6333
|
-
const a = this.channels.findIndex((n) => n.id ===
|
|
6349
|
+
const a = this.channels.findIndex((n) => n.id === s.id);
|
|
6334
6350
|
this.channels[a].lastUsedAt = Date.now(), this.channels[a].status = "connected", this.channels[a].lastError = void 0, this.saveChannel(this.channels[a]);
|
|
6335
6351
|
} else {
|
|
6336
|
-
const a = this.channels.findIndex((n) => n.id ===
|
|
6352
|
+
const a = this.channels.findIndex((n) => n.id === s.id);
|
|
6337
6353
|
this.channels[a].status = "error", this.channels[a].lastError = u.message, this.saveChannel(this.channels[a]);
|
|
6338
6354
|
}
|
|
6339
6355
|
return this.emit("chat", f), f;
|
|
@@ -6347,26 +6363,26 @@ class la {
|
|
|
6347
6363
|
}
|
|
6348
6364
|
/** 使用指定通道发送流式聊天。onDelta 每次收到「累计完整文本」。 */
|
|
6349
6365
|
async chatWithStream(r, t, e) {
|
|
6350
|
-
const
|
|
6351
|
-
if (!
|
|
6366
|
+
const s = this.getChannel(r);
|
|
6367
|
+
if (!s)
|
|
6352
6368
|
throw new Error(`Channel not found: ${r}`);
|
|
6353
|
-
const c = t0(
|
|
6369
|
+
const c = t0(s.providerId);
|
|
6354
6370
|
if (!c)
|
|
6355
|
-
throw new Error(`Provider not found: ${
|
|
6356
|
-
const b = e.messages || [{ role: "user", content: t }], u = await
|
|
6357
|
-
apiFormat:
|
|
6358
|
-
baseUrl:
|
|
6359
|
-
apiKey:
|
|
6360
|
-
model:
|
|
6371
|
+
throw new Error(`Provider not found: ${s.providerId}`);
|
|
6372
|
+
const b = e.messages || [{ role: "user", content: t }], u = await Hr({
|
|
6373
|
+
apiFormat: s.apiFormat,
|
|
6374
|
+
baseUrl: s.baseUrl || c.baseUrl,
|
|
6375
|
+
apiKey: s.apiKey,
|
|
6376
|
+
model: s.model,
|
|
6361
6377
|
messages: b,
|
|
6362
6378
|
maxTokens: e.maxTokens,
|
|
6363
6379
|
onDelta: e.onDelta,
|
|
6364
6380
|
signal: e.signal
|
|
6365
6381
|
}), f = {
|
|
6366
6382
|
...u,
|
|
6367
|
-
channelId:
|
|
6368
|
-
model:
|
|
6369
|
-
}, a = this.channels.findIndex((n) => n.id ===
|
|
6383
|
+
channelId: s.id,
|
|
6384
|
+
model: s.model
|
|
6385
|
+
}, a = this.channels.findIndex((n) => n.id === s.id);
|
|
6370
6386
|
return u.success ? (this.channels[a].lastUsedAt = Date.now(), this.channels[a].status = "connected", this.channels[a].lastError = void 0) : (this.channels[a].status = "error", this.channels[a].lastError = u.message), this.saveChannel(this.channels[a]), this.emit("chat", f), f;
|
|
6371
6387
|
}
|
|
6372
6388
|
/** 测试指定通道的连接 */
|
|
@@ -6377,13 +6393,13 @@ class la {
|
|
|
6377
6393
|
const e = t0(t.providerId);
|
|
6378
6394
|
if (!e)
|
|
6379
6395
|
throw new Error(`Provider not found: ${t.providerId}`);
|
|
6380
|
-
const
|
|
6396
|
+
const s = await Or({
|
|
6381
6397
|
apiFormat: t.apiFormat,
|
|
6382
6398
|
baseUrl: t.baseUrl || e.baseUrl,
|
|
6383
6399
|
apiKey: t.apiKey,
|
|
6384
6400
|
model: t.model
|
|
6385
6401
|
}), c = this.channels.findIndex((b) => b.id === r);
|
|
6386
|
-
return
|
|
6402
|
+
return s.success ? (this.channels[c].status = "connected", this.channels[c].lastError = void 0) : (this.channels[c].status = "error", this.channels[c].lastError = s.message), this.saveChannel(this.channels[c]), this.emit("test", { id: r, ...s }), s;
|
|
6387
6403
|
}
|
|
6388
6404
|
/** 测试所有通道连接 */
|
|
6389
6405
|
async testAllChannels() {
|
|
@@ -6416,8 +6432,8 @@ class la {
|
|
|
6416
6432
|
exportChannels(r) {
|
|
6417
6433
|
const t = this.channels.map((e) => {
|
|
6418
6434
|
if (r) return e;
|
|
6419
|
-
const { apiKey:
|
|
6420
|
-
return { ...c, apiKey: this.maskApiKey(
|
|
6435
|
+
const { apiKey: s, ...c } = e;
|
|
6436
|
+
return { ...c, apiKey: this.maskApiKey(s) };
|
|
6421
6437
|
});
|
|
6422
6438
|
return JSON.stringify({
|
|
6423
6439
|
version: 1,
|
|
@@ -6431,7 +6447,7 @@ class la {
|
|
|
6431
6447
|
if (!e.channels || !Array.isArray(e.channels))
|
|
6432
6448
|
throw new Error("Invalid import format: missing channels array");
|
|
6433
6449
|
t || this.clearAllChannels();
|
|
6434
|
-
const
|
|
6450
|
+
const s = [];
|
|
6435
6451
|
for (const c of e.channels) {
|
|
6436
6452
|
if (c.apiKey && c.apiKey.includes("••••")) {
|
|
6437
6453
|
console.warn(`Skipping channel ${c.modelName}: API Key is masked`);
|
|
@@ -6444,9 +6460,9 @@ class la {
|
|
|
6444
6460
|
modelName: c.modelName,
|
|
6445
6461
|
baseUrl: c.baseUrl
|
|
6446
6462
|
}, u = await this.addChannel(b, c.name);
|
|
6447
|
-
|
|
6463
|
+
s.push(u);
|
|
6448
6464
|
}
|
|
6449
|
-
return
|
|
6465
|
+
return s;
|
|
6450
6466
|
}
|
|
6451
6467
|
// ==================== 批量操作 ====================
|
|
6452
6468
|
/** 清空所有通道 */
|
|
@@ -6471,8 +6487,8 @@ class la {
|
|
|
6471
6487
|
for (const t of this.channels) {
|
|
6472
6488
|
const e = t.status || "untested";
|
|
6473
6489
|
r.byStatus[e] = (r.byStatus[e] || 0) + 1, r.byFormat[t.apiFormat] = (r.byFormat[t.apiFormat] || 0) + 1, r.byProvider[t.providerId] = (r.byProvider[t.providerId] || 0) + 1;
|
|
6474
|
-
for (const
|
|
6475
|
-
r.byCapability[
|
|
6490
|
+
for (const s of t.capabilities || [])
|
|
6491
|
+
r.byCapability[s] = (r.byCapability[s] || 0) + 1;
|
|
6476
6492
|
}
|
|
6477
6493
|
return r;
|
|
6478
6494
|
}
|
|
@@ -6482,7 +6498,7 @@ export {
|
|
|
6482
6498
|
na as I18N,
|
|
6483
6499
|
ia as MODEL_CAPABILITIES,
|
|
6484
6500
|
re as PROVIDERS,
|
|
6485
|
-
|
|
6501
|
+
M as PROVIDER_ID,
|
|
6486
6502
|
wr as STATIC_MODELS,
|
|
6487
6503
|
xa as createConfigStorage,
|
|
6488
6504
|
ur as defaultStorageAdapter,
|
|
@@ -6498,8 +6514,8 @@ export {
|
|
|
6498
6514
|
ta as plainStorageAdapter,
|
|
6499
6515
|
aa as resolveProviderConfig,
|
|
6500
6516
|
cr as sendDirectChat,
|
|
6501
|
-
|
|
6502
|
-
|
|
6517
|
+
Hr as sendDirectChatStream,
|
|
6518
|
+
Mr as strategyRegistry,
|
|
6503
6519
|
sa as testConnection,
|
|
6504
6520
|
Or as testDirectConnection
|
|
6505
6521
|
};
|