@mborecki/crossword 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,11 +4,13 @@ import { Cell } from "./cell";
4
4
  import { indexFromXY, isInputEventLetter, Vec2fromIndex } from "../../utils/utils";
5
5
  import { Vec2 } from "@mb-puzzle/vec2";
6
6
  import { ClueList } from "./clue-list";
7
+ import Bowser from "bowser";
7
8
  export class MBCrossword {
8
9
  init = true;
9
10
  data;
10
11
  showCluePreview = true;
11
12
  clueListStyle = 'ol';
13
+ compareFunction = (a, b) => { return a === b; };
12
14
  clueSelected;
13
15
  textInput;
14
16
  hWords = [];
@@ -17,11 +19,20 @@ export class MBCrossword {
17
19
  currentClue = null;
18
20
  isFocused = false;
19
21
  selectedCell = null;
22
+ bowserParser = Bowser.getParser(typeof window !== 'undefined' ? window.navigator.userAgent : 'unknown');
23
+ abortController = new AbortController();
20
24
  componentWillLoad() {
21
- console.log('componentWillLoad', this.init, this.data);
22
25
  if (this.init && this.data) {
23
26
  this.initGame();
24
27
  }
28
+ if (this.useStickyBottomHack && typeof window !== 'undefined' && window.visualViewport) {
29
+ window.visualViewport.addEventListener('resize', this.updateFloatingPreview.bind(this), { signal: this.abortController.signal });
30
+ window.visualViewport.addEventListener('scroll', this.updateFloatingPreview.bind(this), { signal: this.abortController.signal });
31
+ this.updateFloatingPreview();
32
+ }
33
+ }
34
+ disconnectedCallback() {
35
+ this.abortController.abort();
25
36
  }
26
37
  watchData() {
27
38
  if (this.init && this.data) {
@@ -35,7 +46,6 @@ export class MBCrossword {
35
46
  ];
36
47
  }
37
48
  async initGame(data = this.data) {
38
- console.log('initGame');
39
49
  if (!data.words) {
40
50
  throw new Error('Words definition missing');
41
51
  }
@@ -60,11 +70,7 @@ export class MBCrossword {
60
70
  }
61
71
  async checkAnswer() {
62
72
  const cells = this.cells.filter(c => !c.isBlocked);
63
- console.log(cells);
64
- cells.forEach(c => {
65
- console.log(`${c.value} === ${c.answer}`, `${c.x},${c.y}`, c.value === c.answer);
66
- });
67
- return cells.every(c => c.value === c.answer);
73
+ return cells.every(c => this.compareFunction(c.value, c.answer));
68
74
  }
69
75
  specialBorders = [];
70
76
  specialCells = [];
@@ -72,6 +78,20 @@ export class MBCrossword {
72
78
  boardWidth = 0;
73
79
  boardHeight = 0;
74
80
  cells = [];
81
+ useStickyBottomHack = this.bowserParser.isOS('ios');
82
+ floatingPreviewHackParams = {
83
+ height: 0,
84
+ offsetTop: 0
85
+ };
86
+ updateFloatingPreview(_event) {
87
+ if (window.visualViewport) {
88
+ this.floatingPreviewHackParams = {
89
+ ...this.floatingPreviewHackParams,
90
+ height: window.visualViewport.height,
91
+ offsetTop: window.visualViewport.offsetTop
92
+ };
93
+ }
94
+ }
75
95
  buildBoard() {
76
96
  let boardWidth = 0;
77
97
  let boardHeight = 0;
@@ -234,37 +254,72 @@ export class MBCrossword {
234
254
  }
235
255
  onFocusin() {
236
256
  this.isFocused = true;
237
- if (!this.currentClueId) {
238
- this.currentClueId = this.allWords[0]?.id ?? null;
239
- }
240
- this.textInput.focus();
257
+ // if (!this.currentClueId) {
258
+ // this.currentClueId = this.allWords[0]?.id ?? null;
259
+ // }
260
+ // this.textInput.focus();
241
261
  }
242
262
  onFocusOut() {
243
263
  this.isFocused = false;
244
264
  }
245
- async selectClue(id, { row, col } = {}) {
265
+ async selectClue(id, cell = null) {
246
266
  if (!id)
247
267
  return;
248
- this.currentClueId = id;
249
- const clue = this.allWords.find(w => w.id === id);
268
+ const clue = this.getClueById(id);
250
269
  if (!clue) {
251
270
  this.currentClueId = null;
252
271
  this.currentClue = null;
272
+ return;
253
273
  }
274
+ this.currentClueId = id;
254
275
  this.currentClue = clue;
255
276
  const selectCell = [clue.x, clue.y];
256
- if (typeof row !== 'undefined' && clue.orientation === 'vertical') {
257
- if (row >= clue.y && row < clue.y + clue.word.length) {
258
- selectCell[1] = row;
277
+ if (cell && clue.orientation === 'vertical') {
278
+ if (cell.y >= clue.y && cell.y < clue.y + clue.word.length) {
279
+ selectCell[1] = cell.y;
259
280
  }
260
281
  }
261
- if (typeof col !== 'undefined' && clue.orientation === 'horizontal') {
262
- if (col >= clue.x && col < clue.x + clue.word.length) {
263
- selectCell[0] = col;
282
+ if (cell && clue.orientation === 'horizontal') {
283
+ if (cell.x >= clue.x && cell.x < clue.x + clue.word.length) {
284
+ selectCell[0] = cell.x;
264
285
  }
265
286
  }
266
287
  this.selectCellByXY(Vec2.from(selectCell));
267
288
  }
289
+ selectClueFromCell(cell) {
290
+ const clue = this.getClueByXV(cell);
291
+ if (!clue)
292
+ return;
293
+ const preview = this.getCluePreview(clue);
294
+ console.log('selectClueFromCell', cell, clue, preview);
295
+ if (preview.replaceAll('_', '').length === 0) {
296
+ this.selectClue(clue.id, Vec2.from(clue));
297
+ }
298
+ else {
299
+ this.selectClue(clue.id, cell);
300
+ }
301
+ }
302
+ selectClueByXY(v) {
303
+ const clue = this.getClueByXV(v);
304
+ if (!clue)
305
+ return;
306
+ this.selectClue(clue.id, v);
307
+ }
308
+ getClueByXV(v) {
309
+ const clues = this.allWords.filter(w => this.isInClue(v, w));
310
+ console.log('getClueXY', clues);
311
+ if (!clues.length) {
312
+ return;
313
+ }
314
+ if (this.selectedCell && clues.length === 2 && v.eq(Vec2.from(this.selectedCell))) {
315
+ const betterClue = clues.find(c => c.orientation !== this.currentClue?.orientation);
316
+ return betterClue ?? clues[0];
317
+ }
318
+ else {
319
+ const betterClue = clues.find(c => c.orientation === this.currentClue?.orientation);
320
+ return betterClue ?? clues[0];
321
+ }
322
+ }
268
323
  selectCellByXY(v) {
269
324
  const selectCellIndex = indexFromXY(v, this.boardWidth);
270
325
  this.selectedCell = this.cells[selectCellIndex] ?? null;
@@ -296,20 +351,6 @@ export class MBCrossword {
296
351
  const cell = this.cells[indexFromXY(v, this.boardWidth)];
297
352
  return cell?.isBlocked ?? true;
298
353
  }
299
- selectClueByXY(v) {
300
- const clues = this.allWords.filter(w => this.isInClue(v, w));
301
- if (!clues.length) {
302
- return;
303
- }
304
- if (this.selectedCell && clues.length === 2 && v.eq(Vec2.from(this.selectedCell))) {
305
- const betterClue = clues.find(c => c.orientation !== this.currentClue?.orientation);
306
- this.selectClue(betterClue?.id ?? clues[0].id, { row: v.y, col: v.x });
307
- }
308
- else {
309
- const betterClue = clues.find(c => c.orientation === this.currentClue?.orientation);
310
- this.selectClue(betterClue?.id ?? clues[0].id, { row: v.y, col: v.x });
311
- }
312
- }
313
354
  getCluePreview(clue) {
314
355
  if (!clue)
315
356
  return '_';
@@ -367,10 +408,15 @@ export class MBCrossword {
367
408
  const hasHWords = Boolean(this.hWords.length);
368
409
  const hideList = this.clueListStyle === 'none';
369
410
  const twoLists = hasHWords && hasVWords;
370
- return h("div", { key: '0aa26f6435a57c206eba0d518313d6248d922eaa', part: "main", class: {
411
+ const showFloatingClue = this.isFocused && this.currentClue && this.bowserParser.isPlatform('mobile');
412
+ return h("div", { key: '6fed5a87911f7be97155b1f0f854266ffc618f7d', part: "main", class: {
371
413
  "--focused": this.isFocused,
372
- "--only-board": hideList
373
- }, onFocusin: this.onFocusin.bind(this), onFocusout: this.onFocusOut.bind(this) }, h("input", { key: 'e15789ff3feb48df30117b501b440142ba3eccf7', type: "text", class: "dummy", ref: (el) => this.textInput = el, onKeyDown: this.onKeyPress.bind(this), onInput: this.onInput.bind(this) }), hideList ? '' : h("div", { part: "clues", class: {
414
+ "--only-board": hideList,
415
+ "--sticky-bottom-hack": this.useStickyBottomHack
416
+ }, onFocusin: this.onFocusin.bind(this), onFocusout: this.onFocusOut.bind(this), onClick: () => {
417
+ this.textInput.blur();
418
+ this.textInput.focus();
419
+ } }, h("input", { key: 'bffd1c704603b35b54f59c35092edb984a7adccb', type: "text", class: "dummy", ref: (el) => this.textInput = el, onKeyDown: this.onKeyPress.bind(this), onInput: this.onInput.bind(this) }), hideList ? '' : h("div", { part: "clues", class: {
374
420
  twoLists,
375
421
  oneList: !twoLists
376
422
  } }, hasHWords ? h(ClueList, { type: this.clueListStyle }, this.hWords.map(w => {
@@ -379,7 +425,7 @@ export class MBCrossword {
379
425
  })) : '', hasVWords ? h(ClueList, { type: this.clueListStyle }, this.vWords.map(w => {
380
426
  const isCurrent = w.id === this.currentClueId;
381
427
  return h(Clue, { showPreview: this.showCluePreview, preview: this.getCluePreview(w), word: w, isCurrent: isCurrent, onPointerDown: () => this.selectClue(w.id), tagName: this.clueListStyle === 'ol' ? 'li' : undefined });
382
- })) : ''), h("div", { key: '08ffd76832a1c9c9dfddf8424e9e014d104444a0', part: "board", style: {
428
+ })) : ''), h("div", { key: '9842d788d6e6a8df712c025474303ad0b0cf4f4b', part: "board", style: {
383
429
  '--board-width': `${this.boardWidth}`,
384
430
  'grid-template-columns': `repeat(${this.boardWidth}, 1fr)`,
385
431
  aspectRatio: `${this.boardWidth / this.boardHeight}`
@@ -387,7 +433,7 @@ export class MBCrossword {
387
433
  const isInCurrentClue = this.isInClue(cell);
388
434
  const isSelected = this.isSelectedCell(cell);
389
435
  const isSpecial = this.specialCells.some(c => c.x === cell.x && c.y === cell.y);
390
- return h(Cell, { isSpecial: isSpecial, onPointerDown: () => this.selectClueByXY(Vec2.from(cell)), isInCurrentClue: isInCurrentClue, isSelected: isSelected, data: cell });
436
+ return h(Cell, { isSpecial: isSpecial, onPointerDown: () => this.selectClueFromCell(Vec2.from(cell)), isInCurrentClue: isInCurrentClue, isSelected: isSelected, data: cell });
391
437
  }), this.specialBorders.map((b, index) => {
392
438
  return h("div", { key: index, part: "special-border", class: {
393
439
  'top': Boolean(b.border & 0x1000),
@@ -403,7 +449,12 @@ export class MBCrossword {
403
449
  "--x": `${label.x}`,
404
450
  "--y": `${label.y}`
405
451
  }, onPointerDown: () => this.selectClue(label.clueId) }, h("div", { class: "_inner" }, label.text));
406
- })));
452
+ })), showFloatingClue ? h("div", { part: "floating-clue", style: {
453
+ "--height": `${this.floatingPreviewHackParams.height}px`,
454
+ "--offsetTop": `${this.floatingPreviewHackParams.offsetTop}px`
455
+ } }, h("div", { class: "floating-clue__preview" }, Array.from(this.getCluePreview(this.currentClue)).map((c, index) => {
456
+ return h("span", { key: index }, c);
457
+ })), h("div", { class: "floating-clue__text" }, this.currentClue?.clue ?? '')) : '');
407
458
  }
408
459
  static get is() { return "mb-crossword"; }
409
460
  static get encapsulation() { return "shadow"; }
@@ -503,6 +554,24 @@ export class MBCrossword {
503
554
  "reflect": false,
504
555
  "attribute": "clue-list-style",
505
556
  "defaultValue": "'ol'"
557
+ },
558
+ "compareFunction": {
559
+ "type": "unknown",
560
+ "mutable": false,
561
+ "complexType": {
562
+ "original": "(a: string, b: string) => boolean",
563
+ "resolved": "(a: string, b: string) => boolean",
564
+ "references": {}
565
+ },
566
+ "required": false,
567
+ "optional": false,
568
+ "docs": {
569
+ "tags": [],
570
+ "text": ""
571
+ },
572
+ "getter": false,
573
+ "setter": false,
574
+ "defaultValue": "(a,b) => {return a === b}"
506
575
  }
507
576
  };
508
577
  }
@@ -519,7 +588,8 @@ export class MBCrossword {
519
588
  "labels": {},
520
589
  "boardWidth": {},
521
590
  "boardHeight": {},
522
- "cells": {}
591
+ "cells": {},
592
+ "floatingPreviewHackParams": {}
523
593
  };
524
594
  }
525
595
  static get events() {
@@ -588,20 +658,26 @@ export class MBCrossword {
588
658
  },
589
659
  "selectClue": {
590
660
  "complexType": {
591
- "signature": "(id: string, { row, col }?: { row?: number; col?: number; }) => Promise<void>",
661
+ "signature": "(id: string, cell?: Vec2 | null) => Promise<void>",
592
662
  "parameters": [{
593
663
  "name": "id",
594
664
  "type": "string",
595
665
  "docs": ""
596
666
  }, {
597
- "name": "__1",
598
- "type": "{ row?: number; col?: number; }",
667
+ "name": "cell",
668
+ "type": "Vec2",
599
669
  "docs": ""
600
670
  }],
601
671
  "references": {
602
672
  "Promise": {
603
673
  "location": "global",
604
674
  "id": "global::Promise"
675
+ },
676
+ "Vec2": {
677
+ "location": "import",
678
+ "path": "@mb-puzzle/vec2",
679
+ "id": "../../shared/vec2/src/vec2.ts::Vec2",
680
+ "referenceLocation": "Vec2"
605
681
  }
606
682
  },
607
683
  "return": "Promise<void>"
@@ -1 +1 @@
1
- import{h as t,t as e,p as i,H as r,c as s,Vec2fromIndex as l,V as a,f as o,isInputEventLetter as n,indexFromXY as c}from"./index.js";function h({isCurrent:e,word:i,onPointerDown:r,preview:s,showPreview:l,tagName:a}){return t(a??"div",{onPointerDown:r,part:"clue",class:{"--current":e}},i.clue,l&&t("span",{class:"preview"},s))}function d({data:e,isInCurrentClue:i,isSelected:r,isSpecial:s,onPointerDown:l}){return t("div",{onPointerDown:l,part:"cell",class:{"--blocked":e.isBlocked,"--in-current-clue":i,"--selected":r,"--alt":!((e.x+e.y)%2),"--special":s},style:{"--x":""+e.x,"--y":""+e.y}},t("div",{class:"_inner",style:{position:"absolute",width:"100%"}},e.value))}const u=({type:e},i)=>"p"===e?t("p",{part:"clue-list"},i.map(((e,i)=>t("p",{key:i},e)))):"ol"===e?t("ol",{part:"clue-list"},i):void 0,p=i(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.clueSelected=s(this,"clueSelected")}init=!0;data;showCluePreview=!0;clueListStyle="ol";clueSelected;textInput;hWords=[];vWords=[];currentClueId=null;currentClue=null;isFocused=!1;selectedCell=null;componentWillLoad(){console.log("componentWillLoad",this.init,this.data),this.init&&this.data&&this.initGame()}watchData(){this.init&&this.data&&this.initGame()}get allWords(){return[...this.hWords,...this.vWords]}async initGame(t=this.data){if(console.log("initGame"),!t.words)throw Error("Words definition missing");this.hWords=[],this.vWords=[],t.words.forEach(((t,e)=>{const i=Math.random();void 0===t.id&&(t.id=`${i}_${e}`),"horizontal"===t.orientation&&(this.hWords=[...this.hWords,t]),"vertical"===t.orientation&&(this.vWords=[...this.vWords,t])})),this.specialBorders=t.specialBorders??[],this.specialCells=t.specialCells??[],this.labels=t.labels??[],this.buildBoard()}async checkAnswer(){const t=this.cells.filter((t=>!t.isBlocked));return console.log(t),t.forEach((t=>{console.log(`${t.value} === ${t.answer}`,`${t.x},${t.y}`,t.value===t.answer)})),t.every((t=>t.value===t.answer))}specialBorders=[];specialCells=[];labels=[];boardWidth=0;boardHeight=0;cells=[];buildBoard(){let t=0,e=0;this.allWords.forEach((i=>{"horizontal"===i.orientation&&(t=Math.max(t,i.x+i.word.length),e=Math.max(e,i.y+1)),"vertical"===i.orientation&&(t=Math.max(t,i.x+1),e=Math.max(e,i.y+i.word.length))}));const i=Array(e*t).fill(null).map(((e,i)=>{const[r,s]=l(i,t);return{index:i,x:r,y:s,value:null,isCurrent:!1,isInCurrentWord:!1,isBlocked:!0}}));this.allWords.forEach((e=>{if("horizontal"===e.orientation)for(let r=0;r<e.word.length;r++){const s=a.from(e),l=c(new a(s.x+r,s.y),t);i[l].isBlocked=!1,i[l].answer=e.word[r]}if("vertical"===e.orientation)for(let r=0;r<e.word.length;r++){const s=a.from(e),l=c(new a(s.x,s.y+r),t);i[l].isBlocked=!1,i[l].answer=e.word[r]}})),this.cells=i,this.boardWidth=t,this.boardHeight=e}getClueById(t){return this.allWords.find((e=>e.id===t))??null}isInClue(t,e=this.currentClue){return null!==e&&(t.x===e.x||t.y===e.y)&&("horizontal"===e.orientation?!(t.y!==e.y||t.x<e.x||t.x>=e.x+e.word.length):"vertical"===e.orientation?!(t.x!==e.x||t.y<e.y||t.y>=e.y+e.word.length):void 0)}isSelectedCell(t){return!!this.selectedCell&&t.x===this.selectedCell.x&&t.y===this.selectedCell.y}getNextClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const t=this.allWords.findIndex((t=>t.id===this.currentClueId));return t<0?this.allWords[0]?.id??null:this.allWords[t+1]?.id??null}getPrevClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const t=this.allWords.findIndex((t=>t.id===this.currentClueId));return t<0?this.allWords[0]?.id??null:this.allWords[t-1]?.id??null}inputLetter(t){this.selectedCell&&(this.selectedCell.value=t,this.selectNextCell(),o(this))}backspace(){this.selectedCell&&(this.selectedCell.value?(this.selectedCell.value="",this.selectPrevCell()):(this.selectPrevCell(),this.selectedCell.value=""),o(this))}selectNextCell(){if(!this.selectedCell||!this.currentClue)return;const t=this.currentClue.orientation;if(function(t,e){return v(t).eq(a.from(e))}(this.currentClue,this.selectedCell)){const t=this.getNextClueId(),e=this.getClueById(t);return e?void this.selectClueByXY(a.from(e)):void 0}"horizontal"===t&&this.selectClueByXY(new a(this.selectedCell.x+1,this.selectedCell.y)),"vertical"===t&&this.selectClueByXY(new a(this.selectedCell.x,this.selectedCell.y+1))}selectPrevCell(){if(!this.selectedCell||!this.currentClue)return;const t=this.currentClue.orientation;if(function(t,e){return a.from(t).eq(a.from(e))}(this.currentClue,this.selectedCell)){const t=this.getPrevClueId(),e=this.getClueById(t);if(e){const t=v(e);return console.log(t),void this.selectClueByXY(t)}}"horizontal"===t&&this.selectClueByXY(new a(this.selectedCell.x-1,this.selectedCell.y)),"vertical"===t&&this.selectClueByXY(new a(this.selectedCell.x,this.selectedCell.y-1))}onFocusin(){this.isFocused=!0,this.currentClueId||(this.currentClueId=this.allWords[0]?.id??null),this.textInput.focus()}onFocusOut(){this.isFocused=!1}async selectClue(t,{row:e,col:i}={}){if(!t)return;this.currentClueId=t;const r=this.allWords.find((e=>e.id===t));r||(this.currentClueId=null,this.currentClue=null),this.currentClue=r;const s=[r.x,r.y];void 0!==e&&"vertical"===r.orientation&&e>=r.y&&e<r.y+r.word.length&&(s[1]=e),void 0!==i&&"horizontal"===r.orientation&&i>=r.x&&i<r.x+r.word.length&&(s[0]=i),this.selectCellByXY(a.from(s))}selectCellByXY(t){const e=c(t,this.boardWidth);this.selectedCell=this.cells[e]??null}findNonblockedCell(t,e){const i=new a(t[0]+e[0],t[1]+e[1]),r=this.boardWidth*this.boardHeight;let s=0;for(;this.isCellBlocked(i)&&s<r;)s++,i[0]+=e[0],i[1]+=e[1],i[0]<0&&(i[0]=this.boardWidth-1),i[0]>=this.boardWidth&&(i[0]=0),i[1]<0&&(i[1]=this.boardHeight-1),i[1]>=this.boardHeight&&(i[1]=0);return i}isCellBlocked(t){const e=this.cells[c(t,this.boardWidth)];return e?.isBlocked??!0}selectClueByXY(t){const e=this.allWords.filter((e=>this.isInClue(t,e)));if(e.length)if(this.selectedCell&&2===e.length&&t.eq(a.from(this.selectedCell))){const i=e.find((t=>t.orientation!==this.currentClue?.orientation));this.selectClue(i?.id??e[0].id,{row:t.y,col:t.x})}else{const i=e.find((t=>t.orientation===this.currentClue?.orientation));this.selectClue(i?.id??e[0].id,{row:t.y,col:t.x})}}getCluePreview(t){if(!t)return"_";const e=Array(t.word.length).fill("_");for(let i=0;i<t.word.length;i++){const r=new a(t.x,t.y).add("vertical"===t.orientation?new a(0,1*i):new a(1*i,0)),s=this.cells[c(r,this.boardWidth)];s.value&&(e[i]=s.value)}return e.join("")}onKeyPress(t){if(console.log(t),"Tab"===t.key){const e=t.shiftKey?this.getPrevClueId():this.getNextClueId();e&&(t.preventDefault(),this.selectClue(e))}if(this.selectedCell)switch(t.key){case"ArrowLeft":return this.selectClueByXY(this.findNonblockedCell(new a(this.selectedCell.x,this.selectedCell.y),new a(-1,0))),void t.preventDefault();case"ArrowRight":return this.selectClueByXY(this.findNonblockedCell(new a(this.selectedCell.x,this.selectedCell.y),new a(1,0))),void t.preventDefault();case"ArrowUp":return this.selectClueByXY(this.findNonblockedCell(new a(this.selectedCell.x,this.selectedCell.y),new a(0,-1))),void t.preventDefault();case"ArrowDown":return this.selectClueByXY(this.findNonblockedCell(new a(this.selectedCell.x,this.selectedCell.y),new a(0,1))),void t.preventDefault();case"Backspace":console.log("BACKSPACE!"),this.backspace()}}onInput(t){n(t)&&this.inputLetter(t.data.toLowerCase()[0]),this.textInput.value=""}render(){const e=!!this.vWords.length,i=!!this.hWords.length,r="none"===this.clueListStyle,s=i&&e;return t("div",{key:"0aa26f6435a57c206eba0d518313d6248d922eaa",part:"main",class:{"--focused":this.isFocused,"--only-board":r},onFocusin:this.onFocusin.bind(this),onFocusout:this.onFocusOut.bind(this)},t("input",{key:"e15789ff3feb48df30117b501b440142ba3eccf7",type:"text",class:"dummy",ref:t=>this.textInput=t,onKeyDown:this.onKeyPress.bind(this),onInput:this.onInput.bind(this)}),r?"":t("div",{part:"clues",class:{twoLists:s,oneList:!s}},i?t(u,{type:this.clueListStyle},this.hWords.map((e=>{const i=e.id===this.currentClueId;return t(h,{showPreview:this.showCluePreview,preview:this.getCluePreview(e),word:e,isCurrent:i,onPointerDown:()=>this.selectClue(e.id),tagName:"ol"===this.clueListStyle?"li":void 0})}))):"",e?t(u,{type:this.clueListStyle},this.vWords.map((e=>{const i=e.id===this.currentClueId;return t(h,{showPreview:this.showCluePreview,preview:this.getCluePreview(e),word:e,isCurrent:i,onPointerDown:()=>this.selectClue(e.id),tagName:"ol"===this.clueListStyle?"li":void 0})}))):""),t("div",{key:"08ffd76832a1c9c9dfddf8424e9e014d104444a0",part:"board",style:{"--board-width":""+this.boardWidth,"grid-template-columns":`repeat(${this.boardWidth}, 1fr)`,aspectRatio:""+this.boardWidth/this.boardHeight}},this.cells.filter((t=>!t.isBlocked)).map((e=>{const i=this.isInClue(e),r=this.isSelectedCell(e),s=this.specialCells.some((t=>t.x===e.x&&t.y===e.y));return t(d,{isSpecial:s,onPointerDown:()=>this.selectClueByXY(a.from(e)),isInCurrentClue:i,isSelected:r,data:e})})),this.specialBorders.map(((e,i)=>t("div",{key:i,part:"special-border",class:{top:!!(4096&e.border),right:!!(256&e.border),bottom:!!(16&e.border),left:!!(1&e.border)},style:{"--x":""+e.x,"--y":""+e.y}}))),this.labels.map((e=>t("div",{part:"label",style:{"--x":""+e.x,"--y":""+e.y},onPointerDown:()=>this.selectClue(e.clueId)},t("div",{class:"_inner"},e.text))))))}static get delegatesFocus(){return!0}static get watchers(){return{data:[{watchData:0}]}}static get style(){return'*[part=main]{position:relative;display:grid;grid-template-areas:"board" "clues";grid-template-columns:1fr}@media (min-width: 768px){*[part=main]{grid-template-areas:"clues board" "clues .";grid-template-columns:1fr 1fr}*[part=main].--only-board{grid-template-columns:1fr;grid-template-areas:"board"}}*[part=main].--focused{background:lightgrey}*[part=main] input.dummy{pointer-events:none;opacity:0.2;z-index:100;grid-area:board;border:none;outline:none}[part=clues]{grid-area:clues;display:grid;grid-template-columns:1fr 1fr;gap:16px}[part=clues].oneList{grid-template-columns:1fr}[part=clue-list]{margin:0;padding:0}[part=clue].--current{background:var(--clue-current-background, lightcyan);position:sticky;bottom:0;left:0;right:0}[part=clue] .preview{font-weight:bold;letter-spacing:0.2em;text-align:center;display:block;text-transform:uppercase}li[part=clue]{--_clue-padding:var(--clue-padding, .5em);border-radius:var(--clue-radius, 0.5em);padding:var(--_clue-padding);list-style-position:inside;padding-left:calc(1em + var(--_clue-padding));text-indent:-1em;margin:0}[part=board]{grid-area:board;display:block;position:relative;container-type:size;background:var(--board-background, darkgoldenrod);--_cell-border-width:var(--cell-border-width, 2px);--cell-width-temp:calc((100cqw - var(--_cell-border-width)) / var(--board-width, 10));--cell-width:var(--cell-width-temp);--cell-width:round(var(--cell-width-temp), 1px)}[part=cell]{display:block;color:var(--cell-color, #11138d);width:calc(var(--cell-width) - var(--_cell-border-width));aspect-ratio:1;background:var(--cell-background, #d9d9d9);position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));border:var(--_cell-border-width) solid var(--cell-border-color, red)}[part=cell].--alt{background:var(--cell-background-alt, #999)}[part=cell].--in-current-clue{box-shadow:inset 0 0 2px 2px var(--cell-selected-background, lightblue)}[part=cell].--selected{background:var(--cell-selected-background, lightblue)}[part=cell].--special{background:var(--cell-special-background, lightgreen)}[part=cell].--special.--selected:before{content:"";background:var(--cell-selected-background, lightblue);position:absolute;top:0;left:0;right:0;bottom:0;clip-path:polygon(100% 0, 100% 100%, 50% 100%)}[part=cell] ._inner{position:absolute;top:0;left:0;right:0;bottom:0;display:grid;place-content:center;text-transform:uppercase;font-size:80cqh}[part=preview]{display:none}[part=special-border]{display:block;background:black;position:absolute;z-index:100;--s-border:max(2px, var(--_cell-border-width))}[part=special-border].left,[part=special-border].right{width:var(--s-border);height:calc(var(--cell-width) - var(--_cell-border-width));top:calc(var(--y, 0) * var(--cell-width) + var(--_cell-border-width))}[part=special-border].left{left:calc(var(--x, 0) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].right{left:calc((var(--x, 0) + 1) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].top,[part=special-border].bottom{width:calc(var(--cell-width) - var(--_cell-border-width));height:var(--s-border);left:calc(var(--x, 0) * var(--cell-width) + var(--_cell-border-width))}[part=special-border].top{top:calc(var(--y, 0) * var(--cell-width))}[part=special-border].bottom{top:calc((var(--y, 0) + 1) * var(--cell-width))}[part=label]{display:grid;position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));width:calc(var(--cell-width) - var(--_cell-border-width));aspect-ratio:1;border:var(--_cell-border-width) solid transparent;--label-place-content:center end}[part=label] ._inner{position:absolute;top:var(--label-padding, 10cqh);left:var(--label-padding, 10cqh);right:var(--label-padding, 10cqh);bottom:var(--label-padding, 10cqh);display:grid;place-content:var(--label-place-content, center);text-transform:uppercase;font-size:var(--label-font-size, 60cqh)}'}},[529,"mb-crossword",{init:[4],data:[16],showCluePreview:[4,"show-clue-preview"],clueListStyle:[1,"clue-list-style"],hWords:[32],vWords:[32],currentClueId:[32],currentClue:[32],isFocused:[32],selectedCell:[32],specialBorders:[32],specialCells:[32],labels:[32],boardWidth:[32],boardHeight:[32],cells:[32],initGame:[64],checkAnswer:[64],selectClue:[64]},void 0,{data:[{watchData:0}]}]);function v(t){return new a(t.x+("horizontal"===t.orientation?t.word.length-1:0),t.y+("vertical"===t.orientation?t.word.length-1:0))}function b(){"undefined"!=typeof customElements&&["mb-crossword"].forEach((t=>{"mb-crossword"===t&&(customElements.get(e(t))||customElements.define(e(t),p))}))}b();const w=p,g=b;export{w as MbCrossword,g as defineCustomElement}
1
+ import{h as e,t,p as r,H as i,c as n,Vec2fromIndex as o,V as a,f as s,isInputEventLetter as c,indexFromXY as u}from"./index.js";function d({isCurrent:t,word:r,onPointerDown:i,preview:n,showPreview:o,tagName:a}){return e(a??"div",{role:"button",onPointerDown:i,part:"clue",class:{"--current":t}},r.clue,o&&e("span",{class:"preview"},n))}function l({data:t,isInCurrentClue:r,isSelected:i,isSpecial:n,onPointerDown:o}){return e("div",{onPointerDown:o,part:"cell",class:{"--blocked":t.isBlocked,"--in-current-clue":r,"--selected":i,"--alt":!((t.x+t.y)%2),"--special":n},style:{"--x":""+t.x,"--y":""+t.y}},e("div",{class:"_inner",style:{position:"absolute",width:"100%"}},t.value))}const h=({type:t},r)=>"p"===t?e("p",{part:"clue-list"},r.map(((t,r)=>e("p",{key:r},t)))):"ol"===t?e("ol",{part:"clue-list"},r):void 0;function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var b,p={exports:{}},v=f((b||(b=1,p.exports=function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){t.__esModule=!0,t.default=void 0;var i=r(18),n=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));t.push(0);var r=t[0];if(10===r)switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(r){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,i){void 0===i&&(i=!1);var n=e.getVersionPrecision(t),o=e.getVersionPrecision(r),a=Math.max(n,o),s=0,c=e.map([t,r],(function(t){var r=a-e.getVersionPrecision(t),i=t+Array(r+1).join(".0");return e.map(i.split("."),(function(e){return Array(20-e.length).join("0")+e})).reverse()}));for(i&&(s=a-Math.min(n,o)),a-=1;a>=s;){if(c[0][a]>c[1][a])return 1;if(c[0][a]===c[1][a]){if(a===s)return 0;a-=1}else if(c[0][a]<c[1][a])return-1}},e.map=function(e,t){var r,i=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)i.push(t(e[r]));return i},e.find=function(e,t){var r,i;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,i=e.length;r<i;r+=1){var n=e[r];if(t(n,r))return n}},e.assign=function(e){for(var t,r,i=e,n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var s=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){i[t]=e[t]}))};for(t=0,r=o.length;t<r;t+=1)s();return e},e.getBrowserAlias=function(e){return i.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return i.BROWSER_MAP[e]||""},e}();t.default=n,e.exports=t.default},18:function(e,t){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},t.BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},t.PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},t.OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},t.ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"}},90:function(e,t,r){t.__esModule=!0,t.default=void 0;var i,n=(i=r(91))&&i.__esModule?i:{default:i},o=r(18);function a(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var s=function(){function e(){}var t,r;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw Error("UserAgent should be a string");return new n.default(e,t)},e.parse=function(e){return new n.default(e).getResult()},t=e,r=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],null&&a(t.prototype,null),r&&a(t,r),e}();t.default=s,e.exports=t.default},91:function(e,t,r){t.__esModule=!0,t.default=void 0;var i=c(r(92)),n=c(r(93)),o=c(r(94)),a=c(r(95)),s=c(r(17));function c(e){return e&&e.__esModule?e:{default:e}}var u=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?(this.getBrowser().name+"").toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?(t+"").toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?(t+"").toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?(this.getEngine().name+"").toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},i=0,n={},o=0;if(Object.keys(e).forEach((function(t){var a=e[t];"string"==typeof a?(n[t]=a,o+=1):"object"==typeof a&&(r[t]=a,i+=1)})),i>0){var a=Object.keys(r),c=s.default.find(a,(function(e){return t.isOS(e)}));if(c){var u=this.satisfies(r[c]);if(void 0!==u)return u}var d=s.default.find(a,(function(e){return t.isPlatform(e)}));if(d){var l=this.satisfies(r[d]);if(void 0!==l)return l}}if(o>0){var h=s.default.find(Object.keys(n),(function(e){return t.isBrowser(e,!0)}));if(void 0!==h)return this.compareVersion(n[h])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),i=e.toLowerCase(),n=s.default.getBrowserTypeByAlias(i);return t&&n&&(i=n.toLowerCase()),i===r},t.compareVersion=function(e){var t=[0],r=e,i=!1,n=this.getBrowserVersion();if("string"==typeof n)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(i=!0,r=e.substr(2)):t=[],t.push(">"===e[0]?1:-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(i=!0,r=e.substr(1)),t.indexOf(s.default.compareVersions(n,r,i))>-1},t.isOS=function(e){return this.getOSName(!0)===(e+"").toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===(e+"").toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===(e+"").toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=u,e.exports=t.default},92:function(e,t,r){t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},o=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/gptbot/i],describe:function(e){var t={name:"GPTBot"},r=n.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/chatgpt-user/i],describe:function(e){var t={name:"ChatGPT-User"},r=n.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/oai-searchbot/i],describe:function(e){var t={name:"OAI-SearchBot"},r=n.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(e){var t={name:"ClaudeBot"},r=n.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(e){var t={name:"Omgilibot"},r=n.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/diffbot/i],describe:function(e){var t={name:"Diffbot"},r=n.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/perplexitybot/i],describe:function(e){var t={name:"PerplexityBot"},r=n.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/perplexity-user/i],describe:function(e){var t={name:"Perplexity-User"},r=n.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/youbot/i],describe:function(e){var t={name:"YouBot"},r=n.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/meta-webindexer/i],describe:function(e){var t={name:"Meta-WebIndexer"},r=n.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/meta-externalads/i],describe:function(e){var t={name:"Meta-ExternalAds"},r=n.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/meta-externalagent/i],describe:function(e){var t={name:"Meta-ExternalAgent"},r=n.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/meta-externalfetcher/i],describe:function(e){var t={name:"Meta-ExternalFetcher"},r=n.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=n.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/amazonbot/i],describe:function(e){var t={name:"AmazonBot"},r=n.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/bingbot/i],describe:function(e){var t={name:"BingCrawler"},r=n.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/baiduspider/i],describe:function(e){var t={name:"BaiduSpider"},r=n.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/duckduckbot/i],describe:function(e){var t={name:"DuckDuckBot"},r=n.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/ia_archiver/i],describe:function(e){var t={name:"InternetArchiveCrawler"},r=n.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return{name:"PingdomBot"}}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=n.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/PaleMoon/i],describe:function(e){var t={name:"Pale Moon"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=n.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=n.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=n.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=n.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=n.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=n.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=n.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=n.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=n.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=n.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=n.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=n.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=n.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=n.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=n.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=n.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=n.default.getFirstMatch(o,e)||n.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=n.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=n.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=n.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/librewolf/i],describe:function(e){var t={name:"LibreWolf"},r=n.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=n.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=n.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(e){var t={name:"Sogou Browser"},r=n.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),i=n.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),o=n.default.getFirstMatch(/se ([\d.]+)x/i,e),a=r||i||o;return a&&(t.version=a),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=n.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=n.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=n.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=n.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=n.default.getFirstMatch(o,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:n.default.getFirstMatch(t,e),version:n.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,r){t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},o=r(18),a=[{test:[/Roku\/DVP/],describe:function(e){var t=n.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=n.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=n.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=n.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},r=n.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=n.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=n.default.getMacOSVersionName(t),i={name:o.OS_MAP.MacOS,version:t};return r&&(i.versionName=r),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=n.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:[/OpenHarmony/i],describe:function(e){var t=n.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.HarmonyOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=n.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=n.default.getAndroidVersionName(t),i={name:o.OS_MAP.Android,version:t};return r&&(i.versionName=r),i}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=n.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:o.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=n.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||n.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||n.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=n.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=n.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=n.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,r){t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},o=r(18),a=[{test:[/googlebot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/amazonbot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/yahoo/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return{type:o.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe:function(e){var t=n.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=n.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(e){var t=n.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),r={type:o.PLATFORMS_MAP.mobile,vendor:"Nokia"};return t&&(r.model=t),r}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number((e.getOSVersion()+"").split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,r){t.__esModule=!0,t.default=void 0;var i,n=(i=r(17))&&i.__esModule?i:{default:i},o=r(18),a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=n.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},r=n.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},r=n.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},r=n.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},r=n.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=a,e.exports=t.default}})),p.exports));const m=r(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.clueSelected=n(this,"clueSelected")}init=!0;data;showCluePreview=!0;clueListStyle="ol";compareFunction=(e,t)=>e===t;clueSelected;textInput;hWords=[];vWords=[];currentClueId=null;currentClue=null;isFocused=!1;selectedCell=null;bowserParser=v.getParser("undefined"!=typeof window?window.navigator.userAgent:"unknown");abortController=new AbortController;componentWillLoad(){this.init&&this.data&&this.initGame(),this.useStickyBottomHack&&"undefined"!=typeof window&&window.visualViewport&&(window.visualViewport.addEventListener("resize",this.updateFloatingPreview.bind(this),{signal:this.abortController.signal}),window.visualViewport.addEventListener("scroll",this.updateFloatingPreview.bind(this),{signal:this.abortController.signal}),this.updateFloatingPreview())}disconnectedCallback(){this.abortController.abort()}watchData(){this.init&&this.data&&this.initGame()}get allWords(){return[...this.hWords,...this.vWords]}async initGame(e=this.data){if(!e.words)throw Error("Words definition missing");this.hWords=[],this.vWords=[],e.words.forEach(((e,t)=>{const r=Math.random();void 0===e.id&&(e.id=`${r}_${t}`),"horizontal"===e.orientation&&(this.hWords=[...this.hWords,e]),"vertical"===e.orientation&&(this.vWords=[...this.vWords,e])})),this.specialBorders=e.specialBorders??[],this.specialCells=e.specialCells??[],this.labels=e.labels??[],this.buildBoard()}async checkAnswer(){return this.cells.filter((e=>!e.isBlocked)).every((e=>this.compareFunction(e.value,e.answer)))}specialBorders=[];specialCells=[];labels=[];boardWidth=0;boardHeight=0;cells=[];useStickyBottomHack=this.bowserParser.isOS("ios");floatingPreviewHackParams={height:0,offsetTop:0};updateFloatingPreview(e){window.visualViewport&&(this.floatingPreviewHackParams={...this.floatingPreviewHackParams,height:window.visualViewport.height,offsetTop:window.visualViewport.offsetTop})}buildBoard(){let e=0,t=0;this.allWords.forEach((r=>{"horizontal"===r.orientation&&(e=Math.max(e,r.x+r.word.length),t=Math.max(t,r.y+1)),"vertical"===r.orientation&&(e=Math.max(e,r.x+1),t=Math.max(t,r.y+r.word.length))}));const r=Array(t*e).fill(null).map(((t,r)=>{const[i,n]=o(r,e);return{index:r,x:i,y:n,value:null,isCurrent:!1,isInCurrentWord:!1,isBlocked:!0}}));this.allWords.forEach((t=>{if("horizontal"===t.orientation)for(let i=0;i<t.word.length;i++){const n=a.from(t),o=u(new a(n.x+i,n.y),e);r[o].isBlocked=!1,r[o].answer=t.word[i]}if("vertical"===t.orientation)for(let i=0;i<t.word.length;i++){const n=a.from(t),o=u(new a(n.x,n.y+i),e);r[o].isBlocked=!1,r[o].answer=t.word[i]}})),this.cells=r,this.boardWidth=e,this.boardHeight=t}getClueById(e){return this.allWords.find((t=>t.id===e))??null}isInClue(e,t=this.currentClue){return null!==t&&(e.x===t.x||e.y===t.y)&&("horizontal"===t.orientation?!(e.y!==t.y||e.x<t.x||e.x>=t.x+t.word.length):"vertical"===t.orientation?!(e.x!==t.x||e.y<t.y||e.y>=t.y+t.word.length):void 0)}isSelectedCell(e){return!!this.selectedCell&&e.x===this.selectedCell.x&&e.y===this.selectedCell.y}getNextClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const e=this.allWords.findIndex((e=>e.id===this.currentClueId));return e<0?this.allWords[0]?.id??null:this.allWords[e+1]?.id??null}getPrevClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const e=this.allWords.findIndex((e=>e.id===this.currentClueId));return e<0?this.allWords[0]?.id??null:this.allWords[e-1]?.id??null}inputLetter(e){this.selectedCell&&(this.selectedCell.value=e,this.selectNextCell(),s(this))}backspace(){this.selectedCell&&(this.selectedCell.value?(this.selectedCell.value="",this.selectPrevCell()):(this.selectPrevCell(),this.selectedCell.value=""),s(this))}selectNextCell(){if(!this.selectedCell||!this.currentClue)return;const e=this.currentClue.orientation;if(function(e,t){return w(e).eq(a.from(t))}(this.currentClue,this.selectedCell)){const e=this.getNextClueId(),t=this.getClueById(e);return t?void this.selectClueByXY(a.from(t)):void 0}"horizontal"===e&&this.selectClueByXY(new a(this.selectedCell.x+1,this.selectedCell.y)),"vertical"===e&&this.selectClueByXY(new a(this.selectedCell.x,this.selectedCell.y+1))}selectPrevCell(){if(!this.selectedCell||!this.currentClue)return;const e=this.currentClue.orientation;if(function(e,t){return a.from(e).eq(a.from(t))}(this.currentClue,this.selectedCell)){const e=this.getPrevClueId(),t=this.getClueById(e);if(t){const e=w(t);return console.log(e),void this.selectClueByXY(e)}}"horizontal"===e&&this.selectClueByXY(new a(this.selectedCell.x-1,this.selectedCell.y)),"vertical"===e&&this.selectClueByXY(new a(this.selectedCell.x,this.selectedCell.y-1))}onFocusin(){this.isFocused=!0}onFocusOut(){this.isFocused=!1}async selectClue(e,t=null){if(!e)return;const r=this.getClueById(e);if(!r)return this.currentClueId=null,void(this.currentClue=null);this.currentClueId=e,this.currentClue=r;const i=[r.x,r.y];t&&"vertical"===r.orientation&&t.y>=r.y&&t.y<r.y+r.word.length&&(i[1]=t.y),t&&"horizontal"===r.orientation&&t.x>=r.x&&t.x<r.x+r.word.length&&(i[0]=t.x),this.selectCellByXY(a.from(i))}selectClueFromCell(e){const t=this.getClueByXV(e);if(!t)return;const r=this.getCluePreview(t);console.log("selectClueFromCell",e,t,r),0===r.replaceAll("_","").length?this.selectClue(t.id,a.from(t)):this.selectClue(t.id,e)}selectClueByXY(e){const t=this.getClueByXV(e);t&&this.selectClue(t.id,e)}getClueByXV(e){const t=this.allWords.filter((t=>this.isInClue(e,t)));if(console.log("getClueXY",t),t.length)return this.selectedCell&&2===t.length&&e.eq(a.from(this.selectedCell))?t.find((e=>e.orientation!==this.currentClue?.orientation))??t[0]:t.find((e=>e.orientation===this.currentClue?.orientation))??t[0]}selectCellByXY(e){const t=u(e,this.boardWidth);this.selectedCell=this.cells[t]??null}findNonblockedCell(e,t){const r=new a(e[0]+t[0],e[1]+t[1]),i=this.boardWidth*this.boardHeight;let n=0;for(;this.isCellBlocked(r)&&n<i;)n++,r[0]+=t[0],r[1]+=t[1],r[0]<0&&(r[0]=this.boardWidth-1),r[0]>=this.boardWidth&&(r[0]=0),r[1]<0&&(r[1]=this.boardHeight-1),r[1]>=this.boardHeight&&(r[1]=0);return r}isCellBlocked(e){const t=this.cells[u(e,this.boardWidth)];return t?.isBlocked??!0}getCluePreview(e){if(!e)return"_";const t=Array(e.word.length).fill("_");for(let r=0;r<e.word.length;r++){const i=new a(e.x,e.y).add("vertical"===e.orientation?new a(0,1*r):new a(1*r,0)),n=this.cells[u(i,this.boardWidth)];n.value&&(t[r]=n.value)}return t.join("")}onKeyPress(e){if(console.log(e),"Tab"===e.key){const t=e.shiftKey?this.getPrevClueId():this.getNextClueId();t&&(e.preventDefault(),this.selectClue(t))}if(this.selectedCell)switch(e.key){case"ArrowLeft":return this.selectClueByXY(this.findNonblockedCell(new a(this.selectedCell.x,this.selectedCell.y),new a(-1,0))),void e.preventDefault();case"ArrowRight":return this.selectClueByXY(this.findNonblockedCell(new a(this.selectedCell.x,this.selectedCell.y),new a(1,0))),void e.preventDefault();case"ArrowUp":return this.selectClueByXY(this.findNonblockedCell(new a(this.selectedCell.x,this.selectedCell.y),new a(0,-1))),void e.preventDefault();case"ArrowDown":return this.selectClueByXY(this.findNonblockedCell(new a(this.selectedCell.x,this.selectedCell.y),new a(0,1))),void e.preventDefault();case"Backspace":console.log("BACKSPACE!"),this.backspace()}}onInput(e){c(e)&&this.inputLetter(e.data.toLowerCase()[0]),this.textInput.value=""}render(){const t=!!this.vWords.length,r=!!this.hWords.length,i="none"===this.clueListStyle,n=r&&t,o=this.isFocused&&this.currentClue&&this.bowserParser.isPlatform("mobile");return e("div",{key:"6fed5a87911f7be97155b1f0f854266ffc618f7d",part:"main",class:{"--focused":this.isFocused,"--only-board":i,"--sticky-bottom-hack":this.useStickyBottomHack},onFocusin:this.onFocusin.bind(this),onFocusout:this.onFocusOut.bind(this),onClick:()=>{this.textInput.blur(),this.textInput.focus()}},e("input",{key:"bffd1c704603b35b54f59c35092edb984a7adccb",type:"text",class:"dummy",ref:e=>this.textInput=e,onKeyDown:this.onKeyPress.bind(this),onInput:this.onInput.bind(this)}),i?"":e("div",{part:"clues",class:{twoLists:n,oneList:!n}},r?e(h,{type:this.clueListStyle},this.hWords.map((t=>{const r=t.id===this.currentClueId;return e(d,{showPreview:this.showCluePreview,preview:this.getCluePreview(t),word:t,isCurrent:r,onPointerDown:()=>this.selectClue(t.id),tagName:"ol"===this.clueListStyle?"li":void 0})}))):"",t?e(h,{type:this.clueListStyle},this.vWords.map((t=>{const r=t.id===this.currentClueId;return e(d,{showPreview:this.showCluePreview,preview:this.getCluePreview(t),word:t,isCurrent:r,onPointerDown:()=>this.selectClue(t.id),tagName:"ol"===this.clueListStyle?"li":void 0})}))):""),e("div",{key:"9842d788d6e6a8df712c025474303ad0b0cf4f4b",part:"board",style:{"--board-width":""+this.boardWidth,"grid-template-columns":`repeat(${this.boardWidth}, 1fr)`,aspectRatio:""+this.boardWidth/this.boardHeight}},this.cells.filter((e=>!e.isBlocked)).map((t=>{const r=this.isInClue(t),i=this.isSelectedCell(t),n=this.specialCells.some((e=>e.x===t.x&&e.y===t.y));return e(l,{isSpecial:n,onPointerDown:()=>this.selectClueFromCell(a.from(t)),isInCurrentClue:r,isSelected:i,data:t})})),this.specialBorders.map(((t,r)=>e("div",{key:r,part:"special-border",class:{top:!!(4096&t.border),right:!!(256&t.border),bottom:!!(16&t.border),left:!!(1&t.border)},style:{"--x":""+t.x,"--y":""+t.y}}))),this.labels.map((t=>e("div",{part:"label",style:{"--x":""+t.x,"--y":""+t.y},onPointerDown:()=>this.selectClue(t.clueId)},e("div",{class:"_inner"},t.text))))),o?e("div",{part:"floating-clue",style:{"--height":this.floatingPreviewHackParams.height+"px","--offsetTop":this.floatingPreviewHackParams.offsetTop+"px"}},e("div",{class:"floating-clue__preview"},Array.from(this.getCluePreview(this.currentClue)).map(((t,r)=>e("span",{key:r},t)))),e("div",{class:"floating-clue__text"},this.currentClue?.clue??"")):"")}static get delegatesFocus(){return!0}static get watchers(){return{data:[{watchData:0}]}}static get style(){return'*[part=main]{position:relative;display:grid;grid-template-areas:"board" "clues";grid-template-columns:1fr}@media (min-width: 768px){*[part=main]{grid-template-areas:"clues board" "clues .";grid-template-columns:1fr 1fr}*[part=main].--only-board{grid-template-columns:1fr;grid-template-areas:"board"}}*[part=main].--focused{background:lightgrey}*[part=main] input.dummy{pointer-events:none;opacity:0;grid-area:board;border:none;outline:none}[part=clues]{grid-area:clues;display:grid;grid-template-columns:1fr 1fr;gap:16px}[part=clues].oneList{grid-template-columns:1fr}[part=clue-list]{margin:0;padding:0}[part=clue].--current{background:var(--clue-current-background, lightcyan)}[part=clue] .preview{font-weight:bold;letter-spacing:0.2em;text-align:center;display:block;text-transform:uppercase}li[part=clue]{--_clue-padding:var(--clue-padding, .5em);border-radius:var(--clue-radius, 0.5em);padding:var(--_clue-padding);list-style-position:inside;padding-left:calc(1em + var(--_clue-padding));text-indent:-1em;margin:0}[part=board]{grid-area:board;display:block;position:relative;container-type:size;background:var(--board-background, darkgoldenrod);--_cell-border-width:var(--cell-border-width, 2px);--cell-width-temp:calc((100cqw - var(--_cell-border-width)) / var(--board-width, 10));--cell-width:var(--cell-width-temp);--cell-width:round(var(--cell-width-temp), 1px)}[part=cell]{display:block;color:var(--cell-color, #11138d);width:calc(var(--cell-width) - var(--_cell-border-width));aspect-ratio:1;background:var(--cell-background, #d9d9d9);position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));border:var(--_cell-border-width) solid var(--cell-border-color, red)}[part=cell].--alt{background:var(--cell-background-alt, #999)}[part=cell].--in-current-clue{box-shadow:inset 0 0 2px 2px var(--cell-selected-background, lightblue)}[part=cell].--selected{background:var(--cell-selected-background, lightblue)}[part=cell].--special{background:var(--cell-special-background, lightgreen)}[part=cell].--special.--selected:before{content:"";background:var(--cell-selected-background, lightblue);position:absolute;top:0;left:0;right:0;bottom:0;clip-path:polygon(100% 0, 100% 100%, 50% 100%)}[part=cell] ._inner{position:absolute;top:0;left:0;right:0;bottom:0;display:grid;place-content:center;text-transform:uppercase;font-size:80cqh}[part=preview]{display:none}[part=special-border]{display:block;background:black;position:absolute;z-index:100;--s-border:max(2px, var(--_cell-border-width))}[part=special-border].left,[part=special-border].right{width:var(--s-border);height:calc(var(--cell-width) - var(--_cell-border-width));top:calc(var(--y, 0) * var(--cell-width) + var(--_cell-border-width))}[part=special-border].left{left:calc(var(--x, 0) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].right{left:calc((var(--x, 0) + 1) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].top,[part=special-border].bottom{width:calc(var(--cell-width) - var(--_cell-border-width));height:var(--s-border);left:calc(var(--x, 0) * var(--cell-width) + var(--_cell-border-width))}[part=special-border].top{top:calc(var(--y, 0) * var(--cell-width))}[part=special-border].bottom{top:calc((var(--y, 0) + 1) * var(--cell-width))}[part=label]{display:grid;position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));width:calc(var(--cell-width) - var(--_cell-border-width));aspect-ratio:1;border:var(--_cell-border-width) solid transparent;--label-place-content:center end}[part=label] ._inner{position:absolute;top:var(--label-padding, 10cqh);left:var(--label-padding, 10cqh);right:var(--label-padding, 10cqh);bottom:var(--label-padding, 10cqh);display:grid;place-content:var(--label-place-content, center);text-transform:uppercase;font-size:var(--label-font-size, 60cqh)}[part=floating-clue]{position:fixed;color:white;left:0;right:0;bottom:0;--_background:var(--floating-clue-background, blue)}[part=floating-clue] .floating-clue__text{padding:8px;background:var(--_background)}[part=floating-clue] .floating-clue__preview{display:inline-block;padding:8px;background:var(--_background);font-weight:bold;letter-spacing:0.2em;text-transform:uppercase;border-radius:0 16px 0 0}[part=floating-clue] .floating-clue__preview span{display:inline-block;width:1em;text-align:center}.--sticky-bottom-hack [part=floating-clue]{top:var(--height);top:calc(var(--height) + var(--offsetTop));bottom:unset;transform:translate(0, -100%)}@media (orientation: landscape){.--sticky-bottom-hack [part=floating-clue]{top:calc(var(--height) + var(--offsetTop))}}'}},[529,"mb-crossword",{init:[4],data:[16],showCluePreview:[4,"show-clue-preview"],clueListStyle:[1,"clue-list-style"],compareFunction:[16],hWords:[32],vWords:[32],currentClueId:[32],currentClue:[32],isFocused:[32],selectedCell:[32],specialBorders:[32],specialCells:[32],labels:[32],boardWidth:[32],boardHeight:[32],cells:[32],floatingPreviewHackParams:[32],initGame:[64],checkAnswer:[64],selectClue:[64]},void 0,{data:[{watchData:0}]}]);function w(e){return new a(e.x+("horizontal"===e.orientation?e.word.length-1:0),e.y+("vertical"===e.orientation?e.word.length-1:0))}function g(){"undefined"!=typeof customElements&&["mb-crossword"].forEach((e=>{"mb-crossword"===e&&(customElements.get(t(e))||customElements.define(t(e),m))}))}g();const y=m,x=g;export{y as MbCrossword,x as defineCustomElement}
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["mb-crossword",[[529,"mb-crossword",{"init":[4],"data":[16],"showCluePreview":[4,"show-clue-preview"],"clueListStyle":[1,"clue-list-style"],"hWords":[32],"vWords":[32],"currentClueId":[32],"currentClue":[32],"isFocused":[32],"selectedCell":[32],"specialBorders":[32],"specialCells":[32],"labels":[32],"boardWidth":[32],"boardHeight":[32],"cells":[32],"initGame":[64],"checkAnswer":[64],"selectClue":[64]},null,{"data":[{"watchData":0}]}]]]], options);
8
+ return bootstrapLazy([["mb-crossword",[[529,"mb-crossword",{"init":[4],"data":[16],"showCluePreview":[4,"show-clue-preview"],"clueListStyle":[1,"clue-list-style"],"compareFunction":[16],"hWords":[32],"vWords":[32],"currentClueId":[32],"currentClue":[32],"isFocused":[32],"selectedCell":[32],"specialBorders":[32],"specialCells":[32],"labels":[32],"boardWidth":[32],"boardHeight":[32],"cells":[32],"floatingPreviewHackParams":[32],"initGame":[64],"checkAnswer":[64],"selectClue":[64]},null,{"data":[{"watchData":0}]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };