cubing 0.24.0-pre5 → 0.24.3

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 (65) hide show
  1. package/README.md +37 -7
  2. package/dist/esm/{2x2x2.sgs.json-TASFAQNY.js → 2x2x2.sgs.json-FGJMEY7L.js} +2 -2
  3. package/dist/esm/{2x2x2.sgs.json-TASFAQNY.js.map → 2x2x2.sgs.json-FGJMEY7L.js.map} +0 -0
  4. package/dist/esm/{3d-dynamic-inside-RSDMFS4G.js → 3d-dynamic-inside-OI3KFE53.js} +3 -4
  5. package/dist/esm/{3d-dynamic-inside-RSDMFS4G.js.map → 3d-dynamic-inside-OI3KFE53.js.map} +2 -2
  6. package/dist/esm/bluetooth/index.js +1 -1
  7. package/dist/esm/{chunk-SPTKCRT5.js → chunk-2DZQQRAX.js} +2 -2
  8. package/dist/esm/{chunk-SPTKCRT5.js.map → chunk-2DZQQRAX.js.map} +0 -0
  9. package/dist/esm/{chunk-BBEJTW6Z.js → chunk-63M53ZZ5.js} +2 -2
  10. package/dist/esm/{chunk-BBEJTW6Z.js.map → chunk-63M53ZZ5.js.map} +0 -0
  11. package/dist/esm/{chunk-EA4KWT7Z.js → chunk-ARBPSZE4.js} +3 -3
  12. package/dist/esm/{chunk-EA4KWT7Z.js.map → chunk-ARBPSZE4.js.map} +0 -0
  13. package/dist/esm/{chunk-54HT7B4M.js → chunk-IS5V7Y6I.js} +5 -7
  14. package/dist/esm/chunk-IS5V7Y6I.js.map +7 -0
  15. package/dist/esm/{chunk-ZDALYMGF.js → chunk-KRL5KQQK.js} +32 -3
  16. package/dist/esm/chunk-KRL5KQQK.js.map +7 -0
  17. package/dist/esm/{chunk-3SURT6S2.js → chunk-PJXFSZFG.js} +2 -2
  18. package/dist/esm/{chunk-3SURT6S2.js.map → chunk-PJXFSZFG.js.map} +0 -0
  19. package/dist/esm/{chunk-LR6VCMD2.js → chunk-V5DHYMZ7.js} +2 -2
  20. package/dist/esm/{chunk-LR6VCMD2.js.map → chunk-V5DHYMZ7.js.map} +0 -0
  21. package/dist/esm/{chunk-27MCV5LC.js → chunk-ZA7DHVIG.js} +2 -2
  22. package/dist/esm/{chunk-27MCV5LC.js.map → chunk-ZA7DHVIG.js.map} +0 -0
  23. package/dist/esm/{entry-VNBE3GIX.js → entry-35P24GUC.js} +14 -14
  24. package/dist/esm/{entry-VNBE3GIX.js.map → entry-35P24GUC.js.map} +0 -0
  25. package/dist/esm/{fto.sgs.json-RZ2BQGRG.js → fto.sgs.json-5DLOFNGP.js} +2 -2
  26. package/dist/esm/{fto.sgs.json-RZ2BQGRG.js.map → fto.sgs.json-5DLOFNGP.js.map} +0 -0
  27. package/dist/esm/{megaminx.sgs.json-3UELYHNZ.js → megaminx.sgs.json-6QTJOWQY.js} +3 -3
  28. package/dist/esm/{megaminx.sgs.json-3UELYHNZ.js.map → megaminx.sgs.json-6QTJOWQY.js.map} +0 -0
  29. package/dist/esm/{module-entry-MKJ6SWPL.js → module-entry-EAI3JQ2N.js} +2 -2
  30. package/dist/esm/{module-entry-MKJ6SWPL.js.map → module-entry-EAI3JQ2N.js.map} +0 -0
  31. package/dist/esm/puzzle-geometry/index.js +1 -1
  32. package/dist/esm/puzzles/index.js +1 -1
  33. package/dist/esm/{pyraminx.sgs.json-6KZV2YF7.js → pyraminx.sgs.json-P7ND22JU.js} +3 -3
  34. package/dist/esm/{pyraminx.sgs.json-6KZV2YF7.js.map → pyraminx.sgs.json-P7ND22JU.js.map} +0 -0
  35. package/dist/esm/scramble/index.js +3 -3
  36. package/dist/esm/{scramble_444-WHAZBEON.js → scramble_444-Q22ZMCV5.js} +3 -3
  37. package/dist/esm/{scramble_444-WHAZBEON.js.map → scramble_444-Q22ZMCV5.js.map} +0 -0
  38. package/dist/esm/search/index.js +3 -3
  39. package/dist/esm/{skewb.sgs.json-QVGBEYZV.js → skewb.sgs.json-PE7DQP2D.js} +3 -3
  40. package/dist/esm/{skewb.sgs.json-QVGBEYZV.js.map → skewb.sgs.json-PE7DQP2D.js.map} +0 -0
  41. package/dist/esm/twisty/index.js +448 -231
  42. package/dist/esm/twisty/index.js.map +3 -3
  43. package/dist/esm/{worker-inside-generated-string-K4NE6VX5.js → worker-inside-generated-string-4JQKOQND.js} +21 -21
  44. package/dist/esm/worker-inside-generated-string-4JQKOQND.js.map +7 -0
  45. package/dist/types/puzzle-geometry/FaceNameSwizzler.d.ts +1 -0
  46. package/dist/types/puzzle-geometry/PermOriSet.d.ts +2 -1
  47. package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts +1 -0
  48. package/dist/types/search/worker-inside-generated-string.d.ts +1 -1
  49. package/dist/types/twisty/index.d.ts +1 -0
  50. package/dist/types/twisty/model/TwistyPlayerModel.d.ts +46 -42
  51. package/dist/types/twisty/model/props/puzzle/state/AlgTransformationProp.d.ts +1 -1
  52. package/dist/types/twisty/model/props/puzzle/state/AnchorTransformationProp.d.ts +14 -0
  53. package/dist/types/twisty/model/props/puzzle/state/SetupTransformationProp.d.ts +5 -0
  54. package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts +1 -0
  55. package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts +1 -0
  56. package/dist/types/twisty/views/ManagedCustomElement.d.ts +1 -1
  57. package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts +1 -1
  58. package/dist/types/twisty/views/twizzle/TwizzleLink.css.d.ts +2 -0
  59. package/dist/types/twisty/views/twizzle/TwizzleLink.d.ts +11 -0
  60. package/dist/types/twisty/views/twizzle/url-params.d.ts +18 -0
  61. package/package.json +2 -2
  62. package/dist/esm/chunk-54HT7B4M.js.map +0 -7
  63. package/dist/esm/chunk-ZDALYMGF.js.map +0 -7
  64. package/dist/esm/worker-inside-generated-string-K4NE6VX5.js.map +0 -7
  65. package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts +0 -13
@@ -10,7 +10,7 @@ import {
10
10
  TwistyPropDerived,
11
11
  TwistyPropSource,
12
12
  proxy3D
13
- } from "../chunk-27MCV5LC.js";
13
+ } from "../chunk-ZA7DHVIG.js";
14
14
  import {
15
15
  countAnimatedLeaves,
16
16
  countMoves
@@ -20,7 +20,7 @@ import {
20
20
  cubeAppearance,
21
21
  customPGPuzzleLoader,
22
22
  puzzles
23
- } from "../chunk-54HT7B4M.js";
23
+ } from "../chunk-IS5V7Y6I.js";
24
24
  import "../chunk-B27E6KTE.js";
