/* Auto-generated Euv Zero-DOM WASM Host Glue (MiniApp / QuickApp / Wearable) */
(function () {
var g = typeof globalThis !== 'undefined' ? globalThis : (typeof self !== 'undefined' ? self : this);
if (!g) return;
if (typeof g.TextDecoder === 'undefined') {
g.TextDecoder = function EuvTextDecoder() {};
g.TextDecoder.prototype.decode = function (bytes) {
if (!bytes) return '';
var arr = bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes.buffer || bytes, bytes.byteOffset || 0, bytes.byteLength || bytes.length || 0);
var out = '';
var i = 0;
while (i < arr.length) {
var c = arr[i++];
if (c < 0x80) {
out += String.fromCharCode(c);
} else if ((c & 0xE0) === 0xC0 && i < arr.length) {
out += String.fromCharCode(((c & 0x1F) << 6) | (arr[i++] & 0x3F));
} else if ((c & 0xF0) === 0xE0 && i + 1 < arr.length) {
out += String.fromCharCode(((c & 0x0F) << 12) | ((arr[i++] & 0x3F) << 6) | (arr[i++] & 0x3F));
} else if ((c & 0xF8) === 0xF0 && i + 2 < arr.length) {
var cp = ((c & 0x07) << 18) | ((arr[i++] & 0x3F) << 12) | ((arr[i++] & 0x3F) << 6) | (arr[i++] & 0x3F);
cp -= 0x10000;
out += String.fromCharCode(0xD800 + (cp >> 10), 0xDC00 + (cp & 0x3FF));
}
}
return out;
};
}
if (typeof g.TextEncoder === 'undefined') {
g.TextEncoder = function EuvTextEncoder() {};
g.TextEncoder.prototype.encode = function (str) {
var s = String(str || '');
var bytes = [];
for (var i = 0; i < s.length; i += 1) {
var cp = s.charCodeAt(i);
if (cp >= 0xD800 && cp <= 0xDBFF && i + 1 < s.length) {
var lo = s.charCodeAt(i + 1);
if (lo >= 0xDC00 && lo <= 0xDFFF) {
cp = 0x10000 + ((cp - 0xD800) << 10) + (lo - 0xDC00);
i += 1;
}
}
if (cp < 0x80) {
bytes.push(cp);
} else if (cp < 0x800) {
bytes.push(0xC0 | (cp >> 6), 0x80 | (cp & 0x3F));
} else if (cp < 0x10000) {
bytes.push(0xE0 | (cp >> 12), 0x80 | ((cp >> 6) & 0x3F), 0x80 | (cp & 0x3F));
} else {
bytes.push(0xF0 | (cp >> 18), 0x80 | ((cp >> 12) & 0x3F), 0x80 | ((cp >> 6) & 0x3F), 0x80 | (cp & 0x3F));
}
}
return new Uint8Array(bytes);
};
g.TextEncoder.prototype.encodeInto = function (str, dst) {
var encoded = this.encode(str);
var n = Math.min(encoded.length, dst.length);
dst.set(encoded.subarray(0, n));
return { read: str.length, written: n };
};
}
})();
function __euvResolveVendorWasm() {
var g = typeof globalThis !== 'undefined' ? globalThis : (typeof self !== 'undefined' ? self : {});
if (typeof WXWebAssembly !== 'undefined' && WXWebAssembly && typeof WXWebAssembly.instantiate === 'function') return WXWebAssembly;
if (typeof MYWebAssembly !== 'undefined' && MYWebAssembly && typeof MYWebAssembly.instantiate === 'function') return MYWebAssembly;
if (typeof TTWebAssembly !== 'undefined' && TTWebAssembly && typeof TTWebAssembly.instantiate === 'function') return TTWebAssembly;
if (typeof QQWebAssembly !== 'undefined' && QQWebAssembly && typeof QQWebAssembly.instantiate === 'function') return QQWebAssembly;
if (g.WXWebAssembly && typeof g.WXWebAssembly.instantiate === 'function') return g.WXWebAssembly;
if (g.MYWebAssembly && typeof g.MYWebAssembly.instantiate === 'function') return g.MYWebAssembly;
if (g.TTWebAssembly && typeof g.TTWebAssembly.instantiate === 'function') return g.TTWebAssembly;
if (g.QQWebAssembly && typeof g.QQWebAssembly.instantiate === 'function') return g.QQWebAssembly;
return typeof WebAssembly !== 'undefined' ? WebAssembly : null;
}