edge-core-js 2.44.0 → 2.46.0
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/CHANGELOG.md +12 -1
- package/README.md +4 -4
- package/android/src/main/assets/edge-core-js/edge-core.js +1 -1
- package/android/src/main/assets/edge-core-js/fbcba1e9b05cb4dd9870.js +2 -0
- package/android/src/main/assets/edge-core-js/web-worker-0.js +1 -1
- package/lib/core/account/account-api.js +35 -1
- package/lib/core/account/memory-wallet.js +2 -1
- package/lib/core/actions.js +15 -0
- package/lib/core/currency/wallet/currency-wallet-api.js +16 -0
- package/lib/core/currency/wallet/currency-wallet-cleaners.js +4 -0
- package/lib/core/currency/wallet/currency-wallet-files.js +57 -3
- package/lib/core/currency/wallet/currency-wallet-pixie.js +36 -6
- package/lib/core/currency/wallet/currency-wallet-reducer.js +14 -0
- package/lib/core/login/splitting.js +5 -9
- package/lib/node/index.js +3934 -3805
- package/lib/types/types.js +9 -0
- package/package.json +6 -11
- package/src/types/types.ts +9 -0
- package/types.js +90 -90
- package/android/src/main/assets/edge-core-js/27cab3e7ba7549594ad5.js +0 -2
- package/lib/flow/error.js +0 -448
- package/lib/flow/exports.js +0 -140
- package/lib/flow/fake-types.js +0 -187
- package/lib/flow/server-cleaners.js +0 -444
- package/lib/flow/server-types.js +0 -342
- package/lib/flow/type-helpers.js +0 -60
- package/lib/flow/types.js +0 -2250
- package/lib/node/index.js.flow +0 -4
- package/types.js.flow +0 -4
- /package/android/src/main/assets/edge-core-js/{27cab3e7ba7549594ad5.js.LICENSE.txt → fbcba1e9b05cb4dd9870.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see fbcba1e9b05cb4dd9870.js.LICENSE.txt */
|
|
2
|
+
!function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;function n(e,n,t,r){return new(t||(t=Promise))(function(i,o){function _(e){try{c(r.next(e))}catch(n){o(n)}}function s(e){try{c(r.throw(e))}catch(n){o(n)}}function c(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(_,s)}c((r=r.apply(e,n||[])).next())})}function t(e,n,t,r){function i(e,n,t){var r=t?WebAssembly.instantiateStreaming:WebAssembly.instantiate,i=t?WebAssembly.compileStreaming:WebAssembly.compile;return n?r(e,n):i(e)}var o=null;if(n)return i(fetch(n),r,!0);var _=globalThis.atob(t),s=_.length;o=new Uint8Array(new ArrayBuffer(s));for(var c=0;c<s;c++)o[c]=_.charCodeAt(c);if(e){var a=new WebAssembly.Module(o);return r?new WebAssembly.Instance(a,r):a}return i(o,r,!1)}let r;"function"==typeof SuppressedError&&SuppressedError;let i=0,o=null;function _(){return null!==o&&0!==o.byteLength||(o=new Uint8Array(r.memory.buffer)),o}const s="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},c="function"==typeof s.encodeInto?function(e,n){return s.encodeInto(e,n)}:function(e,n){const t=s.encode(e);return n.set(t),{read:e.length,written:t.length}};function a(e,n,t){if(void 0===t){const t=s.encode(e),r=n(t.length,1)>>>0;return _().subarray(r,r+t.length).set(t),i=t.length,r}let r=e.length,o=n(r,1)>>>0;const a=_();let u=0;for(;u<r;u++){const n=e.charCodeAt(u);if(n>127)break;a[o+u]=n}if(u!==r){0!==u&&(e=e.slice(u)),o=t(o,r,r=u+3*e.length,1)>>>0;const n=_().subarray(o+u,o+r);u+=c(e,n).written,o=t(o,r,u,1)>>>0}return i=u,o}let u=null;function f(){return(null===u||!0===u.buffer.detached||void 0===u.buffer.detached&&u.buffer!==r.memory.buffer)&&(u=new DataView(r.memory.buffer)),u}function b(e){const n=r.__externref_table_alloc();return r.__wbindgen_export_4.set(n,e),n}function g(e,n){try{return e.apply(this,n)}catch(t){const e=b(t);r.__wbindgen_exn_store(e)}}const l="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};function w(e,n){return e>>>=0,l.decode(_().subarray(e,e+n))}function d(e){return null==e}function m(e,n){return e>>>=0,_().subarray(e/1,e/1+n)}"undefined"!=typeof TextDecoder&&l.decode();const h="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>{r.__wbindgen_export_6.get(e.dtor)(e.a,e.b)});function p(e,n,t,i){const o={a:e,b:n,cnt:1,dtor:t},_=(...e)=>{o.cnt++;const n=o.a;o.a=0;try{return i(n,o.b,...e)}finally{0===--o.cnt?(r.__wbindgen_export_6.get(o.dtor)(n,o.b),h.unregister(o)):o.a=n}};return _.original=o,h.register(_,o,o),_}function y(e){const n=typeof e;if("number"==n||"boolean"==n||null==e)return`${e}`;if("string"==n)return`"${e}"`;if("symbol"==n){const n=e.description;return null==n?"Symbol":`Symbol(${n})`}if("function"==n){const n=e.name;return"string"==typeof n&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(e)){const n=e.length;let t="[";n>0&&(t+=y(e[0]));for(let r=1;r<n;r++)t+=", "+y(e[r]);return t+="]",t}const t=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(!(t&&t.length>1))return toString.call(e);if(r=t[1],"Object"==r)try{return"Object("+JSON.stringify(e)+")"}catch(i){return"Object"}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:r}function v(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i,s=function(e,n){const t=n(1*e.length,1)>>>0;return _().set(e,t/1),i=e.length,t}(n,r.__wbindgen_malloc),c=i;return r.send_client_data(t,o,s,c)}function x(e){const n=r.__wbindgen_export_4.get(e);return r.__externref_table_dealloc(e),n}function R(){const e=r.mix_fetch_initialised();if(e[2])throw x(e[1]);return 0!==e[0]}function E(e){const n=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),t=i;return r.start_new_mixnet_connection(n,t)}function T(e){const n=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),t=i;return r.finish_mixnet_connection(n,t)}function S(e,n,t){const i=r.closure743_externref_shim_multivalue_shim(e,n,t);if(i[1])throw x(i[0])}function j(e,n,t){r.closure830_externref_shim(e,n,t)}function I(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h061f9c2866052d32(e,n)}function F(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h67f1322bcb5f40b5(e,n)}function A(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb7fef82722851829(e,n)}function k(e,n,t){r.closure2203_externref_shim(e,n,t)}function O(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ea245616776fb08(e,n)}function U(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h75596235482477c3(e,n)}function W(e,n,t){r.closure2326_externref_shim(e,n,t)}const C=["blob","arraybuffer"],D=["pending","done"],z=["readonly","readwrite","versionchange","readwriteflush","cleanup"],M=["default","no-store","reload","no-cache","force-cache","only-if-cached"],L=["omit","same-origin","include"],B=["same-origin","no-cors","cors","navigate"];"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_acknowledgementswasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_anonymoussendertag_free(e>>>0,1));const P="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>r.__wbg_clientstorage_free(e>>>0,1));class N{static __wrap(e){e>>>=0;const n=Object.create(N.prototype);return n.__wbg_ptr=e,P.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_clientstorage_free(e,0)}static new_unencrypted(e){const n=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),t=i;return r.clientstorage_new_unencrypted(n,t)}constructor(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i,_=a(n,r.__wbindgen_malloc,r.__wbindgen_realloc),s=i;return r.clientstorage_new(t,o,_,s)}static new_async(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;var _=d(n)?0:a(n,r.__wbindgen_malloc,r.__wbindgen_realloc),s=i;return r.clientstorage_new_async(t,o,_,s)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_covertrafficwasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_debugwasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_forgetmewasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_gatewayconnectionwasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_mixfetch_free(e>>>0,1));const q="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>r.__wbg_mixfetchclient_free(e>>>0,1));class G{static __wrap(e){e>>>=0;const n=Object.create(G.prototype);return n.__wbg_ptr=e,q.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,q.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_mixfetchclient_free(e,0)}disconnect(){return r.mixfetchclient_disconnect(this.__wbg_ptr)}self_address(){let e,n;try{const t=r.mixfetchclient_self_address(this.__wbg_ptr);return e=t[0],n=t[1],w(t[0],t[1])}finally{r.__wbindgen_free(e,n,1)}}constructor(e,n,t,o){!function(e,n){if(!(e instanceof n))throw new Error(`expected instance of ${n.name}`)}(e,$);var _=e.__destroy_into_raw(),s=d(t)?0:a(t,r.__wbindgen_malloc,r.__wbindgen_realloc),c=i,u=d(o)?0:a(o,r.__wbindgen_malloc,r.__wbindgen_realloc),f=i;return r.mixfetchclient_new(_,n,s,c,u,f)}active(){return 0!==r.mixfetchclient_active(this.__wbg_ptr)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_mixfetchclientbuilder_free(e>>>0,1));const V="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>r.__wbg_mixfetchconfig_free(e>>>0,1));class ${static __wrap(e){e>>>=0;const n=Object.create($.prototype);return n.__wbg_ptr=e,V.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_mixfetchconfig_free(e,0)}with_mix_fetch_timeout(e){const n=this.__destroy_into_raw(),t=r.mixfetchconfig_with_mix_fetch_timeout(n,e);return $.__wrap(t)}constructor(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i,_=r.mixfetchconfig_new(t,o,d(n)?0:b(n));if(_[2])throw x(_[1]);return this.__wbg_ptr=_[0]>>>0,V.register(this,this.__wbg_ptr,this),this}}function H(){const e={wbg:{}};return e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,n){const t=a(String(n),r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_String_eecc4a11987127d6=function(e,n){const t=a(String(n),r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_Window_41559019033ede94=function(e){return e.Window},e.wbg.__wbg_WorkerGlobalScope_d324bffbeaef9f3a=function(e){return e.WorkerGlobalScope},e.wbg.__wbg_abort_410ec47a64ac6117=function(e,n){e.abort(n)},e.wbg.__wbg_abort_775ef1d17fc65868=function(e){e.abort()},e.wbg.__wbg_abort_99fc644e2c79c9fb=function(){return g(function(e){e.abort()},arguments)},e.wbg.__wbg_addEventListener_84ae3eac6e15480a=function(){return g(function(e,n,t,r,i){e.addEventListener(w(n,t),r,i)},arguments)},e.wbg.__wbg_addEventListener_90e553fdce254421=function(){return g(function(e,n,t,r){e.addEventListener(w(n,t),r)},arguments)},e.wbg.__wbg_append_8c7dd8d641a5f01b=function(){return g(function(e,n,t,r,i){e.append(w(n,t),w(r,i))},arguments)},e.wbg.__wbg_arrayBuffer_d1b44c4390db422f=function(){return g(function(e){return e.arrayBuffer()},arguments)},e.wbg.__wbg_bound_f2afc3766d4545cf=function(){return g(function(e,n,t,r){return IDBKeyRange.bound(e,n,0!==t,0!==r)},arguments)},e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},e.wbg.__wbg_call_672a4d21634d4a24=function(){return g(function(e,n){return e.call(n)},arguments)},e.wbg.__wbg_call_7cccdd69e0791ae2=function(){return g(function(e,n,t){return e.call(n,t)},arguments)},e.wbg.__wbg_clearInterval_dd1e598f425db353=function(e){return clearInterval(e)},e.wbg.__wbg_clearTimeout_3b5c565a5ec539dd=function(e){return clearTimeout(e)},e.wbg.__wbg_clientstorage_new=function(e){return N.__wrap(e)},e.wbg.__wbg_close_2893b7d056a0627d=function(){return g(function(e){e.close()},arguments)},e.wbg.__wbg_code_f4ec1e6e2e1b0417=function(e){return e.code},e.wbg.__wbg_commit_a54edce65f3858f2=function(){return g(function(e){e.commit()},arguments)},e.wbg.__wbg_count_9dbedee4d2474ff8=function(){return g(function(e,n){return e.count(n)},arguments)},e.wbg.__wbg_createObjectStore_e566459f7161f82f=function(){return g(function(e,n,t){return e.createObjectStore(w(n,t))},arguments)},e.wbg.__wbg_crypto_574e78ad8b13b65f=function(e){return e.crypto},e.wbg.__wbg_data_432d9c3df2630942=function(e){return e.data},e.wbg.__wbg_dispatchEvent_9e259d7c1d603dfb=function(){return g(function(e,n){return e.dispatchEvent(n)},arguments)},e.wbg.__wbg_done_769e5ede4b31c67b=function(e){return e.done},e.wbg.__wbg_entries_2a52db465d0421fb=function(e){return e.entries()},e.wbg.__wbg_entries_3265d4158b33e5dc=function(e){return Object.entries(e)},e.wbg.__wbg_error_3cfd4be637595be7=function(e,n){console.error(w(e,n))},e.wbg.__wbg_error_e98c298703cffa97=function(e,n){console.error(w(e,n))},e.wbg.__wbg_error_ff4ddaabdfc5dbb3=function(){return g(function(e){const n=e.error;return d(n)?0:b(n)},arguments)},e.wbg.__wbg_fetch_16dcf1cfbbc66b3c=function(e){return fetch(e)},e.wbg.__wbg_fetch_509096533071c657=function(e,n){return e.fetch(n)},e.wbg.__wbg_from_2a5d3e218e67aa85=function(e){return Array.from(e)},e.wbg.__wbg_getAllKeys_b11d8835dc4be0e8=function(){return g(function(e){return e.getAllKeys()},arguments)},e.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return g(function(e,n){e.getRandomValues(n)},arguments)},e.wbg.__wbg_getTime_46267b1c24877e30=function(e){return e.getTime()},e.wbg.__wbg_get_67b2ba62fc30de12=function(){return g(function(e,n){return Reflect.get(e,n)},arguments)},e.wbg.__wbg_get_8da03f81f6a1111e=function(){return g(function(e,n){return e.get(n)},arguments)},e.wbg.__wbg_get_b9b93047fe3cf45b=function(e,n){return e[n>>>0]},e.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(e,n){return e[n]},e.wbg.__wbg_getwithrefkey_6550b2c093d2eb18=function(e,n){return e[n]},e.wbg.__wbg_global_f5c2926e57ba457f=function(e){return e.global},e.wbg.__wbg_goWasmCloseRemoteSocket_992b677524fcede8=function(e,n){let t,i;try{t=e,i=n,__go_rs_bridge__.goWasmCloseRemoteSocket(w(e,n))}finally{r.__wbindgen_free(t,i,1)}},e.wbg.__wbg_goWasmInjectConnError_b927894206725a9c=function(e,n,t,i){let o,_,s,c;try{o=e,_=n,s=t,c=i,__go_rs_bridge__.goWasmInjectConnError(w(e,n),w(t,i))}finally{r.__wbindgen_free(o,_,1),r.__wbindgen_free(s,c,1)}},e.wbg.__wbg_goWasmInjectServerData_40f1c53f7ca870d5=function(e,n,t,i){let o,_;try{o=e,_=n;var s=m(t,i).slice();r.__wbindgen_free(t,1*i,1),__go_rs_bridge__.goWasmInjectServerData(w(e,n),s)}finally{r.__wbindgen_free(o,_,1)}},e.wbg.__wbg_goWasmSetMixFetchRequestTimeout_74f591ac382a0775=function(e){__go_rs_bridge__.goWasmSetMixFetchRequestTimeout(e>>>0)},e.wbg.__wbg_has_a5ea9117f258a0ec=function(){return g(function(e,n){return Reflect.has(e,n)},arguments)},e.wbg.__wbg_headers_9cb51cfd2ac780a4=function(e){return e.headers},e.wbg.__wbg_indexedDB_54f01430b1e194e8=function(){return g(function(e){const n=e.indexedDB;return d(n)?0:b(n)},arguments)},e.wbg.__wbg_indexedDB_b1f49280282046f8=function(){return g(function(e){const n=e.indexedDB;return d(n)?0:b(n)},arguments)},e.wbg.__wbg_indexedDB_f6b47b0dc333fd2f=function(){return g(function(e){const n=e.indexedDB;return d(n)?0:b(n)},arguments)},e.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(e){let n;try{n=e instanceof ArrayBuffer}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_DomException_ed1ccb7aaf39034c=function(e){let n;try{n=e instanceof DOMException}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_Error_4d54113b22d20306=function(e){let n;try{n=e instanceof Error}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_IdbDatabase_a3ef009ca00059f9=function(e){let n;try{n=e instanceof IDBDatabase}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_IdbRequest_4813c3f207666aa4=function(e){let n;try{n=e instanceof IDBRequest}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_Response_f2cc20d9f7dfd644=function(e){let n;try{n=e instanceof Response}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(e){let n;try{n=e instanceof Uint8Array}catch(t){n=!1}return n},e.wbg.__wbg_isArray_a1eab7e0d067391b=function(e){return Array.isArray(e)},e.wbg.__wbg_isSafeInteger_343e2beeeece1bb0=function(e){return Number.isSafeInteger(e)},e.wbg.__wbg_iterator_9a24c88df860dc65=function(){return Symbol.iterator},e.wbg.__wbg_length_a446193dc22c12f8=function(e){return e.length},e.wbg.__wbg_length_e2d2a49132c1b256=function(e){return e.length},e.wbg.__wbg_log_72cb694afa6a0fe7=function(e,n){console.log(w(e,n))},e.wbg.__wbg_lowerBound_1872d19f5bcf83c6=function(){return g(function(e,n){return IDBKeyRange.lowerBound(e,0!==n)},arguments)},e.wbg.__wbg_message_5c5d919204d42400=function(e,n){const t=a(n.message,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_message_97a2af9b89d693a3=function(e){return e.message},e.wbg.__wbg_mixfetchclient_new=function(e){return G.__wrap(e)},e.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(e){return e.msCrypto},e.wbg.__wbg_name_0b327d569f00ebee=function(e){return e.name},e.wbg.__wbg_name_f2d27098bfd843e7=function(e,n){const t=a(n.name,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_new0_f788a2397c7ca929=function(){return new Date},e.wbg.__wbg_new_018dcc2d6c8c2f6a=function(){return g(function(){return new Headers},arguments)},e.wbg.__wbg_new_23a2665fac83c611=function(e,n){try{var t={a:e,b:n};const i=new Promise((e,n)=>{const i=t.a;t.a=0;try{return function(e,n,t,i){r.closure2942_externref_shim(e,n,t,i)}(i,t.b,e,n)}finally{t.a=i}});return i}finally{t.a=t.b=0}},e.wbg.__wbg_new_405e22f390576ce2=function(){return new Object},e.wbg.__wbg_new_5e0be73521bc8c17=function(){return new Map},e.wbg.__wbg_new_78feb108b6472713=function(){return new Array},e.wbg.__wbg_new_92c54fc74574ef55=function(){return g(function(e,n){return new WebSocket(w(e,n))},arguments)},e.wbg.__wbg_new_a12002a7f91c75be=function(e){return new Uint8Array(e)},e.wbg.__wbg_new_c68d7209be747379=function(e,n){return new Error(w(e,n))},e.wbg.__wbg_new_e25e5aab09ff45db=function(){return g(function(){return new AbortController},arguments)},e.wbg.__wbg_newnoargs_105ed471475aaf50=function(e,n){return new Function(w(e,n))},e.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(e,n,t){return new Uint8Array(e,n>>>0,t>>>0)},e.wbg.__wbg_newwitheventinitdict_502dbfa1b3d2fcbc=function(){return g(function(e,n,t){return new CloseEvent(w(e,n),t)},arguments)},e.wbg.__wbg_newwithlength_a381634e90c276d4=function(e){return new Uint8Array(e>>>0)},e.wbg.__wbg_newwithstrandinit_06c535e0a867c635=function(){return g(function(e,n,t){return new Request(w(e,n),t)},arguments)},e.wbg.__wbg_next_25feadfc0913fea9=function(e){return e.next},e.wbg.__wbg_next_6574e1a8a62d1055=function(){return g(function(e){return e.next()},arguments)},e.wbg.__wbg_node_905d3e251edff8a2=function(e){return e.node},e.wbg.__wbg_now_e1163c67115ff874=function(e){return e.now()},e.wbg.__wbg_objectStore_21878d46d25b64b6=function(){return g(function(e,n,t){return e.objectStore(w(n,t))},arguments)},e.wbg.__wbg_oldVersion_e8337811e52861c6=function(e){return e.oldVersion},e.wbg.__wbg_open_e0c0b2993eb596e1=function(){return g(function(e,n,t,r){return e.open(w(n,t),r>>>0)},arguments)},e.wbg.__wbg_performance_7fe0928f3ab059e5=function(e){return e.performance},e.wbg.__wbg_postMessage_83a8d58d3fcb6c13=function(){return g(function(e,n){e.postMessage(n)},arguments)},e.wbg.__wbg_process_dc0fbacc7c1c06f7=function(e){return e.process},e.wbg.__wbg_put_066faa31a6a88f5b=function(){return g(function(e,n,t){return e.put(n,t)},arguments)},e.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5=function(e){queueMicrotask(e)},e.wbg.__wbg_queueMicrotask_d3219def82552485=function(e){return e.queueMicrotask},e.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return g(function(e,n){e.randomFillSync(n)},arguments)},e.wbg.__wbg_readyState_4013cfdf4f22afb0=function(e){const n=e.readyState;return(D.indexOf(n)+1||3)-1},e.wbg.__wbg_readyState_7ef6e63c349899ed=function(e){return e.readyState},e.wbg.__wbg_reason_49f1cede8bcf23dd=function(e,n){const t=a(n.reason,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_reject_b3fcf99063186ff7=function(e){return Promise.reject(e)},e.wbg.__wbg_removeEventListener_056dfe8c3d6c58f9=function(){return g(function(e,n,t,r){e.removeEventListener(w(n,t),r)},arguments)},e.wbg.__wbg_require_60cc747a6bc5215a=function(){return g(function(){return module.require},arguments)},e.wbg.__wbg_resolve_4851785c9c5f573d=function(e){return Promise.resolve(e)},e.wbg.__wbg_result_f29afabdf2c05826=function(){return g(function(e){return e.result},arguments)},e.wbg.__wbg_send_0293179ba074ffb4=function(){return g(function(e,n,t){e.send(w(n,t))},arguments)},e.wbg.__wbg_send_fc0c204e8a1757f4=function(){return g(function(e,n,t){e.send(m(n,t))},arguments)},e.wbg.__wbg_setInterval_ed3b5e3c3ebb8a6d=function(){return g(function(e,n){return setInterval(e,n)},arguments)},e.wbg.__wbg_setTimeout_42370cb3051b8c2c=function(){return g(function(e,n,t){return e.setTimeout(n,t)},arguments)},e.wbg.__wbg_setTimeout_8f06012fba12034e=function(e,n){globalThis.setTimeout(e,n)},e.wbg.__wbg_setTimeout_cb2a856ba8315e7a=function(e,n){return setTimeout(e,n)},e.wbg.__wbg_set_37837023f3d740e8=function(e,n,t){e[n>>>0]=t},e.wbg.__wbg_set_3f1d0b984ed272ed=function(e,n,t){e[n]=t},e.wbg.__wbg_set_65595bdd868b3009=function(e,n,t){e.set(n,t>>>0)},e.wbg.__wbg_set_8fc6bf8a5b1071d1=function(e,n,t){return e.set(n,t)},e.wbg.__wbg_setbinaryType_92fa1ffd873b327c=function(e,n){e.binaryType=C[n]},e.wbg.__wbg_setbody_5923b78a95eedf29=function(e,n){e.body=n},e.wbg.__wbg_setcache_12f17c3a980650e4=function(e,n){e.cache=M[n]},e.wbg.__wbg_setcode_156060465a2f8f79=function(e,n){e.code=n},e.wbg.__wbg_setcredentials_c3a22f1cd105a2c6=function(e,n){e.credentials=L[n]},e.wbg.__wbg_setheaders_834c0bdb6a8949ad=function(e,n){e.headers=n},e.wbg.__wbg_setmethod_3c5280fe5d890842=function(e,n,t){e.method=w(n,t)},e.wbg.__wbg_setmode_5dc300b865044b65=function(e,n){e.mode=B[n]},e.wbg.__wbg_setonabort_3bf4db6614fa98e9=function(e,n){e.onabort=n},e.wbg.__wbg_setonce_0cb80aea26303a35=function(e,n){e.once=0!==n},e.wbg.__wbg_setoncomplete_4d19df0dadb7c4d4=function(e,n){e.oncomplete=n},e.wbg.__wbg_setonerror_b0d9d723b8fddbbb=function(e,n){e.onerror=n},e.wbg.__wbg_setonerror_d7e3056cc6e56085=function(e,n){e.onerror=n},e.wbg.__wbg_setonsuccess_afa464ee777a396d=function(e,n){e.onsuccess=n},e.wbg.__wbg_setonupgradeneeded_fcf7ce4f2eb0cb5f=function(e,n){e.onupgradeneeded=n},e.wbg.__wbg_setreason_d29ac0402eeeb81a=function(e,n,t){e.reason=w(n,t)},e.wbg.__wbg_setsignal_75b21ef3a81de905=function(e,n){e.signal=n},e.wbg.__wbg_signal_aaf9ad74119f20a4=function(e){return e.signal},e.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07=function(){const e="undefined"==typeof global?null:global;return d(e)?0:b(e)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0=function(){const e="undefined"==typeof globalThis?null:globalThis;return d(e)?0:b(e)},e.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819=function(){const e="undefined"==typeof self?null:self;return d(e)?0:b(e)},e.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40=function(){const e="undefined"==typeof window?null:window;return d(e)?0:b(e)},e.wbg.__wbg_status_f6360336ca686bf0=function(e){return e.status},e.wbg.__wbg_subarray_aa9065fa9dc5df96=function(e,n,t){return e.subarray(n>>>0,t>>>0)},e.wbg.__wbg_target_0a62d9d79a2a1ede=function(e){const n=e.target;return d(n)?0:b(n)},e.wbg.__wbg_text_7805bea50de2af49=function(){return g(function(e){return e.text()},arguments)},e.wbg.__wbg_then_44b73946d2fb3e7d=function(e,n){return e.then(n)},e.wbg.__wbg_then_48b406749878a531=function(e,n,t){return e.then(n,t)},e.wbg.__wbg_toString_5285597960676b7b=function(e){return e.toString()},e.wbg.__wbg_toString_c813bbd34d063839=function(e){return e.toString()},e.wbg.__wbg_transaction_7d452475ef3c3c33=function(e){return e.transaction},e.wbg.__wbg_transaction_babc423936946a37=function(){return g(function(e,n,t,r){return e.transaction(w(n,t),z[r])},arguments)},e.wbg.__wbg_upperBound_76a00814e81f6891=function(){return g(function(e,n){return IDBKeyRange.upperBound(e,0!==n)},arguments)},e.wbg.__wbg_url_ae10c34ca209681d=function(e,n){const t=a(n.url,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_value_cd1ffa7b1ab794f1=function(e){return e.value},e.wbg.__wbg_versions_c01dfd4722a88165=function(e){return e.versions},e.wbg.__wbg_warn_a2e6ac466681f75e=function(e,n){console.warn(w(e,n))},e.wbg.__wbg_wasClean_605b4fd66d44354a=function(e){return e.wasClean},e.wbg.__wbindgen_as_number=function(e){return+e},e.wbg.__wbindgen_bigint_from_i64=function(e){return e},e.wbg.__wbindgen_bigint_from_u64=function(e){return BigInt.asUintN(64,e)},e.wbg.__wbindgen_bigint_get_as_i64=function(e,n){const t="bigint"==typeof n?n:void 0;f().setBigInt64(e+8,d(t)?BigInt(0):t,!0),f().setInt32(e+0,!d(t),!0)},e.wbg.__wbindgen_boolean_get=function(e){return"boolean"==typeof e?e?1:0:2},e.wbg.__wbindgen_cb_drop=function(e){const n=e.original;if(1==n.cnt--)return n.a=0,!0;return!1},e.wbg.__wbindgen_closure_wrapper3948=function(e,n,t){return p(e,n,744,S)},e.wbg.__wbindgen_closure_wrapper4932=function(e,n,t){return p(e,n,831,j)},e.wbg.__wbindgen_closure_wrapper4933=function(e,n,t){return p(e,n,829,I)},e.wbg.__wbindgen_closure_wrapper5925=function(e,n,t){return p(e,n,1132,F)},e.wbg.__wbindgen_closure_wrapper8465=function(e,n,t){return p(e,n,1996,A)},e.wbg.__wbindgen_closure_wrapper9290=function(e,n,t){return p(e,n,2202,k)},e.wbg.__wbindgen_closure_wrapper9292=function(e,n,t){return p(e,n,2202,O)},e.wbg.__wbindgen_closure_wrapper9294=function(e,n,t){return p(e,n,2202,k)},e.wbg.__wbindgen_closure_wrapper9296=function(e,n,t){return p(e,n,2202,k)},e.wbg.__wbindgen_closure_wrapper9742=function(e,n,t){return p(e,n,2316,U)},e.wbg.__wbindgen_closure_wrapper9780=function(e,n,t){return p(e,n,2327,W)},e.wbg.__wbindgen_debug_string=function(e,n){const t=a(y(n),r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbindgen_error_new=function(e,n){return new Error(w(e,n))},e.wbg.__wbindgen_in=function(e,n){return e in n},e.wbg.__wbindgen_init_externref_table=function(){const e=r.__wbindgen_export_4,n=e.grow(4);e.set(0,void 0),e.set(n+0,void 0),e.set(n+1,null),e.set(n+2,!0),e.set(n+3,!1)},e.wbg.__wbindgen_is_bigint=function(e){return"bigint"==typeof e},e.wbg.__wbindgen_is_function=function(e){return"function"==typeof e},e.wbg.__wbindgen_is_null=function(e){return null===e},e.wbg.__wbindgen_is_object=function(e){return"object"==typeof e&&null!==e},e.wbg.__wbindgen_is_string=function(e){return"string"==typeof e},e.wbg.__wbindgen_is_undefined=function(e){return void 0===e},e.wbg.__wbindgen_jsval_eq=function(e,n){return e===n},e.wbg.__wbindgen_jsval_loose_eq=function(e,n){return e==n},e.wbg.__wbindgen_memory=function(){return r.memory},e.wbg.__wbindgen_number_get=function(e,n){const t="number"==typeof n?n:void 0;f().setFloat64(e+8,d(t)?0:t,!0),f().setInt32(e+0,!d(t),!0)},e.wbg.__wbindgen_number_new=function(e){return e},e.wbg.__wbindgen_string_get=function(e,n){const t="string"==typeof n?n:void 0;var o=d(t)?0:a(t,r.__wbindgen_malloc,r.__wbindgen_realloc),_=i;f().setInt32(e+4,_,!0),f().setInt32(e+0,o,!0)},e.wbg.__wbindgen_string_new=function(e,n){return w(e,n)},e.wbg.__wbindgen_throw=function(e,n){throw new Error(w(e,n))},e}async function K(n){if(void 0!==r)return r;void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("mix_fetch_wasm_bg.wasm",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("worker.js",document.baseURI).href));const t=H();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:i,module:_}=await async function(e,n){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,n)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const r=await e.arrayBuffer();return await WebAssembly.instantiate(r,n)}{const t=await WebAssembly.instantiate(e,n);return t instanceof WebAssembly.Instance?{instance:t,module:e}:t}}(await n,t);return function(e,n){return r=e.exports,K.__wbindgen_wasm_module=n,u=null,o=null,r.__wbindgen_start(),r}(i,_)}function Y(){return n(this,void 0,void 0,function*(){const e=yield t(0,new URL("go_conn.wasm",import.meta.url),null,n);var n;const r=new Go,i=yield WebAssembly.instantiate(e,r.importObject);r.run(i)})}function J(){return n(this,void 0,void 0,function*(){const e=yield t(0,new URL("mix_fetch_wasm_bg.wasm",import.meta.url),null,n);var n;yield K(e),console.log("Loaded RUST WASM"),yield Y(),console.log("Loaded GO WASM"),r.set_panic_hook(),function(){const e={send_client_data:v,start_new_mixnet_connection:E,mix_fetch_initialised:R,finish_mixnet_connection:T};self.__rs_go_bridge__=e}()})}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_mixfetchdebug_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_remembermewasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_replysurbswasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_statsreportingwasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_topologywasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_trafficwasm_free(e>>>0,1)),(()=>{const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!globalThis.fs){let n="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1,O_DIRECTORY:-1},writeSync(e,r){n+=t.decode(r);const i=n.lastIndexOf("\n");return-1!=i&&(console.log(n.substring(0,i)),n=n.substring(i+1)),r.length},write(n,t,r,i,o,_){if(0!==r||i!==t.length||null!==o)return void _(e());_(null,this.writeSync(n,t))},chmod(n,t,r){r(e())},chown(n,t,r,i){i(e())},close(n,t){t(e())},fchmod(n,t,r){r(e())},fchown(n,t,r,i){i(e())},fstat(n,t){t(e())},fsync(e,n){n(null)},ftruncate(n,t,r){r(e())},lchown(n,t,r,i){i(e())},link(n,t,r){r(e())},lstat(n,t){t(e())},mkdir(n,t,r){r(e())},open(n,t,r,i){i(e())},read(n,t,r,i,o,_){_(e())},readdir(n,t){t(e())},readlink(n,t){t(e())},rename(n,t,r){r(e())},rmdir(n,t){t(e())},stat(n,t){t(e())},symlink(n,t,r){r(e())},truncate(n,t,r){r(e())},unlink(n,t){t(e())},utimes(n,t,r,i){i(e())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),globalThis.path||(globalThis.path={resolve(...e){return e.join("/")}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const n=new TextEncoder("utf-8"),t=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,Math.floor(n/4294967296),!0)},r=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),i=e=>{const n=this.mem.getFloat64(e,!0);if(0===n)return;if(!isNaN(n))return n;const t=this.mem.getUint32(e,!0);return this._values[t]},o=(e,n)=>{const t=2146959360;if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,t,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let r=this._ids.get(n);void 0===r&&(r=this._idPool.pop(),void 0===r&&(r=this._values.length),this._values[r]=n,this._goRefCounts[r]=0,this._ids.set(n,r)),this._goRefCounts[r]++;let i=0;switch(typeof n){case"object":null!==n&&(i=1);break;case"string":i=2;break;case"symbol":i=3;break;case"function":i=4}this.mem.setUint32(e+4,t|i,!0),this.mem.setUint32(e,r,!0)},_=e=>{const n=r(e+0),t=r(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,t)},s=e=>{const n=r(e+0),t=r(e+8),o=new Array(t);for(let r=0;r<t;r++)o[r]=i(n+8*r);return o},c=e=>{const n=r(e+0),i=r(e+8);return t.decode(new DataView(this._inst.exports.mem.buffer,n,i))},a=Date.now()-performance.now();this.importObject={_gotest:{add:(e,n)=>e+n,callExport:(e,n)=>(this._inst.exports.testExport0(),this._inst.exports.testExport(e,n))},gojs:{"runtime.wasmExit":e=>{e>>>=0;const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const n=r((e>>>=0)+8),t=r(e+16),i=this.mem.getInt32(e+24,!0);fs.writeSync(n,new Uint8Array(this._inst.exports.mem.buffer,t,i))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e((n>>>=0)+8,1e6*(a+performance.now()))},"runtime.walltime":n=>{n>>>=0;const t=(new Date).getTime();e(n+8,t/1e3),this.mem.setInt32(n+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},r(e+8))),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(_(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o((e>>>=0)+24,c(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const n=Reflect.get(i(e+8),c(e+16));e=this._inst.exports.getsp()>>>0,o(e+32,n)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(i(e+8),c(e+16),i(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(i(e+8),c(e+16))},"syscall/js.valueIndex":e=>{o((e>>>=0)+24,Reflect.get(i(e+8),r(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(i(e+8),r(e+16),i(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const n=i(e+8),t=Reflect.get(n,c(e+16)),r=s(e+32),_=Reflect.apply(t,n,r);e=this._inst.exports.getsp()>>>0,o(e+56,_),this.mem.setUint8(e+64,1)}catch(n){e=this._inst.exports.getsp()>>>0,o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const n=i(e+8),t=s(e+16),r=Reflect.apply(n,void 0,t);e=this._inst.exports.getsp()>>>0,o(e+40,r),this.mem.setUint8(e+48,1)}catch(n){e=this._inst.exports.getsp()>>>0,o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const n=i(e+8),t=s(e+16),r=Reflect.construct(n,t);e=this._inst.exports.getsp()>>>0,o(e+40,r),this.mem.setUint8(e+48,1)}catch(n){e=this._inst.exports.getsp()>>>0,o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e((n>>>=0)+16,parseInt(i(n+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const r=n.encode(String(i(t+8)));o(t+16,r),e(t+24,r.length)},"syscall/js.valueLoadString":e=>{const n=i((e>>>=0)+8);_(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,i(e+8)instanceof i(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const t=_((n>>>=0)+8),r=i(n+32);if(!(r instanceof Uint8Array||r instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const o=r.subarray(0,t.length);t.set(o),e(n+40,o.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const t=i((n>>>=0)+8),r=_(n+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const o=r.subarray(0,t.length);t.set(o),e(n+40,o.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){if(!(e instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let t=4096;const r=e=>{const r=t,i=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,t,i.length).set(i),t+=i.length,t%8!=0&&(t+=8-t%8),r},i=this.argv.length,o=[];this.argv.forEach(e=>{o.push(r(e))}),o.push(0);Object.keys(this.env).sort().forEach(e=>{o.push(r(`${e}=${this.env[e]}`))}),o.push(0);const _=t;o.forEach(e=>{this.mem.setUint32(t,e,!0),this.mem.setUint32(t+4,0,!0),t+=8});if(t>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,_),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const t={id:e,this:this,args:arguments};return n._pendingEvent=t,n._resume(),t.result}}}})();const X=Symbol("Comlink.proxy"),Q=Symbol("Comlink.endpoint"),Z=Symbol("Comlink.releaseProxy"),ee=Symbol("Comlink.finalizer"),ne=Symbol("Comlink.thrown"),te=e=>"object"==typeof e&&null!==e||"function"==typeof e,re={canHandle:e=>te(e)&&e[X],serialize(e){const{port1:n,port2:t}=new MessageChannel;return oe(e,n),[t,[t]]},deserialize(e){return e.start(),function(e,n){const t=new Map;return e.addEventListener("message",function(e){const{data:n}=e;if(!n||!n.id)return;const r=t.get(n.id);if(r)try{r(n)}finally{t.delete(n.id)}}),fe(e,t,[],n)}(e)}},ie=new Map([["proxy",re],["throw",{canHandle:e=>te(e)&&ne in e,serialize({value:e}){let n;return n=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[n,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function oe(e,n=globalThis,t=["*"]){n.addEventListener("message",function r(i){if(!i||!i.data)return;if(!function(e,n){for(const t of e){if(n===t||"*"===t)return!0;if(t instanceof RegExp&&t.test(n))return!0}return!1}(t,i.origin))return void console.warn(`Invalid origin '${i.origin}' for comlink proxy`);const{id:o,type:_,path:s}=Object.assign({path:[]},i.data),c=(i.data.argumentList||[]).map(we);let a;try{const n=s.slice(0,-1).reduce((e,n)=>e[n],e),t=s.reduce((e,n)=>e[n],e);switch(_){case"GET":a=t;break;case"SET":n[s.slice(-1)[0]]=we(i.data.value),a=!0;break;case"APPLY":a=t.apply(n,c);break;case"CONSTRUCT":a=function(e){return Object.assign(e,{[X]:!0})}(new t(...c));break;case"ENDPOINT":{const{port1:n,port2:t}=new MessageChannel;oe(e,t),a=function(e,n){return ge.set(e,n),e}(n,[n])}break;case"RELEASE":a=void 0;break;default:return}}catch(u){a={value:u,[ne]:0}}Promise.resolve(a).catch(e=>({value:e,[ne]:0})).then(t=>{const[i,s]=le(t);n.postMessage(Object.assign(Object.assign({},i),{id:o}),s),"RELEASE"===_&&(n.removeEventListener("message",r),_e(n),ee in e&&"function"==typeof e[ee]&&e[ee]())}).catch(e=>{const[t,r]=le({value:new TypeError("Unserializable return value"),[ne]:0});n.postMessage(Object.assign(Object.assign({},t),{id:o}),r)})}),n.start&&n.start()}function _e(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function se(e){if(e)throw new Error("Proxy has been released and is not useable")}function ce(e){return de(e,new Map,{type:"RELEASE"}).then(()=>{_e(e)})}const ae=new WeakMap,ue="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const n=(ae.get(e)||0)-1;ae.set(e,n),0===n&&ce(e)});function fe(e,n,t=[],r=function(){}){let i=!1;const o=new Proxy(r,{get(r,_){if(se(i),_===Z)return()=>{!function(e){ue&&ue.unregister(e)}(o),ce(e),n.clear(),i=!0};if("then"===_){if(0===t.length)return{then:()=>o};const r=de(e,n,{type:"GET",path:t.map(e=>e.toString())}).then(we);return r.then.bind(r)}return fe(e,n,[...t,_])},set(r,o,_){se(i);const[s,c]=le(_);return de(e,n,{type:"SET",path:[...t,o].map(e=>e.toString()),value:s},c).then(we)},apply(r,o,_){se(i);const s=t[t.length-1];if(s===Q)return de(e,n,{type:"ENDPOINT"}).then(we);if("bind"===s)return fe(e,n,t.slice(0,-1));const[c,a]=be(_);return de(e,n,{type:"APPLY",path:t.map(e=>e.toString()),argumentList:c},a).then(we)},construct(r,o){se(i);const[_,s]=be(o);return de(e,n,{type:"CONSTRUCT",path:t.map(e=>e.toString()),argumentList:_},s).then(we)}});return function(e,n){const t=(ae.get(n)||0)+1;ae.set(n,t),ue&&ue.register(e,n,e)}(o,e),o}function be(e){const n=e.map(le);return[n.map(e=>e[0]),(t=n.map(e=>e[1]),Array.prototype.concat.apply([],t))];var t}const ge=new WeakMap;function le(e){for(const[n,t]of ie)if(t.canHandle(e)){const[r,i]=t.serialize(e);return[{type:"HANDLER",name:n,value:r},i]}return[{type:"RAW",value:e},ge.get(e)||[]]}function we(e){switch(e.type){case"HANDLER":return ie.get(e.name).deserialize(e.value);case"RAW":return e.value}}function de(e,n,t,r){return new Promise(i=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");n.set(o,i),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),r)})}var me;!function(e){e.Loaded="Loaded"}(me||(me={}));const he={uint8array:["application/octet-stream"],json:["application/json","text/json",/application\/json.*/,/text\/json\+.*/],text:["text/plain",/text\/plain.*/,"text/html",/text\/html.*/],formData:["application/x-www-form-urlencoded","multipart/form-data"],blob:[/image\/.*/,/video\/.*/],fallback:"blob"},pe=(e,t)=>n(void 0,void 0,void 0,function*(){switch(t){case"uint8array":return{uint8array:new Uint8Array(yield e.arrayBuffer())};case"json":case"text":return{text:yield e.text()};case"blob":{const n=yield e.blob();return{blobUrl:URL.createObjectURL(n)}}case"formData":{const n={},t=yield e.formData();for(const e of t.entries()){const[t,r]=e;n[t]=r}return{formData:n}}default:return{}}}),ye=(e,n)=>{if(!n)return!1;if(!e)return!1;for(let t=0;t<n.length;t+=1){const r=n[t];if("string"==typeof r&&e===r)return!0;if(r.test&&r.test(e))return!0}return!1};function ve(){return n(this,void 0,void 0,function*(){const{mixFetch:e}=self;let t=he;var i;oe({mixFetch:(r,i)=>n(this,void 0,void 0,function*(){console.log("[Worker] --- mixFetch ---",{url:r,args:i});const o=yield e(r,i);console.log("[Worker]",{response:o,json:JSON.stringify(o,null,2)});const _=yield((e,t)=>n(void 0,void 0,void 0,function*(){const n=Object.assign(Object.assign({},he),t),r=(e=>{if(e)return e.headers.has("Content-Type")?e.headers.get("Content-Type"):e.headers.has("content-type")?e.headers.get("content-type"):void 0})(e);return r?ye(r,n.uint8array)?pe(e,"uint8array"):ye(r,n.json)?pe(e,"json"):ye(r,n.text)?pe(e,"text"):ye(r,n.formData)?pe(e,"formData"):ye(r,n.blob)?pe(e,"blob"):{}:e.body?pe(e,(null==t?void 0:t.fallback)||"blob"):{}}))(o,t);console.log("[Worker]",{bodyResponse:_});const s={};o.headers.forEach((e,n)=>{s[n]=e});const c={body:_,url:o.url,headers:s,status:o.status,statusText:o.statusText,type:o.type,ok:o.ok,redirected:o.redirected};return console.log("[Worker]",{output:c}),c}),setupMixFetch:e=>n(this,void 0,void 0,function*(){console.log("[Worker] --- setupMixFetch ---",{opts:e}),(null==e?void 0:e.responseBodyConfigMap)&&(t=e.responseBodyConfigMap),yield function(e){return r.setupMixFetch(e)}(e||{})}),disconnectMixFetch:()=>n(this,void 0,void 0,function*(){console.log("[Worker] --- disconnectMixFetch ---"),yield r.disconnectMixFetch()})}),i={kind:me.Loaded,args:{loaded:!0}},self.postMessage(i)})}(function(){return n(this,void 0,void 0,function*(){yield J(),yield ve()})})().catch(e=>console.error("Unhandled exception in mixFetch worker",e))}();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see web-worker-0.js.LICENSE.txt */
|
|
2
|
-
!function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;function n(e,n,t,r){return new(t||(t=Promise))((function(i,o){function _(e){try{c(r.next(e))}catch(n){o(n)}}function s(e){try{c(r.throw(e))}catch(n){o(n)}}function c(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(_,s)}c((r=r.apply(e,n||[])).next())}))}function t(e,n,t,r){function i(e,n,t){var r=t?WebAssembly.instantiateStreaming:WebAssembly.instantiate,i=t?WebAssembly.compileStreaming:WebAssembly.compile;return n?r(e,n):i(e)}var o=null;if(n)return i(fetch(n),r,!0);var _=globalThis.atob(t),s=_.length;o=new Uint8Array(new ArrayBuffer(s));for(var c=0;c<s;c++)o[c]=_.charCodeAt(c);if(e){var a=new WebAssembly.Module(o);return r?new WebAssembly.Instance(a,r):a}return i(o,r,!1)}let r;"function"==typeof SuppressedError&&SuppressedError;let i=0,o=null;function _(){return null!==o&&0!==o.byteLength||(o=new Uint8Array(r.memory.buffer)),o}const s="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},c="function"==typeof s.encodeInto?function(e,n){return s.encodeInto(e,n)}:function(e,n){const t=s.encode(e);return n.set(t),{read:e.length,written:t.length}};function a(e,n,t){if(void 0===t){const t=s.encode(e),r=n(t.length,1)>>>0;return _().subarray(r,r+t.length).set(t),i=t.length,r}let r=e.length,o=n(r,1)>>>0;const a=_();let u=0;for(;u<r;u++){const n=e.charCodeAt(u);if(n>127)break;a[o+u]=n}if(u!==r){0!==u&&(e=e.slice(u)),o=t(o,r,r=u+3*e.length,1)>>>0;const n=_().subarray(o+u,o+r);u+=c(e,n).written,o=t(o,r,u,1)>>>0}return i=u,o}let u=null;function f(){return(null===u||!0===u.buffer.detached||void 0===u.buffer.detached&&u.buffer!==r.memory.buffer)&&(u=new DataView(r.memory.buffer)),u}function b(e){const n=r.__externref_table_alloc();return r.__wbindgen_export_4.set(n,e),n}function g(e,n){try{return e.apply(this,n)}catch(t){const e=b(t);r.__wbindgen_exn_store(e)}}const l="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};function w(e,n){return e>>>=0,l.decode(_().subarray(e,e+n))}function d(e){return null==e}function m(e,n){return e>>>=0,_().subarray(e/1,e/1+n)}"undefined"!=typeof TextDecoder&&l.decode();const h="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>{r.__wbindgen_export_6.get(e.dtor)(e.a,e.b)}));function p(e,n,t,i){const o={a:e,b:n,cnt:1,dtor:t},_=(...e)=>{o.cnt++;const n=o.a;o.a=0;try{return i(n,o.b,...e)}finally{0==--o.cnt?(r.__wbindgen_export_6.get(o.dtor)(n,o.b),h.unregister(o)):o.a=n}};return _.original=o,h.register(_,o,o),_}function y(e){const n=typeof e;if("number"==n||"boolean"==n||null==e)return`${e}`;if("string"==n)return`"${e}"`;if("symbol"==n){const n=e.description;return null==n?"Symbol":`Symbol(${n})`}if("function"==n){const n=e.name;return"string"==typeof n&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(e)){const n=e.length;let t="[";n>0&&(t+=y(e[0]));for(let r=1;r<n;r++)t+=", "+y(e[r]);return t+="]",t}const t=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(!(t&&t.length>1))return toString.call(e);if(r=t[1],"Object"==r)try{return"Object("+JSON.stringify(e)+")"}catch(i){return"Object"}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:r}function v(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i,s=function(e,n){const t=n(1*e.length,1)>>>0;return _().set(e,t/1),i=e.length,t}(n,r.__wbindgen_malloc),c=i;return r.send_client_data(t,o,s,c)}function x(e){const n=r.__wbindgen_export_4.get(e);return r.__externref_table_dealloc(e),n}function R(){const e=r.mix_fetch_initialised();if(e[2])throw x(e[1]);return 0!==e[0]}function E(e){const n=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),t=i;return r.start_new_mixnet_connection(n,t)}function T(e){const n=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),t=i;return r.finish_mixnet_connection(n,t)}function S(e,n,t){const i=r.closure743_externref_shim_multivalue_shim(e,n,t);if(i[1])throw x(i[0])}function j(e,n,t){r.closure830_externref_shim(e,n,t)}function I(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h061f9c2866052d32(e,n)}function F(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h67f1322bcb5f40b5(e,n)}function A(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb7fef82722851829(e,n)}function k(e,n,t){r.closure2203_externref_shim(e,n,t)}function O(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ea245616776fb08(e,n)}function U(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h75596235482477c3(e,n)}function W(e,n,t){r.closure2326_externref_shim(e,n,t)}const C=["blob","arraybuffer"],D=["pending","done"],z=["readonly","readwrite","versionchange","readwriteflush","cleanup"],M=["default","no-store","reload","no-cache","force-cache","only-if-cached"],L=["omit","same-origin","include"],B=["same-origin","no-cors","cors","navigate"];"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_acknowledgementswasm_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_anonymoussendertag_free(e>>>0,1)));const P="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_clientstorage_free(e>>>0,1)));class N{static __wrap(e){e>>>=0;const n=Object.create(N.prototype);return n.__wbg_ptr=e,P.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_clientstorage_free(e,0)}static new_unencrypted(e){const n=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),t=i;return r.clientstorage_new_unencrypted(n,t)}constructor(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i,_=a(n,r.__wbindgen_malloc,r.__wbindgen_realloc),s=i;return r.clientstorage_new(t,o,_,s)}static new_async(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;var _=d(n)?0:a(n,r.__wbindgen_malloc,r.__wbindgen_realloc),s=i;return r.clientstorage_new_async(t,o,_,s)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_covertrafficwasm_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_debugwasm_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_forgetmewasm_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_gatewayconnectionwasm_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_mixfetch_free(e>>>0,1)));const q="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_mixfetchclient_free(e>>>0,1)));class G{static __wrap(e){e>>>=0;const n=Object.create(G.prototype);return n.__wbg_ptr=e,q.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,q.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_mixfetchclient_free(e,0)}disconnect(){return r.mixfetchclient_disconnect(this.__wbg_ptr)}self_address(){let e,n;try{const t=r.mixfetchclient_self_address(this.__wbg_ptr);return e=t[0],n=t[1],w(t[0],t[1])}finally{r.__wbindgen_free(e,n,1)}}constructor(e,n,t,o){!function(e,n){if(!(e instanceof n))throw new Error(`expected instance of ${n.name}`)}(e,$);var _=e.__destroy_into_raw(),s=d(t)?0:a(t,r.__wbindgen_malloc,r.__wbindgen_realloc),c=i,u=d(o)?0:a(o,r.__wbindgen_malloc,r.__wbindgen_realloc),f=i;return r.mixfetchclient_new(_,n,s,c,u,f)}active(){return 0!==r.mixfetchclient_active(this.__wbg_ptr)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_mixfetchclientbuilder_free(e>>>0,1)));const V="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>r.__wbg_mixfetchconfig_free(e>>>0,1)));class ${static __wrap(e){e>>>=0;const n=Object.create($.prototype);return n.__wbg_ptr=e,V.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_mixfetchconfig_free(e,0)}with_mix_fetch_timeout(e){const n=this.__destroy_into_raw(),t=r.mixfetchconfig_with_mix_fetch_timeout(n,e);return $.__wrap(t)}constructor(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i,_=r.mixfetchconfig_new(t,o,d(n)?0:b(n));if(_[2])throw x(_[1]);return this.__wbg_ptr=_[0]>>>0,V.register(this,this.__wbg_ptr,this),this}}function H(){const e={wbg:{}};return e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,n){const t=a(String(n),r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_String_eecc4a11987127d6=function(e,n){const t=a(String(n),r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_Window_41559019033ede94=function(e){return e.Window},e.wbg.__wbg_WorkerGlobalScope_d324bffbeaef9f3a=function(e){return e.WorkerGlobalScope},e.wbg.__wbg_abort_410ec47a64ac6117=function(e,n){e.abort(n)},e.wbg.__wbg_abort_775ef1d17fc65868=function(e){e.abort()},e.wbg.__wbg_abort_99fc644e2c79c9fb=function(){return g((function(e){e.abort()}),arguments)},e.wbg.__wbg_addEventListener_84ae3eac6e15480a=function(){return g((function(e,n,t,r,i){e.addEventListener(w(n,t),r,i)}),arguments)},e.wbg.__wbg_addEventListener_90e553fdce254421=function(){return g((function(e,n,t,r){e.addEventListener(w(n,t),r)}),arguments)},e.wbg.__wbg_append_8c7dd8d641a5f01b=function(){return g((function(e,n,t,r,i){e.append(w(n,t),w(r,i))}),arguments)},e.wbg.__wbg_arrayBuffer_d1b44c4390db422f=function(){return g((function(e){return e.arrayBuffer()}),arguments)},e.wbg.__wbg_bound_f2afc3766d4545cf=function(){return g((function(e,n,t,r){return IDBKeyRange.bound(e,n,0!==t,0!==r)}),arguments)},e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},e.wbg.__wbg_call_672a4d21634d4a24=function(){return g((function(e,n){return e.call(n)}),arguments)},e.wbg.__wbg_call_7cccdd69e0791ae2=function(){return g((function(e,n,t){return e.call(n,t)}),arguments)},e.wbg.__wbg_clearInterval_dd1e598f425db353=function(e){return clearInterval(e)},e.wbg.__wbg_clearTimeout_3b5c565a5ec539dd=function(e){return clearTimeout(e)},e.wbg.__wbg_clientstorage_new=function(e){return N.__wrap(e)},e.wbg.__wbg_close_2893b7d056a0627d=function(){return g((function(e){e.close()}),arguments)},e.wbg.__wbg_code_f4ec1e6e2e1b0417=function(e){return e.code},e.wbg.__wbg_commit_a54edce65f3858f2=function(){return g((function(e){e.commit()}),arguments)},e.wbg.__wbg_count_9dbedee4d2474ff8=function(){return g((function(e,n){return e.count(n)}),arguments)},e.wbg.__wbg_createObjectStore_e566459f7161f82f=function(){return g((function(e,n,t){return e.createObjectStore(w(n,t))}),arguments)},e.wbg.__wbg_crypto_574e78ad8b13b65f=function(e){return e.crypto},e.wbg.__wbg_data_432d9c3df2630942=function(e){return e.data},e.wbg.__wbg_dispatchEvent_9e259d7c1d603dfb=function(){return g((function(e,n){return e.dispatchEvent(n)}),arguments)},e.wbg.__wbg_done_769e5ede4b31c67b=function(e){return e.done},e.wbg.__wbg_entries_2a52db465d0421fb=function(e){return e.entries()},e.wbg.__wbg_entries_3265d4158b33e5dc=function(e){return Object.entries(e)},e.wbg.__wbg_error_3cfd4be637595be7=function(e,n){console.error(w(e,n))},e.wbg.__wbg_error_e98c298703cffa97=function(e,n){console.error(w(e,n))},e.wbg.__wbg_error_ff4ddaabdfc5dbb3=function(){return g((function(e){const n=e.error;return d(n)?0:b(n)}),arguments)},e.wbg.__wbg_fetch_16dcf1cfbbc66b3c=function(e){return fetch(e)},e.wbg.__wbg_fetch_509096533071c657=function(e,n){return e.fetch(n)},e.wbg.__wbg_from_2a5d3e218e67aa85=function(e){return Array.from(e)},e.wbg.__wbg_getAllKeys_b11d8835dc4be0e8=function(){return g((function(e){return e.getAllKeys()}),arguments)},e.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return g((function(e,n){e.getRandomValues(n)}),arguments)},e.wbg.__wbg_getTime_46267b1c24877e30=function(e){return e.getTime()},e.wbg.__wbg_get_67b2ba62fc30de12=function(){return g((function(e,n){return Reflect.get(e,n)}),arguments)},e.wbg.__wbg_get_8da03f81f6a1111e=function(){return g((function(e,n){return e.get(n)}),arguments)},e.wbg.__wbg_get_b9b93047fe3cf45b=function(e,n){return e[n>>>0]},e.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(e,n){return e[n]},e.wbg.__wbg_getwithrefkey_6550b2c093d2eb18=function(e,n){return e[n]},e.wbg.__wbg_global_f5c2926e57ba457f=function(e){return e.global},e.wbg.__wbg_goWasmCloseRemoteSocket_992b677524fcede8=function(e,n){let t,i;try{t=e,i=n,__go_rs_bridge__.goWasmCloseRemoteSocket(w(e,n))}finally{r.__wbindgen_free(t,i,1)}},e.wbg.__wbg_goWasmInjectConnError_b927894206725a9c=function(e,n,t,i){let o,_,s,c;try{o=e,_=n,s=t,c=i,__go_rs_bridge__.goWasmInjectConnError(w(e,n),w(t,i))}finally{r.__wbindgen_free(o,_,1),r.__wbindgen_free(s,c,1)}},e.wbg.__wbg_goWasmInjectServerData_40f1c53f7ca870d5=function(e,n,t,i){let o,_;try{o=e,_=n;var s=m(t,i).slice();r.__wbindgen_free(t,1*i,1),__go_rs_bridge__.goWasmInjectServerData(w(e,n),s)}finally{r.__wbindgen_free(o,_,1)}},e.wbg.__wbg_goWasmSetMixFetchRequestTimeout_74f591ac382a0775=function(e){__go_rs_bridge__.goWasmSetMixFetchRequestTimeout(e>>>0)},e.wbg.__wbg_has_a5ea9117f258a0ec=function(){return g((function(e,n){return Reflect.has(e,n)}),arguments)},e.wbg.__wbg_headers_9cb51cfd2ac780a4=function(e){return e.headers},e.wbg.__wbg_indexedDB_54f01430b1e194e8=function(){return g((function(e){const n=e.indexedDB;return d(n)?0:b(n)}),arguments)},e.wbg.__wbg_indexedDB_b1f49280282046f8=function(){return g((function(e){const n=e.indexedDB;return d(n)?0:b(n)}),arguments)},e.wbg.__wbg_indexedDB_f6b47b0dc333fd2f=function(){return g((function(e){const n=e.indexedDB;return d(n)?0:b(n)}),arguments)},e.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(e){let n;try{n=e instanceof ArrayBuffer}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_DomException_ed1ccb7aaf39034c=function(e){let n;try{n=e instanceof DOMException}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_Error_4d54113b22d20306=function(e){let n;try{n=e instanceof Error}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_IdbDatabase_a3ef009ca00059f9=function(e){let n;try{n=e instanceof IDBDatabase}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_IdbRequest_4813c3f207666aa4=function(e){let n;try{n=e instanceof IDBRequest}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_Response_f2cc20d9f7dfd644=function(e){let n;try{n=e instanceof Response}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(e){let n;try{n=e instanceof Uint8Array}catch(t){n=!1}return n},e.wbg.__wbg_isArray_a1eab7e0d067391b=function(e){return Array.isArray(e)},e.wbg.__wbg_isSafeInteger_343e2beeeece1bb0=function(e){return Number.isSafeInteger(e)},e.wbg.__wbg_iterator_9a24c88df860dc65=function(){return Symbol.iterator},e.wbg.__wbg_length_a446193dc22c12f8=function(e){return e.length},e.wbg.__wbg_length_e2d2a49132c1b256=function(e){return e.length},e.wbg.__wbg_log_72cb694afa6a0fe7=function(e,n){console.log(w(e,n))},e.wbg.__wbg_lowerBound_1872d19f5bcf83c6=function(){return g((function(e,n){return IDBKeyRange.lowerBound(e,0!==n)}),arguments)},e.wbg.__wbg_message_5c5d919204d42400=function(e,n){const t=a(n.message,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_message_97a2af9b89d693a3=function(e){return e.message},e.wbg.__wbg_mixfetchclient_new=function(e){return G.__wrap(e)},e.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(e){return e.msCrypto},e.wbg.__wbg_name_0b327d569f00ebee=function(e){return e.name},e.wbg.__wbg_name_f2d27098bfd843e7=function(e,n){const t=a(n.name,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_new0_f788a2397c7ca929=function(){return new Date},e.wbg.__wbg_new_018dcc2d6c8c2f6a=function(){return g((function(){return new Headers}),arguments)},e.wbg.__wbg_new_23a2665fac83c611=function(e,n){try{var t={a:e,b:n};const i=new Promise(((e,n)=>{const i=t.a;t.a=0;try{return function(e,n,t,i){r.closure2942_externref_shim(e,n,t,i)}(i,t.b,e,n)}finally{t.a=i}}));return i}finally{t.a=t.b=0}},e.wbg.__wbg_new_405e22f390576ce2=function(){return new Object},e.wbg.__wbg_new_5e0be73521bc8c17=function(){return new Map},e.wbg.__wbg_new_78feb108b6472713=function(){return new Array},e.wbg.__wbg_new_92c54fc74574ef55=function(){return g((function(e,n){return new WebSocket(w(e,n))}),arguments)},e.wbg.__wbg_new_a12002a7f91c75be=function(e){return new Uint8Array(e)},e.wbg.__wbg_new_c68d7209be747379=function(e,n){return new Error(w(e,n))},e.wbg.__wbg_new_e25e5aab09ff45db=function(){return g((function(){return new AbortController}),arguments)},e.wbg.__wbg_newnoargs_105ed471475aaf50=function(e,n){return new Function(w(e,n))},e.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(e,n,t){return new Uint8Array(e,n>>>0,t>>>0)},e.wbg.__wbg_newwitheventinitdict_502dbfa1b3d2fcbc=function(){return g((function(e,n,t){return new CloseEvent(w(e,n),t)}),arguments)},e.wbg.__wbg_newwithlength_a381634e90c276d4=function(e){return new Uint8Array(e>>>0)},e.wbg.__wbg_newwithstrandinit_06c535e0a867c635=function(){return g((function(e,n,t){return new Request(w(e,n),t)}),arguments)},e.wbg.__wbg_next_25feadfc0913fea9=function(e){return e.next},e.wbg.__wbg_next_6574e1a8a62d1055=function(){return g((function(e){return e.next()}),arguments)},e.wbg.__wbg_node_905d3e251edff8a2=function(e){return e.node},e.wbg.__wbg_now_e1163c67115ff874=function(e){return e.now()},e.wbg.__wbg_objectStore_21878d46d25b64b6=function(){return g((function(e,n,t){return e.objectStore(w(n,t))}),arguments)},e.wbg.__wbg_oldVersion_e8337811e52861c6=function(e){return e.oldVersion},e.wbg.__wbg_open_e0c0b2993eb596e1=function(){return g((function(e,n,t,r){return e.open(w(n,t),r>>>0)}),arguments)},e.wbg.__wbg_performance_7fe0928f3ab059e5=function(e){return e.performance},e.wbg.__wbg_postMessage_83a8d58d3fcb6c13=function(){return g((function(e,n){e.postMessage(n)}),arguments)},e.wbg.__wbg_process_dc0fbacc7c1c06f7=function(e){return e.process},e.wbg.__wbg_put_066faa31a6a88f5b=function(){return g((function(e,n,t){return e.put(n,t)}),arguments)},e.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5=function(e){queueMicrotask(e)},e.wbg.__wbg_queueMicrotask_d3219def82552485=function(e){return e.queueMicrotask},e.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return g((function(e,n){e.randomFillSync(n)}),arguments)},e.wbg.__wbg_readyState_4013cfdf4f22afb0=function(e){const n=e.readyState;return(D.indexOf(n)+1||3)-1},e.wbg.__wbg_readyState_7ef6e63c349899ed=function(e){return e.readyState},e.wbg.__wbg_reason_49f1cede8bcf23dd=function(e,n){const t=a(n.reason,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_reject_b3fcf99063186ff7=function(e){return Promise.reject(e)},e.wbg.__wbg_removeEventListener_056dfe8c3d6c58f9=function(){return g((function(e,n,t,r){e.removeEventListener(w(n,t),r)}),arguments)},e.wbg.__wbg_require_60cc747a6bc5215a=function(){return g((function(){return module.require}),arguments)},e.wbg.__wbg_resolve_4851785c9c5f573d=function(e){return Promise.resolve(e)},e.wbg.__wbg_result_f29afabdf2c05826=function(){return g((function(e){return e.result}),arguments)},e.wbg.__wbg_send_0293179ba074ffb4=function(){return g((function(e,n,t){e.send(w(n,t))}),arguments)},e.wbg.__wbg_send_fc0c204e8a1757f4=function(){return g((function(e,n,t){e.send(m(n,t))}),arguments)},e.wbg.__wbg_setInterval_ed3b5e3c3ebb8a6d=function(){return g((function(e,n){return setInterval(e,n)}),arguments)},e.wbg.__wbg_setTimeout_42370cb3051b8c2c=function(){return g((function(e,n,t){return e.setTimeout(n,t)}),arguments)},e.wbg.__wbg_setTimeout_8f06012fba12034e=function(e,n){globalThis.setTimeout(e,n)},e.wbg.__wbg_setTimeout_cb2a856ba8315e7a=function(e,n){return setTimeout(e,n)},e.wbg.__wbg_set_37837023f3d740e8=function(e,n,t){e[n>>>0]=t},e.wbg.__wbg_set_3f1d0b984ed272ed=function(e,n,t){e[n]=t},e.wbg.__wbg_set_65595bdd868b3009=function(e,n,t){e.set(n,t>>>0)},e.wbg.__wbg_set_8fc6bf8a5b1071d1=function(e,n,t){return e.set(n,t)},e.wbg.__wbg_setbinaryType_92fa1ffd873b327c=function(e,n){e.binaryType=C[n]},e.wbg.__wbg_setbody_5923b78a95eedf29=function(e,n){e.body=n},e.wbg.__wbg_setcache_12f17c3a980650e4=function(e,n){e.cache=M[n]},e.wbg.__wbg_setcode_156060465a2f8f79=function(e,n){e.code=n},e.wbg.__wbg_setcredentials_c3a22f1cd105a2c6=function(e,n){e.credentials=L[n]},e.wbg.__wbg_setheaders_834c0bdb6a8949ad=function(e,n){e.headers=n},e.wbg.__wbg_setmethod_3c5280fe5d890842=function(e,n,t){e.method=w(n,t)},e.wbg.__wbg_setmode_5dc300b865044b65=function(e,n){e.mode=B[n]},e.wbg.__wbg_setonabort_3bf4db6614fa98e9=function(e,n){e.onabort=n},e.wbg.__wbg_setonce_0cb80aea26303a35=function(e,n){e.once=0!==n},e.wbg.__wbg_setoncomplete_4d19df0dadb7c4d4=function(e,n){e.oncomplete=n},e.wbg.__wbg_setonerror_b0d9d723b8fddbbb=function(e,n){e.onerror=n},e.wbg.__wbg_setonerror_d7e3056cc6e56085=function(e,n){e.onerror=n},e.wbg.__wbg_setonsuccess_afa464ee777a396d=function(e,n){e.onsuccess=n},e.wbg.__wbg_setonupgradeneeded_fcf7ce4f2eb0cb5f=function(e,n){e.onupgradeneeded=n},e.wbg.__wbg_setreason_d29ac0402eeeb81a=function(e,n,t){e.reason=w(n,t)},e.wbg.__wbg_setsignal_75b21ef3a81de905=function(e,n){e.signal=n},e.wbg.__wbg_signal_aaf9ad74119f20a4=function(e){return e.signal},e.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07=function(){const e="undefined"==typeof global?null:global;return d(e)?0:b(e)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0=function(){const e="undefined"==typeof globalThis?null:globalThis;return d(e)?0:b(e)},e.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819=function(){const e="undefined"==typeof self?null:self;return d(e)?0:b(e)},e.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40=function(){const e="undefined"==typeof window?null:window;return d(e)?0:b(e)},e.wbg.__wbg_status_f6360336ca686bf0=function(e){return e.status},e.wbg.__wbg_subarray_aa9065fa9dc5df96=function(e,n,t){return e.subarray(n>>>0,t>>>0)},e.wbg.__wbg_target_0a62d9d79a2a1ede=function(e){const n=e.target;return d(n)?0:b(n)},e.wbg.__wbg_text_7805bea50de2af49=function(){return g((function(e){return e.text()}),arguments)},e.wbg.__wbg_then_44b73946d2fb3e7d=function(e,n){return e.then(n)},e.wbg.__wbg_then_48b406749878a531=function(e,n,t){return e.then(n,t)},e.wbg.__wbg_toString_5285597960676b7b=function(e){return e.toString()},e.wbg.__wbg_toString_c813bbd34d063839=function(e){return e.toString()},e.wbg.__wbg_transaction_7d452475ef3c3c33=function(e){return e.transaction},e.wbg.__wbg_transaction_babc423936946a37=function(){return g((function(e,n,t,r){return e.transaction(w(n,t),z[r])}),arguments)},e.wbg.__wbg_upperBound_76a00814e81f6891=function(){return g((function(e,n){return IDBKeyRange.upperBound(e,0!==n)}),arguments)},e.wbg.__wbg_url_ae10c34ca209681d=function(e,n){const t=a(n.url,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_value_cd1ffa7b1ab794f1=function(e){return e.value},e.wbg.__wbg_versions_c01dfd4722a88165=function(e){return e.versions},e.wbg.__wbg_warn_a2e6ac466681f75e=function(e,n){console.warn(w(e,n))},e.wbg.__wbg_wasClean_605b4fd66d44354a=function(e){return e.wasClean},e.wbg.__wbindgen_as_number=function(e){return+e},e.wbg.__wbindgen_bigint_from_i64=function(e){return e},e.wbg.__wbindgen_bigint_from_u64=function(e){return BigInt.asUintN(64,e)},e.wbg.__wbindgen_bigint_get_as_i64=function(e,n){const t="bigint"==typeof n?n:void 0;f().setBigInt64(e+8,d(t)?BigInt(0):t,!0),f().setInt32(e+0,!d(t),!0)},e.wbg.__wbindgen_boolean_get=function(e){return"boolean"==typeof e?e?1:0:2},e.wbg.__wbindgen_cb_drop=function(e){const n=e.original;if(1==n.cnt--)return n.a=0,!0;return!1},e.wbg.__wbindgen_closure_wrapper3948=function(e,n,t){return p(e,n,744,S)},e.wbg.__wbindgen_closure_wrapper4932=function(e,n,t){return p(e,n,831,j)},e.wbg.__wbindgen_closure_wrapper4933=function(e,n,t){return p(e,n,829,I)},e.wbg.__wbindgen_closure_wrapper5925=function(e,n,t){return p(e,n,1132,F)},e.wbg.__wbindgen_closure_wrapper8465=function(e,n,t){return p(e,n,1996,A)},e.wbg.__wbindgen_closure_wrapper9290=function(e,n,t){return p(e,n,2202,k)},e.wbg.__wbindgen_closure_wrapper9292=function(e,n,t){return p(e,n,2202,O)},e.wbg.__wbindgen_closure_wrapper9294=function(e,n,t){return p(e,n,2202,k)},e.wbg.__wbindgen_closure_wrapper9296=function(e,n,t){return p(e,n,2202,k)},e.wbg.__wbindgen_closure_wrapper9742=function(e,n,t){return p(e,n,2316,U)},e.wbg.__wbindgen_closure_wrapper9780=function(e,n,t){return p(e,n,2327,W)},e.wbg.__wbindgen_debug_string=function(e,n){const t=a(y(n),r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbindgen_error_new=function(e,n){return new Error(w(e,n))},e.wbg.__wbindgen_in=function(e,n){return e in n},e.wbg.__wbindgen_init_externref_table=function(){const e=r.__wbindgen_export_4,n=e.grow(4);e.set(0,void 0),e.set(n+0,void 0),e.set(n+1,null),e.set(n+2,!0),e.set(n+3,!1)},e.wbg.__wbindgen_is_bigint=function(e){return"bigint"==typeof e},e.wbg.__wbindgen_is_function=function(e){return"function"==typeof e},e.wbg.__wbindgen_is_null=function(e){return null===e},e.wbg.__wbindgen_is_object=function(e){return"object"==typeof e&&null!==e},e.wbg.__wbindgen_is_string=function(e){return"string"==typeof e},e.wbg.__wbindgen_is_undefined=function(e){return void 0===e},e.wbg.__wbindgen_jsval_eq=function(e,n){return e===n},e.wbg.__wbindgen_jsval_loose_eq=function(e,n){return e==n},e.wbg.__wbindgen_memory=function(){return r.memory},e.wbg.__wbindgen_number_get=function(e,n){const t="number"==typeof n?n:void 0;f().setFloat64(e+8,d(t)?0:t,!0),f().setInt32(e+0,!d(t),!0)},e.wbg.__wbindgen_number_new=function(e){return e},e.wbg.__wbindgen_string_get=function(e,n){const t="string"==typeof n?n:void 0;var o=d(t)?0:a(t,r.__wbindgen_malloc,r.__wbindgen_realloc),_=i;f().setInt32(e+4,_,!0),f().setInt32(e+0,o,!0)},e.wbg.__wbindgen_string_new=function(e,n){return w(e,n)},e.wbg.__wbindgen_throw=function(e,n){throw new Error(w(e,n))},e}async function K(n){if(void 0!==r)return r;void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("mix_fetch_wasm_bg.wasm",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("worker.js",document.baseURI).href));const t=H();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:i,module:_}=await async function(e,n){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,n)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const r=await e.arrayBuffer();return await WebAssembly.instantiate(r,n)}{const t=await WebAssembly.instantiate(e,n);return t instanceof WebAssembly.Instance?{instance:t,module:e}:t}}(await n,t);return function(e,n){return r=e.exports,K.__wbindgen_wasm_module=n,u=null,o=null,r.__wbindgen_start(),r}(i,_)}function Y(){return n(this,void 0,void 0,(function*(){const e=yield t(0,new URL("go_conn.wasm",import.meta.url),null,n);var n;const r=new Go,i=yield WebAssembly.instantiate(e,r.importObject);r.run(i)}))}function J(){return n(this,void 0,void 0,(function*(){const e=yield t(0,new URL("mix_fetch_wasm_bg.wasm",import.meta.url),null,n);var n;yield K(e),console.log("Loaded RUST WASM"),yield Y(),console.log("Loaded GO WASM"),r.set_panic_hook(),function(){const e={send_client_data:v,start_new_mixnet_connection:E,mix_fetch_initialised:R,finish_mixnet_connection:T};self.__rs_go_bridge__=e}()}))}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_mixfetchdebug_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_remembermewasm_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_replysurbswasm_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_statsreportingwasm_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_topologywasm_free(e>>>0,1))),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry((e=>r.__wbg_trafficwasm_free(e>>>0,1))),(()=>{const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!globalThis.fs){let n="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1,O_DIRECTORY:-1},writeSync(e,r){n+=t.decode(r);const i=n.lastIndexOf("\n");return-1!=i&&(console.log(n.substring(0,i)),n=n.substring(i+1)),r.length},write(n,t,r,i,o,_){if(0!==r||i!==t.length||null!==o)return void _(e());_(null,this.writeSync(n,t))},chmod(n,t,r){r(e())},chown(n,t,r,i){i(e())},close(n,t){t(e())},fchmod(n,t,r){r(e())},fchown(n,t,r,i){i(e())},fstat(n,t){t(e())},fsync(e,n){n(null)},ftruncate(n,t,r){r(e())},lchown(n,t,r,i){i(e())},link(n,t,r){r(e())},lstat(n,t){t(e())},mkdir(n,t,r){r(e())},open(n,t,r,i){i(e())},read(n,t,r,i,o,_){_(e())},readdir(n,t){t(e())},readlink(n,t){t(e())},rename(n,t,r){r(e())},rmdir(n,t){t(e())},stat(n,t){t(e())},symlink(n,t,r){r(e())},truncate(n,t,r){r(e())},unlink(n,t){t(e())},utimes(n,t,r,i){i(e())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),globalThis.path||(globalThis.path={resolve(...e){return e.join("/")}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const n=new TextEncoder("utf-8"),t=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise((e=>{this._resolveExitPromise=e})),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,Math.floor(n/4294967296),!0)},r=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),i=e=>{const n=this.mem.getFloat64(e,!0);if(0===n)return;if(!isNaN(n))return n;const t=this.mem.getUint32(e,!0);return this._values[t]},o=(e,n)=>{const t=2146959360;if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,t,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let r=this._ids.get(n);void 0===r&&(r=this._idPool.pop(),void 0===r&&(r=this._values.length),this._values[r]=n,this._goRefCounts[r]=0,this._ids.set(n,r)),this._goRefCounts[r]++;let i=0;switch(typeof n){case"object":null!==n&&(i=1);break;case"string":i=2;break;case"symbol":i=3;break;case"function":i=4}this.mem.setUint32(e+4,t|i,!0),this.mem.setUint32(e,r,!0)},_=e=>{const n=r(e+0),t=r(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,t)},s=e=>{const n=r(e+0),t=r(e+8),o=new Array(t);for(let r=0;r<t;r++)o[r]=i(n+8*r);return o},c=e=>{const n=r(e+0),i=r(e+8);return t.decode(new DataView(this._inst.exports.mem.buffer,n,i))},a=Date.now()-performance.now();this.importObject={_gotest:{add:(e,n)=>e+n,callExport:(e,n)=>(this._inst.exports.testExport0(),this._inst.exports.testExport(e,n))},gojs:{"runtime.wasmExit":e=>{e>>>=0;const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const n=r((e>>>=0)+8),t=r(e+16),i=this.mem.getInt32(e+24,!0);fs.writeSync(n,new Uint8Array(this._inst.exports.mem.buffer,t,i))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e((n>>>=0)+8,1e6*(a+performance.now()))},"runtime.walltime":n=>{n>>>=0;const t=(new Date).getTime();e(n+8,t/1e3),this.mem.setInt32(n+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout((()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()}),r(e+8))),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(_(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o((e>>>=0)+24,c(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const n=Reflect.get(i(e+8),c(e+16));e=this._inst.exports.getsp()>>>0,o(e+32,n)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(i(e+8),c(e+16),i(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(i(e+8),c(e+16))},"syscall/js.valueIndex":e=>{o((e>>>=0)+24,Reflect.get(i(e+8),r(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(i(e+8),r(e+16),i(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const n=i(e+8),t=Reflect.get(n,c(e+16)),r=s(e+32),_=Reflect.apply(t,n,r);e=this._inst.exports.getsp()>>>0,o(e+56,_),this.mem.setUint8(e+64,1)}catch(n){e=this._inst.exports.getsp()>>>0,o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const n=i(e+8),t=s(e+16),r=Reflect.apply(n,void 0,t);e=this._inst.exports.getsp()>>>0,o(e+40,r),this.mem.setUint8(e+48,1)}catch(n){e=this._inst.exports.getsp()>>>0,o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const n=i(e+8),t=s(e+16),r=Reflect.construct(n,t);e=this._inst.exports.getsp()>>>0,o(e+40,r),this.mem.setUint8(e+48,1)}catch(n){e=this._inst.exports.getsp()>>>0,o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e((n>>>=0)+16,parseInt(i(n+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const r=n.encode(String(i(t+8)));o(t+16,r),e(t+24,r.length)},"syscall/js.valueLoadString":e=>{const n=i((e>>>=0)+8);_(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,i(e+8)instanceof i(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const t=_((n>>>=0)+8),r=i(n+32);if(!(r instanceof Uint8Array||r instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const o=r.subarray(0,t.length);t.set(o),e(n+40,o.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const t=i((n>>>=0)+8),r=_(n+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const o=r.subarray(0,t.length);t.set(o),e(n+40,o.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){if(!(e instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let t=4096;const r=e=>{const r=t,i=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,t,i.length).set(i),t+=i.length,t%8!=0&&(t+=8-t%8),r},i=this.argv.length,o=[];this.argv.forEach((e=>{o.push(r(e))})),o.push(0);Object.keys(this.env).sort().forEach((e=>{o.push(r(`${e}=${this.env[e]}`))})),o.push(0);const _=t;o.forEach((e=>{this.mem.setUint32(t,e,!0),this.mem.setUint32(t+4,0,!0),t+=8}));if(t>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,_),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const t={id:e,this:this,args:arguments};return n._pendingEvent=t,n._resume(),t.result}}}})();const X=Symbol("Comlink.proxy"),Q=Symbol("Comlink.endpoint"),Z=Symbol("Comlink.releaseProxy"),ee=Symbol("Comlink.finalizer"),ne=Symbol("Comlink.thrown"),te=e=>"object"==typeof e&&null!==e||"function"==typeof e,re={canHandle:e=>te(e)&&e[X],serialize(e){const{port1:n,port2:t}=new MessageChannel;return oe(e,n),[t,[t]]},deserialize(e){return e.start(),function(e,n){const t=new Map;return e.addEventListener("message",(function(e){const{data:n}=e;if(!n||!n.id)return;const r=t.get(n.id);if(r)try{r(n)}finally{t.delete(n.id)}})),fe(e,t,[],n)}(e)}},ie=new Map([["proxy",re],["throw",{canHandle:e=>te(e)&&ne in e,serialize({value:e}){let n;return n=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[n,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function oe(e,n=globalThis,t=["*"]){n.addEventListener("message",(function r(i){if(!i||!i.data)return;if(!function(e,n){for(const t of e){if(n===t||"*"===t)return!0;if(t instanceof RegExp&&t.test(n))return!0}return!1}(t,i.origin))return void console.warn(`Invalid origin '${i.origin}' for comlink proxy`);const{id:o,type:_,path:s}=Object.assign({path:[]},i.data),c=(i.data.argumentList||[]).map(we);let a;try{const n=s.slice(0,-1).reduce(((e,n)=>e[n]),e),t=s.reduce(((e,n)=>e[n]),e);switch(_){case"GET":a=t;break;case"SET":n[s.slice(-1)[0]]=we(i.data.value),a=!0;break;case"APPLY":a=t.apply(n,c);break;case"CONSTRUCT":a=function(e){return Object.assign(e,{[X]:!0})}(new t(...c));break;case"ENDPOINT":{const{port1:n,port2:t}=new MessageChannel;oe(e,t),a=function(e,n){return ge.set(e,n),e}(n,[n])}break;case"RELEASE":a=void 0;break;default:return}}catch(u){a={value:u,[ne]:0}}Promise.resolve(a).catch((e=>({value:e,[ne]:0}))).then((t=>{const[i,s]=le(t);n.postMessage(Object.assign(Object.assign({},i),{id:o}),s),"RELEASE"===_&&(n.removeEventListener("message",r),_e(n),ee in e&&"function"==typeof e[ee]&&e[ee]())})).catch((e=>{const[t,r]=le({value:new TypeError("Unserializable return value"),[ne]:0});n.postMessage(Object.assign(Object.assign({},t),{id:o}),r)}))})),n.start&&n.start()}function _e(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function se(e){if(e)throw new Error("Proxy has been released and is not useable")}function ce(e){return de(e,new Map,{type:"RELEASE"}).then((()=>{_e(e)}))}const ae=new WeakMap,ue="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const n=(ae.get(e)||0)-1;ae.set(e,n),0===n&&ce(e)}));function fe(e,n,t=[],r=function(){}){let i=!1;const o=new Proxy(r,{get(r,_){if(se(i),_===Z)return()=>{!function(e){ue&&ue.unregister(e)}(o),ce(e),n.clear(),i=!0};if("then"===_){if(0===t.length)return{then:()=>o};const r=de(e,n,{type:"GET",path:t.map((e=>e.toString()))}).then(we);return r.then.bind(r)}return fe(e,n,[...t,_])},set(r,o,_){se(i);const[s,c]=le(_);return de(e,n,{type:"SET",path:[...t,o].map((e=>e.toString())),value:s},c).then(we)},apply(r,o,_){se(i);const s=t[t.length-1];if(s===Q)return de(e,n,{type:"ENDPOINT"}).then(we);if("bind"===s)return fe(e,n,t.slice(0,-1));const[c,a]=be(_);return de(e,n,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:c},a).then(we)},construct(r,o){se(i);const[_,s]=be(o);return de(e,n,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:_},s).then(we)}});return function(e,n){const t=(ae.get(n)||0)+1;ae.set(n,t),ue&&ue.register(e,n,e)}(o,e),o}function be(e){const n=e.map(le);return[n.map((e=>e[0])),(t=n.map((e=>e[1])),Array.prototype.concat.apply([],t))];var t}const ge=new WeakMap;function le(e){for(const[n,t]of ie)if(t.canHandle(e)){const[r,i]=t.serialize(e);return[{type:"HANDLER",name:n,value:r},i]}return[{type:"RAW",value:e},ge.get(e)||[]]}function we(e){switch(e.type){case"HANDLER":return ie.get(e.name).deserialize(e.value);case"RAW":return e.value}}function de(e,n,t,r){return new Promise((i=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");n.set(o,i),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),r)}))}var me;!function(e){e.Loaded="Loaded"}(me||(me={}));const he={uint8array:["application/octet-stream"],json:["application/json","text/json",/application\/json.*/,/text\/json\+.*/],text:["text/plain",/text\/plain.*/,"text/html",/text\/html.*/],formData:["application/x-www-form-urlencoded","multipart/form-data"],blob:[/image\/.*/,/video\/.*/],fallback:"blob"},pe=(e,t)=>n(void 0,void 0,void 0,(function*(){switch(t){case"uint8array":return{uint8array:new Uint8Array(yield e.arrayBuffer())};case"json":case"text":return{text:yield e.text()};case"blob":{const n=yield e.blob();return{blobUrl:URL.createObjectURL(n)}}case"formData":{const n={},t=yield e.formData();for(const e of t.entries()){const[t,r]=e;n[t]=r}return{formData:n}}default:return{}}})),ye=(e,n)=>{if(!n)return!1;if(!e)return!1;for(let t=0;t<n.length;t+=1){const r=n[t];if("string"==typeof r&&e===r)return!0;if(r.test&&r.test(e))return!0}return!1},ve=(e,t)=>n(void 0,void 0,void 0,(function*(){const n=Object.assign(Object.assign({},he),t),r=(e=>{if(e)return e.headers.has("Content-Type")?e.headers.get("Content-Type"):e.headers.has("content-type")?e.headers.get("content-type"):void 0})(e);return r?ye(r,n.uint8array)?pe(e,"uint8array"):ye(r,n.json)?pe(e,"json"):ye(r,n.text)?pe(e,"text"):ye(r,n.formData)?pe(e,"formData"):ye(r,n.blob)?pe(e,"blob"):{}:e.body?pe(e,(null==t?void 0:t.fallback)||"blob"):{}})),xe=e=>self.postMessage(e);function Re(){return n(this,void 0,void 0,(function*(){const{mixFetch:e}=self;let t=he;oe({mixFetch:(r,i)=>n(this,void 0,void 0,(function*(){console.log("[Worker] --- mixFetch ---",{url:r,args:i});const n=yield e(r,i);console.log("[Worker]",{response:n,json:JSON.stringify(n,null,2)});const o=yield ve(n,t);console.log("[Worker]",{bodyResponse:o});const _={};n.headers.forEach(((e,n)=>{_[n]=e}));const s={body:o,url:n.url,headers:_,status:n.status,statusText:n.statusText,type:n.type,ok:n.ok,redirected:n.redirected};return console.log("[Worker]",{output:s}),s})),setupMixFetch:e=>n(this,void 0,void 0,(function*(){console.log("[Worker] --- setupMixFetch ---",{opts:e}),(null==e?void 0:e.responseBodyConfigMap)&&(t=e.responseBodyConfigMap),yield function(e){return r.setupMixFetch(e)}(e||{})})),disconnectMixFetch:()=>n(this,void 0,void 0,(function*(){console.log("[Worker] --- disconnectMixFetch ---"),yield r.disconnectMixFetch()}))}),xe({kind:me.Loaded,args:{loaded:!0}})}))}(function(){return n(this,void 0,void 0,(function*(){yield J(),yield Re()}))})().catch((e=>console.error("Unhandled exception in mixFetch worker",e)))}();
|
|
2
|
+
!function(){"use strict";var e="undefined"!=typeof document?document.currentScript:null;function n(e,n,t,r){return new(t||(t=Promise))(function(i,o){function _(e){try{c(r.next(e))}catch(n){o(n)}}function s(e){try{c(r.throw(e))}catch(n){o(n)}}function c(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(_,s)}c((r=r.apply(e,n||[])).next())})}function t(e,n,t,r){function i(e,n,t){var r=t?WebAssembly.instantiateStreaming:WebAssembly.instantiate,i=t?WebAssembly.compileStreaming:WebAssembly.compile;return n?r(e,n):i(e)}var o=null;if(n)return i(fetch(n),r,!0);var _=globalThis.atob(t),s=_.length;o=new Uint8Array(new ArrayBuffer(s));for(var c=0;c<s;c++)o[c]=_.charCodeAt(c);if(e){var a=new WebAssembly.Module(o);return r?new WebAssembly.Instance(a,r):a}return i(o,r,!1)}let r;"function"==typeof SuppressedError&&SuppressedError;let i=0,o=null;function _(){return null!==o&&0!==o.byteLength||(o=new Uint8Array(r.memory.buffer)),o}const s="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},c="function"==typeof s.encodeInto?function(e,n){return s.encodeInto(e,n)}:function(e,n){const t=s.encode(e);return n.set(t),{read:e.length,written:t.length}};function a(e,n,t){if(void 0===t){const t=s.encode(e),r=n(t.length,1)>>>0;return _().subarray(r,r+t.length).set(t),i=t.length,r}let r=e.length,o=n(r,1)>>>0;const a=_();let u=0;for(;u<r;u++){const n=e.charCodeAt(u);if(n>127)break;a[o+u]=n}if(u!==r){0!==u&&(e=e.slice(u)),o=t(o,r,r=u+3*e.length,1)>>>0;const n=_().subarray(o+u,o+r);u+=c(e,n).written,o=t(o,r,u,1)>>>0}return i=u,o}let u=null;function f(){return(null===u||!0===u.buffer.detached||void 0===u.buffer.detached&&u.buffer!==r.memory.buffer)&&(u=new DataView(r.memory.buffer)),u}function b(e){const n=r.__externref_table_alloc();return r.__wbindgen_export_4.set(n,e),n}function g(e,n){try{return e.apply(this,n)}catch(t){const e=b(t);r.__wbindgen_exn_store(e)}}const l="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};function w(e,n){return e>>>=0,l.decode(_().subarray(e,e+n))}function d(e){return null==e}function m(e,n){return e>>>=0,_().subarray(e/1,e/1+n)}"undefined"!=typeof TextDecoder&&l.decode();const h="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>{r.__wbindgen_export_6.get(e.dtor)(e.a,e.b)});function p(e,n,t,i){const o={a:e,b:n,cnt:1,dtor:t},_=(...e)=>{o.cnt++;const n=o.a;o.a=0;try{return i(n,o.b,...e)}finally{0===--o.cnt?(r.__wbindgen_export_6.get(o.dtor)(n,o.b),h.unregister(o)):o.a=n}};return _.original=o,h.register(_,o,o),_}function y(e){const n=typeof e;if("number"==n||"boolean"==n||null==e)return`${e}`;if("string"==n)return`"${e}"`;if("symbol"==n){const n=e.description;return null==n?"Symbol":`Symbol(${n})`}if("function"==n){const n=e.name;return"string"==typeof n&&n.length>0?`Function(${n})`:"Function"}if(Array.isArray(e)){const n=e.length;let t="[";n>0&&(t+=y(e[0]));for(let r=1;r<n;r++)t+=", "+y(e[r]);return t+="]",t}const t=/\[object ([^\]]+)\]/.exec(toString.call(e));let r;if(!(t&&t.length>1))return toString.call(e);if(r=t[1],"Object"==r)try{return"Object("+JSON.stringify(e)+")"}catch(i){return"Object"}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:r}function v(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i,s=function(e,n){const t=n(1*e.length,1)>>>0;return _().set(e,t/1),i=e.length,t}(n,r.__wbindgen_malloc),c=i;return r.send_client_data(t,o,s,c)}function x(e){const n=r.__wbindgen_export_4.get(e);return r.__externref_table_dealloc(e),n}function R(){const e=r.mix_fetch_initialised();if(e[2])throw x(e[1]);return 0!==e[0]}function E(e){const n=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),t=i;return r.start_new_mixnet_connection(n,t)}function T(e){const n=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),t=i;return r.finish_mixnet_connection(n,t)}function S(e,n,t){const i=r.closure743_externref_shim_multivalue_shim(e,n,t);if(i[1])throw x(i[0])}function j(e,n,t){r.closure830_externref_shim(e,n,t)}function I(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h061f9c2866052d32(e,n)}function F(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h67f1322bcb5f40b5(e,n)}function A(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb7fef82722851829(e,n)}function k(e,n,t){r.closure2203_externref_shim(e,n,t)}function O(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7ea245616776fb08(e,n)}function U(e,n){r._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h75596235482477c3(e,n)}function W(e,n,t){r.closure2326_externref_shim(e,n,t)}const C=["blob","arraybuffer"],D=["pending","done"],z=["readonly","readwrite","versionchange","readwriteflush","cleanup"],M=["default","no-store","reload","no-cache","force-cache","only-if-cached"],L=["omit","same-origin","include"],B=["same-origin","no-cors","cors","navigate"];"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_acknowledgementswasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_anonymoussendertag_free(e>>>0,1));const P="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>r.__wbg_clientstorage_free(e>>>0,1));class N{static __wrap(e){e>>>=0;const n=Object.create(N.prototype);return n.__wbg_ptr=e,P.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,P.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_clientstorage_free(e,0)}static new_unencrypted(e){const n=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),t=i;return r.clientstorage_new_unencrypted(n,t)}constructor(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i,_=a(n,r.__wbindgen_malloc,r.__wbindgen_realloc),s=i;return r.clientstorage_new(t,o,_,s)}static new_async(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;var _=d(n)?0:a(n,r.__wbindgen_malloc,r.__wbindgen_realloc),s=i;return r.clientstorage_new_async(t,o,_,s)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_covertrafficwasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_debugwasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_forgetmewasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_gatewayconnectionwasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_mixfetch_free(e>>>0,1));const q="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>r.__wbg_mixfetchclient_free(e>>>0,1));class G{static __wrap(e){e>>>=0;const n=Object.create(G.prototype);return n.__wbg_ptr=e,q.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,q.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_mixfetchclient_free(e,0)}disconnect(){return r.mixfetchclient_disconnect(this.__wbg_ptr)}self_address(){let e,n;try{const t=r.mixfetchclient_self_address(this.__wbg_ptr);return e=t[0],n=t[1],w(t[0],t[1])}finally{r.__wbindgen_free(e,n,1)}}constructor(e,n,t,o){!function(e,n){if(!(e instanceof n))throw new Error(`expected instance of ${n.name}`)}(e,$);var _=e.__destroy_into_raw(),s=d(t)?0:a(t,r.__wbindgen_malloc,r.__wbindgen_realloc),c=i,u=d(o)?0:a(o,r.__wbindgen_malloc,r.__wbindgen_realloc),f=i;return r.mixfetchclient_new(_,n,s,c,u,f)}active(){return 0!==r.mixfetchclient_active(this.__wbg_ptr)}}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_mixfetchclientbuilder_free(e>>>0,1));const V="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>r.__wbg_mixfetchconfig_free(e>>>0,1));class ${static __wrap(e){e>>>=0;const n=Object.create($.prototype);return n.__wbg_ptr=e,V.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),e}free(){const e=this.__destroy_into_raw();r.__wbg_mixfetchconfig_free(e,0)}with_mix_fetch_timeout(e){const n=this.__destroy_into_raw(),t=r.mixfetchconfig_with_mix_fetch_timeout(n,e);return $.__wrap(t)}constructor(e,n){const t=a(e,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i,_=r.mixfetchconfig_new(t,o,d(n)?0:b(n));if(_[2])throw x(_[1]);return this.__wbg_ptr=_[0]>>>0,V.register(this,this.__wbg_ptr,this),this}}function H(){const e={wbg:{}};return e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,n){const t=a(String(n),r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_String_eecc4a11987127d6=function(e,n){const t=a(String(n),r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_Window_41559019033ede94=function(e){return e.Window},e.wbg.__wbg_WorkerGlobalScope_d324bffbeaef9f3a=function(e){return e.WorkerGlobalScope},e.wbg.__wbg_abort_410ec47a64ac6117=function(e,n){e.abort(n)},e.wbg.__wbg_abort_775ef1d17fc65868=function(e){e.abort()},e.wbg.__wbg_abort_99fc644e2c79c9fb=function(){return g(function(e){e.abort()},arguments)},e.wbg.__wbg_addEventListener_84ae3eac6e15480a=function(){return g(function(e,n,t,r,i){e.addEventListener(w(n,t),r,i)},arguments)},e.wbg.__wbg_addEventListener_90e553fdce254421=function(){return g(function(e,n,t,r){e.addEventListener(w(n,t),r)},arguments)},e.wbg.__wbg_append_8c7dd8d641a5f01b=function(){return g(function(e,n,t,r,i){e.append(w(n,t),w(r,i))},arguments)},e.wbg.__wbg_arrayBuffer_d1b44c4390db422f=function(){return g(function(e){return e.arrayBuffer()},arguments)},e.wbg.__wbg_bound_f2afc3766d4545cf=function(){return g(function(e,n,t,r){return IDBKeyRange.bound(e,n,0!==t,0!==r)},arguments)},e.wbg.__wbg_buffer_609cc3eee51ed158=function(e){return e.buffer},e.wbg.__wbg_call_672a4d21634d4a24=function(){return g(function(e,n){return e.call(n)},arguments)},e.wbg.__wbg_call_7cccdd69e0791ae2=function(){return g(function(e,n,t){return e.call(n,t)},arguments)},e.wbg.__wbg_clearInterval_dd1e598f425db353=function(e){return clearInterval(e)},e.wbg.__wbg_clearTimeout_3b5c565a5ec539dd=function(e){return clearTimeout(e)},e.wbg.__wbg_clientstorage_new=function(e){return N.__wrap(e)},e.wbg.__wbg_close_2893b7d056a0627d=function(){return g(function(e){e.close()},arguments)},e.wbg.__wbg_code_f4ec1e6e2e1b0417=function(e){return e.code},e.wbg.__wbg_commit_a54edce65f3858f2=function(){return g(function(e){e.commit()},arguments)},e.wbg.__wbg_count_9dbedee4d2474ff8=function(){return g(function(e,n){return e.count(n)},arguments)},e.wbg.__wbg_createObjectStore_e566459f7161f82f=function(){return g(function(e,n,t){return e.createObjectStore(w(n,t))},arguments)},e.wbg.__wbg_crypto_574e78ad8b13b65f=function(e){return e.crypto},e.wbg.__wbg_data_432d9c3df2630942=function(e){return e.data},e.wbg.__wbg_dispatchEvent_9e259d7c1d603dfb=function(){return g(function(e,n){return e.dispatchEvent(n)},arguments)},e.wbg.__wbg_done_769e5ede4b31c67b=function(e){return e.done},e.wbg.__wbg_entries_2a52db465d0421fb=function(e){return e.entries()},e.wbg.__wbg_entries_3265d4158b33e5dc=function(e){return Object.entries(e)},e.wbg.__wbg_error_3cfd4be637595be7=function(e,n){console.error(w(e,n))},e.wbg.__wbg_error_e98c298703cffa97=function(e,n){console.error(w(e,n))},e.wbg.__wbg_error_ff4ddaabdfc5dbb3=function(){return g(function(e){const n=e.error;return d(n)?0:b(n)},arguments)},e.wbg.__wbg_fetch_16dcf1cfbbc66b3c=function(e){return fetch(e)},e.wbg.__wbg_fetch_509096533071c657=function(e,n){return e.fetch(n)},e.wbg.__wbg_from_2a5d3e218e67aa85=function(e){return Array.from(e)},e.wbg.__wbg_getAllKeys_b11d8835dc4be0e8=function(){return g(function(e){return e.getAllKeys()},arguments)},e.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return g(function(e,n){e.getRandomValues(n)},arguments)},e.wbg.__wbg_getTime_46267b1c24877e30=function(e){return e.getTime()},e.wbg.__wbg_get_67b2ba62fc30de12=function(){return g(function(e,n){return Reflect.get(e,n)},arguments)},e.wbg.__wbg_get_8da03f81f6a1111e=function(){return g(function(e,n){return e.get(n)},arguments)},e.wbg.__wbg_get_b9b93047fe3cf45b=function(e,n){return e[n>>>0]},e.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(e,n){return e[n]},e.wbg.__wbg_getwithrefkey_6550b2c093d2eb18=function(e,n){return e[n]},e.wbg.__wbg_global_f5c2926e57ba457f=function(e){return e.global},e.wbg.__wbg_goWasmCloseRemoteSocket_992b677524fcede8=function(e,n){let t,i;try{t=e,i=n,__go_rs_bridge__.goWasmCloseRemoteSocket(w(e,n))}finally{r.__wbindgen_free(t,i,1)}},e.wbg.__wbg_goWasmInjectConnError_b927894206725a9c=function(e,n,t,i){let o,_,s,c;try{o=e,_=n,s=t,c=i,__go_rs_bridge__.goWasmInjectConnError(w(e,n),w(t,i))}finally{r.__wbindgen_free(o,_,1),r.__wbindgen_free(s,c,1)}},e.wbg.__wbg_goWasmInjectServerData_40f1c53f7ca870d5=function(e,n,t,i){let o,_;try{o=e,_=n;var s=m(t,i).slice();r.__wbindgen_free(t,1*i,1),__go_rs_bridge__.goWasmInjectServerData(w(e,n),s)}finally{r.__wbindgen_free(o,_,1)}},e.wbg.__wbg_goWasmSetMixFetchRequestTimeout_74f591ac382a0775=function(e){__go_rs_bridge__.goWasmSetMixFetchRequestTimeout(e>>>0)},e.wbg.__wbg_has_a5ea9117f258a0ec=function(){return g(function(e,n){return Reflect.has(e,n)},arguments)},e.wbg.__wbg_headers_9cb51cfd2ac780a4=function(e){return e.headers},e.wbg.__wbg_indexedDB_54f01430b1e194e8=function(){return g(function(e){const n=e.indexedDB;return d(n)?0:b(n)},arguments)},e.wbg.__wbg_indexedDB_b1f49280282046f8=function(){return g(function(e){const n=e.indexedDB;return d(n)?0:b(n)},arguments)},e.wbg.__wbg_indexedDB_f6b47b0dc333fd2f=function(){return g(function(e){const n=e.indexedDB;return d(n)?0:b(n)},arguments)},e.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(e){let n;try{n=e instanceof ArrayBuffer}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_DomException_ed1ccb7aaf39034c=function(e){let n;try{n=e instanceof DOMException}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_Error_4d54113b22d20306=function(e){let n;try{n=e instanceof Error}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_IdbDatabase_a3ef009ca00059f9=function(e){let n;try{n=e instanceof IDBDatabase}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_IdbRequest_4813c3f207666aa4=function(e){let n;try{n=e instanceof IDBRequest}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_Response_f2cc20d9f7dfd644=function(e){let n;try{n=e instanceof Response}catch(t){n=!1}return n},e.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(e){let n;try{n=e instanceof Uint8Array}catch(t){n=!1}return n},e.wbg.__wbg_isArray_a1eab7e0d067391b=function(e){return Array.isArray(e)},e.wbg.__wbg_isSafeInteger_343e2beeeece1bb0=function(e){return Number.isSafeInteger(e)},e.wbg.__wbg_iterator_9a24c88df860dc65=function(){return Symbol.iterator},e.wbg.__wbg_length_a446193dc22c12f8=function(e){return e.length},e.wbg.__wbg_length_e2d2a49132c1b256=function(e){return e.length},e.wbg.__wbg_log_72cb694afa6a0fe7=function(e,n){console.log(w(e,n))},e.wbg.__wbg_lowerBound_1872d19f5bcf83c6=function(){return g(function(e,n){return IDBKeyRange.lowerBound(e,0!==n)},arguments)},e.wbg.__wbg_message_5c5d919204d42400=function(e,n){const t=a(n.message,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_message_97a2af9b89d693a3=function(e){return e.message},e.wbg.__wbg_mixfetchclient_new=function(e){return G.__wrap(e)},e.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(e){return e.msCrypto},e.wbg.__wbg_name_0b327d569f00ebee=function(e){return e.name},e.wbg.__wbg_name_f2d27098bfd843e7=function(e,n){const t=a(n.name,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_new0_f788a2397c7ca929=function(){return new Date},e.wbg.__wbg_new_018dcc2d6c8c2f6a=function(){return g(function(){return new Headers},arguments)},e.wbg.__wbg_new_23a2665fac83c611=function(e,n){try{var t={a:e,b:n};const i=new Promise((e,n)=>{const i=t.a;t.a=0;try{return function(e,n,t,i){r.closure2942_externref_shim(e,n,t,i)}(i,t.b,e,n)}finally{t.a=i}});return i}finally{t.a=t.b=0}},e.wbg.__wbg_new_405e22f390576ce2=function(){return new Object},e.wbg.__wbg_new_5e0be73521bc8c17=function(){return new Map},e.wbg.__wbg_new_78feb108b6472713=function(){return new Array},e.wbg.__wbg_new_92c54fc74574ef55=function(){return g(function(e,n){return new WebSocket(w(e,n))},arguments)},e.wbg.__wbg_new_a12002a7f91c75be=function(e){return new Uint8Array(e)},e.wbg.__wbg_new_c68d7209be747379=function(e,n){return new Error(w(e,n))},e.wbg.__wbg_new_e25e5aab09ff45db=function(){return g(function(){return new AbortController},arguments)},e.wbg.__wbg_newnoargs_105ed471475aaf50=function(e,n){return new Function(w(e,n))},e.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(e,n,t){return new Uint8Array(e,n>>>0,t>>>0)},e.wbg.__wbg_newwitheventinitdict_502dbfa1b3d2fcbc=function(){return g(function(e,n,t){return new CloseEvent(w(e,n),t)},arguments)},e.wbg.__wbg_newwithlength_a381634e90c276d4=function(e){return new Uint8Array(e>>>0)},e.wbg.__wbg_newwithstrandinit_06c535e0a867c635=function(){return g(function(e,n,t){return new Request(w(e,n),t)},arguments)},e.wbg.__wbg_next_25feadfc0913fea9=function(e){return e.next},e.wbg.__wbg_next_6574e1a8a62d1055=function(){return g(function(e){return e.next()},arguments)},e.wbg.__wbg_node_905d3e251edff8a2=function(e){return e.node},e.wbg.__wbg_now_e1163c67115ff874=function(e){return e.now()},e.wbg.__wbg_objectStore_21878d46d25b64b6=function(){return g(function(e,n,t){return e.objectStore(w(n,t))},arguments)},e.wbg.__wbg_oldVersion_e8337811e52861c6=function(e){return e.oldVersion},e.wbg.__wbg_open_e0c0b2993eb596e1=function(){return g(function(e,n,t,r){return e.open(w(n,t),r>>>0)},arguments)},e.wbg.__wbg_performance_7fe0928f3ab059e5=function(e){return e.performance},e.wbg.__wbg_postMessage_83a8d58d3fcb6c13=function(){return g(function(e,n){e.postMessage(n)},arguments)},e.wbg.__wbg_process_dc0fbacc7c1c06f7=function(e){return e.process},e.wbg.__wbg_put_066faa31a6a88f5b=function(){return g(function(e,n,t){return e.put(n,t)},arguments)},e.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5=function(e){queueMicrotask(e)},e.wbg.__wbg_queueMicrotask_d3219def82552485=function(e){return e.queueMicrotask},e.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return g(function(e,n){e.randomFillSync(n)},arguments)},e.wbg.__wbg_readyState_4013cfdf4f22afb0=function(e){const n=e.readyState;return(D.indexOf(n)+1||3)-1},e.wbg.__wbg_readyState_7ef6e63c349899ed=function(e){return e.readyState},e.wbg.__wbg_reason_49f1cede8bcf23dd=function(e,n){const t=a(n.reason,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_reject_b3fcf99063186ff7=function(e){return Promise.reject(e)},e.wbg.__wbg_removeEventListener_056dfe8c3d6c58f9=function(){return g(function(e,n,t,r){e.removeEventListener(w(n,t),r)},arguments)},e.wbg.__wbg_require_60cc747a6bc5215a=function(){return g(function(){return module.require},arguments)},e.wbg.__wbg_resolve_4851785c9c5f573d=function(e){return Promise.resolve(e)},e.wbg.__wbg_result_f29afabdf2c05826=function(){return g(function(e){return e.result},arguments)},e.wbg.__wbg_send_0293179ba074ffb4=function(){return g(function(e,n,t){e.send(w(n,t))},arguments)},e.wbg.__wbg_send_fc0c204e8a1757f4=function(){return g(function(e,n,t){e.send(m(n,t))},arguments)},e.wbg.__wbg_setInterval_ed3b5e3c3ebb8a6d=function(){return g(function(e,n){return setInterval(e,n)},arguments)},e.wbg.__wbg_setTimeout_42370cb3051b8c2c=function(){return g(function(e,n,t){return e.setTimeout(n,t)},arguments)},e.wbg.__wbg_setTimeout_8f06012fba12034e=function(e,n){globalThis.setTimeout(e,n)},e.wbg.__wbg_setTimeout_cb2a856ba8315e7a=function(e,n){return setTimeout(e,n)},e.wbg.__wbg_set_37837023f3d740e8=function(e,n,t){e[n>>>0]=t},e.wbg.__wbg_set_3f1d0b984ed272ed=function(e,n,t){e[n]=t},e.wbg.__wbg_set_65595bdd868b3009=function(e,n,t){e.set(n,t>>>0)},e.wbg.__wbg_set_8fc6bf8a5b1071d1=function(e,n,t){return e.set(n,t)},e.wbg.__wbg_setbinaryType_92fa1ffd873b327c=function(e,n){e.binaryType=C[n]},e.wbg.__wbg_setbody_5923b78a95eedf29=function(e,n){e.body=n},e.wbg.__wbg_setcache_12f17c3a980650e4=function(e,n){e.cache=M[n]},e.wbg.__wbg_setcode_156060465a2f8f79=function(e,n){e.code=n},e.wbg.__wbg_setcredentials_c3a22f1cd105a2c6=function(e,n){e.credentials=L[n]},e.wbg.__wbg_setheaders_834c0bdb6a8949ad=function(e,n){e.headers=n},e.wbg.__wbg_setmethod_3c5280fe5d890842=function(e,n,t){e.method=w(n,t)},e.wbg.__wbg_setmode_5dc300b865044b65=function(e,n){e.mode=B[n]},e.wbg.__wbg_setonabort_3bf4db6614fa98e9=function(e,n){e.onabort=n},e.wbg.__wbg_setonce_0cb80aea26303a35=function(e,n){e.once=0!==n},e.wbg.__wbg_setoncomplete_4d19df0dadb7c4d4=function(e,n){e.oncomplete=n},e.wbg.__wbg_setonerror_b0d9d723b8fddbbb=function(e,n){e.onerror=n},e.wbg.__wbg_setonerror_d7e3056cc6e56085=function(e,n){e.onerror=n},e.wbg.__wbg_setonsuccess_afa464ee777a396d=function(e,n){e.onsuccess=n},e.wbg.__wbg_setonupgradeneeded_fcf7ce4f2eb0cb5f=function(e,n){e.onupgradeneeded=n},e.wbg.__wbg_setreason_d29ac0402eeeb81a=function(e,n,t){e.reason=w(n,t)},e.wbg.__wbg_setsignal_75b21ef3a81de905=function(e,n){e.signal=n},e.wbg.__wbg_signal_aaf9ad74119f20a4=function(e){return e.signal},e.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07=function(){const e="undefined"==typeof global?null:global;return d(e)?0:b(e)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0=function(){const e="undefined"==typeof globalThis?null:globalThis;return d(e)?0:b(e)},e.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819=function(){const e="undefined"==typeof self?null:self;return d(e)?0:b(e)},e.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40=function(){const e="undefined"==typeof window?null:window;return d(e)?0:b(e)},e.wbg.__wbg_status_f6360336ca686bf0=function(e){return e.status},e.wbg.__wbg_subarray_aa9065fa9dc5df96=function(e,n,t){return e.subarray(n>>>0,t>>>0)},e.wbg.__wbg_target_0a62d9d79a2a1ede=function(e){const n=e.target;return d(n)?0:b(n)},e.wbg.__wbg_text_7805bea50de2af49=function(){return g(function(e){return e.text()},arguments)},e.wbg.__wbg_then_44b73946d2fb3e7d=function(e,n){return e.then(n)},e.wbg.__wbg_then_48b406749878a531=function(e,n,t){return e.then(n,t)},e.wbg.__wbg_toString_5285597960676b7b=function(e){return e.toString()},e.wbg.__wbg_toString_c813bbd34d063839=function(e){return e.toString()},e.wbg.__wbg_transaction_7d452475ef3c3c33=function(e){return e.transaction},e.wbg.__wbg_transaction_babc423936946a37=function(){return g(function(e,n,t,r){return e.transaction(w(n,t),z[r])},arguments)},e.wbg.__wbg_upperBound_76a00814e81f6891=function(){return g(function(e,n){return IDBKeyRange.upperBound(e,0!==n)},arguments)},e.wbg.__wbg_url_ae10c34ca209681d=function(e,n){const t=a(n.url,r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbg_value_cd1ffa7b1ab794f1=function(e){return e.value},e.wbg.__wbg_versions_c01dfd4722a88165=function(e){return e.versions},e.wbg.__wbg_warn_a2e6ac466681f75e=function(e,n){console.warn(w(e,n))},e.wbg.__wbg_wasClean_605b4fd66d44354a=function(e){return e.wasClean},e.wbg.__wbindgen_as_number=function(e){return+e},e.wbg.__wbindgen_bigint_from_i64=function(e){return e},e.wbg.__wbindgen_bigint_from_u64=function(e){return BigInt.asUintN(64,e)},e.wbg.__wbindgen_bigint_get_as_i64=function(e,n){const t="bigint"==typeof n?n:void 0;f().setBigInt64(e+8,d(t)?BigInt(0):t,!0),f().setInt32(e+0,!d(t),!0)},e.wbg.__wbindgen_boolean_get=function(e){return"boolean"==typeof e?e?1:0:2},e.wbg.__wbindgen_cb_drop=function(e){const n=e.original;if(1==n.cnt--)return n.a=0,!0;return!1},e.wbg.__wbindgen_closure_wrapper3948=function(e,n,t){return p(e,n,744,S)},e.wbg.__wbindgen_closure_wrapper4932=function(e,n,t){return p(e,n,831,j)},e.wbg.__wbindgen_closure_wrapper4933=function(e,n,t){return p(e,n,829,I)},e.wbg.__wbindgen_closure_wrapper5925=function(e,n,t){return p(e,n,1132,F)},e.wbg.__wbindgen_closure_wrapper8465=function(e,n,t){return p(e,n,1996,A)},e.wbg.__wbindgen_closure_wrapper9290=function(e,n,t){return p(e,n,2202,k)},e.wbg.__wbindgen_closure_wrapper9292=function(e,n,t){return p(e,n,2202,O)},e.wbg.__wbindgen_closure_wrapper9294=function(e,n,t){return p(e,n,2202,k)},e.wbg.__wbindgen_closure_wrapper9296=function(e,n,t){return p(e,n,2202,k)},e.wbg.__wbindgen_closure_wrapper9742=function(e,n,t){return p(e,n,2316,U)},e.wbg.__wbindgen_closure_wrapper9780=function(e,n,t){return p(e,n,2327,W)},e.wbg.__wbindgen_debug_string=function(e,n){const t=a(y(n),r.__wbindgen_malloc,r.__wbindgen_realloc),o=i;f().setInt32(e+4,o,!0),f().setInt32(e+0,t,!0)},e.wbg.__wbindgen_error_new=function(e,n){return new Error(w(e,n))},e.wbg.__wbindgen_in=function(e,n){return e in n},e.wbg.__wbindgen_init_externref_table=function(){const e=r.__wbindgen_export_4,n=e.grow(4);e.set(0,void 0),e.set(n+0,void 0),e.set(n+1,null),e.set(n+2,!0),e.set(n+3,!1)},e.wbg.__wbindgen_is_bigint=function(e){return"bigint"==typeof e},e.wbg.__wbindgen_is_function=function(e){return"function"==typeof e},e.wbg.__wbindgen_is_null=function(e){return null===e},e.wbg.__wbindgen_is_object=function(e){return"object"==typeof e&&null!==e},e.wbg.__wbindgen_is_string=function(e){return"string"==typeof e},e.wbg.__wbindgen_is_undefined=function(e){return void 0===e},e.wbg.__wbindgen_jsval_eq=function(e,n){return e===n},e.wbg.__wbindgen_jsval_loose_eq=function(e,n){return e==n},e.wbg.__wbindgen_memory=function(){return r.memory},e.wbg.__wbindgen_number_get=function(e,n){const t="number"==typeof n?n:void 0;f().setFloat64(e+8,d(t)?0:t,!0),f().setInt32(e+0,!d(t),!0)},e.wbg.__wbindgen_number_new=function(e){return e},e.wbg.__wbindgen_string_get=function(e,n){const t="string"==typeof n?n:void 0;var o=d(t)?0:a(t,r.__wbindgen_malloc,r.__wbindgen_realloc),_=i;f().setInt32(e+4,_,!0),f().setInt32(e+0,o,!0)},e.wbg.__wbindgen_string_new=function(e,n){return w(e,n)},e.wbg.__wbindgen_throw=function(e,n){throw new Error(w(e,n))},e}async function K(n){if(void 0!==r)return r;void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("mix_fetch_wasm_bg.wasm",e&&"SCRIPT"===e.tagName.toUpperCase()&&e.src||new URL("worker.js",document.baseURI).href));const t=H();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:i,module:_}=await async function(e,n){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,n)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const r=await e.arrayBuffer();return await WebAssembly.instantiate(r,n)}{const t=await WebAssembly.instantiate(e,n);return t instanceof WebAssembly.Instance?{instance:t,module:e}:t}}(await n,t);return function(e,n){return r=e.exports,K.__wbindgen_wasm_module=n,u=null,o=null,r.__wbindgen_start(),r}(i,_)}function Y(){return n(this,void 0,void 0,function*(){const e=yield t(0,new URL("go_conn.wasm",import.meta.url),null,n);var n;const r=new Go,i=yield WebAssembly.instantiate(e,r.importObject);r.run(i)})}function J(){return n(this,void 0,void 0,function*(){const e=yield t(0,new URL("mix_fetch_wasm_bg.wasm",import.meta.url),null,n);var n;yield K(e),console.log("Loaded RUST WASM"),yield Y(),console.log("Loaded GO WASM"),r.set_panic_hook(),function(){const e={send_client_data:v,start_new_mixnet_connection:E,mix_fetch_initialised:R,finish_mixnet_connection:T};self.__rs_go_bridge__=e}()})}"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_mixfetchdebug_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_remembermewasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_replysurbswasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_statsreportingwasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_topologywasm_free(e>>>0,1)),"undefined"==typeof FinalizationRegistry||new FinalizationRegistry(e=>r.__wbg_trafficwasm_free(e>>>0,1)),(()=>{const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!globalThis.fs){let n="";globalThis.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1,O_DIRECTORY:-1},writeSync(e,r){n+=t.decode(r);const i=n.lastIndexOf("\n");return-1!=i&&(console.log(n.substring(0,i)),n=n.substring(i+1)),r.length},write(n,t,r,i,o,_){if(0!==r||i!==t.length||null!==o)return void _(e());_(null,this.writeSync(n,t))},chmod(n,t,r){r(e())},chown(n,t,r,i){i(e())},close(n,t){t(e())},fchmod(n,t,r){r(e())},fchown(n,t,r,i){i(e())},fstat(n,t){t(e())},fsync(e,n){n(null)},ftruncate(n,t,r){r(e())},lchown(n,t,r,i){i(e())},link(n,t,r){r(e())},lstat(n,t){t(e())},mkdir(n,t,r){r(e())},open(n,t,r,i){i(e())},read(n,t,r,i,o,_){_(e())},readdir(n,t){t(e())},readlink(n,t){t(e())},rename(n,t,r){r(e())},rmdir(n,t){t(e())},stat(n,t){t(e())},symlink(n,t,r){r(e())},truncate(n,t,r){r(e())},unlink(n,t){t(e())},utimes(n,t,r,i){i(e())}}}if(globalThis.process||(globalThis.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),globalThis.path||(globalThis.path={resolve(...e){return e.join("/")}}),!globalThis.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!globalThis.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!globalThis.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!globalThis.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const n=new TextEncoder("utf-8"),t=new TextDecoder("utf-8");globalThis.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=e=>{0!==e&&console.warn("exit code:",e)},this._exitPromise=new Promise(e=>{this._resolveExitPromise=e}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=(e,n)=>{this.mem.setUint32(e+0,n,!0),this.mem.setUint32(e+4,Math.floor(n/4294967296),!0)},r=e=>this.mem.getUint32(e+0,!0)+4294967296*this.mem.getInt32(e+4,!0),i=e=>{const n=this.mem.getFloat64(e,!0);if(0===n)return;if(!isNaN(n))return n;const t=this.mem.getUint32(e,!0);return this._values[t]},o=(e,n)=>{const t=2146959360;if("number"==typeof n&&0!==n)return isNaN(n)?(this.mem.setUint32(e+4,t,!0),void this.mem.setUint32(e,0,!0)):void this.mem.setFloat64(e,n,!0);if(void 0===n)return void this.mem.setFloat64(e,0,!0);let r=this._ids.get(n);void 0===r&&(r=this._idPool.pop(),void 0===r&&(r=this._values.length),this._values[r]=n,this._goRefCounts[r]=0,this._ids.set(n,r)),this._goRefCounts[r]++;let i=0;switch(typeof n){case"object":null!==n&&(i=1);break;case"string":i=2;break;case"symbol":i=3;break;case"function":i=4}this.mem.setUint32(e+4,t|i,!0),this.mem.setUint32(e,r,!0)},_=e=>{const n=r(e+0),t=r(e+8);return new Uint8Array(this._inst.exports.mem.buffer,n,t)},s=e=>{const n=r(e+0),t=r(e+8),o=new Array(t);for(let r=0;r<t;r++)o[r]=i(n+8*r);return o},c=e=>{const n=r(e+0),i=r(e+8);return t.decode(new DataView(this._inst.exports.mem.buffer,n,i))},a=Date.now()-performance.now();this.importObject={_gotest:{add:(e,n)=>e+n,callExport:(e,n)=>(this._inst.exports.testExport0(),this._inst.exports.testExport(e,n))},gojs:{"runtime.wasmExit":e=>{e>>>=0;const n=this.mem.getInt32(e+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(n)},"runtime.wasmWrite":e=>{const n=r((e>>>=0)+8),t=r(e+16),i=this.mem.getInt32(e+24,!0);fs.writeSync(n,new Uint8Array(this._inst.exports.mem.buffer,t,i))},"runtime.resetMemoryDataView":e=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{e((n>>>=0)+8,1e6*(a+performance.now()))},"runtime.walltime":n=>{n>>>=0;const t=(new Date).getTime();e(n+8,t/1e3),this.mem.setInt32(n+16,t%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":e=>{e>>>=0;const n=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(n,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(n);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},r(e+8))),this.mem.setInt32(e+16,n,!0)},"runtime.clearTimeoutEvent":e=>{e>>>=0;const n=this.mem.getInt32(e+8,!0);clearTimeout(this._scheduledTimeouts.get(n)),this._scheduledTimeouts.delete(n)},"runtime.getRandomData":e=>{e>>>=0,crypto.getRandomValues(_(e+8))},"syscall/js.finalizeRef":e=>{e>>>=0;const n=this.mem.getUint32(e+8,!0);if(this._goRefCounts[n]--,0===this._goRefCounts[n]){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":e=>{o((e>>>=0)+24,c(e+8))},"syscall/js.valueGet":e=>{e>>>=0;const n=Reflect.get(i(e+8),c(e+16));e=this._inst.exports.getsp()>>>0,o(e+32,n)},"syscall/js.valueSet":e=>{e>>>=0,Reflect.set(i(e+8),c(e+16),i(e+32))},"syscall/js.valueDelete":e=>{e>>>=0,Reflect.deleteProperty(i(e+8),c(e+16))},"syscall/js.valueIndex":e=>{o((e>>>=0)+24,Reflect.get(i(e+8),r(e+16)))},"syscall/js.valueSetIndex":e=>{e>>>=0,Reflect.set(i(e+8),r(e+16),i(e+24))},"syscall/js.valueCall":e=>{e>>>=0;try{const n=i(e+8),t=Reflect.get(n,c(e+16)),r=s(e+32),_=Reflect.apply(t,n,r);e=this._inst.exports.getsp()>>>0,o(e+56,_),this.mem.setUint8(e+64,1)}catch(n){e=this._inst.exports.getsp()>>>0,o(e+56,n),this.mem.setUint8(e+64,0)}},"syscall/js.valueInvoke":e=>{e>>>=0;try{const n=i(e+8),t=s(e+16),r=Reflect.apply(n,void 0,t);e=this._inst.exports.getsp()>>>0,o(e+40,r),this.mem.setUint8(e+48,1)}catch(n){e=this._inst.exports.getsp()>>>0,o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueNew":e=>{e>>>=0;try{const n=i(e+8),t=s(e+16),r=Reflect.construct(n,t);e=this._inst.exports.getsp()>>>0,o(e+40,r),this.mem.setUint8(e+48,1)}catch(n){e=this._inst.exports.getsp()>>>0,o(e+40,n),this.mem.setUint8(e+48,0)}},"syscall/js.valueLength":n=>{e((n>>>=0)+16,parseInt(i(n+8).length))},"syscall/js.valuePrepareString":t=>{t>>>=0;const r=n.encode(String(i(t+8)));o(t+16,r),e(t+24,r.length)},"syscall/js.valueLoadString":e=>{const n=i((e>>>=0)+8);_(e+16).set(n)},"syscall/js.valueInstanceOf":e=>{e>>>=0,this.mem.setUint8(e+24,i(e+8)instanceof i(e+16)?1:0)},"syscall/js.copyBytesToGo":n=>{const t=_((n>>>=0)+8),r=i(n+32);if(!(r instanceof Uint8Array||r instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const o=r.subarray(0,t.length);t.set(o),e(n+40,o.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{const t=i((n>>>=0)+8),r=_(n+16);if(!(t instanceof Uint8Array||t instanceof Uint8ClampedArray))return void this.mem.setUint8(n+48,0);const o=r.subarray(0,t.length);t.set(o),e(n+40,o.length),this.mem.setUint8(n+48,1)},debug:e=>{console.log(e)}}}}async run(e){if(!(e instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=e,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,globalThis,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[globalThis,5],[this,6]]),this._idPool=[],this.exited=!1;let t=4096;const r=e=>{const r=t,i=n.encode(e+"\0");return new Uint8Array(this.mem.buffer,t,i.length).set(i),t+=i.length,t%8!=0&&(t+=8-t%8),r},i=this.argv.length,o=[];this.argv.forEach(e=>{o.push(r(e))}),o.push(0);Object.keys(this.env).sort().forEach(e=>{o.push(r(`${e}=${this.env[e]}`))}),o.push(0);const _=t;o.forEach(e=>{this.mem.setUint32(t,e,!0),this.mem.setUint32(t+4,0,!0),t+=8});if(t>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(i,_),this.exited&&this._resolveExitPromise(),await this._exitPromise}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(e){const n=this;return function(){const t={id:e,this:this,args:arguments};return n._pendingEvent=t,n._resume(),t.result}}}})();const X=Symbol("Comlink.proxy"),Q=Symbol("Comlink.endpoint"),Z=Symbol("Comlink.releaseProxy"),ee=Symbol("Comlink.finalizer"),ne=Symbol("Comlink.thrown"),te=e=>"object"==typeof e&&null!==e||"function"==typeof e,re={canHandle:e=>te(e)&&e[X],serialize(e){const{port1:n,port2:t}=new MessageChannel;return oe(e,n),[t,[t]]},deserialize(e){return e.start(),function(e,n){const t=new Map;return e.addEventListener("message",function(e){const{data:n}=e;if(!n||!n.id)return;const r=t.get(n.id);if(r)try{r(n)}finally{t.delete(n.id)}}),fe(e,t,[],n)}(e)}},ie=new Map([["proxy",re],["throw",{canHandle:e=>te(e)&&ne in e,serialize({value:e}){let n;return n=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[n,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function oe(e,n=globalThis,t=["*"]){n.addEventListener("message",function r(i){if(!i||!i.data)return;if(!function(e,n){for(const t of e){if(n===t||"*"===t)return!0;if(t instanceof RegExp&&t.test(n))return!0}return!1}(t,i.origin))return void console.warn(`Invalid origin '${i.origin}' for comlink proxy`);const{id:o,type:_,path:s}=Object.assign({path:[]},i.data),c=(i.data.argumentList||[]).map(we);let a;try{const n=s.slice(0,-1).reduce((e,n)=>e[n],e),t=s.reduce((e,n)=>e[n],e);switch(_){case"GET":a=t;break;case"SET":n[s.slice(-1)[0]]=we(i.data.value),a=!0;break;case"APPLY":a=t.apply(n,c);break;case"CONSTRUCT":a=function(e){return Object.assign(e,{[X]:!0})}(new t(...c));break;case"ENDPOINT":{const{port1:n,port2:t}=new MessageChannel;oe(e,t),a=function(e,n){return ge.set(e,n),e}(n,[n])}break;case"RELEASE":a=void 0;break;default:return}}catch(u){a={value:u,[ne]:0}}Promise.resolve(a).catch(e=>({value:e,[ne]:0})).then(t=>{const[i,s]=le(t);n.postMessage(Object.assign(Object.assign({},i),{id:o}),s),"RELEASE"===_&&(n.removeEventListener("message",r),_e(n),ee in e&&"function"==typeof e[ee]&&e[ee]())}).catch(e=>{const[t,r]=le({value:new TypeError("Unserializable return value"),[ne]:0});n.postMessage(Object.assign(Object.assign({},t),{id:o}),r)})}),n.start&&n.start()}function _e(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function se(e){if(e)throw new Error("Proxy has been released and is not useable")}function ce(e){return de(e,new Map,{type:"RELEASE"}).then(()=>{_e(e)})}const ae=new WeakMap,ue="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const n=(ae.get(e)||0)-1;ae.set(e,n),0===n&&ce(e)});function fe(e,n,t=[],r=function(){}){let i=!1;const o=new Proxy(r,{get(r,_){if(se(i),_===Z)return()=>{!function(e){ue&&ue.unregister(e)}(o),ce(e),n.clear(),i=!0};if("then"===_){if(0===t.length)return{then:()=>o};const r=de(e,n,{type:"GET",path:t.map(e=>e.toString())}).then(we);return r.then.bind(r)}return fe(e,n,[...t,_])},set(r,o,_){se(i);const[s,c]=le(_);return de(e,n,{type:"SET",path:[...t,o].map(e=>e.toString()),value:s},c).then(we)},apply(r,o,_){se(i);const s=t[t.length-1];if(s===Q)return de(e,n,{type:"ENDPOINT"}).then(we);if("bind"===s)return fe(e,n,t.slice(0,-1));const[c,a]=be(_);return de(e,n,{type:"APPLY",path:t.map(e=>e.toString()),argumentList:c},a).then(we)},construct(r,o){se(i);const[_,s]=be(o);return de(e,n,{type:"CONSTRUCT",path:t.map(e=>e.toString()),argumentList:_},s).then(we)}});return function(e,n){const t=(ae.get(n)||0)+1;ae.set(n,t),ue&&ue.register(e,n,e)}(o,e),o}function be(e){const n=e.map(le);return[n.map(e=>e[0]),(t=n.map(e=>e[1]),Array.prototype.concat.apply([],t))];var t}const ge=new WeakMap;function le(e){for(const[n,t]of ie)if(t.canHandle(e)){const[r,i]=t.serialize(e);return[{type:"HANDLER",name:n,value:r},i]}return[{type:"RAW",value:e},ge.get(e)||[]]}function we(e){switch(e.type){case"HANDLER":return ie.get(e.name).deserialize(e.value);case"RAW":return e.value}}function de(e,n,t,r){return new Promise(i=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");n.set(o,i),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),r)})}var me;!function(e){e.Loaded="Loaded"}(me||(me={}));const he={uint8array:["application/octet-stream"],json:["application/json","text/json",/application\/json.*/,/text\/json\+.*/],text:["text/plain",/text\/plain.*/,"text/html",/text\/html.*/],formData:["application/x-www-form-urlencoded","multipart/form-data"],blob:[/image\/.*/,/video\/.*/],fallback:"blob"},pe=(e,t)=>n(void 0,void 0,void 0,function*(){switch(t){case"uint8array":return{uint8array:new Uint8Array(yield e.arrayBuffer())};case"json":case"text":return{text:yield e.text()};case"blob":{const n=yield e.blob();return{blobUrl:URL.createObjectURL(n)}}case"formData":{const n={},t=yield e.formData();for(const e of t.entries()){const[t,r]=e;n[t]=r}return{formData:n}}default:return{}}}),ye=(e,n)=>{if(!n)return!1;if(!e)return!1;for(let t=0;t<n.length;t+=1){const r=n[t];if("string"==typeof r&&e===r)return!0;if(r.test&&r.test(e))return!0}return!1};function ve(){return n(this,void 0,void 0,function*(){const{mixFetch:e}=self;let t=he;var i;oe({mixFetch:(r,i)=>n(this,void 0,void 0,function*(){console.log("[Worker] --- mixFetch ---",{url:r,args:i});const o=yield e(r,i);console.log("[Worker]",{response:o,json:JSON.stringify(o,null,2)});const _=yield((e,t)=>n(void 0,void 0,void 0,function*(){const n=Object.assign(Object.assign({},he),t),r=(e=>{if(e)return e.headers.has("Content-Type")?e.headers.get("Content-Type"):e.headers.has("content-type")?e.headers.get("content-type"):void 0})(e);return r?ye(r,n.uint8array)?pe(e,"uint8array"):ye(r,n.json)?pe(e,"json"):ye(r,n.text)?pe(e,"text"):ye(r,n.formData)?pe(e,"formData"):ye(r,n.blob)?pe(e,"blob"):{}:e.body?pe(e,(null==t?void 0:t.fallback)||"blob"):{}}))(o,t);console.log("[Worker]",{bodyResponse:_});const s={};o.headers.forEach((e,n)=>{s[n]=e});const c={body:_,url:o.url,headers:s,status:o.status,statusText:o.statusText,type:o.type,ok:o.ok,redirected:o.redirected};return console.log("[Worker]",{output:c}),c}),setupMixFetch:e=>n(this,void 0,void 0,function*(){console.log("[Worker] --- setupMixFetch ---",{opts:e}),(null==e?void 0:e.responseBodyConfigMap)&&(t=e.responseBodyConfigMap),yield function(e){return r.setupMixFetch(e)}(e||{})}),disconnectMixFetch:()=>n(this,void 0,void 0,function*(){console.log("[Worker] --- disconnectMixFetch ---"),yield r.disconnectMixFetch()})}),i={kind:me.Loaded,args:{loaded:!0}},self.postMessage(i)})}(function(){return n(this,void 0,void 0,function*(){yield J(),yield ve()})})().catch(e=>console.error("Unhandled exception in mixFetch worker",e))}();
|
|
@@ -26,10 +26,12 @@ import { AccountSync, fixUsername } from '../../client-side'
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
import { makeEdgeResult } from '../../util/edgeResult'
|
|
32
33
|
import { base58 } from '../../util/encoding'
|
|
34
|
+
import { saveWalletSettings } from '../currency/wallet/currency-wallet-files'
|
|
33
35
|
import { getPublicWalletInfo } from '../currency/wallet/currency-wallet-pixie'
|
|
34
36
|
import {
|
|
35
37
|
finishWalletCreation,
|
|
@@ -55,13 +57,14 @@ import {
|
|
|
55
57
|
import { changePin, checkPin2, deletePin } from '../login/pin2'
|
|
56
58
|
import { changeRecovery, deleteRecovery } from '../login/recovery2'
|
|
57
59
|
import { listSplittableWalletTypes, splitWalletInfo } from '../login/splitting'
|
|
60
|
+
import { asEdgeStorageKeys } from '../login/storage-keys'
|
|
58
61
|
import { changeVoucherStatus } from '../login/vouchers'
|
|
59
62
|
import {
|
|
60
63
|
findCurrencyPluginId,
|
|
61
64
|
getCurrencyTools
|
|
62
65
|
} from '../plugins/plugins-selectors'
|
|
63
66
|
|
|
64
|
-
import { makeLocalDisklet } from '../storage/repo'
|
|
67
|
+
import { makeLocalDisklet, makeRepoPaths } from '../storage/repo'
|
|
65
68
|
import { makeStorageWalletApi } from '../storage/storage-api'
|
|
66
69
|
import { fetchSwapQuotes } from '../swap/swap-api'
|
|
67
70
|
import { changeWalletStates } from './account-files'
|
|
@@ -72,6 +75,26 @@ import { makeLobbyApi } from './lobby-api'
|
|
|
72
75
|
import { makeMemoryWalletInner } from './memory-wallet'
|
|
73
76
|
import { CurrencyConfig, SwapConfig } from './plugin-api'
|
|
74
77
|
|
|
78
|
+
async function prewriteWalletSettings(
|
|
79
|
+
ai,
|
|
80
|
+
walletInfo,
|
|
81
|
+
walletSettings
|
|
82
|
+
) {
|
|
83
|
+
// Only persist settings for currencies that actually support them. Otherwise
|
|
84
|
+
// the data would be written to disk but never loaded or exposed, since the
|
|
85
|
+
// wallet layer reads settings only when `currencyInfo.hasWalletSettings`:
|
|
86
|
+
const { currency } = ai.props.state.plugins
|
|
87
|
+
const pluginId = findCurrencyPluginId(currency, walletInfo.type)
|
|
88
|
+
const { hasWalletSettings = false } = currency[pluginId].currencyInfo
|
|
89
|
+
if (!hasWalletSettings) return
|
|
90
|
+
|
|
91
|
+
const { io } = ai.props
|
|
92
|
+
const storageKeys = asEdgeStorageKeys(walletInfo.keys)
|
|
93
|
+
const { disklet } = makeRepoPaths(io, storageKeys)
|
|
94
|
+
|
|
95
|
+
await saveWalletSettings(disklet, walletSettings)
|
|
96
|
+
}
|
|
97
|
+
|
|
75
98
|
/**
|
|
76
99
|
* Creates an unwrapped account API object around an account state object.
|
|
77
100
|
*/
|
|
@@ -642,6 +665,9 @@ export function makeAccountApi(ai, accountId) {
|
|
|
642
665
|
ai.props.log.breadcrumb('EdgeAccount.createCurrencyWallet', {})
|
|
643
666
|
|
|
644
667
|
const walletInfo = await makeCurrencyWalletKeys(ai, walletType, opts)
|
|
668
|
+
if (opts.walletSettings != null) {
|
|
669
|
+
await prewriteWalletSettings(ai, walletInfo, opts.walletSettings)
|
|
670
|
+
}
|
|
645
671
|
const childKey = decryptChildKey(stashTree, sessionKey, login.loginId)
|
|
646
672
|
await applyKit(ai, sessionKey, makeKeysKit(ai, childKey, [walletInfo]))
|
|
647
673
|
return await finishWalletCreation(ai, accountId, walletInfo.id, opts)
|
|
@@ -674,6 +700,14 @@ export function makeAccountApi(ai, accountId) {
|
|
|
674
700
|
)
|
|
675
701
|
)
|
|
676
702
|
|
|
703
|
+
// Prewrite wallet settings before applyKit triggers the pixie:
|
|
704
|
+
for (let i = 0; i < walletInfos.length; i++) {
|
|
705
|
+
const { walletSettings } = createWallets[i]
|
|
706
|
+
if (walletSettings != null) {
|
|
707
|
+
await prewriteWalletSettings(ai, walletInfos[i], walletSettings)
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
|
|
677
711
|
// Store the keys on the server:
|
|
678
712
|
const childKey = decryptChildKey(stashTree, sessionKey, login.loginId)
|
|
679
713
|
await applyKit(ai, sessionKey, makeKeysKit(ai, childKey, walletInfos))
|
|
@@ -28,7 +28,7 @@ export const makeMemoryWalletInner = async (
|
|
|
28
28
|
walletType,
|
|
29
29
|
opts = {}
|
|
30
30
|
) => {
|
|
31
|
-
const { keys } = opts
|
|
31
|
+
const { keys, walletSettings = {} } = opts
|
|
32
32
|
if (keys == null) throw new Error('No keys provided')
|
|
33
33
|
|
|
34
34
|
const walletId = `memorywallet-${memoryWalletCount++}`
|
|
@@ -113,6 +113,7 @@ export const makeMemoryWalletInner = async (
|
|
|
113
113
|
lightMode: true,
|
|
114
114
|
log,
|
|
115
115
|
userSettings: { ...(_nullishCoalesce(config.userSettings, () => ( {}))) },
|
|
116
|
+
walletSettings,
|
|
116
117
|
walletLocalDisklet: makeMemoryDisklet(),
|
|
117
118
|
walletLocalEncryptedDisklet: makeMemoryDisklet()
|
|
118
119
|
})
|
package/lib/core/actions.js
CHANGED
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
+
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
import { makeMetaTokens } from '../../account/custom-tokens'
|
|
@@ -63,6 +64,7 @@ import {
|
|
|
63
64
|
loadTxFiles,
|
|
64
65
|
renameCurrencyWallet,
|
|
65
66
|
saveTxMetadataFile,
|
|
67
|
+
saveWalletSettingsFile,
|
|
66
68
|
setCurrencyWalletFiat,
|
|
67
69
|
setupNewTxMetadata,
|
|
68
70
|
updateCurrencyWalletTxMetadata
|
|
@@ -135,6 +137,9 @@ export function makeCurrencyWalletApi(
|
|
|
135
137
|
get id() {
|
|
136
138
|
return storageWalletApi.id
|
|
137
139
|
},
|
|
140
|
+
get imported() {
|
|
141
|
+
return walletInfo.imported === true
|
|
142
|
+
},
|
|
138
143
|
get localDisklet() {
|
|
139
144
|
return storageWalletApi.localDisklet
|
|
140
145
|
},
|
|
@@ -193,6 +198,17 @@ export function makeCurrencyWalletApi(
|
|
|
193
198
|
return div(nativeAmount, multiplier, multiplier.length)
|
|
194
199
|
},
|
|
195
200
|
|
|
201
|
+
// User settings for this wallet:
|
|
202
|
+
get walletSettings() {
|
|
203
|
+
return input.props.walletState.walletSettings
|
|
204
|
+
},
|
|
205
|
+
async changeWalletSettings(settings) {
|
|
206
|
+
if (input.props.walletState.currencyInfo.hasWalletSettings !== true) {
|
|
207
|
+
throw new Error('Wallet settings unsupported')
|
|
208
|
+
}
|
|
209
|
+
await saveWalletSettingsFile(input, settings)
|
|
210
|
+
},
|
|
211
|
+
|
|
196
212
|
// Chain state:
|
|
197
213
|
get balances() {
|
|
198
214
|
return input.props.walletState.balances
|
|
@@ -308,6 +308,10 @@ export const asTokensFile = asObject({
|
|
|
308
308
|
detectedTokenIds: asArray(asString)
|
|
309
309
|
})
|
|
310
310
|
|
|
311
|
+
export const asWalletSettingsFile = asObject({
|
|
312
|
+
walletSettings: asOptional(asJsonObject, () => ({}))
|
|
313
|
+
})
|
|
314
|
+
|
|
311
315
|
const asTransactionAsset = asObject({
|
|
312
316
|
assetAction: asOptional(asEdgeAssetAction),
|
|
313
317
|
metadata: asEdgeMetadata,
|
|
@@ -10,6 +10,7 @@ import { justFiles, navigateDisklet } from 'disklet'
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
|
|
13
14
|
import { makeJsonFile } from '../../../util/file-helpers'
|
|
14
15
|
import { fetchAppIdInfo } from '../../account/lobby-api'
|
|
15
16
|
import { toApiInput } from '../../root-pixie'
|
|
@@ -30,6 +31,7 @@ import {
|
|
|
30
31
|
asTransactionFile,
|
|
31
32
|
asWalletFiatFile,
|
|
32
33
|
asWalletNameFile,
|
|
34
|
+
asWalletSettingsFile,
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
|
|
@@ -45,6 +47,7 @@ const LEGACY_TOKENS_FILE = 'EnabledTokens.json'
|
|
|
45
47
|
const SEEN_TX_CHECKPOINT_FILE = 'seenTxCheckpoint.json'
|
|
46
48
|
const TOKENS_FILE = 'Tokens.json'
|
|
47
49
|
const WALLET_NAME_FILE = 'WalletName.json'
|
|
50
|
+
const WALLET_SETTINGS_FILE = 'WalletSettings.json'
|
|
48
51
|
|
|
49
52
|
const legacyAddressFile = makeJsonFile(asLegacyAddressFile)
|
|
50
53
|
const legacyMapFile = makeJsonFile(asLegacyMapFile)
|
|
@@ -55,6 +58,7 @@ const tokensFile = makeJsonFile(asTokensFile)
|
|
|
55
58
|
const transactionFile = makeJsonFile(asTransactionFile)
|
|
56
59
|
const walletFiatFile = makeJsonFile(asWalletFiatFile)
|
|
57
60
|
const walletNameFile = makeJsonFile(asWalletNameFile)
|
|
61
|
+
const walletSettingsFile = makeJsonFile(asWalletSettingsFile)
|
|
58
62
|
|
|
59
63
|
/**
|
|
60
64
|
* Updates the enabled tokens on a wallet.
|
|
@@ -284,6 +288,52 @@ export async function loadTokensFile(
|
|
|
284
288
|
})
|
|
285
289
|
}
|
|
286
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Loads wallet-specific settings.
|
|
293
|
+
*/
|
|
294
|
+
export async function loadWalletSettingsFile(
|
|
295
|
+
input
|
|
296
|
+
) {
|
|
297
|
+
const { dispatch, state, walletId } = input.props
|
|
298
|
+
const disklet = getStorageWalletDisklet(state, walletId)
|
|
299
|
+
|
|
300
|
+
const clean = await walletSettingsFile.load(disklet, WALLET_SETTINGS_FILE)
|
|
301
|
+
dispatch({
|
|
302
|
+
type: 'CURRENCY_WALLET_LOADED_WALLET_SETTINGS_FILE',
|
|
303
|
+
payload: {
|
|
304
|
+
walletId,
|
|
305
|
+
walletSettings: _nullishCoalesce(_optionalChain([clean, 'optionalAccess', _ => _.walletSettings]), () => ( {}))
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Persists wallet settings to disk.
|
|
312
|
+
*/
|
|
313
|
+
export async function saveWalletSettingsFile(
|
|
314
|
+
input,
|
|
315
|
+
walletSettings
|
|
316
|
+
) {
|
|
317
|
+
const { dispatch, state, walletId } = input.props
|
|
318
|
+
const disklet = getStorageWalletDisklet(state, walletId)
|
|
319
|
+
|
|
320
|
+
await saveWalletSettings(disklet, walletSettings)
|
|
321
|
+
|
|
322
|
+
dispatch({
|
|
323
|
+
type: 'CURRENCY_WALLET_CHANGED_WALLET_SETTINGS',
|
|
324
|
+
payload: { walletId, walletSettings }
|
|
325
|
+
})
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export async function saveWalletSettings(
|
|
329
|
+
disklet,
|
|
330
|
+
walletSettings
|
|
331
|
+
) {
|
|
332
|
+
await walletSettingsFile.save(disklet, WALLET_SETTINGS_FILE, {
|
|
333
|
+
walletSettings
|
|
334
|
+
})
|
|
335
|
+
}
|
|
336
|
+
|
|
287
337
|
/**
|
|
288
338
|
* Loads transaction metadata files.
|
|
289
339
|
*/
|
|
@@ -437,7 +487,7 @@ export async function loadAddressFiles(
|
|
|
437
487
|
)
|
|
438
488
|
|
|
439
489
|
// Load these addresses into the engine:
|
|
440
|
-
const engine = _optionalChain([input, 'access',
|
|
490
|
+
const engine = _optionalChain([input, 'access', _2 => _2.props, 'access', _3 => _3.walletOutput, 'optionalAccess', _4 => _4.engine])
|
|
441
491
|
if (engine != null) await engine.addGapLimitAddresses(out)
|
|
442
492
|
}
|
|
443
493
|
|
|
@@ -482,9 +532,9 @@ export async function updateCurrencyWalletTxMetadata(
|
|
|
482
532
|
const newFile = {
|
|
483
533
|
...oldFile,
|
|
484
534
|
creationDate,
|
|
485
|
-
currencies: new Map(_nullishCoalesce(_optionalChain([oldFile, 'optionalAccess',
|
|
535
|
+
currencies: new Map(_nullishCoalesce(_optionalChain([oldFile, 'optionalAccess', _5 => _5.currencies]), () => ( []))),
|
|
486
536
|
internal: true,
|
|
487
|
-
tokens: new Map(_nullishCoalesce(_optionalChain([oldFile, 'optionalAccess',
|
|
537
|
+
tokens: new Map(_nullishCoalesce(_optionalChain([oldFile, 'optionalAccess', _6 => _6.tokens]), () => ( []))),
|
|
488
538
|
txid
|
|
489
539
|
}
|
|
490
540
|
|
|
@@ -697,6 +747,10 @@ export async function reloadWalletFiles(
|
|
|
697
747
|
if (changes.includes(TOKENS_FILE) || changes.includes(LEGACY_TOKENS_FILE)) {
|
|
698
748
|
await loadTokensFile(input)
|
|
699
749
|
}
|
|
750
|
+
const { hasWalletSettings = false } = input.props.walletState.currencyInfo
|
|
751
|
+
if (hasWalletSettings && changes.includes(WALLET_SETTINGS_FILE)) {
|
|
752
|
+
await loadWalletSettingsFile(input)
|
|
753
|
+
}
|
|
700
754
|
if (changes.includes(CURRENCY_FILE)) {
|
|
701
755
|
await loadFiatFile(input)
|
|
702
756
|
}
|