create-freeholder 0.2.0-beta.4 → 0.2.0-beta.6
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/template/.changeset/blog-playground-content.md +4 -0
- package/dist/template/.changeset/blog-wordpress-structure.md +6 -0
- package/dist/template/.changeset/managed-preview-assistant.md +4 -0
- package/dist/template/.changeset/native-linux-install.md +6 -0
- package/dist/template/.changeset/public-beta-5.md +4 -0
- package/dist/template/.changeset/public-beta-6.md +4 -0
- package/dist/template/.github/ISSUE_TEMPLATE/bug_report.yml +1 -1
- package/dist/template/.github/workflows/release-tarballs.yml +117 -0
- package/dist/template/AGENTS.md +15 -2
- package/dist/template/Dockerfile +3 -0
- package/dist/template/MASTER.md +114 -11
- package/dist/template/README.md +1 -1
- package/dist/template/app/(admin)/admin/assistant/page.tsx +9 -1
- package/dist/template/app/(admin)/admin/blog/PostSettings.tsx +26 -0
- package/dist/template/app/(admin)/admin/blog/[kind]/page.tsx +53 -0
- package/dist/template/app/(admin)/admin/blog/actions.ts +186 -6
- package/dist/template/app/(admin)/admin/blog/comments/page.tsx +25 -0
- package/dist/template/app/(admin)/admin/blog/page.tsx +21 -5
- package/dist/template/app/(admin)/admin/imports/[id]/page.tsx +2 -0
- package/dist/template/app/(admin)/admin/pages/[id]/page.tsx +3 -0
- package/dist/template/app/(admin)/assistant-actions.ts +13 -6
- package/dist/template/app/(public)/[[...slug]]/ReaderComments.tsx +25 -0
- package/dist/template/app/(public)/[[...slug]]/blog-parts.tsx +153 -0
- package/dist/template/app/(public)/[[...slug]]/comment-actions.ts +16 -0
- package/dist/template/app/(public)/[[...slug]]/page.tsx +182 -18
- package/dist/template/app/api/chat/assistant/call/route.ts +35 -0
- package/dist/template/db/migrations/0061_blog_structure.sql +89 -0
- package/dist/template/db/migrations/0062_blog_reader_comments.sql +24 -0
- package/dist/template/db/migrations/meta/_journal.json +14 -0
- package/dist/template/deploy/README.md +26 -9
- package/dist/template/deploy/blog-wordpress-2026-11-07.md +146 -0
- package/dist/template/deploy/docker-selfhost/.env.example +11 -1
- package/dist/template/deploy/docker-selfhost/README.md +79 -50
- package/dist/template/deploy/docker-selfhost/infra/backup.sh +81 -0
- package/dist/template/deploy/docker-selfhost/infra/compose.https.yml +37 -1
- package/dist/template/deploy/docker-selfhost/infra/compose.yml +37 -1
- package/dist/template/deploy/docker-selfhost/migrate.md +8 -5
- package/dist/template/deploy/docker-selfhost/recipe.yaml +9 -10
- package/dist/template/deploy/docker-selfhost/selfhost.sh +206 -0
- package/dist/template/deploy/docker-selfhost/verify.md +11 -4
- package/dist/template/deploy/f-criteria-matrix.md +89 -0
- package/dist/template/deploy/linux/.env.example +28 -0
- package/dist/template/deploy/linux/README.md +181 -0
- package/dist/template/deploy/linux/freeholder +655 -0
- package/dist/template/deploy/linux/install.sh +173 -0
- package/dist/template/deploy/linux/migrate.md +17 -0
- package/dist/template/deploy/linux/recipe.yaml +50 -0
- package/dist/template/deploy/linux/share/Caddyfile.template +19 -0
- package/dist/template/deploy/linux/share/systemd/freeholder-backup.service +13 -0
- package/dist/template/deploy/linux/share/systemd/freeholder-backup.timer +12 -0
- package/dist/template/deploy/linux/share/systemd/freeholder.service +41 -0
- package/dist/template/deploy/linux/verify.md +22 -0
- package/dist/template/deploy/managed-preview-assistant.md +99 -0
- package/dist/template/eslint.config.mjs +3 -1
- package/dist/template/gitignore.template +1 -0
- package/dist/template/locales/ar.json +85 -6
- package/dist/template/locales/en.json +83 -4
- package/dist/template/locales/es.json +83 -4
- package/dist/template/locales/fr.json +85 -6
- package/dist/template/next.config.ts +2 -0
- package/dist/template/package.json +3 -2
- package/dist/template/packages/cli/package.json +1 -1
- package/dist/template/packages/create-freeholder/package.json +1 -1
- package/dist/template/packages/freeholder-app/package.json +1 -1
- package/dist/template/packages/mobile-app/package.json +1 -1
- package/dist/template/packages/plugin-kit/package.json +1 -1
- package/dist/template/packages/sdk/package.json +1 -1
- package/dist/template/packages/sdk/src/generated.ts +177 -9
- package/dist/template/packages/sdk/src/version.ts +1 -1
- package/dist/template/packages/templates/package.json +1 -1
- package/dist/template/proxy.ts +18 -1
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/NOTICE.txt +117 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/audio-output-processor.js +267 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/decoderWorker.min.js +847 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/decoderWorker.min.wasm +0 -0
- package/dist/template/public/managed-assistant/0.1.10/duplex-codec/encoderWorker.min.js +1 -0
- package/dist/template/public/managed-assistant/0.1.10/manifest.json +12 -0
- package/dist/template/public/managed-assistant/0.1.10/pm-ai-duplex-client.js +1376 -0
- package/dist/template/scripts/build-release.d.mts +4 -0
- package/dist/template/scripts/build-release.mjs +171 -0
- package/dist/template/scripts/launch-prepare.mjs +6 -3
- package/dist/template/scripts/license-headers.mjs +3 -0
- package/dist/template/scripts/recipe-matrix.sh +22 -7
- package/dist/template/scripts/verify-wordpress-migration.d.mts +8 -0
- package/dist/template/scripts/verify-wordpress-migration.mjs +105 -0
- package/dist/template/security/adversarial-audit-2026-10-08.md +1 -1
- package/dist/template/src/adapters/ai/types.ts +5 -0
- package/dist/template/src/adapters/paradise/assistant.ts +37 -0
- package/dist/template/src/adapters/paradise/http.ts +4 -3
- package/dist/template/src/adapters/storage/local-mode.ts +54 -0
- package/dist/template/src/adapters/storage/local.ts +53 -26
- package/dist/template/src/core/contract/json-schema.ts +8 -0
- package/dist/template/src/core/demo/playground-inserts.ts +29 -0
- package/dist/template/src/core/demo/playground-policy.ts +9 -0
- package/dist/template/src/core/doctor/index.ts +19 -10
- package/dist/template/src/core/env.ts +8 -1
- package/dist/template/src/core/http/csp.ts +10 -2
- package/dist/template/src/core/http/csrf-client.ts +10 -0
- package/dist/template/src/core/import/service.ts +217 -12
- package/dist/template/src/core/import/wordpress.ts +80 -15
- package/dist/template/src/core/notifications/service.ts +1 -0
- package/dist/template/src/core/retention/registry.ts +2 -0
- package/dist/template/src/core/search/registry.ts +2 -0
- package/dist/template/src/core/seo/feeds.ts +2 -0
- package/dist/template/src/core/seo/jsonld.ts +46 -2
- package/dist/template/src/core/seo/legacy-proxy.ts +53 -0
- package/dist/template/src/core/seo/meta.ts +10 -7
- package/dist/template/src/core/seo/service.ts +14 -1
- package/dist/template/src/core/update/preflight.ts +3 -2
- package/dist/template/src/core/update/release-declaration.json +1 -1
- package/dist/template/src/core/update/service.ts +7 -17
- package/dist/template/src/modules/assistant/contract.ts +1 -1
- package/dist/template/src/modules/assistant/limits.ts +3 -0
- package/dist/template/src/modules/assistant/preview.ts +124 -0
- package/dist/template/src/modules/assistant/provider.ts +7 -0
- package/dist/template/src/modules/assistant/service.ts +21 -5
- package/dist/template/src/modules/cms/blocks/PreviewAssistantCall.tsx +176 -0
- package/dist/template/src/modules/cms/blocks/SiteChatClient.tsx +10 -4
- package/dist/template/src/modules/cms/blocks/surfaces.tsx +10 -0
- package/dist/template/src/modules/cms/blog-comments-schema.ts +27 -0
- package/dist/template/src/modules/cms/blog-comments.ts +111 -0
- package/dist/template/src/modules/cms/blog-schema.ts +146 -0
- package/dist/template/src/modules/cms/blog-service.ts +999 -0
- package/dist/template/src/modules/cms/blog.tsx +245 -25
- package/dist/template/src/modules/cms/manifest.ts +7 -1
- package/dist/template/src/modules/cms/read.ts +18 -0
- package/dist/template/src/modules/cms/service.ts +22 -4
- package/dist/template/src/modules/cms/tables.ts +2 -0
- package/dist/template/src/modules/seed/launch.ts +31 -3
- package/dist/template/tests/browser/blog-structure.spec.ts +69 -0
- package/dist/template/tests/core/agent-launch.test.ts +7 -2
- package/dist/template/tests/core/analytics-consent.test.ts +1 -1
- package/dist/template/tests/core/blog-playground.test.ts +106 -0
- package/dist/template/tests/core/blog-structure-comments.test.ts +166 -0
- package/dist/template/tests/core/client-readiness-security.test.ts +3 -1
- package/dist/template/tests/core/csp.test.ts +1 -1
- package/dist/template/tests/core/deploy-recipe.test.ts +54 -4
- package/dist/template/tests/core/internal-services.test.ts +4 -0
- package/dist/template/tests/core/legacy-redirect-proxy.test.ts +59 -0
- package/dist/template/tests/core/linux-install.test.ts +169 -0
- package/dist/template/tests/core/local-storage-mode.test.ts +29 -0
- package/dist/template/tests/core/locale-routing.test.ts +1 -1
- package/dist/template/tests/core/playground-cache.test.ts +1 -1
- package/dist/template/tests/core/playground.test.ts +3 -3
- package/dist/template/tests/core/preview-assistant-call.test.ts +88 -0
- package/dist/template/tests/core/private-preview-webhooks.test.ts +1 -1
- package/dist/template/tests/core/private-preview.test.ts +1 -1
- package/dist/template/tests/core/proxy-locale.test.ts +1 -1
- package/dist/template/tests/core/sdk-schema.test.ts +20 -0
- package/dist/template/tests/core/seo.test.ts +1 -1
- package/dist/template/tests/core/site-chat-client.test.ts +50 -0
- package/dist/template/tests/core/storage.test.ts +38 -2
- package/dist/template/tests/core/wordpress-import-flow.test.ts +81 -18
- package/dist/template/tests/core/wordpress-import.test.ts +25 -12
- package/dist/template/tests/core/wordpress-migration-verification.test.ts +37 -0
- package/dist/template/tests/modules/preview-assistant.test.ts +164 -0
- package/dist/template-manifest.json +490 -175
- package/package.json +1 -1
|
@@ -0,0 +1,847 @@
|
|
|
1
|
+
var Module = typeof Module !== "undefined" ? Module : {};
|
|
2
|
+
!(function (e, t) {
|
|
3
|
+
"object" == typeof exports && "object" == typeof module
|
|
4
|
+
? (module.exports = t())
|
|
5
|
+
: "function" == typeof define && define.amd
|
|
6
|
+
? define([], t)
|
|
7
|
+
: "object" == typeof exports
|
|
8
|
+
? (exports.DecoderWorker = t())
|
|
9
|
+
: (e.DecoderWorker = t());
|
|
10
|
+
})("undefined" != typeof self ? self : this, function () {
|
|
11
|
+
return (function (e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
function r(s) {
|
|
14
|
+
if (t[s]) return t[s].exports;
|
|
15
|
+
var i = (t[s] = { i: s, l: !1, exports: {} });
|
|
16
|
+
return e[s].call(i.exports, i, i.exports, r), (i.l = !0), i.exports;
|
|
17
|
+
}
|
|
18
|
+
return (
|
|
19
|
+
(r.m = e),
|
|
20
|
+
(r.c = t),
|
|
21
|
+
(r.d = function (e, t, s) {
|
|
22
|
+
r.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: s });
|
|
23
|
+
}),
|
|
24
|
+
(r.r = function (e) {
|
|
25
|
+
"undefined" != typeof Symbol &&
|
|
26
|
+
Symbol.toStringTag &&
|
|
27
|
+
Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }),
|
|
28
|
+
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
29
|
+
}),
|
|
30
|
+
(r.t = function (e, t) {
|
|
31
|
+
if ((1 & t && (e = r(e)), 8 & t)) return e;
|
|
32
|
+
if (4 & t && "object" == typeof e && e && e.__esModule) return e;
|
|
33
|
+
var s = Object.create(null);
|
|
34
|
+
if (
|
|
35
|
+
(r.r(s),
|
|
36
|
+
Object.defineProperty(s, "default", { enumerable: !0, value: e }),
|
|
37
|
+
2 & t && "string" != typeof e)
|
|
38
|
+
)
|
|
39
|
+
for (var i in e)
|
|
40
|
+
r.d(
|
|
41
|
+
s,
|
|
42
|
+
i,
|
|
43
|
+
function (t) {
|
|
44
|
+
return e[t];
|
|
45
|
+
}.bind(null, i),
|
|
46
|
+
);
|
|
47
|
+
return s;
|
|
48
|
+
}),
|
|
49
|
+
(r.n = function (e) {
|
|
50
|
+
var t =
|
|
51
|
+
e && e.__esModule
|
|
52
|
+
? function () {
|
|
53
|
+
return e.default;
|
|
54
|
+
}
|
|
55
|
+
: function () {
|
|
56
|
+
return e;
|
|
57
|
+
};
|
|
58
|
+
return r.d(t, "a", t), t;
|
|
59
|
+
}),
|
|
60
|
+
(r.o = function (e, t) {
|
|
61
|
+
return Object.prototype.hasOwnProperty.call(e, t);
|
|
62
|
+
}),
|
|
63
|
+
(r.p = ""),
|
|
64
|
+
r((r.s = 0))
|
|
65
|
+
);
|
|
66
|
+
})([
|
|
67
|
+
function (e, t, r) {
|
|
68
|
+
null;
|
|
69
|
+
(function (t) {
|
|
70
|
+
var r,
|
|
71
|
+
s,
|
|
72
|
+
i = new Promise(function (e) {
|
|
73
|
+
s = e;
|
|
74
|
+
});
|
|
75
|
+
t.onmessage = function (e) {
|
|
76
|
+
i.then(function () {
|
|
77
|
+
switch (e.data.command) {
|
|
78
|
+
case "decode":
|
|
79
|
+
r && r.decode(e.data.pages);
|
|
80
|
+
break;
|
|
81
|
+
case "done":
|
|
82
|
+
r && (r.sendLastBuffer(), t.close());
|
|
83
|
+
break;
|
|
84
|
+
case "init":
|
|
85
|
+
r = new o(e.data, Module);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
var o = function (e, t) {
|
|
90
|
+
if (!t)
|
|
91
|
+
throw new Error(
|
|
92
|
+
"Module with exports required to initialize a decoder instance",
|
|
93
|
+
);
|
|
94
|
+
(this.mainReady = i),
|
|
95
|
+
(this.config = Object.assign(
|
|
96
|
+
{
|
|
97
|
+
bufferLength: 4096,
|
|
98
|
+
decoderSampleRate: 48e3,
|
|
99
|
+
outputBufferSampleRate: 48e3,
|
|
100
|
+
resampleQuality: 3,
|
|
101
|
+
},
|
|
102
|
+
e,
|
|
103
|
+
)),
|
|
104
|
+
(this._opus_decoder_create = t._opus_decoder_create),
|
|
105
|
+
(this._opus_decoder_destroy = t._opus_decoder_destroy),
|
|
106
|
+
(this._speex_resampler_process_interleaved_float =
|
|
107
|
+
t._speex_resampler_process_interleaved_float),
|
|
108
|
+
(this._speex_resampler_init = t._speex_resampler_init),
|
|
109
|
+
(this._speex_resampler_destroy = t._speex_resampler_destroy),
|
|
110
|
+
(this._opus_decode_float = t._opus_decode_float),
|
|
111
|
+
(this._free = t._free),
|
|
112
|
+
(this._malloc = t._malloc),
|
|
113
|
+
(this.HEAPU8 = t.HEAPU8),
|
|
114
|
+
(this.HEAP32 = t.HEAP32),
|
|
115
|
+
(this.HEAPF32 = t.HEAPF32),
|
|
116
|
+
(this.outputBuffers = []);
|
|
117
|
+
};
|
|
118
|
+
(o.prototype.decode = function (e) {
|
|
119
|
+
var t = new DataView(e.buffer);
|
|
120
|
+
this.getPageBoundaries(t).map(function (r) {
|
|
121
|
+
var s = t.getUint8(r + 5, !0),
|
|
122
|
+
i = t.getUint32(r + 18, !0);
|
|
123
|
+
if (
|
|
124
|
+
(2 & s &&
|
|
125
|
+
((this.numberOfChannels = t.getUint8(r + 37, !0)), this.init()),
|
|
126
|
+
i > 1)
|
|
127
|
+
) {
|
|
128
|
+
for (
|
|
129
|
+
var o = t.getUint8(r + 26, !0), u = r + 27 + o, n = 0;
|
|
130
|
+
n < o;
|
|
131
|
+
n++
|
|
132
|
+
) {
|
|
133
|
+
var f = t.getUint8(r + 27 + n, !0);
|
|
134
|
+
if (
|
|
135
|
+
(this.decoderBuffer.set(
|
|
136
|
+
e.subarray(u, (u += f)),
|
|
137
|
+
this.decoderBufferIndex,
|
|
138
|
+
),
|
|
139
|
+
(this.decoderBufferIndex += f),
|
|
140
|
+
f < 255)
|
|
141
|
+
) {
|
|
142
|
+
var h = this._opus_decode_float(
|
|
143
|
+
this.decoder,
|
|
144
|
+
this.decoderBufferPointer,
|
|
145
|
+
this.decoderBufferIndex,
|
|
146
|
+
this.decoderOutputPointer,
|
|
147
|
+
this.decoderOutputMaxLength,
|
|
148
|
+
0,
|
|
149
|
+
),
|
|
150
|
+
a = Math.ceil(
|
|
151
|
+
(h * this.config.outputBufferSampleRate) /
|
|
152
|
+
this.config.decoderSampleRate,
|
|
153
|
+
);
|
|
154
|
+
(this.HEAP32[this.decoderOutputLengthPointer >> 2] = h),
|
|
155
|
+
(this.HEAP32[this.resampleOutputLengthPointer >> 2] = a),
|
|
156
|
+
this._speex_resampler_process_interleaved_float(
|
|
157
|
+
this.resampler,
|
|
158
|
+
this.decoderOutputPointer,
|
|
159
|
+
this.decoderOutputLengthPointer,
|
|
160
|
+
this.resampleOutputBufferPointer,
|
|
161
|
+
this.resampleOutputLengthPointer,
|
|
162
|
+
),
|
|
163
|
+
this.sendToOutputBuffers(
|
|
164
|
+
this.HEAPF32.subarray(
|
|
165
|
+
this.resampleOutputBufferPointer >> 2,
|
|
166
|
+
(this.resampleOutputBufferPointer >> 2) +
|
|
167
|
+
a * this.numberOfChannels,
|
|
168
|
+
),
|
|
169
|
+
),
|
|
170
|
+
(this.decoderBufferIndex = 0);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
4 & s && this.sendLastBuffer();
|
|
174
|
+
}
|
|
175
|
+
}, this);
|
|
176
|
+
}),
|
|
177
|
+
(o.prototype.getPageBoundaries = function (e) {
|
|
178
|
+
for (var t = [], r = 0; r < e.byteLength - 4; r++)
|
|
179
|
+
1399285583 == e.getUint32(r, !0) && t.push(r);
|
|
180
|
+
return t;
|
|
181
|
+
}),
|
|
182
|
+
(o.prototype.init = function () {
|
|
183
|
+
this.resetOutputBuffers(), this.initCodec(), this.initResampler();
|
|
184
|
+
}),
|
|
185
|
+
(o.prototype.initCodec = function () {
|
|
186
|
+
this.decoder &&
|
|
187
|
+
(this._opus_decoder_destroy(this.decoder),
|
|
188
|
+
this._free(this.decoderBufferPointer),
|
|
189
|
+
this._free(this.decoderOutputLengthPointer),
|
|
190
|
+
this._free(this.decoderOutputPointer));
|
|
191
|
+
var e = this._malloc(4);
|
|
192
|
+
(this.decoder = this._opus_decoder_create(
|
|
193
|
+
this.config.decoderSampleRate,
|
|
194
|
+
this.numberOfChannels,
|
|
195
|
+
e,
|
|
196
|
+
)),
|
|
197
|
+
this._free(e),
|
|
198
|
+
(this.decoderBufferMaxLength = 4e3),
|
|
199
|
+
(this.decoderBufferPointer = this._malloc(
|
|
200
|
+
this.decoderBufferMaxLength,
|
|
201
|
+
)),
|
|
202
|
+
(this.decoderBuffer = this.HEAPU8.subarray(
|
|
203
|
+
this.decoderBufferPointer,
|
|
204
|
+
this.decoderBufferPointer + this.decoderBufferMaxLength,
|
|
205
|
+
)),
|
|
206
|
+
(this.decoderBufferIndex = 0),
|
|
207
|
+
(this.decoderOutputLengthPointer = this._malloc(4)),
|
|
208
|
+
(this.decoderOutputMaxLength =
|
|
209
|
+
(this.config.decoderSampleRate * this.numberOfChannels * 120) /
|
|
210
|
+
1e3),
|
|
211
|
+
(this.decoderOutputPointer = this._malloc(
|
|
212
|
+
4 * this.decoderOutputMaxLength,
|
|
213
|
+
));
|
|
214
|
+
}),
|
|
215
|
+
(o.prototype.initResampler = function () {
|
|
216
|
+
this.resampler &&
|
|
217
|
+
(this._speex_resampler_destroy(this.resampler),
|
|
218
|
+
this._free(this.resampleOutputLengthPointer),
|
|
219
|
+
this._free(this.resampleOutputBufferPointer));
|
|
220
|
+
var e = this._malloc(4);
|
|
221
|
+
(this.resampler = this._speex_resampler_init(
|
|
222
|
+
this.numberOfChannels,
|
|
223
|
+
this.config.decoderSampleRate,
|
|
224
|
+
this.config.outputBufferSampleRate,
|
|
225
|
+
this.config.resampleQuality,
|
|
226
|
+
e,
|
|
227
|
+
)),
|
|
228
|
+
this._free(e),
|
|
229
|
+
(this.resampleOutputLengthPointer = this._malloc(4)),
|
|
230
|
+
(this.resampleOutputMaxLength = Math.ceil(
|
|
231
|
+
(this.decoderOutputMaxLength *
|
|
232
|
+
this.config.outputBufferSampleRate) /
|
|
233
|
+
this.config.decoderSampleRate,
|
|
234
|
+
)),
|
|
235
|
+
(this.resampleOutputBufferPointer = this._malloc(
|
|
236
|
+
4 * this.resampleOutputMaxLength,
|
|
237
|
+
));
|
|
238
|
+
}),
|
|
239
|
+
(o.prototype.resetOutputBuffers = function () {
|
|
240
|
+
(this.outputBuffers = []),
|
|
241
|
+
(this.outputBufferArrayBuffers = []),
|
|
242
|
+
(this.outputBufferIndex = 0);
|
|
243
|
+
for (var e = 0; e < this.numberOfChannels; e++)
|
|
244
|
+
this.outputBuffers.push(
|
|
245
|
+
new Float32Array(this.config.bufferLength),
|
|
246
|
+
),
|
|
247
|
+
this.outputBufferArrayBuffers.push(
|
|
248
|
+
this.outputBuffers[e].buffer,
|
|
249
|
+
);
|
|
250
|
+
}),
|
|
251
|
+
(o.prototype.sendLastBuffer = function () {
|
|
252
|
+
this.sendToOutputBuffers(
|
|
253
|
+
new Float32Array(
|
|
254
|
+
(this.config.bufferLength - this.outputBufferIndex) *
|
|
255
|
+
this.numberOfChannels,
|
|
256
|
+
),
|
|
257
|
+
),
|
|
258
|
+
t.postMessage(null);
|
|
259
|
+
}),
|
|
260
|
+
(o.prototype.sendToOutputBuffers = function (e) {
|
|
261
|
+
for (var r = 0, s = e.length / this.numberOfChannels; r < s; ) {
|
|
262
|
+
var i = Math.min(
|
|
263
|
+
s - r,
|
|
264
|
+
this.config.bufferLength - this.outputBufferIndex,
|
|
265
|
+
);
|
|
266
|
+
if (1 === this.numberOfChannels)
|
|
267
|
+
this.outputBuffers[0].set(
|
|
268
|
+
e.subarray(r, r + i),
|
|
269
|
+
this.outputBufferIndex,
|
|
270
|
+
);
|
|
271
|
+
else
|
|
272
|
+
for (var o = 0; o < i; o++)
|
|
273
|
+
this.outputBuffers.forEach(function (t, s) {
|
|
274
|
+
t[this.outputBufferIndex + o] =
|
|
275
|
+
e[(r + o) * this.numberOfChannels + s];
|
|
276
|
+
}, this);
|
|
277
|
+
(r += i),
|
|
278
|
+
(this.outputBufferIndex += i),
|
|
279
|
+
this.outputBufferIndex == this.config.bufferLength &&
|
|
280
|
+
(t.postMessage(
|
|
281
|
+
this.outputBuffers,
|
|
282
|
+
this.outputBufferArrayBuffers,
|
|
283
|
+
),
|
|
284
|
+
this.resetOutputBuffers());
|
|
285
|
+
}
|
|
286
|
+
}),
|
|
287
|
+
Module || (Module = {}),
|
|
288
|
+
(Module.mainReady = i),
|
|
289
|
+
(Module.OggOpusDecoder = o),
|
|
290
|
+
(Module.onRuntimeInitialized = s),
|
|
291
|
+
(e.exports = Module);
|
|
292
|
+
}).call(this, r(1));
|
|
293
|
+
},
|
|
294
|
+
function (e, t) {
|
|
295
|
+
var r;
|
|
296
|
+
r = (function () {
|
|
297
|
+
return this;
|
|
298
|
+
})();
|
|
299
|
+
try {
|
|
300
|
+
r = r || new Function("return this")();
|
|
301
|
+
} catch (e) {
|
|
302
|
+
"object" == typeof window && (r = window);
|
|
303
|
+
}
|
|
304
|
+
e.exports = r;
|
|
305
|
+
},
|
|
306
|
+
]);
|
|
307
|
+
});
|
|
308
|
+
var moduleOverrides = {};
|
|
309
|
+
var key;
|
|
310
|
+
for (key in Module) {
|
|
311
|
+
if (Module.hasOwnProperty(key)) {
|
|
312
|
+
moduleOverrides[key] = Module[key];
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
var arguments_ = [];
|
|
316
|
+
var thisProgram = "./this.program";
|
|
317
|
+
var quit_ = function (status, toThrow) {
|
|
318
|
+
throw toThrow;
|
|
319
|
+
};
|
|
320
|
+
var ENVIRONMENT_IS_WEB = typeof window === "object";
|
|
321
|
+
var ENVIRONMENT_IS_WORKER = typeof importScripts === "function";
|
|
322
|
+
var ENVIRONMENT_IS_NODE =
|
|
323
|
+
typeof process === "object" &&
|
|
324
|
+
typeof process.versions === "object" &&
|
|
325
|
+
typeof process.versions.node === "string";
|
|
326
|
+
var scriptDirectory = "";
|
|
327
|
+
function locateFile(path) {
|
|
328
|
+
if (Module["locateFile"]) {
|
|
329
|
+
return Module["locateFile"](path, scriptDirectory);
|
|
330
|
+
}
|
|
331
|
+
return scriptDirectory + path;
|
|
332
|
+
}
|
|
333
|
+
var read_, readAsync, readBinary, setWindowTitle;
|
|
334
|
+
function logExceptionOnExit(e) {
|
|
335
|
+
if (e instanceof ExitStatus) return;
|
|
336
|
+
var toLog = e;
|
|
337
|
+
err("exiting due to exception: " + toLog);
|
|
338
|
+
}
|
|
339
|
+
var nodeFS;
|
|
340
|
+
var nodePath;
|
|
341
|
+
if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
|
|
342
|
+
if (ENVIRONMENT_IS_WORKER) {
|
|
343
|
+
scriptDirectory = self.location.href;
|
|
344
|
+
} else if (typeof document !== "undefined" && document.currentScript) {
|
|
345
|
+
scriptDirectory = document.currentScript.src;
|
|
346
|
+
}
|
|
347
|
+
if (scriptDirectory.indexOf("blob:") !== 0) {
|
|
348
|
+
scriptDirectory = scriptDirectory.substr(
|
|
349
|
+
0,
|
|
350
|
+
scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1,
|
|
351
|
+
);
|
|
352
|
+
} else {
|
|
353
|
+
scriptDirectory = "";
|
|
354
|
+
}
|
|
355
|
+
{
|
|
356
|
+
read_ = function (url) {
|
|
357
|
+
var xhr = new XMLHttpRequest();
|
|
358
|
+
xhr.open("GET", url, false);
|
|
359
|
+
xhr.send(null);
|
|
360
|
+
return xhr.responseText;
|
|
361
|
+
};
|
|
362
|
+
if (ENVIRONMENT_IS_WORKER) {
|
|
363
|
+
readBinary = function (url) {
|
|
364
|
+
var xhr = new XMLHttpRequest();
|
|
365
|
+
xhr.open("GET", url, false);
|
|
366
|
+
xhr.responseType = "arraybuffer";
|
|
367
|
+
xhr.send(null);
|
|
368
|
+
return new Uint8Array(xhr.response);
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
readAsync = function (url, onload, onerror) {
|
|
372
|
+
var xhr = new XMLHttpRequest();
|
|
373
|
+
xhr.open("GET", url, true);
|
|
374
|
+
xhr.responseType = "arraybuffer";
|
|
375
|
+
xhr.onload = function () {
|
|
376
|
+
if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) {
|
|
377
|
+
onload(xhr.response);
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
onerror();
|
|
381
|
+
};
|
|
382
|
+
xhr.onerror = onerror;
|
|
383
|
+
xhr.send(null);
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
setWindowTitle = function (title) {
|
|
387
|
+
document.title = title;
|
|
388
|
+
};
|
|
389
|
+
} else {
|
|
390
|
+
}
|
|
391
|
+
var out = Module["print"] || console.log.bind(console);
|
|
392
|
+
var err = Module["printErr"] || console.warn.bind(console);
|
|
393
|
+
for (key in moduleOverrides) {
|
|
394
|
+
if (moduleOverrides.hasOwnProperty(key)) {
|
|
395
|
+
Module[key] = moduleOverrides[key];
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
moduleOverrides = null;
|
|
399
|
+
if (Module["arguments"]) arguments_ = Module["arguments"];
|
|
400
|
+
if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
|
|
401
|
+
if (Module["quit"]) quit_ = Module["quit"];
|
|
402
|
+
var wasmBinary;
|
|
403
|
+
if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"];
|
|
404
|
+
var noExitRuntime = Module["noExitRuntime"] || true;
|
|
405
|
+
if (typeof WebAssembly !== "object") {
|
|
406
|
+
abort("no native wasm support detected");
|
|
407
|
+
}
|
|
408
|
+
var wasmMemory;
|
|
409
|
+
var ABORT = false;
|
|
410
|
+
var EXITSTATUS;
|
|
411
|
+
function assert(condition, text) {
|
|
412
|
+
if (!condition) {
|
|
413
|
+
abort("Assertion failed: " + text);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
var UTF8Decoder =
|
|
417
|
+
typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined;
|
|
418
|
+
function UTF8ArrayToString(heap, idx, maxBytesToRead) {
|
|
419
|
+
var endIdx = idx + maxBytesToRead;
|
|
420
|
+
var endPtr = idx;
|
|
421
|
+
while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr;
|
|
422
|
+
if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) {
|
|
423
|
+
return UTF8Decoder.decode(heap.subarray(idx, endPtr));
|
|
424
|
+
} else {
|
|
425
|
+
var str = "";
|
|
426
|
+
while (idx < endPtr) {
|
|
427
|
+
var u0 = heap[idx++];
|
|
428
|
+
if (!(u0 & 128)) {
|
|
429
|
+
str += String.fromCharCode(u0);
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
var u1 = heap[idx++] & 63;
|
|
433
|
+
if ((u0 & 224) == 192) {
|
|
434
|
+
str += String.fromCharCode(((u0 & 31) << 6) | u1);
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
var u2 = heap[idx++] & 63;
|
|
438
|
+
if ((u0 & 240) == 224) {
|
|
439
|
+
u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
|
|
440
|
+
} else {
|
|
441
|
+
u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heap[idx++] & 63);
|
|
442
|
+
}
|
|
443
|
+
if (u0 < 65536) {
|
|
444
|
+
str += String.fromCharCode(u0);
|
|
445
|
+
} else {
|
|
446
|
+
var ch = u0 - 65536;
|
|
447
|
+
str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023));
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return str;
|
|
452
|
+
}
|
|
453
|
+
function UTF8ToString(ptr, maxBytesToRead) {
|
|
454
|
+
return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
|
|
455
|
+
}
|
|
456
|
+
var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
|
|
457
|
+
function updateGlobalBufferAndViews(buf) {
|
|
458
|
+
buffer = buf;
|
|
459
|
+
Module["HEAP8"] = HEAP8 = new Int8Array(buf);
|
|
460
|
+
Module["HEAP16"] = HEAP16 = new Int16Array(buf);
|
|
461
|
+
Module["HEAP32"] = HEAP32 = new Int32Array(buf);
|
|
462
|
+
Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf);
|
|
463
|
+
Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf);
|
|
464
|
+
Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf);
|
|
465
|
+
Module["HEAPF32"] = HEAPF32 = new Float32Array(buf);
|
|
466
|
+
Module["HEAPF64"] = HEAPF64 = new Float64Array(buf);
|
|
467
|
+
}
|
|
468
|
+
var INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216;
|
|
469
|
+
var wasmTable;
|
|
470
|
+
var __ATPRERUN__ = [];
|
|
471
|
+
var __ATINIT__ = [];
|
|
472
|
+
var __ATPOSTRUN__ = [];
|
|
473
|
+
var runtimeInitialized = false;
|
|
474
|
+
var runtimeKeepaliveCounter = 0;
|
|
475
|
+
function keepRuntimeAlive() {
|
|
476
|
+
return noExitRuntime || runtimeKeepaliveCounter > 0;
|
|
477
|
+
}
|
|
478
|
+
function preRun() {
|
|
479
|
+
if (Module["preRun"]) {
|
|
480
|
+
if (typeof Module["preRun"] == "function")
|
|
481
|
+
Module["preRun"] = [Module["preRun"]];
|
|
482
|
+
while (Module["preRun"].length) {
|
|
483
|
+
addOnPreRun(Module["preRun"].shift());
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
callRuntimeCallbacks(__ATPRERUN__);
|
|
487
|
+
}
|
|
488
|
+
function initRuntime() {
|
|
489
|
+
runtimeInitialized = true;
|
|
490
|
+
callRuntimeCallbacks(__ATINIT__);
|
|
491
|
+
}
|
|
492
|
+
function postRun() {
|
|
493
|
+
if (Module["postRun"]) {
|
|
494
|
+
if (typeof Module["postRun"] == "function")
|
|
495
|
+
Module["postRun"] = [Module["postRun"]];
|
|
496
|
+
while (Module["postRun"].length) {
|
|
497
|
+
addOnPostRun(Module["postRun"].shift());
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
callRuntimeCallbacks(__ATPOSTRUN__);
|
|
501
|
+
}
|
|
502
|
+
function addOnPreRun(cb) {
|
|
503
|
+
__ATPRERUN__.unshift(cb);
|
|
504
|
+
}
|
|
505
|
+
function addOnInit(cb) {
|
|
506
|
+
__ATINIT__.unshift(cb);
|
|
507
|
+
}
|
|
508
|
+
function addOnPostRun(cb) {
|
|
509
|
+
__ATPOSTRUN__.unshift(cb);
|
|
510
|
+
}
|
|
511
|
+
var runDependencies = 0;
|
|
512
|
+
var runDependencyWatcher = null;
|
|
513
|
+
var dependenciesFulfilled = null;
|
|
514
|
+
function addRunDependency(id) {
|
|
515
|
+
runDependencies++;
|
|
516
|
+
if (Module["monitorRunDependencies"]) {
|
|
517
|
+
Module["monitorRunDependencies"](runDependencies);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
function removeRunDependency(id) {
|
|
521
|
+
runDependencies--;
|
|
522
|
+
if (Module["monitorRunDependencies"]) {
|
|
523
|
+
Module["monitorRunDependencies"](runDependencies);
|
|
524
|
+
}
|
|
525
|
+
if (runDependencies == 0) {
|
|
526
|
+
if (runDependencyWatcher !== null) {
|
|
527
|
+
clearInterval(runDependencyWatcher);
|
|
528
|
+
runDependencyWatcher = null;
|
|
529
|
+
}
|
|
530
|
+
if (dependenciesFulfilled) {
|
|
531
|
+
var callback = dependenciesFulfilled;
|
|
532
|
+
dependenciesFulfilled = null;
|
|
533
|
+
callback();
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
Module["preloadedImages"] = {};
|
|
538
|
+
Module["preloadedAudios"] = {};
|
|
539
|
+
function abort(what) {
|
|
540
|
+
{
|
|
541
|
+
if (Module["onAbort"]) {
|
|
542
|
+
Module["onAbort"](what);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
what = "Aborted(" + what + ")";
|
|
546
|
+
err(what);
|
|
547
|
+
ABORT = true;
|
|
548
|
+
EXITSTATUS = 1;
|
|
549
|
+
what += ". Build with -s ASSERTIONS=1 for more info.";
|
|
550
|
+
var e = new WebAssembly.RuntimeError(what);
|
|
551
|
+
throw e;
|
|
552
|
+
}
|
|
553
|
+
var dataURIPrefix = "data:application/octet-stream;base64,";
|
|
554
|
+
function isDataURI(filename) {
|
|
555
|
+
return filename.startsWith(dataURIPrefix);
|
|
556
|
+
}
|
|
557
|
+
function isFileURI(filename) {
|
|
558
|
+
return filename.startsWith("file://");
|
|
559
|
+
}
|
|
560
|
+
var wasmBinaryFile;
|
|
561
|
+
wasmBinaryFile = "decoderWorker.min.wasm";
|
|
562
|
+
if (!isDataURI(wasmBinaryFile)) {
|
|
563
|
+
wasmBinaryFile = locateFile(wasmBinaryFile);
|
|
564
|
+
}
|
|
565
|
+
function getBinary(file) {
|
|
566
|
+
try {
|
|
567
|
+
if (file == wasmBinaryFile && wasmBinary) {
|
|
568
|
+
return new Uint8Array(wasmBinary);
|
|
569
|
+
}
|
|
570
|
+
if (readBinary) {
|
|
571
|
+
return readBinary(file);
|
|
572
|
+
} else {
|
|
573
|
+
throw "both async and sync fetching of the wasm failed";
|
|
574
|
+
}
|
|
575
|
+
} catch (err) {
|
|
576
|
+
abort(err);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
function getBinaryPromise() {
|
|
580
|
+
if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
|
|
581
|
+
if (typeof fetch === "function" && !isFileURI(wasmBinaryFile)) {
|
|
582
|
+
return fetch(wasmBinaryFile, { credentials: "same-origin" })
|
|
583
|
+
.then(function (response) {
|
|
584
|
+
if (!response["ok"]) {
|
|
585
|
+
throw "failed to load wasm binary file at '" + wasmBinaryFile + "'";
|
|
586
|
+
}
|
|
587
|
+
return response["arrayBuffer"]();
|
|
588
|
+
})
|
|
589
|
+
.catch(function () {
|
|
590
|
+
return getBinary(wasmBinaryFile);
|
|
591
|
+
});
|
|
592
|
+
} else {
|
|
593
|
+
if (readAsync) {
|
|
594
|
+
return new Promise(function (resolve, reject) {
|
|
595
|
+
readAsync(
|
|
596
|
+
wasmBinaryFile,
|
|
597
|
+
function (response) {
|
|
598
|
+
resolve(new Uint8Array(response));
|
|
599
|
+
},
|
|
600
|
+
reject,
|
|
601
|
+
);
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
return Promise.resolve().then(function () {
|
|
607
|
+
return getBinary(wasmBinaryFile);
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
function createWasm() {
|
|
611
|
+
var info = { a: asmLibraryArg };
|
|
612
|
+
function receiveInstance(instance, module) {
|
|
613
|
+
var exports = instance.exports;
|
|
614
|
+
Module["asm"] = exports;
|
|
615
|
+
wasmMemory = Module["asm"]["g"];
|
|
616
|
+
updateGlobalBufferAndViews(wasmMemory.buffer);
|
|
617
|
+
wasmTable = Module["asm"]["q"];
|
|
618
|
+
addOnInit(Module["asm"]["h"]);
|
|
619
|
+
removeRunDependency("wasm-instantiate");
|
|
620
|
+
}
|
|
621
|
+
addRunDependency("wasm-instantiate");
|
|
622
|
+
function receiveInstantiationResult(result) {
|
|
623
|
+
receiveInstance(result["instance"]);
|
|
624
|
+
}
|
|
625
|
+
function instantiateArrayBuffer(receiver) {
|
|
626
|
+
return getBinaryPromise()
|
|
627
|
+
.then(function (binary) {
|
|
628
|
+
return WebAssembly.instantiate(binary, info);
|
|
629
|
+
})
|
|
630
|
+
.then(function (instance) {
|
|
631
|
+
return instance;
|
|
632
|
+
})
|
|
633
|
+
.then(receiver, function (reason) {
|
|
634
|
+
err("failed to asynchronously prepare wasm: " + reason);
|
|
635
|
+
abort(reason);
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
function instantiateAsync() {
|
|
639
|
+
if (
|
|
640
|
+
!wasmBinary &&
|
|
641
|
+
typeof WebAssembly.instantiateStreaming === "function" &&
|
|
642
|
+
!isDataURI(wasmBinaryFile) &&
|
|
643
|
+
!isFileURI(wasmBinaryFile) &&
|
|
644
|
+
typeof fetch === "function"
|
|
645
|
+
) {
|
|
646
|
+
return fetch(wasmBinaryFile, { credentials: "same-origin" }).then(
|
|
647
|
+
function (response) {
|
|
648
|
+
var result = WebAssembly.instantiateStreaming(response, info);
|
|
649
|
+
return result.then(receiveInstantiationResult, function (reason) {
|
|
650
|
+
err("wasm streaming compile failed: " + reason);
|
|
651
|
+
err("falling back to ArrayBuffer instantiation");
|
|
652
|
+
return instantiateArrayBuffer(receiveInstantiationResult);
|
|
653
|
+
});
|
|
654
|
+
},
|
|
655
|
+
);
|
|
656
|
+
} else {
|
|
657
|
+
return instantiateArrayBuffer(receiveInstantiationResult);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
if (Module["instantiateWasm"]) {
|
|
661
|
+
try {
|
|
662
|
+
var exports = Module["instantiateWasm"](info, receiveInstance);
|
|
663
|
+
return exports;
|
|
664
|
+
} catch (e) {
|
|
665
|
+
err("Module.instantiateWasm callback failed with error: " + e);
|
|
666
|
+
return false;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
instantiateAsync();
|
|
670
|
+
return {};
|
|
671
|
+
}
|
|
672
|
+
function callRuntimeCallbacks(callbacks) {
|
|
673
|
+
while (callbacks.length > 0) {
|
|
674
|
+
var callback = callbacks.shift();
|
|
675
|
+
if (typeof callback == "function") {
|
|
676
|
+
callback(Module);
|
|
677
|
+
continue;
|
|
678
|
+
}
|
|
679
|
+
var func = callback.func;
|
|
680
|
+
if (typeof func === "number") {
|
|
681
|
+
if (callback.arg === undefined) {
|
|
682
|
+
wasmTable.get(func)();
|
|
683
|
+
} else {
|
|
684
|
+
wasmTable.get(func)(callback.arg);
|
|
685
|
+
}
|
|
686
|
+
} else {
|
|
687
|
+
func(callback.arg === undefined ? null : callback.arg);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
function _abort() {
|
|
692
|
+
abort("");
|
|
693
|
+
}
|
|
694
|
+
function _emscripten_memcpy_big(dest, src, num) {
|
|
695
|
+
HEAPU8.copyWithin(dest, src, src + num);
|
|
696
|
+
}
|
|
697
|
+
function abortOnCannotGrowMemory(requestedSize) {
|
|
698
|
+
abort("OOM");
|
|
699
|
+
}
|
|
700
|
+
function _emscripten_resize_heap(requestedSize) {
|
|
701
|
+
var oldSize = HEAPU8.length;
|
|
702
|
+
requestedSize = requestedSize >>> 0;
|
|
703
|
+
abortOnCannotGrowMemory(requestedSize);
|
|
704
|
+
}
|
|
705
|
+
var SYSCALLS = {
|
|
706
|
+
mappings: {},
|
|
707
|
+
buffers: [null, [], []],
|
|
708
|
+
printChar: function (stream, curr) {
|
|
709
|
+
var buffer = SYSCALLS.buffers[stream];
|
|
710
|
+
if (curr === 0 || curr === 10) {
|
|
711
|
+
(stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));
|
|
712
|
+
buffer.length = 0;
|
|
713
|
+
} else {
|
|
714
|
+
buffer.push(curr);
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
varargs: undefined,
|
|
718
|
+
get: function () {
|
|
719
|
+
SYSCALLS.varargs += 4;
|
|
720
|
+
var ret = HEAP32[(SYSCALLS.varargs - 4) >> 2];
|
|
721
|
+
return ret;
|
|
722
|
+
},
|
|
723
|
+
getStr: function (ptr) {
|
|
724
|
+
var ret = UTF8ToString(ptr);
|
|
725
|
+
return ret;
|
|
726
|
+
},
|
|
727
|
+
get64: function (low, high) {
|
|
728
|
+
return low;
|
|
729
|
+
},
|
|
730
|
+
};
|
|
731
|
+
function _fd_close(fd) {
|
|
732
|
+
return 0;
|
|
733
|
+
}
|
|
734
|
+
function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {}
|
|
735
|
+
function _fd_write(fd, iov, iovcnt, pnum) {
|
|
736
|
+
var num = 0;
|
|
737
|
+
for (var i = 0; i < iovcnt; i++) {
|
|
738
|
+
var ptr = HEAP32[(iov + i * 8) >> 2];
|
|
739
|
+
var len = HEAP32[(iov + (i * 8 + 4)) >> 2];
|
|
740
|
+
for (var j = 0; j < len; j++) {
|
|
741
|
+
SYSCALLS.printChar(fd, HEAPU8[ptr + j]);
|
|
742
|
+
}
|
|
743
|
+
num += len;
|
|
744
|
+
}
|
|
745
|
+
HEAP32[pnum >> 2] = num;
|
|
746
|
+
return 0;
|
|
747
|
+
}
|
|
748
|
+
var asmLibraryArg = {
|
|
749
|
+
c: _abort,
|
|
750
|
+
e: _emscripten_memcpy_big,
|
|
751
|
+
f: _emscripten_resize_heap,
|
|
752
|
+
d: _fd_close,
|
|
753
|
+
b: _fd_seek,
|
|
754
|
+
a: _fd_write,
|
|
755
|
+
};
|
|
756
|
+
var asm = createWasm();
|
|
757
|
+
var ___wasm_call_ctors = (Module["___wasm_call_ctors"] = function () {
|
|
758
|
+
return (___wasm_call_ctors = Module["___wasm_call_ctors"] =
|
|
759
|
+
Module["asm"]["h"]).apply(null, arguments);
|
|
760
|
+
});
|
|
761
|
+
var _opus_decoder_create = (Module["_opus_decoder_create"] = function () {
|
|
762
|
+
return (_opus_decoder_create = Module["_opus_decoder_create"] =
|
|
763
|
+
Module["asm"]["i"]).apply(null, arguments);
|
|
764
|
+
});
|
|
765
|
+
var _opus_decode_float = (Module["_opus_decode_float"] = function () {
|
|
766
|
+
return (_opus_decode_float = Module["_opus_decode_float"] =
|
|
767
|
+
Module["asm"]["j"]).apply(null, arguments);
|
|
768
|
+
});
|
|
769
|
+
var _opus_decoder_destroy = (Module["_opus_decoder_destroy"] = function () {
|
|
770
|
+
return (_opus_decoder_destroy = Module["_opus_decoder_destroy"] =
|
|
771
|
+
Module["asm"]["k"]).apply(null, arguments);
|
|
772
|
+
});
|
|
773
|
+
var _speex_resampler_init = (Module["_speex_resampler_init"] = function () {
|
|
774
|
+
return (_speex_resampler_init = Module["_speex_resampler_init"] =
|
|
775
|
+
Module["asm"]["l"]).apply(null, arguments);
|
|
776
|
+
});
|
|
777
|
+
var _speex_resampler_destroy = (Module["_speex_resampler_destroy"] =
|
|
778
|
+
function () {
|
|
779
|
+
return (_speex_resampler_destroy = Module["_speex_resampler_destroy"] =
|
|
780
|
+
Module["asm"]["m"]).apply(null, arguments);
|
|
781
|
+
});
|
|
782
|
+
var _speex_resampler_process_interleaved_float = (Module[
|
|
783
|
+
"_speex_resampler_process_interleaved_float"
|
|
784
|
+
] = function () {
|
|
785
|
+
return (_speex_resampler_process_interleaved_float = Module[
|
|
786
|
+
"_speex_resampler_process_interleaved_float"
|
|
787
|
+
] =
|
|
788
|
+
Module["asm"]["n"]).apply(null, arguments);
|
|
789
|
+
});
|
|
790
|
+
var _malloc = (Module["_malloc"] = function () {
|
|
791
|
+
return (_malloc = Module["_malloc"] = Module["asm"]["o"]).apply(
|
|
792
|
+
null,
|
|
793
|
+
arguments,
|
|
794
|
+
);
|
|
795
|
+
});
|
|
796
|
+
var _free = (Module["_free"] = function () {
|
|
797
|
+
return (_free = Module["_free"] = Module["asm"]["p"]).apply(null, arguments);
|
|
798
|
+
});
|
|
799
|
+
var calledRun;
|
|
800
|
+
function ExitStatus(status) {
|
|
801
|
+
this.name = "ExitStatus";
|
|
802
|
+
this.message = "Program terminated with exit(" + status + ")";
|
|
803
|
+
this.status = status;
|
|
804
|
+
}
|
|
805
|
+
dependenciesFulfilled = function runCaller() {
|
|
806
|
+
if (!calledRun) run();
|
|
807
|
+
if (!calledRun) dependenciesFulfilled = runCaller;
|
|
808
|
+
};
|
|
809
|
+
function run(args) {
|
|
810
|
+
args = args || arguments_;
|
|
811
|
+
if (runDependencies > 0) {
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
814
|
+
preRun();
|
|
815
|
+
if (runDependencies > 0) {
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
function doRun() {
|
|
819
|
+
if (calledRun) return;
|
|
820
|
+
calledRun = true;
|
|
821
|
+
Module["calledRun"] = true;
|
|
822
|
+
if (ABORT) return;
|
|
823
|
+
initRuntime();
|
|
824
|
+
if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
|
|
825
|
+
postRun();
|
|
826
|
+
}
|
|
827
|
+
if (Module["setStatus"]) {
|
|
828
|
+
Module["setStatus"]("Running...");
|
|
829
|
+
setTimeout(function () {
|
|
830
|
+
setTimeout(function () {
|
|
831
|
+
Module["setStatus"]("");
|
|
832
|
+
}, 1);
|
|
833
|
+
doRun();
|
|
834
|
+
}, 1);
|
|
835
|
+
} else {
|
|
836
|
+
doRun();
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
Module["run"] = run;
|
|
840
|
+
if (Module["preInit"]) {
|
|
841
|
+
if (typeof Module["preInit"] == "function")
|
|
842
|
+
Module["preInit"] = [Module["preInit"]];
|
|
843
|
+
while (Module["preInit"].length > 0) {
|
|
844
|
+
Module["preInit"].pop()();
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
run();
|