@vunk/plus 1.2.2 → 1.3.1

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.
Files changed (119) hide show
  1. package/components/SendOutlined.mjs +2 -2
  2. package/components/agent-chat-provider/index.d.ts +7 -0
  3. package/components/agent-chat-provider/index.mjs +789 -0
  4. package/components/agent-chat-provider/src/api.d.ts +3 -0
  5. package/components/agent-chat-provider/src/const-roles.d.ts +8 -0
  6. package/components/agent-chat-provider/src/const.d.ts +1 -0
  7. package/components/agent-chat-provider/src/index.vue.d.ts +47 -0
  8. package/components/agent-chat-provider/src/types.d.ts +37 -0
  9. package/components/agent-chat-provider/src/use.d.ts +29 -0
  10. package/components/avatar/index.mjs +2 -2
  11. package/components/avatar/src/ctx.d.ts +4 -4
  12. package/components/avatar/src/index.vue.d.ts +66 -125
  13. package/components/broadcasting-markdown/index.css +3 -0
  14. package/components/broadcasting-markdown/index.d.ts +5 -0
  15. package/components/broadcasting-markdown/index.mjs +637 -0
  16. package/components/broadcasting-markdown/src/const.d.ts +18 -0
  17. package/components/broadcasting-markdown/src/ctx.d.ts +93 -0
  18. package/components/broadcasting-markdown/src/custom-speech.vue.d.ts +109 -0
  19. package/components/broadcasting-markdown/src/index.vue.d.ts +477 -0
  20. package/components/broadcasting-markdown/src/paragraph.vue.d.ts +78 -0
  21. package/components/broadcasting-markdown/src/speech-error.vue.d.ts +60 -0
  22. package/components/broadcasting-markdown/src/types.d.ts +17 -0
  23. package/components/broadcasting-markdown/src/use.d.ts +3 -0
  24. package/components/broadcasting-markdown/src/web-speech.vue.d.ts +102 -0
  25. package/components/bubble-list/index.css +18 -0
  26. package/components/bubble-list/index.d.ts +5 -0
  27. package/components/bubble-list/index.mjs +386 -0
  28. package/components/bubble-list/src/ctx.d.ts +30 -0
  29. package/components/bubble-list/src/index.vue.d.ts +927 -0
  30. package/components/bubble-list/src/types.d.ts +4 -0
  31. package/components/bubble-templates/index.css +18 -0
  32. package/components/bubble-templates/index.d.ts +4 -0
  33. package/components/bubble-templates/index.mjs +258 -0
  34. package/components/bubble-templates/src/index.vue.d.ts +631 -0
  35. package/components/bubble-templates/src/types.d.ts +30 -0
  36. package/components/chat-independent/index.css +47 -0
  37. package/components/chat-independent/index.d.ts +4 -0
  38. package/components/chat-independent/index.mjs +184 -0
  39. package/components/chat-independent/src/const.d.ts +13 -0
  40. package/components/chat-independent/src/ctx.d.ts +20 -0
  41. package/components/chat-independent/src/index.vue.d.ts +2388 -0
  42. package/components/chat-independent/src/types.d.ts +13 -0
  43. package/components/index.d.ts +0 -0
  44. package/components/index.mjs +1 -0
  45. package/components/index2.mjs +35980 -0
  46. package/components/lottie-animation/index.mjs +2 -2
  47. package/components/lottie-animation/src/index.vue.d.ts +1 -1
  48. package/components/monaco-editor/index.mjs +2 -2
  49. package/components/monaco-editor/src/ctx.d.ts +3 -3
  50. package/components/monaco-editor/src/index.vue.d.ts +3 -3
  51. package/components/monaco-environment/index.mjs +1 -1
  52. package/components/recorder-button/index.css +7 -10
  53. package/components/recorder-button/index.mjs +115 -83
  54. package/components/recorder-button/src/ctx.d.ts +27 -6
  55. package/components/recorder-button/src/index.vue.d.ts +196 -202
  56. package/components/recorder-button/src/types.d.ts +1 -0
  57. package/components/routes-menu-content/index.mjs +5 -5
  58. package/components/routes-menu-content/src/ctx.d.ts +1 -1
  59. package/components/routes-menu-content/src/index.vue.d.ts +223 -101
  60. package/components/routes-menu-content/src/item/core/ctx.d.ts +1 -1
  61. package/components/routes-menu-content/src/item/core/index.vue.d.ts +175 -53
  62. package/components/routes-menu-content/src/item/index.vue.d.ts +221 -99
  63. package/components/sender/index.css +2 -5
  64. package/components/sender/index.mjs +32 -13
  65. package/components/sender/src/SenderHeader.vue.d.ts +31 -45
  66. package/components/sender/src/ctx.d.ts +23 -3
  67. package/components/sender/src/index.vue.d.ts +170 -124
  68. package/components/sender/src/types.d.ts +1 -1
  69. package/components/speech-button/index.mjs +7 -14
  70. package/components/speech-button/src/ctx.d.ts +1 -1
  71. package/components/speech-button/src/index.vue.d.ts +3 -3
  72. package/components/table-columns/index.d.ts +1 -1
  73. package/components/table-columns/index.mjs +3 -6
  74. package/components/table-columns/src/ctx.d.ts +8 -8
  75. package/components/table-columns/src/el-ctx.d.ts +7 -7
  76. package/components/table-columns/src/index.vue.d.ts +38 -36
  77. package/components/tables-v1/index.mjs +3 -3
  78. package/components/tables-v1/src/ctx.d.ts +66 -68
  79. package/components/tables-v1/src/el-ctx.d.ts +48 -51
  80. package/components/tables-v1/src/index.vue.d.ts +1950 -1933
  81. package/components/tables-v1-checkbox/index.mjs +269 -33
  82. package/components/tables-v1-checkbox/src/ctx.d.ts +65 -67
  83. package/components/tables-v1-checkbox/src/index.vue.d.ts +2167 -2159
  84. package/components/typing-markdown/index.mjs +128 -33
  85. package/components/typing-markdown/src/core.d.ts +2 -3
  86. package/components/typing-markdown/src/ctx.d.ts +5 -5
  87. package/components/typing-markdown/src/index.vue.d.ts +9 -9
  88. package/components/vditor/index.mjs +5 -9
  89. package/components/vditor/src/ctx.d.ts +2 -2
  90. package/components/vditor/src/handle-fullscreen.vue.d.ts +3 -3
  91. package/components/vditor/src/handle-value.vue.d.ts +3 -3
  92. package/components/vditor/src/index.vue.d.ts +11 -11
  93. package/composables/el-breakpoints/index.d.ts +1 -1
  94. package/composables/recorder/index.mjs +751 -182
  95. package/icons/_plugin-vue_export-helper.mjs +9 -0
  96. package/icons/end/index.d.ts +4 -0
  97. package/icons/end/index.mjs +36 -0
  98. package/icons/end/src/avatar.d.ts +12 -0
  99. package/icons/end/src/icon.d.ts +57 -0
  100. package/icons/keyboard/index.d.ts +4 -0
  101. package/icons/keyboard/index.mjs +36 -0
  102. package/icons/keyboard/src/avatar.d.ts +12 -0
  103. package/icons/keyboard/src/icon.d.ts +57 -0
  104. package/icons/start/index.d.ts +4 -0
  105. package/icons/start/index.mjs +36 -0
  106. package/icons/start/src/avatar.d.ts +12 -0
  107. package/icons/start/src/icon.d.ts +57 -0
  108. package/icons/voice/index.d.ts +4 -0
  109. package/icons/voice/index.mjs +51 -0
  110. package/icons/voice/src/avatar.d.ts +12 -0
  111. package/icons/voice/src/icon.d.ts +57 -0
  112. package/icons/voice/src/index.vue.d.ts +4 -0
  113. package/index.css +99 -15
  114. package/package.json +51 -7
  115. package/fetch/PlusFetch/index.d.ts +0 -14
  116. package/fetch/PlusFetch/index.mjs +0 -638
  117. package/fetch/PlusFetch/types.d.ts +0 -54
  118. package/fetch/index.d.ts +0 -1
  119. package/fetch/index.mjs +0 -5
@@ -2,6 +2,580 @@ import { sleep } from '@vunk/shared/promise';
2
2
  import { ElMessage } from 'element-plus';
3
3
  import { ref } from 'vue';
4
4
 
5
+ const LogLevels = {
6
+ fatal: 0,
7
+ error: 0,
8
+ warn: 1,
9
+ log: 2,
10
+ info: 3,
11
+ success: 3,
12
+ fail: 3,
13
+ debug: 4,
14
+ trace: 5,
15
+ verbose: Number.POSITIVE_INFINITY
16
+ };
17
+ const LogTypes = {
18
+ // Silent
19
+ silent: {
20
+ level: -1
21
+ },
22
+ // Level 0
23
+ fatal: {
24
+ level: LogLevels.fatal
25
+ },
26
+ error: {
27
+ level: LogLevels.error
28
+ },
29
+ // Level 1
30
+ warn: {
31
+ level: LogLevels.warn
32
+ },
33
+ // Level 2
34
+ log: {
35
+ level: LogLevels.log
36
+ },
37
+ // Level 3
38
+ info: {
39
+ level: LogLevels.info
40
+ },
41
+ success: {
42
+ level: LogLevels.success
43
+ },
44
+ fail: {
45
+ level: LogLevels.fail
46
+ },
47
+ ready: {
48
+ level: LogLevels.info
49
+ },
50
+ start: {
51
+ level: LogLevels.info
52
+ },
53
+ box: {
54
+ level: LogLevels.info
55
+ },
56
+ // Level 4
57
+ debug: {
58
+ level: LogLevels.debug
59
+ },
60
+ // Level 5
61
+ trace: {
62
+ level: LogLevels.trace
63
+ },
64
+ // Verbose
65
+ verbose: {
66
+ level: LogLevels.verbose
67
+ }
68
+ };
69
+
70
+ function isPlainObject$1(value) {
71
+ if (value === null || typeof value !== "object") {
72
+ return false;
73
+ }
74
+ const prototype = Object.getPrototypeOf(value);
75
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
76
+ return false;
77
+ }
78
+ if (Symbol.iterator in value) {
79
+ return false;
80
+ }
81
+ if (Symbol.toStringTag in value) {
82
+ return Object.prototype.toString.call(value) === "[object Module]";
83
+ }
84
+ return true;
85
+ }
86
+
87
+ function _defu(baseObject, defaults, namespace = ".", merger) {
88
+ if (!isPlainObject$1(defaults)) {
89
+ return _defu(baseObject, {}, namespace);
90
+ }
91
+ const object = Object.assign({}, defaults);
92
+ for (const key in baseObject) {
93
+ if (key === "__proto__" || key === "constructor") {
94
+ continue;
95
+ }
96
+ const value = baseObject[key];
97
+ if (value === null || value === void 0) {
98
+ continue;
99
+ }
100
+ if (Array.isArray(value) && Array.isArray(object[key])) {
101
+ object[key] = [...value, ...object[key]];
102
+ } else if (isPlainObject$1(value) && isPlainObject$1(object[key])) {
103
+ object[key] = _defu(
104
+ value,
105
+ object[key],
106
+ (namespace ? `${namespace}.` : "") + key.toString());
107
+ } else {
108
+ object[key] = value;
109
+ }
110
+ }
111
+ return object;
112
+ }
113
+ function createDefu(merger) {
114
+ return (...arguments_) => (
115
+ // eslint-disable-next-line unicorn/no-array-reduce
116
+ arguments_.reduce((p, c) => _defu(p, c, ""), {})
117
+ );
118
+ }
119
+ const defu = createDefu();
120
+
121
+ function isPlainObject(obj) {
122
+ return Object.prototype.toString.call(obj) === "[object Object]";
123
+ }
124
+ function isLogObj(arg) {
125
+ if (!isPlainObject(arg)) {
126
+ return false;
127
+ }
128
+ if (!arg.message && !arg.args) {
129
+ return false;
130
+ }
131
+ if (arg.stack) {
132
+ return false;
133
+ }
134
+ return true;
135
+ }
136
+
137
+ let paused = false;
138
+ const queue = [];
139
+ class Consola {
140
+ options;
141
+ _lastLog;
142
+ _mockFn;
143
+ /**
144
+ * Creates an instance of Consola with specified options or defaults.
145
+ *
146
+ * @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
147
+ */
148
+ constructor(options = {}) {
149
+ const types = options.types || LogTypes;
150
+ this.options = defu(
151
+ {
152
+ ...options,
153
+ defaults: { ...options.defaults },
154
+ level: _normalizeLogLevel(options.level, types),
155
+ reporters: [...options.reporters || []]
156
+ },
157
+ {
158
+ types: LogTypes,
159
+ throttle: 1e3,
160
+ throttleMin: 5,
161
+ formatOptions: {
162
+ date: true,
163
+ colors: false,
164
+ compact: true
165
+ }
166
+ }
167
+ );
168
+ for (const type in types) {
169
+ const defaults = {
170
+ type,
171
+ ...this.options.defaults,
172
+ ...types[type]
173
+ };
174
+ this[type] = this._wrapLogFn(defaults);
175
+ this[type].raw = this._wrapLogFn(
176
+ defaults,
177
+ true
178
+ );
179
+ }
180
+ if (this.options.mockFn) {
181
+ this.mockTypes();
182
+ }
183
+ this._lastLog = {};
184
+ }
185
+ /**
186
+ * Gets the current log level of the Consola instance.
187
+ *
188
+ * @returns {number} The current log level.
189
+ */
190
+ get level() {
191
+ return this.options.level;
192
+ }
193
+ /**
194
+ * Sets the minimum log level that will be output by the instance.
195
+ *
196
+ * @param {number} level - The new log level to set.
197
+ */
198
+ set level(level) {
199
+ this.options.level = _normalizeLogLevel(
200
+ level,
201
+ this.options.types,
202
+ this.options.level
203
+ );
204
+ }
205
+ /**
206
+ * Displays a prompt to the user and returns the response.
207
+ * Throw an error if `prompt` is not supported by the current configuration.
208
+ *
209
+ * @template T
210
+ * @param {string} message - The message to display in the prompt.
211
+ * @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
212
+ * @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
213
+ */
214
+ prompt(message, opts) {
215
+ if (!this.options.prompt) {
216
+ throw new Error("prompt is not supported!");
217
+ }
218
+ return this.options.prompt(message, opts);
219
+ }
220
+ /**
221
+ * Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
222
+ *
223
+ * @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
224
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
225
+ */
226
+ create(options) {
227
+ const instance = new Consola({
228
+ ...this.options,
229
+ ...options
230
+ });
231
+ if (this._mockFn) {
232
+ instance.mockTypes(this._mockFn);
233
+ }
234
+ return instance;
235
+ }
236
+ /**
237
+ * Creates a new Consola instance with the specified default log object properties.
238
+ *
239
+ * @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
240
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
241
+ */
242
+ withDefaults(defaults) {
243
+ return this.create({
244
+ ...this.options,
245
+ defaults: {
246
+ ...this.options.defaults,
247
+ ...defaults
248
+ }
249
+ });
250
+ }
251
+ /**
252
+ * Creates a new Consola instance with a specified tag, which will be included in every log.
253
+ *
254
+ * @param {string} tag - The tag to include in each log of the new instance.
255
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
256
+ */
257
+ withTag(tag) {
258
+ return this.withDefaults({
259
+ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
260
+ });
261
+ }
262
+ /**
263
+ * Adds a custom reporter to the Consola instance.
264
+ * Reporters will be called for each log message, depending on their implementation and log level.
265
+ *
266
+ * @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
267
+ * @returns {Consola} The current Consola instance.
268
+ */
269
+ addReporter(reporter) {
270
+ this.options.reporters.push(reporter);
271
+ return this;
272
+ }
273
+ /**
274
+ * Removes a custom reporter from the Consola instance.
275
+ * If no reporter is specified, all reporters will be removed.
276
+ *
277
+ * @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
278
+ * @returns {Consola} The current Consola instance.
279
+ */
280
+ removeReporter(reporter) {
281
+ if (reporter) {
282
+ const i = this.options.reporters.indexOf(reporter);
283
+ if (i !== -1) {
284
+ return this.options.reporters.splice(i, 1);
285
+ }
286
+ } else {
287
+ this.options.reporters.splice(0);
288
+ }
289
+ return this;
290
+ }
291
+ /**
292
+ * Replaces all reporters of the Consola instance with the specified array of reporters.
293
+ *
294
+ * @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
295
+ * @returns {Consola} The current Consola instance.
296
+ */
297
+ setReporters(reporters) {
298
+ this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
299
+ return this;
300
+ }
301
+ wrapAll() {
302
+ this.wrapConsole();
303
+ this.wrapStd();
304
+ }
305
+ restoreAll() {
306
+ this.restoreConsole();
307
+ this.restoreStd();
308
+ }
309
+ /**
310
+ * Overrides console methods with Consola logging methods for consistent logging.
311
+ */
312
+ wrapConsole() {
313
+ for (const type in this.options.types) {
314
+ if (!console["__" + type]) {
315
+ console["__" + type] = console[type];
316
+ }
317
+ console[type] = this[type].raw;
318
+ }
319
+ }
320
+ /**
321
+ * Restores the original console methods, removing Consola overrides.
322
+ */
323
+ restoreConsole() {
324
+ for (const type in this.options.types) {
325
+ if (console["__" + type]) {
326
+ console[type] = console["__" + type];
327
+ delete console["__" + type];
328
+ }
329
+ }
330
+ }
331
+ /**
332
+ * Overrides standard output and error streams to redirect them through Consola.
333
+ */
334
+ wrapStd() {
335
+ this._wrapStream(this.options.stdout, "log");
336
+ this._wrapStream(this.options.stderr, "log");
337
+ }
338
+ _wrapStream(stream, type) {
339
+ if (!stream) {
340
+ return;
341
+ }
342
+ if (!stream.__write) {
343
+ stream.__write = stream.write;
344
+ }
345
+ stream.write = (data) => {
346
+ this[type].raw(String(data).trim());
347
+ };
348
+ }
349
+ /**
350
+ * Restores the original standard output and error streams, removing the Consola redirection.
351
+ */
352
+ restoreStd() {
353
+ this._restoreStream(this.options.stdout);
354
+ this._restoreStream(this.options.stderr);
355
+ }
356
+ _restoreStream(stream) {
357
+ if (!stream) {
358
+ return;
359
+ }
360
+ if (stream.__write) {
361
+ stream.write = stream.__write;
362
+ delete stream.__write;
363
+ }
364
+ }
365
+ /**
366
+ * Pauses logging, queues incoming logs until resumed.
367
+ */
368
+ pauseLogs() {
369
+ paused = true;
370
+ }
371
+ /**
372
+ * Resumes logging, processing any queued logs.
373
+ */
374
+ resumeLogs() {
375
+ paused = false;
376
+ const _queue = queue.splice(0);
377
+ for (const item of _queue) {
378
+ item[0]._logFn(item[1], item[2]);
379
+ }
380
+ }
381
+ /**
382
+ * Replaces logging methods with mocks if a mock function is provided.
383
+ *
384
+ * @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
385
+ */
386
+ mockTypes(mockFn) {
387
+ const _mockFn = mockFn || this.options.mockFn;
388
+ this._mockFn = _mockFn;
389
+ if (typeof _mockFn !== "function") {
390
+ return;
391
+ }
392
+ for (const type in this.options.types) {
393
+ this[type] = _mockFn(type, this.options.types[type]) || this[type];
394
+ this[type].raw = this[type];
395
+ }
396
+ }
397
+ _wrapLogFn(defaults, isRaw) {
398
+ return (...args) => {
399
+ if (paused) {
400
+ queue.push([this, defaults, args, isRaw]);
401
+ return;
402
+ }
403
+ return this._logFn(defaults, args, isRaw);
404
+ };
405
+ }
406
+ _logFn(defaults, args, isRaw) {
407
+ if ((defaults.level || 0) > this.level) {
408
+ return false;
409
+ }
410
+ const logObj = {
411
+ date: /* @__PURE__ */ new Date(),
412
+ args: [],
413
+ ...defaults,
414
+ level: _normalizeLogLevel(defaults.level, this.options.types)
415
+ };
416
+ if (!isRaw && args.length === 1 && isLogObj(args[0])) {
417
+ Object.assign(logObj, args[0]);
418
+ } else {
419
+ logObj.args = [...args];
420
+ }
421
+ if (logObj.message) {
422
+ logObj.args.unshift(logObj.message);
423
+ delete logObj.message;
424
+ }
425
+ if (logObj.additional) {
426
+ if (!Array.isArray(logObj.additional)) {
427
+ logObj.additional = logObj.additional.split("\n");
428
+ }
429
+ logObj.args.push("\n" + logObj.additional.join("\n"));
430
+ delete logObj.additional;
431
+ }
432
+ logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
433
+ logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
434
+ const resolveLog = (newLog = false) => {
435
+ const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
436
+ if (this._lastLog.object && repeated > 0) {
437
+ const args2 = [...this._lastLog.object.args];
438
+ if (repeated > 1) {
439
+ args2.push(`(repeated ${repeated} times)`);
440
+ }
441
+ this._log({ ...this._lastLog.object, args: args2 });
442
+ this._lastLog.count = 1;
443
+ }
444
+ if (newLog) {
445
+ this._lastLog.object = logObj;
446
+ this._log(logObj);
447
+ }
448
+ };
449
+ clearTimeout(this._lastLog.timeout);
450
+ const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
451
+ this._lastLog.time = logObj.date;
452
+ if (diffTime < this.options.throttle) {
453
+ try {
454
+ const serializedLog = JSON.stringify([
455
+ logObj.type,
456
+ logObj.tag,
457
+ logObj.args
458
+ ]);
459
+ const isSameLog = this._lastLog.serialized === serializedLog;
460
+ this._lastLog.serialized = serializedLog;
461
+ if (isSameLog) {
462
+ this._lastLog.count = (this._lastLog.count || 0) + 1;
463
+ if (this._lastLog.count > this.options.throttleMin) {
464
+ this._lastLog.timeout = setTimeout(
465
+ resolveLog,
466
+ this.options.throttle
467
+ );
468
+ return;
469
+ }
470
+ }
471
+ } catch {
472
+ }
473
+ }
474
+ resolveLog(true);
475
+ }
476
+ _log(logObj) {
477
+ for (const reporter of this.options.reporters) {
478
+ reporter.log(logObj, {
479
+ options: this.options
480
+ });
481
+ }
482
+ }
483
+ }
484
+ function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
485
+ if (input === void 0) {
486
+ return defaultLevel;
487
+ }
488
+ if (typeof input === "number") {
489
+ return input;
490
+ }
491
+ if (types[input] && types[input].level !== void 0) {
492
+ return types[input].level;
493
+ }
494
+ return defaultLevel;
495
+ }
496
+ Consola.prototype.add = Consola.prototype.addReporter;
497
+ Consola.prototype.remove = Consola.prototype.removeReporter;
498
+ Consola.prototype.clear = Consola.prototype.removeReporter;
499
+ Consola.prototype.withScope = Consola.prototype.withTag;
500
+ Consola.prototype.mock = Consola.prototype.mockTypes;
501
+ Consola.prototype.pause = Consola.prototype.pauseLogs;
502
+ Consola.prototype.resume = Consola.prototype.resumeLogs;
503
+ function createConsola$1(options = {}) {
504
+ return new Consola(options);
505
+ }
506
+
507
+ class BrowserReporter {
508
+ options;
509
+ defaultColor;
510
+ levelColorMap;
511
+ typeColorMap;
512
+ constructor(options) {
513
+ this.options = { ...options };
514
+ this.defaultColor = "#7f8c8d";
515
+ this.levelColorMap = {
516
+ 0: "#c0392b",
517
+ // Red
518
+ 1: "#f39c12",
519
+ // Yellow
520
+ 3: "#00BCD4"
521
+ // Cyan
522
+ };
523
+ this.typeColorMap = {
524
+ success: "#2ecc71"
525
+ // Green
526
+ };
527
+ }
528
+ _getLogFn(level) {
529
+ if (level < 1) {
530
+ return console.__error || console.error;
531
+ }
532
+ if (level === 1) {
533
+ return console.__warn || console.warn;
534
+ }
535
+ return console.__log || console.log;
536
+ }
537
+ log(logObj) {
538
+ const consoleLogFn = this._getLogFn(logObj.level);
539
+ const type = logObj.type === "log" ? "" : logObj.type;
540
+ const tag = logObj.tag || "";
541
+ const color = this.typeColorMap[logObj.type] || this.levelColorMap[logObj.level] || this.defaultColor;
542
+ const style = `
543
+ background: ${color};
544
+ border-radius: 0.5em;
545
+ color: white;
546
+ font-weight: bold;
547
+ padding: 2px 0.5em;
548
+ `;
549
+ const badge = `%c${[tag, type].filter(Boolean).join(":")}`;
550
+ if (typeof logObj.args[0] === "string") {
551
+ consoleLogFn(
552
+ `${badge}%c ${logObj.args[0]}`,
553
+ style,
554
+ // Empty string as style resets to default console style
555
+ "",
556
+ ...logObj.args.slice(1)
557
+ );
558
+ } else {
559
+ consoleLogFn(badge, style, ...logObj.args);
560
+ }
561
+ }
562
+ }
563
+
564
+ function createConsola(options = {}) {
565
+ const consola2 = createConsola$1({
566
+ reporters: options.reporters || [new BrowserReporter({})],
567
+ prompt(message, options2 = {}) {
568
+ if (options2.type === "confirm") {
569
+ return Promise.resolve(confirm(message));
570
+ }
571
+ return Promise.resolve(prompt(message));
572
+ },
573
+ ...options
574
+ });
575
+ return consola2;
576
+ }
577
+ const consola = createConsola();
578
+
5
579
  function getDefaultExportFromCjs (x) {
6
580
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
7
581
  }
