cubing 0.53.7 → 0.53.8

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 (69) hide show
  1. package/dist/lib/cubing/{PuzzleLoader-D75CAwCp.d.ts → PuzzleLoader-DIRtjF9X.d.ts} +4 -2
  2. package/dist/lib/cubing/{TwizzleLink.d-DbvG8HYW.d.ts → TwizzleLink.d-DjvNu9pZ.d.ts} +3 -3
  3. package/dist/lib/cubing/alg/index.d.ts +3 -3
  4. package/dist/lib/cubing/alg/index.js +1 -1
  5. package/dist/lib/cubing/bluetooth/index.d.ts +6 -6
  6. package/dist/lib/cubing/bluetooth/index.js +5 -5
  7. package/dist/lib/cubing/{bluetooth-puzzle.d-DRGMwcSn.d.ts → bluetooth-puzzle.d-DOmkUdep.d.ts} +2 -2
  8. package/dist/lib/cubing/chunks/{chunk-4QUGAADL.js → chunk-2SBMIHZV.js} +53 -46
  9. package/dist/lib/cubing/chunks/chunk-2SBMIHZV.js.map +7 -0
  10. package/dist/lib/cubing/chunks/{chunk-MKN7YQQJ.js → chunk-576MXDEF.js} +3 -3
  11. package/dist/lib/cubing/chunks/{chunk-ZCOKH4N7.js → chunk-BQNTAVTA.js} +2 -2
  12. package/dist/lib/cubing/chunks/{chunk-3GLPWJQ4.js → chunk-L2MEEU4Q.js} +3 -3
  13. package/dist/lib/cubing/chunks/{chunk-P4HD65XN.js → chunk-MTXM5RS4.js} +5 -5
  14. package/dist/lib/cubing/chunks/{chunk-YZL7YQBN.js → chunk-NMKKPUZW.js} +4 -4
  15. package/dist/lib/cubing/chunks/{chunk-C6MGGBJ2.js → chunk-QEQT4IRI.js} +2 -2
  16. package/dist/lib/cubing/chunks/{chunk-PHOA3XR5.js → chunk-SPVYKTCP.js} +3 -3
  17. package/dist/lib/cubing/chunks/{chunk-CIXBGOOX.js → chunk-TA6HSIQ6.js} +2 -2
  18. package/dist/lib/cubing/chunks/{chunk-AHU6JAA2.js → chunk-Y3IDQC5A.js} +3 -3
  19. package/dist/lib/cubing/chunks/{inside-ADDWNEHV.js → inside-T3O22WWD.js} +14 -14
  20. package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-KMHO3U7V.js → search-dynamic-sgs-side-events-GSDLVL2Z.js} +6 -6
  21. package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-NWC66IFC.js → search-dynamic-sgs-unofficial-KOQT6CII.js} +6 -6
  22. package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-DW6TCEEQ.js → search-dynamic-solve-4x4x4-M2VFH2JJ.js} +7 -7
  23. package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-TL4GETO2.js → search-dynamic-solve-fto-5YRST2XM.js} +2 -2
  24. package/dist/lib/cubing/chunks/{search-dynamic-solve-kilominx-OKETU2LL.js → search-dynamic-solve-kilominx-W64XQPBF.js} +2 -2
  25. package/dist/lib/cubing/chunks/search-worker-entry.js +1 -1
  26. package/dist/lib/cubing/chunks/{twisty-dynamic-3d-53NE7BLI.js → twisty-dynamic-3d-Q6UZ4CCL.js} +6 -6
  27. package/dist/lib/cubing/chunks/{twsearch-57UA6UJ5.js → twsearch-DACM53TI.js} +2 -2
  28. package/dist/lib/cubing/{KPattern.d-CSRKVUQa.d.ts → index-B9ExLTgf.d.ts} +110 -110
  29. package/dist/lib/cubing/{index-Dyvvxhe7.d.ts → index-CNCqtUrz.d.ts} +2 -2
  30. package/dist/lib/cubing/kpuzzle/index.d.ts +2 -2
  31. package/dist/lib/cubing/kpuzzle/index.js +2 -2
  32. package/dist/lib/cubing/notation/index.d.ts +4 -4
  33. package/dist/lib/cubing/notation/index.js +4 -4
  34. package/dist/lib/cubing/parseAlg.d-DYKpQgll.d.ts +11 -0
  35. package/dist/lib/cubing/protocol/index.d.ts +2 -2
  36. package/dist/lib/cubing/protocol/index.js +4 -4
  37. package/dist/lib/cubing/puzzle-geometry/index.d.ts +3 -3
  38. package/dist/lib/cubing/puzzle-geometry/index.js +1 -1
  39. package/dist/lib/cubing/puzzles/index.d.ts +4 -4
  40. package/dist/lib/cubing/puzzles/index.js +4 -4
  41. package/dist/lib/cubing/scramble/index.d.ts +3 -3
  42. package/dist/lib/cubing/scramble/index.js +6 -6
  43. package/dist/lib/cubing/search/index.d.ts +3 -3
  44. package/dist/lib/cubing/search/index.js +6 -6
  45. package/dist/lib/cubing/stream/index.d.ts +5 -5
  46. package/dist/lib/cubing/stream/index.js +1 -1
  47. package/dist/lib/cubing/twisty/index.d.ts +5 -5
  48. package/dist/lib/cubing/twisty/index.js +22 -20
  49. package/dist/lib/cubing/twisty/index.js.map +2 -2
  50. package/package.json +1 -1
  51. package/dist/lib/cubing/chunks/chunk-4QUGAADL.js.map +0 -7
  52. package/dist/lib/cubing/parseAlg.d-Def4INIF.d.ts +0 -9
  53. /package/dist/lib/cubing/chunks/{chunk-MKN7YQQJ.js.map → chunk-576MXDEF.js.map} +0 -0
  54. /package/dist/lib/cubing/chunks/{chunk-ZCOKH4N7.js.map → chunk-BQNTAVTA.js.map} +0 -0
  55. /package/dist/lib/cubing/chunks/{chunk-3GLPWJQ4.js.map → chunk-L2MEEU4Q.js.map} +0 -0
  56. /package/dist/lib/cubing/chunks/{chunk-P4HD65XN.js.map → chunk-MTXM5RS4.js.map} +0 -0
  57. /package/dist/lib/cubing/chunks/{chunk-YZL7YQBN.js.map → chunk-NMKKPUZW.js.map} +0 -0
  58. /package/dist/lib/cubing/chunks/{chunk-C6MGGBJ2.js.map → chunk-QEQT4IRI.js.map} +0 -0
  59. /package/dist/lib/cubing/chunks/{chunk-PHOA3XR5.js.map → chunk-SPVYKTCP.js.map} +0 -0
  60. /package/dist/lib/cubing/chunks/{chunk-CIXBGOOX.js.map → chunk-TA6HSIQ6.js.map} +0 -0
  61. /package/dist/lib/cubing/chunks/{chunk-AHU6JAA2.js.map → chunk-Y3IDQC5A.js.map} +0 -0
  62. /package/dist/lib/cubing/chunks/{inside-ADDWNEHV.js.map → inside-T3O22WWD.js.map} +0 -0
  63. /package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-KMHO3U7V.js.map → search-dynamic-sgs-side-events-GSDLVL2Z.js.map} +0 -0
  64. /package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-NWC66IFC.js.map → search-dynamic-sgs-unofficial-KOQT6CII.js.map} +0 -0
  65. /package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-DW6TCEEQ.js.map → search-dynamic-solve-4x4x4-M2VFH2JJ.js.map} +0 -0
  66. /package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-TL4GETO2.js.map → search-dynamic-solve-fto-5YRST2XM.js.map} +0 -0
  67. /package/dist/lib/cubing/chunks/{search-dynamic-solve-kilominx-OKETU2LL.js.map → search-dynamic-solve-kilominx-W64XQPBF.js.map} +0 -0
  68. /package/dist/lib/cubing/chunks/{twisty-dynamic-3d-53NE7BLI.js.map → twisty-dynamic-3d-Q6UZ4CCL.js.map} +0 -0
  69. /package/dist/lib/cubing/chunks/{twsearch-57UA6UJ5.js.map → twsearch-DACM53TI.js.map} +0 -0
@@ -692,9 +692,11 @@ declare class Alg extends AlgCommon<Alg> {
692
692
  simplify(options?: SimplifyOptions): Alg;
693
693
  }
694
694
 
695
+ declare const startCharIndexKey: unique symbol;
696
+ declare const endCharIndexKey: unique symbol;
695
697
  interface ParserIndexed {
696
- startCharIndex: number;
697
- endCharIndex: number;
698
+ [startCharIndexKey]: number;
699
+ [endCharIndexKey]: number;
698
700
  }
699
701
  type Parsed<T extends Alg | AlgNode> = T & ParserIndexed;
700
702
 
@@ -1,7 +1,7 @@
1
1
  import { Texture, Object3D, Raycaster, PerspectiveCamera, Scene, WebGLRenderer } from 'three';
2
- import { P as PuzzleSpecificSimplifyOptions, b as AlgLeaf, M as Move, A as Alg, e as Pause, h as AppendCancelOptions, c as AppendOptions, a as AlgNode, I as IterationDirection } from './PuzzleLoader-D75CAwCp.js';
3
- import { P as Parsed } from './parseAlg.d-Def4INIF.js';
4
- import { s as KPuzzle, d as PuzzleGeometry, K as KPattern, t as KTransformation, u as PuzzleDescriptionString } from './KPattern.d-CSRKVUQa.js';
2
+ import { P as PuzzleSpecificSimplifyOptions, b as AlgLeaf, M as Move, A as Alg, e as Pause, h as AppendCancelOptions, c as AppendOptions, a as AlgNode, I as IterationDirection } from './PuzzleLoader-DIRtjF9X.js';
3
+ import { P as Parsed } from './parseAlg.d-DYKpQgll.js';
4
+ import { s as KPuzzle, d as PuzzleGeometry, K as KPattern, t as KTransformation, u as PuzzleDescriptionString } from './index-B9ExLTgf.js';
5
5
 
6
6
  type FaceletMeshStickeringMask = "regular" | "dim" | "oriented" | "experimentalOriented2" | "ignored" | "invisible" | "mystery";
7
7
  type FaceletStickeringMask = {
@@ -1,6 +1,6 @@
1
- import { a as AlgNode, A as Alg, M as Move, c as AppendOptions, K as KeyMapping, b as AlgLeaf, G as Grouping, C as Commutator, d as Conjugate, e as Pause, N as Newline, L as LineComment } from '../PuzzleLoader-D75CAwCp.js';
2
- export { g as AlgBranch, h as AppendCancelOptions, E as ExperimentalNotationType, i as ExperimentalSerializationOptions, f as MoveModifications, P as PuzzleSpecificSimplifyOptions, Q as QuantumMove, S as SimplifyOptions } from '../PuzzleLoader-D75CAwCp.js';
3
- export { P as ExperimentalParsed } from '../parseAlg.d-Def4INIF.js';
1
+ import { a as AlgNode, A as Alg, M as Move, c as AppendOptions, K as KeyMapping, b as AlgLeaf, G as Grouping, C as Commutator, d as Conjugate, e as Pause, N as Newline, L as LineComment } from '../PuzzleLoader-DIRtjF9X.js';
2
+ export { g as AlgBranch, h as AppendCancelOptions, E as ExperimentalNotationType, i as ExperimentalSerializationOptions, f as MoveModifications, P as PuzzleSpecificSimplifyOptions, Q as QuantumMove, S as SimplifyOptions } from '../PuzzleLoader-DIRtjF9X.js';
3
+ export { P as ExperimentalParsed } from '../parseAlg.d-DYKpQgll.js';
4
4
  import 'three';
5
5
 
6
6
  /** @deprecated */
@@ -18,7 +18,7 @@ import {
18
18
  functionFromTraversal,
19
19
  keyToMove,
20
20
  setAlgDebug
21
- } from "../chunks/chunk-4QUGAADL.js";
21
+ } from "../chunks/chunk-2SBMIHZV.js";
22
22
  export {
23
23
  Alg,
24
24
  AlgBuilder,
@@ -1,10 +1,10 @@
1
- import { K as KPattern } from '../KPattern.d-CSRKVUQa.js';
2
- import { a as PuzzleID, P as PuzzleLoader } from '../TwizzleLink.d-DbvG8HYW.js';
3
- import { A as Alg, M as Move } from '../PuzzleLoader-D75CAwCp.js';
4
- import { B as BluetoothPuzzle } from '../bluetooth-puzzle.d-DRGMwcSn.js';
5
- export { A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle.d-DRGMwcSn.js';
1
+ import { K as KPattern } from '../index-B9ExLTgf.js';
2
+ import { a as PuzzleID, P as PuzzleLoader } from '../TwizzleLink.d-DjvNu9pZ.js';
3
+ import { A as Alg, M as Move } from '../PuzzleLoader-DIRtjF9X.js';
4
+ import { B as BluetoothPuzzle } from '../bluetooth-puzzle.d-DOmkUdep.js';
5
+ export { A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle.d-DOmkUdep.js';
6
6
  import 'three';
7
- import '../parseAlg.d-Def4INIF.js';
7
+ import '../parseAlg.d-DYKpQgll.js';
8
8
 
9
9
  declare function enableDebugLogging(enable: boolean): void;
10
10
 
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  binaryComponentsToReid3x3x3,
3
3
  twizzleBinaryToBinaryComponents
4
- } from "../chunks/chunk-AHU6JAA2.js";
4
+ } from "../chunks/chunk-Y3IDQC5A.js";
5
5
  import {
6
6
  cube3x3x3,
7
7
  puzzles
8
- } from "../chunks/chunk-YZL7YQBN.js";
8
+ } from "../chunks/chunk-NMKKPUZW.js";
9
9
  import {
10
10
  experimental3x3x3KPuzzle
11
- } from "../chunks/chunk-PHOA3XR5.js";
11
+ } from "../chunks/chunk-SPVYKTCP.js";
12
12
  import {
13
13
  KPattern
14
- } from "../chunks/chunk-CIXBGOOX.js";
14
+ } from "../chunks/chunk-TA6HSIQ6.js";
15
15
  import {
16
16
  Alg,
17
17
  Move,
18
18
  experimentalAppendMove,
19
19
  keyToMove
20
- } from "../chunks/chunk-4QUGAADL.js";
20
+ } from "../chunks/chunk-2SBMIHZV.js";
21
21
 
22
22
  // src/cubing/bluetooth/debug.ts
23
23
  var DEBUG_LOGGING_ENABLED = false;
