cubing 0.65.2 → 0.66.1

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.
Files changed (106) hide show
  1. package/dist/bin/chunks/{chunk-Z5QOJAME.js → chunk-HS7R54XN.js} +2 -2
  2. package/dist/bin/order.js +1 -1
  3. package/dist/bin/puzzle-geometry-bin.js +1 -1
  4. package/dist/bin/scramble.js +1 -1
  5. package/dist/bin/svg.js +1 -1
  6. package/dist/lib/cubing/alg/index.d.ts +1 -1
  7. package/dist/lib/cubing/alg/index.js +1 -2
  8. package/dist/lib/cubing/bluetooth/index.d.ts +2 -2
  9. package/dist/lib/cubing/bluetooth/index.js +5 -6
  10. package/dist/lib/cubing/chunks/{big-puzzle-orientation-7WHPJCCO.js → big-puzzle-orientation-KJL4OFV2.js} +1 -2
  11. package/dist/lib/cubing/chunks/{chunk-2IA2R7XV.js → chunk-6R47S6MP.js} +24 -25
  12. package/dist/lib/cubing/chunks/{chunk-YSAQ6DRT.js → chunk-7LEVC3YR.js} +1 -2
  13. package/dist/lib/cubing/chunks/{chunk-7GUL3OBQ.js → chunk-BHVTDDUY.js} +0 -1
  14. package/dist/lib/cubing/chunks/{chunk-5FXQPBXH.js → chunk-IIJFVP3K.js} +6 -7
  15. package/dist/lib/cubing/chunks/{chunk-IRY6MBI2.js → chunk-KH2MQ7KY.js} +2 -3
  16. package/dist/lib/cubing/chunks/{chunk-BQPY6252.js → chunk-LBER75W4.js} +1 -2
  17. package/dist/lib/cubing/chunks/{chunk-MFKLAFPQ.js → chunk-NJ66FRKF.js} +3 -4
  18. package/dist/lib/cubing/chunks/{chunk-2BVL5OQE.js → chunk-QOLD6GH2.js} +5 -6
  19. package/dist/lib/cubing/chunks/{chunk-UP5VP7GL.js → chunk-QZK3M7IM.js} +0 -20
  20. package/dist/lib/cubing/chunks/chunk-RDKH6CDA.js +0 -0
  21. package/dist/lib/cubing/chunks/{chunk-6K433TB5.js → chunk-T5M3DY5P.js} +2 -3
  22. package/dist/lib/cubing/chunks/{chunk-MIHF623Z.js → chunk-UKAXYOG2.js} +2 -3
  23. package/dist/lib/cubing/chunks/{chunk-GHFBZYSV.js → chunk-YJH5LHFN.js} +0 -1
  24. package/dist/lib/cubing/chunks/{inside-N5WSMI7I.js → inside-UWSZBO4Y.js} +14 -15
  25. package/dist/lib/cubing/chunks/{puzzles-dynamic-3x3x3-FYXD7SIU.js → puzzles-dynamic-3x3x3-CMH2HHH5.js} +0 -1
  26. package/dist/lib/cubing/chunks/{puzzles-dynamic-4x4x4-AIGABOAR.js → puzzles-dynamic-4x4x4-UFAQS3QG.js} +0 -1
  27. package/dist/lib/cubing/chunks/{puzzles-dynamic-megaminx-2LVHIDL4.js → puzzles-dynamic-megaminx-EFR4GQFA.js} +0 -1
  28. package/dist/lib/cubing/chunks/{puzzles-dynamic-side-events-653A7JCM.js → puzzles-dynamic-side-events-KF3PEOJN.js} +0 -1
  29. package/dist/lib/cubing/chunks/{puzzles-dynamic-unofficial-2CY6GVZ4.js → puzzles-dynamic-unofficial-6BF3EWTI.js} +0 -1
  30. package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-5EIXNDVI.js → search-dynamic-sgs-side-events-5GQDHSJR.js} +5 -6
  31. package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-Y7SIOVIX.js → search-dynamic-sgs-unofficial-YM23KVCN.js} +90 -78
  32. package/dist/lib/cubing/chunks/{search-dynamic-solve-3x3x3-B2L4IN34.js → search-dynamic-solve-3x3x3-6UMZH4WB.js} +3 -6
  33. package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-FRAX3IPQ.js → search-dynamic-solve-4x4x4-KNSBAM7Q.js} +14 -17
  34. package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-TI4TFL6X.js → search-dynamic-solve-fto-CSXJYISF.js} +200 -90
  35. package/dist/lib/cubing/chunks/{search-dynamic-solve-kilominx-UKFT6I42.js → search-dynamic-solve-kilominx-EHAUQJXS.js} +105 -113
  36. package/dist/lib/cubing/chunks/{search-dynamic-solve-master_tetraminx-GIS7T5B7.js → search-dynamic-solve-master_tetraminx-ZQ25QK7E.js} +99 -100
  37. package/dist/lib/cubing/chunks/search-worker-entry.js +2 -3
  38. package/dist/lib/cubing/chunks/{twips-UCWWA2WI.js → twips-IMF5RNH5.js} +3 -4
  39. package/dist/lib/cubing/chunks/{twips_wasm_bg-TJNYGA2C-AP2O4LGG.js → twips_wasm_bg-TJNYGA2C-4JIZWC6Q.js} +1 -2
  40. package/dist/lib/cubing/chunks/{twisty-dynamic-3d-O5TGOSAO.js → twisty-dynamic-3d-HSYJR5CM.js} +5 -6
  41. package/dist/lib/cubing/{index-COSxNAgV.d.ts → index-lAUL_nRN.d.ts} +1 -1
  42. package/dist/lib/cubing/{index-BQdS3h4z.d.ts → index-nWspzjVK.d.ts} +43 -43
  43. package/dist/lib/cubing/kpuzzle/index.d.ts +1 -1
  44. package/dist/lib/cubing/kpuzzle/index.js +2 -3
  45. package/dist/lib/cubing/notation/index.d.ts +1 -1
  46. package/dist/lib/cubing/notation/index.js +4 -5
  47. package/dist/lib/cubing/{outside-BRtF0DA2.d.ts → outside-CD19aDjE.d.ts} +1 -1
  48. package/dist/lib/cubing/protocol/index.d.ts +1 -1
  49. package/dist/lib/cubing/protocol/index.js +4 -5
  50. package/dist/lib/cubing/puzzle-geometry/index.d.ts +1 -1
  51. package/dist/lib/cubing/puzzle-geometry/index.js +375 -375
  52. package/dist/lib/cubing/puzzles/index.d.ts +1 -1
  53. package/dist/lib/cubing/puzzles/index.js +4 -5
  54. package/dist/lib/cubing/scramble/index.d.ts +1 -1
  55. package/dist/lib/cubing/scramble/index.js +8 -9
  56. package/dist/lib/cubing/search/index.d.ts +1 -1
  57. package/dist/lib/cubing/search/index.js +7 -8
  58. package/dist/lib/cubing/stream/index.d.ts +1 -1
  59. package/dist/lib/cubing/stream/index.js +1 -2
  60. package/dist/lib/cubing/twisty/index.d.ts +1 -1
  61. package/dist/lib/cubing/twisty/index.js +6 -7
  62. package/package.json +1 -1
  63. package/dist/lib/cubing/alg/index.js.map +0 -7
  64. package/dist/lib/cubing/bluetooth/index.js.map +0 -7
  65. package/dist/lib/cubing/chunks/big-puzzle-orientation-7WHPJCCO.js.map +0 -7
  66. package/dist/lib/cubing/chunks/chunk-2BVL5OQE.js.map +0 -7
  67. package/dist/lib/cubing/chunks/chunk-2IA2R7XV.js.map +0 -7
  68. package/dist/lib/cubing/chunks/chunk-5FXQPBXH.js.map +0 -7
  69. package/dist/lib/cubing/chunks/chunk-6K433TB5.js.map +0 -7
  70. package/dist/lib/cubing/chunks/chunk-7GUL3OBQ.js.map +0 -7
  71. package/dist/lib/cubing/chunks/chunk-BQPY6252.js.map +0 -7
  72. package/dist/lib/cubing/chunks/chunk-GHFBZYSV.js.map +0 -7
  73. package/dist/lib/cubing/chunks/chunk-IRY6MBI2.js.map +0 -7
  74. package/dist/lib/cubing/chunks/chunk-MFKLAFPQ.js.map +0 -7
  75. package/dist/lib/cubing/chunks/chunk-MIHF623Z.js.map +0 -7
  76. package/dist/lib/cubing/chunks/chunk-NAPITA3L.js +0 -1
  77. package/dist/lib/cubing/chunks/chunk-NAPITA3L.js.map +0 -7
  78. package/dist/lib/cubing/chunks/chunk-UP5VP7GL.js.map +0 -7
  79. package/dist/lib/cubing/chunks/chunk-YSAQ6DRT.js.map +0 -7
  80. package/dist/lib/cubing/chunks/inside-N5WSMI7I.js.map +0 -7
  81. package/dist/lib/cubing/chunks/puzzles-dynamic-3x3x3-FYXD7SIU.js.map +0 -7
  82. package/dist/lib/cubing/chunks/puzzles-dynamic-4x4x4-AIGABOAR.js.map +0 -7
  83. package/dist/lib/cubing/chunks/puzzles-dynamic-megaminx-2LVHIDL4.js.map +0 -7
  84. package/dist/lib/cubing/chunks/puzzles-dynamic-side-events-653A7JCM.js.map +0 -7
  85. package/dist/lib/cubing/chunks/puzzles-dynamic-unofficial-2CY6GVZ4.js.map +0 -7
  86. package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-5EIXNDVI.js.map +0 -7
  87. package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-Y7SIOVIX.js.map +0 -7
  88. package/dist/lib/cubing/chunks/search-dynamic-solve-3x3x3-B2L4IN34.js.map +0 -7
  89. package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-FRAX3IPQ.js.map +0 -7
  90. package/dist/lib/cubing/chunks/search-dynamic-solve-fto-TI4TFL6X.js.map +0 -7
  91. package/dist/lib/cubing/chunks/search-dynamic-solve-kilominx-UKFT6I42.js.map +0 -7
  92. package/dist/lib/cubing/chunks/search-dynamic-solve-master_tetraminx-GIS7T5B7.js.map +0 -7
  93. package/dist/lib/cubing/chunks/search-worker-entry.js.map +0 -7
  94. package/dist/lib/cubing/chunks/twips-UCWWA2WI.js.map +0 -7
  95. package/dist/lib/cubing/chunks/twips_wasm_bg-TJNYGA2C-AP2O4LGG.js.map +0 -7
  96. package/dist/lib/cubing/chunks/twisty-dynamic-3d-O5TGOSAO.js.map +0 -7
  97. package/dist/lib/cubing/kpuzzle/index.js.map +0 -7
  98. package/dist/lib/cubing/notation/index.js.map +0 -7
  99. package/dist/lib/cubing/protocol/index.js.map +0 -7
  100. package/dist/lib/cubing/puzzle-geometry/index.js.map +0 -7
  101. package/dist/lib/cubing/puzzles/index.js.map +0 -7
  102. package/dist/lib/cubing/scramble/index.js.map +0 -7
  103. package/dist/lib/cubing/search/index.js.map +0 -7
  104. package/dist/lib/cubing/stream/index.js.map +0 -7
  105. package/dist/lib/cubing/twisty/index.js.map +0 -7
  106. /package/dist/bin/chunks/{chunk-Z5QOJAME.js.map → chunk-HS7R54XN.js.map} +0 -0
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Alg
3
- } from "./chunk-UP5VP7GL.js";
3
+ } from "./chunk-QZK3M7IM.js";
4
4
 
