motely-wasm 1.2.13 → 2.2.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/README.md +23 -0
- package/_framework/Motely.5vhxk92wwy.wasm +0 -0
- package/_framework/Motely.5vhxk92wwy.wasm.br +0 -0
- package/_framework/Motely.5vhxk92wwy.wasm.gz +0 -0
- package/_framework/Motely.BrowserWasm.27cet3zkwp.wasm +0 -0
- package/_framework/Motely.BrowserWasm.27cet3zkwp.wasm.br +0 -0
- package/_framework/Motely.BrowserWasm.27cet3zkwp.wasm.gz +0 -0
- package/_framework/System.Collections.0dg6m9s6vr.wasm +0 -0
- package/_framework/System.Collections.0dg6m9s6vr.wasm.gz +0 -0
- package/_framework/System.Collections.Concurrent.n17cmogn7m.wasm +0 -0
- package/_framework/System.Collections.Concurrent.n17cmogn7m.wasm.gz +0 -0
- package/_framework/System.ComponentModel.Primitives.fjv77ljto2.wasm +0 -0
- package/_framework/System.ComponentModel.Primitives.fjv77ljto2.wasm.gz +0 -0
- package/_framework/System.Console.a5h4vm85mj.wasm +0 -0
- package/_framework/System.Console.a5h4vm85mj.wasm.br +0 -0
- package/_framework/System.Console.a5h4vm85mj.wasm.gz +0 -0
- package/_framework/System.IO.Pipelines.dvb53mk2zg.wasm +0 -0
- package/_framework/System.IO.Pipelines.dvb53mk2zg.wasm.gz +0 -0
- package/_framework/System.Linq.x3bjseuxl8.wasm +0 -0
- package/_framework/System.Linq.x3bjseuxl8.wasm.br +0 -0
- package/_framework/System.Linq.x3bjseuxl8.wasm.gz +0 -0
- package/_framework/System.Memory.eh4au0brlj.wasm +0 -0
- package/_framework/System.Memory.eh4au0brlj.wasm.gz +0 -0
- package/_framework/System.ObjectModel.8ksm30ll2f.wasm +0 -0
- package/_framework/System.ObjectModel.8ksm30ll2f.wasm.gz +0 -0
- package/_framework/System.Private.CoreLib.vgf7cxstoh.wasm +0 -0
- package/_framework/System.Private.CoreLib.vgf7cxstoh.wasm.br +0 -0
- package/_framework/System.Private.CoreLib.vgf7cxstoh.wasm.gz +0 -0
- package/_framework/System.Private.Uri.litlccc5xj.wasm +0 -0
- package/_framework/System.Private.Uri.litlccc5xj.wasm.gz +0 -0
- package/_framework/System.Runtime.InteropServices.JavaScript.r77pc0xoes.wasm +0 -0
- package/_framework/System.Runtime.InteropServices.JavaScript.r77pc0xoes.wasm.br +0 -0
- package/_framework/System.Runtime.InteropServices.JavaScript.r77pc0xoes.wasm.gz +0 -0
- package/_framework/System.Text.Encodings.Web.ha1lyoz09i.wasm +0 -0
- package/_framework/System.Text.Encodings.Web.ha1lyoz09i.wasm.gz +0 -0
- package/_framework/System.Text.Json.ad1y3qs7i4.wasm +0 -0
- package/_framework/System.Text.Json.ad1y3qs7i4.wasm.gz +0 -0
- package/_framework/System.Text.RegularExpressions.n5mf3b24ec.wasm +0 -0
- package/_framework/System.Text.RegularExpressions.n5mf3b24ec.wasm.gz +0 -0
- package/_framework/System.Threading.Channels.x0wzjodomg.wasm +0 -0
- package/_framework/System.Threading.Channels.x0wzjodomg.wasm.gz +0 -0
- package/_framework/System.Threading.eajjzgfxty.wasm +0 -0
- package/_framework/System.Threading.eajjzgfxty.wasm.br +0 -0
- package/_framework/System.Threading.eajjzgfxty.wasm.gz +0 -0
- package/_framework/YamlDotNet.wzbtxwal2q.wasm +0 -0
- package/_framework/YamlDotNet.wzbtxwal2q.wasm.gz +0 -0
- package/_framework/dotnet.js +24 -23
- package/_framework/dotnet.js.br +0 -0
- package/_framework/dotnet.js.gz +0 -0
- package/_framework/{dotnet.native.zvrd2elzl3.js → dotnet.native.4ses43gwlg.js} +2 -2
- package/_framework/dotnet.native.4ses43gwlg.js.br +0 -0
- package/_framework/dotnet.native.4ses43gwlg.js.gz +0 -0
- package/_framework/dotnet.native.61n7xh4ean.wasm +0 -0
- package/_framework/dotnet.native.61n7xh4ean.wasm.br +0 -0
- package/_framework/dotnet.native.61n7xh4ean.wasm.gz +0 -0
- package/_framework/dotnet.native.worker.3pea7uf3ce.mjs.br +0 -0
- package/_framework/dotnet.native.worker.3pea7uf3ce.mjs.gz +0 -0
- package/_framework/dotnet.runtime.s2ntauasab.js.br +0 -0
- package/_framework/dotnet.runtime.s2ntauasab.js.gz +0 -0
- package/index.d.ts +1 -2
- package/index.js +7 -2
- package/package.json +5 -21
- package/_framework/Motely.BrowserWasm.o80ouq2dpr.wasm.br +0 -0
- package/_framework/Motely.Orchestration.61a16mwxb0.wasm.br +0 -0
- package/_framework/Motely.rflf2zj5iu.wasm.br +0 -0
- package/_framework/System.Console.zh7t4lf8r4.wasm.br +0 -0
- package/_framework/System.Linq.2f9osaxu8l.wasm.br +0 -0
- package/_framework/System.Private.CoreLib.1h1cod6yy1.wasm.br +0 -0
- package/_framework/System.Runtime.InteropServices.JavaScript.hoefx079bw.wasm.br +0 -0
- package/_framework/dotnet.native.tqk7zwig2t.wasm.br +0 -0
- package/next-plugin-motely-wasm.d.ts +0 -4
- package/next-plugin-motely-wasm.js +0 -86
- package/vite-plugin-motely-wasm.d.ts +0 -4
- package/vite-plugin-motely-wasm.js +0 -118
package/README.md
CHANGED
|
@@ -106,8 +106,31 @@ import { loadMotely } from "motely-wasm";
|
|
|
106
106
|
const api = await loadMotely();
|
|
107
107
|
const version = api.getVersion();
|
|
108
108
|
const result = api.analyzeSeed("TACO1111", "Red", "White");
|
|
109
|
+
|
|
110
|
+
// Analyze seed with ante-by-ante breakdown
|
|
111
|
+
result.antes.forEach(ante => {
|
|
112
|
+
console.log(`Ante ${ante.ante}: Boss=${ante.boss}, Draw order=${ante.drawOrder}`);
|
|
113
|
+
ante.shopQueue.forEach(item => console.log(` Shop: ${item.name}`));
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Search with JAML filter
|
|
117
|
+
const searchResult = await api.startJamlSearch(jamlContent, {
|
|
118
|
+
threadCount: 4, // auto-detected if omitted; defaults to processorCount
|
|
119
|
+
batchCharCount: 4, // default: 4 (1.5M seeds per batch, range 1-7)
|
|
120
|
+
onProgress: (searched, matches, elapsed, count) => {
|
|
121
|
+
console.log(`Searched: ${searched}, Matches: ${matches}`);
|
|
122
|
+
},
|
|
123
|
+
onResult: (seed, score) => {
|
|
124
|
+
console.log(`Found: ${seed}`);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
109
127
|
```
|
|
110
128
|
|
|
129
|
+
**Batch size tuning:**
|
|
130
|
+
- `batchCharCount=4` (default): 1.5M seeds/batch, good balance between responsiveness and JS interop overhead
|
|
131
|
+
- `batchCharCount=3`: 175K seeds/batch, more responsive UI updates
|
|
132
|
+
- `batchCharCount=5`: 52M seeds/batch, fewer JS calls, less responsive
|
|
133
|
+
|
|
111
134
|
Optional custom base URL (e.g. CDN): `loadMotely({ baseUrl: "https://cdn.example/assets" })`.
|
|
112
135
|
Optional threading mode: `loadMotely({ threads: "auto" | "on" | "off" })` (default: auto).
|
|
113
136
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/_framework/dotnet.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var e=!0;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),o=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,15,1,13,0,65,1,253,15,65,2,253,15,253,128,2,11])),n=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),r=Symbol.for("wasm promise_control");function i(e,t){let o=null;const n=new Promise((function(n,r){o={isDone:!1,promise:null,resolve:t=>{o.isDone||(o.isDone=!0,n(t),e&&e())},reject:e=>{o.isDone||(o.isDone=!0,r(e),t&&t())}}}));o.promise=n;const i=n;return i[r]=o,{promise:i,promise_control:o}}function s(e){return e[r]}function a(e){e&&function(e){return void 0!==e[r]}(e)||qe(!1,"Promise is not controllable")}const l="__mono_message__",c=["debug","log","trace","warn","info","error"],d="MONO_WASM: ";let u,m,f,g;function p(e){g=e}function h(e){if(Ne.diagnosticTracing){const t="function"==typeof e?e():e;console.debug(d+t)}}function w(e,...t){console.info(d+e,...t)}function b(e,...t){console.info(e,...t)}function y(e,...t){console.warn(d+e,...t)}function v(e,...t){if(t&&t.length>0&&t[0]&&"object"==typeof t[0]){if(t[0].silent)return;if(t[0].toString)return void console.error(d+e,t[0].toString())}console.error(d+e,...t)}let _,E,T="",x=(new Date).valueOf();function j(t,o,n){return function(...r){try{let i=r[0];if(void 0===i)i="undefined";else if(null===i)i="null";else if("function"==typeof i)i=i.toString();else if("string"!=typeof i)try{i=JSON.stringify(i)}catch(e){i=i.toString()}if("string"==typeof i&&e){if(Pe&&-1!==i.indexOf("keeping the worker alive for asynchronous operation"))return;if(0===i.indexOf("MONO_WASM: ")||0===i.indexOf("[MONO]")){const e=new Date;x!==e.valueOf()&&(T=e.toISOString().substring(11,23),x=e.valueOf()),i=`[${g} ${T}] ${i}`}}o(n?JSON.stringify({method:t,payload:i,arguments:r.slice(1)}):[t+i,...r.slice(1)])}catch(e){f.error(`proxyConsole failed: ${e}`)}}}function R(e,t,o){m=t,g=e,f={...t};const n=`${o}/console`.replace("https://","wss://").replace("http://","ws://");u=new WebSocket(n),u.addEventListener("error",O),u.addEventListener("close",D),function(){for(const e of c)m[e]=j(`console.${e}`,A,!0)}()}function S(e){let t=30;const o=()=>{u?0==u.bufferedAmount||0==t?(e&&b(e),function(){for(const e of c)m[e]=j(`console.${e}`,f.log,!1)}(),u.removeEventListener("error",O),u.removeEventListener("close",D),u.close(1e3,e),u=void 0):(t--,globalThis.setTimeout(o,100)):e&&f&&f.log(e)};o()}function A(e){u&&u.readyState===WebSocket.OPEN?u.send(e):f.log(e)}function O(e){f.error(`[${g}] proxy console websocket error: ${e}`,e)}function D(e){f.debug(`[${g}] proxy console websocket closed: ${e}`,e)}function k(){Ne.preferredIcuAsset=I(Ne.config);let e="invariant"==Ne.config.globalizationMode;if(!e)if(Ne.preferredIcuAsset)Ne.diagnosticTracing&&h("ICU data archive(s) available, disabling invariant mode");else{if("custom"===Ne.config.globalizationMode||"all"===Ne.config.globalizationMode||"sharded"===Ne.config.globalizationMode){const e="invariant globalization mode is inactive and no ICU data archives are available";throw v(`ERROR: ${e}`),new Error(e)}Ne.diagnosticTracing&&h("ICU data archive(s) not available, using invariant globalization mode"),e=!0,Ne.preferredIcuAsset=null}const t="DOTNET_SYSTEM_GLOBALIZATION_INVARIANT",o=Ne.config.environmentVariables;if(void 0===o[t]&&e&&(o[t]="1"),void 0===o.TZ)try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone||null;e&&(o.TZ=e)}catch(e){w("failed to detect timezone, will fallback to UTC")}}function I(e){var t;if((null===(t=e.resources)||void 0===t?void 0:t.icu)&&"invariant"!=e.globalizationMode){const t=e.applicationCulture||(Ce?globalThis.navigator&&globalThis.navigator.languages&&globalThis.navigator.languages[0]:Intl.DateTimeFormat().resolvedOptions().locale),o=e.resources.icu;let n=null;if("custom"===e.globalizationMode){if(o.length>=1)return o[0].name}else t&&"all"!==e.globalizationMode?"sharded"===e.globalizationMode&&(n=function(e){const t=e.split("-")[0];return"en"===t||["fr","fr-FR","it","it-IT","de","de-DE","es","es-ES"].includes(e)?"icudt_EFIGS.dat":["zh","ko","ja"].includes(t)?"icudt_CJK.dat":"icudt_no_CJK.dat"}(t)):n="icudt.dat";if(n)for(let e=0;e<o.length;e++){const t=o[e];if(t.virtualPath===n)return t.name}}return e.globalizationMode="invariant",null}const P=class{constructor(e){this.url=e}toString(){return this.url}};async function C(e,t){try{const o="function"==typeof globalThis.fetch;if(De){const n=e.startsWith("file://");if(!n&&o)return globalThis.fetch(e,t||{credentials:"same-origin"});_||(E=ze.require("url"),_=ze.require("fs")),n&&(e=E.fileURLToPath(e));const r=await _.promises.readFile(e);return{ok:!0,headers:{length:0,get:()=>null},url:e,arrayBuffer:()=>r,json:()=>JSON.parse(r),text:()=>{throw new Error("NotImplementedException")}}}if(o)return globalThis.fetch(e,t||{credentials:"same-origin"});if("function"==typeof read)return{ok:!0,url:e,headers:{length:0,get:()=>null},arrayBuffer:()=>new Uint8Array(read(e,"binary")),json:()=>JSON.parse(read(e,"utf8")),text:()=>read(e,"utf8")}}catch(t){return{ok:!1,url:e,status:500,headers:{length:0,get:()=>null},statusText:"ERR28: "+t,arrayBuffer:()=>{throw t},json:()=>{throw t},text:()=>{throw t}}}throw new Error("No fetch implementation available")}function M(e){return"string"!=typeof e&&qe(!1,"url must be a string"),!L(e)&&0!==e.indexOf("./")&&0!==e.indexOf("../")&&globalThis.URL&&globalThis.document&&globalThis.document.baseURI&&(e=new URL(e,globalThis.document.baseURI).toString()),e}const U=/^[a-zA-Z][a-zA-Z\d+\-.]*?:\/\//,N=/[a-zA-Z]:[\\/]/;function L(e){return De||Me?e.startsWith("/")||e.startsWith("\\")||-1!==e.indexOf("///")||N.test(e):U.test(e)}let $,z=0;const W=[],F=[],B=new Map,V={"js-module-threads":!0,"js-module-runtime":!0,"js-module-dotnet":!0,"js-module-native":!0,"js-module-diagnostics":!0},q={...V,"js-module-library-initializer":!0},J={...V,dotnetwasm:!0,heap:!0,manifest:!0},H={...q,manifest:!0},Z={...q,dotnetwasm:!0},Q={dotnetwasm:!0,symbols:!0},G={...q,dotnetwasm:!0,symbols:!0},K={symbols:!0};function X(e){return!("icu"==e.behavior&&e.name!=Ne.preferredIcuAsset)}function Y(e,t,o){null!=t||(t=[]),qe(1==t.length,`Expect to have one ${o} asset in resources`);const n=t[0];return n.behavior=o,ee(n),e.push(n),n}function ee(e){J[e.behavior]&&B.set(e.behavior,e)}function te(e){qe(J[e],`Unknown single asset behavior ${e}`);const t=B.get(e);if(t&&!t.resolvedUrl)if(t.resolvedUrl=Ne.locateFile(t.name),V[t.behavior]){const e=he(t);e?("string"!=typeof e&&qe(!1,"loadBootResource response for 'dotnetjs' type should be a URL string"),t.resolvedUrl=e):t.resolvedUrl=ue(t.resolvedUrl,t.behavior)}else if("dotnetwasm"!==t.behavior)throw new Error(`Unknown single asset behavior ${e}`);return t}function oe(e){const t=te(e);return qe(t,`Single asset for ${e} not found`),t}let ne=!1;async function re(){if(!ne){ne=!0,Ne.diagnosticTracing&&h("mono_download_assets");try{const e=[],t=[],o=(e,t)=>{!G[e.behavior]&&X(e)&&Ne.expected_instantiated_assets_count++,!Z[e.behavior]&&X(e)&&(Ne.expected_downloaded_assets_count++,t.push(le(e)))};for(const t of W)o(t,e);for(const e of F)o(e,t);Ne.allDownloadsQueued.promise_control.resolve(),Promise.all([...e,...t]).then((()=>{Ne.allDownloadsFinished.promise_control.resolve()})).catch((e=>{throw Ne.err("Error in mono_download_assets: "+e),et(1,e),e})),await Ne.runtimeModuleLoaded.promise;const n=async e=>{const t=await e;if(t.buffer){if(!G[t.behavior]){t.buffer&&"object"==typeof t.buffer||qe(!1,"asset buffer must be array-like or buffer-like or promise of these"),"string"!=typeof t.resolvedUrl&&qe(!1,"resolvedUrl must be string");const e=t.resolvedUrl,o=await t.buffer,n=new Uint8Array(o);we(t),await Ue.beforeOnRuntimeInitialized.promise,Ue.instantiate_asset(t,e,n)}}else Q[t.behavior]?("symbols"===t.behavior&&(await Ue.instantiate_symbols_asset(t),we(t)),Q[t.behavior]&&++Ne.actual_downloaded_assets_count):(t.isOptional||qe(!1,"Expected asset to have the downloaded buffer"),!Z[t.behavior]&&X(t)&&Ne.expected_downloaded_assets_count--,!G[t.behavior]&&X(t)&&Ne.expected_instantiated_assets_count--)},r=[],i=[];for(const t of e)r.push(n(t));for(const e of t)i.push(n(e));Promise.all(r).then((()=>{Pe||Ue.coreAssetsInMemory.promise_control.resolve()})).catch((e=>{throw Ne.err("Error in mono_download_assets: "+e),et(1,e),e})),Promise.all(i).then((async()=>{Pe||(await Ue.coreAssetsInMemory.promise,Ue.allAssetsInMemory.promise_control.resolve())})).catch((e=>{throw Ne.err("Error in mono_download_assets: "+e),et(1,e),e}))}catch(e){throw Ne.err("Error in mono_download_assets: "+e),e}}}let ie=!1;function se(){if(ie)return;ie=!0;const e=Ne.config,t=[];if(e.assets)for(const t of e.assets)"object"!=typeof t&&qe(!1,`asset must be object, it was ${typeof t} : ${t}`),"string"!=typeof t.behavior&&qe(!1,"asset behavior must be known string"),"string"!=typeof t.name&&qe(!1,"asset name must be string"),t.resolvedUrl&&"string"!=typeof t.resolvedUrl&&qe(!1,"asset resolvedUrl could be string"),t.hash&&"string"!=typeof t.hash&&qe(!1,"asset resolvedUrl could be string"),t.pendingDownload&&"object"!=typeof t.pendingDownload&&qe(!1,"asset pendingDownload could be object"),t.isCore?W.push(t):F.push(t),ee(t);else if(e.resources){const o=e.resources;o.wasmNative||qe(!1,"resources.wasmNative must be defined"),o.jsModuleNative||qe(!1,"resources.jsModuleNative must be defined"),o.jsModuleRuntime||qe(!1,"resources.jsModuleRuntime must be defined"),o.jsModuleWorker||qe(!1,"resources.jsModuleWorker must be defined"),Y(F,o.wasmNative,"dotnetwasm"),Y(t,o.jsModuleNative,"js-module-native"),Y(t,o.jsModuleRuntime,"js-module-runtime"),o.jsModuleDiagnostics&&Y(t,o.jsModuleDiagnostics,"js-module-diagnostics"),Y(t,o.jsModuleWorker,"js-module-threads");const n=(e,t,o)=>{const n=e;n.behavior=t,o?(n.isCore=!0,W.push(n)):F.push(n)};if(o.coreAssembly)for(let e=0;e<o.coreAssembly.length;e++)n(o.coreAssembly[e],"assembly",!0);if(o.assembly)for(let e=0;e<o.assembly.length;e++)n(o.assembly[e],"assembly",!o.coreAssembly);if(0!=e.debugLevel&&Ne.isDebuggingSupported()){if(o.corePdb)for(let e=0;e<o.corePdb.length;e++)n(o.corePdb[e],"pdb",!0);if(o.pdb)for(let e=0;e<o.pdb.length;e++)n(o.pdb[e],"pdb",!o.corePdb)}if(e.loadAllSatelliteResources&&o.satelliteResources)for(const e in o.satelliteResources)for(let t=0;t<o.satelliteResources[e].length;t++){const r=o.satelliteResources[e][t];r.culture=e,n(r,"resource",!o.coreAssembly)}if(o.coreVfs)for(let e=0;e<o.coreVfs.length;e++)n(o.coreVfs[e],"vfs",!0);if(o.vfs)for(let e=0;e<o.vfs.length;e++)n(o.vfs[e],"vfs",!o.coreVfs);const r=I(e);if(r&&o.icu)for(let e=0;e<o.icu.length;e++){const t=o.icu[e];t.name===r&&n(t,"icu",!1)}if(o.wasmSymbols)for(let e=0;e<o.wasmSymbols.length;e++)n(o.wasmSymbols[e],"symbols",!1)}if(e.appsettings)for(let t=0;t<e.appsettings.length;t++){const o=e.appsettings[t],n=be(o);"appsettings.json"!==n&&n!==`appsettings.${e.applicationEnvironment}.json`||F.push({name:o,behavior:"vfs",cache:"no-cache",useCredentials:!0})}e.assets=[...W,...F,...t]}async function ae(e){const t=await le(e);return await t.pendingDownloadInternal.response,t.buffer}async function le(e){try{return await ce(e)}catch(t){if(!Ne.enableDownloadRetry)throw t;if(Me||De)throw t;if(e.pendingDownload&&e.pendingDownloadInternal==e.pendingDownload)throw t;if(e.resolvedUrl&&-1!=e.resolvedUrl.indexOf("file://"))throw t;if(t&&404==t.status)throw t;e.pendingDownloadInternal=void 0,await Ne.allDownloadsQueued.promise;try{return Ne.diagnosticTracing&&h(`Retrying download '${e.name}'`),await ce(e)}catch(t){return e.pendingDownloadInternal=void 0,await new Promise((e=>globalThis.setTimeout(e,100))),Ne.diagnosticTracing&&h(`Retrying download (2) '${e.name}' after delay`),await ce(e)}}}async function ce(e){for(;$;)await $.promise;try{++z,z==Ne.maxParallelDownloads&&(Ne.diagnosticTracing&&h("Throttling further parallel downloads"),$=i());const t=await async function(e){if(e.pendingDownload&&(e.pendingDownloadInternal=e.pendingDownload),e.pendingDownloadInternal&&e.pendingDownloadInternal.response)return e.pendingDownloadInternal.response;if(e.buffer){const t=await e.buffer;return e.resolvedUrl||(e.resolvedUrl="undefined://"+e.name),e.pendingDownloadInternal={url:e.resolvedUrl,name:e.name,response:Promise.resolve({ok:!0,arrayBuffer:()=>t,json:()=>JSON.parse(new TextDecoder("utf-8").decode(t)),text:()=>{throw new Error("NotImplementedException")},headers:{get:()=>{}}})},e.pendingDownloadInternal.response}const t=e.loadRemote&&Ne.config.remoteSources?Ne.config.remoteSources:[""];let o;for(let n of t){n=n.trim(),"./"===n&&(n="");const t=de(e,n);e.name===t?Ne.diagnosticTracing&&h(`Attempting to download '${t}'`):Ne.diagnosticTracing&&h(`Attempting to download '${t}' for ${e.name}`);try{e.resolvedUrl=t;const n=ge(e);if(e.pendingDownloadInternal=n,o=await n.response,!o||!o.ok)continue;return o}catch(e){o||(o={ok:!1,url:t,status:0,statusText:""+e});continue}}const n=e.isOptional||e.name.match(/\.pdb$/)&&Ne.config.ignorePdbLoadErrors;if(o||qe(!1,`Response undefined ${e.name}`),!n){const t=new Error(`download '${o.url}' for ${e.name} failed ${o.status} ${o.statusText}`);throw t.status=o.status,t}w(`optional download '${o.url}' for ${e.name} failed ${o.status} ${o.statusText}`)}(e);return t?(Q[e.behavior]||(e.buffer=await t.arrayBuffer(),++Ne.actual_downloaded_assets_count),e):e}finally{if(--z,$&&z==Ne.maxParallelDownloads-1){Ne.diagnosticTracing&&h("Resuming more parallel downloads");const e=$;$=void 0,e.promise_control.resolve()}}}function de(e,t){let o;return null==t&&qe(!1,`sourcePrefix must be provided for ${e.name}`),e.resolvedUrl?o=e.resolvedUrl:(o=""===t?"assembly"===e.behavior||"pdb"===e.behavior?e.name:"resource"===e.behavior&&e.culture&&""!==e.culture?`${e.culture}/${e.name}`:e.name:t+e.name,o=ue(Ne.locateFile(o),e.behavior)),o&&"string"==typeof o||qe(!1,"attemptUrl need to be path or url string"),o}function ue(e,t){return Ne.modulesUniqueQuery&&H[t]&&(e+=Ne.modulesUniqueQuery),e}let me=0;const fe=new Set;function ge(e){try{e.resolvedUrl||qe(!1,"Request's resolvedUrl must be set");const t=function(e){let t=e.resolvedUrl;if(Ne.loadBootResource){const o=he(e);if(o instanceof Promise)return o;"string"==typeof o&&(t=o)}const o={};return e.cache?o.cache=e.cache:Ne.config.disableNoCacheFetch||(o.cache="no-cache"),e.useCredentials?o.credentials="include":!Ne.config.disableIntegrityCheck&&e.hash&&(o.integrity=e.hash),Ne.fetch_like(t,o)}(e),o={name:e.name,url:e.resolvedUrl,response:t};return fe.add(e.name),o.response.then((()=>{"assembly"==e.behavior&&Ne.loadedAssemblies.push(e.name),me++,Ne.onDownloadResourceProgress&&Ne.onDownloadResourceProgress(me,fe.size)})),o}catch(t){const o={ok:!1,url:e.resolvedUrl,status:500,statusText:"ERR29: "+t,arrayBuffer:()=>{throw t},json:()=>{throw t}};return{name:e.name,url:e.resolvedUrl,response:Promise.resolve(o)}}}const pe={resource:"assembly",assembly:"assembly",pdb:"pdb",icu:"globalization",vfs:"configuration",manifest:"manifest",dotnetwasm:"dotnetwasm","js-module-dotnet":"dotnetjs","js-module-native":"dotnetjs","js-module-runtime":"dotnetjs","js-module-threads":"dotnetjs"};function he(e){var t;if(Ne.loadBootResource){const o=null!==(t=e.hash)&&void 0!==t?t:"",n=e.resolvedUrl,r=pe[e.behavior];if(r){const t=Ne.loadBootResource(r,e.name,n,o,e.behavior);return"string"==typeof t?M(t):t}}}function we(e){e.pendingDownloadInternal=null,e.pendingDownload=null,e.buffer=null,e.moduleExports=null}function be(e){let t=e.lastIndexOf("/");return t>=0&&t++,e.substring(t)}async function ye(e){e&&await Promise.all((null!=e?e:[]).map((e=>async function(e){try{const t=e.name;if(!e.moduleExports){const o=ue(Ne.locateFile(t),"js-module-library-initializer");Ne.diagnosticTracing&&h(`Attempting to import '${o}' for ${e}`),e.moduleExports=await import(/*! webpackIgnore: true */o)}Ne.libraryInitializers.push({scriptName:t,exports:e.moduleExports})}catch(t){y(`Failed to import library initializer '${e}': ${t}`)}}(e))))}async function ve(e,t){if(!Ne.libraryInitializers)return;const o=[];for(let n=0;n<Ne.libraryInitializers.length;n++){const r=Ne.libraryInitializers[n];r.exports[e]&&o.push(_e(r.scriptName,e,(()=>r.exports[e](...t))))}await Promise.all(o)}async function _e(e,t,o){try{await o()}catch(o){throw y(`Failed to invoke '${t}' on library initializer '${e}': ${o}`),et(1,o),o}}function Ee(e,t){if(e===t)return e;const o={...t};return void 0!==o.assets&&o.assets!==e.assets&&(o.assets=[...e.assets||[],...o.assets||[]]),void 0!==o.resources&&(o.resources=xe(e.resources||{assembly:[],jsModuleNative:[],jsModuleRuntime:[],wasmNative:[]},o.resources)),void 0!==o.environmentVariables&&(o.environmentVariables={...e.environmentVariables||{},...o.environmentVariables||{}}),void 0!==o.runtimeOptions&&o.runtimeOptions!==e.runtimeOptions&&(o.runtimeOptions=[...e.runtimeOptions||[],...o.runtimeOptions||[]]),Object.assign(e,o)}function Te(e,t){if(e===t)return e;const o={...t};return o.config&&(e.config||(e.config={}),o.config=Ee(e.config,o.config)),Object.assign(e,o)}function xe(e,t){if(e===t)return e;const o={...t};return void 0!==o.coreAssembly&&(o.coreAssembly=[...e.coreAssembly||[],...o.coreAssembly||[]]),void 0!==o.assembly&&(o.assembly=[...e.assembly||[],...o.assembly||[]]),void 0!==o.lazyAssembly&&(o.lazyAssembly=[...e.lazyAssembly||[],...o.lazyAssembly||[]]),void 0!==o.corePdb&&(o.corePdb=[...e.corePdb||[],...o.corePdb||[]]),void 0!==o.pdb&&(o.pdb=[...e.pdb||[],...o.pdb||[]]),void 0!==o.jsModuleWorker&&(o.jsModuleWorker=[...e.jsModuleWorker||[],...o.jsModuleWorker||[]]),void 0!==o.jsModuleNative&&(o.jsModuleNative=[...e.jsModuleNative||[],...o.jsModuleNative||[]]),void 0!==o.jsModuleDiagnostics&&(o.jsModuleDiagnostics=[...e.jsModuleDiagnostics||[],...o.jsModuleDiagnostics||[]]),void 0!==o.jsModuleRuntime&&(o.jsModuleRuntime=[...e.jsModuleRuntime||[],...o.jsModuleRuntime||[]]),void 0!==o.wasmSymbols&&(o.wasmSymbols=[...e.wasmSymbols||[],...o.wasmSymbols||[]]),void 0!==o.wasmNative&&(o.wasmNative=[...e.wasmNative||[],...o.wasmNative||[]]),void 0!==o.icu&&(o.icu=[...e.icu||[],...o.icu||[]]),void 0!==o.satelliteResources&&(o.satelliteResources=function(e,t){if(e===t)return e;for(const o in t)e[o]=[...e[o]||[],...t[o]||[]];return e}(e.satelliteResources||{},o.satelliteResources||{})),void 0!==o.modulesAfterConfigLoaded&&(o.modulesAfterConfigLoaded=[...e.modulesAfterConfigLoaded||[],...o.modulesAfterConfigLoaded||[]]),void 0!==o.modulesAfterRuntimeReady&&(o.modulesAfterRuntimeReady=[...e.modulesAfterRuntimeReady||[],...o.modulesAfterRuntimeReady||[]]),void 0!==o.extensions&&(o.extensions={...e.extensions||{},...o.extensions||{}}),void 0!==o.vfs&&(o.vfs=[...e.vfs||[],...o.vfs||[]]),Object.assign(e,o)}function je(){const e=Ne.config;if(e.environmentVariables=e.environmentVariables||{},e.runtimeOptions=e.runtimeOptions||[],e.resources=e.resources||{assembly:[],jsModuleNative:[],jsModuleWorker:[],jsModuleRuntime:[],wasmNative:[],vfs:[],satelliteResources:{}},e.assets){Ne.diagnosticTracing&&h("config.assets is deprecated, use config.resources instead");for(const t of e.assets){const o={};switch(t.behavior){case"assembly":o.assembly=[t];break;case"pdb":o.pdb=[t];break;case"resource":o.satelliteResources={},o.satelliteResources[t.culture]=[t];break;case"icu":o.icu=[t];break;case"symbols":o.wasmSymbols=[t];break;case"vfs":o.vfs=[t];break;case"dotnetwasm":o.wasmNative=[t];break;case"js-module-threads":o.jsModuleWorker=[t];break;case"js-module-runtime":o.jsModuleRuntime=[t];break;case"js-module-native":o.jsModuleNative=[t];break;case"js-module-diagnostics":o.jsModuleDiagnostics=[t];break;case"js-module-dotnet":break;default:throw new Error(`Unexpected behavior ${t.behavior} of asset ${t.name}`)}xe(e.resources,o)}}e.debugLevel,e.applicationEnvironment||(e.applicationEnvironment="Production"),Number.isInteger(e.pthreadPoolInitialSize)||(e.pthreadPoolInitialSize=5),Number.isInteger(e.pthreadPoolUnusedSize)||(e.pthreadPoolUnusedSize=1),null==e.jsThreadBlockingMode&&(e.jsThreadBlockingMode="PreventSynchronousJSExport"),void 0===e.environmentVariables.MONO_SLEEP_ABORT_LIMIT&&(e.environmentVariables.MONO_SLEEP_ABORT_LIMIT="5000"),e.applicationCulture&&(e.environmentVariables.LANG=`${e.applicationCulture}.UTF-8`),Ue.diagnosticTracing=Ne.diagnosticTracing=!!e.diagnosticTracing,Ue.waitForDebugger=e.waitForDebugger,Ne.maxParallelDownloads=e.maxParallelDownloads||Ne.maxParallelDownloads,Ne.enableDownloadRetry=void 0!==e.enableDownloadRetry?e.enableDownloadRetry:Ne.enableDownloadRetry}let Re=!1;async function Se(e){var t;if(Re)return void await Ne.afterConfigLoaded.promise;let o;try{if(e.configSrc||Ne.config&&0!==Object.keys(Ne.config).length&&(Ne.config.assets||Ne.config.resources)||(e.configSrc="dotnet.boot.js"),o=e.configSrc,Re=!0,o&&(Ne.diagnosticTracing&&h("mono_wasm_load_config"),await async function(e){const t=e.configSrc,o=Ne.locateFile(t);let n=null;void 0!==Ne.loadBootResource&&(n=Ne.loadBootResource("manifest",t,o,"","manifest"));let r,i=null;if(n)if("string"==typeof n)n.includes(".json")?(i=await s(M(n)),r=await Oe(i)):r=(await import(M(n))).config;else{const e=await n;"function"==typeof e.json?(i=e,r=await Oe(i)):r=e.config}else o.includes(".json")?(i=await s(ue(o,"manifest")),r=await Oe(i)):r=(await import(ue(o,"manifest"))).config;function s(e){return Ne.fetch_like(e,{method:"GET",credentials:"include",cache:"no-cache"})}Ne.config.applicationEnvironment&&(r.applicationEnvironment=Ne.config.applicationEnvironment),Ee(Ne.config,r)}(e)),je(),await ye(null===(t=Ne.config.resources)||void 0===t?void 0:t.modulesAfterConfigLoaded),await ve("onRuntimeConfigLoaded",[Ne.config]),e.onConfigLoaded)try{await e.onConfigLoaded(Ne.config,$e),je()}catch(e){throw v("onConfigLoaded() failed",e),e}je(),Ne.afterConfigLoaded.promise_control.resolve(Ne.config)}catch(t){const n=`Failed to load config file ${o} ${t} ${null==t?void 0:t.stack}`;throw Ne.config=e.config=Object.assign(Ne.config,{message:n,error:t,isError:!0}),et(1,new Error(n)),t}}function Ae(){return!!globalThis.navigator&&(Ne.isChromium||Ne.isFirefox)}async function Oe(e){const t=Ne.config,o=await e.json();t.applicationEnvironment||o.applicationEnvironment||(o.applicationEnvironment=e.headers.get("Blazor-Environment")||e.headers.get("DotNet-Environment")||void 0),o.environmentVariables||(o.environmentVariables={});const n=e.headers.get("DOTNET-MODIFIABLE-ASSEMBLIES");n&&(o.environmentVariables.DOTNET_MODIFIABLE_ASSEMBLIES=n);const r=e.headers.get("ASPNETCORE-BROWSER-TOOLS");return r&&(o.environmentVariables.__ASPNETCORE_BROWSER_TOOLS=r),o}"function"!=typeof importScripts||globalThis.onmessage||(globalThis.dotnetSidecar=!0);const De="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,ke="function"==typeof importScripts,Ie=ke&&"undefined"!=typeof dotnetSidecar,Pe=ke&&!Ie,Ce="object"==typeof window||ke&&!De,Me=!Ce&&!De;let Ue={},Ne={},Le={},$e={},ze={},We=!1;const Fe={},Be={config:Fe},Ve={mono:{},binding:{},internal:ze,module:Be,loaderHelpers:Ne,runtimeHelpers:Ue,diagnosticHelpers:Le,api:$e};function qe(e,t){if(e)return;const o="Assert failed: "+("function"==typeof t?t():t),n=new Error(o);v(o,n),Ue.nativeAbort(n)}function Je(){return void 0!==Ne.exitCode}function He(){return Ue.runtimeReady&&!Je()}function Ze(){Je()&&qe(!1,`.NET runtime already exited with ${Ne.exitCode} ${Ne.exitReason}. You can use runtime.runMain() which doesn't exit the runtime.`),Pe?Ue.runtimeReady||qe(!1,"The WebWorker is not attached to the runtime. See https://github.com/dotnet/runtime/blob/main/src/mono/wasm/threads.md#JS-interop-on-dedicated-threads"):Ue.runtimeReady||qe(!1,".NET runtime didn't start yet. Please call dotnet.create() first.")}function Qe(){Ce&&(globalThis.addEventListener("unhandledrejection",ot),globalThis.addEventListener("error",nt))}let Ge,Ke;function Xe(e){Ke&&Ke(e),et(e,Ne.exitReason)}function Ye(e){var t;if(Ge&&Ge(e||Ne.exitReason),(null===(t=Ne.config)||void 0===t?void 0:t.dumpThreadsOnNonZeroExit)&&Ue.mono_wasm_print_thread_dump&&void 0===Ne.exitCode)try{Ue.mono_wasm_print_thread_dump()}catch(e){}et(1,e||Ne.exitReason)}function et(t,o){var n,r;const i=o&&"object"==typeof o;t=i&&"number"==typeof o.status?o.status:void 0===t?-1:t;const s=i&&"string"==typeof o.message?o.message:""+o;(o=i?o:Ue.ExitStatus?function(e,t){const o=new Ue.ExitStatus(e);return o.message=t,o.toString=()=>t,o}(t,s):new Error("Exit with code "+t+" "+s)).status=t,o.message||(o.message=s);const a=""+(o.stack||(new Error).stack);try{Object.defineProperty(o,"stack",{get:()=>a})}catch(e){}const l=!!o.silent;if(o.silent=!0,Je())Ne.diagnosticTracing&&h("mono_exit called after exit");else{try{Be.onAbort==Ye&&(Be.onAbort=Ge),Be.onExit==Xe&&(Be.onExit=Ke),Ce&&(globalThis.removeEventListener("unhandledrejection",ot),globalThis.removeEventListener("error",nt)),Ue.runtimeReady?(Ue.jiterpreter_dump_stats&&Ue.jiterpreter_dump_stats(!1),0===t&&(null===(n=Ne.config)||void 0===n?void 0:n.interopCleanupOnExit)&&Ue.forceDisposeProxies(!0,!0),e&&0!==t&&(null===(r=Ne.config)||void 0===r?void 0:r.dumpThreadsOnNonZeroExit)&&Ue.dumpThreads()):(Ne.diagnosticTracing&&h(`abort_startup, reason: ${o}`),function(e){Ne.allDownloadsQueued.promise_control.reject(e),Ne.allDownloadsFinished.promise_control.reject(e),Ne.afterConfigLoaded.promise_control.reject(e),Ne.wasmCompilePromise.promise_control.reject(e),Ne.runtimeModuleLoaded.promise_control.reject(e),Ue.dotnetReady&&(Ue.dotnetReady.promise_control.reject(e),Ue.afterInstantiateWasm.promise_control.reject(e),Ue.beforePreInit.promise_control.reject(e),Ue.afterPreInit.promise_control.reject(e),Ue.afterPreRun.promise_control.reject(e),Ue.beforeOnRuntimeInitialized.promise_control.reject(e),Ue.afterOnRuntimeInitialized.promise_control.reject(e),Ue.afterPostRun.promise_control.reject(e))}(o))}catch(e){y("mono_exit A failed",e)}try{l||(function(e,t){if(0!==e&&t){const e=Ue.ExitStatus&&t instanceof Ue.ExitStatus?h:v;"string"==typeof t?e(t):(void 0===t.stack&&(t.stack=(new Error).stack+""),t.message?e(Ue.stringify_as_error_with_stack?Ue.stringify_as_error_with_stack(t.message+"\n"+t.stack):t.message+"\n"+t.stack):e(JSON.stringify(t)))}!Pe&&Ne.config&&(Ne.config.logExitCode?Ne.config.forwardConsoleLogsToWS?S("WASM EXIT "+e):b("WASM EXIT "+e):Ne.config.forwardConsoleLogsToWS&&S())}(t,o),function(e){if(Ce&&!Pe&&Ne.config&&Ne.config.appendElementOnExit&&document){const t=document.createElement("label");t.id="tests_done",0!==e&&(t.style.background="red"),t.innerHTML=""+e,document.body.appendChild(t)}}(t))}catch(e){y("mono_exit B failed",e)}Ne.exitCode=t,Ne.exitReason||(Ne.exitReason=o),!Pe&&Ue.runtimeReady&&Be.runtimeKeepalivePop()}if(Ne.config&&Ne.config.asyncFlushOnExit&&0===t)throw(async()=>{try{await async function(){try{const e=await import(/*! webpackIgnore: true */"process"),t=e=>new Promise(((t,o)=>{e.on("error",o),e.end("","utf8",t)})),o=t(e.stderr),n=t(e.stdout);let r;const i=new Promise((e=>{r=setTimeout((()=>e("timeout")),1e3)}));await Promise.race([Promise.all([n,o]),i]),clearTimeout(r)}catch(e){v(`flushing std* streams failed: ${e}`)}}()}finally{tt(t,o)}})(),o;tt(t,o)}function tt(e,t){if(Pe&&Ue.runtimeReady&&Ue.nativeAbort)throw Ue.nativeAbort(t),t;if(Ue.runtimeReady&&Ue.nativeExit)try{Ue.nativeExit(e)}catch(e){!Ue.ExitStatus||e instanceof Ue.ExitStatus||y("set_exit_code_and_quit_now failed: "+e.toString())}if(0!==e||!Ce)throw De&&ze.process?ze.process.exit(e):Ue.quit&&Ue.quit(e,t),t}function ot(e){rt(e,e.reason,"rejection")}function nt(e){rt(e,e.error,"error")}function rt(e,t,o){e.preventDefault();try{t||(t=new Error("Unhandled "+o)),void 0===t.stack&&(t.stack=(new Error).stack),t.stack=t.stack+"",t.silent||(v("Unhandled error:",t),et(1,t))}catch(e){}}!function(e){if(We)throw new Error("Loader module already loaded");We=!0,Ue=e.runtimeHelpers,Ne=e.loaderHelpers,Le=e.diagnosticHelpers,$e=e.api,ze=e.internal,Object.assign($e,{INTERNAL:ze,invokeLibraryInitializers:ve}),Object.assign(e.module,{config:Ee(Fe,{environmentVariables:{}})});const r={mono_wasm_bindings_is_ready:!1,config:e.module.config,diagnosticTracing:!1,nativeAbort:e=>{throw e||new Error("abort")},nativeExit:e=>{throw new Error("exit:"+e)}},l={gitHash:"c2435c3e0f46de784341ac3ed62863ce77e117b4",config:e.module.config,diagnosticTracing:!1,maxParallelDownloads:16,enableDownloadRetry:!0,_loaded_files:[],loadedFiles:[],loadedAssemblies:[],libraryInitializers:[],workerNextNumber:1,actual_downloaded_assets_count:0,actual_instantiated_assets_count:0,expected_downloaded_assets_count:0,expected_instantiated_assets_count:0,afterConfigLoaded:i(),allDownloadsQueued:i(),allDownloadsFinished:i(),wasmCompilePromise:i(),runtimeModuleLoaded:i(),loadingWorkers:i(),is_exited:Je,is_runtime_running:He,assert_runtime_running:Ze,mono_exit:et,createPromiseController:i,getPromiseController:s,assertIsControllablePromise:a,mono_download_assets:re,resolve_single_asset_path:oe,setup_proxy_console:R,set_thread_prefix:p,installUnhandledErrorHandler:Qe,retrieve_asset_download:ae,invokeLibraryInitializers:ve,isDebuggingSupported:Ae,exceptions:t,simd:n,relaxedSimd:o};Object.assign(Ue,r),Object.assign(Ne,l)}(Ve);let it,st,at,lt=!1,ct=!1;async function dt(e){if(!ct){if(ct=!0,Ce&&Ne.config.forwardConsoleLogsToWS&&void 0!==globalThis.WebSocket&&R("main",globalThis.console,globalThis.location.origin),Be||qe(!1,"Null moduleConfig"),Ne.config||qe(!1,"Null moduleConfig.config"),"function"==typeof e){const t=e(Ve.api);if(t.ready)throw new Error("Module.ready couldn't be redefined.");Object.assign(Be,t),Te(Be,t)}else{if("object"!=typeof e)throw new Error("Can't use moduleFactory callback of createDotnetRuntime function.");Te(Be,e)}await async function(e){if(De){const e=await import(/*! webpackIgnore: true */"process"),t=14;if(e.versions.node.split(".")[0]<t)throw new Error(`NodeJS at '${e.execPath}' has too low version '${e.versions.node}', please use at least ${t}. See also https://aka.ms/dotnet-wasm-features`)}const t=/*! webpackIgnore: true */import.meta.url,o=t.indexOf("?");var n;if(o>0&&(Ne.modulesUniqueQuery=t.substring(o)),Ne.scriptUrl=t.replace(/\\/g,"/").replace(/[?#].*/,""),Ne.scriptDirectory=(n=Ne.scriptUrl).slice(0,n.lastIndexOf("/"))+"/",Ne.locateFile=e=>"URL"in globalThis&&globalThis.URL!==P?new URL(e,Ne.scriptDirectory).toString():L(e)?e:Ne.scriptDirectory+e,Ne.fetch_like=C,Ne.out=console.log,Ne.err=console.error,Ne.onDownloadResourceProgress=e.onDownloadResourceProgress,Ce&&globalThis.navigator){const e=globalThis.navigator,t=e.userAgentData&&e.userAgentData.brands;t&&t.length>0?Ne.isChromium=t.some((e=>"Google Chrome"===e.brand||"Microsoft Edge"===e.brand||"Chromium"===e.brand)):e.userAgent&&(Ne.isChromium=e.userAgent.includes("Chrome"),Ne.isFirefox=e.userAgent.includes("Firefox"))}ze.require=De?await import(/*! webpackIgnore: true */"module").then((e=>e.createRequire(/*! webpackIgnore: true */import.meta.url))):Promise.resolve((()=>{throw new Error("require not supported")})),void 0===globalThis.URL&&(globalThis.URL=P)}(Be)}}async function ut(e){return await dt(e),Ge=Be.onAbort,Ke=Be.onExit,Be.onAbort=Ye,Be.onExit=Xe,Be.ENVIRONMENT_IS_PTHREAD?async function(){(function(){const e=new MessageChannel,t=e.port1,o=e.port2;t.addEventListener("message",(e=>{var n,r;n=JSON.parse(e.data.config),r=JSON.parse(e.data.monoThreadInfo),lt?Ne.diagnosticTracing&&h("mono config already received"):(Ee(Ne.config,n),Ue.monoThreadInfo=r,je(),Ne.diagnosticTracing&&h("mono config received"),lt=!0,Ne.afterConfigLoaded.promise_control.resolve(Ne.config),Ce&&n.forwardConsoleLogsToWS&&void 0!==globalThis.WebSocket&&Ne.setup_proxy_console("worker-idle",console,globalThis.location.origin)),t.close(),o.close()}),{once:!0}),t.start(),self.postMessage({[l]:{monoCmd:"preload",port:o}},[o])})(),await Ne.afterConfigLoaded.promise,function(){const e=Ne.config;e.assets||qe(!1,"config.assets must be defined");for(const t of e.assets)ee(t),K[t.behavior]&&F.push(t)}(),setTimeout((async()=>{try{await re()}catch(e){et(1,e)}}),0);const e=mt(),t=await Promise.all(e);return await ft(t),Be}():async function(){var e;await Se(Be),se();const t=mt();(async function(){try{const e=oe("dotnetwasm");await le(e),e&&e.pendingDownloadInternal&&e.pendingDownloadInternal.response||qe(!1,"Can't load dotnet.native.wasm");const t=await e.pendingDownloadInternal.response,o=t.headers&&t.headers.get?t.headers.get("Content-Type"):void 0;let n;if("function"==typeof WebAssembly.compileStreaming&&"application/wasm"===o)n=await WebAssembly.compileStreaming(t);else{Ce&&"application/wasm"!==o&&y('WebAssembly resource does not have the expected content type "application/wasm", so falling back to slower ArrayBuffer instantiation.');const e=await t.arrayBuffer();Ne.diagnosticTracing&&h("instantiate_wasm_module buffered"),n=Me?await Promise.resolve(new WebAssembly.Module(e)):await WebAssembly.compile(e)}e.pendingDownloadInternal=null,e.pendingDownload=null,e.buffer=null,e.moduleExports=null,Ne.wasmCompilePromise.promise_control.resolve(n)}catch(e){Ne.wasmCompilePromise.promise_control.reject(e)}})(),setTimeout((async()=>{try{k(),function(){const e=oe("js-module-threads"),t=[];for(let o=0;o<Ne.config.pthreadPoolInitialSize;o++){const o=Ne.workerNextNumber++,n=new Worker(e.resolvedUrl,{name:"dotnet-worker-"+o.toString().padStart(3,"0"),type:"module"});n.info={workerNumber:o,pthreadId:0,reuseCount:0,updateCount:0,threadPrefix:" - ",threadName:"emscripten-pool"},t.push(n)}Ne.loadingWorkers.promise_control.resolve(t)}(),await re()}catch(e){et(1,e)}}),0);const o=await Promise.all(t);return await ft(o),await Ue.dotnetReady.promise,await ye(null===(e=Ne.config.resources)||void 0===e?void 0:e.modulesAfterRuntimeReady),await ve("onRuntimeReady",[Ve.api]),$e}()}function mt(){const e=oe("js-module-runtime"),t=oe("js-module-native");if(it&&st)return[it,st,at];"object"==typeof e.moduleExports?it=e.moduleExports:(Ne.diagnosticTracing&&h(`Attempting to import '${e.resolvedUrl}' for ${e.name}`),it=import(/*! webpackIgnore: true */e.resolvedUrl)),"object"==typeof t.moduleExports?st=t.moduleExports:(Ne.diagnosticTracing&&h(`Attempting to import '${t.resolvedUrl}' for ${t.name}`),st=import(/*! webpackIgnore: true */t.resolvedUrl));const o=te("js-module-diagnostics");return o&&("object"==typeof o.moduleExports?at=o.moduleExports:(Ne.diagnosticTracing&&h(`Attempting to import '${o.resolvedUrl}' for ${o.name}`),at=import(/*! webpackIgnore: true */o.resolvedUrl))),[it,st,at]}async function ft(e){const{initializeExports:t,initializeReplacements:o,configureRuntimeStartup:n,configureEmscriptenStartup:r,configureWorkerStartup:i,setRuntimeGlobals:s,passEmscriptenInternals:a}=e[0],{default:l}=e[1],c=e[2];s(Ve),t(Ve),c&&c.setRuntimeGlobals(Ve),await n(Be),Ne.runtimeModuleLoaded.promise_control.resolve(),l((e=>(Object.assign(Be,{ready:e.ready,__dotnet_runtime:{initializeReplacements:o,configureEmscriptenStartup:r,configureWorkerStartup:i,passEmscriptenInternals:a}}),Be))).catch((e=>{if(e.message&&e.message.toLowerCase().includes("out of memory"))throw new Error(".NET runtime has failed to start, because too much memory was requested. Please decrease the memory by adjusting EmccMaximumHeapSize. See also https://aka.ms/dotnet-wasm-features");throw e}))}const gt=new class{withModuleConfig(e){try{return Te(Be,e),this}catch(e){throw et(1,e),e}}withOnConfigLoaded(e){try{return Te(Be,{onConfigLoaded:e}),this}catch(e){throw et(1,e),e}}withConsoleForwarding(){try{return Ee(Fe,{forwardConsoleLogsToWS:!0}),this}catch(e){throw et(1,e),e}}withExitOnUnhandledError(){try{return Ee(Fe,{exitOnUnhandledError:!0}),Qe(),this}catch(e){throw et(1,e),e}}withAsyncFlushOnExit(){try{return Ee(Fe,{asyncFlushOnExit:!0}),this}catch(e){throw et(1,e),e}}withExitCodeLogging(){try{return Ee(Fe,{logExitCode:!0}),this}catch(e){throw et(1,e),e}}withElementOnExit(){try{return Ee(Fe,{appendElementOnExit:!0}),this}catch(e){throw et(1,e),e}}withInteropCleanupOnExit(){try{return Ee(Fe,{interopCleanupOnExit:!0}),this}catch(e){throw et(1,e),e}}withDumpThreadsOnNonZeroExit(){try{return Ee(Fe,{dumpThreadsOnNonZeroExit:!0}),this}catch(e){throw et(1,e),e}}withWaitingForDebugger(e){try{return Ee(Fe,{waitForDebugger:e}),this}catch(e){throw et(1,e),e}}withInterpreterPgo(e,t){try{return Ee(Fe,{interpreterPgo:e,interpreterPgoSaveDelay:t}),Fe.runtimeOptions?Fe.runtimeOptions.push("--interp-pgo-recording"):Fe.runtimeOptions=["--interp-pgo-recording"],this}catch(e){throw et(1,e),e}}withConfig(e){try{return Ee(Fe,e),this}catch(e){throw et(1,e),e}}withConfigSrc(e){try{return e&&"string"==typeof e||qe(!1,"must be file path or URL"),Te(Be,{configSrc:e}),this}catch(e){throw et(1,e),e}}withVirtualWorkingDirectory(e){try{return e&&"string"==typeof e||qe(!1,"must be directory path"),Ee(Fe,{virtualWorkingDirectory:e}),this}catch(e){throw et(1,e),e}}withEnvironmentVariable(e,t){try{const o={};return o[e]=t,Ee(Fe,{environmentVariables:o}),this}catch(e){throw et(1,e),e}}withEnvironmentVariables(e){try{return e&&"object"==typeof e||qe(!1,"must be dictionary object"),Ee(Fe,{environmentVariables:e}),this}catch(e){throw et(1,e),e}}withDiagnosticTracing(e){try{return"boolean"!=typeof e&&qe(!1,"must be boolean"),Ee(Fe,{diagnosticTracing:e}),this}catch(e){throw et(1,e),e}}withDebugging(e){try{return null!=e&&"number"==typeof e||qe(!1,"must be number"),Ee(Fe,{debugLevel:e}),this}catch(e){throw et(1,e),e}}withApplicationArguments(...e){try{return e&&Array.isArray(e)||qe(!1,"must be array of strings"),Ee(Fe,{applicationArguments:e}),this}catch(e){throw et(1,e),e}}withRuntimeOptions(e){try{return e&&Array.isArray(e)||qe(!1,"must be array of strings"),Fe.runtimeOptions?Fe.runtimeOptions.push(...e):Fe.runtimeOptions=e,this}catch(e){throw et(1,e),e}}withMainAssembly(e){try{return Ee(Fe,{mainAssemblyName:e}),this}catch(e){throw et(1,e),e}}withApplicationArgumentsFromQuery(){try{if(!globalThis.window)throw new Error("Missing window to the query parameters from");if(void 0===globalThis.URLSearchParams)throw new Error("URLSearchParams is supported");const e=new URLSearchParams(globalThis.window.location.search).getAll("arg");return this.withApplicationArguments(...e)}catch(e){throw et(1,e),e}}withApplicationEnvironment(e){try{return Ee(Fe,{applicationEnvironment:e}),this}catch(e){throw et(1,e),e}}withApplicationCulture(e){try{return Ee(Fe,{applicationCulture:e}),this}catch(e){throw et(1,e),e}}withResourceLoader(e){try{return Ne.loadBootResource=e,this}catch(e){throw et(1,e),e}}async download(){try{await async function(){dt(Be),await Se(Be),se(),k(),re(),await Ne.allDownloadsFinished.promise}()}catch(e){throw et(1,e),e}}async create(){try{return this.instance||(this.instance=await async function(){return await ut(Be),Ve.api}()),this.instance}catch(e){throw et(1,e),e}}async run(){try{return Be.config||qe(!1,"Null moduleConfig.config"),this.instance||await this.create(),this.instance.runMainAndExit()}catch(e){throw et(1,e),e}}},pt=et,ht=ut;Me||"function"==typeof globalThis.URL||qe(!1,"This browser/engine doesn't support URL API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features"),"function"!=typeof globalThis.BigInt64Array&&qe(!1,"This browser/engine doesn't support BigInt64Array API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features"),(Me||De)&&qe(!1,"This build of dotnet is multi-threaded, it doesn't support shell environments like V8 or NodeJS. See also https://aka.ms/dotnet-wasm-features"),void 0===globalThis.SharedArrayBuffer&&qe(!1,"SharedArrayBuffer is not enabled on this page. Please use a modern browser and set Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy http headers. See also https://aka.ms/dotnet-wasm-features"),"function"!=typeof globalThis.EventTarget&&qe(!1,"This browser/engine doesn't support EventTarget API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features"),gt.withConfig(/*json-start*/{
|
|
5
5
|
"mainAssemblyName": "Motely.BrowserWasm",
|
|
6
6
|
"resources": {
|
|
7
|
-
"hash": "sha256-
|
|
7
|
+
"hash": "sha256-SCkbjVQhMHLDYcYFOeiYAQGvbydF/lRO7X3/5aix+yA=",
|
|
8
8
|
"jsModuleWorker": [
|
|
9
9
|
{
|
|
10
10
|
"name": "dotnet.native.worker.3pea7uf3ce.mjs"
|
|
@@ -12,7 +12,7 @@ var e=!0;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
|
|
12
12
|
],
|
|
13
13
|
"jsModuleNative": [
|
|
14
14
|
{
|
|
15
|
-
"name": "dotnet.native.
|
|
15
|
+
"name": "dotnet.native.4ses43gwlg.js"
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
18
|
"jsModuleRuntime": [
|
|
@@ -22,28 +22,22 @@ var e=!0;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
|
|
22
22
|
],
|
|
23
23
|
"wasmNative": [
|
|
24
24
|
{
|
|
25
|
-
"name": "dotnet.native.
|
|
26
|
-
"integrity": "sha256-
|
|
25
|
+
"name": "dotnet.native.61n7xh4ean.wasm",
|
|
26
|
+
"integrity": "sha256-WtWRwyMqbfgbtAEkRRwaO1oZe5gpmi4VgSsDjG78D8Q=",
|
|
27
27
|
"cache": "force-cache"
|
|
28
28
|
}
|
|
29
29
|
],
|
|
30
30
|
"coreAssembly": [
|
|
31
|
-
{
|
|
32
|
-
"virtualPath": "Motely.wasm",
|
|
33
|
-
"name": "Motely.rflf2zj5iu.wasm",
|
|
34
|
-
"integrity": "sha256-RzgSPyFqiVpEY5RLEut6WUkHbAPkb6UCvRKBtyodNZY=",
|
|
35
|
-
"cache": "force-cache"
|
|
36
|
-
},
|
|
37
31
|
{
|
|
38
32
|
"virtualPath": "Motely.BrowserWasm.wasm",
|
|
39
|
-
"name": "Motely.BrowserWasm.
|
|
40
|
-
"integrity": "sha256-
|
|
33
|
+
"name": "Motely.BrowserWasm.27cet3zkwp.wasm",
|
|
34
|
+
"integrity": "sha256-wnHuhODZONCT3pL9hB17GQgbdOnSxP89b0pHUQKXLg4=",
|
|
41
35
|
"cache": "force-cache"
|
|
42
36
|
},
|
|
43
37
|
{
|
|
44
|
-
"virtualPath": "Motely.
|
|
45
|
-
"name": "Motely.
|
|
46
|
-
"integrity": "sha256-
|
|
38
|
+
"virtualPath": "Motely.wasm",
|
|
39
|
+
"name": "Motely.5vhxk92wwy.wasm",
|
|
40
|
+
"integrity": "sha256-T6/p6FNb3MvDw7dQ2ZUxgIgQgmpxS0yH5W34W24Bx8w=",
|
|
47
41
|
"cache": "force-cache"
|
|
48
42
|
},
|
|
49
43
|
{
|
|
@@ -66,8 +60,8 @@ var e=!0;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
|
|
66
60
|
},
|
|
67
61
|
{
|
|
68
62
|
"virtualPath": "System.Console.wasm",
|
|
69
|
-
"name": "System.Console.
|
|
70
|
-
"integrity": "sha256-
|
|
63
|
+
"name": "System.Console.a5h4vm85mj.wasm",
|
|
64
|
+
"integrity": "sha256-zob51KjJjxggRZ8t9Gwy3eVwc01dqq9ktxBypLRC0e0=",
|
|
71
65
|
"cache": "force-cache"
|
|
72
66
|
},
|
|
73
67
|
{
|
|
@@ -78,8 +72,8 @@ var e=!0;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
|
|
78
72
|
},
|
|
79
73
|
{
|
|
80
74
|
"virtualPath": "System.Linq.wasm",
|
|
81
|
-
"name": "System.Linq.
|
|
82
|
-
"integrity": "sha256-
|
|
75
|
+
"name": "System.Linq.x3bjseuxl8.wasm",
|
|
76
|
+
"integrity": "sha256-A41Q1q6JXtvitIxPdo+s+oh/hecRx3livbvQQdn9B68=",
|
|
83
77
|
"cache": "force-cache"
|
|
84
78
|
},
|
|
85
79
|
{
|
|
@@ -96,8 +90,8 @@ var e=!0;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
|
|
96
90
|
},
|
|
97
91
|
{
|
|
98
92
|
"virtualPath": "System.Private.CoreLib.wasm",
|
|
99
|
-
"name": "System.Private.CoreLib.
|
|
100
|
-
"integrity": "sha256-
|
|
93
|
+
"name": "System.Private.CoreLib.vgf7cxstoh.wasm",
|
|
94
|
+
"integrity": "sha256-8QVpWkzD/unZtXEk9CY5WUas0Rq2PM4iE5KpQ+SGJhc=",
|
|
101
95
|
"cache": "force-cache"
|
|
102
96
|
},
|
|
103
97
|
{
|
|
@@ -108,8 +102,8 @@ var e=!0;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
|
|
108
102
|
},
|
|
109
103
|
{
|
|
110
104
|
"virtualPath": "System.Runtime.InteropServices.JavaScript.wasm",
|
|
111
|
-
"name": "System.Runtime.InteropServices.JavaScript.
|
|
112
|
-
"integrity": "sha256-
|
|
105
|
+
"name": "System.Runtime.InteropServices.JavaScript.r77pc0xoes.wasm",
|
|
106
|
+
"integrity": "sha256-x4wah1ZnXhxZpju6QS6Bo7F+GNAM1379u+9nRWchX/8=",
|
|
113
107
|
"cache": "force-cache"
|
|
114
108
|
},
|
|
115
109
|
{
|
|
@@ -130,6 +124,12 @@ var e=!0;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
|
|
130
124
|
"integrity": "sha256-6yxiQVYAbn1qHtSPc/LPeQ7v10s0zhNIaJP9kJpbAAo=",
|
|
131
125
|
"cache": "force-cache"
|
|
132
126
|
},
|
|
127
|
+
{
|
|
128
|
+
"virtualPath": "System.Threading.wasm",
|
|
129
|
+
"name": "System.Threading.eajjzgfxty.wasm",
|
|
130
|
+
"integrity": "sha256-mqSJ10qCB3KE5ozZ/62EAjxWzkphoINkAQX8zktAqBY=",
|
|
131
|
+
"cache": "force-cache"
|
|
132
|
+
},
|
|
133
133
|
{
|
|
134
134
|
"virtualPath": "System.Threading.Channels.wasm",
|
|
135
135
|
"name": "System.Threading.Channels.x0wzjodomg.wasm",
|
|
@@ -151,6 +151,7 @@ var e=!0;const t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,
|
|
|
151
151
|
"runtimeConfig": {
|
|
152
152
|
"runtimeOptions": {
|
|
153
153
|
"configProperties": {
|
|
154
|
+
"Microsoft.AspNetCore.Components.Routing.RegexConstraintSupport": false,
|
|
154
155
|
"Microsoft.Extensions.DependencyInjection.VerifyOpenGenericServiceTrimmability": true,
|
|
155
156
|
"System.ComponentModel.DefaultValueAttribute.IsSupported": false,
|
|
156
157
|
"System.ComponentModel.Design.IDesignerHost.IsSupported": false,
|
|
Binary file
|
|
Binary file
|
|
@@ -5032,8 +5032,6 @@ var _pow = Module["_pow"] = (a0, a1) => (_pow = Module["_pow"] = wasmExports["po
|
|
|
5032
5032
|
|
|
5033
5033
|
var _mono_aot_Motely_get_method = Module["_mono_aot_Motely_get_method"] = a0 => (_mono_aot_Motely_get_method = Module["_mono_aot_Motely_get_method"] = wasmExports["mono_aot_Motely_get_method"])(a0);
|
|
5034
5034
|
|
|
5035
|
-
var _mono_aot_Motely_Orchestration_get_method = Module["_mono_aot_Motely_Orchestration_get_method"] = a0 => (_mono_aot_Motely_Orchestration_get_method = Module["_mono_aot_Motely_Orchestration_get_method"] = wasmExports["mono_aot_Motely_Orchestration_get_method"])(a0);
|
|
5036
|
-
|
|
5037
5035
|
var _mono_aot_Motely_BrowserWasm_get_method = Module["_mono_aot_Motely_BrowserWasm_get_method"] = a0 => (_mono_aot_Motely_BrowserWasm_get_method = Module["_mono_aot_Motely_BrowserWasm_get_method"] = wasmExports["mono_aot_Motely_BrowserWasm_get_method"])(a0);
|
|
5038
5036
|
|
|
5039
5037
|
var _mono_aot_System_Collections_Concurrent_get_method = Module["_mono_aot_System_Collections_Concurrent_get_method"] = a0 => (_mono_aot_System_Collections_Concurrent_get_method = Module["_mono_aot_System_Collections_Concurrent_get_method"] = wasmExports["mono_aot_System_Collections_Concurrent_get_method"])(a0);
|
|
@@ -5064,6 +5062,8 @@ var _mono_aot_System_Text_RegularExpressions_get_method = Module["_mono_aot_Syst
|
|
|
5064
5062
|
|
|
5065
5063
|
var _mono_aot_System_Threading_Channels_get_method = Module["_mono_aot_System_Threading_Channels_get_method"] = a0 => (_mono_aot_System_Threading_Channels_get_method = Module["_mono_aot_System_Threading_Channels_get_method"] = wasmExports["mono_aot_System_Threading_Channels_get_method"])(a0);
|
|
5066
5064
|
|
|
5065
|
+
var _mono_aot_System_Threading_get_method = Module["_mono_aot_System_Threading_get_method"] = a0 => (_mono_aot_System_Threading_get_method = Module["_mono_aot_System_Threading_get_method"] = wasmExports["mono_aot_System_Threading_get_method"])(a0);
|
|
5066
|
+
|
|
5067
5067
|
var _fma = Module["_fma"] = (a0, a1, a2) => (_fma = Module["_fma"] = wasmExports["fma"])(a0, a1, a2);
|
|
5068
5068
|
|
|
5069
5069
|
var _cos = Module["_cos"] = a0 => (_cos = Module["_cos"] = wasmExports["cos"])(a0);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ export interface SeedAnalysisInfo {
|
|
|
34
34
|
deck: string;
|
|
35
35
|
stake: string;
|
|
36
36
|
erraticDeckComposition: string[];
|
|
37
|
-
twos: number;
|
|
38
37
|
error?: string | null;
|
|
39
38
|
antes: AnteAnalysisInfo[];
|
|
40
39
|
}
|
|
@@ -62,7 +61,7 @@ export interface ValidateResult {
|
|
|
62
61
|
}
|
|
63
62
|
export interface SearchOptions {
|
|
64
63
|
threadCount?: number;
|
|
65
|
-
|
|
64
|
+
batchCharCount?: number;
|
|
66
65
|
startBatch?: number;
|
|
67
66
|
endBatch?: number;
|
|
68
67
|
cutoff?: string;
|
package/index.js
CHANGED
|
@@ -64,8 +64,13 @@ export async function loadMotely(options) {
|
|
|
64
64
|
// Wire up callbacks - no searchId needed, single search only
|
|
65
65
|
globalThis.__motelyOnProgress = onProgress ?? (() => { });
|
|
66
66
|
globalThis.__motelyOnResult = onResult ?? (() => { });
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
// Apply defaults: batchCharCount=4 (1.5M seeds/block), threadCount=all available cores
|
|
68
|
+
const withDefaults = {
|
|
69
|
+
threadCount: cachedCapabilities.processorCount,
|
|
70
|
+
batchCharCount: 4,
|
|
71
|
+
...searchParams,
|
|
72
|
+
};
|
|
73
|
+
const optionsJson = JSON.stringify(withDefaults);
|
|
69
74
|
const resultJson = await raw.StartJamlSearch(jamlContent, optionsJson);
|
|
70
75
|
globalThis.__motelyOnProgress = () => { };
|
|
71
76
|
globalThis.__motelyOnResult = () => { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motely-wasm",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Run the classic Analyzer on a Balatro seed, and more all in your browser!",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"require": "./index.js",
|
|
13
13
|
"types": "./index.d.ts"
|
|
14
14
|
},
|
|
15
|
-
"./vite-plugin": {
|
|
16
|
-
"import": "./vite-plugin-motely-wasm.js",
|
|
17
|
-
"types": "./vite-plugin-motely-wasm.d.ts"
|
|
18
|
-
},
|
|
19
|
-
"./next-plugin": {
|
|
20
|
-
"import": "./next-plugin-motely-wasm.js",
|
|
21
|
-
"types": "./next-plugin-motely-wasm.d.ts"
|
|
22
|
-
},
|
|
23
15
|
"./jaml.schema.json": "./jaml.schema.json"
|
|
24
16
|
},
|
|
25
17
|
"files": [
|
|
@@ -27,11 +19,7 @@
|
|
|
27
19
|
"index.js",
|
|
28
20
|
"index.d.ts",
|
|
29
21
|
"README.md",
|
|
30
|
-
"jaml.schema.json"
|
|
31
|
-
"vite-plugin-motely-wasm.js",
|
|
32
|
-
"vite-plugin-motely-wasm.d.ts",
|
|
33
|
-
"next-plugin-motely-wasm.js",
|
|
34
|
-
"next-plugin-motely-wasm.d.ts"
|
|
22
|
+
"jaml.schema.json"
|
|
35
23
|
],
|
|
36
24
|
"keywords": [
|
|
37
25
|
"balatro",
|
|
@@ -42,11 +30,7 @@
|
|
|
42
30
|
"jaml",
|
|
43
31
|
"filter",
|
|
44
32
|
"finder",
|
|
45
|
-
"
|
|
46
|
-
"Brainstorm",
|
|
47
|
-
"Perkeo",
|
|
48
|
-
"search",
|
|
49
|
-
"ALEEB"
|
|
33
|
+
"search"
|
|
50
34
|
],
|
|
51
35
|
"repository": {
|
|
52
36
|
"type": "git",
|
|
@@ -55,10 +39,10 @@
|
|
|
55
39
|
},
|
|
56
40
|
"license": "MIT",
|
|
57
41
|
"scripts": {
|
|
58
|
-
"build": "tsc
|
|
42
|
+
"build": "tsc",
|
|
59
43
|
"prepublishOnly": "npm run build"
|
|
60
44
|
},
|
|
61
45
|
"devDependencies": {
|
|
62
46
|
"typescript": "^5.0.0"
|
|
63
47
|
}
|
|
64
|
-
}
|
|
48
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import { createRequire } from "module";
|
|
4
|
-
|
|
5
|
-
const require = createRequire(import.meta.url);
|
|
6
|
-
|
|
7
|
-
const COOP_COEP = [
|
|
8
|
-
{ key: "Cross-Origin-Opener-Policy", value: "same-origin" },
|
|
9
|
-
{ key: "Cross-Origin-Embedder-Policy", value: "require-corp" },
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
function findFrameworkDir(subdir) {
|
|
13
|
-
const cwd = process.cwd();
|
|
14
|
-
const candidate = path.join(cwd, "node_modules", "motely-wasm", subdir);
|
|
15
|
-
if (fs.existsSync(candidate)) return candidate;
|
|
16
|
-
try {
|
|
17
|
-
const pkg = require.resolve("motely-wasm/package.json", { paths: [cwd] });
|
|
18
|
-
const dir = path.join(path.dirname(pkg), subdir);
|
|
19
|
-
if (fs.existsSync(dir)) return dir;
|
|
20
|
-
} catch {
|
|
21
|
-
const fallbackDir = path.join(cwd, "..", "node_modules", "motely-wasm", subdir);
|
|
22
|
-
if (fs.existsSync(fallbackDir)) return fallbackDir;
|
|
23
|
-
}
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function copyDirRecursive(src, dest) {
|
|
28
|
-
if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
|
|
29
|
-
for (const name of fs.readdirSync(src)) {
|
|
30
|
-
const s = path.join(src, name);
|
|
31
|
-
const d = path.join(dest, name);
|
|
32
|
-
if (fs.statSync(s).isDirectory()) copyDirRecursive(s, d);
|
|
33
|
-
else fs.copyFileSync(s, d);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Next.js plugin: copies _framework to public/_framework and sets COOP/COEP.
|
|
39
|
-
* Usage: export default withMotelyWasm({ ...yourNextConfig });
|
|
40
|
-
* @param {import('next').NextConfig} nextConfig
|
|
41
|
-
* @returns {import('next').NextConfig}
|
|
42
|
-
*/
|
|
43
|
-
function withMotelyWasm(nextConfig = {}) {
|
|
44
|
-
const frameworkDirs = [
|
|
45
|
-
{ subdir: "_framework", dir: findFrameworkDir("_framework") },
|
|
46
|
-
];
|
|
47
|
-
const publicDir = path.join(process.cwd(), "public");
|
|
48
|
-
|
|
49
|
-
if (!fs.existsSync(publicDir)) {
|
|
50
|
-
fs.mkdirSync(publicDir, { recursive: true });
|
|
51
|
-
}
|
|
52
|
-
const logKey = "__motelyWasmNextPluginLogged";
|
|
53
|
-
let copiedAny = false;
|
|
54
|
-
for (const { subdir, dir } of frameworkDirs) {
|
|
55
|
-
if (dir && fs.existsSync(dir)) {
|
|
56
|
-
const dest = path.join(publicDir, subdir);
|
|
57
|
-
copyDirRecursive(dir, dest);
|
|
58
|
-
copiedAny = true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (copiedAny && !globalThis[logKey]) {
|
|
62
|
-
globalThis[logKey] = true;
|
|
63
|
-
console.log("[motely-wasm] public/_framework ready");
|
|
64
|
-
}
|
|
65
|
-
if (!copiedAny) {
|
|
66
|
-
console.warn("[motely-wasm] _framework not found. Run: npm install motely-wasm");
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const existingHeaders = nextConfig.headers;
|
|
70
|
-
const motelyHeaders = async () => {
|
|
71
|
-
const list = [{ source: "/:path*", headers: COOP_COEP }];
|
|
72
|
-
if (typeof existingHeaders === "function") {
|
|
73
|
-
const existing = await existingHeaders();
|
|
74
|
-
return [...existing, ...list];
|
|
75
|
-
}
|
|
76
|
-
if (Array.isArray(existingHeaders)) return [...existingHeaders, ...list];
|
|
77
|
-
return list;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
return {
|
|
81
|
-
...nextConfig,
|
|
82
|
-
headers: motelyHeaders,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export default withMotelyWasm;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import { createRequire } from "module";
|
|
4
|
-
|
|
5
|
-
const require = createRequire(import.meta.url);
|
|
6
|
-
|
|
7
|
-
const COOP_COEP = {
|
|
8
|
-
"Cross-Origin-Opener-Policy": "same-origin",
|
|
9
|
-
"Cross-Origin-Embedder-Policy": "require-corp",
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
function findFrameworkDir(subdir) {
|
|
13
|
-
const cwd = process.cwd();
|
|
14
|
-
const candidate = path.join(cwd, "node_modules", "motely-wasm", subdir);
|
|
15
|
-
if (fs.existsSync(candidate)) return candidate;
|
|
16
|
-
try {
|
|
17
|
-
const pkg = require.resolve("motely-wasm/package.json", { paths: [cwd] });
|
|
18
|
-
const dir = path.join(path.dirname(pkg), subdir);
|
|
19
|
-
if (fs.existsSync(dir)) return dir;
|
|
20
|
-
return null;
|
|
21
|
-
} catch {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function copyDirRecursive(src, dest) {
|
|
27
|
-
if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
|
|
28
|
-
for (const name of fs.readdirSync(src)) {
|
|
29
|
-
const s = path.join(src, name);
|
|
30
|
-
const d = path.join(dest, name);
|
|
31
|
-
if (fs.statSync(s).isDirectory()) copyDirRecursive(s, d);
|
|
32
|
-
else fs.copyFileSync(s, d);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Vite plugin: serves _framework in dev, copies to dist on build, sets COOP/COEP.
|
|
38
|
-
* @returns {import('vite').Plugin}
|
|
39
|
-
*/
|
|
40
|
-
function findPackageRoot() {
|
|
41
|
-
const cwd = process.cwd();
|
|
42
|
-
const candidate = path.join(cwd, "node_modules", "motely-wasm");
|
|
43
|
-
if (fs.existsSync(candidate)) return candidate;
|
|
44
|
-
try {
|
|
45
|
-
const pkg = require.resolve("motely-wasm/package.json", { paths: [cwd] });
|
|
46
|
-
return path.dirname(pkg);
|
|
47
|
-
} catch {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function motelyWasm() {
|
|
53
|
-
let frameworkDirs = [];
|
|
54
|
-
let outDir = "dist";
|
|
55
|
-
let packageRoot = null;
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
name: "motely-wasm",
|
|
59
|
-
config(config) {
|
|
60
|
-
packageRoot = findPackageRoot();
|
|
61
|
-
frameworkDirs = [
|
|
62
|
-
{ subdir: "_framework", dir: findFrameworkDir("_framework") },
|
|
63
|
-
].filter(x => x.dir);
|
|
64
|
-
const headers = { ...COOP_COEP };
|
|
65
|
-
const existing = config.server?.headers;
|
|
66
|
-
if (existing && typeof existing === "object") Object.assign(headers, existing);
|
|
67
|
-
return {
|
|
68
|
-
server: {
|
|
69
|
-
headers,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
},
|
|
73
|
-
configResolved(config) {
|
|
74
|
-
outDir = config.build?.outDir ?? "dist";
|
|
75
|
-
},
|
|
76
|
-
configureServer(server) {
|
|
77
|
-
if (!frameworkDirs.length) return;
|
|
78
|
-
const types = {
|
|
79
|
-
".js": "text/javascript",
|
|
80
|
-
".mjs": "text/javascript",
|
|
81
|
-
".wasm": "application/wasm",
|
|
82
|
-
".json": "application/json",
|
|
83
|
-
".dat": "application/octet-stream",
|
|
84
|
-
};
|
|
85
|
-
for (const { subdir, dir } of frameworkDirs) {
|
|
86
|
-
if (!dir || !fs.existsSync(dir)) continue;
|
|
87
|
-
server.middlewares.use(`/${subdir}`, (req, res, next) => {
|
|
88
|
-
const p = path.resolve(dir, (req.url === "/" ? "" : req.url).split("?")[0].replace(/^\//, ""));
|
|
89
|
-
if (!p.startsWith(path.resolve(dir))) return next();
|
|
90
|
-
try {
|
|
91
|
-
const stat = fs.statSync(p);
|
|
92
|
-
if (stat.isFile()) {
|
|
93
|
-
res.setHeader("Cross-Origin-Opener-Policy", "same-origin");
|
|
94
|
-
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
|
|
95
|
-
const ext = path.extname(p);
|
|
96
|
-
if (types[ext]) res.setHeader("Content-Type", types[ext]);
|
|
97
|
-
const stream = fs.createReadStream(p);
|
|
98
|
-
stream.pipe(res);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
} catch (_) { }
|
|
102
|
-
next();
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
closeBundle() {
|
|
107
|
-
const absOut = path.isAbsolute(outDir) ? outDir : path.resolve(process.cwd(), outDir);
|
|
108
|
-
if (!fs.existsSync(absOut)) return;
|
|
109
|
-
for (const { subdir, dir } of frameworkDirs) {
|
|
110
|
-
if (!dir || !fs.existsSync(dir)) continue;
|
|
111
|
-
const dest = path.join(absOut, subdir);
|
|
112
|
-
copyDirRecursive(dir, dest);
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export default motelyWasm;
|