@@ -1,5 +1,5 @@
1
- import { b as AlgLeaf } from './PuzzleLoader-D75CAwCp.js';
2
- import { K as KPattern } from './KPattern.d-CSRKVUQa.js';
1
+ import { b as AlgLeaf } from './PuzzleLoader-DIRtjF9X.js';
2
+ import { K as KPattern } from './index-B9ExLTgf.js';
3
3
 
4
4
  interface StreamTransformer {
5
5
  transformAlgLeaf(algLeafEvent: AlgLeafEvent): void;
@@ -56,42 +56,6 @@ var MAX_INT = 2147483647;
56
56
  var MAX_INT_DESCRIPTION = "2^31 - 1";
57
57
  var MIN_INT = -2147483648;
58
58
 
59
- // src/cubing/alg/AlgBuilder.ts
60
- var AlgBuilder = class {
61
- #algNodes = [];
62
- push(u) {
63
- this.#algNodes.push(u);
64
- }
65
- // TODO: Allow FlexibleAlgSource?
66
- /** @deprecated */
67
- experimentalPushAlg(alg) {
68
- for (const u of alg.childAlgNodes()) {
69
- this.push(u);
70
- }
71
- }
72
- // TODO: can we guarantee this to be fast in the permanent API?
73
- experimentalNumAlgNodes() {
74
- return this.#algNodes.length;
75
- }
76
- // can be called multiple times, even if you push alg nodes inbetween.
77
- toAlg() {
78
- return new Alg(this.#algNodes);
79
- }
80
- reset() {
81
- this.#algNodes = [];
82
- }
83
- };
84
-
85
- // src/cubing/alg/debug.ts
86
- var algDebugGlobals = {
87
- caretNISSNotationEnabled: true
88
- };
89
- function setAlgDebug(options) {
90
- if ("caretNISSNotationEnabled" in options) {
91
- algDebugGlobals.caretNISSNotationEnabled = !!options.caretNISSNotationEnabled;
92
- }
93
- }
94
-
95
59
  // src/cubing/alg/alg-nodes/containers/Commutator.ts
96
60
  var Commutator = class _Commutator extends AlgCommon {
97
61
  #A;
@@ -266,6 +230,42 @@ var Pause = class _Pause extends AlgCommon {
266
230
  }
267
231
  };
268
232
 
233
+ // src/cubing/alg/AlgBuilder.ts
234
+ var AlgBuilder = class {
235
+ #algNodes = [];
236
+ push(u) {
237
+ this.#algNodes.push(u);
238
+ }
239
+ // TODO: Allow FlexibleAlgSource?
240
+ /** @deprecated */
241
+ experimentalPushAlg(alg) {
242
+ for (const u of alg.childAlgNodes()) {
243
+ this.push(u);
244
+ }
245
+ }
246
+ // TODO: can we guarantee this to be fast in the permanent API?
247
+ experimentalNumAlgNodes() {
248
+ return this.#algNodes.length;
249
+ }
250
+ // can be called multiple times, even if you push alg nodes inbetween.
251
+ toAlg() {
252
+ return new Alg(this.#algNodes);
253
+ }
254
+ reset() {
255
+ this.#algNodes = [];
256
+ }
257
+ };
258
+
259
+ // src/cubing/alg/debug.ts
260
+ var algDebugGlobals = {
261
+ caretNISSNotationEnabled: true
262
+ };
263
+ function setAlgDebug(options) {
264
+ if ("caretNISSNotationEnabled" in options) {
265
+ algDebugGlobals.caretNISSNotationEnabled = !!options.caretNISSNotationEnabled;
266
+ }
267
+ }
268
+
269
269
  // src/cubing/alg/parseAlg.ts
270
270
  function parseIntWithEmptyFallback(n, emptyFallback) {
271
271
  return n ? parseInt(n) : emptyFallback;
@@ -285,18 +285,20 @@ function parseMove(s) {
285
285
  function parseQuantumMove(s) {
286
286
  return new AlgParser().parseQuantumMove(s);
287
287
  }
288
+ var startCharIndexKey = Symbol("startCharIndex");
289
+ var endCharIndexKey = Symbol("endCharIndex");
288
290
  function addCharIndices(t, startCharIndex, endCharIndex) {
289
291
  const parsedT = t;
290
- parsedT.startCharIndex = startCharIndex;
291
- parsedT.endCharIndex = endCharIndex;
292
+ parsedT[startCharIndexKey] = startCharIndex;
293
+ parsedT[endCharIndexKey] = endCharIndex;
292
294
  return parsedT;
293
295
  }
294
296
  function transferCharIndex(from, to) {
295
- if ("startCharIndex" in from) {
296
- to.startCharIndex = from.startCharIndex;
297
+ if (startCharIndexKey in from) {
298
+ to[startCharIndexKey] = from[startCharIndexKey];
297
299
  }
298
- if ("endCharIndex" in from) {
299
- to.endCharIndex = from.endCharIndex;
300
+ if (endCharIndexKey in from) {
301
+ to[endCharIndexKey] = from[endCharIndexKey];
300
302
  }
301
303
  return to;
302
304
  }
@@ -316,7 +318,10 @@ var AlgParser = class {
316
318
  }
317
319
  }
318
320
  const newAlg = new Alg(algNodes);
319
- const { startCharIndex, endCharIndex } = alg;
321
+ const {
322
+ [startCharIndexKey]: startCharIndex,
323
+ [endCharIndexKey]: endCharIndex
324
+ } = alg;
320
325
  addCharIndices(newAlg, startCharIndex, endCharIndex);
321
326
  return newAlg;
322
327
  }
@@ -1843,13 +1848,15 @@ function experimentalAlgCubingNetLink(options) {
1843
1848
  export {
1844
1849
  direct,
1845
1850
  directedGenerator,
1846
- AlgBuilder,
1847
- setAlgDebug,
1848
1851
  Commutator,
1849
1852
  Conjugate,
1850
1853
  LineComment,
1851
1854
  Newline,
1852
1855
  Pause,
1856
+ AlgBuilder,
1857
+ setAlgDebug,
1858
+ startCharIndexKey,
1859
+ endCharIndexKey,
1853
1860
  QuantumMove,
1854
1861
  Move,
1855
1862
  Grouping,
@@ -1864,4 +1871,4 @@ export {
1864
1871
  keyToMove,
1865
1872
  experimentalAlgCubingNetLink
1866
1873
  };
1867
- //# sourceMappingURL=chunk-4QUGAADL.js.map
1874
+ //# sourceMappingURL=chunk-2SBMIHZV.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/cubing/alg/common.ts", "../../../../src/cubing/alg/iteration.ts", "../../../../src/cubing/alg/limits.ts", "../../../../src/cubing/alg/alg-nodes/containers/Commutator.ts", "../../../../src/cubing/alg/alg-nodes/containers/Conjugate.ts", "../../../../src/cubing/alg/alg-nodes/leaves/LineComment.ts", "../../../../src/cubing/alg/alg-nodes/leaves/Newline.ts", "../../../../src/cubing/alg/alg-nodes/leaves/Pause.ts", "../../../../src/cubing/alg/AlgBuilder.ts", "../../../../src/cubing/alg/debug.ts", "../../../../src/cubing/alg/parseAlg.ts", "../../../../src/cubing/alg/warnOnce.ts", "../../../../src/cubing/alg/alg-nodes/QuantumWithAmount.ts", "../../../../src/cubing/alg/alg-nodes/leaves/Move.ts", "../../../../src/cubing/alg/alg-nodes/containers/Grouping.ts", "../../../../src/cubing/alg/is.ts", "../../../../src/cubing/alg/traversal.ts", "../../../../src/cubing/alg/simplify/options.ts", "../../../../src/cubing/alg/simplify/append.ts", "../../../../src/cubing/alg/simplify/simplify.ts", "../../../../src/cubing/alg/Alg.ts", "../../../../src/cubing/alg/example.ts", "../../../../src/cubing/alg/keyboard.ts", "../../../../src/cubing/alg/url.ts"],
4
+ "sourcesContent": ["import type { Alg } from \"./Alg\";\nimport type { AlgLeaf, AlgNode } from \"./alg-nodes/AlgNode\";\nimport type { IterationDirection } from \"./iteration\";\nimport type { ExperimentalSerializationOptions } from \"./SerializationOptions\";\n\nlet writeAlgDebugField = false;\nexport function setAlgDebugField(debug: boolean): void {\n writeAlgDebugField = debug;\n}\n\nexport abstract class Comparable {\n is(c: any): boolean {\n return this instanceof c;\n }\n\n as<T>(c: new (...args: any) => T): T | null {\n return this instanceof c ? this : null;\n }\n\n abstract isIdentical(other: Comparable): boolean;\n}\n\nexport interface Repeatable extends Comparable {\n experimentalExpand(\n iterDir?: IterationDirection,\n depth?: number,\n ): Generator<AlgLeaf>;\n}\n\n// Common to `Alg` or `AlgNode` classes.\nexport abstract class AlgCommon<T extends Alg | AlgNode>\n extends Comparable\n implements Repeatable\n{\n constructor() {\n super();\n if (writeAlgDebugField) {\n Object.defineProperty(this, \"_debugStr\", {\n get: () => {\n return this.toString();\n },\n });\n }\n }\n\n get log(): (message?: any) => void {\n // By returning a (bound) version of `console.log`, we ensure that DevTools\n // logs the call site instead of this function.\n return console.log.bind(console, this, this.toString()) as (\n message?: any,\n ) => void;\n }\n\n abstract override toString(\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string;\n\n abstract invert(): T;\n\n abstract experimentalExpand(iterDir: IterationDirection): Generator<AlgLeaf>;\n}\n", "export enum IterationDirection {\n Forwards = 1,\n Backwards = -1,\n}\n\nexport function toggleDirection(\n iterationDirection: IterationDirection,\n flip: boolean = true,\n): IterationDirection {\n if (!flip) {\n return iterationDirection;\n }\n switch (iterationDirection) {\n case IterationDirection.Forwards:\n return IterationDirection.Backwards;\n case IterationDirection.Backwards:\n return IterationDirection.Forwards;\n }\n}\n\nexport function direct<T>(\n g: Iterable<T>,\n iterDir: IterationDirection,\n): Iterable<T> {\n return iterDir === IterationDirection.Backwards ? Array.from(g).reverse() : g;\n}\n\nexport function reverse<T>(g: Iterable<T>): Iterable<T> {\n return Array.from(g).reverse();\n}\n\nexport function* directedGenerator<T>(\n g: Generator<T>,\n direction: IterationDirection,\n): Generator<T> {\n direction === IterationDirection.Backwards\n ? yield* reverseGenerator(g)\n : yield* g;\n}\n\nexport function* reverseGenerator<T>(g: Generator<T>): Generator<T> {\n for (const t of Array.from(g).reverse()) {\n yield t;\n }\n}\n", "export const MAX_INT = 0x7fffffff; // 2^31-1, the max value for signed 32-bit ints.\nexport const MAX_INT_DESCRIPTION = \"2^31 - 1\";\nexport const MIN_INT = -0x80000000;\nexport const MIN_INT_DESCRIPTION = \"-2^31\";\n", "import type { ExperimentalSerializationOptions } from \"cubing/alg/SerializationOptions\";\nimport {\n experimentalEnsureAlg,\n type Alg,\n type FlexibleAlgSource,\n} from \"../../Alg\";\nimport { AlgCommon, type Comparable } from \"../../common\";\nimport { IterationDirection } from \"../../iteration\";\nimport type { AlgLeaf } from \"../AlgNode\";\n\n/** @category Alg Nodes */\nexport class Commutator extends AlgCommon<Commutator> {\n readonly #A: Alg;\n readonly #B: Alg;\n\n constructor(aSource: FlexibleAlgSource, bSource: FlexibleAlgSource) {\n super();\n this.#A = experimentalEnsureAlg(aSource);\n this.#B = experimentalEnsureAlg(bSource);\n }\n\n get A(): Alg {\n return this.#A;\n }\n\n get B(): Alg {\n return this.#B;\n }\n\n isIdentical(other: Comparable): boolean {\n const otherAsCommutator = other.as(Commutator);\n return !!(\n otherAsCommutator?.A.isIdentical(this.A) &&\n otherAsCommutator?.B.isIdentical(this.B)\n );\n }\n\n invert(): Commutator {\n return new Commutator(this.#B, this.#A);\n }\n\n *experimentalExpand(\n iterDir: IterationDirection = IterationDirection.Forwards,\n depth?: number,\n ): Generator<AlgLeaf> {\n depth ??= Infinity;\n if (depth === 0) {\n yield iterDir === IterationDirection.Forwards ? this : this.invert();\n } else {\n if (iterDir === IterationDirection.Forwards) {\n yield* this.A.experimentalExpand(\n IterationDirection.Forwards,\n depth - 1,\n );\n yield* this.B.experimentalExpand(\n IterationDirection.Forwards,\n depth - 1,\n );\n yield* this.A.experimentalExpand(\n IterationDirection.Backwards,\n depth - 1,\n );\n yield* this.B.experimentalExpand(\n IterationDirection.Backwards,\n depth - 1,\n );\n } else {\n yield* this.B.experimentalExpand(\n IterationDirection.Forwards,\n depth - 1,\n );\n yield* this.A.experimentalExpand(\n IterationDirection.Forwards,\n depth - 1,\n );\n yield* this.B.experimentalExpand(\n IterationDirection.Backwards,\n depth - 1,\n );\n yield* this.A.experimentalExpand(\n IterationDirection.Backwards,\n depth - 1,\n );\n }\n }\n }\n\n toString(\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string {\n return `[${this.#A.toString(experimentalSerializationOptions)}, ${this.#B.toString(experimentalSerializationOptions)}]`;\n }\n}\n", "import type { ExperimentalSerializationOptions } from \"cubing/alg/SerializationOptions\";\nimport {\n experimentalEnsureAlg,\n type Alg,\n type FlexibleAlgSource,\n} from \"../../Alg\";\nimport { AlgCommon, type Comparable } from \"../../common\";\nimport { IterationDirection } from \"../../iteration\";\nimport type { AlgLeaf } from \"../AlgNode\";\n\n/** @category Alg Nodes */\nexport class Conjugate extends AlgCommon<Conjugate> {\n readonly #A: Alg;\n readonly #B: Alg;\n\n constructor(aSource: FlexibleAlgSource, bSource: FlexibleAlgSource) {\n super();\n this.#A = experimentalEnsureAlg(aSource);\n this.#B = experimentalEnsureAlg(bSource);\n }\n\n get A(): Alg {\n return this.#A;\n }\n\n get B(): Alg {\n return this.#B;\n }\n\n isIdentical(other: Comparable): boolean {\n const otherAsConjugate = other.as(Conjugate);\n return !!(\n otherAsConjugate?.A.isIdentical(this.A) &&\n otherAsConjugate?.B.isIdentical(this.B)\n );\n }\n\n invert(): Conjugate {\n return new Conjugate(this.#A, this.#B.invert());\n }\n\n *experimentalExpand(\n iterDir: IterationDirection,\n depth?: number,\n ): Generator<AlgLeaf> {\n depth ??= Infinity;\n if (depth === 0) {\n yield iterDir === IterationDirection.Forwards ? this : this.invert();\n } else {\n yield* this.A.experimentalExpand(IterationDirection.Forwards, depth - 1);\n yield* this.B.experimentalExpand(iterDir, depth - 1);\n yield* this.A.experimentalExpand(IterationDirection.Backwards, depth - 1);\n }\n }\n\n toString(\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string {\n return `[${this.A.toString(experimentalSerializationOptions)}: ${this.B.toString(experimentalSerializationOptions)}]`;\n }\n}\n", "import type { ExperimentalSerializationOptions } from \"cubing/alg/SerializationOptions\";\nimport { AlgCommon, type Comparable } from \"../../common\";\nimport { IterationDirection } from \"../../iteration\";\nimport type { AlgLeaf } from \"../AlgNode\";\n\n// TODO: hash\n// TODO: this conflicts with the HTML `LineComment` class\n/** @category Alg Nodes */\nexport class LineComment extends AlgCommon<LineComment> {\n readonly #text: string;\n\n constructor(commentText: string) {\n super();\n if (commentText.includes(\"\\n\") || commentText.includes(\"\\r\")) {\n throw new Error(\"LineComment cannot contain newline\");\n }\n this.#text = commentText;\n }\n\n get text(): string {\n return this.#text;\n }\n\n isIdentical(other: Comparable): boolean {\n const otherAsLineComment = other as LineComment;\n return other.is(LineComment) && this.#text === otherAsLineComment.#text;\n }\n\n invert(): LineComment {\n return this;\n }\n\n *experimentalExpand(\n _iterDir: IterationDirection = IterationDirection.Forwards,\n _depth: number = Infinity,\n ): Generator<AlgLeaf> {\n yield this;\n }\n\n toString(\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string {\n return `//${this.#text}`;\n }\n // toJSON(): LineCommentJSON {\n // return {\n // type: \"comment\",\n // text: this.#text,\n // };\n // }\n}\n", "import type { ExperimentalSerializationOptions } from \"cubing/alg/SerializationOptions\";\nimport { AlgCommon, type Comparable } from \"../../common\";\nimport { IterationDirection } from \"../../iteration\";\nimport type { AlgLeaf } from \"../AlgNode\";\n\n/** @category Alg Nodes */\nexport class Newline extends AlgCommon<Newline> {\n toString(\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string {\n return \"\\n\";\n }\n\n isIdentical(other: Comparable): boolean {\n return other.is(Newline);\n }\n\n invert(): Newline {\n return this;\n }\n\n *experimentalExpand(\n _iterDir: IterationDirection = IterationDirection.Forwards,\n _depth: number = Infinity,\n ): Generator<AlgLeaf> {\n yield this;\n }\n}\n", "import type { ExperimentalSerializationOptions } from \"cubing/alg/SerializationOptions\";\nimport { AlgCommon, type Comparable } from \"../../common\";\nimport { IterationDirection } from \"../../iteration\";\nimport type { AlgLeaf } from \"../AlgNode\";\nimport type { Grouping } from \"../containers/Grouping\";\n\n/** @category Alg Nodes */\nexport class Pause extends AlgCommon<Pause> {\n experimentalNISSGrouping?: Grouping; // TODO: tie this to the alg\n\n toString(\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string {\n return \".\";\n }\n\n isIdentical(other: Comparable): boolean {\n return other.is(Pause);\n }\n\n invert(): Pause {\n return this;\n }\n\n *experimentalExpand(\n _iterDir: IterationDirection = IterationDirection.Forwards,\n _depth: number = Infinity,\n ): Generator<AlgLeaf> {\n yield this;\n }\n}\n", "import { Alg } from \"./Alg\";\nimport type { AlgNode } from \"./alg-nodes/AlgNode\";\n\n/** @category Alg */\nexport class AlgBuilder {\n #algNodes: AlgNode[] = [];\n\n push(u: AlgNode): void {\n this.#algNodes.push(u);\n }\n\n // TODO: Allow FlexibleAlgSource?\n /** @deprecated */\n experimentalPushAlg(alg: Alg): void {\n // TODO: Optimize?\n for (const u of alg.childAlgNodes()) {\n this.push(u);\n }\n }\n\n // TODO: can we guarantee this to be fast in the permanent API?\n experimentalNumAlgNodes(): number {\n return this.#algNodes.length;\n }\n\n // can be called multiple times, even if you push alg nodes inbetween.\n toAlg(): Alg {\n return new Alg(this.#algNodes);\n }\n\n reset(): void {\n this.#algNodes = [];\n }\n}\n", "type ReportingLevel = \"none\" | \"warn\" | \"error\";\nlet currentReportingLevel = \"warn\";\n\nconst MAX_NUMBER_OF_TIMES_TO_WARN = 10;\nlet numWarned = 0;\n\n// TODO: Avoid creating the string message if it won't be used (e.g. by taking a function?).\nexport function reportTypeMismatch(msg: string): void {\n switch (currentReportingLevel) {\n case \"error\":\n throw new Error(msg);\n case \"warn\": {\n numWarned++;\n if (numWarned < MAX_NUMBER_OF_TIMES_TO_WARN) {\n if (numWarned + 1 === MAX_NUMBER_OF_TIMES_TO_WARN) {\n console.warn(msg);\n }\n }\n return;\n }\n }\n}\n\nexport function setAlgPartTypeMismatchReportingLevel(\n level: ReportingLevel,\n): void {\n currentReportingLevel = level;\n}\n\nexport const algDebugGlobals: { caretNISSNotationEnabled: boolean } = {\n caretNISSNotationEnabled: true,\n};\n\nexport function setAlgDebug(options: {\n caretNISSNotationEnabled?: boolean;\n}): void {\n if (\"caretNISSNotationEnabled\" in options) {\n algDebugGlobals.caretNISSNotationEnabled =\n !!options.caretNISSNotationEnabled;\n }\n}\n", "import { Alg } from \"./Alg\";\nimport type { AlgNode } from \"./alg-nodes\";\nimport { Commutator } from \"./alg-nodes/containers/Commutator\";\nimport { Conjugate } from \"./alg-nodes/containers/Conjugate\";\nimport { Grouping } from \"./alg-nodes/containers/Grouping\";\nimport { LineComment } from \"./alg-nodes/leaves/LineComment\";\nimport { Move, QuantumMove } from \"./alg-nodes/leaves/Move\";\nimport { Newline } from \"./alg-nodes/leaves/Newline\";\nimport { Pause } from \"./alg-nodes/leaves/Pause\";\nimport { AlgBuilder } from \"./AlgBuilder\";\nimport { algDebugGlobals } from \"./debug\";\n\ntype StoppingChar = \",\" | \":\" | \"]\" | \")\";\n\nfunction parseIntWithEmptyFallback<T>(n: string, emptyFallback: T): number | T {\n return n ? parseInt(n) : emptyFallback;\n}\n\nconst AMOUNT_REGEX = /^(\\d+)?('?)/;\nconst MOVE_START_REGEX = /^[_\\dA-Za-z]/; // TODO: Handle slash\nconst QUANTUM_MOVE_REGEX = /^((([1-9]\\d*)-)?([1-9]\\d*))?([_A-Za-z]+)/;\nconst COMMENT_TEXT_REGEX = /^[^\\n]*/;\nconst SQUARE1_PAIR_START_REGEX = /^(-?\\d+), ?/; // TODO: match up with other whitespace handling?\nconst SQUARE1_PAIR_END_REGEX = /^(-?\\d+)\\)/; // TODO: match up with other whitespace handling?\n\nexport function parseAlg(s: string): Alg {\n return new AlgParser().parseAlg(s);\n}\n\nexport function parseMove(s: string): Move {\n return new AlgParser().parseMove(s);\n}\n\nexport function parseQuantumMove(s: string): QuantumMove {\n return new AlgParser().parseQuantumMove(s);\n}\n\nexport const startCharIndexKey = Symbol(\"startCharIndex\");\nexport const endCharIndexKey = Symbol(\"endCharIndex\");\n\nexport interface ParserIndexed {\n [startCharIndexKey]: number;\n [endCharIndexKey]: number;\n}\n\nexport type Parsed<T extends Alg | AlgNode> = T & ParserIndexed;\n\n// TODO: attach to parser so the end char index can default to `this.#idx`?\nfunction addCharIndices<T extends Alg | AlgNode>(\n t: T,\n startCharIndex: number,\n endCharIndex: number,\n): Parsed<T> {\n const parsedT = t as ParserIndexed & T;\n parsedT[startCharIndexKey] = startCharIndex;\n parsedT[endCharIndexKey] = endCharIndex;\n return parsedT;\n}\n\nexport function transferCharIndex<T extends Alg | AlgNode>(from: T, to: T): T {\n if (startCharIndexKey in from) {\n (to as Parsed<T>)[startCharIndexKey] = (from as Parsed<T>)[\n startCharIndexKey\n ];\n }\n if (endCharIndexKey in from) {\n (to as Parsed<T>)[endCharIndexKey] = (from as Parsed<T>)[endCharIndexKey];\n }\n return to;\n}\n\ntype MoveSuffix = \"+\" | \"++\" | \"-\" | \"--\";\n\n// TODO: support recording string locations for moves.\nclass AlgParser {\n #input: string = \"\";\n #idx: number = 0;\n #nissQueue: Grouping[] = [];\n\n parseAlg(input: string): Parsed<Alg> {\n this.#input = input;\n this.#idx = 0;\n const alg = this.parseAlgWithStopping([]);\n this.mustBeAtEndOfInput();\n const algNodes = Array.from(alg.childAlgNodes());\n if (this.#nissQueue.length > 0) {\n for (const nissGrouping of this.#nissQueue.reverse()) {\n algNodes.push(nissGrouping);\n }\n }\n const newAlg = new Alg(algNodes) as Parsed<Alg>;\n const {\n [startCharIndexKey]: startCharIndex,\n [endCharIndexKey]: endCharIndex,\n } = alg;\n addCharIndices(newAlg, startCharIndex, endCharIndex);\n return newAlg;\n }\n\n parseMove(input: string): Parsed<Move> {\n this.#input = input;\n this.#idx = 0;\n const move = this.parseMoveImpl();\n this.mustBeAtEndOfInput();\n return move;\n }\n\n parseQuantumMove(input: string): QuantumMove {\n this.#input = input;\n this.#idx = 0;\n const quantumMove = this.parseQuantumMoveImpl();\n this.mustBeAtEndOfInput();\n return quantumMove;\n }\n\n private mustBeAtEndOfInput() {\n if (this.#idx !== this.#input.length) {\n throw new Error(\"parsing unexpectedly ended early\");\n }\n }\n\n private parseAlgWithStopping(stopBefore: StoppingChar[]): Parsed<Alg> {\n let algStartIdx = this.#idx;\n let algEndIdx = this.#idx;\n const algBuilder = new AlgBuilder();\n\n // We're \"crowded\" if there was not a space or newline since the last alg node.\n let crowded = false;\n\n const mustNotBeCrowded = (idx: number): void => {\n if (crowded) {\n throw new Error(\n `Unexpected character at index ${idx}. Are you missing a space?`,\n ); // TODO better error message\n }\n };\n\n mainLoop: while (this.#idx < this.#input.length) {\n const savedCharIndex = this.#idx;\n if ((stopBefore as string[]).includes(this.#input[this.#idx])) {\n return addCharIndices(algBuilder.toAlg(), algStartIdx, algEndIdx);\n }\n if (this.tryConsumeNext(\" \")) {\n crowded = false;\n if (algBuilder.experimentalNumAlgNodes() === 0) {\n algStartIdx = this.#idx;\n }\n // biome-ignore lint/correctness/noUnnecessaryContinue: This line allows for more robust refactoring.\n // biome-ignore lint/complexity/noUselessLabel: This line allows for more robust refactoring.\n continue mainLoop;\n } else if (MOVE_START_REGEX.test(this.#input[this.#idx])) {\n mustNotBeCrowded(savedCharIndex);\n const move = this.parseMoveImpl();\n algBuilder.push(move);\n crowded = true;\n algEndIdx = this.#idx;\n\n // biome-ignore lint/correctness/noUnnecessaryContinue: This line allows for more robust refactoring.\n // biome-ignore lint/complexity/noUselessLabel: This line allows for more robust refactoring.\n continue mainLoop;\n } else if (this.tryConsumeNext(\"(\")) {\n mustNotBeCrowded(savedCharIndex);\n const sq1PairStartMatch = this.tryRegex(SQUARE1_PAIR_START_REGEX);\n if (sq1PairStartMatch) {\n const topAmountString = sq1PairStartMatch[1];\n const savedCharIndexD = this.#idx;\n const sq1PairEndMatch = this.parseRegex(SQUARE1_PAIR_END_REGEX);\n const uMove = addCharIndices(\n new Move(new QuantumMove(\"U_SQ_\"), parseInt(topAmountString)),\n savedCharIndex + 1,\n savedCharIndex + 1 + topAmountString.length,\n );\n const dMove = addCharIndices(\n new Move(new QuantumMove(\"D_SQ_\"), parseInt(sq1PairEndMatch[1])),\n savedCharIndexD,\n this.#idx - 1,\n );\n const alg = addCharIndices(\n new Alg([uMove, dMove]),\n savedCharIndex + 1,\n this.#idx - 1,\n );\n algBuilder.push(\n addCharIndices(new Grouping(alg), savedCharIndex, this.#idx),\n );\n crowded = true;\n algEndIdx = this.#idx;\n\n // biome-ignore lint/correctness/noUnnecessaryContinue: This line allows for more robust refactoring.\n // biome-ignore lint/complexity/noUselessLabel: This line allows for more robust refactoring.\n continue mainLoop;\n } else {\n const alg = this.parseAlgWithStopping([\")\"]);\n this.mustConsumeNext(\")\");\n const amount = this.parseAmount();\n algBuilder.push(\n addCharIndices(\n new Grouping(alg, amount),\n savedCharIndex,\n this.#idx,\n ),\n );\n crowded = true;\n algEndIdx = this.#idx;\n\n // biome-ignore lint/correctness/noUnnecessaryContinue: This line allows for more robust refactoring.\n // biome-ignore lint/complexity/noUselessLabel: This line allows for more robust refactoring.\n continue mainLoop;\n }\n } else if (this.tryConsumeNext(\"^\")) {\n if (!algDebugGlobals.caretNISSNotationEnabled) {\n throw new Error(\n \"Alg contained a caret but caret NISS notation is not enabled.\",\n );\n }\n\n this.mustConsumeNext(\"(\");\n const alg = this.parseAlgWithStopping([\")\"]);\n this.popNext();\n\n const grouping = new Grouping(alg, -1);\n const placeholder = new Pause();\n\n grouping.experimentalNISSPlaceholder = placeholder;\n placeholder.experimentalNISSGrouping = grouping;\n\n this.#nissQueue.push(grouping);\n algBuilder.push(placeholder);\n } else if (this.tryConsumeNext(\"[\")) {\n mustNotBeCrowded(savedCharIndex);\n const A = this.parseAlgWithStopping([\",\", \":\"]);\n const separator = this.popNext();\n const B = this.parseAlgWithStopping([\"]\"]);\n this.mustConsumeNext(\"]\");\n let unrepeated: Commutator | Conjugate;\n switch (separator) {\n case \":\": {\n unrepeated = addCharIndices(\n new Conjugate(A, B),\n savedCharIndex,\n this.#idx,\n );\n crowded = true;\n algEndIdx = this.#idx;\n break;\n }\n case \",\": {\n unrepeated = addCharIndices(\n new Commutator(A, B),\n savedCharIndex,\n this.#idx,\n );\n crowded = true;\n algEndIdx = this.#idx;\n break;\n }\n default:\n throw new Error(\"unexpected parsing error\");\n }\n const afterClosingBracketIdx = this.#idx;\n const amount = this.parseAmount();\n if (amount === 1) {\n algBuilder.push(unrepeated);\n } else {\n const unrepeatedAlg = addCharIndices(\n new Alg([unrepeated]),\n savedCharIndex,\n afterClosingBracketIdx,\n );\n const grouping = addCharIndices(\n new Grouping(unrepeatedAlg, amount),\n savedCharIndex,\n this.#idx,\n );\n algBuilder.push(grouping);\n }\n crowded = true;\n algEndIdx = this.#idx;\n\n // biome-ignore lint/correctness/noUnnecessaryContinue: This line allows for more robust refactoring.\n // biome-ignore lint/complexity/noUselessLabel: This line allows for more robust refactoring.\n continue mainLoop;\n } else if (this.tryConsumeNext(\"\\n\")) {\n algBuilder.push(\n addCharIndices(new Newline(), savedCharIndex, this.#idx),\n );\n crowded = false;\n algEndIdx = this.#idx;\n\n // biome-ignore lint/correctness/noUnnecessaryContinue: This line allows for more robust refactoring.\n // biome-ignore lint/complexity/noUselessLabel: This line allows for more robust refactoring.\n continue mainLoop;\n } else if (this.tryConsumeNext(\"/\")) {\n if (this.tryConsumeNext(\"/\")) {\n mustNotBeCrowded(savedCharIndex);\n const [text] = this.parseRegex(COMMENT_TEXT_REGEX);\n algBuilder.push(\n addCharIndices(new LineComment(text), savedCharIndex, this.#idx),\n );\n crowded = false;\n algEndIdx = this.#idx;\n\n // biome-ignore lint/correctness/noUnnecessaryContinue: This line allows for more robust refactoring.\n // biome-ignore lint/complexity/noUselessLabel: This line allows for more robust refactoring.\n continue mainLoop;\n } else {\n // We allow crowding here to account for csTimer scrambles, which don't have a space between a Square-1 tuple and the following slash.\n algBuilder.push(\n addCharIndices(new Move(\"_SLASH_\"), savedCharIndex, this.#idx),\n );\n crowded = true;\n algEndIdx = this.#idx;\n\n // biome-ignore lint/correctness/noUnnecessaryContinue: This line allows for more robust refactoring.\n // biome-ignore lint/complexity/noUselessLabel: This line allows for more robust refactoring.\n continue mainLoop;\n }\n } else if (this.tryConsumeNext(\".\")) {\n mustNotBeCrowded(savedCharIndex);\n algBuilder.push(addCharIndices(new Pause(), savedCharIndex, this.#idx));\n crowded = true;\n algEndIdx = this.#idx;\n\n // biome-ignore lint/correctness/noUnnecessaryContinue: This line allows for more robust refactoring.\n // biome-ignore lint/complexity/noUselessLabel: This line allows for more robust refactoring.\n continue mainLoop;\n } else {\n throw new Error(`Unexpected character: ${this.popNext()}`);\n }\n }\n\n if (this.#idx !== this.#input.length) {\n throw new Error(\"did not finish parsing?\");\n }\n if (stopBefore.length > 0) {\n throw new Error(\"expected stopping\");\n }\n return addCharIndices(algBuilder.toAlg(), algStartIdx, algEndIdx);\n }\n\n private parseQuantumMoveImpl(): QuantumMove {\n const [, , , outerLayerStr, innerLayerStr, family] =\n this.parseRegex(QUANTUM_MOVE_REGEX);\n\n return new QuantumMove(\n family,\n parseIntWithEmptyFallback(innerLayerStr, undefined),\n parseIntWithEmptyFallback(outerLayerStr, undefined),\n );\n }\n\n private parseMoveImpl(): Parsed<Move> {\n const savedCharIndex = this.#idx;\n\n if (this.tryConsumeNext(\"/\")) {\n return addCharIndices(new Move(\"_SLASH_\"), savedCharIndex, this.#idx);\n }\n\n let quantumMove = this.parseQuantumMoveImpl();\n // Only `hadEmptyAbsAmount` is `const`.\n let [amount, hadEmptyAbsAmount] = this.parseAmountAndTrackEmptyAbsAmount();\n const suffix = this.parseMoveSuffix();\n\n if (suffix) {\n if (amount < 0) {\n throw new Error(\"uh-oh\");\n }\n if ((suffix === \"++\" || suffix === \"--\") && amount !== 1) {\n // TODO: Handle 1 vs. null\n throw new Error(\n \"Pochmann ++ or -- moves cannot have an amount other than 1.\",\n );\n }\n if ((suffix === \"++\" || suffix === \"--\") && !hadEmptyAbsAmount) {\n throw new Error(\n \"Pochmann ++ or -- moves cannot have an amount written as a number.\",\n );\n }\n if ((suffix === \"+\" || suffix === \"-\") && hadEmptyAbsAmount) {\n throw new Error(\n \"Clock dial moves must have an amount written as a natural number followed by + or -.\",\n );\n }\n if (suffix.startsWith(\"+\")) {\n quantumMove = quantumMove.modified({\n family: `${quantumMove.family}_${\n suffix === \"+\" ? \"PLUS\" : \"PLUSPLUS\"\n }_`, // TODO\n });\n }\n if (suffix.startsWith(\"-\")) {\n quantumMove = quantumMove.modified({\n family: `${quantumMove.family}_${\n suffix === \"-\" ? \"PLUS\" : \"PLUSPLUS\"\n }_`, // TODO\n });\n amount *= -1;\n }\n }\n\n const move = addCharIndices(\n new Move(quantumMove, amount),\n savedCharIndex,\n this.#idx,\n );\n return move;\n }\n\n private parseMoveSuffix(): MoveSuffix | null {\n if (this.tryConsumeNext(\"+\")) {\n if (this.tryConsumeNext(\"+\")) {\n return \"++\";\n }\n return \"+\";\n }\n if (this.tryConsumeNext(\"-\")) {\n if (this.tryConsumeNext(\"-\")) {\n return \"--\";\n }\n return \"-\";\n }\n return null;\n }\n\n private parseAmountAndTrackEmptyAbsAmount(): [number, boolean] {\n const savedIdx = this.#idx;\n const [, absAmountStr, primeStr] = this.parseRegex(AMOUNT_REGEX);\n if (absAmountStr?.startsWith(\"0\") && absAmountStr !== \"0\") {\n throw new Error(\n `Error at char index ${savedIdx}: An amount can only start with 0 if it's exactly the digit 0.`,\n );\n }\n return [\n parseIntWithEmptyFallback(absAmountStr, 1) * (primeStr === \"'\" ? -1 : 1),\n !absAmountStr,\n ];\n }\n\n private parseAmount(): number {\n const savedIdx = this.#idx;\n const [, absAmountStr, primeStr] = this.parseRegex(AMOUNT_REGEX);\n if (absAmountStr?.startsWith(\"0\") && absAmountStr !== \"0\") {\n throw new Error(\n `Error at char index ${savedIdx}: An amount number can only start with 0 if it's exactly the digit 0.`,\n );\n }\n return (\n parseIntWithEmptyFallback(absAmountStr, 1) * (primeStr === \"'\" ? -1 : 1)\n );\n }\n\n private parseRegex(regex: RegExp): RegExpExecArray {\n const arr = regex.exec(this.remaining());\n if (arr === null) {\n throw new Error(\"internal parsing error\"); // TODO\n }\n this.#idx += arr[0].length;\n return arr;\n }\n\n // TOD: can we avoid this?\n private tryRegex(regex: RegExp): RegExpExecArray | null {\n const arr = regex.exec(this.remaining());\n if (arr === null) {\n return null;\n }\n this.#idx += arr[0].length;\n return arr;\n }\n\n private remaining(): string {\n return this.#input.slice(this.#idx);\n }\n\n private popNext(): string {\n const next = this.#input[this.#idx];\n this.#idx++;\n return next;\n }\n\n private tryConsumeNext(expected: string): boolean {\n if (this.#input[this.#idx] === expected) {\n this.#idx++;\n return true;\n }\n return false;\n }\n\n private mustConsumeNext(expected: string): string {\n const next = this.popNext();\n if (next !== expected) {\n throw new Error(\n `expected \\`${expected}\\` while parsing, encountered ${next}`,\n ); // TODO: be more helpful\n }\n return next;\n }\n}\n", "const warned = new Set<string>();\nexport function warnOnce(s: string): void {\n if (!warned.has(s)) {\n console.warn(s);\n warned.add(s);\n }\n}\n", "import type { Repeatable } from \"../common\";\nimport { toggleDirection, type IterationDirection } from \"../iteration\";\nimport { MAX_INT, MAX_INT_DESCRIPTION, MIN_INT } from \"../limits\";\nimport type { AlgLeaf } from \"./AlgNode\";\n\nexport class QuantumWithAmount<Q extends Repeatable> {\n readonly quantum: Q;\n readonly amount: number;\n\n constructor(quantum: Q, amount: number = 1) {\n this.quantum = quantum;\n this.amount = amount;\n\n if (\n !Number.isInteger(this.amount) ||\n this.amount < MIN_INT ||\n this.amount > MAX_INT\n ) {\n throw new Error(\n `AlgNode amount absolute value must be a non-negative integer below ${MAX_INT_DESCRIPTION}.`,\n );\n }\n }\n\n suffix(): string {\n let s: string = \"\";\n // TODO\n const absAmount = Math.abs(this.amount);\n if (absAmount !== 1) {\n s += absAmount;\n }\n if (this.amount < 0) {\n s += \"'\";\n }\n return s;\n }\n\n isIdentical(other: QuantumWithAmount<Q>): boolean {\n return (\n this.quantum.isIdentical(other.quantum) && this.amount === other.amount\n );\n }\n\n // TODO: `Conjugate` and `Commutator` decrement `depth` inside the quantum, `Grouping` has to do it outside the quantum.\n *experimentalExpand(\n iterDir: IterationDirection,\n depth: number,\n ): Generator<AlgLeaf> {\n const absAmount = Math.abs(this.amount);\n const newIterDir = toggleDirection(iterDir, this.amount < 0);\n for (let i = 0; i < absAmount; i++) {\n yield* this.quantum.experimentalExpand(newIterDir, depth);\n }\n }\n}\n", "import type { ExperimentalSerializationOptions } from \"cubing/alg/SerializationOptions\";\nimport { AlgCommon, Comparable } from \"../../common\";\nimport { IterationDirection } from \"../../iteration\";\nimport { MAX_INT, MAX_INT_DESCRIPTION } from \"../../limits\";\nimport { parseMove, parseQuantumMove, transferCharIndex } from \"../../parseAlg\";\nimport { warnOnce } from \"../../warnOnce\";\nimport type { AlgLeaf } from \"../AlgNode\";\nimport { QuantumWithAmount } from \"../QuantumWithAmount\";\n\ninterface QuantumMoveModifications {\n outerLayer?: number;\n innerLayer?: number;\n family?: string;\n}\n\nexport class QuantumMove extends Comparable {\n readonly #family: string;\n readonly #innerLayer: number | null;\n readonly #outerLayer: number | null;\n\n constructor(\n family: string,\n innerLayer?: number | null,\n outerLayer?: number | null,\n ) {\n super();\n this.#family = family;\n this.#innerLayer = innerLayer ?? null;\n this.#outerLayer = outerLayer ?? null;\n Object.freeze(this);\n\n if (\n this.#innerLayer !== null &&\n (!Number.isInteger(this.#innerLayer) ||\n this.#innerLayer < 1 ||\n this.#innerLayer > MAX_INT)\n ) {\n throw new Error(\n `QuantumMove inner layer must be a positive integer below ${MAX_INT_DESCRIPTION}.`,\n );\n }\n\n if (\n this.#outerLayer !== null &&\n (!Number.isInteger(this.#outerLayer) ||\n this.#outerLayer < 1 ||\n this.#outerLayer > MAX_INT)\n ) {\n throw new Error(\n `QuantumMove outer layer must be a positive integer below ${MAX_INT_DESCRIPTION}.`,\n );\n }\n\n if (\n this.#outerLayer !== null &&\n this.#innerLayer !== null &&\n this.#innerLayer <= this.#outerLayer\n ) {\n throw new Error(\n \"QuantumMove outer layer must be smaller than inner layer.\",\n );\n }\n\n if (this.#outerLayer !== null && this.#innerLayer === null) {\n throw new Error(\n \"QuantumMove with an outer layer must have an inner layer\",\n ); // TODO: test\n }\n }\n\n static fromString(s: string): QuantumMove {\n return parseQuantumMove(s);\n }\n\n // TODO: `modify`?\n modified(modifications: QuantumMoveModifications): QuantumMove {\n return new QuantumMove(\n modifications.family ?? this.#family,\n modifications.innerLayer ?? this.#innerLayer,\n modifications.outerLayer ?? this.#outerLayer,\n );\n }\n\n isIdentical(other: QuantumMove): boolean {\n const otherAsQuantumMove = other;\n return (\n other.is(QuantumMove) &&\n this.#family === otherAsQuantumMove.#family &&\n this.#innerLayer === otherAsQuantumMove.#innerLayer &&\n this.#outerLayer === otherAsQuantumMove.#outerLayer\n );\n }\n\n // TODO: provide something more useful on average.\n /** @deprecated */\n get family(): string {\n return this.#family;\n }\n\n // TODO: provide something more useful on average.\n /** @deprecated */\n get outerLayer(): number | null {\n return this.#outerLayer;\n }\n\n // TODO: provide something more useful on average.\n /** @deprecated */\n get innerLayer(): number | null {\n return this.#innerLayer;\n }\n\n experimentalExpand(): Generator<AlgLeaf> {\n throw new Error(\n \"experimentalExpand() cannot be called on a `QuantumMove` directly.\",\n );\n }\n\n override toString(\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string {\n let s = this.#family;\n if (this.#innerLayer !== null) {\n s = String(this.#innerLayer) + s;\n if (this.#outerLayer !== null) {\n s = `${String(this.#outerLayer)}-${s}`;\n }\n }\n return s;\n }\n}\n\nexport interface MoveModifications {\n outerLayer?: number;\n innerLayer?: number;\n family?: string;\n amount?: number;\n}\n\n/** @category Alg Nodes */\nexport class Move extends AlgCommon<Move> {\n readonly #quantumWithAmount: QuantumWithAmount<QuantumMove>;\n\n constructor(\n ...args: [QuantumMove] | [QuantumMove, number] | [string] | [string, number]\n ) {\n super();\n if (typeof args[0] === \"string\") {\n if (args[1] ?? null) {\n this.#quantumWithAmount = new QuantumWithAmount(\n QuantumMove.fromString(args[0]),\n args[1],\n );\n return;\n } else {\n // biome-ignore lint/correctness/noConstructorReturn: https://github.com/rome/tools/issues/4005\n return Move.fromString(args[0]);\n }\n }\n this.#quantumWithAmount = new QuantumWithAmount<QuantumMove>(\n args[0],\n args[1],\n );\n }\n\n isIdentical(other: Comparable): boolean {\n const otherAsMove = other.as(Move);\n return (\n !!otherAsMove &&\n this.#quantumWithAmount.isIdentical(otherAsMove.#quantumWithAmount)\n );\n }\n\n invert(): Move {\n // TODO: handle char indices more consistently among alg nodes.\n return transferCharIndex(\n this,\n new Move(\n this.#quantumWithAmount.quantum,\n this.#isSlash() ? this.amount : -this.amount,\n ),\n );\n }\n\n *experimentalExpand(\n iterDir: IterationDirection = IterationDirection.Forwards,\n ): Generator<AlgLeaf> {\n if (iterDir === IterationDirection.Forwards) {\n yield this;\n } else {\n yield this.modified({\n amount: -this.amount,\n });\n }\n }\n\n get quantum(): QuantumMove {\n return this.#quantumWithAmount.quantum;\n }\n\n // TODO: `modify`?\n modified(modifications: MoveModifications): Move {\n // TODO: Avoid creating a new quantum move\n return new Move(\n this.#quantumWithAmount.quantum.modified(modifications),\n modifications.amount ?? this.amount,\n );\n }\n\n static fromString(s: string): Move {\n return parseMove(s);\n }\n\n get amount(): number {\n return this.#quantumWithAmount.amount;\n }\n\n /** @deprecated */\n get type(): string {\n warnOnce(\"deprecated: type\");\n return \"blockMove\";\n }\n\n /** @deprecated */\n get family(): string {\n return this.#quantumWithAmount.quantum.family ?? undefined;\n }\n\n /** @deprecated */\n get outerLayer(): number | undefined {\n return this.#quantumWithAmount.quantum.outerLayer ?? undefined;\n }\n\n /** @deprecated */\n get innerLayer(): number | undefined {\n return this.#quantumWithAmount.quantum.innerLayer ?? undefined;\n }\n\n #cachedSlashMove: Move | undefined;\n #isSlash(): boolean {\n return this.isIdentical((this.#cachedSlashMove ??= new Move(\"_SLASH_\")));\n }\n\n toString(\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string {\n if (experimentalSerializationOptions?.notation !== \"LGN\") {\n if (this.#isSlash()) {\n return \"/\"; // TODO: validate no amount\n }\n if (this.family.endsWith(\"_PLUS_\")) {\n return (\n this.#quantumWithAmount.quantum.toString().slice(0, -6) +\n Math.abs(this.amount) +\n (this.amount < 0 ? \"-\" : \"+\")\n ); // TODO\n }\n if (this.family.endsWith(\"_PLUSPLUS_\")) {\n const absAmount = Math.abs(this.amount);\n return (\n this.#quantumWithAmount.quantum.toString().slice(0, -10) +\n (absAmount === 1 ? \"\" : absAmount) +\n (this.amount < 0 ? \"--\" : \"++\")\n ); // TODO\n }\n }\n return (\n this.#quantumWithAmount.quantum.toString(\n experimentalSerializationOptions,\n ) + this.#quantumWithAmount.suffix()\n );\n }\n // // TODO: Serialize as a string?\n // toJSON(): MoveJSON {\n // return {\n // type: \"move\",\n // family: this.family,\n // innerLayer: this.innerLayer,\n // outerLayer: this.outerLayer,\n // };\n // }\n}\n", "import type { ExperimentalSerializationOptions } from \"cubing/alg/SerializationOptions\";\nimport { Commutator, Conjugate } from \"..\";\nimport { Alg, experimentalEnsureAlg, type FlexibleAlgSource } from \"../../Alg\";\nimport { AlgCommon, type Comparable } from \"../../common\";\nimport { IterationDirection } from \"../../iteration\";\nimport type { AlgLeaf, AlgNode } from \"../AlgNode\";\nimport { Move, QuantumMove } from \"../leaves/Move\";\nimport type { Pause } from \"../leaves/Pause\";\nimport { QuantumWithAmount } from \"../QuantumWithAmount\";\n\n// This is a workaround for `jest`, which doesn't handle cycles of imports inside `cubing/alg`.\n// We need to lazy-initialize the reusable quantum moves for Square-1, so we create this wrapper for it.\nclass Square1TupleFormatter {\n quantumU_SQ_: QuantumMove | null = null;\n quantumD_SQ_: QuantumMove | null = null;\n\n format(\n grouping: Grouping,\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string | null {\n if (experimentalSerializationOptions?.notation === \"LGN\") {\n return null;\n }\n\n if (grouping.amount !== 1) {\n return null;\n }\n const amounts = this.tuple(grouping);\n if (!amounts) {\n return null;\n }\n return `(${amounts.map((move) => move.amount).join(\", \")})`;\n }\n\n tuple(grouping: Grouping): [moveU: Move, moveD: Move] | null {\n if (grouping.amount !== 1) {\n return null;\n }\n\n this.quantumU_SQ_ ||= new QuantumMove(\"U_SQ_\");\n this.quantumD_SQ_ ||= new QuantumMove(\"D_SQ_\");\n\n const quantumAlg = grouping.alg;\n if (quantumAlg.experimentalNumChildAlgNodes() === 2) {\n const [U, D] = quantumAlg.childAlgNodes();\n if (\n U.as(Move)?.quantum.isIdentical(this.quantumU_SQ_) &&\n D.as(Move)?.quantum.isIdentical(this.quantumD_SQ_)\n ) {\n return [U as Move, D as Move]; // TODO: can we reuse the casting from above?\n }\n }\n return null;\n }\n}\nconst square1TupleFormatterInstance = new Square1TupleFormatter();\n\n/** @category Alg Nodes */\nexport class Grouping extends AlgCommon<Grouping> {\n readonly #quantumWithAmount: QuantumWithAmount<Alg>;\n experimentalNISSPlaceholder?: Pause; // TODO: tie this to the alg\n\n constructor(algSource: FlexibleAlgSource, amount?: number) {\n super();\n const alg = experimentalEnsureAlg(algSource);\n this.#quantumWithAmount = new QuantumWithAmount(alg, amount);\n }\n\n isIdentical(other: Comparable): boolean {\n const otherAsGrouping = other as Grouping;\n return (\n other.is(Grouping) &&\n this.#quantumWithAmount.isIdentical(otherAsGrouping.#quantumWithAmount)\n );\n }\n\n get alg(): Alg {\n return this.#quantumWithAmount.quantum;\n }\n\n get amount(): number {\n return this.#quantumWithAmount.amount;\n }\n\n /** @deprecated */\n get experimentalRepetitionSuffix(): string {\n return this.#quantumWithAmount.suffix();\n }\n\n invert(): Grouping {\n const amounts = square1TupleFormatterInstance.tuple(this);\n if (amounts) {\n const [moveU, moveD] = amounts;\n return new Grouping(new Alg([moveU.invert(), moveD.invert()]));\n }\n return new Grouping(\n this.#quantumWithAmount.quantum,\n -this.#quantumWithAmount.amount,\n );\n }\n\n *experimentalExpand(\n iterDir: IterationDirection = IterationDirection.Forwards,\n depth?: number,\n ): Generator<AlgLeaf> {\n depth ??= Infinity;\n if (depth === 0) {\n yield iterDir === IterationDirection.Forwards ? this : this.invert();\n } else {\n yield* this.#quantumWithAmount.experimentalExpand(iterDir, depth - 1);\n }\n }\n\n static fromString(): Grouping {\n throw new Error(\"unimplemented\");\n }\n\n #unrepeatedString(\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string | null {\n const insideString = this.#quantumWithAmount.quantum.toString(\n experimentalSerializationOptions,\n );\n const iter = this.alg.childAlgNodes();\n const { value } = iter.next() as {\n value: AlgNode;\n done: boolean;\n };\n if (iter.next().done && (value?.is(Commutator) || value?.is(Conjugate))) {\n return insideString;\n }\n return `(${insideString})`;\n }\n\n toString(\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string {\n return (\n square1TupleFormatterInstance.format(\n this,\n experimentalSerializationOptions,\n ) ??\n `${this.#unrepeatedString(experimentalSerializationOptions)}${this.#quantumWithAmount.suffix()}`\n );\n }\n\n experimentalAsSquare1Tuple(): [moveU: Move, moveD: Move] | null {\n return square1TupleFormatterInstance.tuple(this);\n }\n // toJSON(): GroupingJSON {\n // return {\n // type: \"grouping\",\n // alg: this.#quanta.quantum.toJSON(),\n // };\n // }\n}\n", "import type { Alg } from \"./Alg\";\nimport {\n Commutator,\n Conjugate,\n Grouping,\n LineComment,\n Move,\n Newline,\n Pause,\n} from \"./alg-nodes\";\n\nexport function experimentalIs(\n v: any,\n c:\n | typeof Alg\n | typeof Grouping\n | typeof LineComment\n | typeof Commutator\n | typeof Conjugate\n | typeof Move\n | typeof Newline\n | typeof Pause,\n): boolean {\n return v instanceof c;\n}\nexport function experimentalIsAlgNode(v: any): boolean {\n return (\n experimentalIs(v, Grouping) ||\n experimentalIs(v, LineComment) ||\n experimentalIs(v, Commutator) ||\n experimentalIs(v, Conjugate) ||\n experimentalIs(v, Move) ||\n experimentalIs(v, Newline) ||\n experimentalIs(v, Pause)\n );\n}\n", "import type { Alg } from \"./Alg\";\nimport type { AlgNode } from \"./alg-nodes/AlgNode\";\nimport { Commutator } from \"./alg-nodes/containers/Commutator\";\nimport { Conjugate } from \"./alg-nodes/containers/Conjugate\";\nimport { Grouping } from \"./alg-nodes/containers/Grouping\";\nimport { LineComment } from \"./alg-nodes/leaves/LineComment\";\nimport { Move } from \"./alg-nodes/leaves/Move\";\nimport { Newline } from \"./alg-nodes/leaves/Newline\";\nimport { Pause } from \"./alg-nodes/leaves/Pause\";\nimport type { Comparable } from \"./common\";\n\nfunction dispatch<DataDown, DataAlgUp, DataAlgNodeUp>(\n t: TraversalDownUp<DataDown, DataAlgUp, DataAlgNodeUp>,\n algNode: AlgNode,\n dataDown: DataDown,\n): DataAlgNodeUp {\n // TODO: Can we turn this back into a `switch` or something more efficiently?\n if (algNode.is(Grouping)) {\n return t.traverseGrouping(algNode as Grouping, dataDown);\n }\n if (algNode.is(Move)) {\n return t.traverseMove(algNode as Move, dataDown);\n }\n if (algNode.is(Commutator)) {\n return t.traverseCommutator(algNode as Commutator, dataDown);\n }\n if (algNode.is(Conjugate)) {\n return t.traverseConjugate(algNode as Conjugate, dataDown);\n }\n if (algNode.is(Pause)) {\n return t.traversePause(algNode as Pause, dataDown);\n }\n if (algNode.is(Newline)) {\n return t.traverseNewline(algNode as Newline, dataDown);\n }\n if (algNode.is(LineComment)) {\n return t.traverseLineComment(algNode as LineComment, dataDown);\n }\n throw new Error(\"unknown AlgNode\");\n}\n\nfunction mustBeAlgNode(t: Comparable): AlgNode {\n if (\n t.is(Grouping) ||\n t.is(Move) ||\n t.is(Commutator) ||\n t.is(Conjugate) ||\n t.is(Pause) ||\n t.is(Newline) ||\n t.is(LineComment)\n ) {\n return t as AlgNode;\n }\n throw new Error(\"internal error: expected AlgNode\"); // TODO: Make more helpful, add tests\n}\n\nexport abstract class TraversalDownUp<\n DataDown,\n DataAlgUp,\n DataAlgNodeUp = DataAlgUp,\n> {\n // Immediate subclasses should overwrite this.\n public traverseAlgNode(algNode: AlgNode, dataDown: DataDown): DataAlgNodeUp {\n return dispatch(this, algNode, dataDown);\n }\n\n public traverseIntoAlgNode(algNode: AlgNode, dataDown: DataDown): AlgNode {\n return mustBeAlgNode(this.traverseAlgNode(algNode, dataDown) as any);\n }\n\n public abstract traverseAlg(alg: Alg, dataDown: DataDown): DataAlgUp;\n\n public abstract traverseGrouping(\n grouping: Grouping,\n dataDown: DataDown,\n ): DataAlgNodeUp;\n\n public abstract traverseMove(move: Move, dataDown: DataDown): DataAlgNodeUp;\n\n public abstract traverseCommutator(\n commutator: Commutator,\n dataDown: DataDown,\n ): DataAlgNodeUp;\n\n public abstract traverseConjugate(\n conjugate: Conjugate,\n dataDown: DataDown,\n ): DataAlgNodeUp;\n\n public abstract traversePause(\n pause: Pause,\n dataDown: DataDown,\n ): DataAlgNodeUp;\n public abstract traverseNewline(\n newline: Newline,\n dataDown: DataDown,\n ): DataAlgNodeUp;\n\n public abstract traverseLineComment(\n comment: LineComment,\n dataDown: DataDown,\n ): DataAlgNodeUp;\n}\n\nexport abstract class TraversalUp<\n DataAlgUp,\n DataAlgNodeUp = DataAlgUp,\n> extends TraversalDownUp<undefined, DataAlgUp, DataAlgNodeUp> {\n public override traverseAlgNode(algNode: AlgNode): DataAlgNodeUp {\n return dispatch<unknown, DataAlgUp, DataAlgNodeUp>(\n this,\n algNode,\n undefined,\n );\n }\n\n public override traverseIntoAlgNode(algNode: AlgNode): AlgNode {\n return mustBeAlgNode(this.traverseAlgNode(algNode) as any);\n }\n\n public abstract override traverseAlg(alg: Alg): DataAlgUp;\n public abstract override traverseGrouping(grouping: Grouping): DataAlgNodeUp;\n public abstract override traverseMove(move: Move): DataAlgNodeUp;\n public abstract override traverseCommutator(\n commutator: Commutator,\n ): DataAlgNodeUp;\n public abstract override traverseConjugate(\n conjugate: Conjugate,\n ): DataAlgNodeUp;\n public abstract override traversePause(pause: Pause): DataAlgNodeUp;\n public abstract override traverseNewline(newline: Newline): DataAlgNodeUp;\n public abstract override traverseLineComment(\n comment: LineComment,\n ): DataAlgNodeUp;\n}\n\nexport function functionFromTraversal<\n DataDown,\n DataAlgUp,\n ConstructorArgs extends unknown[],\n>(\n traversalConstructor: {\n new (...args: ConstructorArgs): TraversalDownUp<DataDown, DataAlgUp, any>;\n },\n constructorArgs?: ConstructorArgs,\n): undefined extends DataDown\n ? (alg: Alg) => DataAlgUp\n : (alg: Alg, v: DataDown) => DataAlgUp {\n const instance = new traversalConstructor(\n ...(constructorArgs ?? ([] as any)),\n );\n return instance.traverseAlg.bind(instance);\n}\n", "import type { Move, QuantumMove } from \"../alg-nodes\";\n\n// TODO: enums?\nconst DEFAULT_DIRECTIONAL = \"any-direction\";\nDEFAULT_DIRECTIONAL;\nexport type QuantumDirectionalCancellation =\n | typeof DEFAULT_DIRECTIONAL // Cancel any moves with the same quantum.\n | \"same-direction\" // Cancel two quantums when have non-zero amounts of the same sign (positive/negative). An amount of 0 always counts as the same direction as any other amount.\n | \"none\";\n\n// Example input: `R7' . R6' . R5' . R6` on a cube.\nexport type ModWrap =\n | \"none\" // R7' . R6' . R5' . R6\n | \"gravity\" // R . R2' . R' . R2\n | \"canonical-centered\" // R . R2 . R' . R2\n | \"canonical-positive\" // R . R2 . R3 . R2\n | \"preserve-sign\"; // R3' . R2' . R' . R2\n\nexport interface AppendCancelOptions {\n directional?: QuantumDirectionalCancellation;\n puzzleSpecificModWrap?: ModWrap; // Default depends on `directional`\n}\n\n// TODO: preserve single moves even when amount is 0?\nexport interface AppendOptions {\n cancel?: boolean | AppendCancelOptions; // Set to `true` to use future-proof defaults.\n // Takes precedence over the direct `puzzleSpecificSimplifyOptions` field.\n puzzleLoader?: {\n puzzleSpecificSimplifyOptions?: PuzzleSpecificSimplifyOptions;\n };\n puzzleSpecificSimplifyOptions?: PuzzleSpecificSimplifyOptions;\n}\n\nexport class AppendOptionsHelper {\n constructor(private config: AppendOptions = {}) {}\n\n cancelQuantum(): QuantumDirectionalCancellation {\n const { cancel } = this.config;\n if (cancel === true) {\n return DEFAULT_DIRECTIONAL;\n }\n if (cancel === false) {\n return \"none\";\n }\n return cancel?.directional ?? \"none\";\n }\n\n cancelAny() {\n return this.config.cancel && this.cancelQuantum() !== \"none\";\n }\n\n cancelPuzzleSpecificModWrap(): ModWrap {\n const { cancel } = this.config;\n if (cancel === true || cancel === false) {\n return \"canonical-centered\";\n }\n if (cancel?.puzzleSpecificModWrap) {\n return cancel?.puzzleSpecificModWrap;\n }\n return cancel?.directional === \"same-direction\"\n ? \"preserve-sign\"\n : \"canonical-centered\";\n }\n\n puzzleSpecificSimplifyOptions(): PuzzleSpecificSimplifyOptions | undefined {\n return (\n this.config.puzzleLoader?.puzzleSpecificSimplifyOptions ??\n this.config.puzzleSpecificSimplifyOptions\n );\n }\n}\n\nexport interface SimplifyOptions extends AppendOptions {\n depth?: number | null; // TODO: test\n}\n\nexport interface PuzzleSpecificAxisSimplifyInfo {\n // All moves on the same axis *must* commute.\n areQuantumMovesSameAxis: (\n quantumMove1: QuantumMove,\n quantumMove2: QuantumMove,\n ) => boolean;\n simplifySameAxisMoves: (moves: Move[], quantumMod: boolean) => Move[];\n}\n\n// TODO: allow \"normal\" \"twisty\" puzzles to hardcode axis concepts without hardcoding too much in `Alg` that's not relevant to all puzzles.\nexport interface PuzzleSpecificSimplifyOptions {\n quantumMoveOrder?: (quantumMove: QuantumMove) => number;\n // TODO: implement cancellation for non-axis commuting moves (e.g. Megaminx: `BL R BL'` \u2192 `R`)\n // // Commutation is not transitive. For example, on Megaminx: BR and BL both commute with F, but not with each other.\n // doQuantumMovesCommute?: (\n // quantumMove1: QuantumMove,\n // quantumMove2: QuantumMove,\n // ) => boolean;\n axis?: PuzzleSpecificAxisSimplifyInfo;\n}\n", "import { Alg } from \"../Alg\";\nimport type { AlgNode } from \"../alg-nodes\";\nimport type { AlgLeaf } from \"../alg-nodes/AlgNode\";\nimport { Move } from \"../alg-nodes/leaves/Move\";\nimport { type AppendOptions, AppendOptionsHelper } from \"./options\";\n\nfunction areSameDirection(direction: -1 | 1, move2: Move): boolean {\n // This multiplication has two properties:\n // - If either amount is 0, returns true.\n // - Otherwise, the signs have to match.\n return direction * Math.sign(move2.amount) >= 0;\n}\n\nexport function offsetMod(\n x: number,\n positiveMod: number,\n offset: number = 0,\n): number {\n return ((((x - offset) % positiveMod) + positiveMod) % positiveMod) + offset;\n}\n\nexport function experimentalAppendMove(\n alg: Alg,\n addedMove: Move,\n options?: AppendOptions,\n): Alg {\n const optionsHelper = new AppendOptionsHelper(options);\n\n const outputPrefix: AlgNode[] = Array.from(alg.childAlgNodes());\n let outputSuffix: Move[] = [addedMove];\n function output() {\n return new Alg([...outputPrefix, ...outputSuffix]); // TODO: What's the most efficient way to do this?\n }\n\n function modMove(move: Move): Move {\n if (optionsHelper.cancelPuzzleSpecificModWrap() === \"none\") {\n return move;\n }\n const quantumMoveOrder =\n optionsHelper.puzzleSpecificSimplifyOptions()?.quantumMoveOrder;\n if (!quantumMoveOrder) {\n return move;\n }\n const mod = quantumMoveOrder(addedMove.quantum)!; // TODO: throw if `undefined`?\n let offset: number;\n switch (optionsHelper.cancelPuzzleSpecificModWrap()) {\n case \"gravity\": {\n offset = -Math.floor((mod - (move.amount < 0 ? 0 : 1)) / 2); // TODO: dedup this calculation for the most common path?\n break;\n }\n case \"canonical-centered\": {\n offset = -Math.floor((mod - 1) / 2); // TODO: dedup this calculation for the most common path?\n break;\n }\n case \"canonical-positive\": {\n offset = 0;\n break;\n }\n case \"preserve-sign\": {\n offset = move.amount < 0 ? 1 - mod : 0;\n break;\n }\n default: {\n throw new Error(\"Unknown mod wrap\");\n }\n }\n const offsetAmount = offsetMod(move.amount, mod, offset);\n return move.modified({ amount: offsetAmount });\n }\n\n if (optionsHelper.cancelAny()) {\n let canCancelMoveBasedOnQuantum: (move: Move) => boolean;\n const axis = optionsHelper.puzzleSpecificSimplifyOptions()?.axis;\n if (axis) {\n canCancelMoveBasedOnQuantum = (move: Move): boolean =>\n axis.areQuantumMovesSameAxis(addedMove.quantum, move.quantum);\n } else {\n const newMoveQuantumString = addedMove.quantum.toString();\n canCancelMoveBasedOnQuantum = (move: Move): boolean =>\n move.quantum.toString() === newMoveQuantumString;\n }\n\n const sameDirectionOnly =\n optionsHelper.cancelQuantum() === \"same-direction\";\n\n const quantumDirections = new Map<string, 1 | 0 | -1>();\n quantumDirections.set(\n addedMove.quantum.toString(),\n Math.sign(addedMove.amount) as -1 | 0 | 1,\n );\n let i: number;\n for (i = outputPrefix.length - 1; i >= 0; i--) {\n const move = outputPrefix[i].as(Move);\n if (!move) {\n break;\n }\n if (!canCancelMoveBasedOnQuantum(move)) {\n break;\n }\n const quantumKey = move.quantum.toString();\n if (sameDirectionOnly) {\n const existingQuantumDirectionOnAxis =\n quantumDirections.get(quantumKey);\n if (\n existingQuantumDirectionOnAxis && // Short-circuits, but that's actually okay here.\n !areSameDirection(existingQuantumDirectionOnAxis, move)\n ) {\n break;\n }\n quantumDirections.set(quantumKey, Math.sign(move.amount) as -1 | 0 | 1);\n }\n }\n const suffix = [...(outputPrefix.splice(i + 1) as Move[]), addedMove];\n\n if (axis) {\n // TODO: pass down quantum mod\n outputSuffix = axis.simplifySameAxisMoves(\n suffix,\n optionsHelper.cancelPuzzleSpecificModWrap() !== \"none\",\n );\n } else {\n const amount = suffix.reduce(\n (sum: number, move: Move) => sum + move.amount,\n 0,\n );\n if (quantumDirections.size !== 1) {\n throw new Error(\n \"Internal error: multiple quantums when one was expected\",\n );\n }\n outputSuffix = [new Move(addedMove.quantum, amount)];\n }\n }\n outputSuffix = outputSuffix\n .map((m) => modMove(m))\n .filter((move: Move) => move.amount !== 0);\n return output();\n}\n\nexport function experimentalAppendNode(\n alg: Alg,\n leaf: AlgLeaf,\n options: AppendOptions,\n): Alg {\n const maybeMove = leaf.as(Move);\n if (maybeMove) {\n return experimentalAppendMove(alg, maybeMove, options);\n } else {\n return new Alg([...alg.childAlgNodes(), leaf]);\n }\n}\n", "import { Alg } from \"../Alg\";\nimport type { AlgNode } from \"../alg-nodes/AlgNode\";\nimport { Commutator } from \"../alg-nodes/containers/Commutator\";\nimport { Conjugate } from \"../alg-nodes/containers/Conjugate\";\nimport { Grouping } from \"../alg-nodes/containers/Grouping\";\nimport type { LineComment } from \"../alg-nodes/leaves/LineComment\";\nimport { Move } from \"../alg-nodes/leaves/Move\";\nimport type { Newline } from \"../alg-nodes/leaves/Newline\";\nimport { Pause } from \"../alg-nodes/leaves/Pause\";\nimport { functionFromTraversal, TraversalDownUp } from \"../traversal\";\nimport { experimentalAppendNode } from \"./append\";\nimport { AppendOptionsHelper, type SimplifyOptions } from \"./options\";\n\n// TODO: Test that inverses are bijections.\nclass Simplify extends TraversalDownUp<SimplifyOptions, Generator<AlgNode>> {\n #newPlaceholderAssociationsMap?: Map<Grouping, Pause>;\n #newPlaceholderAssociations(): Map<Grouping, Pause> {\n return (this.#newPlaceholderAssociationsMap ??= new Map<Grouping, Pause>());\n }\n\n // TODO: avoid allocations?\n #descendOptions(options: SimplifyOptions): SimplifyOptions {\n return {\n ...options,\n depth: options.depth ? options.depth - 1 : null,\n };\n }\n\n // TODO: Handle\n public *traverseAlg(alg: Alg, options: SimplifyOptions): Generator<AlgNode> {\n if (options.depth === 0) {\n yield* alg.childAlgNodes();\n return;\n }\n\n let output: AlgNode[] = [];\n\n const newOptions: SimplifyOptions = this.#descendOptions(options); // TODO: avoid allocations?\n for (const algNode of alg.childAlgNodes()) {\n for (const traversedNode of this.traverseAlgNode(algNode, newOptions)) {\n output = Array.from(\n experimentalAppendNode(\n new Alg(output),\n traversedNode,\n newOptions,\n ).childAlgNodes(),\n );\n }\n }\n\n // TODO: try to use `yield* output[Symbol.iterator]();`?\n for (const newAlgNode of output) {\n yield newAlgNode;\n }\n }\n\n public *traverseGrouping(\n grouping: Grouping,\n options: SimplifyOptions,\n ): Generator<AlgNode> {\n if (options.depth === 0) {\n yield grouping;\n return;\n }\n if (grouping.amount === 0) {\n // TODO: Are we okay with throwing away nested comments?\n return;\n }\n const newGrouping = new Grouping(\n this.traverseAlg(grouping.alg, this.#descendOptions(options)),\n grouping.amount,\n );\n if (newGrouping.alg.experimentalIsEmpty()) {\n return;\n }\n\n const newPlaceholder = this.#newPlaceholderAssociations().get(grouping);\n if (newPlaceholder) {\n newGrouping.experimentalNISSPlaceholder = newPlaceholder;\n newPlaceholder.experimentalNISSGrouping = newGrouping;\n }\n\n yield newGrouping;\n }\n\n public *traverseMove(\n move: Move,\n _options: SimplifyOptions,\n ): Generator<AlgNode> {\n yield move;\n }\n\n #doChildrenCommute(A: Alg, B: Alg, options: SimplifyOptions): boolean {\n if (\n A.experimentalNumChildAlgNodes() === 1 &&\n B.experimentalNumChildAlgNodes() === 1\n ) {\n // Handle the special case where each side has been reduced to a single move.\n const aMove = Array.from(A.childAlgNodes())[0]?.as(Move);\n const bMove = Array.from(B.childAlgNodes())[0]?.as(Move);\n if (!(aMove && bMove)) {\n return false;\n }\n if (bMove.quantum.isIdentical(aMove.quantum)) {\n return true;\n }\n const appendOptionsHelper = new AppendOptionsHelper(options); // TODO: avoid re-allocating every time.\n if (\n appendOptionsHelper\n .puzzleSpecificSimplifyOptions()\n ?.axis?.areQuantumMovesSameAxis(aMove.quantum, bMove.quantum)\n ) {\n return true;\n }\n }\n return false;\n }\n\n public *traverseCommutator(\n commutator: Commutator,\n options: SimplifyOptions,\n ): Generator<AlgNode> {\n if (options.depth === 0) {\n yield commutator;\n return;\n }\n const newOptions = this.#descendOptions(options);\n const newCommutator = new Commutator(\n this.traverseAlg(commutator.A, newOptions),\n this.traverseAlg(commutator.B, newOptions),\n );\n if (\n newCommutator.A.experimentalIsEmpty() ||\n newCommutator.B.experimentalIsEmpty() ||\n newCommutator.A.isIdentical(newCommutator.B) ||\n newCommutator.A.isIdentical(newCommutator.B.invert()) ||\n this.#doChildrenCommute(newCommutator.A, newCommutator.B, options)\n ) {\n return;\n }\n yield newCommutator;\n }\n\n public *traverseConjugate(\n conjugate: Conjugate,\n options: SimplifyOptions,\n ): Generator<AlgNode> {\n if (options.depth === 0) {\n yield conjugate;\n return;\n }\n const newOptions = this.#descendOptions(options);\n const newConjugate = new Conjugate(\n this.traverseAlg(conjugate.A, newOptions),\n this.traverseAlg(conjugate.B, newOptions),\n );\n if (newConjugate.B.experimentalIsEmpty()) {\n return;\n }\n if (\n newConjugate.A.experimentalIsEmpty() ||\n newConjugate.A.isIdentical(newConjugate.B) ||\n newConjugate.A.isIdentical(newConjugate.B.invert()) ||\n this.#doChildrenCommute(newConjugate.A, newConjugate.B, options)\n ) {\n yield* conjugate.B.childAlgNodes();\n return;\n }\n yield newConjugate;\n }\n\n public *traversePause(\n pause: Pause,\n _options: SimplifyOptions,\n ): Generator<AlgNode> {\n if (pause.experimentalNISSGrouping) {\n const newPause = new Pause();\n this.#newPlaceholderAssociations().set(\n pause.experimentalNISSGrouping,\n newPause,\n );\n yield newPause;\n } else {\n yield pause;\n }\n }\n\n public *traverseNewline(\n newline: Newline,\n _options: SimplifyOptions,\n ): Generator<AlgNode> {\n yield newline;\n }\n\n public *traverseLineComment(\n comment: LineComment,\n _options: SimplifyOptions,\n ): Generator<AlgNode> {\n yield comment;\n }\n}\n\nexport const simplify = functionFromTraversal(Simplify);\n", "// https://js.cubing.net/cubing/alg/\n\nimport { Grouping, Pause } from \"./alg-nodes\";\nimport type { AlgLeaf, AlgNode } from \"./alg-nodes/AlgNode\";\nimport { LineComment } from \"./alg-nodes/leaves/LineComment\";\nimport { Move } from \"./alg-nodes/leaves/Move\";\nimport { Newline } from \"./alg-nodes/leaves/Newline\";\nimport { AlgCommon, type Comparable } from \"./common\";\nimport { experimentalIs, experimentalIsAlgNode } from \"./is\";\nimport { IterationDirection, direct, reverse } from \"./iteration\";\nimport { parseAlg } from \"./parseAlg\";\nimport type { ExperimentalSerializationOptions } from \"./SerializationOptions\";\nimport { simplify, type SimplifyOptions } from \"./simplify\";\nimport { warnOnce } from \"./warnOnce\";\n\nexport type FlexibleAlgSource = string | Iterable<AlgNode> | Alg;\n\n// TODO: validate\nfunction toIterable(input?: FlexibleAlgSource): Iterable<AlgNode> {\n if (!input) {\n return [];\n }\n\n if (experimentalIs(input, Alg)) {\n return (input as Alg).childAlgNodes();\n }\n\n if (typeof input === \"string\") {\n return parseAlg(input).childAlgNodes(); // TODO: something more direct?\n }\n\n const iter = input as Iterable<AlgNode>;\n if (typeof iter[Symbol.iterator] === \"function\") {\n return iter; // TODO: avoid allocations\n }\n\n throw new Error(\"Invalid AlgNode\");\n}\n\n// Preserves the alg if it's already an `Alg`.\nexport function experimentalEnsureAlg(alg: FlexibleAlgSource): Alg {\n if (experimentalIs(alg, Alg)) {\n return alg as Alg;\n }\n return new Alg(alg);\n}\n\n/**\n * `Alg` is a class that encapsulates a structured alg. To create an `Alg` from a string, use:\n *\n * new Alg(\"R U R'\"); // Convenient\n * Alg.fromString(dynamicString); // Recommended when the string input is user-provided.\n *\n * Once you have an `Alg`, you can call methods to transform it:\n *\n * new Alg(\"[[R: U], R U R2']\").expand().experimentalSimplify({cancel: true}).invert().log()\n *\n * To convert an `Alg` to a string, use .toString():\n *\n * new Alg(\"R U F\").invert().toString();\n *\n * If you need to debug, you may also find it convenient to use .log():\n *\n * if (alg.isIdentical(alg.invert())) {\n * alg.log(\"A self-inverse!\")\n * }\n *\n * For more information, see: {@link https://js.cubing.net/cubing/alg/}\n *\n * @category Alg\n */\nexport class Alg extends AlgCommon<Alg> {\n // #debugString: string;\n #algNodes: Iterable<AlgNode>; // TODO: freeze?\n constructor(alg?: FlexibleAlgSource) {\n super();\n this.#algNodes = Array.from(toIterable(alg)); // TODO: can we avoid array-casting?\n // this.#debugString = this.toString();\n\n for (const algNode of this.#algNodes) {\n if (!experimentalIsAlgNode(algNode)) {\n throw new Error(\"An alg can only contain alg nodes.\");\n }\n }\n }\n\n /**\n * Checks whether this Alg is structurally identical to another Alg. This\n * essentially means that they are written identically apart from whitespace.\n *\n * const alg1 = new Alg(\"R U L'\");\n * const alg2 = new Alg(\"L U' R'\").invert();\n * // true\n * alg1.isIdentical(alg2);\n *\n * // false\n * new Alg(\"[R, U]\").isIdentical(new Alg(\"R U R' U'\"));\n * // true\n * new Alg(\"[R, U]\").expand().isIdentical(new Alg(\"R U R' U'\"));\n *\n * Note that .isIdentical() efficiently compares algorithms, but mainly exists\n * to help optimize code when the structure of an algorithm hasn't changed.\n * There are many ways to write the \"same\" alg on most puzzles, but is\n * *highly* recommended to avoid expanding two Alg instances to compare them,\n * since that can easily slow your program to a crawl if someone inputs an alg\n * containing a large repetition. In general, you should use `cubing/kpuzzle`\n * to compare if two algs have the same effect on a puzzle.\n *\n * Also note that parser annotations are not taken into account while comparing\n * algs:\n *\n * const alg = new Alg([new Move(\"R\"), new Move(\"U2\")]);\n * // true, even though one of the algs has parser annotations\n * alg.isIdentical(new Alg(\"R U2\"))\n *\n */\n isIdentical(other: Comparable): boolean {\n const otherAsAlg = other as Alg;\n if (!other.is(Alg)) {\n return false;\n }\n\n // TODO: avoid converting to array\n const l1 = Array.from(this.#algNodes);\n const l2 = Array.from(otherAsAlg.#algNodes);\n if (l1.length !== l2.length) {\n return false;\n }\n for (let i = 0; i < l1.length; i++) {\n if (!l1[i].isIdentical(l2[i])) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Returns the inverse of the given alg.\n *\n * Note that that this does not make any assumptions about what puzzle the alg\n * is for. For example, U2 is its own inverse on a cube, but U2' has the same\n * effect U3 (and not U2) on Megaminx:\n *\n * // Outputs: R U2' L'\n * new Alg(\"L U2 R'\").invert().log();\n */\n invert(): Alg {\n // TODO: Handle newLines and comments correctly\n // TODO: Make more efficient.\n return new Alg(reverse(Array.from(this.#algNodes).map((u) => u.invert())));\n }\n\n /** @deprecated Use {@link Alg.expand} instead. */\n *experimentalExpand(\n iterDir: IterationDirection = IterationDirection.Forwards,\n depth?: number,\n ): Generator<AlgLeaf> {\n depth ??= Infinity;\n for (const algNode of direct(this.#algNodes, iterDir)) {\n yield* algNode.experimentalExpand(iterDir, depth);\n }\n }\n\n /**\n * Expands all Grouping, Commutator, and Conjugate parts nested inside the\n * alg.\n *\n * // F R U R' U' F'\n * new Alg(\"[F: [R, U]]\").expand().log();\n *\n * // F [R, U] F'\n * new Alg(\"[F: [R, U]]\").expand(({ depth: 1 }).log();\n *\n * Avoid calling this on a user-provided alg unless the user explicitly asks\n * to see the expanded alg. Otherwise, it's easy to make your program freeze\n * when someone passes in an alg like: (R U)10000000\n *\n * Generally, if you want to perform an operation on an entire alg, you'll\n * want to use something based on the `Traversal` mechanism, like countMoves()\n * from `cubing/notation`.\n */\n expand(options?: { depth?: number }): Alg {\n return new Alg(\n this.experimentalExpand(\n IterationDirection.Forwards,\n options?.depth ?? Infinity,\n ),\n );\n }\n\n /** @deprecated */\n *experimentalLeafMoves(): Generator<Move> {\n for (const leaf of this.experimentalExpand()) {\n if (leaf.is(Move)) {\n yield leaf as Move;\n }\n }\n }\n\n concat(input: FlexibleAlgSource): Alg {\n return new Alg(\n Array.from(this.#algNodes).concat(Array.from(toIterable(input))),\n );\n }\n\n /** @deprecated */\n experimentalIsEmpty(): boolean {\n for (const _ of this.#algNodes) {\n return false;\n }\n return true;\n }\n\n static fromString(s: string): Alg {\n return parseAlg(s);\n }\n\n /** @deprecated */\n units(): Generator<AlgNode> {\n return this.childAlgNodes();\n }\n\n *childAlgNodes(): Generator<AlgNode> {\n for (const algNode of this.#algNodes) {\n yield algNode;\n }\n }\n\n /** @deprecated */\n experimentalNumUnits(): number {\n return this.experimentalNumChildAlgNodes();\n }\n\n experimentalNumChildAlgNodes(): number {\n return Array.from(this.#algNodes).length;\n }\n\n /** @deprecated */\n get type(): string {\n warnOnce(\"deprecated: type\");\n return \"sequence\";\n }\n\n /**\n * Converts the Alg to a string:\n *\n * const alg = new Alg([new Move(\"R\"), new Move(\"U2\"), new Move(\"L\")])\n * // R U2 L\n * console.log(alg.toString())\n */\n toString(\n experimentalSerializationOptions?: ExperimentalSerializationOptions,\n ): string {\n let output = \"\";\n let previousVisibleAlgNode: AlgNode | null = null;\n for (const algNode of this.#algNodes) {\n if (previousVisibleAlgNode) {\n output += spaceBetween(previousVisibleAlgNode, algNode);\n }\n const nissGrouping = algNode.as(Pause)?.experimentalNISSGrouping;\n if (nissGrouping) {\n if (nissGrouping.amount !== -1) {\n throw new Error(\"Invalid NISS Grouping amount!\");\n }\n output += `^(${nissGrouping.alg.toString(experimentalSerializationOptions)})`;\n } else if (algNode.as(Grouping)?.experimentalNISSPlaceholder) {\n // do not serialize (rely on the placeholder instead)\n } else {\n output += algNode.toString(experimentalSerializationOptions);\n }\n previousVisibleAlgNode = algNode;\n }\n return output;\n }\n\n /**\n * `experimentalSimplify` can perform several mostly-syntactic simplifications on an alg:\n *\n * // Logs: R' U3\n * import { Alg } from \"cubing/alg\";\n * new Alg(\"R R2' U U2\").experimentalSimplify({ cancel: true }).log()\n *\n * You can pass in a `PuzzleLoader` (currently only for 3x3x3) for puzzle-specific simplifications:\n *\n * // Logs: R' U'\n * import { Alg } from \"cubing/alg\";\n * import { cube3x3x3 } from \"cubing/puzzles\";\n * new Alg(\"R R2' U U2\").experimentalSimplify({ cancel: true, puzzleLoader: cube3x3x3 }).log()\n *\n * You can also cancel only moves that are in the same direction:\n *\n * // Logs: R R2' U'\n * import { Alg } from \"cubing/alg\";\n * import { cube3x3x3 } from \"cubing/puzzles\";\n * new Alg(\"R R2' U U2\").experimentalSimplify({\n * cancel: { directional: \"same-direction\" },\n * puzzleLoader: cube3x3x3\n * }).log()\n *\n * Additionally, you can specify how moves are \"wrapped\":\n *\n * import { Alg } from \"cubing/alg\";\n * import { cube3x3x3 } from \"cubing/puzzles\";\n *\n * function example(puzzleSpecificModWrap) {\n * alg.experimentalSimplify({\n * cancel: { puzzleSpecificModWrap },\n * puzzleLoader: cube3x3x3\n * }).log()\n * }\n *\n * const alg = new Alg(\"R7' . R6' . R5' . R6\")\n * example(\"none\") // R7' . R6' . R5' . R6\n * example(\"gravity\") // R . R2' . R' . R2\n * example(\"canonical-centered\") // R . R2 . R' . R2\n * example(\"canonical-positive\") // R . R2 . R3 . R2\n * example(\"preserve-sign\") // R3' . R2' . R' . R2\n *\n * Same-axis and simultaneous move canonicalization is not implemented yet:\n *\n * // Logs: R L R\n * import { Alg } from \"cubing/alg\";\n * import { cube3x3x3 } from \"cubing/puzzles\";\n * new Alg(\"R L R\").experimentalSimplify({ cancel: true, puzzleLoader: cube3x3x3 }).log()\n */\n experimentalSimplify(options?: SimplifyOptions): Alg {\n return new Alg(simplify(this, options ?? {}));\n }\n\n /** @deprecated See {@link experimentalSimplify} */\n simplify(options?: SimplifyOptions): Alg {\n return this.experimentalSimplify(options);\n }\n}\n\nfunction spaceBetween(u1: AlgNode, u2: AlgNode): string {\n if (u1.is(Newline) || u2.is(Newline)) {\n return \"\";\n }\n if (u2.as(Grouping)?.experimentalNISSPlaceholder) {\n return \"\";\n }\n if (u1.is(LineComment) && !u2.is(Newline)) {\n return \"\\n\"; /// TODO\n }\n return \" \";\n}\n", "// tslint:disable-next-line no-namespace // TODO: nested module\n\nimport { Alg } from \"./Alg\";\nimport { Grouping } from \"./alg-nodes\";\nimport { Commutator } from \"./alg-nodes/containers/Commutator\";\nimport { Conjugate } from \"./alg-nodes/containers/Conjugate\";\nimport { Move } from \"./alg-nodes/leaves/Move\";\nimport { Pause } from \"./alg-nodes/leaves/Pause\";\n\nexport const Example = {\n Sune: new Alg([\n new Move(\"R\", 1),\n new Move(\"U\", 1),\n new Move(\"R\", -1),\n new Move(\"U\", 1),\n new Move(\"R\", 1),\n new Move(\"U\", -2),\n new Move(\"R\", -1),\n ]),\n\n AntiSune: new Alg([\n new Move(\"R\", 1),\n new Move(\"U\", 2),\n new Move(\"R\", -1),\n new Move(\"U\", -1),\n new Move(\"R\", 1),\n new Move(\"U\", -1),\n new Move(\"R\", -1),\n ]),\n\n SuneCommutator: new Alg([\n new Commutator(\n new Alg([new Move(\"R\", 1), new Move(\"U\", 1), new Move(\"R\", -2)]),\n new Alg([\n new Conjugate(new Alg([new Move(\"R\", 1)]), new Alg([new Move(\"U\", 1)])),\n ]),\n ),\n ]),\n\n Niklas: new Alg([\n new Move(\"R\", 1),\n new Move(\"U\", -1),\n new Move(\"L\", -1),\n new Move(\"U\", 1),\n new Move(\"R\", -1),\n new Move(\"U\", -1),\n new Move(\"L\", 1),\n new Move(\"U\", 1),\n ]),\n\n EPerm: new Alg([\n new Move(\"x\", -1),\n new Commutator(\n new Alg([\n new Conjugate(\n new Alg([new Move(\"R\", 1)]),\n new Alg([new Move(\"U\", -1)]),\n ),\n ]),\n new Alg([new Move(\"D\", 1)]),\n ),\n new Commutator(\n new Alg([\n new Conjugate(new Alg([new Move(\"R\", 1)]), new Alg([new Move(\"U\", 1)])),\n ]),\n new Alg([new Move(\"D\", 1)]),\n ),\n new Move(\"x\", 1),\n ]),\n\n FURURFCompact: new Alg([\n new Conjugate(\n new Alg([new Move(\"F\", 1)]),\n new Alg([\n new Commutator(\n new Alg([new Move(\"U\", 1)]),\n new Alg([new Move(\"R\", 1)]),\n ),\n ]),\n ),\n ]),\n\n APermCompact: new Alg([\n new Conjugate(\n new Alg([new Move(\"R\", 2)]),\n new Alg([\n new Commutator(\n new Alg([new Move(\"F\", 2)]),\n new Alg([new Move(\"R\", -1), new Move(\"B\", -1), new Move(\"R\", 1)]),\n ),\n ]),\n ),\n ]),\n\n FURURFMoves: new Alg([\n new Move(\"F\", 1),\n new Move(\"U\", 1),\n new Move(\"R\", 1),\n new Move(\"U\", -1),\n new Move(\"R\", -1),\n new Move(\"F\", -1),\n ]),\n\n TPerm: new Alg([\n new Move(\"R\", 1),\n new Move(\"U\", 1),\n new Move(\"R\", -1),\n new Move(\"U\", -1),\n new Move(\"R\", -1),\n new Move(\"F\", 1),\n new Move(\"R\", 2),\n new Move(\"U\", -1),\n new Move(\"R\", -1),\n new Move(\"U\", -1),\n new Move(\"R\", 1),\n new Move(\"U\", 1),\n new Move(\"R\", -1),\n new Move(\"F\", -1),\n ]),\n\n HeadlightSwaps: new Alg([\n new Conjugate(\n new Alg([new Move(\"F\", 1)]),\n new Alg([\n new Grouping(\n new Alg([\n new Commutator(\n new Alg([new Move(\"R\", 1)]),\n new Alg([new Move(\"U\", 1)]),\n ),\n ]),\n 3,\n ),\n ]),\n ),\n ]),\n\n TriplePause: new Alg([new Pause(), new Pause(), new Pause()]),\n // AllAlgParts: [\n // new Alg([new Move(\"R\", 1), new Move(\"U\", -1)]),\n // new Grouping(new Alg([new Move(\"F\", 1)]), 2),\n // // new Rotation(\"y\", -1),\n // new Move(\"R\", 2),\n // new Commutator(new Alg([new Move(\"R\", 2)]), new Alg([new Move(\"U\", 2)]), 2),\n // new Conjugate(new Alg([new Move(\"L\", 2)]), new Alg([new Move(\"D\", -1)]), 2),\n // new Pause(),\n // new Newline(),\n // new LineComment(\"line comment\"),\n // ],\n};\n", "import type { KeyMapping } from \"cubing/puzzles/PuzzleLoader\";\nimport type { AlgLeaf } from \"./alg-nodes/AlgNode\";\n\n// TODO: options about whether to ignore modifier keys (e.g. alt, ctrl).\n// TODO: Support different mappings.\n// TODO: Return BaseMove instead?\nexport function keyToMove(\n keyMapping: KeyMapping | undefined,\n e: KeyboardEvent,\n): AlgLeaf | null {\n if (e.altKey || e.ctrlKey) {\n return null;\n }\n\n // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code\n // > The KeyboardEvent.code property represents a physical key on the keyboard\n // > (as opposed to the character generated by pressing the key). In other\n // > words, this property returns a value that isn't altered by keyboard\n // > layout or the state of the modifier keys.\n const layoutIndepdendentCode = e.code;\n return keyMapping?.[layoutIndepdendentCode] ?? null;\n}\n", "import type { Alg } from \"./Alg\";\n\n// This is not the most sophisticated scheme, but it has been used in production\n// at alg.cubing.net for years.\nfunction serializeURLParam(a: Alg): string {\n let escaped = a.toString();\n escaped = escaped.replace(/_/g, \"&#95;\").replace(/ /g, \"_\");\n escaped = escaped.replace(/\\+/g, \"&#2b;\");\n escaped = escaped.replace(/-/g, \"&#45;\").replace(/'/g, \"-\");\n return escaped;\n}\n\nexport interface AlgCubingNetOptions {\n alg?: Alg;\n setup?: Alg;\n title?: string;\n puzzle?:\n | \"1x1x1\"\n | \"2x2x2\"\n | \"3x3x3\"\n | \"4x4x4\"\n | \"5x5x5\"\n | \"6x6x6\"\n | \"7x7x7\"\n | \"8x8x8\"\n | \"9x9x9\"\n | \"10x10x10\"\n | \"11x11x11\"\n | \"12x12x12\"\n | \"13x13x13\"\n | \"14x14x14\"\n | \"16x16x16\"\n | \"17x17x17\";\n stage?:\n | \"full\"\n | \"cross\"\n | \"F2L\"\n | \"LL\"\n | \"OLL\"\n | \"PLL\"\n | \"CLS\"\n | \"ELS\"\n | \"L6E\"\n | \"CMLL\"\n | \"WV\"\n | \"ZBLL\"\n | \"void\";\n view?: \"editor\" | \"playback\" | \"fullscreen\";\n type?: \"moves\" | \"reconstruction\" | \"alg\" | \"reconstruction-end-with-setup\";\n}\n\n// TODO: runtime validation?\n/** @deprecated */\nexport function experimentalAlgCubingNetLink(\n options: AlgCubingNetOptions,\n): string {\n const url = new URL(\"https://alg.cubing.net\");\n if (!options.alg) {\n throw new Error(\"An alg parameter is required.\");\n }\n url.searchParams.set(\"alg\", serializeURLParam(options.alg));\n\n if (options.setup) {\n url.searchParams.set(\"setup\", serializeURLParam(options.setup));\n }\n if (options.title) {\n url.searchParams.set(\"title\", options.title);\n }\n if (options.puzzle) {\n if (\n ![\n \"1x1x1\",\n \"2x2x2\",\n \"3x3x3\",\n \"4x4x4\",\n \"5x5x5\",\n \"6x6x6\",\n \"7x7x7\",\n \"8x8x8\",\n \"9x9x9\",\n \"10x10x10\",\n \"11x11x11\",\n \"12x12x12\",\n \"13x13x13\",\n \"14x14x14\",\n \"16x16x16\",\n \"17x17x17\",\n ].includes(options.puzzle)\n ) {\n throw new Error(`Invalid puzzle parameter: ${options.puzzle}`);\n }\n url.searchParams.set(\"puzzle\", options.puzzle);\n }\n if (options.stage) {\n if (\n ![\n \"full\",\n \"cross\",\n \"F2L\",\n \"LL\",\n \"OLL\",\n \"PLL\",\n \"CLS\",\n \"ELS\",\n \"L6E\",\n \"CMLL\",\n \"WV\",\n \"ZBLL\",\n \"void\",\n ].includes(options.stage)\n ) {\n throw new Error(`Invalid stage parameter: ${options.stage}`);\n }\n url.searchParams.set(\"stage\", options.stage);\n }\n if (options.view) {\n if (![\"editor\", \"playback\", \"fullscreen\"].includes(options.view)) {\n throw new Error(`Invalid view parameter: ${options.view}`);\n }\n url.searchParams.set(\"view\", options.view);\n }\n if (options.type) {\n if (\n ![\n \"moves\",\n \"reconstruction\",\n \"alg\",\n \"reconstruction-end-with-setup\",\n ].includes(options.type)\n ) {\n throw new Error(`Invalid type parameter: ${options.type}`);\n }\n url.searchParams.set(\"type\", options.type);\n }\n return url.toString();\n}\n"],
5
+ "mappings": ";AAKA,IAAI,qBAAqB;AAKlB,IAAe,aAAf,MAA0B;AAAA,EAC/B,GAAG,GAAiB;AAClB,WAAO,gBAAgB;AAAA,EACzB;AAAA,EAEA,GAAM,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E,YAAM,IAAI,MAAM,2BAA2B,QAAQ,IAAI,EAAE;AAAA,IAC3D;AACA,QAAI,aAAa,IAAI,QAAQ,QAAQ,IAAI;AAAA,EAC3C;AACA,MAAI,QAAQ,MAAM;AAChB,QACE,CAAC;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,SAAS,QAAQ,IAAI,GACvB;AACA,YAAM,IAAI,MAAM,2BAA2B,QAAQ,IAAI,EAAE;AAAA,IAC3D;AACA,QAAI,aAAa,IAAI,QAAQ,QAAQ,IAAI;AAAA,EAC3C;AACA,SAAO,IAAI,SAAS;AACtB;",
6
+ "names": []
7
+ }
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  cube3x3x3KPuzzleDefinition
3
- } from "./chunk-PHOA3XR5.js";
3
+ } from "./chunk-SPVYKTCP.js";
4
4
  import {
5
5
  TraversalUp,
6
6
  functionFromTraversal
7
- } from "./chunk-4QUGAADL.js";
7
+ } from "./chunk-2SBMIHZV.js";
8
8
 
9
9
  // src/cubing/notation/commonMetrics.ts
10
10
  var CommonMetric = /* @__PURE__ */ ((CommonMetric2) => {
@@ -272,4 +272,4 @@ export {
272
272
  countMetricMoves,
273
273
  countAnimatedLeaves
274
274
  };
275
- //# sourceMappingURL=chunk-MKN7YQQJ.js.map
275
+ //# sourceMappingURL=chunk-576MXDEF.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Alg
3
- } from "./chunk-4QUGAADL.js";
3
+ } from "./chunk-2SBMIHZV.js";
4
4
 
5
5
  // src/cubing/search/inside/solve/parseSGS.ts
6
6
  function parseSGS(kpuzzle, sgs) {
@@ -86,4 +86,4 @@ function parseSGS(kpuzzle, sgs) {
86
86
  export {
87
87
  parseSGS
88
88
  };
89
- //# sourceMappingURL=chunk-ZCOKH4N7.js.map
89
+ //# sourceMappingURL=chunk-BQNTAVTA.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  from
3
- } from "./chunk-PHOA3XR5.js";
3
+ } from "./chunk-SPVYKTCP.js";
4
4
 
5
5
  // src/cubing/twisty/debug.ts
6
6
  var twistyDebugGlobals = {
@@ -527,7 +527,7 @@ var StatsPanel = class {
527
527
  // src/cubing/twisty/heavy-code-imports/3d.ts
528
528
  var cachedConstructorProxy = null;
529
529
  async function proxy3D() {
530
- return cachedConstructorProxy ??= import("./twisty-dynamic-3d-53NE7BLI.js");
530
+ return cachedConstructorProxy ??= import("./twisty-dynamic-3d-Q6UZ4CCL.js");
531
531
  }
532
532
  var THREEJS = from(
533
533
  async () => (await proxy3D()).T3I
@@ -1155,4 +1155,4 @@ export {
1155
1155
  proxy3D,
1156
1156
  THREEJS
1157
1157
  };
1158
- //# sourceMappingURL=chunk-3GLPWJQ4.js.map
1158
+ //# sourceMappingURL=chunk-L2MEEU4Q.js.map