5
- // src/cubing/vendor/mpl/xyzzy/kilosolver.js
5
+ // src/cubing/vendor/mpl/xyzzy/kilosolver.ts
6
6
  import { randomUIntBelow } from "random-uint-below";
7
7
  var PHASE4_THRESHOLD = 7;
8
8
  function factorial(n) {
@@ -35,10 +35,10 @@ function permutation_to_index(perm) {
35
35
  let ind = 0;
36
36
  while (n > 1) {
37
37
  n--;
38
- let e = perm[0];
38
+ const e = perm[0];
39
39
  ind += e * f;
40
40
  for (let i = 0; i < n; i++) {
41
- let x = perm[i + 1];
41
+ const x = perm[i + 1];
42
42
  perm[i] = x - (x > e);
43
43
  }
44
44
  f /= n;
@@ -46,7 +46,7 @@ function permutation_to_index(perm) {
46
46
  return ind;
47
47
  }
48
48
  function permutation_parity(A) {
49
- let n = A.length;
49
+ const n = A.length;
50
50
  let parity = 0;
51
51
  for (let i = 0; i < n - 1; i++) {
52
52
  for (let j = i; j < n; j++) {
@@ -61,8 +61,8 @@ function evenpermutation_to_index(perm) {
61
61
  return permutation_to_index(perm) >> 1;
62
62
  }
63
63
  var [evenpermutation10_to_index, index_to_evenpermutation10] = (() => {
64
- let index_in_set_bits = new Int8Array(1024 * 10);
65
- let look_up_set_bits = new Int8Array(1024 * 10);
64
+ const index_in_set_bits = new Int8Array(1024 * 10);
65
+ const look_up_set_bits = new Int8Array(1024 * 10);
66
66
  for (let i = 0; i < 1024; i++) {
67
67
  for (let j = 0, counter = 0; j < 10; j++) {
68
68
  if ((i >>> j & 1) === 0) {
@@ -78,7 +78,7 @@ var [evenpermutation10_to_index, index_to_evenpermutation10] = (() => {
78
78
  let f = 181440;
79
79
  let ind = 0;
80
80
  for (let i = 0; i < 8; i++) {
81
- let v = perm[i];
81
+ const v = perm[i];
82
82
  ind += index_in_set_bits[unused | v << 10] * f;
83
83
  unused &= ~(1 << v);
84
84
  f /= 9 - i;
@@ -90,10 +90,10 @@ var [evenpermutation10_to_index, index_to_evenpermutation10] = (() => {
90
90
  let f = 181440;
91
91
  let parity = 0;
92
92
  for (let i = 0; i < 8; i++) {
93
- let a = ind / f | 0;
93
+ const a = ind / f | 0;
94
94
  ind -= a * f;
95
95
  parity ^= a & 1;
96
- let v = look_up_set_bits[unused | a << 10];
96
+ const v = look_up_set_bits[unused | a << 10];
97
97
  perm[i] = v;
98
98
  unused &= ~(1 << v);
99
99
  f /= 9 - i;
@@ -130,8 +130,8 @@ function comb_to_index(l) {
130
130
  function index_to_comb(ind, ones, bits) {
131
131
  let zeros = bits - ones;
132
132
  let b = C(bits - 1, ones);
133
- let l = [];
134
- let n = bits - 1;
133
+ const l = [];
134
+ const n = bits - 1;
135
135
  for (let i = 0; i < n; i++) {
136
136
  bits--;
137
137
  if (ind < b) {
@@ -147,23 +147,23 @@ function index_to_comb(ind, ones, bits) {
147
147
  return l;
148
148
  }
149
149
  function compose(A, B) {
150
- let C2 = [];
150
+ const C2 = [];
151
151
  for (let i = 0; i < B.length; i++) {
152
152
  C2[i] = A[B[i]];
153
153
  }
154
154
  return C2;
155
155
  }
156
156
  function compose_o(A, B) {
157
- let p = compose(A[0], B[0]);
158
- let o = [];
159
- let n = B[0].length;
157
+ const p = compose(A[0], B[0]);
158
+ const o = [];
159
+ const n = B[0].length;
160
160
  for (let i = 0; i < n; i++) {
161
161
  o[i] = (A[1][B[0][i]] + B[1][i]) % 3;
162
162
  }
163
163
  return [p, o];
164
164
  }
165
165
  function permutation_from_cycle(cycle, n) {
166
- let perm = [];
166
+ const perm = [];
167
167
  for (let i = 0; i < n; i++) {
168
168
  perm[i] = i;
169
169
  }
@@ -173,8 +173,8 @@ function permutation_from_cycle(cycle, n) {
173
173
  return perm;
174
174
  }
175
175
  function unsparsify_list(d, n) {
176
- let l = Array(n).fill(0);
177
- for (let k in d) {
176
+ const l = Array(n).fill(0);
177
+ for (const k in d) {
178
178
  l[k] = d[k];
179
179
  }
180
180
  return l;
@@ -222,16 +222,16 @@ for (let i = 0; i < moves.length; i++) {
222
222
  }
223
223
  }
224
224
  function random_state() {
225
- let p = [0];
225
+ const p = [0];
226
226
  for (let i = 1; i < 20; i++) {
227
- let r = randomUIntBelow(i + 1);
227
+ const r = randomUIntBelow(i + 1);
228
228
  p[i] = p[r];
229
229
  p[r] = i;
230
230
  }
231
231
  if (permutation_parity(p) === 1) {
232
232
  [p[0], p[1]] = [p[1], p[0]];
233
233
  }
234
- let o = Array(20).fill(0);
234
+ const o = Array(20).fill(0);
235
235
  for (let i = 0; i < 19; i++) {
236
236
  o[i] = randomUIntBelow(3);
237
237
  o[19] += 3 - o[i];
@@ -240,12 +240,12 @@ function random_state() {
240
240
  return [p, o];
241
241
  }
242
242
  function stringify_move_sequence(move_sequence) {
243
- let suffixes = ["0", "", "2", "2'", "'"];
244
- let s = move_sequence.map(([m, r]) => move_names[m] + suffixes[r]);
243
+ const suffixes = ["0", "", "2", "2'", "'"];
244
+ const s = move_sequence.map(([m, r]) => move_names[m] + suffixes[r]);
245
245
  return s.join(" ");
246
246
  }
247
247
  function apply_move_sequence(state, move_sequence) {
248
- for (let [m, r] of move_sequence) {
248
+ for (const [m, r] of move_sequence) {
249
249
  for (let i = 0; i < r; i++) {
250
250
  state = compose_o(state, moves[m]);
251
251
  }
@@ -256,14 +256,14 @@ function generate_random_state_scramble() {
256
256
  return solve(random_state());
257
257
  }
258
258
  function solve_phase1(state) {
259
- let p = state[0];
259
+ const p = state[0];
260
260
  if (p.slice(15, 20).every((x) => x < 15)) {
261
261
  return [];
262
262
  }
263
263
  if (p.slice(0, 5).every((x) => x < 15)) {
264
264
  return [[6, 1]];
265
265
  }
266
- let flags = p.map((x) => x >= 15);
266
+ const flags = p.map((x) => x >= 15);
267
267
  let depth = 0;
268
268
  let sol;
269
269
  while (sol === void 0) {
@@ -285,8 +285,8 @@ function search_phase1(flags, depth, last) {
285
285
  continue;
286
286
  }
287
287
  for (let r = 1; r < 5; r++) {
288
- let new_flags = compose(flags, moves_full[move_index][r][0]);
289
- let sol = search_phase1(new_flags, depth - 1, move_index);
288
+ const new_flags = compose(flags, moves_full[move_index][r][0]);
289
+ const sol = search_phase1(new_flags, depth - 1, move_index);
290
290
  if (sol !== void 0) {
291
291
  return [[move_index, r]].concat(sol);
292
292
  }
@@ -295,73 +295,73 @@ function search_phase1(flags, depth, last) {
295
295
  return;
296
296
  }
297
297
  function index_phase2(state) {
298
- let p = state[0].slice(0, 15);
299
- let o = state[1];
300
- let index_c = comb_to_index(p.map((x) => +(x >= 15)));
298
+ const p = state[0].slice(0, 15);
299
+ const o = state[1];
300
+ const index_c = comb_to_index(p.map((x) => +(x >= 15)));
301
301
  let index_o = 243 * index_c;
302
302
  for (let i = 0, j = 0; i < 15; i++) {
303
303
  if (p[i] < 15) {
304
304
  continue;
305
305
  }
306
- index_o += o[i] * Math.pow(3, j);
306
+ index_o += o[i] * 3 ** j;
307
307
  j++;
308
308
  }
309
309
  let index_p = 0;
310
310
  for (let i = 0; i < 5; i++) {
311
- index_p += p.indexOf(15 + i) * Math.pow(15, i);
311
+ index_p += p.indexOf(15 + i) * 15 ** i;
312
312
  }
313
313
  return [index_o, index_p];
314
314
  }
315
315
  function solve_phase2(state) {
316
- let mtables = [
316
+ const mtables = [
317
317
  generate_phase23_orientation_mtable(),
318
318
  generate_phase23_permutation_mtable()
319
319
  ];
320
- let ptables = [
320
+ const ptables = [
321
321
  generate_phase2_orientation_ptable(),
322
322
  generate_phase2_permutation_ptable()
323
323
  ];
324
324
  return ida_solve(index_phase2(state), mtables, ptables).concat([[6, 1]]);
325
325
  }
326
326
  function index_phase3(state) {
327
- let pieces = [5, 6, 7, 8, 14];
328
- let p = state[0].slice(0, 15);
329
- let o = state[1];
330
- let index_c = comb_to_index(p.map((x) => +(pieces.indexOf(x) !== -1)));
327
+ const pieces = [5, 6, 7, 8, 14];
328
+ const p = state[0].slice(0, 15);
329
+ const o = state[1];
330
+ const index_c = comb_to_index(p.map((x) => +(pieces.indexOf(x) !== -1)));
331
331
  let index_o = 243 * index_c;
332
332
  for (let i = 0, j = 0; i < 15; i++) {
333
333
  if (pieces.indexOf(p[i]) === -1) {
334
334
  continue;
335
335
  }
336
- index_o += o[i] * Math.pow(3, j);
336
+ index_o += o[i] * 3 ** j;
337
337
  j++;
338
338
  }
339
339
  let index_p = 0;
340
340
  for (let i = 0; i < 5; i++) {
341
- index_p += p.indexOf(pieces[i]) * Math.pow(15, i);
341
+ index_p += p.indexOf(pieces[i]) * 15 ** i;
342
342
  }
343
343
  return [index_o, index_p];
344
344
  }
345
345
  function solve_phase3(state) {
346
- let mtables = [
346
+ const mtables = [
347
347
  generate_phase23_orientation_mtable(),
348
348
  generate_phase23_permutation_mtable()
349
349
  ];
350
- let ptables = [
350
+ const ptables = [
351
351
  generate_phase3_orientation_ptable(),
352
352
  generate_phase3_permutation_ptable()
353
353
  ];
354
354
  return ida_solve(index_phase3(state), mtables, ptables);
355
355
  }
356
356
  function index_phase4(state) {
357
- let p = state[0].slice(0, 14);
358
- let o = state[1];
357
+ const p = state[0].slice(0, 14);
358
+ const o = state[1];
359
359
  let index_o = 0;
360
- let perm = [];
360
+ const perm = [];
361
361
  let j = 0;
362
- for (let i of [0, 1, 2, 3, 4, 9, 10, 11, 12, 13]) {
362
+ for (const i of [0, 1, 2, 3, 4, 9, 10, 11, 12, 13]) {
363
363
  if (i !== 13) {
364
- index_o += o[i] * Math.pow(3, j);
364
+ index_o += o[i] * 3 ** j;
365
365
  }
366
366
  perm[j] = p[i] < 5 ? p[i] : p[i] - 4;
367
367
  j++;
@@ -373,13 +373,13 @@ function solve_phase4_fast(state) {
373
373
  }
374
374
  function solve(state) {
375
375
  let sol = [];
376
- for (let solver of [
376
+ for (const solver of [
377
377
  solve_phase1,
378
378
  solve_phase2,
379
379
  solve_phase3,
380
380
  solve_phase4_fast
381
381
  ]) {
382
- let phase_sol = solver(state);
382
+ const phase_sol = solver(state);
383
383
  state = apply_move_sequence(state, phase_sol);
384
384
  sol = sol.concat(phase_sol);
385
385
  }
@@ -392,18 +392,18 @@ function generate_phase23_orientation_mtable() {
392
392
  }
393
393
  const C15_5 = C(15, 5);
394
394
  const THREE = [1, 3, 9, 27, 81, 243];
395
- let phase23om = Array(C(15, 5) * THREE[5]);
395
+ const phase23om = Array(C(15, 5) * THREE[5]);
396
396
  tables.phase23om = phase23om;
397
397
  for (let i = 0; i < C15_5; i++) {
398
- let comb = index_to_comb(i, 5, 15).concat(Array(5).fill(0));
399
- let new_comb_indices = [];
398
+ const comb = index_to_comb(i, 5, 15).concat(Array(5).fill(0));
399
+ const new_comb_indices = [];
400
400
  for (let move_index = 0; move_index < 6; move_index++) {
401
- let new_comb = compose(comb, moves[move_index][0]).slice(0, 15);
401
+ const new_comb = compose(comb, moves[move_index][0]).slice(0, 15);
402
402
  new_comb_indices[move_index] = comb_to_index(new_comb);
403
403
  }
404
404
  for (let j = 0; j < THREE[5]; j++) {
405
405
  phase23om[j + 243 * i] = [];
406
- let orient_full = [];
406
+ const orient_full = [];
407
407
  for (let k = 0, l = 0; k < 20; k++) {
408
408
  if (comb[k] === 1) {
409
409
  orient_full[k] = (j / THREE[l] | 0) % 3;
@@ -413,12 +413,12 @@ function generate_phase23_orientation_mtable() {
413
413
  }
414
414
  }
415
415
  for (let move_index = 0; move_index < 6; move_index++) {
416
- let move = moves[move_index];
417
- let new_orient_full = [];
416
+ const move = moves[move_index];
417
+ const new_orient_full = [];
418
418
  for (let k = 0; k < 15; k++) {
419
419
  new_orient_full[k] = orient_full[move[0][k]] + move[1][k];
420
420
  }
421
- let new_orient = new_orient_full.filter((x) => x < 10);
421
+ const new_orient = new_orient_full.filter((x) => x < 10);
422
422
  let J = 0;
423
423
  for (let k = 0; k < 5; k++) {
424
424
  J += new_orient[k] % 3 * THREE[k];
@@ -433,37 +433,30 @@ function generate_phase2_orientation_ptable() {
433
433
  if (tables.phase2op) {
434
434
  return tables.phase2op;
435
435
  }
436
- let mtable = generate_phase23_orientation_mtable();
436
+ const mtable = generate_phase23_orientation_mtable();
437
437
  return tables.phase2op = bfs(mtable, [243 * 3002]);
438
438
  }
439
439
  function generate_phase3_orientation_ptable() {
440
440
  if (tables.phase3op) {
441
441
  return tables.phase3op;
442
442
  }
443
- let mtable = generate_phase23_orientation_mtable();
443
+ const mtable = generate_phase23_orientation_mtable();
444
444
  return tables.phase3op = bfs(mtable, [243 * 246]);
445
445
  }
446
446
  function generate_phase23_permutation_mtable() {
447
447
  if (tables.phase23pm) {
448
448
  return tables.phase23pm;
449
449
  }
450
- const FIFTEEN = [
451
- 1,
452
- 15,
453
- 225,
454
- Math.pow(15, 3),
455
- Math.pow(15, 4),
456
- Math.pow(15, 5)
457
- ];
458
- let phase23pm = Array(FIFTEEN[5]);
459
- let single = Array(15);
450
+ const FIFTEEN = [1, 15, 225, 15 ** 3, 15 ** 4, 15 ** 5];
451
+ const phase23pm = Array(FIFTEEN[5]);
452
+ const single = Array(15);
460
453
  for (let i = 0; i < 15; i++) {
461
454
  single[i] = Array(6);
462
455
  for (let move_index = 0; move_index < 6; move_index++) {
463
456
  single[i][move_index] = moves[move_index][0].indexOf(i);
464
457
  }
465
458
  }
466
- let locations = [0, 0, 0, 0, 0];
459
+ const locations = [0, 0, 0, 0, 0];
467
460
  for (let ind = 0; ind < FIFTEEN[5]; ind++) {
468
461
  phase23pm[ind] = Array(6);
469
462
  for (let move_index = 0; move_index < 6; move_index++) {
@@ -487,14 +480,14 @@ function generate_phase2_permutation_ptable() {
487
480
  if (tables.phase2pp) {
488
481
  return tables.phase2pp;
489
482
  }
490
- let mtable = generate_phase23_permutation_mtable();
483
+ const mtable = generate_phase23_permutation_mtable();
491
484
  return tables.phase2pp = bfs(mtable, [213090]);
492
485
  }
493
486
  function generate_phase3_permutation_ptable() {
494
487
  if (tables.phase3pp) {
495
488
  return tables.phase3pp;
496
489
  }
497
- let mtable = generate_phase23_permutation_mtable();
490
+ const mtable = generate_phase23_permutation_mtable();
498
491
  return tables.phase3pp = bfs(mtable, [737420]);
499
492
  }
500
493
  function generate_phase4_orientation_mtable() {
@@ -502,19 +495,19 @@ function generate_phase4_orientation_mtable() {
502
495
  return tables.phase4om;
503
496
  }
504
497
  const THREE = [1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 59049];
505
- let mtable = Array(THREE[9]);
498
+ const mtable = Array(THREE[9]);
506
499
  for (let i = 0; i < THREE[9]; i++) {
507
- let o = Array(14).fill(0);
500
+ const o = Array(14).fill(0);
508
501
  for (let j = 0; j < 9; j++) {
509
- let J = j < 5 ? j : j + 4;
502
+ const J = j < 5 ? j : j + 4;
510
503
  o[J] = (i / THREE[j] | 0) % 3;
511
504
  o[13] -= o[J];
512
505
  }
513
506
  o[13] = (o[13] + 999) % 3;
514
507
  mtable[i] = [];
515
508
  for (let move_index = 0; move_index < 3; move_index++) {
516
- let move = moves[move_index];
517
- let new_o = [0, 1, 2, 3, 4, 9, 10, 11, 12, 13].map(
509
+ const move = moves[move_index];
510
+ const new_o = [0, 1, 2, 3, 4, 9, 10, 11, 12, 13].map(
518
511
  (i2) => o[move[0][i2]] + move[1][i2]
519
512
  );
520
513
  let new_i = 0;
@@ -532,20 +525,20 @@ function generate_phase4_permutation_mtable() {
532
525
  }
533
526
  const HALFFACT10 = factorial(10) / 2;
534
527
  const n = 10;
535
- let pre = [0, 1, 2, 3, 4, -1, -1, -1, -1, 5, 6, 7, 8, 9];
536
- let post = [0, 1, 2, 3, 4, 9, 10, 11, 12, 13];
537
- let move_permutations = [
528
+ const pre = [0, 1, 2, 3, 4, -1, -1, -1, -1, 5, 6, 7, 8, 9];
529
+ const post = [0, 1, 2, 3, 4, 9, 10, 11, 12, 13];
530
+ const move_permutations = [
538
531
  compose(pre, compose(move_U[0], post)),
539
532
  compose(pre, compose(move_R[0], post)),
540
533
  compose(pre, compose(move_F[0], post))
541
534
  ];
542
- let mtable = Array(HALFFACT10);
543
- let perm = Array(10);
535
+ const mtable = Array(HALFFACT10);
536
+ const perm = Array(10);
544
537
  for (let i = 0; i < HALFFACT10; i++) {
545
538
  index_to_evenpermutation10(i, perm);
546
539
  mtable[i] = [];
547
540
  for (let move_index = 0; move_index < 3; move_index++) {
548
- let new_perm = compose(perm, move_permutations[move_index]);
541
+ const new_perm = compose(perm, move_permutations[move_index]);
549
542
  mtable[i][move_index] = evenpermutation10_to_index(new_perm);
550
543
  }
551
544
  }
@@ -555,33 +548,33 @@ function generate_phase4_orientation_ptable() {
555
548
  if (tables.phase4op) {
556
549
  return tables.phase4op;
557
550
  }
558
- let mtable = generate_phase4_orientation_mtable();
551
+ const mtable = generate_phase4_orientation_mtable();
559
552
  return tables.phase4op = bfs(mtable, [0]);
560
553
  }
561
554
  function generate_phase4_permutation_ptable() {
562
555
  if (tables.phase4pp) {
563
556
  return tables.phase4pp;
564
557
  }
565
- let mtable = generate_phase4_permutation_mtable();
558
+ const mtable = generate_phase4_permutation_mtable();
566
559
  return tables.phase4pp = bfs(mtable, [0]);
567
560
  }
568
561
  function generate_phase4_near_ptable_list(threshold) {
569
562
  if (tables.phase4np_list && tables.phase4np_list.threshold === threshold) {
570
563
  return tables.phase4np_list;
571
564
  }
572
- let mtables = [
565
+ const mtables = [
573
566
  generate_phase4_orientation_mtable(),
574
567
  generate_phase4_permutation_mtable()
575
568
  ];
576
- let base = Math.pow(3, 9);
577
- let states = [0];
569
+ const base = 3 ** 9;
570
+ const states = [0];
578
571
  populate(threshold, [0, 0], -1);
579
572
  function populate(depth, state, last2) {
580
573
  states.push(state[0] + base * state[1]);
581
574
  if (depth === 0) {
582
575
  return;
583
576
  }
584
- let new_state = [];
577
+ const new_state = [];
585
578
  for (let move_index = 0; move_index < 3; move_index++) {
586
579
  if (move_index === last2) {
587
580
  continue;
@@ -597,9 +590,9 @@ function generate_phase4_near_ptable_list(threshold) {
597
590
  return;
598
591
  }
599
592
  states.sort((x, y) => x - y);
600
- let unique_states = [];
593
+ const unique_states = [];
601
594
  let last = -1;
602
- for (let state of states) {
595
+ for (const state of states) {
603
596
  if (state !== last) {
604
597
  unique_states.push(last = state);
605
598
  }
@@ -611,7 +604,7 @@ function binary_search(A, x) {
611
604
  let lo = 0;
612
605
  let hi = A.length - 1;
613
606
  while (hi - lo > 1) {
614
- let mid = lo + hi >> 1;
607
+ const mid = lo + hi >> 1;
615
608
  if (x > A[mid]) {
616
609
  lo = mid + 1;
617
610
  } else {
@@ -621,10 +614,10 @@ function binary_search(A, x) {
621
614
  return x === A[lo] || x === A[hi];
622
615
  }
623
616
  function bfs(mtable, goal_states) {
624
- let N = mtable.length;
625
- let nmoves = mtable[0].length;
626
- let ptable = Array(N).fill(-1);
627
- for (let state of goal_states) {
617
+ const N = mtable.length;
618
+ const nmoves = mtable[0].length;
619
+ const ptable = Array(N).fill(-1);
620
+ for (const state of goal_states) {
628
621
  ptable[state] = 0;
629
622
  }
630
623
  let depth = 0;
@@ -651,13 +644,13 @@ function bfs(mtable, goal_states) {
651
644
  return ptable;
652
645
  }
653
646
  function ida_solve(indices, mtables, ptables) {
654
- let ncoords = indices.length;
647
+ const ncoords = indices.length;
655
648
  let bound = 0;
656
649
  for (let i = 0; i < ncoords; i++) {
657
650
  bound = Math.max(bound, ptables[i][indices[i]]);
658
651
  }
659
652
  while (true) {
660
- let path = ida_search(indices, mtables, ptables, bound, -1);
653
+ const path = ida_search(indices, mtables, ptables, bound, -1);
661
654
  if (path !== void 0) {
662
655
  return path;
663
656
  }
@@ -665,8 +658,8 @@ function ida_solve(indices, mtables, ptables) {
665
658
  }
666
659
  }
667
660
  function ida_search(indices, mtables, ptables, bound, last) {
668
- let ncoords = indices.length;
669
- let nmoves = mtables[0][0].length;
661
+ const ncoords = indices.length;
662
+ const nmoves = mtables[0][0].length;
670
663
  let heuristic = 0;
671
664
  for (let i = 0; i < ncoords; i++) {
672
665
  heuristic = Math.max(heuristic, ptables[i][indices[i]]);
@@ -681,13 +674,13 @@ function ida_search(indices, mtables, ptables, bound, last) {
681
674
  if (m === last) {
682
675
  continue;
683
676
  }
684
- let new_indices = indices.slice();
677
+ const new_indices = indices.slice();
685
678
  for (let c = 0; c < ncoords; c++) {
686
679
  new_indices[c] = mtables[c][indices[c]][m];
687
680
  }
688
681
  let r = 1;
689
682
  while (indices.some((_, i) => indices[i] !== new_indices[i])) {
690
- let subpath = ida_search(new_indices, mtables, ptables, bound - 1, m);
683
+ const subpath = ida_search(new_indices, mtables, ptables, bound - 1, m);
691
684
  if (subpath !== void 0) {
692
685
  return [[m, r]].concat(subpath);
693
686
  }
@@ -700,14 +693,14 @@ function ida_search(indices, mtables, ptables, bound, last) {
700
693
  return;
701
694
  }
702
695
  function phase4_ida_solve(indices) {
703
- let mtable_o = generate_phase4_orientation_mtable();
704
- let mtable_p = generate_phase4_permutation_mtable();
705
- let ptable_o = generate_phase4_orientation_ptable();
706
- let ptable_p = generate_phase4_permutation_ptable();
707
- let ptable_n = generate_phase4_near_ptable_list(PHASE4_THRESHOLD);
696
+ const mtable_o = generate_phase4_orientation_mtable();
697
+ const mtable_p = generate_phase4_permutation_mtable();
698
+ const ptable_o = generate_phase4_orientation_ptable();
699
+ const ptable_p = generate_phase4_permutation_ptable();
700
+ const ptable_n = generate_phase4_near_ptable_list(PHASE4_THRESHOLD);
708
701
  let bound = Math.max(ptable_o[indices[0]], ptable_p[indices[1]]);
709
702
  while (true) {
710
- let path = phase4_ida_search(
703
+ const path = phase4_ida_search(
711
704
  indices,
712
705
  bound,
713
706
  -1,
@@ -741,11 +734,11 @@ function phase4_ida_search(indices, bound, last, mtable_o, mtable_p, ptable_o, p
741
734
  if (m === last) {
742
735
  continue;
743
736
  }
744
- let new_indices = indices.slice();
737
+ const new_indices = indices.slice();
745
738
  for (let r = 1; r < 5; r++) {
746
739
  new_indices[0] = mtable_o[new_indices[0]][m];
747
740
  new_indices[1] = mtable_p[new_indices[1]][m];
748
- let subpath = phase4_ida_search(
741
+ const subpath = phase4_ida_search(
749
742
  new_indices,
750
743
  bound - 1,
751
744
  m,
@@ -768,4 +761,3 @@ function getRandomKilominxScramble() {
768
761
  export {
769
762
  getRandomKilominxScramble
770
763
  };
771
- //# sourceMappingURL=search-dynamic-solve-kilominx-UKFT6I42.js.map