cubing 0.43.5 → 0.43.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/cubing/chunks/{chunk-J6EV75FJ.js → chunk-CP3NXNYV.js} +20 -184
- package/dist/lib/cubing/chunks/chunk-CP3NXNYV.js.map +7 -0
- package/dist/lib/cubing/chunks/{chunk-72RDBMAX.js → chunk-DLLQL65B.js} +2 -2
- package/dist/lib/cubing/chunks/{chunk-72RDBMAX.js.map → chunk-DLLQL65B.js.map} +2 -2
- package/dist/lib/cubing/chunks/{chunk-DX6FHFRA.js → chunk-S6M5LVBU.js} +2 -2
- package/dist/lib/cubing/chunks/chunk-S6M5LVBU.js.map +7 -0
- package/dist/lib/cubing/chunks/{inside-BCHGO3XT.js → inside-NHJHFY3P.js} +2 -2
- package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-JZPYKEUP.js → search-dynamic-solve-4x4x4-IKGRCFMI.js} +3 -3
- package/dist/lib/cubing/chunks/search-worker-entry.js +1 -1
- package/dist/lib/cubing/chunks/{twsearch-ZUYNNUKY.js → twsearch-I7ZWTUE4.js} +82 -40
- package/dist/lib/cubing/chunks/twsearch-I7ZWTUE4.js.map +7 -0
- package/dist/lib/cubing/chunks/twsearch_wasm_bg-BXMNNHLU-USJMMACR.js +15 -0
- package/dist/lib/cubing/chunks/twsearch_wasm_bg-BXMNNHLU-USJMMACR.js.map +7 -0
- package/dist/lib/cubing/{index-17ce7649.d.ts → index-34488522.d.ts} +1 -1
- package/dist/lib/cubing/scramble/index.d.cts +1 -1
- package/dist/lib/cubing/scramble/index.js +2 -2
- package/dist/lib/cubing/search/index.d.cts +1 -1
- package/dist/lib/cubing/search/index.js +2 -2
- package/package.json +1 -1
- package/dist/lib/cubing/chunks/chunk-DX6FHFRA.js.map +0 -7
- package/dist/lib/cubing/chunks/chunk-J6EV75FJ.js.map +0 -7
- package/dist/lib/cubing/chunks/twsearch-BDAXZGZU-JERMHHZP.js +0 -3155
- package/dist/lib/cubing/chunks/twsearch-BDAXZGZU-JERMHHZP.js.map +0 -7
- package/dist/lib/cubing/chunks/twsearch-ZUYNNUKY.js.map +0 -7
- package/dist/lib/cubing/chunks/twsearch-cpp-CUTU3IFM.js +0 -171
- package/dist/lib/cubing/chunks/twsearch-cpp-CUTU3IFM.js.map +0 -7
- package/dist/lib/cubing/chunks/twsearch_wasm_bg-V6CRTKYG-PV6XNJXH.js +0 -15
- package/dist/lib/cubing/chunks/twsearch_wasm_bg-V6CRTKYG-PV6XNJXH.js.map +0 -7
- /package/dist/lib/cubing/chunks/{inside-BCHGO3XT.js.map → inside-NHJHFY3P.js.map} +0 -0
- /package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-JZPYKEUP.js.map → search-dynamic-solve-4x4x4-IKGRCFMI.js.map} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/cubing/vendor/mpl/twsearch/index.js"],
|
|
4
|
-
"sourcesContent": ["// Generated from `twsearch` v0.6.4-31-g67b163a9\n\nimport \"./chunk-FNEBKWKX.js\";\n\n// src/wasm-package/index.ts\nimport { Alg } from \"../../../alg\";\n\n// .temp/rust-wasm/twsearch_wasm.js\nvar node_fs_promises_mangled = \"node:-fs/pr-omises\";\nvar node_fs_promises_unmangled = () => node_fs_promises_mangled.replace(/-/g, \"\");\nvar wasm;\nvar cachedTextDecoder = typeof TextDecoder !== \"undefined\" ? new TextDecoder(\"utf-8\", { ignoreBOM: true, fatal: true }) : { decode: () => {\n throw Error(\"TextDecoder not available\");\n} };\nif (typeof TextDecoder !== \"undefined\") {\n cachedTextDecoder.decode();\n}\nvar cachedUint8Memory0 = null;\nfunction getUint8Memory0() {\n if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {\n cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8Memory0;\n}\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));\n}\nvar heap = new Array(128).fill(void 0);\nheap.push(void 0, null, true, false);\nvar heap_next = heap.length;\nfunction addHeapObject(obj) {\n if (heap_next === heap.length)\n heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n heap[idx] = obj;\n return idx;\n}\nfunction getObject(idx) {\n return heap[idx];\n}\nfunction dropObject(idx) {\n if (idx < 132)\n return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\nfunction debugString(val) {\n const type = typeof val;\n if (type == \"number\" || type == \"boolean\" || val == null) {\n return `${val}`;\n }\n if (type == \"string\") {\n return `\"${val}\"`;\n }\n if (type == \"symbol\") {\n const description = val.description;\n if (description == null) {\n return \"Symbol\";\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == \"function\") {\n const name = val.name;\n if (typeof name == \"string\" && name.length > 0) {\n return `Function(${name})`;\n } else {\n return \"Function\";\n }\n }\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = \"[\";\n if (length > 0) {\n debug += debugString(val[0]);\n }\n for (let i = 1; i < length; i++) {\n debug += \", \" + debugString(val[i]);\n }\n debug += \"]\";\n return debug;\n }\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n return toString.call(val);\n }\n if (className == \"Object\") {\n try {\n return \"Object(\" + JSON.stringify(val) + \")\";\n } catch (_) {\n return \"Object\";\n }\n }\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\n${val.stack}`;\n }\n return className;\n}\nvar WASM_VECTOR_LEN = 0;\nvar cachedTextEncoder = typeof TextEncoder !== \"undefined\" ? new TextEncoder(\"utf-8\") : { encode: () => {\n throw Error(\"TextEncoder not available\");\n} };\nvar encodeString = typeof cachedTextEncoder.encodeInto === \"function\" ? function(arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n} : function(arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n};\nfunction passStringToWasm0(arg, malloc, realloc) {\n if (realloc === void 0) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr2 = malloc(buf.length, 1) >>> 0;\n getUint8Memory0().subarray(ptr2, ptr2 + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr2;\n }\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n const mem = getUint8Memory0();\n let offset = 0;\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 127)\n break;\n mem[ptr + offset] = code;\n }\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8Memory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n offset += ret.written;\n }\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\nvar cachedInt32Memory0 = null;\nfunction getInt32Memory0() {\n if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {\n cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);\n }\n return cachedInt32Memory0;\n}\nfunction wasmRandomScrambleForEvent(event_str) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(event_str, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n wasm.wasmRandomScrambleForEvent(retptr, ptr0, len0);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n var r2 = getInt32Memory0()[retptr / 4 + 2];\n var r3 = getInt32Memory0()[retptr / 4 + 3];\n var ptr2 = r0;\n var len2 = r1;\n if (r3) {\n ptr2 = 0;\n len2 = 0;\n throw takeObject(r2);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n wasm.__wbindgen_export_3(addHeapObject(e));\n }\n}\nasync function __wbg_load(module2, imports) {\n if (typeof Response === \"function\" && module2 instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === \"function\") {\n try {\n return await WebAssembly.instantiateStreaming(module2, imports);\n } catch (e) {\n if (module2.headers.get(\"Content-Type\") != \"application/wasm\") {\n 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\", e);\n } else {\n throw e;\n }\n }\n }\n const bytes = await module2.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module2, imports);\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module: module2 };\n } else {\n return instance;\n }\n }\n}\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbindgen_string_new = function(arg0, arg1) {\n const ret = getStringFromWasm0(arg0, arg1);\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_new_abda76e883ba8a5f = function() {\n const ret = new Error();\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {\n const ret = getObject(arg1).stack;\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len1;\n getInt32Memory0()[arg0 / 4 + 0] = ptr1;\n };\n imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {\n let deferred0_0;\n let deferred0_1;\n try {\n deferred0_0 = arg0;\n deferred0_1 = arg1;\n console.error(getStringFromWasm0(arg0, arg1));\n } finally {\n wasm.__wbindgen_export_2(deferred0_0, deferred0_1, 1);\n }\n };\n imports.wbg.__wbindgen_object_drop_ref = function(arg0) {\n takeObject(arg0);\n };\n imports.wbg.__wbindgen_object_clone_ref = function(arg0) {\n const ret = getObject(arg0);\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) {\n const ret = getObject(arg0).crypto;\n return addHeapObject(ret);\n };\n imports.wbg.__wbindgen_is_object = function(arg0) {\n const val = getObject(arg0);\n const ret = typeof val === \"object\" && val !== null;\n return ret;\n };\n imports.wbg.__wbg_process_298734cf255a885d = function(arg0) {\n const ret = getObject(arg0).process;\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_versions_e2e78e134e3e5d01 = function(arg0) {\n const ret = getObject(arg0).versions;\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_node_1cd7a5d853dbea79 = function(arg0) {\n const ret = getObject(arg0).node;\n return addHeapObject(ret);\n };\n imports.wbg.__wbindgen_is_string = function(arg0) {\n const ret = typeof getObject(arg0) === \"string\";\n return ret;\n };\n imports.wbg.__wbg_require_8f08ceecec0f4fee = function() {\n return handleError(function() {\n const ret = module.require;\n return addHeapObject(ret);\n }, arguments);\n };\n imports.wbg.__wbindgen_is_function = function(arg0) {\n const ret = typeof getObject(arg0) === \"function\";\n return ret;\n };\n imports.wbg.__wbg_call_01734de55d61e11d = function() {\n return handleError(function(arg0, arg1, arg2) {\n const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));\n return addHeapObject(ret);\n }, arguments);\n };\n imports.wbg.__wbg_msCrypto_bcb970640f50a1e8 = function(arg0) {\n const ret = getObject(arg0).msCrypto;\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_newwithlength_e5d69174d6984cd7 = function(arg0) {\n const ret = new Uint8Array(arg0 >>> 0);\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_get_97b561fb56f034b5 = function() {\n return handleError(function(arg0, arg1) {\n const ret = Reflect.get(getObject(arg0), getObject(arg1));\n return addHeapObject(ret);\n }, arguments);\n };\n imports.wbg.__wbg_now_0cfdc90c97d0c24b = function(arg0) {\n const ret = getObject(arg0).now();\n return ret;\n };\n imports.wbg.__wbg_self_1ff1d729e9aae938 = function() {\n return handleError(function() {\n const ret = self.self;\n return addHeapObject(ret);\n }, arguments);\n };\n imports.wbg.__wbg_window_5f4faef6c12b79ec = function() {\n return handleError(function() {\n const ret = window.window;\n return addHeapObject(ret);\n }, arguments);\n };\n imports.wbg.__wbg_globalThis_1d39714405582d3c = function() {\n return handleError(function() {\n const ret = globalThis.globalThis;\n return addHeapObject(ret);\n }, arguments);\n };\n imports.wbg.__wbg_global_651f05c6a0944d1c = function() {\n return handleError(function() {\n const ret = global.global;\n return addHeapObject(ret);\n }, arguments);\n };\n imports.wbg.__wbindgen_is_undefined = function(arg0) {\n const ret = getObject(arg0) === void 0;\n return ret;\n };\n imports.wbg.__wbg_newnoargs_581967eacc0e2604 = function(arg0, arg1) {\n const ret = new Function(getStringFromWasm0(arg0, arg1));\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_call_cb65541d95d71282 = function() {\n return handleError(function(arg0, arg1) {\n const ret = getObject(arg0).call(getObject(arg1));\n return addHeapObject(ret);\n }, arguments);\n };\n imports.wbg.__wbindgen_memory = function() {\n const ret = wasm.memory;\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_buffer_085ec1f694018c4f = function(arg0) {\n const ret = getObject(arg0).buffer;\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) {\n const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_randomFillSync_dc1e9a60c158336d = function() {\n return handleError(function(arg0, arg1) {\n getObject(arg0).randomFillSync(takeObject(arg1));\n }, arguments);\n };\n imports.wbg.__wbg_subarray_13db269f57aa838d = function(arg0, arg1, arg2) {\n const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() {\n return handleError(function(arg0, arg1) {\n getObject(arg0).getRandomValues(getObject(arg1));\n }, arguments);\n };\n imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) {\n const ret = new Uint8Array(getObject(arg0));\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {\n getObject(arg0).set(getObject(arg1), arg2 >>> 0);\n };\n imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {\n const ret = debugString(getObject(arg1));\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len1;\n getInt32Memory0()[arg0 / 4 + 0] = ptr1;\n };\n imports.wbg.__wbindgen_throw = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n return imports;\n}\nfunction __wbg_init_memory(imports, maybe_memory) {\n}\nfunction __wbg_finalize_init(instance, module2) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module2;\n cachedInt32Memory0 = null;\n cachedUint8Memory0 = null;\n return wasm;\n}\nasync function __wbg_init(input) {\n if (wasm !== void 0)\n return wasm;\n if (typeof input === \"undefined\") {\n input = new URL(\"twsearch_wasm_bg.wasm\", import.meta.url);\n }\n const imports = __wbg_get_imports();\n if (typeof input === \"string\" || typeof Request === \"function\" && input instanceof Request || typeof URL === \"function\" && input instanceof URL) {\n try {\n input = await fetch(input);\n } catch (e) {\n if (!(e instanceof TypeError)) {\n throw e;\n }\n input = await (await import(node_fs_promises_unmangled())).readFile(input);\n }\n }\n __wbg_init_memory(imports);\n const { instance, module: module2 } = await __wbg_load(await input, imports);\n return __wbg_finalize_init(instance, module2);\n}\nvar twsearch_wasm_default = __wbg_init;\n\n// src/wasm-package/index.ts\nvar cachedInitWrapper;\nasync function initWrapper() {\n await (cachedInitWrapper ??= (async () => {\n const wasmUint8Array = (await import(\"./twsearch_wasm_bg-V6CRTKYG.js\")).default;\n await twsearch_wasm_default(wasmUint8Array.buffer);\n })());\n}\nasync function wasmRandomScrambleForEvent2(eventId) {\n await initWrapper();\n return new Alg(wasmRandomScrambleForEvent(eventId));\n}\nexport {\n wasmRandomScrambleForEvent2 as wasmRandomScrambleForEvent\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;AAQA,IAAI,2BAA2B;AAC/B,IAAI,6BAA6B,MAAM,yBAAyB,QAAQ,MAAM,EAAE;AAChF,IAAI;AACJ,IAAI,oBAAoB,OAAO,gBAAgB,cAAc,IAAI,YAAY,SAAS,EAAE,WAAW,MAAM,OAAO,KAAK,CAAC,IAAI,EAAE,QAAQ,MAAM;AACxI,QAAM,MAAM,2BAA2B;AACzC,EAAE;AACF,IAAI,OAAO,gBAAgB,aAAa;AACtC,oBAAkB,OAAO;AAC3B;AACA,IAAI,qBAAqB;AACzB,SAAS,kBAAkB;AACzB,MAAI,uBAAuB,QAAQ,mBAAmB,eAAe,GAAG;AACtE,yBAAqB,IAAI,WAAW,KAAK,OAAO,MAAM;AAAA,EACxD;AACA,SAAO;AACT;AACA,SAAS,mBAAmB,KAAK,KAAK;AACpC,QAAM,QAAQ;AACd,SAAO,kBAAkB,OAAO,gBAAgB,EAAE,SAAS,KAAK,MAAM,GAAG,CAAC;AAC5E;AACA,IAAI,OAAO,IAAI,MAAM,GAAG,EAAE,KAAK,MAAM;AACrC,KAAK,KAAK,QAAQ,MAAM,MAAM,KAAK;AACnC,IAAI,YAAY,KAAK;AACrB,SAAS,cAAc,KAAK;AAC1B,MAAI,cAAc,KAAK;AACrB,SAAK,KAAK,KAAK,SAAS,CAAC;AAC3B,QAAM,MAAM;AACZ,cAAY,KAAK,GAAG;AACpB,OAAK,GAAG,IAAI;AACZ,SAAO;AACT;AACA,SAAS,UAAU,K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M,MAAM,KAAK;AAAA,IAC3B,SAAS,GAAG;AACV,UAAI,EAAE,aAAa,YAAY;AAC7B,cAAM;AAAA,MACR;AACA,cAAQ,OAAO,MAAM,OAAO,2BAA2B,IAAI,SAAS,KAAK;AAAA,IAC3E;AAAA,EACF;AACA,oBAAkB,OAAO;AACzB,QAAM,EAAE,UAAU,QAAQ,QAAQ,IAAI,MAAM,WAAW,MAAM,OAAO,OAAO;AAC3E,SAAO,oBAAoB,UAAU,OAAO;AAC9C;AACA,IAAI,wBAAwB;AAG5B,IAAI;AACJ,eAAe,cAAc;AAC3B,SAAO,uBAAuB,YAAY;AACxC,UAAM,kBAAkB,MAAM,OAAO,yCAAgC,GAAG;AACxE,UAAM,sBAAsB,eAAe,MAAM;AAAA,EACnD,GAAG;AACL;AACA,eAAe,4BAA4B,SAAS;AAClD,QAAM,YAAY;AAClB,SAAO,IAAI,IAAI,2BAA2B,OAAO,CAAC;AACpD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Alg
|
|
3
|
-
} from "./chunk-7X47IY3P.js";
|
|
4
|
-
|
|
5
|
-
// src/cubing/vendor/mpl/twsearch-cpp/index.js
|
|
6
|
-
console.info("Loading twsearch v0.4.2");
|
|
7
|
-
async function importOnce() {
|
|
8
|
-
const fn = (await import("./twsearch-BDAXZGZU-JERMHHZP.js")).default;
|
|
9
|
-
return await fn();
|
|
10
|
-
}
|
|
11
|
-
var cachedEmscriptenModule = null;
|
|
12
|
-
async function emscriptenModule() {
|
|
13
|
-
return cachedEmscriptenModule ?? (cachedEmscriptenModule = importOnce());
|
|
14
|
-
}
|
|
15
|
-
function cwrap(fn, returnType, argTypes, processReturnValue = (v) => v) {
|
|
16
|
-
const wrapped = (async () => (await emscriptenModule()).cwrap(fn, returnType, argTypes))();
|
|
17
|
-
return async (...args) => {
|
|
18
|
-
return processReturnValue((await wrapped)(...args));
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
var NoSolutionError = class extends Error {
|
|
22
|
-
};
|
|
23
|
-
function parseResult(s) {
|
|
24
|
-
if (s === "--no solution--") {
|
|
25
|
-
throw new NoSolutionError("");
|
|
26
|
-
}
|
|
27
|
-
return Alg.fromString(s);
|
|
28
|
-
}
|
|
29
|
-
var stringArg = ["string"];
|
|
30
|
-
var setArg = cwrap(
|
|
31
|
-
"w_arg",
|
|
32
|
-
"void",
|
|
33
|
-
stringArg
|
|
34
|
-
);
|
|
35
|
-
var setKPuzzleDefString = cwrap(
|
|
36
|
-
"w_setksolve",
|
|
37
|
-
"void",
|
|
38
|
-
stringArg
|
|
39
|
-
);
|
|
40
|
-
var solveScramble = cwrap(
|
|
41
|
-
"w_solvescramble",
|
|
42
|
-
"string",
|
|
43
|
-
stringArg,
|
|
44
|
-
parseResult
|
|
45
|
-
);
|
|
46
|
-
var solvePattern = cwrap(
|
|
47
|
-
"w_solveposition",
|
|
48
|
-
"string",
|
|
49
|
-
stringArg,
|
|
50
|
-
parseResult
|
|
51
|
-
);
|
|
52
|
-
var BLANK_LINE = "";
|
|
53
|
-
var END = "End";
|
|
54
|
-
function sanitize(s) {
|
|
55
|
-
return s.replaceAll(/[^A-Za-z0-9]/g, "_");
|
|
56
|
-
}
|
|
57
|
-
function serializeMoveTransformation(name, t) {
|
|
58
|
-
const outputLines = [];
|
|
59
|
-
outputLines.push(`MoveTransformation ${sanitize(name)}`);
|
|
60
|
-
for (const [orbitName, orbitData] of Object.entries(t)) {
|
|
61
|
-
outputLines.push(sanitize(orbitName));
|
|
62
|
-
outputLines.push(orbitData.permutation.join(" "));
|
|
63
|
-
outputLines.push(orbitData.orientationDelta.join(" "));
|
|
64
|
-
}
|
|
65
|
-
outputLines.push(END);
|
|
66
|
-
outputLines.push(BLANK_LINE);
|
|
67
|
-
return outputLines.join("\n");
|
|
68
|
-
}
|
|
69
|
-
function serializeScramblePattern(name, t) {
|
|
70
|
-
const outputLines = [];
|
|
71
|
-
outputLines.push(`ScrambleState ${sanitize(name)}`);
|
|
72
|
-
for (const [orbitName, orbitData] of Object.entries(t)) {
|
|
73
|
-
outputLines.push(sanitize(orbitName));
|
|
74
|
-
outputLines.push(orbitData.pieces.join(" "));
|
|
75
|
-
const orientationEntries = [];
|
|
76
|
-
for (let i = 0; i < orbitData.orientation.length; i++) {
|
|
77
|
-
switch (orbitData.orientationMod?.[i] ?? 0) {
|
|
78
|
-
case 0: {
|
|
79
|
-
orientationEntries.push(orbitData.orientation[i]);
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
case 1: {
|
|
83
|
-
orientationEntries.push("?");
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
default:
|
|
87
|
-
throw new Error("Unsupported `orientationMod` value.");
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
outputLines.push(orientationEntries.join(" "));
|
|
91
|
-
}
|
|
92
|
-
outputLines.push(END);
|
|
93
|
-
outputLines.push(BLANK_LINE);
|
|
94
|
-
return outputLines.join("\n");
|
|
95
|
-
}
|
|
96
|
-
function serializeDefToTws(kpuzzle, options) {
|
|
97
|
-
let outputLines = [];
|
|
98
|
-
const def = kpuzzle.definition;
|
|
99
|
-
outputLines.push(`Name ${sanitize(def.name ?? "CustomPuzzle")}`);
|
|
100
|
-
outputLines.push(BLANK_LINE);
|
|
101
|
-
for (const orbitDefinition of def.orbits) {
|
|
102
|
-
outputLines.push(
|
|
103
|
-
`Set ${sanitize(orbitDefinition.orbitName)} ${orbitDefinition.numPieces} ${orbitDefinition.numOrientations}`
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
outputLines.push(BLANK_LINE);
|
|
107
|
-
outputLines.push("StartState");
|
|
108
|
-
if (options?.startPattern) {
|
|
109
|
-
outputLines.push(options?.startPattern);
|
|
110
|
-
} else {
|
|
111
|
-
for (const [orbitName, orbitData] of Object.entries(def.defaultPattern)) {
|
|
112
|
-
outputLines.push(sanitize(orbitName));
|
|
113
|
-
outputLines.push(orbitData.pieces.join(" "));
|
|
114
|
-
const orientationEntries = [];
|
|
115
|
-
for (let i = 0; i < orbitData.orientation.length; i++) {
|
|
116
|
-
switch (orbitData.orientationMod?.[i] ?? 0) {
|
|
117
|
-
case 0: {
|
|
118
|
-
orientationEntries.push(orbitData.orientation[i]);
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
case 1: {
|
|
122
|
-
orientationEntries.push("?");
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
default:
|
|
126
|
-
throw new Error("Unsupported `orientationMod` value.");
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
outputLines.push(orientationEntries.join(" "));
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
outputLines.push(END);
|
|
133
|
-
outputLines.push(BLANK_LINE);
|
|
134
|
-
function include(moveName) {
|
|
135
|
-
if (options?.moveSubset) {
|
|
136
|
-
return options.moveSubset.includes(moveName);
|
|
137
|
-
} else {
|
|
138
|
-
return true;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
for (const [moveName, moveDef] of Object.entries(def.moves)) {
|
|
142
|
-
if (include(moveName)) {
|
|
143
|
-
outputLines.push(serializeMoveTransformation(moveName, moveDef));
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
for (const [moveName, moveAlgDef] of Object.entries(
|
|
147
|
-
def.derivedMoves ?? {}
|
|
148
|
-
)) {
|
|
149
|
-
if (include(moveName)) {
|
|
150
|
-
const transformation = kpuzzle.algToTransformation(moveAlgDef);
|
|
151
|
-
outputLines.push(
|
|
152
|
-
serializeMoveTransformation(
|
|
153
|
-
moveName,
|
|
154
|
-
transformation.transformationData
|
|
155
|
-
)
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return outputLines.join("\n");
|
|
160
|
-
}
|
|
161
|
-
export {
|
|
162
|
-
NoSolutionError,
|
|
163
|
-
serializeDefToTws,
|
|
164
|
-
serializeMoveTransformation,
|
|
165
|
-
serializeScramblePattern,
|
|
166
|
-
setArg,
|
|
167
|
-
setKPuzzleDefString,
|
|
168
|
-
solvePattern,
|
|
169
|
-
solveScramble
|
|
170
|
-
};
|
|
171
|
-
//# sourceMappingURL=twsearch-cpp-CUTU3IFM.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/cubing/vendor/mpl/twsearch-cpp/index.js"],
|
|
4
|
-
"sourcesContent": ["console.info(\"Loading twsearch v0.4.2\");\n// src/js/api.ts\nimport { Alg } from \"../../../alg\";\nasync function importOnce() {\n const fn = (await import(\"./twsearch-BDAXZGZU.js\")).default;\n return await fn();\n}\nvar cachedEmscriptenModule = null;\nasync function emscriptenModule() {\n return cachedEmscriptenModule ?? (cachedEmscriptenModule = importOnce());\n}\nfunction cwrap(fn, returnType, argTypes, processReturnValue = (v) => v) {\n const wrapped = (async () => (await emscriptenModule()).cwrap(fn, returnType, argTypes))();\n return async (...args) => {\n return processReturnValue((await wrapped)(...args));\n };\n}\nvar NoSolutionError = class extends Error {\n};\nfunction parseResult(s) {\n if (s === \"--no solution--\") {\n throw new NoSolutionError(\"\");\n }\n return Alg.fromString(s);\n}\nvar stringArg = [\"string\"];\nvar setArg = cwrap(\n \"w_arg\",\n \"void\",\n stringArg\n);\nvar setKPuzzleDefString = cwrap(\n \"w_setksolve\",\n \"void\",\n stringArg\n);\nvar solveScramble = cwrap(\n \"w_solvescramble\",\n \"string\",\n stringArg,\n parseResult\n);\nvar solvePattern = cwrap(\n \"w_solveposition\",\n \"string\",\n stringArg,\n parseResult\n);\n\n// src/js/serialize.ts\nvar BLANK_LINE = \"\";\nvar END = \"End\";\nfunction sanitize(s) {\n return s.replaceAll(/[^A-Za-z0-9]/g, \"_\");\n}\nfunction serializeMoveTransformation(name, t) {\n const outputLines = [];\n outputLines.push(`MoveTransformation ${sanitize(name)}`);\n for (const [orbitName, orbitData] of Object.entries(t)) {\n outputLines.push(sanitize(orbitName));\n outputLines.push(orbitData.permutation.join(\" \"));\n outputLines.push(orbitData.orientationDelta.join(\" \"));\n }\n outputLines.push(END);\n outputLines.push(BLANK_LINE);\n return outputLines.join(\"\\n\");\n}\nfunction serializeScramblePattern(name, t) {\n const outputLines = [];\n outputLines.push(`ScrambleState ${sanitize(name)}`);\n for (const [orbitName, orbitData] of Object.entries(t)) {\n outputLines.push(sanitize(orbitName));\n outputLines.push(orbitData.pieces.join(\" \"));\n const orientationEntries = [];\n for (let i = 0; i < orbitData.orientation.length; i++) {\n switch (orbitData.orientationMod?.[i] ?? 0) {\n case 0: {\n orientationEntries.push(orbitData.orientation[i]);\n break;\n }\n case 1: {\n orientationEntries.push(\"?\");\n break;\n }\n default:\n throw new Error(\"Unsupported `orientationMod` value.\");\n }\n }\n outputLines.push(orientationEntries.join(\" \"));\n }\n outputLines.push(END);\n outputLines.push(BLANK_LINE);\n return outputLines.join(\"\\n\");\n}\nfunction serializeDefToTws(kpuzzle, options) {\n let outputLines = [];\n const def = kpuzzle.definition;\n outputLines.push(`Name ${sanitize(def.name ?? \"CustomPuzzle\")}`);\n outputLines.push(BLANK_LINE);\n for (const orbitDefinition of def.orbits) {\n outputLines.push(\n `Set ${sanitize(orbitDefinition.orbitName)} ${orbitDefinition.numPieces} ${orbitDefinition.numOrientations}`\n );\n }\n outputLines.push(BLANK_LINE);\n outputLines.push(\"StartState\");\n if (options?.startPattern) {\n outputLines.push(options?.startPattern);\n } else {\n for (const [orbitName, orbitData] of Object.entries(def.defaultPattern)) {\n outputLines.push(sanitize(orbitName));\n outputLines.push(orbitData.pieces.join(\" \"));\n const orientationEntries = [];\n for (let i = 0; i < orbitData.orientation.length; i++) {\n switch (orbitData.orientationMod?.[i] ?? 0) {\n case 0: {\n orientationEntries.push(orbitData.orientation[i]);\n break;\n }\n case 1: {\n orientationEntries.push(\"?\");\n break;\n }\n default:\n throw new Error(\"Unsupported `orientationMod` value.\");\n }\n }\n outputLines.push(orientationEntries.join(\" \"));\n }\n }\n outputLines.push(END);\n outputLines.push(BLANK_LINE);\n function include(moveName) {\n if (options?.moveSubset) {\n return options.moveSubset.includes(moveName);\n } else {\n return true;\n }\n }\n for (const [moveName, moveDef] of Object.entries(def.moves)) {\n if (include(moveName)) {\n outputLines.push(serializeMoveTransformation(moveName, moveDef));\n }\n }\n for (const [moveName, moveAlgDef] of Object.entries(\n def.derivedMoves ?? {}\n )) {\n if (include(moveName)) {\n const transformation = kpuzzle.algToTransformation(moveAlgDef);\n outputLines.push(\n serializeMoveTransformation(\n moveName,\n transformation.transformationData\n )\n );\n }\n }\n return outputLines.join(\"\\n\");\n}\nexport {\n NoSolutionError,\n serializeDefToTws,\n serializeMoveTransformation,\n serializeScramblePattern,\n setArg,\n setKPuzzleDefString,\n solveScramble,\n solvePattern\n};\n"],
|
|
5
|
-
"mappings": ";;;;;AAAA,QAAQ,KAAK,yBAAyB;AAGtC,eAAe,aAAa;AAC1B,QAAM,MAAM,MAAM,OAAO,iCAAwB,GAAG;AACpD,SAAO,MAAM,GAAG;AAClB;AACA,IAAI,yBAAyB;AAC7B,eAAe,mBAAmB;AAChC,SAAO,2BAA2B,yBAAyB,WAAW;AACxE;AACA,SAAS,MAAM,IAAI,YAAY,UAAU,qBAAqB,CAAC,MAAM,GAAG;AACtE,QAAM,WAAW,aAAa,MAAM,iBAAiB,GAAG,MAAM,IAAI,YAAY,QAAQ,GAAG;AACzF,SAAO,UAAU,SAAS;AACxB,WAAO,oBAAoB,MAAM,SAAS,GAAG,IAAI,CAAC;AAAA,EACpD;AACF;AACA,IAAI,kBAAkB,cAAc,MAAM;AAC1C;AACA,SAAS,YAAY,GAAG;AACtB,MAAI,MAAM,mBAAmB;AAC3B,UAAM,IAAI,gBAAgB,EAAE;AAAA,EAC9B;AACA,SAAO,IAAI,WAAW,CAAC;AACzB;AACA,IAAI,YAAY,CAAC,QAAQ;AACzB,IAAI,SAAS;AAAA,EACX;AAAA,EACA;AAAA,EACA;AACF;AACA,IAAI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