@@ -629,7 +1203,7 @@ https://github.com/xiangyuecn/Recorder
629
1203
  s=Fy;
630
1204
  }else { s=filterFn?filterFn(s):s; }
631
1205
 
632
- if(s>0x7FFF) s=0x7FFF; else if(s<-0x8000) s=-0x8000; //Int16越界处理
1206
+ if(s>0x7FFF) s=0x7FFF; else if(s<-32768) s=-32768; //Int16越界处理
633
1207
  if(useSum) _sum+=Math.abs(s);
634
1208
  res[pos]=s;
635
1209
  idx++;
@@ -667,7 +1241,7 @@ https://github.com/xiangyuecn/Recorder
667
1241
  var afterVal=after<il ? F2 : beforeVal; //后个点越界了,忽略不计
668
1242
  var val=beforeVal+(afterVal-beforeVal)*atPoint;
669
1243
 
670
- if(val>0x7FFF) val=0x7FFF; else if(val<-0x8000) val=-0x8000; //Int16越界处理
1244
+ if(val>0x7FFF) val=0x7FFF; else if(val<-32768) val=-32768; //Int16越界处理
671
1245
  if(useSum) _sum+=Math.abs(val);
672
1246
  res[idx]=val;
673
1247
 
@@ -3948,14 +4522,14 @@ function Presets() {
3948
4522
  * </PRE>
3949
4523
  */
3950
4524
  var abr_switch_map = [
3951
- new ABRPresets(8, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -30.0, 11, 0.0012, 1), /* 8, impossible to use in stereo */
3952
- new ABRPresets(16, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -25.0, 11, 0.0010, 1), /* 16 */
3953
- new ABRPresets(24, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -20.0, 11, 0.0010, 1), /* 24 */
3954
- new ABRPresets(32, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -15.0, 11, 0.0010, 1), /* 32 */
3955
- new ABRPresets(40, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -10.0, 11, 0.0009, 1), /* 40 */
3956
- new ABRPresets(48, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -10.0, 11, 0.0009, 1), /* 48 */
3957
- new ABRPresets(56, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -6.0, 11, 0.0008, 1), /* 56 */
3958
- new ABRPresets(64, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -2.0, 11, 0.0008, 1), /* 64 */
4525
+ new ABRPresets(8, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -30, 11, 0.0012, 1), /* 8, impossible to use in stereo */
4526
+ new ABRPresets(16, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -25, 11, 0.0010, 1), /* 16 */
4527
+ new ABRPresets(24, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -20, 11, 0.0010, 1), /* 24 */
4528
+ new ABRPresets(32, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -15, 11, 0.0010, 1), /* 32 */
4529
+ new ABRPresets(40, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -10, 11, 0.0009, 1), /* 40 */
4530
+ new ABRPresets(48, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -10, 11, 0.0009, 1), /* 48 */
4531
+ new ABRPresets(56, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -6, 11, 0.0008, 1), /* 56 */
4532
+ new ABRPresets(64, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, -2, 11, 0.0008, 1), /* 64 */
3959
4533
  new ABRPresets(80, 9, 9, 0, 0, 6.60, 145, 0, 0.95, 0, .0, 8, 0.0007, 1), /* 80 */
3960
4534
  new ABRPresets(96, 9, 9, 0, 2.50, 6.60, 145, 0, 0.95, 0, 1.0, 5.5, 0.0006, 1), /* 96 */
3961
4535
  new ABRPresets(112, 9, 9, 0, 2.25, 6.60, 145, 0, 0.95, 0, 2.0, 4.5, 0.0005, 1), /* 112 */
@@ -6601,7 +7175,7 @@ function QuantizePVT() {
6601
7175
  /*
6602
7176
  * work in progress, don't rely on it too much
6603
7177
  */
6604
- gfc.ATH.floor = 10. * Math_log10(ATHmdct(gfp, -1.));
7178
+ gfc.ATH.floor = 10. * Math_log10(ATHmdct(gfp, -1));
6605
7179
  }
6606
7180
 
6607
7181
  /**
@@ -7007,7 +7581,7 @@ function QuantizePVT() {
7007
7581
  /* 0 dB relative to masking */
7008
7582
  var tot_noise_db = 0;
7009
7583
  /* -200 dB relative to masking */
7010
- var max_noise = -20.0;
7584
+ var max_noise = -20;
7011
7585
  var j = 0;
7012
7586
  var scalefac = cod_info.scalefac;
7013
7587
  var scalefacPos = 0;
@@ -7959,7 +8533,6 @@ function Quantize() {
7959
8533
  var best_part2_3_length = 9999999;
7960
8534
  var bEndOfSearch = false;
7961
8535
  var bRefine = false;
7962
- var best_ggain_pass1 = 0;
7963
8536
 
7964
8537
  bin_search_StepSize(gfc, cod_info, targ_bits, ch, xrpow);
7965
8538
 
@@ -8081,12 +8654,11 @@ function Quantize() {
8081
8654
  if (++age > search_limit
8082
8655
  && best_noise_info.over_count == 0)
8083
8656
  break;
8084
- if ((gfc.noise_shaping_amp == 3) && bRefine && age > 30)
8085
- break;
8657
+ if ((gfc.noise_shaping_amp == 3) && bRefine)
8658
+ ;
8086
8659
  if ((gfc.noise_shaping_amp == 3)
8087
- && bRefine
8088
- && (cod_info_w.global_gain - best_ggain_pass1) > 15)
8089
- break;
8660
+ && bRefine)
8661
+ ;
8090
8662
  }
8091
8663
  }
8092
8664
  } while ((cod_info_w.global_gain + cod_info_w.scalefac_scale) < 255);