25
25
  import {
26
26
  Alg,
@@ -144,8 +144,8 @@ var CatchUpHelper = class {
144
144
  this.scheduler.requestAnimFrame();
145
145
  const delta = (timestamp - this.lastTimestamp) / this.catchUpMs;
146
146
  this.lastTimestamp = timestamp;
147
- this.model.catchUpMoveProp.set((async () => {
148
- const previousCatchUpMove = await this.model.catchUpMoveProp.get();
147
+ this.model.catchUpMove.set((async () => {
148
+ const previousCatchUpMove = await this.model.catchUpMove.get();
149
149
  if (previousCatchUpMove.move === null) {
150
150
  return previousCatchUpMove;
151
151
  }
@@ -153,7 +153,7 @@ var CatchUpHelper = class {
153
153
  if (amount >= 1) {
154
154
  this.pendingFrame = true;
155
155
  this.stop();
156
- this.model.timestampRequestProp.set("end");
156
+ this.model.timestampRequest.set("end");
157
157
  return {
158
158
  move: null,
159
159
  amount: 0
@@ -179,9 +179,9 @@ var TwistyAnimationController = class {
179
179
  __privateAdd(this, _animFrameEffectiveTimestampStaleDropper, new StaleDropper());
180
180
  this.model = model;
181
181
  this.lastTimestampPromise = __privateMethod(this, _effectiveTimestampMilliseconds, effectiveTimestampMilliseconds_fn).call(this);
182
- this.model.playingInfoProp.addFreshListener(this.onPlayingProp.bind(this));
182
+ this.model.playingInfo.addFreshListener(this.onPlayingProp.bind(this));
183
183
  this.catchUpHelper = new CatchUpHelper(this.model);
184
- this.model.catchUpMoveProp.addFreshListener(this.onCatchUpMoveProp.bind(this));
184
+ this.model.catchUpMove.addFreshListener(this.onCatchUpMoveProp.bind(this));
185
185
  }
186
186
  async onPlayingProp(playingInfo) {
187
187
  if (playingInfo.playing !== this.playing) {
@@ -196,14 +196,14 @@ var TwistyAnimationController = class {
196
196
  this.scheduler.requestAnimFrame();
197
197
  }
198
198
  jumpToStart(options) {
199
- this.model.timestampRequestProp.set("start");
199
+ this.model.timestampRequest.set("start");
200
200
  this.pause();
201
201
  if (options?.flash) {
202
202
  this.delegate.flash();
203
203
  }
204
204
  }
205
205
  jumpToEnd(options) {
206
- this.model.timestampRequestProp.set("end");
206
+ this.model.timestampRequest.set("end");
207
207
  this.pause();
208
208
  if (options?.flash) {
209
209
  this.delegate.flash();
@@ -218,18 +218,18 @@ var TwistyAnimationController = class {
218
218
  }
219
219
  async play(options) {
220
220
  const direction = options?.direction ?? Direction.Forwards;
221
- const coarseTimelineInfo = await this.model.coarseTimelineInfoProp.get();
221
+ const coarseTimelineInfo = await this.model.coarseTimelineInfo.get();
222
222
  if (options?.autoSkipToOtherEndIfStartingAtBoundary ?? true) {
223
223
  if (direction === Direction.Forwards && coarseTimelineInfo.atEnd) {
224
- this.model.timestampRequestProp.set("start");
224
+ this.model.timestampRequest.set("start");
225
225
  this.delegate.flash();
226
226
  }
227
227
  if (direction === Direction.Backwards && coarseTimelineInfo.atStart) {
228
- this.model.timestampRequestProp.set("end");
228
+ this.model.timestampRequest.set("end");
229
229
  this.delegate.flash();
230
230
  }
231
231
  }
232
- this.model.playingInfoProp.set({
232
+ this.model.playingInfo.set({
233
233
  playing: true,
234
234
  direction,
235
235
  untilBoundary: options?.untilBoundary ?? BoundaryType.EntireTimeline,
@@ -243,7 +243,7 @@ var TwistyAnimationController = class {
243
243
  pause() {
244
244
  this.playing = false;
245
245
  this.scheduler.cancelAnimFrame();
246
- this.model.playingInfoProp.set({
246
+ this.model.playingInfo.set({
247
247
  playing: false,
248
248
  untilBoundary: BoundaryType.EntireTimeline
249
249
  });
@@ -254,11 +254,11 @@ var TwistyAnimationController = class {
254
254
  }
255
255
  const lastDatestamp = this.lastDatestamp;
256
256
  const freshenerResult = await __privateGet(this, _animFrameEffectiveTimestampStaleDropper).queue(Promise.all([
257
- this.model.playingInfoProp.get(),
257
+ this.model.playingInfo.get(),
258
258
  this.lastTimestampPromise,
259
- this.model.timeRangeProp.get(),
260
- this.model.tempoScaleProp.get(),
261
- this.model.currentMoveInfoProp.get()
259
+ this.model.timeRange.get(),
260
+ this.model.tempoScale.get(),
261
+ this.model.currentMoveInfo.get()
262
262
  ]));
263
263
  const [playingInfo, lastTimestamp, timeRange, tempoScale, currentMoveInfo] = freshenerResult;
264
264
  if (!playingInfo.playing) {
@@ -288,7 +288,7 @@ var TwistyAnimationController = class {
288
288
  newTimestamp = end;
289
289
  }
290
290
  this.playing = false;
291
- this.model.playingInfoProp.set({
291
+ this.model.playingInfo.set({
292
292
  playing: false
293
293
  });
294
294
  }
@@ -302,19 +302,19 @@ var TwistyAnimationController = class {
302
302
  newTimestamp = start;
303
303
  }
304
304
  this.playing = false;
305
- this.model.playingInfoProp.set({
305
+ this.model.playingInfo.set({
306
306
  playing: false
307
307
  });
308
308
  }
309
309
  }
310
310
  this.lastDatestamp = frameDatestamp;
311
311
  this.lastTimestampPromise = Promise.resolve(newTimestamp);
312
- this.model.timestampRequestProp.set(newSmartTimestampRequest ?? newTimestamp);
312
+ this.model.timestampRequest.set(newSmartTimestampRequest ?? newTimestamp);
313
313
  }
314
314
  };
315
315
  _effectiveTimestampMilliseconds = new WeakSet();
316
316
  effectiveTimestampMilliseconds_fn = async function() {
317
- return (await this.model.detailedTimelineInfoProp.get()).timestamp;
317
+ return (await this.model.detailedTimelineInfo.get()).timestamp;
318
318
  };
319
319
  _animFrameEffectiveTimestampStaleDropper = new WeakMap();
320
320
 
@@ -395,13 +395,15 @@ var ManagedCustomElement = class extends HTMLElementShim {
395
395
  this.shadow.appendChild(this.contentWrapper);
396
396
  }
397
397
  addCSS(cssSource) {
398
- if (__privateGet(this, _cssSourceMap).get(cssSource)) {
399
- return;
398
+ const existing = __privateGet(this, _cssSourceMap).get(cssSource);
399
+ if (existing) {
400
+ return existing;
400
401
  }
401
402
  const cssElem = document.createElement("style");
402
403
  cssElem.textContent = cssSource.getAsString();
403
404
  __privateGet(this, _cssSourceMap).set(cssSource, cssElem);
404
405
  this.shadow.appendChild(cssElem);
406
+ return cssElem;
405
407
  }
406
408
  removeCSS(cssSource) {
407
409
  const cssElem = __privateGet(this, _cssSourceMap).get(cssSource);
@@ -688,12 +690,12 @@ var Twisty2DPuzzle = class extends ManagedCustomElement {
688
690
  __privateAdd(this, _freshListenerManager, new FreshListenerManager());
689
691
  this.addCSS(twisty2DSVGCSS);
690
692
  this.resetSVG();
691
- __privateGet(this, _freshListenerManager).addListener(this.model.puzzleIDProp, (puzzleID) => {
693
+ __privateGet(this, _freshListenerManager).addListener(this.model.puzzleID, (puzzleID) => {
692
694
  if (puzzleLoader?.id !== puzzleID) {
693
695
  this.disconnect();
694
696
  }
695
697
  });
696
- __privateGet(this, _freshListenerManager).addListener(this.model.legacyPositionProp, this.onPositionChange.bind(this));
698
+ __privateGet(this, _freshListenerManager).addListener(this.model.legacyPosition, this.onPositionChange.bind(this));
697
699
  if (this.options?.experimentalStickering) {
698
700
  this.experimentalSetStickering(this.options.experimentalStickering);
699
701
  }
@@ -763,7 +765,7 @@ var Twisty2DPuzzleWrapper = class {
763
765
  __privateAdd(this, _freshListenerManager2, new FreshListenerManager());
764
766
  __privateAdd(this, _cachedTwisty2DPuzzle, null);
765
767
  this.twisty2DPuzzle();
766
- __privateGet(this, _freshListenerManager2).addListener(this.model.stickeringProp, async (stickering) => {
768
+ __privateGet(this, _freshListenerManager2).addListener(this.model.stickering, async (stickering) => {
767
769
  (await this.twisty2DPuzzle()).experimentalSetStickering(stickering);
768
770
  });
769
771
  }
@@ -799,7 +801,7 @@ var Twisty2DSceneWrapper = class extends ManagedCustomElement {
799
801
  async connectedCallback() {
800
802
  this.addCSS(twistyViewerWrapperCSS);
801
803
  if (this.model) {
802
- __privateGet(this, _freshListenerManager3).addListener(this.model.puzzleLoaderProp, this.onPuzzleLoader.bind(this));
804
+ __privateGet(this, _freshListenerManager3).addListener(this.model.puzzleLoader, this.onPuzzleLoader.bind(this));
803
805
  }
804
806
  }
805
807
  async scene() {
@@ -872,12 +874,12 @@ var Twisty3DPuzzleWrapper = class {
872
874
  __privateAdd(this, _freshListenerManager4, new FreshListenerManager());
873
875
  __privateAdd(this, _cachedTwisty3DPuzzle, null);
874
876
  this.twisty3DPuzzle();
875
- __privateGet(this, _freshListenerManager4).addListener(this.model.puzzleLoaderProp, (puzzleLoader2) => {
877
+ __privateGet(this, _freshListenerManager4).addListener(this.model.puzzleLoader, (puzzleLoader2) => {
876
878
  if (this.puzzleLoader.id !== puzzleLoader2.id) {
877
879
  this.disconnect();
878
880
  }
879
881
  });
880
- __privateGet(this, _freshListenerManager4).addListener(this.model.legacyPositionProp, async (position) => {
882
+ __privateGet(this, _freshListenerManager4).addListener(this.model.legacyPosition, async (position) => {
881
883
  try {
882
884
  (await this.twisty3DPuzzle()).onPositionChange(position);
883
885
  this.scheduleRender();
@@ -885,19 +887,19 @@ var Twisty3DPuzzleWrapper = class {
885
887
  this.disconnect();
886
888
  }
887
889
  });
888
- __privateGet(this, _freshListenerManager4).addListener(this.model.hintFaceletProp, async (hintFaceletStyle) => {
890
+ __privateGet(this, _freshListenerManager4).addListener(this.model.hintFacelet, async (hintFaceletStyle) => {
889
891
  (await this.twisty3DPuzzle()).experimentalUpdateOptions({
890
892
  hintFacelets: hintFaceletStyle === "auto" ? "floating" : hintFaceletStyle
891
893
  });
892
894
  this.scheduleRender();
893
895
  });
894
- __privateGet(this, _freshListenerManager4).addListener(this.model.foundationDisplayProp, async (foundationDisplay) => {
896
+ __privateGet(this, _freshListenerManager4).addListener(this.model.foundationDisplay, async (foundationDisplay) => {
895
897
  (await this.twisty3DPuzzle()).experimentalUpdateOptions({
896
898
  showFoundation: foundationDisplay !== "none"
897
899
  });
898
900
  this.scheduleRender();
899
901
  });
900
- __privateGet(this, _freshListenerManager4).addListener(this.model.stickeringProp, async (stickering) => {
902
+ __privateGet(this, _freshListenerManager4).addListener(this.model.stickering, async (stickering) => {
901
903
  if ("setStickering" in await this.twisty3DPuzzle()) {
902
904
  (await this.twisty3DPuzzle()).setStickering(stickering);
903
905
  this.scheduleRender();
@@ -941,7 +943,7 @@ var Twisty3DPuzzleWrapper = class {
941
943
  const [foundationSprite, hintSprite, experimentalStickering] = await Promise.all([
942
944
  this.model.foundationStickerSprite.get(),
943
945
  this.model.hintStickerSprite.get(),
944
- this.model.stickeringProp.get()
946
+ this.model.stickering.get()
945
947
  ]);
946
948
  return (await proxyPromise).cube3DShim({
947
949
  foundationSprite,
@@ -950,7 +952,7 @@ var Twisty3DPuzzleWrapper = class {
950
952
  });
951
953
  } else {
952
954
  const [hintFacelets, foundationSprite, hintSprite] = await Promise.all([
953
- this.model.hintFaceletProp.get(),
955
+ this.model.hintFacelet.get(),
954
956
  this.model.foundationStickerSprite.get(),
955
957
  this.model.hintStickerSprite.get()
956
958
  ]);
@@ -1104,12 +1106,45 @@ var twisty3DVantageCSS = new CSSSource(`
1104
1106
  height: 100%;
1105
1107
  display: grid;
1106
1108
  overflow: hidden;
1109
+ place-content: center;
1110
+ }
1111
+
1112
+ .loading {
1113
+ width: 4em;
1114
+ height: 4em;
1115
+ border-radius: 2.5em;
1116
+ border: 0.5em solid rgba(0, 0, 0, 0);
1117
+ border-top: 0.5em solid rgba(0, 0, 0, 0.7);
1118
+ border-right: 0.5em solid rgba(0, 0, 0, 0.7);
1119
+ animation: fade-in-delayed 4s, rotate 1s linear infinite;
1120
+ }
1121
+
1122
+ @keyframes fade-in-delayed {
1123
+ 0% { opacity: 0; }
1124
+ 25% {opacity: 0; }
1125
+ 100% { opacity: 1; }
1126
+ }
1127
+
1128
+ @keyframes rotate {
1129
+ from { transform: rotate(0deg); }
1130
+ to { transform: rotate(360deg); }
1107
1131
  }
1108
1132
 
1109
1133
  /* TODO: This is due to stats hack. Replace with \`canvas\`. */
1110
1134
  .wrapper > canvas {
1111
1135
  max-width: 100%;
1112
1136
  max-height: 100%;
1137
+ cursor: grab;
1138
+ animation: fade-in 0.25s ease-in;
1139
+ }
1140
+
1141
+ @keyframes fade-in {
1142
+ from { opacity: 0; }
1143
+ to { opacity: 1; }
1144
+ }
1145
+
1146
+ .wrapper > canvas:active {
1147
+ cursor: grabbing;
1113
1148
  }
1114
1149
 
1115
1150
  .wrapper.invisible {
@@ -1322,8 +1357,8 @@ var TwistyOrbitControls = class {
1322
1357
  const minDim = Math.min(this.canvas.offsetWidth, this.canvas.offsetHeight);
1323
1358
  const temperedX = this.temperMovement(movementX / minDim);
1324
1359
  const temperedY = this.temperMovement(movementY / minDim * VERTICAL_MOVEMENT_BASE_SCALE);
1325
- this.model.orbitCoordinatesRequestProp.set((async () => {
1326
- const prevCoords = await this.model.orbitCoordinatesProp.get();
1360
+ this.model.orbitCoordinatesRequest.set((async () => {
1361
+ const prevCoords = await this.model.orbitCoordinates.get();
1327
1362
  const newCoords = {
1328
1363
  latitude: prevCoords.latitude + 2 * temperedY * DEGREES_PER_RADIAN * scale,
1329
1364
  longitude: prevCoords.longitude - 2 * temperedX * DEGREES_PER_RADIAN
@@ -1383,6 +1418,7 @@ var Twisty3DVantage = class extends ManagedCustomElement {
1383
1418
  this.scene = null;
1384
1419
  this.stats = null;
1385
1420
  this.rendererIsShared = shareRenderer();
1421
+ this.loadingElement = null;
1386
1422
  __privateAdd(this, _onResizeStaleDropper, new StaleDropper());
1387
1423
  __privateAdd(this, _width, 0);
1388
1424
  __privateAdd(this, _height, 0);
@@ -1394,6 +1430,8 @@ var Twisty3DVantage = class extends ManagedCustomElement {
1394
1430
  __privateAdd(this, _disconnectionFunctions, []);
1395
1431
  __privateAdd(this, _scheduler, new RenderScheduler(this.render.bind(this)));
1396
1432
  this.scene = scene ?? null;
1433
+ this.loadingElement = this.addElement(document.createElement("div"));
1434
+ this.loadingElement.classList.add("loading");
1397
1435
  if (SHOW_STATS) {
1398
1436
  this.stats = new Stats();
1399
1437
  this.stats.dom.style.position = "absolute";
@@ -1435,6 +1473,7 @@ var Twisty3DVantage = class extends ManagedCustomElement {
1435
1473
  const renderer = await this.renderer();
1436
1474
  canvas = this.addElement(renderer.domElement);
1437
1475
  }
1476
+ this.loadingElement?.remove();
1438
1477
  const context = canvas.getContext("2d");
1439
1478
  return { canvas, context };
1440
1479
  })());
@@ -1451,7 +1490,7 @@ var Twisty3DVantage = class extends ManagedCustomElement {
1451
1490
  return __privateGet(this, _cachedOrbitControls) ?? __privateSet(this, _cachedOrbitControls, (async () => {
1452
1491
  const orbitControls = new TwistyOrbitControls(this.model, !!this.options?.backView, (await this.canvasInfo()).canvas, await __privateMethod(this, _dragTracker, dragTracker_fn).call(this));
1453
1492
  if (this.model) {
1454
- this.addListener(this.model.orbitCoordinatesProp, async (orbitCoordinates) => {
1493
+ this.addListener(this.model.orbitCoordinates, async (orbitCoordinates) => {
1455
1494
  const camera = await this.camera();
1456
1495
  setCameraFromOrbitCoordinates(camera, orbitCoordinates, this.options?.backView);
1457
1496
  this.scheduleRender();
@@ -1497,7 +1536,7 @@ _setupBasicPresses = new WeakSet();
1497
1536
  setupBasicPresses_fn = async function() {
1498
1537
  const dragTracker = await __privateMethod(this, _dragTracker, dragTracker_fn).call(this);
1499
1538
  dragTracker.addEventListener("press", async (e) => {
1500
- const movePressInput = await this.model.movePressInputProp.get();
1539
+ const movePressInput = await this.model.movePressInput.get();
1501
1540
  if (movePressInput !== "basic") {
1502
1541
  return;
1503
1542
  }
@@ -1584,8 +1623,8 @@ var Twisty3DSceneWrapper = class extends ManagedCustomElement {
1584
1623
  const vantage = new Twisty3DVantage(this.model, this);
1585
1624
  this.addVantage(vantage);
1586
1625
  if (this.model) {
1587
- __privateGet(this, _freshListenerManager5).addMultiListener([this.model.puzzleLoaderProp, this.model.visualizationStrategyProp], this.onPuzzle.bind(this));
1588
- __privateGet(this, _freshListenerManager5).addListener(this.model.backViewProp, this.onBackView.bind(this));
1626
+ __privateGet(this, _freshListenerManager5).addMultiListener([this.model.puzzleLoader, this.model.visualizationStrategy], this.onPuzzle.bind(this));
1627
+ __privateGet(this, _freshListenerManager5).addListener(this.model.backView, this.onBackView.bind(this));
1589
1628
  }
1590
1629
  this.scheduleRender();
1591
1630
  }
@@ -1656,11 +1695,14 @@ var Twisty3DSceneWrapper = class extends ManagedCustomElement {
1656
1695
  }
1657
1696
  async setCurrentTwisty3DPuzzleWrapper(scene, twisty3DPuzzleWrapper) {
1658
1697
  const old = __privateGet(this, _currentTwisty3DPuzzleWrapper);
1659
- __privateSet(this, _currentTwisty3DPuzzleWrapper, twisty3DPuzzleWrapper);
1660
- old?.disconnect();
1661
- scene.add(await twisty3DPuzzleWrapper.twisty3DPuzzle());
1662
- if (old) {
1663
- scene.remove(await old.twisty3DPuzzle());
1698
+ try {
1699
+ __privateSet(this, _currentTwisty3DPuzzleWrapper, twisty3DPuzzleWrapper);
1700
+ old?.disconnect();
1701
+ scene.add(await twisty3DPuzzleWrapper.twisty3DPuzzle());
1702
+ } finally {
1703
+ if (old) {
1704
+ scene.remove(await old.twisty3DPuzzle());
1705
+ }
1664
1706
  }
1665
1707
  }
1666
1708
  async onPuzzle(inputs) {
@@ -1915,7 +1957,7 @@ var TwistyButtonsV2 = class extends ManagedCustomElement {
1915
1957
  this.addElement(button);
1916
1958
  }
1917
1959
  this.buttons = buttons;
1918
- this.model?.buttonAppearanceProp.addFreshListener(this.update.bind(this));
1960
+ this.model?.buttonAppearance.addFreshListener(this.update.bind(this));
1919
1961
  }
1920
1962
  async onFullscreenButton() {
1921
1963
  if (!this.fullscreenElement) {
@@ -2014,36 +2056,11 @@ var twistyScrubberCSS = new CSSSource(`
2014
2056
  overflow: hidden;
2015
2057
  backdrop-filter: blur(4px);
2016
2058
  -webkit-backdrop-filter: blur(4px);
2059
+ background: rgba(196, 196, 196, 0.75)
2017
2060
  }
2018
2061
 
2019
- input {
2020
- margin: 0; width: 100%;
2021
- }
2022
-
2023
- input {
2024
- background: none;
2025
- }
2026
-
2027
- ::-moz-range-track {
2028
- background: rgba(0, 0, 0, 0.25);
2029
- height: 50%;
2030
- border: 1px solid rgba(0, 0, 0, 0.1);
2031
- }
2032
-
2033
- ::-webkit-slider-runnable-track {
2034
- background: rgba(0, 0, 0, 0.05);
2035
- }
2036
-
2037
- ::-moz-range-progress {
2038
- background: #3273F6;
2039
- height: 50%;
2040
- border: 1px solid rgba(0, 0, 0, 0.1);
2041
- }
2042
-
2043
- ::-ms-fill-lower {
2044
- background: #3273F6;
2045
- height: 50%;
2046
- border: 1px solid rgba(0, 0, 0, 0.1);
2062
+ input:not(:disabled) {
2063
+ cursor: ew-resize;
2047
2064
  }
2048
2065
  `);
2049
2066
 
@@ -2097,7 +2114,7 @@ var TwistyScrubberV2 = class extends ManagedCustomElement {
2097
2114
  const elem = document.createElement("input");
2098
2115
  elem.type = "range";
2099
2116
  elem.disabled = true;
2100
- this.model?.detailedTimelineInfoProp.addFreshListener(this.onDetailedTimelineInfo.bind(this));
2117
+ this.model?.detailedTimelineInfo.addFreshListener(this.onDetailedTimelineInfo.bind(this));
2101
2118
  elem.addEventListener("input", this.onInput.bind(this));
2102
2119
  return elem;
2103
2120
  })());
@@ -2109,8 +2126,8 @@ var TwistyScrubberV2 = class extends ManagedCustomElement {
2109
2126
  const inputElem = await this.inputElem();
2110
2127
  await this.slowDown(e, inputElem);
2111
2128
  const value = parseInt(inputElem.value);
2112
- this.model?.playingInfoProp.set({ playing: false });
2113
- this.model?.timestampRequestProp.set(value);
2129
+ this.model?.playingInfo.set({ playing: false });
2130
+ this.model?.timestampRequest.set(value);
2114
2131
  }
2115
2132
  async slowDown(e, inputElem) {
2116
2133
  if (!SLOW_DOWN_SCRUBBING) {
@@ -2158,12 +2175,12 @@ async function screenshot(model, options) {
2158
2175
  })());
2159
2176
  const scene = new (await THREEJS).Scene();
2160
2177
  const twisty3DWrapper = new Twisty3DPuzzleWrapper(model, { scheduleRender: () => {
2161
- } }, await model.puzzleLoaderProp.get(), await model.visualizationStrategyProp.get());
2162
- await model.stickeringProp.get();
2178
+ } }, await model.puzzleLoader.get(), await model.visualizationStrategy.get());
2179
+ await model.stickering.get();
2163
2180
  await new Promise((resolve) => setTimeout(resolve, 1e3));
2164
- await model.legacyPositionProp.get();
2181
+ await model.legacyPosition.get();
2165
2182
  scene.add(await twisty3DWrapper.twisty3DPuzzle());
2166
- const orbitCoordinates = await model.orbitCoordinatesProp.get();
2183
+ const orbitCoordinates = await model.orbitCoordinates.get();
2167
2184
  await setCameraFromOrbitCoordinates(camera, orbitCoordinates);
2168
2185
  const renderer = new (await THREEJS).WebGLRenderer({
2169
2186
  antialias: true,
@@ -2182,8 +2199,8 @@ async function screenshot(model, options) {
2182
2199
  }
2183
2200
  async function getDefaultFilename(model) {
2184
2201
  const [puzzleID, algWithIssues] = await Promise.all([
2185
- model.puzzleIDProp.get(),
2186
- model.algProp.get()
2202
+ model.puzzleID.get(),
2203
+ model.alg.get()
2187
2204
  ]);
2188
2205
  return `[${puzzleID}]${algWithIssues.alg.experimentalNumUnits() === 0 ? "" : " " + algWithIssues.alg.toString()}`;
2189
2206
  }
@@ -2208,7 +2225,7 @@ var twistyPlayerCSS = new CSSSource(`
2208
2225
  .wrapper {
2209
2226
  display: grid;
2210
2227
  overflow: hidden;
2211
- grid-template-rows: 7fr 1em 1fr;
2228
+ grid-template-rows: 7fr minmax(1.5em, 0.5fr) minmax(2em, 1fr);
2212
2229
  }
2213
2230
 
2214
2231
  .wrapper > * {
@@ -3458,7 +3475,7 @@ var PuzzleAlgProp = class extends TwistyPropDerived {
3458
3475
  // src/cubing/twisty/model/props/puzzle/state/AlgTransformationProp.ts
3459
3476
  var AlgTransformationProp = class extends TwistyPropDerived {
3460
3477
  derive(input) {
3461
- return input.kpuzzle.algToTransformation(input.alg.alg);
3478
+ return input.kpuzzle.algToTransformation(input.setupAlg.alg);
3462
3479
  }
3463
3480
  };
3464
3481
 
@@ -3469,16 +3486,19 @@ var IndexerProp = class extends TwistyPropDerived {
3469
3486
  }
3470
3487
  };
3471
3488
 
3472
- // src/cubing/twisty/model/props/puzzle/state/AnchoredStartProp.ts
3473
- var AnchoredStartProp = class extends TwistyPropDerived {
3489
+ // src/cubing/twisty/model/props/puzzle/state/AnchorTransformationProp.ts
3490
+ var AnchorTransformationProp = class extends TwistyPropDerived {
3474
3491
  derive(inputs) {
3492
+ if (inputs.setupTransformation) {
3493
+ return inputs.setupTransformation;
3494
+ }
3475
3495
  switch (inputs.setupAnchor) {
3476
3496
  case "start":
3477
- return inputs.setupTransformation;
3497
+ return inputs.setupAlgTransformation;
3478
3498
  case "end": {
3479
3499
  const algTransformation = inputs.indexer.transformationAtIndex(inputs.indexer.numAnimatedLeaves());
3480
3500
  const inverseAlgTransformation = algTransformation.invert();
3481
- return inputs.setupTransformation.applyTransformation(inverseAlgTransformation);
3501
+ return inputs.setupAlgTransformation.applyTransformation(inverseAlgTransformation);
3482
3502
  }
3483
3503
  default:
3484
3504
  throw new Error("Unimplemented!");
@@ -3709,127 +3729,148 @@ var FoundationDisplayProp = class extends SimpleTwistyPropSource {
3709
3729
  }
3710
3730
  };
3711
3731
 
3732
+ // src/cubing/twisty/model/props/puzzle/state/SetupTransformationProp.ts
3733
+ var SetupTransformationProp = class extends SimpleTwistyPropSource {
3734
+ getDefaultValue() {
3735
+ return null;
3736
+ }
3737
+ };
3738
+
3712
3739
  // src/cubing/twisty/model/TwistyPlayerModel.ts
3713
3740
  var TwistyPlayerModel = class {
3714
3741
  constructor() {
3715
3742
  this.userVisibleErrorTracker = new UserVisibleErrorTracker();
3716
- this.algProp = new AlgProp();
3717
- this.backgroundProp = new BackgroundProp();
3718
- this.backViewProp = new BackViewProp();
3719
- this.controlPanelProp = new ControlPanelProp();
3720
- this.catchUpMoveProp = new CatchUpMoveProp();
3721
- this.foundationDisplayProp = new FoundationDisplayProp();
3743
+ this.alg = new AlgProp();
3744
+ this.background = new BackgroundProp();
3745
+ this.backView = new BackViewProp();
3746
+ this.controlPanel = new ControlPanelProp();
3747
+ this.catchUpMove = new CatchUpMoveProp();
3748
+ this.foundationDisplay = new FoundationDisplayProp();
3722
3749
  this.foundationStickerSpriteURL = new URLProp();
3723
- this.hintFaceletProp = new HintFaceletProp();
3750
+ this.hintFacelet = new HintFaceletProp();
3724
3751
  this.hintStickerSpriteURL = new URLProp();
3725
- this.indexerConstructorRequestProp = new IndexerConstructorRequestProp();
3726
- this.latitudeLimitProp = new LatitudeLimitProp();
3727
- this.movePressInputProp = new MovePressInputProp();
3728
- this.orbitCoordinatesRequestProp = new OrbitCoordinatesRequestProp();
3729
- this.playingInfoProp = new PlayingInfoProp();
3730
- this.puzzleDescriptionRequestProp = new PGPuzzleDescriptionStringProp();
3731
- this.puzzleIDRequestProp = new PuzzleIDRequestProp();
3732
- this.setupAnchorProp = new SetupAnchorProp();
3733
- this.setupProp = new AlgProp();
3734
- this.stickeringProp = new StickeringProp();
3735
- this.tempoScaleProp = new TempoScaleProp();
3736
- this.timestampRequestProp = new TimestampRequestProp();
3737
- this.viewerLinkProp = new ViewerLinkProp();
3738
- this.visualizationFormatProp = new VisualizationFormatProp();
3752
+ this.indexerConstructorRequest = new IndexerConstructorRequestProp();
3753
+ this.latitudeLimit = new LatitudeLimitProp();
3754
+ this.movePressInput = new MovePressInputProp();
3755
+ this.orbitCoordinatesRequest = new OrbitCoordinatesRequestProp();
3756
+ this.playingInfo = new PlayingInfoProp();
3757
+ this.puzzleDescriptionRequest = new PGPuzzleDescriptionStringProp();
3758
+ this.puzzleIDRequest = new PuzzleIDRequestProp();
3759
+ this.setupAnchor = new SetupAnchorProp();
3760
+ this.setupAlg = new AlgProp();
3761
+ this.setupTransformation = new SetupTransformationProp();
3762
+ this.stickering = new StickeringProp();
3763
+ this.tempoScale = new TempoScaleProp();
3764
+ this.timestampRequest = new TimestampRequestProp();
3765
+ this.viewerLink = new ViewerLinkProp();
3766
+ this.visualizationFormat = new VisualizationFormatProp();
3739
3767
  this.foundationStickerSprite = new SpriteProp({
3740
3768
  spriteURL: this.foundationStickerSpriteURL
3741
3769
  });
3742
3770
  this.hintStickerSprite = new SpriteProp({
3743
3771
  spriteURL: this.hintStickerSpriteURL
3744
3772
  });
3745
- this.puzzleLoaderProp = new PuzzleLoaderProp({
3746
- puzzleIDRequest: this.puzzleIDRequestProp,
3747
- puzzleDescriptionRequest: this.puzzleDescriptionRequestProp
3773
+ this.puzzleLoader = new PuzzleLoaderProp({
3774
+ puzzleIDRequest: this.puzzleIDRequest,
3775
+ puzzleDescriptionRequest: this.puzzleDescriptionRequest
3748
3776
  }, this.userVisibleErrorTracker);
3749
- this.kpuzzleProp = new KPuzzleProp({ puzzleLoader: this.puzzleLoaderProp });
3750
- this.puzzleIDProp = new PuzzleIDProp({ puzzleLoader: this.puzzleLoaderProp });
3751
- this.puzzleAlgProp = new PuzzleAlgProp({
3752
- algWithIssues: this.algProp,
3753
- kpuzzle: this.kpuzzleProp
3777
+ this.kpuzzle = new KPuzzleProp({ puzzleLoader: this.puzzleLoader });
3778
+ this.puzzleID = new PuzzleIDProp({ puzzleLoader: this.puzzleLoader });
3779
+ this.puzzleAlg = new PuzzleAlgProp({
3780
+ algWithIssues: this.alg,
3781
+ kpuzzle: this.kpuzzle
3754
3782
  });
3755
- this.puzzleSetupProp = new PuzzleAlgProp({
3756
- algWithIssues: this.setupProp,
3757
- kpuzzle: this.kpuzzleProp
3783
+ this.puzzleSetupAlg = new PuzzleAlgProp({
3784
+ algWithIssues: this.setupAlg,
3785
+ kpuzzle: this.kpuzzle
3758
3786
  });
3759
- this.visualizationStrategyProp = new VisualizationStrategyProp({
3760
- visualizationRequest: this.visualizationFormatProp,
3761
- puzzleID: this.puzzleIDProp
3787
+ this.visualizationStrategy = new VisualizationStrategyProp({
3788
+ visualizationRequest: this.visualizationFormat,
3789
+ puzzleID: this.puzzleID
3762
3790
  });
3763
- this.indexerConstructorProp = new IndexerConstructorProp({
3764
- alg: this.algProp,
3765
- puzzle: this.puzzleIDProp,
3766
- visualizationStrategy: this.visualizationStrategyProp,
3767
- indexerConstructorRequest: this.indexerConstructorRequestProp
3791
+ this.indexerConstructor = new IndexerConstructorProp({
3792
+ alg: this.alg,
3793
+ puzzle: this.puzzleID,
3794
+ visualizationStrategy: this.visualizationStrategy,
3795
+ indexerConstructorRequest: this.indexerConstructorRequest
3768
3796
  });
3769
- this.moveCountProp = new NaiveMoveCountProp({ alg: this.puzzleAlgProp });
3770
- this.orbitCoordinatesProp = new OrbitCoordinatesProp({
3771
- orbitCoordinatesRequest: this.orbitCoordinatesRequestProp,
3772
- latitudeLimit: this.latitudeLimitProp,
3773
- puzzleID: this.puzzleIDProp,
3774
- strategy: this.visualizationStrategyProp
3797
+ this.moveCount = new NaiveMoveCountProp({ alg: this.puzzleAlg });
3798
+ this.orbitCoordinates = new OrbitCoordinatesProp({
3799
+ orbitCoordinatesRequest: this.orbitCoordinatesRequest,
3800
+ latitudeLimit: this.latitudeLimit,
3801
+ puzzleID: this.puzzleID,
3802
+ strategy: this.visualizationStrategy
3775
3803
  });
3776
- this.setupTransformationProp = new AlgTransformationProp({
3777
- alg: this.puzzleSetupProp,
3778
- kpuzzle: this.kpuzzleProp
3804
+ this.setupAlgTransformation = new AlgTransformationProp({
3805
+ setupAlg: this.puzzleSetupAlg,
3806
+ kpuzzle: this.kpuzzle
3779
3807
  });
3780
- this.indexerProp = new IndexerProp({
3781
- indexerConstructor: this.indexerConstructorProp,
3782
- algWithIssues: this.puzzleAlgProp,
3783
- kpuzzle: this.kpuzzleProp
3808
+ this.indexer = new IndexerProp({
3809
+ indexerConstructor: this.indexerConstructor,
3810
+ algWithIssues: this.puzzleAlg,
3811
+ kpuzzle: this.kpuzzle
3784
3812
  });
3785
- this.anchoredStartProp = new AnchoredStartProp({
3786
- setupAnchor: this.setupAnchorProp,
3787
- setupTransformation: this.setupTransformationProp,
3788
- indexer: this.indexerProp
3813
+ this.anchorTransformation = new AnchorTransformationProp({
3814
+ setupTransformation: this.setupTransformation,
3815
+ setupAnchor: this.setupAnchor,
3816
+ setupAlgTransformation: this.setupAlgTransformation,
3817
+ indexer: this.indexer
3789
3818
  });
3790
- this.timeRangeProp = new TimeRangeProp({
3791
- indexer: this.indexerProp
3819
+ this.timeRange = new TimeRangeProp({
3820
+ indexer: this.indexer
3792
3821
  });
3793
- this.detailedTimelineInfoProp = new DetailedTimelineInfoProp({
3794
- timestampRequest: this.timestampRequestProp,
3795
- timeRange: this.timeRangeProp,
3796
- setupAnchor: this.setupAnchorProp
3822
+ this.detailedTimelineInfo = new DetailedTimelineInfoProp({
3823
+ timestampRequest: this.timestampRequest,
3824
+ timeRange: this.timeRange,
3825
+ setupAnchor: this.setupAnchor
3797
3826
  });
3798
- this.coarseTimelineInfoProp = new CoarseTimelineInfoProp({
3799
- detailedTimelineInfo: this.detailedTimelineInfoProp,
3800
- playingInfo: this.playingInfoProp
3827
+ this.coarseTimelineInfo = new CoarseTimelineInfoProp({
3828
+ detailedTimelineInfo: this.detailedTimelineInfo,
3829
+ playingInfo: this.playingInfo
3801
3830
  });
3802
- this.currentMoveInfoProp = new CurrentMoveInfoProp({
3803
- indexer: this.indexerProp,
3804
- detailedTimelineInfo: this.detailedTimelineInfoProp,
3805
- catchUpMove: this.catchUpMoveProp
3831
+ this.currentMoveInfo = new CurrentMoveInfoProp({
3832
+ indexer: this.indexer,
3833
+ detailedTimelineInfo: this.detailedTimelineInfo,
3834
+ catchUpMove: this.catchUpMove
3806
3835
  });
3807
- this.buttonAppearanceProp = new ButtonAppearanceProp({
3808
- coarseTimelineInfo: this.coarseTimelineInfoProp,
3809
- viewerLink: this.viewerLinkProp
3836
+ this.buttonAppearance = new ButtonAppearanceProp({
3837
+ coarseTimelineInfo: this.coarseTimelineInfo,
3838
+ viewerLink: this.viewerLink
3810
3839
  });
3811
- this.currentLeavesSimplifiedProp = new CurrentLeavesSimplifiedProp({
3812
- currentMoveInfo: this.currentMoveInfoProp
3840
+ this.currentLeavesSimplified = new CurrentLeavesSimplifiedProp({
3841
+ currentMoveInfo: this.currentMoveInfo
3813
3842
  });
3814
- this.currentStateProp = new CurrentStateProp({
3815
- anchoredStart: this.anchoredStartProp,
3816
- currentLeavesSimplified: this.currentLeavesSimplifiedProp,
3817
- indexer: this.indexerProp
3843
+ this.currentState = new CurrentStateProp({
3844
+ anchoredStart: this.anchorTransformation,
3845
+ currentLeavesSimplified: this.currentLeavesSimplified,
3846
+ indexer: this.indexer
3818
3847
  });
3819
- this.legacyPositionProp = new LegacyPositionProp({
3820
- currentMoveInfo: this.currentMoveInfoProp,
3821
- state: this.currentStateProp
3848
+ this.legacyPosition = new LegacyPositionProp({
3849
+ currentMoveInfo: this.currentMoveInfo,
3850
+ state: this.currentState
3822
3851
  });
3823
3852
  }
3824
3853
  async twizzleLink() {
3825
- const url = new URL("https://alpha.twizzle.net/edit/");
3826
- const [puzzle, alg, setup, anchor, experimentalStickering] = await Promise.all([
3827
- this.puzzleIDProp.get(),
3828
- this.algProp.get(),
3829
- this.setupProp.get(),
3830
- this.setupAnchorProp.get(),
3831
- this.stickeringProp.get()
3854
+ const [
3855
+ viewerLink,
3856
+ puzzleID,
3857
+ puzzleDescription,
3858
+ alg,
3859
+ setup,
3860
+ anchor,
3861
+ experimentalStickering
3862
+ ] = await Promise.all([
3863
+ this.viewerLink.get(),
3864
+ this.puzzleID.get(),
3865
+ this.puzzleDescriptionRequest.get(),
3866
+ this.alg.get(),
3867
+ this.setupAlg.get(),
3868
+ this.setupAnchor.get(),
3869
+ this.stickering.get()
3832
3870
  ]);
3871
+ const isExplorer = viewerLink === "experimental-twizzle-explorer";
3872
+ console.log({ isExplorer, viewerLink });
3873
+ const url = new URL(`https://alpha.twizzle.net/${isExplorer ? "explore" : "edit"}/`);
3833
3874
  if (!alg.alg.experimentalIsEmpty()) {
3834
3875
  url.searchParams.set("alg", alg.alg.toString());
3835
3876
  }
@@ -3842,27 +3883,33 @@ var TwistyPlayerModel = class {
3842
3883
  if (experimentalStickering !== "full") {
3843
3884
  url.searchParams.set("experimental-stickering", experimentalStickering);
3844
3885
  }
3845
- if (puzzle !== "3x3x3") {
3846
- url.searchParams.set("puzzle", puzzle);
3886
+ if (isExplorer && puzzleDescription !== NO_VALUE) {
3887
+ url.searchParams.set("puzzle-description", puzzleDescription);
3888
+ } else if (puzzleID !== "3x3x3") {
3889
+ url.searchParams.set("puzzle", puzzleID);
3847
3890
  }
3848
3891
  return url.toString();
3849
3892
  }
3850
3893
  experimentalAddMove(flexibleMove, options = {}) {
3851
3894
  const move = typeof flexibleMove === "string" ? new Move(flexibleMove) : flexibleMove;
3852
3895
  (async () => {
3853
- const alg = (await this.algProp.get()).alg;
3896
+ const alg = (await this.alg.get()).alg;
3854
3897
  const newAlg = experimentalAppendMove(alg, move, {
3855
3898
  coalesce: options?.coalesce,
3856
3899
  mod: options?.mod
3857
3900
  });
3858
- this.algProp.set(newAlg);
3859
- this.timestampRequestProp.set("end");
3860
- this.catchUpMoveProp.set({
3901
+ this.alg.set(newAlg);
3902
+ this.timestampRequest.set("end");
3903
+ this.catchUpMove.set({
3861
3904
  move,
3862
3905
  amount: 0
3863
3906
  });
3864
3907
  })();
3865
3908
  }
3909
+ get playingInfoProp() {
3910
+ console.warn("Using deprecated prop: `playingInfoProp`. Please switch to: `playingInfo`");
3911
+ return this.playingInfo;
3912
+ }
3866
3913
  };
3867
3914
 
3868
3915
  // src/cubing/twisty/views/TwistyPlayerSettable.ts
@@ -3876,121 +3923,121 @@ var TwistyPlayerSettable = class extends ManagedCustomElement {
3876
3923
  this.experimentalGet = new ExperimentalGetters(this.experimentalModel);
3877
3924
  }
3878
3925
  set alg(newAlg) {
3879
- this.experimentalModel.algProp.set(newAlg);
3926
+ this.experimentalModel.alg.set(newAlg);
3880
3927
  }
3881
3928
  get alg() {
3882
3929
  throw err("alg");
3883
3930
  }
3884
3931
  set experimentalSetupAlg(newSetup) {
3885
- this.experimentalModel.setupProp.set(newSetup);
3932
+ this.experimentalModel.setupAlg.set(newSetup);
3886
3933
  }
3887
3934
  get experimentalSetupAlg() {
3888
3935
  throw err("setup");
3889
3936
  }
3890
3937
  set experimentalSetupAnchor(anchor) {
3891
- this.experimentalModel.setupAnchorProp.set(anchor);
3938
+ this.experimentalModel.setupAnchor.set(anchor);
3892
3939
  }
3893
3940
  get experimentalSetupAnchor() {
3894
3941
  throw err("anchor");
3895
3942
  }
3896
3943
  set puzzle(puzzleID) {
3897
- this.experimentalModel.puzzleIDRequestProp.set(puzzleID);
3944
+ this.experimentalModel.puzzleIDRequest.set(puzzleID);
3898
3945
  }
3899
3946
  get puzzle() {
3900
3947
  throw err("puzzle");
3901
3948
  }
3902
3949
  set experimentalPuzzleDescription(puzzleDescription) {
3903
- this.experimentalModel.puzzleDescriptionRequestProp.set(puzzleDescription);
3950
+ this.experimentalModel.puzzleDescriptionRequest.set(puzzleDescription);
3904
3951
  }
3905
3952
  get experimentalPuzzleDescription() {
3906
3953
  throw err("experimentalPuzzleDescription");
3907
3954
  }
3908
3955
  set timestamp(timestamp) {
3909
- this.experimentalModel.timestampRequestProp.set(timestamp);
3956
+ this.experimentalModel.timestampRequest.set(timestamp);
3910
3957
  }
3911
3958
  get timestamp() {
3912
3959
  throw err("timestamp");
3913
3960
  }
3914
3961
  set hintFacelets(hintFaceletStyle) {
3915
- this.experimentalModel.hintFaceletProp.set(hintFaceletStyle);
3962
+ this.experimentalModel.hintFacelet.set(hintFaceletStyle);
3916
3963
  }
3917
3964
  get hintFacelets() {
3918
3965
  throw err("hintFacelets");
3919
3966
  }
3920
3967
  set experimentalStickering(stickering) {
3921
- this.experimentalModel.stickeringProp.set(stickering);
3968
+ this.experimentalModel.stickering.set(stickering);
3922
3969
  }
3923
3970
  get experimentalStickering() {
3924
3971
  throw err("stickering");
3925
3972
  }
3926
3973
  set backView(backView) {
3927
- this.experimentalModel.backViewProp.set(backView);
3974
+ this.experimentalModel.backView.set(backView);
3928
3975
  }
3929
3976
  get backView() {
3930
3977
  throw err("backView");
3931
3978
  }
3932
3979
  set background(backgroundTheme) {
3933
- this.experimentalModel.backgroundProp.set(backgroundTheme);
3980
+ this.experimentalModel.background.set(backgroundTheme);
3934
3981
  }
3935
3982
  get background() {
3936
3983
  throw err("background");
3937
3984
  }
3938
3985
  set controlPanel(newControlPanel) {
3939
- this.experimentalModel.controlPanelProp.set(newControlPanel);
3986
+ this.experimentalModel.controlPanel.set(newControlPanel);
3940
3987
  }
3941
3988
  get controlPanel() {
3942
3989
  throw err("controlPanel");
3943
3990
  }
3944
3991
  set visualization(visualizationFormat) {
3945
- this.experimentalModel.visualizationFormatProp.set(visualizationFormat);
3992
+ this.experimentalModel.visualizationFormat.set(visualizationFormat);
3946
3993
  }
3947
3994
  get visualization() {
3948
3995
  throw err("visualization");
3949
3996
  }
3950
3997
  set viewerLink(viewerLinkPage) {
3951
- this.experimentalModel.viewerLinkProp.set(viewerLinkPage);
3998
+ this.experimentalModel.viewerLink.set(viewerLinkPage);
3952
3999
  }
3953
4000
  get viewerLink() {
3954
4001
  throw err("viewerLink");
3955
4002
  }
3956
4003
  set experimentalMovePressInput(movePressInput) {
3957
- this.experimentalModel.movePressInputProp.set(movePressInput);
4004
+ this.experimentalModel.movePressInput.set(movePressInput);
3958
4005
  }
3959
4006
  get experimentalMovePressInput() {
3960
4007
  throw err("experimentalMovePressInput");
3961
4008
  }
3962
4009
  set cameraLatitude(latitude) {
3963
- this.experimentalModel.orbitCoordinatesRequestProp.set({ latitude });
4010
+ this.experimentalModel.orbitCoordinatesRequest.set({ latitude });
3964
4011
  }
3965
4012
  get cameraLatitude() {
3966
4013
  throw err("cameraLatitude");
3967
4014
  }
3968
4015
  set cameraLongitude(longitude) {
3969
- this.experimentalModel.orbitCoordinatesRequestProp.set({ longitude });
4016
+ this.experimentalModel.orbitCoordinatesRequest.set({ longitude });
3970
4017
  }
3971
4018
  get cameraLongitude() {
3972
4019
  throw err("cameraLongitude");
3973
4020
  }
3974
4021
  set cameraDistance(distance) {
3975
- this.experimentalModel.orbitCoordinatesRequestProp.set({ distance });
4022
+ this.experimentalModel.orbitCoordinatesRequest.set({ distance });
3976
4023
  }
3977
4024
  get cameraDistance() {
3978
4025
  throw err("cameraDistance");
3979
4026
  }
3980
4027
  set cameraLatitudeLimit(latitudeLimit) {
3981
- this.experimentalModel.latitudeLimitProp.set(latitudeLimit);
4028
+ this.experimentalModel.latitudeLimit.set(latitudeLimit);
3982
4029
  }
3983
4030
  get cameraLatitudeLimit() {
3984
4031
  throw err("cameraLatitudeLimit");
3985
4032
  }
3986
4033
  set indexer(indexer) {
3987
- this.experimentalModel.indexerConstructorRequestProp.set(indexer);
4034
+ this.experimentalModel.indexerConstructorRequest.set(indexer);
3988
4035
  }
3989
4036
  get indexer() {
3990
4037
  throw err("indexer");
3991
4038
  }
3992
4039
  set tempoScale(newTempoScale) {
3993
- this.experimentalModel.tempoScaleProp.set(newTempoScale);
4040
+ this.experimentalModel.tempoScale.set(newTempoScale);
3994
4041
  }
3995
4042
  get tempoScale() {
3996
4043
  throw err("tempoScale");
@@ -4013,16 +4060,16 @@ var ExperimentalGetters = class {
4013
4060
  this.model = model;
4014
4061
  }
4015
4062
  async alg() {
4016
- return (await this.model.algProp.get()).alg;
4063
+ return (await this.model.alg.get()).alg;
4017
4064
  }
4018
4065
  async setupAlg() {
4019
- return (await this.model.setupProp.get()).alg;
4066
+ return (await this.model.setupAlg.get()).alg;
4020
4067
  }
4021
4068
  puzzleID() {
4022
- return this.model.puzzleIDProp.get();
4069
+ return this.model.puzzleID.get();
4023
4070
  }
4024
4071
  async timestamp() {
4025
- return (await this.model.detailedTimelineInfoProp.get()).timestamp;
4072
+ return (await this.model.detailedTimelineInfo.get()).timestamp;
4026
4073
  }
4027
4074
  };
4028
4075
 
@@ -4092,14 +4139,14 @@ var TwistyPlayer = class extends TwistyPlayerSettable {
4092
4139
  this.contentWrapper.appendChild(scrubber);
4093
4140
  this.buttons = new TwistyButtonsV2(this.experimentalModel, this.controller, this);
4094
4141
  this.contentWrapper.appendChild(this.buttons);
4095
- this.experimentalModel.backgroundProp.addFreshListener((backgroundTheme) => {
4142
+ this.experimentalModel.background.addFreshListener((backgroundTheme) => {
4096
4143
  this.contentWrapper.classList.toggle("checkered", backgroundTheme !== "none");
4097
4144
  });
4098
- this.experimentalModel.controlPanelProp.addFreshListener((controlPanel) => {
4145
+ this.experimentalModel.controlPanel.addFreshListener((controlPanel) => {
4099
4146
  __privateGet(this, _controlsManager).setValue(controlPanel);
4100
4147
  });
4101
- this.experimentalModel.visualizationStrategyProp.addFreshListener(__privateMethod(this, _setVisualizationWrapper, setVisualizationWrapper_fn).bind(this));
4102
- this.experimentalModel.puzzleIDProp.addFreshListener(this.flash.bind(this));
4148
+ this.experimentalModel.visualizationStrategy.addFreshListener(__privateMethod(this, _setVisualizationWrapper, setVisualizationWrapper_fn).bind(this));
4149
+ this.experimentalModel.puzzleID.addFreshListener(this.flash.bind(this));
4103
4150
  }
4104
4151
  flash() {
4105
4152
  __privateGet(this, _visualizationWrapper)?.animate([{ opacity: 0.25 }, { opacity: 1 }], {
@@ -4158,7 +4205,7 @@ var TwistyPlayer = class extends TwistyPlayerSettable {
4158
4205
  return (await screenshot(this.experimentalModel, options)).dataURL;
4159
4206
  }
4160
4207
  async experimentalDownloadScreenshot(filename) {
4161
- if (["2D", "experimental-2D-LL"].includes(await this.experimentalModel.visualizationStrategyProp.get())) {
4208
+ if (["2D", "experimental-2D-LL"].includes(await this.experimentalModel.visualizationStrategy.get())) {
4162
4209
  const wrapper2D = __privateGet(this, _visualizationWrapper);
4163
4210
  const twisty2DPuzzle = await wrapper2D.currentTwisty2DPuzzleWrapper().twisty2DPuzzle();
4164
4211
  const str = new XMLSerializer().serializeToString(twisty2DPuzzle.svg.element);
@@ -4472,13 +4519,13 @@ var TwistyAlgViewer = class extends HTMLElementShim {
4472
4519
  return;
4473
4520
  }
4474
4521
  this.twistyPlayer = twistyPlayer;
4475
- this.twistyPlayer.experimentalModel.algProp.addFreshListener((algWithIssues) => {
4522
+ this.twistyPlayer.experimentalModel.alg.addFreshListener((algWithIssues) => {
4476
4523
  this.setAlg(algWithIssues.alg);
4477
4524
  });
4478
- const sourceAlg = (await this.twistyPlayer.experimentalModel.algProp.get()).alg;
4525
+ const sourceAlg = (await this.twistyPlayer.experimentalModel.alg.get()).alg;
4479
4526
  const parsedAlg = "startCharIndex" in sourceAlg ? sourceAlg : Alg.fromString(sourceAlg.toString());
4480
4527
  this.setAlg(parsedAlg);
4481
- twistyPlayer.experimentalModel.currentMoveInfoProp.addFreshListener((currentMoveInfo) => {
4528
+ twistyPlayer.experimentalModel.currentMoveInfo.addFreshListener((currentMoveInfo) => {
4482
4529
  let moveInfo = currentMoveInfo.currentMoves[0];
4483
4530
  moveInfo ?? (moveInfo = currentMoveInfo.movesStarting[0]);
4484
4531
  moveInfo ?? (moveInfo = currentMoveInfo.movesFinishing[0]);
@@ -4489,7 +4536,7 @@ var TwistyAlgViewer = class extends HTMLElementShim {
4489
4536
  this.highlighter.set(mainCurrentMove);
4490
4537
  }
4491
4538
  });
4492
- twistyPlayer.experimentalModel.detailedTimelineInfoProp.addFreshListener((detailedTimelineInfo) => {
4539
+ twistyPlayer.experimentalModel.detailedTimelineInfo.addFreshListener((detailedTimelineInfo) => {
4493
4540
  if (detailedTimelineInfo.timestamp !== this.lastClickTimestamp) {
4494
4541
  this.lastClickTimestamp = null;
4495
4542
  }
@@ -4500,11 +4547,11 @@ var TwistyAlgViewer = class extends HTMLElementShim {
4500
4547
  if (twistyPlayer) {
4501
4548
  twistyPlayer.pause();
4502
4549
  const timestampPromise = (async () => {
4503
- const indexer = await twistyPlayer.experimentalModel.indexerProp.get();
4550
+ const indexer = await twistyPlayer.experimentalModel.indexer.get();
4504
4551
  const offset = offsetIntoMove ? DEFAULT_OFFSET_MS : 0;
4505
4552
  return (indexer.indexToMoveStartTimestamp(index) ?? -offset) + offset;
4506
4553
  })();
4507
- twistyPlayer.experimentalModel.timestampRequestProp.set(await timestampPromise);
4554
+ twistyPlayer.experimentalModel.timestampRequest.set(await timestampPromise);
4508
4555
  if (this.lastClickTimestamp === await timestampPromise) {
4509
4556
  twistyPlayer.play();
4510
4557
  this.lastClickTimestamp = null;
@@ -4823,8 +4870,8 @@ var TwistyAlgEditor = class extends ManagedCustomElement {
4823
4870
  if (options?.twistyPlayer) {
4824
4871
  this.twistyPlayer = options.twistyPlayer;
4825
4872
  }
4826
- __privateSet(this, _twistyPlayerProp, options?.twistyPlayerProp ?? "algProp");
4827
- if (options?.twistyPlayerProp === "algProp") {
4873
+ __privateSet(this, _twistyPlayerProp, options?.twistyPlayerProp ?? "alg");
4874
+ if (options?.twistyPlayerProp === "alg") {
4828
4875
  this.model.leafToHighlight.addFreshListener((highlightInfo) => {
4829
4876
  if (highlightInfo) {
4830
4877
  this.highlightLeaf(highlightInfo.leafInfo.leaf);
@@ -4853,7 +4900,7 @@ var TwistyAlgEditor = class extends ManagedCustomElement {
4853
4900
  if (document.activeElement !== this || this.shadow.activeElement !== __privateGet(this, _textarea)) {
4854
4901
  return;
4855
4902
  }
4856
- if (__privateGet(this, _twistyPlayerProp) !== "algProp") {
4903
+ if (__privateGet(this, _twistyPlayerProp) !== "alg") {
4857
4904
  return;
4858
4905
  }
4859
4906
  const { selectionStart, selectionEnd } = __privateGet(this, _textarea);
@@ -4868,7 +4915,7 @@ var TwistyAlgEditor = class extends ManagedCustomElement {
4868
4915
  __privateGet(this, _textareaClassListValidForPuzzleManager).setValue(issues);
4869
4916
  }
4870
4917
  highlightLeaf(leaf) {
4871
- if (__privateGet(this, _twistyPlayerProp) !== "algProp") {
4918
+ if (__privateGet(this, _twistyPlayerProp) !== "alg") {
4872
4919
  return;
4873
4920
  }
4874
4921
  if (leaf === null) {
@@ -4901,8 +4948,8 @@ var TwistyAlgEditor = class extends ManagedCustomElement {
4901
4948
  (async () => {
4902
4949
  this.algString = __privateGet(this, _algProp, algProp_get) ? (await __privateGet(this, _algProp, algProp_get).get()).alg.toString() : "";
4903
4950
  })();
4904
- if (__privateGet(this, _twistyPlayerProp) === "algProp") {
4905
- __privateGet(this, _twistyPlayer)?.experimentalModel.puzzleAlgProp.addFreshListener((algWithIssues) => {
4951
+ if (__privateGet(this, _twistyPlayerProp) === "alg") {
4952
+ __privateGet(this, _twistyPlayer)?.experimentalModel.puzzleAlg.addFreshListener((algWithIssues) => {
4906
4953
  if (algWithIssues.issues.errors.length === 0) {
4907
4954
  this.setAlgIssueClassForPuzzle(algWithIssues.issues.warnings.length === 0 ? "none" : "warning");
4908
4955
  const newAlg = algWithIssues.alg;
@@ -4921,8 +4968,8 @@ var TwistyAlgEditor = class extends ManagedCustomElement {
4921
4968
  return;
4922
4969
  }
4923
4970
  const [indexer, timestampRequest] = await Promise.all([
4924
- await twistyPlayer.experimentalModel.indexerProp.get(),
4925
- await twistyPlayer.experimentalModel.timestampRequestProp.get()
4971
+ await twistyPlayer.experimentalModel.indexer.get(),
4972
+ await twistyPlayer.experimentalModel.timestampRequest.get()
4926
4973
  ]);
4927
4974
  if (timestampRequest === "opposite-anchor" && !__privateGet(this, _onInputHasFired)) {
4928
4975
  return;
@@ -4947,11 +4994,11 @@ var TwistyAlgEditor = class extends ManagedCustomElement {
4947
4994
  throw new Error("Invalid where!");
4948
4995
  }
4949
4996
  if (!this.debugNeverRequestTimestamp) {
4950
- twistyPlayer.experimentalModel.timestampRequestProp.set(newTimestamp);
4997
+ twistyPlayer.experimentalModel.timestampRequest.set(newTimestamp);
4951
4998
  }
4952
4999
  });
4953
- twistyPlayer.experimentalModel.currentLeavesSimplifiedProp.addFreshListener(async (currentLeavesSimplified) => {
4954
- const indexer = await twistyPlayer.experimentalModel.indexerProp.get();
5000
+ twistyPlayer.experimentalModel.currentLeavesSimplified.addFreshListener(async (currentLeavesSimplified) => {
5001
+ const indexer = await twistyPlayer.experimentalModel.indexer.get();
4955
5002
  const leaf = indexer.getAnimLeaf(currentLeavesSimplified.stateIndex);
4956
5003
  this.highlightLeaf(leaf);
4957
5004
  });
@@ -5015,6 +5062,175 @@ padSuffix_fn = function(s) {
5015
5062
  };
5016
5063
  _highlightedLeaf = new WeakMap();
5017
5064
  customElementsShim.define("twisty-alg-editor", TwistyAlgEditor);
5065
+
5066
+ // src/cubing/twisty/views/twizzle/TwizzleLink.css.ts
5067
+ var twizzleLinkCSS = new CSSSource(`
5068
+ .wrapper {
5069
+ background: rgb(255, 245, 235);
5070
+ display: grid;
5071
+ grid-template-columns: 1fr;
5072
+ border: 1px solid rgba(0, 0, 0, 0.25);
5073
+ }
5074
+
5075
+ .setup-alg, twisty-alg-viewer {
5076
+ padding: 0.5em 1em;
5077
+ }
5078
+
5079
+ .heading {
5080
+ background: rgba(255, 230, 210, 1);
5081
+ font-weight: bold;
5082
+ padding: 0.25em 0.5em;
5083
+ }
5084
+
5085
+ twisty-player {
5086
+ width: 100%;
5087
+ resize: vertical;
5088
+ overflow-y: hidden;
5089
+ }
5090
+
5091
+ twisty-player + .heading {
5092
+ padding-top: 0.5em;
5093
+ }
5094
+ `);
5095
+
5096
+ // src/cubing/twisty/views/twizzle/url-params.ts
5097
+ function updateURL(url) {
5098
+ window.history.replaceState("", "", url.toString());
5099
+ }
5100
+ var _prefix;
5101
+ var URLParamUpdater = class {
5102
+ constructor(model, options) {
5103
+ __privateAdd(this, _prefix, void 0);
5104
+ __privateSet(this, _prefix, options?.prefix ?? "");
5105
+ this.listenToAlgProp(model.alg, "alg");
5106
+ this.listenToAlgProp(model.setupAlg, "setup-alg");
5107
+ this.listenToStringSourceProp(model.stickering, "stickering");
5108
+ this.listenToStringSourceProp(model.setupAnchor, "setup-anchor");
5109
+ this.listenToStringOrNoValueProp(model.puzzleIDRequest, "puzzle", NO_VALUE);
5110
+ this.listenToStringOrNoValueProp(model.puzzleDescriptionRequest, "puzzle-description", NO_VALUE);
5111
+ }
5112
+ setURLParam(unprefixedKey, value, defaultString) {
5113
+ const prefixedKey = __privateGet(this, _prefix) + unprefixedKey;
5114
+ const url = new URL(location.href);
5115
+ if (value === defaultString) {
5116
+ url.searchParams.delete(prefixedKey);
5117
+ } else {
5118
+ url.searchParams.set(prefixedKey, value);
5119
+ }
5120
+ updateURL(url);
5121
+ }
5122
+ async listenToStringSourceProp(prop, key, defaultString) {
5123
+ const actualDefaultString = defaultString ?? await prop.getDefaultValue();
5124
+ prop.addFreshListener((s) => {
5125
+ this.setURLParam(key, s, actualDefaultString);
5126
+ });
5127
+ }
5128
+ async listenToStringOrNoValueProp(prop, key, defaultString) {
5129
+ prop.addFreshListener((s) => {
5130
+ if (s === NO_VALUE) {
5131
+ s = defaultString;
5132
+ }
5133
+ if (s === NO_VALUE) {
5134
+ this.setURLParam(key, "", "");
5135
+ } else {
5136
+ this.setURLParam(key, s, "");
5137
+ }
5138
+ });
5139
+ }
5140
+ listenToAlgProp(prop, key) {
5141
+ prop.addFreshListener((algWithIssues) => {
5142
+ this.setURLParam(key, algWithIssues.alg.toString(), "");
5143
+ });
5144
+ }
5145
+ };
5146
+ _prefix = new WeakMap();
5147
+ function getConfigFromURL(prefix = "", url = location.href) {
5148
+ const paramMapping = {
5149
+ "alg": "alg",
5150
+ "setup-alg": "experimental-setup-alg",
5151
+ "setup-anchor": "experimental-setup-anchor",
5152
+ "puzzle": "puzzle",
5153
+ "stickering": "experimental-stickering",
5154
+ "puzzle-description": "experimental-puzzle-description"
5155
+ };
5156
+ const params = new URL(url).searchParams;
5157
+ const config = {};
5158
+ for (const [ourParam, twistyPlayerParam] of Object.entries(paramMapping)) {
5159
+ const paramValue = params.get(prefix + ourParam);
5160
+ if (paramValue !== null) {
5161
+ const configKey = twistyPlayerAttributeMap[twistyPlayerParam];
5162
+ config[configKey] = paramValue;
5163
+ }
5164
+ }
5165
+ return config;
5166
+ }
5167
+
5168
+ // src/cubing/twisty/views/twizzle/TwizzleLink.ts
5169
+ var _cssElem;
5170
+ var TwizzleLink = class extends ManagedCustomElement {
5171
+ constructor() {
5172
+ super({ mode: "open" });
5173
+ this.twistyPlayer = null;
5174
+ this.a = null;
5175
+ __privateAdd(this, _cssElem, void 0);
5176
+ }
5177
+ fallback() {
5178
+ this.contentWrapper.textContent = "";
5179
+ if (this.a) {
5180
+ const span = this.contentWrapper.appendChild(document.createElement("span"));
5181
+ span.textContent = "\u2757\uFE0F";
5182
+ span.title = "Could not show a player for link";
5183
+ this.addElement(this.a);
5184
+ }
5185
+ if (__privateGet(this, _cssElem)) {
5186
+ __privateGet(this, _cssElem).remove();
5187
+ }
5188
+ }
5189
+ async connectedCallback() {
5190
+ __privateSet(this, _cssElem, this.addCSS(twizzleLinkCSS));
5191
+ this.a = this.querySelector("a");
5192
+ if (!this.a) {
5193
+ return;
5194
+ }
5195
+ const config = getConfigFromURL("", this.a.href);
5196
+ const href = this.a?.href;
5197
+ const { hostname, pathname } = new URL(href);
5198
+ if (hostname !== "alpha.twizzle.net") {
5199
+ this.fallback();
5200
+ return;
5201
+ }
5202
+ if (["/edit/", "/explore/"].includes(pathname)) {
5203
+ const isExplorer = pathname === "/explore/";
5204
+ if (config.puzzle && !(config.puzzle in puzzles)) {
5205
+ const puzzleDescription = (await import("../puzzle-geometry/index.js")).getPuzzleDescriptionString(config.puzzle);
5206
+ delete config.puzzle;
5207
+ config.experimentalPuzzleDescription = puzzleDescription;
5208
+ }
5209
+ this.twistyPlayer = this.addElement(new TwistyPlayer({
5210
+ ...config,
5211
+ viewerLink: isExplorer ? "experimental-twizzle-explorer" : "auto"
5212
+ }));
5213
+ if (config.experimentalSetupAlg) {
5214
+ this.addHeading("Setup");
5215
+ const setupAlgDiv = this.addElement(document.createElement("div"));
5216
+ setupAlgDiv.classList.add("setup-alg");
5217
+ setupAlgDiv.textContent = new Alg(config.experimentalSetupAlg).toString();
5218
+ }
5219
+ this.addHeading("Moves");
5220
+ const twistyAlgViewer = this.addElement(new TwistyAlgViewer({ twistyPlayer: this.twistyPlayer }));
5221
+ twistyAlgViewer.part.add("twisty-alg-viewer");
5222
+ } else {
5223
+ this.fallback();
5224
+ }
5225
+ }
5226
+ addHeading(text) {
5227
+ const headingDiv = this.addElement(document.createElement("div"));
5228
+ headingDiv.classList.add("heading");
5229
+ headingDiv.textContent = text;
5230
+ }
5231
+ };
5232
+ _cssElem = new WeakMap();
5233
+ customElementsShim.define("twizzle-link", TwizzleLink);
5018
5234
  export {
5019
5235
  NO_VALUE as EXPERIMENTAL_PROP_NO_VALUE,
5020
5236
  KPuzzleSVGWrapper as ExperimentalKPuzzleSVGWrapper,
@@ -5023,6 +5239,7 @@ export {
5023
5239
  TwistyAlgEditor,
5024
5240
  TwistyAlgViewer,
5025
5241
  TwistyPlayer,
5242
+ TwizzleLink,
5026
5243
  backViewLayouts,
5027
5244
  debugShowRenderStats as experimentalDebugShowRenderStats,
5028
5245
  experimentalForceNewRendererSharing