@@ -8179,7 +8751,7 @@ function Quantize() {
8179
8751
  function NewMDCT() {
8180
8752
 
8181
8753
  var enwindow = [
8182
- -4.77e-07 * 0.740951125354959 / 2.384e-06,
8754
+ -477e-9 * 0.740951125354959 / 2.384e-06,
8183
8755
  1.03951e-04 * 0.740951125354959 / 2.384e-06,
8184
8756
  9.53674e-04 * 0.740951125354959 / 2.384e-06,
8185
8757
  2.841473e-03 * 0.740951125354959 / 2.384e-06,
@@ -8191,13 +8763,13 @@ function NewMDCT() {
8191
8763
  1.91212e-04 * 0.740951125354959 / 2.384e-06,
8192
8764
  2.283096e-03 * 0.740951125354959 / 2.384e-06,
8193
8765
  1.6994476e-02 * 0.740951125354959 / 2.384e-06,
8194
- -1.8756866e-02 * 0.740951125354959 / 2.384e-06,
8195
- -2.630711e-03 * 0.740951125354959 / 2.384e-06,
8196
- -2.47478e-04 * 0.740951125354959 / 2.384e-06,
8197
- -1.4782e-05 * 0.740951125354959 / 2.384e-06,
8766
+ -0.018756866 * 0.740951125354959 / 2.384e-06,
8767
+ -2630711e-9 * 0.740951125354959 / 2.384e-06,
8768
+ -247478e-9 * 0.740951125354959 / 2.384e-06,
8769
+ -14782e-9 * 0.740951125354959 / 2.384e-06,
8198
8770
  9.063471690191471e-01, 1.960342806591213e-01,
8199
8771
 
8200
- -4.77e-07 * 0.773010453362737 / 2.384e-06,
8772
+ -477e-9 * 0.773010453362737 / 2.384e-06,
8201
8773
  1.05858e-04 * 0.773010453362737 / 2.384e-06,
8202
8774
  9.30786e-04 * 0.773010453362737 / 2.384e-06,
8203
8775
  2.521515e-03 * 0.773010453362737 / 2.384e-06,
@@ -8209,13 +8781,13 @@ function NewMDCT() {
8209
8781
  1.65462e-04 * 0.773010453362737 / 2.384e-06,
8210
8782
  2.110004e-03 * 0.773010453362737 / 2.384e-06,
8211
8783
  1.6112804e-02 * 0.773010453362737 / 2.384e-06,
8212
- -1.9634247e-02 * 0.773010453362737 / 2.384e-06,
8213
- -2.803326e-03 * 0.773010453362737 / 2.384e-06,
8214
- -2.77042e-04 * 0.773010453362737 / 2.384e-06,
8215
- -1.6689e-05 * 0.773010453362737 / 2.384e-06,
8784
+ -0.019634247 * 0.773010453362737 / 2.384e-06,
8785
+ -2803326e-9 * 0.773010453362737 / 2.384e-06,
8786
+ -277042e-9 * 0.773010453362737 / 2.384e-06,
8787
+ -16689e-9 * 0.773010453362737 / 2.384e-06,
8216
8788
  8.206787908286602e-01, 3.901806440322567e-01,
8217
8789
 
8218
- -4.77e-07 * 0.803207531480645 / 2.384e-06,
8790
+ -477e-9 * 0.803207531480645 / 2.384e-06,
8219
8791
  1.07288e-04 * 0.803207531480645 / 2.384e-06,
8220
8792
  9.02653e-04 * 0.803207531480645 / 2.384e-06,
8221
8793
  2.174854e-03 * 0.803207531480645 / 2.384e-06,
@@ -8227,13 +8799,13 @@ function NewMDCT() {
8227
8799
  1.40190e-04 * 0.803207531480645 / 2.384e-06,
8228
8800
  1.937389e-03 * 0.803207531480645 / 2.384e-06,
8229
8801
  1.5233517e-02 * 0.803207531480645 / 2.384e-06,
8230
- -2.0506859e-02 * 0.803207531480645 / 2.384e-06,
8231
- -2.974033e-03 * 0.803207531480645 / 2.384e-06,
8232
- -3.07560e-04 * 0.803207531480645 / 2.384e-06,
8233
- -1.8120e-05 * 0.803207531480645 / 2.384e-06,
8802
+ -0.020506859 * 0.803207531480645 / 2.384e-06,
8803
+ -2974033e-9 * 0.803207531480645 / 2.384e-06,
8804
+ -30756e-8 * 0.803207531480645 / 2.384e-06,
8805
+ -1812e-8 * 0.803207531480645 / 2.384e-06,
8234
8806
  7.416505462720353e-01, 5.805693545089249e-01,
8235
8807
 
8236
- -4.77e-07 * 0.831469612302545 / 2.384e-06,
8808
+ -477e-9 * 0.831469612302545 / 2.384e-06,
8237
8809
  1.08242e-04 * 0.831469612302545 / 2.384e-06,
8238
8810
  8.68797e-04 * 0.831469612302545 / 2.384e-06,
8239
8811
  1.800537e-03 * 0.831469612302545 / 2.384e-06,
@@ -8245,13 +8817,13 @@ function NewMDCT() {
8245
8817
  1.16348e-04 * 0.831469612302545 / 2.384e-06,
8246
8818
  1.766682e-03 * 0.831469612302545 / 2.384e-06,
8247
8819
  1.4358521e-02 * 0.831469612302545 / 2.384e-06,
8248
- -2.1372318e-02 * 0.831469612302545 / 2.384e-06,
8249
- -3.14188e-03 * 0.831469612302545 / 2.384e-06,
8250
- -3.39031e-04 * 0.831469612302545 / 2.384e-06,
8251
- -1.9550e-05 * 0.831469612302545 / 2.384e-06,
8820
+ -0.021372318 * 0.831469612302545 / 2.384e-06,
8821
+ -314188e-8 * 0.831469612302545 / 2.384e-06,
8822
+ -339031e-9 * 0.831469612302545 / 2.384e-06,
8823
+ -1955e-8 * 0.831469612302545 / 2.384e-06,
8252
8824
  6.681786379192989e-01, 7.653668647301797e-01,
8253
8825
 
8254
- -4.77e-07 * 0.857728610000272 / 2.384e-06,
8826
+ -477e-9 * 0.857728610000272 / 2.384e-06,
8255
8827
  1.08719e-04 * 0.857728610000272 / 2.384e-06,
8256
8828
  8.29220e-04 * 0.857728610000272 / 2.384e-06,
8257
8829
  1.399517e-03 * 0.857728610000272 / 2.384e-06,
@@ -8263,13 +8835,13 @@ function NewMDCT() {
8263
8835
  9.3937e-05 * 0.857728610000272 / 2.384e-06,
8264
8836
  1.597881e-03 * 0.857728610000272 / 2.384e-06,
8265
8837
  1.3489246e-02 * 0.857728610000272 / 2.384e-06,
8266
- -2.2228718e-02 * 0.857728610000272 / 2.384e-06,
8267
- -3.306866e-03 * 0.857728610000272 / 2.384e-06,
8268
- -3.71456e-04 * 0.857728610000272 / 2.384e-06,
8269
- -2.1458e-05 * 0.857728610000272 / 2.384e-06,
8838
+ -0.022228718 * 0.857728610000272 / 2.384e-06,
8839
+ -3306866e-9 * 0.857728610000272 / 2.384e-06,
8840
+ -371456e-9 * 0.857728610000272 / 2.384e-06,
8841
+ -21458e-9 * 0.857728610000272 / 2.384e-06,
8270
8842
  5.993769336819237e-01, 9.427934736519954e-01,
8271
8843
 
8272
- -4.77e-07 * 0.881921264348355 / 2.384e-06,
8844
+ -477e-9 * 0.881921264348355 / 2.384e-06,
8273
8845
  1.08719e-04 * 0.881921264348355 / 2.384e-06,
8274
8846
  7.8392e-04 * 0.881921264348355 / 2.384e-06,
8275
8847
  9.71317e-04 * 0.881921264348355 / 2.384e-06,
@@ -8281,13 +8853,13 @@ function NewMDCT() {
8281
8853
  7.2956e-05 * 0.881921264348355 / 2.384e-06,
8282
8854
  1.432419e-03 * 0.881921264348355 / 2.384e-06,
8283
8855
  1.2627602e-02 * 0.881921264348355 / 2.384e-06,
8284
- -2.3074150e-02 * 0.881921264348355 / 2.384e-06,
8285
- -3.467083e-03 * 0.881921264348355 / 2.384e-06,
8286
- -4.04358e-04 * 0.881921264348355 / 2.384e-06,
8287
- -2.3365e-05 * 0.881921264348355 / 2.384e-06,
8856
+ -0.02307415 * 0.881921264348355 / 2.384e-06,
8857
+ -3467083e-9 * 0.881921264348355 / 2.384e-06,
8858
+ -404358e-9 * 0.881921264348355 / 2.384e-06,
8859
+ -23365e-9 * 0.881921264348355 / 2.384e-06,
8288
8860
  5.345111359507916e-01, 1.111140466039205e+00,
8289
8861
 
8290
- -9.54e-07 * 0.903989293123443 / 2.384e-06,
8862
+ -954e-9 * 0.903989293123443 / 2.384e-06,
8291
8863
  1.08242e-04 * 0.903989293123443 / 2.384e-06,
8292
8864
  7.31945e-04 * 0.903989293123443 / 2.384e-06,
8293
8865
  5.15938e-04 * 0.903989293123443 / 2.384e-06,
@@ -8299,13 +8871,13 @@ function NewMDCT() {
8299
8871
  5.2929e-05 * 0.903989293123443 / 2.384e-06,
8300
8872
  1.269817e-03 * 0.903989293123443 / 2.384e-06,
8301
8873
  1.1775017e-02 * 0.903989293123443 / 2.384e-06,
8302
- -2.3907185e-02 * 0.903989293123443 / 2.384e-06,
8303
- -3.622532e-03 * 0.903989293123443 / 2.384e-06,
8304
- -4.38213e-04 * 0.903989293123443 / 2.384e-06,
8305
- -2.5272e-05 * 0.903989293123443 / 2.384e-06,
8874
+ -0.023907185 * 0.903989293123443 / 2.384e-06,
8875
+ -3622532e-9 * 0.903989293123443 / 2.384e-06,
8876
+ -438213e-9 * 0.903989293123443 / 2.384e-06,
8877
+ -25272e-9 * 0.903989293123443 / 2.384e-06,
8306
8878
  4.729647758913199e-01, 1.268786568327291e+00,
8307
8879
 
8308
- -9.54e-07 * 0.92387953251128675613 / 2.384e-06,
8880
+ -954e-9 * 0.92387953251128675613 / 2.384e-06,
8309
8881
  1.06812e-04 * 0.92387953251128675613 / 2.384e-06,
8310
8882
  6.74248e-04 * 0.92387953251128675613 / 2.384e-06,
8311
8883
  3.3379e-05 * 0.92387953251128675613 / 2.384e-06,
@@ -8317,17 +8889,17 @@ function NewMDCT() {
8317
8889
  3.4332e-05 * 0.92387953251128675613 / 2.384e-06,
8318
8890
  1.111031e-03 * 0.92387953251128675613 / 2.384e-06,
8319
8891
  1.0933399e-02 * 0.92387953251128675613 / 2.384e-06,
8320
- -2.4725437e-02 * 0.92387953251128675613 / 2.384e-06,
8321
- -3.771782e-03 * 0.92387953251128675613 / 2.384e-06,
8322
- -4.72546e-04 * 0.92387953251128675613 / 2.384e-06,
8323
- -2.7657e-05 * 0.92387953251128675613 / 2.384e-06,
8892
+ -0.024725437 * 0.92387953251128675613 / 2.384e-06,
8893
+ -3771782e-9 * 0.92387953251128675613 / 2.384e-06,
8894
+ -472546e-9 * 0.92387953251128675613 / 2.384e-06,
8895
+ -27657e-9 * 0.92387953251128675613 / 2.384e-06,
8324
8896
  4.1421356237309504879e-01, /* tan(PI/8) */
8325
8897
  1.414213562373095e+00,
8326
8898
 
8327
- -9.54e-07 * 0.941544065183021 / 2.384e-06,
8899
+ -954e-9 * 0.941544065183021 / 2.384e-06,
8328
8900
  1.05381e-04 * 0.941544065183021 / 2.384e-06,
8329
8901
  6.10352e-04 * 0.941544065183021 / 2.384e-06,
8330
- -4.75883e-04 * 0.941544065183021 / 2.384e-06,
8902
+ -475883e-9 * 0.941544065183021 / 2.384e-06,
8331
8903
  3.4055710e-02 * 0.941544065183021 / 2.384e-06,
8332
8904
  4.649162e-03 * 0.941544065183021 / 2.384e-06,
8333
8905
  9.35555e-04 * 0.941544065183021 / 2.384e-06,
@@ -8336,16 +8908,16 @@ function NewMDCT() {
8336
8908
  1.7166e-05 * 0.941544065183021 / 2.384e-06,
8337
8909
  9.56535e-04 * 0.941544065183021 / 2.384e-06,
8338
8910
  1.0103703e-02 * 0.941544065183021 / 2.384e-06,
8339
- -2.5527000e-02 * 0.941544065183021 / 2.384e-06,
8340
- -3.914356e-03 * 0.941544065183021 / 2.384e-06,
8341
- -5.07355e-04 * 0.941544065183021 / 2.384e-06,
8342
- -3.0041e-05 * 0.941544065183021 / 2.384e-06,
8911
+ -0.025527 * 0.941544065183021 / 2.384e-06,
8912
+ -3914356e-9 * 0.941544065183021 / 2.384e-06,
8913
+ -507355e-9 * 0.941544065183021 / 2.384e-06,
8914
+ -30041e-9 * 0.941544065183021 / 2.384e-06,
8343
8915
  3.578057213145241e-01, 1.546020906725474e+00,
8344
8916
 
8345
- -9.54e-07 * 0.956940335732209 / 2.384e-06,
8917
+ -954e-9 * 0.956940335732209 / 2.384e-06,
8346
8918
  1.02520e-04 * 0.956940335732209 / 2.384e-06,
8347
8919
  5.39303e-04 * 0.956940335732209 / 2.384e-06,
8348
- -1.011848e-03 * 0.956940335732209 / 2.384e-06,
8920
+ -1011848e-9 * 0.956940335732209 / 2.384e-06,
8349
8921
  3.3659935e-02 * 0.956940335732209 / 2.384e-06,
8350
8922
  4.703045e-03 * 0.956940335732209 / 2.384e-06,
8351
8923
  9.15051e-04 * 0.956940335732209 / 2.384e-06,
@@ -8354,100 +8926,100 @@ function NewMDCT() {
8354
8926
  9.54e-07 * 0.956940335732209 / 2.384e-06,
8355
8927
  8.06808e-04 * 0.956940335732209 / 2.384e-06,
8356
8928
  9.287834e-03 * 0.956940335732209 / 2.384e-06,
8357
- -2.6310921e-02 * 0.956940335732209 / 2.384e-06,
8358
- -4.048824e-03 * 0.956940335732209 / 2.384e-06,
8359
- -5.42164e-04 * 0.956940335732209 / 2.384e-06,
8360
- -3.2425e-05 * 0.956940335732209 / 2.384e-06,
8929
+ -0.026310921 * 0.956940335732209 / 2.384e-06,
8930
+ -4048824e-9 * 0.956940335732209 / 2.384e-06,
8931
+ -542164e-9 * 0.956940335732209 / 2.384e-06,
8932
+ -32425e-9 * 0.956940335732209 / 2.384e-06,
8361
8933
  3.033466836073424e-01, 1.662939224605090e+00,
8362
8934
 
8363
- -1.431e-06 * 0.970031253194544 / 2.384e-06,
8935
+ -1431e-9 * 0.970031253194544 / 2.384e-06,
8364
8936
  9.9182e-05 * 0.970031253194544 / 2.384e-06,
8365
8937
  4.62532e-04 * 0.970031253194544 / 2.384e-06,
8366
- -1.573563e-03 * 0.970031253194544 / 2.384e-06,
8938
+ -1573563e-9 * 0.970031253194544 / 2.384e-06,
8367
8939
  3.3225536e-02 * 0.970031253194544 / 2.384e-06,
8368
8940
  4.737377e-03 * 0.970031253194544 / 2.384e-06,
8369
8941
  8.91685e-04 * 0.970031253194544 / 2.384e-06,
8370
8942
  6.6280e-05 * 0.970031253194544 / 2.384e-06, /* 5 */
8371
8943
  4.292e-06 * 0.970031253194544 / 2.384e-06,
8372
- -1.3828e-05 * 0.970031253194544 / 2.384e-06,
8944
+ -13828e-9 * 0.970031253194544 / 2.384e-06,
8373
8945
  6.61850e-04 * 0.970031253194544 / 2.384e-06,
8374
8946
  8.487225e-03 * 0.970031253194544 / 2.384e-06,
8375
- -2.7073860e-02 * 0.970031253194544 / 2.384e-06,
8376
- -4.174709e-03 * 0.970031253194544 / 2.384e-06,
8377
- -5.76973e-04 * 0.970031253194544 / 2.384e-06,
8378
- -3.4809e-05 * 0.970031253194544 / 2.384e-06,
8947
+ -0.02707386 * 0.970031253194544 / 2.384e-06,
8948
+ -4174709e-9 * 0.970031253194544 / 2.384e-06,
8949
+ -576973e-9 * 0.970031253194544 / 2.384e-06,
8950
+ -34809e-9 * 0.970031253194544 / 2.384e-06,
8379
8951
  2.504869601913055e-01, 1.763842528696710e+00,
8380
8952
 
8381
- -1.431e-06 * 0.98078528040323 / 2.384e-06,
8953
+ -1431e-9 * 0.98078528040323 / 2.384e-06,
8382
8954
  9.5367e-05 * 0.98078528040323 / 2.384e-06,
8383
8955
  3.78609e-04 * 0.98078528040323 / 2.384e-06,
8384
- -2.161503e-03 * 0.98078528040323 / 2.384e-06,
8956
+ -2161503e-9 * 0.98078528040323 / 2.384e-06,
8385
8957
  3.2754898e-02 * 0.98078528040323 / 2.384e-06,
8386
8958
  4.752159e-03 * 0.98078528040323 / 2.384e-06,
8387
8959
  8.66413e-04 * 0.98078528040323 / 2.384e-06,
8388
8960
  6.2943e-05 * 0.98078528040323 / 2.384e-06, /* 4 */
8389
8961
  3.815e-06 * 0.98078528040323 / 2.384e-06,
8390
- -2.718e-05 * 0.98078528040323 / 2.384e-06,
8962
+ -2718e-8 * 0.98078528040323 / 2.384e-06,
8391
8963
  5.22137e-04 * 0.98078528040323 / 2.384e-06,
8392
8964
  7.703304e-03 * 0.98078528040323 / 2.384e-06,
8393
- -2.7815342e-02 * 0.98078528040323 / 2.384e-06,
8394
- -4.290581e-03 * 0.98078528040323 / 2.384e-06,
8395
- -6.11782e-04 * 0.98078528040323 / 2.384e-06,
8396
- -3.7670e-05 * 0.98078528040323 / 2.384e-06,
8965
+ -0.027815342 * 0.98078528040323 / 2.384e-06,
8966
+ -4290581e-9 * 0.98078528040323 / 2.384e-06,
8967
+ -611782e-9 * 0.98078528040323 / 2.384e-06,
8968
+ -3767e-8 * 0.98078528040323 / 2.384e-06,
8397
8969
  1.989123673796580e-01, 1.847759065022573e+00,
8398
8970
 
8399
- -1.907e-06 * 0.989176509964781 / 2.384e-06,
8971
+ -1907e-9 * 0.989176509964781 / 2.384e-06,
8400
8972
  9.0122e-05 * 0.989176509964781 / 2.384e-06,
8401
8973
  2.88486e-04 * 0.989176509964781 / 2.384e-06,
8402
- -2.774239e-03 * 0.989176509964781 / 2.384e-06,
8974
+ -2774239e-9 * 0.989176509964781 / 2.384e-06,
8403
8975
  3.2248020e-02 * 0.989176509964781 / 2.384e-06,
8404
8976
  4.748821e-03 * 0.989176509964781 / 2.384e-06,
8405
8977
  8.38757e-04 * 0.989176509964781 / 2.384e-06,
8406
8978
  5.9605e-05 * 0.989176509964781 / 2.384e-06, /* 3 */
8407
8979
  3.338e-06 * 0.989176509964781 / 2.384e-06,
8408
- -3.9577e-05 * 0.989176509964781 / 2.384e-06,
8980
+ -39577e-9 * 0.989176509964781 / 2.384e-06,
8409
8981
  3.88145e-04 * 0.989176509964781 / 2.384e-06,
8410
8982
  6.937027e-03 * 0.989176509964781 / 2.384e-06,
8411
- -2.8532982e-02 * 0.989176509964781 / 2.384e-06,
8412
- -4.395962e-03 * 0.989176509964781 / 2.384e-06,
8413
- -6.46591e-04 * 0.989176509964781 / 2.384e-06,
8414
- -4.0531e-05 * 0.989176509964781 / 2.384e-06,
8983
+ -0.028532982 * 0.989176509964781 / 2.384e-06,
8984
+ -4395962e-9 * 0.989176509964781 / 2.384e-06,
8985
+ -646591e-9 * 0.989176509964781 / 2.384e-06,
8986
+ -40531e-9 * 0.989176509964781 / 2.384e-06,
8415
8987
  1.483359875383474e-01, 1.913880671464418e+00,
8416
8988
 
8417
- -1.907e-06 * 0.995184726672197 / 2.384e-06,
8989
+ -1907e-9 * 0.995184726672197 / 2.384e-06,
8418
8990
  8.4400e-05 * 0.995184726672197 / 2.384e-06,
8419
8991
  1.91689e-04 * 0.995184726672197 / 2.384e-06,
8420
- -3.411293e-03 * 0.995184726672197 / 2.384e-06,
8992
+ -3411293e-9 * 0.995184726672197 / 2.384e-06,
8421
8993
  3.1706810e-02 * 0.995184726672197 / 2.384e-06,
8422
8994
  4.728317e-03 * 0.995184726672197 / 2.384e-06,
8423
8995
  8.09669e-04 * 0.995184726672197 / 2.384e-06,
8424
8996
  5.579e-05 * 0.995184726672197 / 2.384e-06,
8425
8997
  3.338e-06 * 0.995184726672197 / 2.384e-06,
8426
- -5.0545e-05 * 0.995184726672197 / 2.384e-06,
8998
+ -50545e-9 * 0.995184726672197 / 2.384e-06,
8427
8999
  2.59876e-04 * 0.995184726672197 / 2.384e-06,
8428
9000
  6.189346e-03 * 0.995184726672197 / 2.384e-06,
8429
- -2.9224873e-02 * 0.995184726672197 / 2.384e-06,
8430
- -4.489899e-03 * 0.995184726672197 / 2.384e-06,
8431
- -6.80923e-04 * 0.995184726672197 / 2.384e-06,
8432
- -4.3392e-05 * 0.995184726672197 / 2.384e-06,
9001
+ -0.029224873 * 0.995184726672197 / 2.384e-06,
9002
+ -4489899e-9 * 0.995184726672197 / 2.384e-06,
9003
+ -680923e-9 * 0.995184726672197 / 2.384e-06,
9004
+ -43392e-9 * 0.995184726672197 / 2.384e-06,
8433
9005
  9.849140335716425e-02, 1.961570560806461e+00,
8434
9006
 
8435
- -2.384e-06 * 0.998795456205172 / 2.384e-06,
9007
+ -2384e-9 * 0.998795456205172 / 2.384e-06,
8436
9008
  7.7724e-05 * 0.998795456205172 / 2.384e-06,
8437
9009
  8.8215e-05 * 0.998795456205172 / 2.384e-06,
8438
- -4.072189e-03 * 0.998795456205172 / 2.384e-06,
9010
+ -4072189e-9 * 0.998795456205172 / 2.384e-06,
8439
9011
  3.1132698e-02 * 0.998795456205172 / 2.384e-06,
8440
9012
  4.691124e-03 * 0.998795456205172 / 2.384e-06,
8441
9013
  7.79152e-04 * 0.998795456205172 / 2.384e-06,
8442
9014
  5.2929e-05 * 0.998795456205172 / 2.384e-06,
8443
9015
  2.861e-06 * 0.998795456205172 / 2.384e-06,
8444
- -6.0558e-05 * 0.998795456205172 / 2.384e-06,
9016
+ -60558e-9 * 0.998795456205172 / 2.384e-06,
8445
9017
  1.37329e-04 * 0.998795456205172 / 2.384e-06,
8446
9018
  5.462170e-03 * 0.998795456205172 / 2.384e-06,
8447
- -2.9890060e-02 * 0.998795456205172 / 2.384e-06,
8448
- -4.570484e-03 * 0.998795456205172 / 2.384e-06,
8449
- -7.14302e-04 * 0.998795456205172 / 2.384e-06,
8450
- -4.6253e-05 * 0.998795456205172 / 2.384e-06,
9019
+ -0.02989006 * 0.998795456205172 / 2.384e-06,
9020
+ -4570484e-9 * 0.998795456205172 / 2.384e-06,
9021
+ -714302e-9 * 0.998795456205172 / 2.384e-06,
9022
+ -46253e-9 * 0.998795456205172 / 2.384e-06,
8451
9023
  4.912684976946725e-02, 1.990369453344394e+00,
8452
9024
 
8453
9025
  3.5780907e-02 * Util.SQRT2 * 0.5 / 2.384e-06,
@@ -8462,12 +9034,9 @@ function NewMDCT() {
8462
9034
  3.0526638e-02 / 2.384e-06, 4.638195e-03 / 2.384e-06,
8463
9035
  7.47204e-04 / 2.384e-06, 4.9591e-05 / 2.384e-06,
8464
9036
  4.756451e-03 / 2.384e-06, 2.1458e-05 / 2.384e-06,
8465
- -6.9618e-05 / 2.384e-06, /* 2.384e-06/2.384e-06 */
9037
+ -69618e-9 / 2.384e-06, /* 2.384e-06/2.384e-06 */
8466
9038
  ];
8467
9039
 
8468
- var NS = 12;
8469
- var NL = 36;
8470
-
8471
9040
  var win = [
8472
9041
  [
8473
9042
  2.382191739347913e-13,
@@ -8490,25 +9059,25 @@ function NewMDCT() {
8490
9059
  8.371015190102974e-13,
8491
9060
  2.599706096327376e-13,
8492
9061
 
8493
- -5.456116108943412e-12,
8494
- -4.878985199565852e-12,
8495
- -4.240448995017367e-12,
8496
- -3.559909094758252e-12,
8497
- -2.858043359288076e-12,
8498
- -2.156177623817898e-12,
8499
- -1.475637723558783e-12,
8500
- -8.371015190102975e-13,
8501
- -2.599706096327376e-13,
8502
-
8503
- -2.382191739347923e-13,
8504
- -6.423305872147843e-13,
8505
- -9.400849094049696e-13,
8506
- -1.122435026096556e-12,
8507
- -1.183840321267481e-12,
8508
- -1.122435026096556e-12,
8509
- -9.400849094049694e-13,
8510
- -6.423305872147840e-13,
8511
- -2.382191739347918e-13,
9062
+ -5456116108943412e-27,
9063
+ -4878985199565852e-27,
9064
+ -4240448995017367e-27,
9065
+ -3559909094758252e-27,
9066
+ -2858043359288076e-27,
9067
+ -2156177623817898e-27,
9068
+ -1475637723558783e-27,
9069
+ -8371015190102975e-28,
9070
+ -2599706096327376e-28,
9071
+
9072
+ -2382191739347923e-28,
9073
+ -6423305872147843e-28,
9074
+ -9400849094049696e-28,
9075
+ -1122435026096556e-27,
9076
+ -1183840321267481e-27,
9077
+ -1122435026096556e-27,
9078
+ -9400849094049694e-28,
9079
+ -642330587214784e-27,
9080
+ -2382191739347918e-28,
8512
9081
  ],
8513
9082
  [
8514
9083
  2.382191739347913e-13,
@@ -8531,15 +9100,15 @@ function NewMDCT() {
8531
9100
  8.371015190102975e-13,
8532
9101
  2.599706096327376e-13,
8533
9102
 
8534
- -5.461314069809755e-12,
8535
- -4.921085770524055e-12,
8536
- -4.343405037091838e-12,
8537
- -3.732668368707687e-12,
8538
- -3.093523840190885e-12,
8539
- -2.430835727329465e-12,
8540
- -1.734679010007751e-12,
8541
- -9.748253656609281e-13,
8542
- -2.797435120168326e-13,
9103
+ -5461314069809755e-27,
9104
+ -4921085770524055e-27,
9105
+ -4343405037091838e-27,
9106
+ -3732668368707687e-27,
9107
+ -3093523840190885e-27,
9108
+ -2430835727329465e-27,
9109
+ -1734679010007751e-27,
9110
+ -974825365660928e-27,
9111
+ -2797435120168326e-28,
8543
9112
 
8544
9113
  0.000000000000000e+00,
8545
9114
  0.000000000000000e+00,
@@ -8547,9 +9116,9 @@ function NewMDCT() {
8547
9116
  0.000000000000000e+00,
8548
9117
  0.000000000000000e+00,
8549
9118
  0.000000000000000e+00,
8550
- -2.283748241799531e-13,
8551
- -4.037858874020686e-13,
8552
- -2.146547464825323e-13,
9119
+ -2283748241799531e-28,
9120
+ -4037858874020686e-28,
9121
+ -2146547464825323e-28,
8553
9122
  ],
8554
9123
  [
8555
9124
  1.316524975873958e-01, /* win[SHORT_TYPE] */
@@ -8570,19 +9139,19 @@ function NewMDCT() {
8570
9139
  0.64278760968653936292,
8571
9140
  0.34202014332566882393,
8572
9141
  0.93969262078590842791,
8573
- -0.17364817766693030343,
8574
- -0.76604444311897790243,
9142
+ -0.1736481776669303,
9143
+ -0.7660444431189779,
8575
9144
  0.86602540378443870761,
8576
9145
  0.500000000000000e+00,
8577
9146
 
8578
- -5.144957554275265e-01, /* ca */
8579
- -4.717319685649723e-01,
8580
- -3.133774542039019e-01,
8581
- -1.819131996109812e-01,
8582
- -9.457419252642064e-02,
8583
- -4.096558288530405e-02,
8584
- -1.419856857247115e-02,
8585
- -3.699974673760037e-03,
9147
+ -0.5144957554275265, /* ca */
9148
+ -0.4717319685649723,
9149
+ -0.3133774542039019,
9150
+ -0.1819131996109812,
9151
+ -0.09457419252642064,
9152
+ -0.04096558288530405,
9153
+ -0.01419856857247115,
9154
+ -0.003699974673760037,
8586
9155
 
8587
9156
  8.574929257125442e-01, /* cs */
8588
9157
  8.817419973177052e-01,
@@ -8614,25 +9183,25 @@ function NewMDCT() {
8614
9183
  9.748253656609281e-13,
8615
9184
  2.797435120168326e-13,
8616
9185
 
8617
- -5.456116108943413e-12,
8618
- -4.878985199565852e-12,
8619
- -4.240448995017367e-12,
8620
- -3.559909094758253e-12,
8621
- -2.858043359288075e-12,
8622
- -2.156177623817898e-12,
8623
- -1.475637723558782e-12,
8624
- -8.371015190102975e-13,
8625
- -2.599706096327376e-13,
8626
-
8627
- -2.382191739347913e-13,
8628
- -6.423305872147834e-13,
8629
- -9.400849094049688e-13,
8630
- -1.122435026096556e-12,
8631
- -1.183840321267481e-12,
8632
- -1.122435026096556e-12,
8633
- -9.400849094049688e-13,
8634
- -6.423305872147841e-13,
8635
- -2.382191739347918e-13,
9186
+ -5456116108943413e-27,
9187
+ -4878985199565852e-27,
9188
+ -4240448995017367e-27,
9189
+ -3559909094758253e-27,
9190
+ -2858043359288075e-27,
9191
+ -2156177623817898e-27,
9192
+ -1475637723558782e-27,
9193
+ -8371015190102975e-28,
9194
+ -2599706096327376e-28,
9195
+
9196
+ -2382191739347913e-28,
9197
+ -6423305872147834e-28,
9198
+ -9400849094049688e-28,
9199
+ -1122435026096556e-27,
9200
+ -1183840321267481e-27,
9201
+ -1122435026096556e-27,
9202
+ -9400849094049688e-28,
9203
+ -6423305872147841e-28,
9204
+ -2382191739347918e-28,
8636
9205
  ]
8637
9206
  ];
8638
9207
 
@@ -9223,7 +9792,7 @@ function NewMDCT() {
9223
9792
  abort();//fix cc 精简
9224
9793
  }
9225
9794
  if (type == Encoder.SHORT_TYPE) {
9226
- for (var k = -NS / 4; k < 0; k++) {
9795
+ for (var k = -12 / 4; k < 0; k++) {
9227
9796
  var w = win[Encoder.SHORT_TYPE][k + 3];
9228
9797
  mdct_enc[mdct_encPos + k * 3 + 9] = band0[9 + k][order[band]]
9229
9798
  * w - band0[8 - k][order[band]];
@@ -9241,7 +9810,7 @@ function NewMDCT() {
9241
9810
  mdct_short(mdct_enc, mdct_encPos);
9242
9811
  } else {
9243
9812
  var work = new_float(18);
9244
- for (var k = -NL / 4; k < 0; k++) {
9813
+ for (var k = -36 / 4; k < 0; k++) {
9245
9814
  var a, b;
9246
9815
  a = win[type][k + 27]
9247
9816
  * band1[k + 9][order[band]]
@@ -11301,9 +11870,9 @@ function PsyModel() {
11301
11870
  }
11302
11871
 
11303
11872
  var fircoef = [
11304
- -8.65163e-18 * 2, -0.00851586 * 2, -6.74764e-18 * 2, 0.0209036 * 2,
11305
- -3.36639e-17 * 2, -0.0438162 * 2, -1.54175e-17 * 2, 0.0931738 * 2,
11306
- -5.52212e-17 * 2, -0.313819 * 2
11873
+ -865163e-23 * 2, -851586e-8 * 2, -674764e-23 * 2, 0.0209036 * 2,
11874
+ -336639e-22 * 2, -0.0438162 * 2, -154175e-22 * 2, 0.0931738 * 2,
11875
+ -552212e-22 * 2, -0.313819 * 2
11307
11876
  ];
11308
11877
 
11309
11878
  this.L3psycho_anal_ns = function (gfp, buffer, bufPos, gr_out, masking_ratio, masking_MS_ratio, percep_entropy, percep_MS_entropy, energy, blocktype_d) {
@@ -11677,7 +12246,7 @@ function PsyModel() {
11677
12246
  tempy = 15.811389 + 7.5 * tempx - 17.5
11678
12247
  * Math.sqrt(1.0 + tempx * tempx);
11679
12248
 
11680
- if (tempy <= -60.0)
12249
+ if (tempy <= -60)
11681
12250
  return 0.0;
11682
12251
 
11683
12252
  tempx = Math.exp((x + tempy) * LN_TO_LOG10);
@@ -12043,7 +12612,7 @@ function PsyModel() {
12043
12612
  * minval this is an ISO MPEG1 thing, dont know if it is really
12044
12613
  * needed
12045
12614
  */
12046
- x = (-7.0 + bval[i] * 7.0 / 12.0);
12615
+ x = (-7 + bval[i] * 7.0 / 12.0);
12047
12616
  if (bval[i] > 12) {
12048
12617
  x *= 1 + Math.log(1 + x) * 3.1;
12049
12618
  }
@@ -12065,7 +12634,7 @@ function PsyModel() {
12065
12634
  fft.init_fft(gfc);
12066
12635
 
12067
12636
  /* setup temporal masking */
12068
- gfc.decay = Math.exp(-1.0 * LOG10
12637
+ gfc.decay = Math.exp(-1 * LOG10
12069
12638
  / (temporalmask_sustain_sec * sfreq / 192.0));
12070
12639
 
12071
12640
  {
@@ -12091,7 +12660,7 @@ function PsyModel() {
12091
12660
  * per second
12092
12661
  */
12093
12662
  var frame_duration = (576. * gfc.mode_gr / sfreq);
12094
- gfc.ATH.decay = Math.pow(10., -12. / 10. * frame_duration);
12663
+ gfc.ATH.decay = Math.pow(10., -12 / 10. * frame_duration);
12095
12664
  gfc.ATH.adjust = 0.01;
12096
12665
  /* minimum, for leading low loudness */
12097
12666
  gfc.ATH.adjustLimit = 1.0;
@@ -12182,7 +12751,7 @@ function PsyModel() {
12182
12751
  */
12183
12752
 
12184
12753
  // the following Hack allows to ask for the lowest value
12185
- if (f < -.3)
12754
+ if (f < -0.3)
12186
12755
  f = 3410;
12187
12756
 
12188
12757
  // convert to khz
@@ -12412,7 +12981,7 @@ function Lame() {
12412
12981
  gfc.RadioGain = 0;
12413
12982
  gfc.AudiophileGain = 0;
12414
12983
  gfc.noclipGainChange = 0;
12415
- gfc.noclipScale = -1.0;
12984
+ gfc.noclipScale = -1;
12416
12985
 
12417
12986
  gfp.preset = 0;
12418
12987
 
@@ -13269,7 +13838,7 @@ function Lame() {
13269
13838
 
13270
13839
  /* initialize internal adaptive ATH settings -jd */
13271
13840
  gfc.ATH.aaSensitivityP = Math.pow(10.0, gfp.athaa_sensitivity
13272
- / -10.0);
13841
+ / -10);
13273
13842
 
13274
13843
  if (gfp.short_blocks == null) {
13275
13844
  gfp.short_blocks = ShortBlock.short_block_allowed;
@@ -14419,7 +14988,7 @@ function useRecorder() {
14419
14988
  () => {
14420
14989
  supported.value = true;
14421
14990
  opening.value = false;
14422
- console.log("recorder open success", recorder);
14991
+ consola.info("recorder open success", recorder);
14423
14992
  resolve(recorder);
14424
14993
  },
14425
14994
  () => (msg, isUserNotAllow) => {