@putianyi888/vue3-minesweeper-board 0.1.0 → 0.3.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.
- package/LICENSE +20 -20
- package/README.md +2 -3
- package/dist/components/MinesweeperBoard.vue.d.ts +22 -0
- package/dist/minesweeper-board.css +1 -1
- package/dist/minesweeper-board.js +88 -68
- package/dist/minesweeper-board.umd.cjs +1 -1
- package/package.json +11 -3
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Tianyi Pu
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tianyi Pu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# @putianyi888/vue3-minesweeper-board
|
|
2
2
|
|
|
3
|
-
Vue 3 component for rendering a Minesweeper board matrix
|
|
4
|
-
`@putianyi888/vue3-plots`.
|
|
3
|
+
Vue 3 component for rendering a Minesweeper board matrix.
|
|
5
4
|
|
|
6
5
|
## Install
|
|
7
6
|
|
|
8
7
|
```sh
|
|
9
|
-
npm install @putianyi888/vue3-minesweeper-board
|
|
8
|
+
npm install @putianyi888/vue3-minesweeper-board vue
|
|
10
9
|
```
|
|
11
10
|
|
|
12
11
|
## Usage
|
|
@@ -3,6 +3,10 @@ type CellIndex = {
|
|
|
3
3
|
rowIndex: number;
|
|
4
4
|
columnIndex: number;
|
|
5
5
|
};
|
|
6
|
+
type CursorPosition = {
|
|
7
|
+
rowIndex: number;
|
|
8
|
+
columnIndex: number;
|
|
9
|
+
};
|
|
6
10
|
type BoardSize = number | 'auto';
|
|
7
11
|
declare var __VLS_1: {
|
|
8
12
|
board: number[][] | undefined;
|
|
@@ -14,6 +18,9 @@ declare var __VLS_1: {
|
|
|
14
18
|
}, __VLS_10: {
|
|
15
19
|
board: number[][] | undefined;
|
|
16
20
|
size: number;
|
|
21
|
+
}, __VLS_17: {
|
|
22
|
+
position: CursorPosition;
|
|
23
|
+
size: number;
|
|
17
24
|
};
|
|
18
25
|
type __VLS_Slots = {} & {
|
|
19
26
|
background?: (props: typeof __VLS_1) => any;
|
|
@@ -21,6 +28,8 @@ type __VLS_Slots = {} & {
|
|
|
21
28
|
default?: (props: typeof __VLS_8) => any;
|
|
22
29
|
} & {
|
|
23
30
|
foreground?: (props: typeof __VLS_10) => any;
|
|
31
|
+
} & {
|
|
32
|
+
cursor?: (props: typeof __VLS_17) => any;
|
|
24
33
|
};
|
|
25
34
|
declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
26
35
|
/** Game board matrix following ms_toollib's game_board values. */
|
|
@@ -34,6 +43,12 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
34
43
|
required: true;
|
|
35
44
|
validator: (size: BoardSize) => size is number | "auto";
|
|
36
45
|
};
|
|
46
|
+
/** Cursor position in cell units. Fractional values place the cursor between cells. */
|
|
47
|
+
cursorPosition: {
|
|
48
|
+
type: PropType<CursorPosition>;
|
|
49
|
+
default: undefined;
|
|
50
|
+
validator: (position: CursorPosition) => boolean;
|
|
51
|
+
};
|
|
37
52
|
}>, {
|
|
38
53
|
cellIndex: import('vue').Ref<CellIndex | undefined, CellIndex | undefined>;
|
|
39
54
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
@@ -48,8 +63,15 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
|
|
|
48
63
|
required: true;
|
|
49
64
|
validator: (size: BoardSize) => size is number | "auto";
|
|
50
65
|
};
|
|
66
|
+
/** Cursor position in cell units. Fractional values place the cursor between cells. */
|
|
67
|
+
cursorPosition: {
|
|
68
|
+
type: PropType<CursorPosition>;
|
|
69
|
+
default: undefined;
|
|
70
|
+
validator: (position: CursorPosition) => boolean;
|
|
71
|
+
};
|
|
51
72
|
}>> & Readonly<{}>, {
|
|
52
73
|
board: number[][];
|
|
74
|
+
cursorPosition: CursorPosition;
|
|
53
75
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
54
76
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
55
77
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.outer-border{box-sizing:border-box;background:silver;border:.1875em solid #a0a0a0;border-color:#fff #a0a0a0 #a0a0a0 #fff;align-items:flex-start;gap:.375em;margin:0;padding:.375em;line-height:0;display:inline-flex}.inner-border{box-sizing:content-box;font-size:inherit;border:.1875em solid #fff;border-color:gray #fff #fff gray}.counter[data-v-04cf9f01]{--counter-size:16px;border-style:solid;border-color:gray #fff #fff gray;border-width:calc(var(--counter-size) * .0625);box-sizing:border-box;vertical-align:middle;background:#000;align-items:flex-end;line-height:0;display:inline-flex;overflow:hidden}.counter__digit[data-v-04cf9f01]{height:calc(var(--counter-size) * 1.5625);-webkit-user-select:none;user-select:none;width:calc(var(--counter-size) * .8125);flex:none;display:block}.counter__fraction[data-v-04cf9f01]{align-items:flex-end;display:inline-flex}.counter__digit--fraction[data-v-04cf9f01]{height:calc(var(--counter-size) * .9375);width:calc(var(--counter-size) * .4875)}.minesweeper-board-content[data-v-
|
|
1
|
+
.outer-border{box-sizing:border-box;background:silver;border:.1875em solid #a0a0a0;border-color:#fff #a0a0a0 #a0a0a0 #fff;align-items:flex-start;gap:.375em;margin:0;padding:.375em;line-height:0;display:inline-flex}.inner-border{box-sizing:content-box;font-size:inherit;border:.1875em solid #fff;border-color:gray #fff #fff gray}.counter[data-v-04cf9f01]{--counter-size:16px;border-style:solid;border-color:gray #fff #fff gray;border-width:calc(var(--counter-size) * .0625);box-sizing:border-box;vertical-align:middle;background:#000;align-items:flex-end;line-height:0;display:inline-flex;overflow:hidden}.counter__digit[data-v-04cf9f01]{height:calc(var(--counter-size) * 1.5625);-webkit-user-select:none;user-select:none;width:calc(var(--counter-size) * .8125);flex:none;display:block}.counter__fraction[data-v-04cf9f01]{align-items:flex-end;display:inline-flex}.counter__digit--fraction[data-v-04cf9f01]{height:calc(var(--counter-size) * .9375);width:calc(var(--counter-size) * .4875)}.minesweeper-board-content[data-v-a543fc73]{font-size:initial;line-height:0;display:grid}.minesweeper-board-layer[data-v-a543fc73]{grid-area:1/1}.minesweeper-board-layer--foreground[data-v-a543fc73]{pointer-events:none}.minesweeper-board-layer--cursor[data-v-a543fc73]{pointer-events:none;height:0;transform:translate(var(--minesweeper-cursor-x), var(--minesweeper-cursor-y));z-index:1;width:0}.minesweeper-board-cursor[data-v-a543fc73]{border:calc(var(--minesweeper-cursor-size) * .0625) solid #000;box-sizing:border-box;height:calc(var(--minesweeper-cursor-size) * .375);width:calc(var(--minesweeper-cursor-size) * .375);background:#ffdf00;border-radius:50%;transform:translate(-50%,-50%)}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -45,7 +45,7 @@ var y = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg
|
|
|
45
45
|
"cells"
|
|
46
46
|
]));
|
|
47
47
|
}
|
|
48
|
-
}), C = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='160'%20height='160'%20fill='%23808080'%20/%3e%3c!--%20dark%20frame%20--%3e%3crect%20x='10'%20y='10'%20width='150'%20height='150'%20fill='%23ff0000'%20/%3e%3c!--%20background%20--%3e%3c!--%20mine.svg%20--%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3c/svg%3e", w = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20mine.svg%20--%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3cpolygon%20points='15,30%2035,30%20155,150%20135,150'%20fill='%23ff0000'%20/%3e%3c!--%20\\cross%20--%3e%3cpolygon%20points='155,30%20135,30%2015,150%2035,150'%20fill='%23ff0000'%20/%3e%3c!--%20/cross%20--%3e%3c/svg%3e", T = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='40'%20y='110'%20width='80'%20height='20'%20fill='%23000000'%20/%3e%3c!--%20lower%20base%20--%3e%3crect%20x='60'%20y='100'%20width='40'%20height='10'%20fill='%23000000'%20/%3e%3c!--%20upper%20base%20--%3e%3crect%20x='80'%20y='40'%20width='10'%20height='60'%20fill='%23000000'%20/%3e%3c!--%20pole%20--%3e%3cpath%20d='M%2090%2030%20L%2035%2057%20L%2090%2084'%20fill='%23ff0000'%20/%3e%3c!--%20flag%20--%3e%3c/svg%3e", E = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3c!--%20mine%20body%20--%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3c!--%20-spike%20--%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3c!--%20|spike%20--%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3c!--%20\\spike%20--%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3c!--%20/spike%20--%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3c!--%20highlight%20--%3e%3c/svg%3e", D = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3c/svg%3e", O = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='50,110%2050,130%20120,130%20120,110%20100,110%20100,30%2085,30%2050,65%2050,70%2070,70%2070,110'%20fill='%230000ff'%20/%3e%3c/svg%3e", k = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2060%20Q%2030%2030,%2065%2030%20H%2095%20Q%20130%2030,%20130%2060%20C%20130%2085,%2070%20100,%2060%20110%20H%20130%20V%20130%20H%2030%20V%20115%20C%2030%2080,%20100%2080,%20100%2060%20Q%20100%2050,%2090%2050%20H%2070%20Q%2060%2050,%2060%2060'%20fill='%23008000'/%3e%3c/svg%3e", A = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2030%20H%2095%20Q%20130%2030,%20130%2060%20Q%20130%2075,%20115%2080%20Q%20130%2085,%20130%20100%20Q%20130%20130,%2095%20130%20H%2030%20V%20110%20H%2090%20Q%20100%20110,%20100%20100%20T%2090%2090%20H%2060%20V%2070%20H%2090%20Q%20100%2070,%20100%2060%20T%2090%2050%20H%2030'%20fill='%23ff0000'/%3e%3c/svg%3e", j = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='55,30%2030,80%2030,90%2090,90%2090,130%20120,130%20120,90%20130,90%20130,70%20120,70%20120,30%2090,30%2090,70%2065,70%2085,30'%20fill='%23000080'%20/%3e%3c/svg%3e",
|
|
48
|
+
}), C = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='160'%20height='160'%20fill='%23808080'%20/%3e%3c!--%20dark%20frame%20--%3e%3crect%20x='10'%20y='10'%20width='150'%20height='150'%20fill='%23ff0000'%20/%3e%3c!--%20background%20--%3e%3c!--%20mine.svg%20--%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3c/svg%3e", w = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20mine.svg%20--%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3cpolygon%20points='15,30%2035,30%20155,150%20135,150'%20fill='%23ff0000'%20/%3e%3c!--%20\\cross%20--%3e%3cpolygon%20points='155,30%20135,30%2015,150%2035,150'%20fill='%23ff0000'%20/%3e%3c!--%20/cross%20--%3e%3c/svg%3e", T = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='40'%20y='110'%20width='80'%20height='20'%20fill='%23000000'%20/%3e%3c!--%20lower%20base%20--%3e%3crect%20x='60'%20y='100'%20width='40'%20height='10'%20fill='%23000000'%20/%3e%3c!--%20upper%20base%20--%3e%3crect%20x='80'%20y='40'%20width='10'%20height='60'%20fill='%23000000'%20/%3e%3c!--%20pole%20--%3e%3cpath%20d='M%2090%2030%20L%2035%2057%20L%2090%2084'%20fill='%23ff0000'%20/%3e%3c!--%20flag%20--%3e%3c/svg%3e", E = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3c!--%20mine%20body%20--%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3c!--%20-spike%20--%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3c!--%20|spike%20--%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3c!--%20\\spike%20--%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3c!--%20/spike%20--%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3c!--%20highlight%20--%3e%3c/svg%3e", D = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3c/svg%3e", O = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='50,110%2050,130%20120,130%20120,110%20100,110%20100,30%2085,30%2050,65%2050,70%2070,70%2070,110'%20fill='%230000ff'%20/%3e%3c/svg%3e", k = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2060%20Q%2030%2030,%2065%2030%20H%2095%20Q%20130%2030,%20130%2060%20C%20130%2085,%2070%20100,%2060%20110%20H%20130%20V%20130%20H%2030%20V%20115%20C%2030%2080,%20100%2080,%20100%2060%20Q%20100%2050,%2090%2050%20H%2070%20Q%2060%2050,%2060%2060'%20fill='%23008000'/%3e%3c/svg%3e", A = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2030%20H%2095%20Q%20130%2030,%20130%2060%20Q%20130%2075,%20115%2080%20Q%20130%2085,%20130%20100%20Q%20130%20130,%2095%20130%20H%2030%20V%20110%20H%2090%20Q%20100%20110,%20100%20100%20T%2090%2090%20H%2060%20V%2070%20H%2090%20Q%20100%2070,%20100%2060%20T%2090%2050%20H%2030'%20fill='%23ff0000'/%3e%3c/svg%3e", j = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='55,30%2030,80%2030,90%2090,90%2090,130%20120,130%20120,90%20130,90%20130,70%20120,70%20120,30%2090,30%2090,70%2065,70%2085,30'%20fill='%23000080'%20/%3e%3c/svg%3e", M = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2030%20H%20130%20V%2050%20H%2060%20V%2070%20H%2095%20Q%20130%2070,%20130%20100%20T%2095%20130%20H%2030%20V%20110%20H%2090%20Q%20100%20110,%20100%20100%20T%2090%2090%20H%2030'%20fill='%23800000'/%3e%3c/svg%3e", N = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%20120%2030%20V%2050%20H%2080%20Q%2060%2050,%2060%2060%20V%20100%20Q%2060%20110,%2080%20110%20T%20100%20100%20T%2080%2090%20H%2060%20V%2070%20H%2095%20Q%20130%2070,%20130%20100%20T%2095%20130%20H%2065%20Q%2030%20130,%2030%20100%20V%2060%20Q%2030%2030,%2065%2030'%20fill='%23008080'/%3e%3c/svg%3e", P = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2030%20H%20130%20V%2060%20L%2095%20130%20H%2065%20L%20100%2060%20V%2050%20H%2030'%20fill='%23000000'/%3e%3c/svg%3e", F = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2065%2030%20H%2095%20Q%20130%2030,%20130%2060%20Q%20130%2075,%20115%2080%20H%20100%20V%2060%20Q%20100%2050,%2090%2050%20H%2070%20Q%2060%2050,%2060%2060%20T%2070%2070%20H%2090%20Q%20100%2070,%20100%2060%20V%20100%20Q%20100%2090,%2090%2090%20H%2070%20Q%2060%2090,%2060%20100%20T%2070%20110%20H%2090%20Q%20100%20110,%20100%20100%20V%2080%20H%20115%20Q%20130%2085,%20130%20100%20Q%20130%20130,%2095%20130%20H%2065%20Q%2030%20130,%2030%20100%20Q%2030%2085,%2045%2080%20Q%2030%2075,%2030%2060%20Q%2030%2030,%2065%2030'%20fill='%23808080'/%3e%3c/svg%3e", I = /* @__PURE__ */ o({
|
|
49
49
|
__name: "BoardForeground",
|
|
50
50
|
props: { board: {
|
|
51
51
|
type: Array,
|
|
@@ -60,10 +60,10 @@ var y = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg
|
|
|
60
60
|
num2: k,
|
|
61
61
|
num3: A,
|
|
62
62
|
num4: j,
|
|
63
|
-
num5:
|
|
64
|
-
num6:
|
|
65
|
-
num7:
|
|
66
|
-
num8:
|
|
63
|
+
num5: M,
|
|
64
|
+
num6: N,
|
|
65
|
+
num7: P,
|
|
66
|
+
num8: F,
|
|
67
67
|
mine: E,
|
|
68
68
|
flag: T,
|
|
69
69
|
falsemine: w,
|
|
@@ -116,10 +116,10 @@ var y = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg
|
|
|
116
116
|
"cells"
|
|
117
117
|
]));
|
|
118
118
|
}
|
|
119
|
-
}), re = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23400000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", P = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", F = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", I = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23400000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", L = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", R = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", z = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", B = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", V = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", H = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", U = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", W = ["aria-label"], G = ["data-counter-digit", "src"], K = {
|
|
119
|
+
}), L = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23400000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", R = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", z = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", B = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23400000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", V = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", H = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", U = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", W = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", G = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", K = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", q = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e", J = ["aria-label"], Y = ["data-counter-digit", "src"], ee = {
|
|
120
120
|
key: 0,
|
|
121
121
|
class: "counter__fraction"
|
|
122
|
-
},
|
|
122
|
+
}, te = ["data-counter-digit", "src"], ne = 270, re = /*@__PURE__*/ o({
|
|
123
123
|
name: "MinesweeperCounter",
|
|
124
124
|
__name: "Counter",
|
|
125
125
|
props: {
|
|
@@ -145,17 +145,17 @@ var y = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg
|
|
|
145
145
|
},
|
|
146
146
|
setup(n) {
|
|
147
147
|
let a = n, o = {
|
|
148
|
-
"-":
|
|
149
|
-
0:
|
|
150
|
-
1:
|
|
151
|
-
2:
|
|
152
|
-
3:
|
|
153
|
-
4:
|
|
154
|
-
5:
|
|
155
|
-
6:
|
|
156
|
-
7:
|
|
157
|
-
8:
|
|
158
|
-
9:
|
|
148
|
+
"-": L,
|
|
149
|
+
0: R,
|
|
150
|
+
1: z,
|
|
151
|
+
2: B,
|
|
152
|
+
3: V,
|
|
153
|
+
4: H,
|
|
154
|
+
5: U,
|
|
155
|
+
6: W,
|
|
156
|
+
7: G,
|
|
157
|
+
8: K,
|
|
158
|
+
9: q
|
|
159
159
|
}, s = t(() => Math.min(100, Math.max(0, Math.trunc(a.fixed)))), f = t(() => (Number.isFinite(a.value) ? a.value : 0).toFixed(s.value)), h = t(() => f.value.split(".")), g = t(() => O(h.value[0] ?? "0")), v = t(() => E(g.value)), y = t(() => E(h.value[1] ?? "")), b = t(() => {
|
|
160
160
|
let e = h.value[1];
|
|
161
161
|
return e === void 0 ? g.value : `${g.value}.${e}`;
|
|
@@ -164,7 +164,7 @@ var y = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg
|
|
|
164
164
|
width: 0
|
|
165
165
|
}), C = t(() => 20 + v.value.length * 130 + y.value.length * 78), w = t(() => {
|
|
166
166
|
if (typeof a.size == "number") return a.size;
|
|
167
|
-
let e = C.value > 0 && S.value.width > 0 ? S.value.width * 160 / C.value : void 0, t = S.value.height > 0 ? S.value.height * 160 /
|
|
167
|
+
let e = C.value > 0 && S.value.width > 0 ? S.value.width * 160 / C.value : void 0, t = S.value.height > 0 ? S.value.height * 160 / ne : void 0, n = Math.min(...[e, t].filter((e) => e !== void 0));
|
|
168
168
|
return Number.isFinite(n) ? Math.max(1, n) : 16;
|
|
169
169
|
}), T = t(() => ({ "--counter-size": `${w.value}px` }));
|
|
170
170
|
function E(e) {
|
|
@@ -228,20 +228,20 @@ var y = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg
|
|
|
228
228
|
src: o[e],
|
|
229
229
|
alt: "",
|
|
230
230
|
draggable: "false"
|
|
231
|
-
}, null, 8,
|
|
231
|
+
}, null, 8, Y))), 128)), y.value.length > 0 ? (d(), i("span", ee, [(d(!0), i(e, null, m(y.value, (e, t) => (d(), i("img", {
|
|
232
232
|
key: `fraction-${t}`,
|
|
233
233
|
class: "counter__digit counter__digit--fraction",
|
|
234
234
|
"data-counter-digit": e,
|
|
235
235
|
src: o[e],
|
|
236
236
|
alt: "",
|
|
237
237
|
draggable: "false"
|
|
238
|
-
}, null, 8,
|
|
238
|
+
}, null, 8, te))), 128))])) : r("", !0)], 12, J));
|
|
239
239
|
}
|
|
240
240
|
}), X = (e, t) => {
|
|
241
241
|
let n = e.__vccOpts || e;
|
|
242
242
|
for (let [e, r] of t) n[e] = r;
|
|
243
243
|
return n;
|
|
244
|
-
}, ie = /*#__PURE__*/ X(
|
|
244
|
+
}, ie = /*#__PURE__*/ X(re, [["__scopeId", "data-v-04cf9f01"]]), ae = { class: "minesweeper-board-layer" }, oe = { class: "minesweeper-board-layer" }, se = { class: "minesweeper-board-layer minesweeper-board-layer--foreground" }, Z = /*#__PURE__*/ X(/* @__PURE__ */ o({
|
|
245
245
|
__name: "MinesweeperBoard",
|
|
246
246
|
props: {
|
|
247
247
|
board: {
|
|
@@ -252,116 +252,136 @@ var y = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg
|
|
|
252
252
|
type: [Number, String],
|
|
253
253
|
required: !0,
|
|
254
254
|
validator: (e) => e === "auto" || typeof e == "number"
|
|
255
|
+
},
|
|
256
|
+
cursorPosition: {
|
|
257
|
+
type: Object,
|
|
258
|
+
default: void 0,
|
|
259
|
+
validator: (e) => Number.isFinite(e.rowIndex) && Number.isFinite(e.columnIndex)
|
|
255
260
|
}
|
|
256
261
|
},
|
|
257
262
|
setup(e, { expose: o }) {
|
|
258
|
-
let s = e,
|
|
263
|
+
let s = e, m = p(), g = p(), v = p({
|
|
259
264
|
height: 0,
|
|
260
265
|
width: 0
|
|
261
|
-
}),
|
|
266
|
+
}), y = t(() => s.board?.length ?? 0), b = t(() => s.board?.reduce((e, t) => Math.max(e, t.length), 0) ?? 0), C = t(() => {
|
|
262
267
|
if (typeof s.size == "number") return s.size;
|
|
263
|
-
let e =
|
|
268
|
+
let e = b.value > 0 && v.value.width > 0 ? v.value.width / b.value : void 0, t = y.value > 0 && v.value.height > 0 ? v.value.height / y.value : void 0, n = Math.min(...[e, t].filter((e) => e !== void 0));
|
|
264
269
|
return Number.isFinite(n) ? Math.max(1, n) : 16;
|
|
265
270
|
});
|
|
266
271
|
f(x, {
|
|
267
272
|
board: t(() => s.board),
|
|
268
|
-
size: t(() =>
|
|
273
|
+
size: t(() => C.value)
|
|
274
|
+
});
|
|
275
|
+
let w = t(() => b.value * C.value), T = t(() => y.value * C.value), E = t(() => {
|
|
276
|
+
let e = s.cursorPosition;
|
|
277
|
+
return e === void 0 ? {} : {
|
|
278
|
+
"--minesweeper-cursor-size": `${C.value}px`,
|
|
279
|
+
"--minesweeper-cursor-x": `${e.columnIndex * C.value}px`,
|
|
280
|
+
"--minesweeper-cursor-y": `${e.rowIndex * C.value}px`
|
|
281
|
+
};
|
|
269
282
|
});
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
m.value !== void 0 && (m.value = void 0);
|
|
283
|
+
function D() {
|
|
284
|
+
g.value !== void 0 && (g.value = void 0);
|
|
273
285
|
}
|
|
274
|
-
function
|
|
275
|
-
let t =
|
|
276
|
-
if (t === void 0 ||
|
|
277
|
-
|
|
286
|
+
function O(e) {
|
|
287
|
+
let t = m.value;
|
|
288
|
+
if (t === void 0 || y.value === 0 || b.value === 0) {
|
|
289
|
+
D();
|
|
278
290
|
return;
|
|
279
291
|
}
|
|
280
292
|
let n = t.getBoundingClientRect();
|
|
281
|
-
if (n.width === 0 || n.height === 0 ||
|
|
282
|
-
|
|
293
|
+
if (n.width === 0 || n.height === 0 || w.value === 0 || T.value === 0) {
|
|
294
|
+
D();
|
|
283
295
|
return;
|
|
284
296
|
}
|
|
285
297
|
let r = e.clientX - n.left, i = e.clientY - n.top;
|
|
286
|
-
if (r < 0 || i < 0 || r >=
|
|
287
|
-
|
|
298
|
+
if (r < 0 || i < 0 || r >= w.value || i >= T.value) {
|
|
299
|
+
D();
|
|
288
300
|
return;
|
|
289
301
|
}
|
|
290
|
-
let a = Math.floor(i /
|
|
302
|
+
let a = Math.floor(i / C.value), o = Math.floor(r / C.value);
|
|
291
303
|
if (s.board?.[a]?.[o] === void 0) {
|
|
292
|
-
|
|
304
|
+
D();
|
|
293
305
|
return;
|
|
294
306
|
}
|
|
295
|
-
|
|
307
|
+
k({
|
|
296
308
|
rowIndex: a,
|
|
297
309
|
columnIndex: o
|
|
298
310
|
});
|
|
299
311
|
}
|
|
300
|
-
function
|
|
301
|
-
|
|
312
|
+
function k(e) {
|
|
313
|
+
g.value?.rowIndex === e.rowIndex && g.value.columnIndex === e.columnIndex || (g.value = e);
|
|
302
314
|
}
|
|
303
|
-
let
|
|
304
|
-
function
|
|
305
|
-
let e =
|
|
315
|
+
let A;
|
|
316
|
+
function j() {
|
|
317
|
+
let e = m.value, t = e?.parentElement ?? e;
|
|
306
318
|
if (t === void 0) {
|
|
307
|
-
|
|
319
|
+
v.value = {
|
|
308
320
|
height: 0,
|
|
309
321
|
width: 0
|
|
310
322
|
};
|
|
311
323
|
return;
|
|
312
324
|
}
|
|
313
325
|
let n = t.getBoundingClientRect();
|
|
314
|
-
|
|
326
|
+
v.value = {
|
|
315
327
|
height: n.height,
|
|
316
328
|
width: n.width
|
|
317
329
|
};
|
|
318
330
|
}
|
|
319
|
-
function
|
|
320
|
-
if (
|
|
321
|
-
let e =
|
|
322
|
-
t !== void 0 && (
|
|
331
|
+
function M() {
|
|
332
|
+
if (A?.disconnect(), A = void 0, s.size !== "auto") return;
|
|
333
|
+
let e = m.value, t = e?.parentElement ?? e;
|
|
334
|
+
t !== void 0 && (j(), !(typeof ResizeObserver > "u") && (A = new ResizeObserver((e) => {
|
|
323
335
|
let t = e[0];
|
|
324
336
|
if (t === void 0) {
|
|
325
|
-
|
|
337
|
+
j();
|
|
326
338
|
return;
|
|
327
339
|
}
|
|
328
|
-
|
|
340
|
+
v.value = {
|
|
329
341
|
height: t.contentRect.height,
|
|
330
342
|
width: t.contentRect.width
|
|
331
343
|
};
|
|
332
|
-
}),
|
|
344
|
+
}), A.observe(t)));
|
|
333
345
|
}
|
|
334
346
|
return u(() => {
|
|
335
|
-
|
|
347
|
+
M();
|
|
336
348
|
}), l(() => {
|
|
337
|
-
|
|
349
|
+
A?.disconnect();
|
|
338
350
|
}), _(() => s.size, () => {
|
|
339
|
-
|
|
340
|
-
}), o({ cellIndex:
|
|
351
|
+
M();
|
|
352
|
+
}), o({ cellIndex: g }), (e, t) => (d(), i("div", {
|
|
341
353
|
ref_key: "boardElement",
|
|
342
|
-
ref:
|
|
354
|
+
ref: m,
|
|
343
355
|
class: "minesweeper-board-content",
|
|
344
|
-
onMouseleave:
|
|
345
|
-
onMousemove:
|
|
356
|
+
onMouseleave: D,
|
|
357
|
+
onMousemove: O
|
|
346
358
|
}, [
|
|
347
359
|
a("div", ae, [h(e.$slots, "background", {
|
|
348
360
|
board: s.board,
|
|
349
|
-
size:
|
|
361
|
+
size: C.value
|
|
350
362
|
}, () => [s.board === void 0 ? r("", !0) : (d(), n(S, { key: 0 }))], !0)]),
|
|
351
363
|
a("div", oe, [h(e.$slots, "default", {
|
|
352
364
|
board: s.board,
|
|
353
|
-
cellIndex:
|
|
354
|
-
size:
|
|
365
|
+
cellIndex: g.value,
|
|
366
|
+
size: C.value
|
|
355
367
|
}, void 0, !0)]),
|
|
356
368
|
a("div", se, [h(e.$slots, "foreground", {
|
|
357
369
|
board: s.board,
|
|
358
|
-
size:
|
|
359
|
-
}, () => [s.board === void 0 ? r("", !0) : (d(), n(
|
|
370
|
+
size: C.value
|
|
371
|
+
}, () => [s.board === void 0 ? r("", !0) : (d(), n(I, { key: 0 }))], !0)]),
|
|
372
|
+
s.cursorPosition === void 0 ? r("", !0) : (d(), i("div", {
|
|
373
|
+
key: 0,
|
|
374
|
+
class: "minesweeper-board-layer minesweeper-board-layer--cursor",
|
|
375
|
+
style: c(E.value)
|
|
376
|
+
}, [h(e.$slots, "cursor", {
|
|
377
|
+
position: s.cursorPosition,
|
|
378
|
+
size: C.value
|
|
379
|
+
}, () => [t[0] ||= a("div", { class: "minesweeper-board-cursor" }, null, -1)], !0)], 4))
|
|
360
380
|
], 544));
|
|
361
381
|
}
|
|
362
|
-
}), [["__scopeId", "data-v-
|
|
382
|
+
}), [["__scopeId", "data-v-a543fc73"]]), Q = "outer-border", $ = "inner-border", ce = {
|
|
363
383
|
innerBorder: $,
|
|
364
384
|
outerBorder: Q
|
|
365
385
|
};
|
|
366
386
|
//#endregion
|
|
367
|
-
export { S as BoardBackground,
|
|
387
|
+
export { S as BoardBackground, I as BoardForeground, ie as Counter, Z as MinesweeperBoard, Z as default, $ as innerBorderClass, ce as minesweeperBoardClasses, Q as outerBorderClass };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue"),require("@putianyi888/vue3-plots")):typeof define==`function`&&define.amd?define([`exports`,`vue`,`@putianyi888/vue3-plots`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.MinesweeperBoard={},e.Vue,e.Vue3Plots))})(this,function(e,t,n){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='160'%20height='160'%20fill='%23808080'%20/%3e%3c!--%20dark%20frame%20--%3e%3crect%20x='10'%20y='10'%20width='150'%20height='150'%20fill='%23c0c0c0'%20/%3e%3c!--%20light%20background%20--%3e%3c/svg%3e`,i=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='0,0%20160,0%20140,20%2020,20%2020,140%200,160'%20fill='%23ffffff'%20/%3e%3c!--%20highlight%20--%3e%3cpolygon%20points='160,160%20160,0%20140,20%20140,140%2020,140%200,160'%20fill='%23808080'%20/%3e%3c!--%20shade%20--%3e%3crect%20x='20'%20y='20'%20width='120'%20height='120'%20fill='%23c0c0c0'%20/%3e%3c!--%20background%20--%3e%3c/svg%3e`,a=Symbol(`minesweeper-board`),o=(0,t.defineComponent)({__name:`BoardBackground`,props:{board:{type:Array,default:void 0}},setup(e,{expose:o}){let s=e,c=(0,t.inject)(a);if(c===void 0)throw Error(`BoardBackground must be used inside MinesweeperBoard.`);let l={down:r,up:i},u=new Set([0,1,2,3,4,5,6,7,8,14,15,18]),d=(0,t.computed)(()=>{if(s.board!==void 0)return s.board;let e=c.board.value;if(e===void 0)throw Error(`BoardBackground requires a board prop or MinesweeperBoard board context.`);return e.map(e=>e.map(e=>u.has(e)))}),f=(0,t.computed)(()=>d.value.map(e=>e.map(e=>e?`down`:`up`))),p=(0,t.ref)();return o({cellIndex:(0,t.computed)(()=>(0,t.unref)(p.value?.cellIndex))}),(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ImageGrid),{ref_key:`imageGrid`,ref:p,"cell-height":(0,t.unref)(c).size.value,"cell-width":(0,t.unref)(c).size.value,cells:f.value,images:l},null,8,[`cell-height`,`cell-width`,`cells`]))}}),s=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='160'%20height='160'%20fill='%23808080'%20/%3e%3c!--%20dark%20frame%20--%3e%3crect%20x='10'%20y='10'%20width='150'%20height='150'%20fill='%23ff0000'%20/%3e%3c!--%20background%20--%3e%3c!--%20mine.svg%20--%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3c/svg%3e`,c=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20mine.svg%20--%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3cpolygon%20points='15,30%2035,30%20155,150%20135,150'%20fill='%23ff0000'%20/%3e%3c!--%20\\cross%20--%3e%3cpolygon%20points='155,30%20135,30%2015,150%2035,150'%20fill='%23ff0000'%20/%3e%3c!--%20/cross%20--%3e%3c/svg%3e`,l=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='40'%20y='110'%20width='80'%20height='20'%20fill='%23000000'%20/%3e%3c!--%20lower%20base%20--%3e%3crect%20x='60'%20y='100'%20width='40'%20height='10'%20fill='%23000000'%20/%3e%3c!--%20upper%20base%20--%3e%3crect%20x='80'%20y='40'%20width='10'%20height='60'%20fill='%23000000'%20/%3e%3c!--%20pole%20--%3e%3cpath%20d='M%2090%2030%20L%2035%2057%20L%2090%2084'%20fill='%23ff0000'%20/%3e%3c!--%20flag%20--%3e%3c/svg%3e`,u=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3c!--%20mine%20body%20--%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3c!--%20-spike%20--%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3c!--%20|spike%20--%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3c!--%20\\spike%20--%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3c!--%20/spike%20--%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3c!--%20highlight%20--%3e%3c/svg%3e`,d=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3c/svg%3e`,f=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='50,110%2050,130%20120,130%20120,110%20100,110%20100,30%2085,30%2050,65%2050,70%2070,70%2070,110'%20fill='%230000ff'%20/%3e%3c/svg%3e`,p=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2060%20Q%2030%2030,%2065%2030%20H%2095%20Q%20130%2030,%20130%2060%20C%20130%2085,%2070%20100,%2060%20110%20H%20130%20V%20130%20H%2030%20V%20115%20C%2030%2080,%20100%2080,%20100%2060%20Q%20100%2050,%2090%2050%20H%2070%20Q%2060%2050,%2060%2060'%20fill='%23008000'/%3e%3c/svg%3e`,m=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2030%20H%2095%20Q%20130%2030,%20130%2060%20Q%20130%2075,%20115%2080%20Q%20130%2085,%20130%20100%20Q%20130%20130,%2095%20130%20H%2030%20V%20110%20H%2090%20Q%20100%20110,%20100%20100%20T%2090%2090%20H%2060%20V%2070%20H%2090%20Q%20100%2070,%20100%2060%20T%2090%2050%20H%2030'%20fill='%23ff0000'/%3e%3c/svg%3e`,h=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='55,30%2030,80%2030,90%2090,90%2090,130%20120,130%20120,90%20130,90%20130,70%20120,70%20120,30%2090,30%2090,70%2065,70%2085,30'%20fill='%23000080'%20/%3e%3c/svg%3e`,g=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2030%20H%20130%20V%2050%20H%2060%20V%2070%20H%2095%20Q%20130%2070,%20130%20100%20T%2095%20130%20H%2030%20V%20110%20H%2090%20Q%20100%20110,%20100%20100%20T%2090%2090%20H%2030'%20fill='%23800000'/%3e%3c/svg%3e`,_=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%20120%2030%20V%2050%20H%2080%20Q%2060%2050,%2060%2060%20V%20100%20Q%2060%20110,%2080%20110%20T%20100%20100%20T%2080%2090%20H%2060%20V%2070%20H%2095%20Q%20130%2070,%20130%20100%20T%2095%20130%20H%2065%20Q%2030%20130,%2030%20100%20V%2060%20Q%2030%2030,%2065%2030'%20fill='%23008080'/%3e%3c/svg%3e`,v=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2030%20H%20130%20V%2060%20L%2095%20130%20H%2065%20L%20100%2060%20V%2050%20H%2030'%20fill='%23000000'/%3e%3c/svg%3e`,y=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2065%2030%20H%2095%20Q%20130%2030,%20130%2060%20Q%20130%2075,%20115%2080%20H%20100%20V%2060%20Q%20100%2050,%2090%2050%20H%2070%20Q%2060%2050,%2060%2060%20T%2070%2070%20H%2090%20Q%20100%2070,%20100%2060%20V%20100%20Q%20100%2090,%2090%2090%20H%2070%20Q%2060%2090,%2060%20100%20T%2070%20110%20H%2090%20Q%20100%20110,%20100%20100%20V%2080%20H%20115%20Q%20130%2085,%20130%20100%20Q%20130%20130,%2095%20130%20H%2065%20Q%2030%20130,%2030%20100%20Q%2030%2085,%2045%2080%20Q%2030%2075,%2030%2060%20Q%2030%2030,%2065%2030'%20fill='%23808080'/%3e%3c/svg%3e`,b=(0,t.defineComponent)({__name:`BoardForeground`,props:{board:{type:Array,default:void 0}},setup(e){let r=e,i=(0,t.inject)(a);if(i===void 0)throw Error(`BoardForeground must be used inside MinesweeperBoard.`);let o={blank:d,num1:f,num2:p,num3:m,num4:h,num5:g,num6:_,num7:v,num8:y,mine:u,flag:l,falsemine:c,blast:s},b={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,10:0,11:-2,12:0,14:-3,15:-4,16:-1,18:0},x={0:`blank`,1:`num1`,2:`num2`,3:`num3`,4:`num4`,5:`num5`,6:`num6`,7:`num7`,8:`num8`,[-1]:`mine`,[-2]:`flag`,[-3]:`falsemine`,[-4]:`blast`},S=(0,t.computed)(()=>{if(r.board!==void 0)return r.board;let e=i.board.value;if(e===void 0)throw Error(`BoardForeground requires a board prop or MinesweeperBoard board context.`);return e.map(e=>e.map(e=>b[e]??0))}),C=(0,t.computed)(()=>S.value.map(e=>e.map(e=>x[e]??`blank`)));return(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ImageGrid),{"cell-height":(0,t.unref)(i).size.value,"cell-width":(0,t.unref)(i).size.value,cells:C.value,images:o},null,8,[`cell-height`,`cell-width`,`cells`]))}}),x=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23400000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,S=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,C=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,w=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23400000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,T=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,E=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,D=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,O=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,k=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,A=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,j=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,M=[`aria-label`],N=[`data-counter-digit`,`src`],P={key:0,class:`counter__fraction`},F=[`data-counter-digit`,`src`],I=270,L=(0,t.defineComponent)({name:`MinesweeperCounter`,__name:`Counter`,props:{value:{type:Number,required:!0},size:{type:[Number,String],required:!0,validator:e=>e===`auto`||typeof e==`number`},fixed:{type:Number,default:0,validator:e=>Number.isInteger(e)&&e>=0&&e<=100},digits:{type:Number,default:1,validator:e=>Number.isInteger(e)&&e>=1&&e<=100}},setup(e){let n=e,r={"-":x,0:S,1:C,2:w,3:T,4:E,5:D,6:O,7:k,8:A,9:j},i=(0,t.computed)(()=>Math.min(100,Math.max(0,Math.trunc(n.fixed)))),a=(0,t.computed)(()=>(Number.isFinite(n.value)?n.value:0).toFixed(i.value)),o=(0,t.computed)(()=>a.value.split(`.`)),s=(0,t.computed)(()=>v(o.value[0]??`0`)),c=(0,t.computed)(()=>g(s.value)),l=(0,t.computed)(()=>g(o.value[1]??``)),u=(0,t.computed)(()=>{let e=o.value[1];return e===void 0?s.value:`${s.value}.${e}`}),d=(0,t.ref)(),f=(0,t.ref)({height:0,width:0}),p=(0,t.computed)(()=>20+c.value.length*130+l.value.length*78),m=(0,t.computed)(()=>{if(typeof n.size==`number`)return n.size;let e=p.value>0&&f.value.width>0?f.value.width*160/p.value:void 0,t=f.value.height>0?f.value.height*160/I:void 0,r=Math.min(...[e,t].filter(e=>e!==void 0));return Number.isFinite(r)?Math.max(1,r):16}),h=(0,t.computed)(()=>({"--counter-size":`${m.value}px`}));function g(e){return Array.from(e,e=>_(e)?e:`0`)}function _(e){return e in r}function v(e){let t=Math.min(100,Math.max(1,Math.trunc(n.digits)));return e.startsWith(`-`)?`-${e.slice(1).padStart(t,`0`)}`:e.padStart(t,`0`)}let y;function b(){let e=d.value,t=e?.parentElement??e;if(t===void 0){f.value={height:0,width:0};return}let n=t.getBoundingClientRect();f.value={height:n.height,width:n.width}}function L(){if(y?.disconnect(),y=void 0,n.size!==`auto`)return;let e=d.value,t=e?.parentElement??e;t!==void 0&&(b(),!(typeof ResizeObserver>`u`)&&(y=new ResizeObserver(e=>{let t=e[0];if(t===void 0){b();return}f.value={height:t.contentRect.height,width:t.contentRect.width}}),y.observe(t)))}return(0,t.onMounted)(()=>{L()}),(0,t.onBeforeUnmount)(()=>{y?.disconnect()}),(0,t.watch)(()=>n.size,()=>{L()}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`counterElement`,ref:d,class:`counter`,style:(0,t.normalizeStyle)(h.value),"aria-label":u.value,role:`img`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:`integer-${n}`,class:`counter__digit`,"data-counter-digit":e,src:r[e],alt:``,draggable:`false`},null,8,N))),128)),l.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,P,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(l.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:`fraction-${n}`,class:`counter__digit counter__digit--fraction`,"data-counter-digit":e,src:r[e],alt:``,draggable:`false`},null,8,F))),128))])):(0,t.createCommentVNode)(``,!0)],12,M))}}),R=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},z=R(L,[[`__scopeId`,`data-v-04cf9f01`]]),B={class:`minesweeper-board-layer`},V={class:`minesweeper-board-layer`},H={class:`minesweeper-board-layer minesweeper-board-layer--foreground`},U=R((0,t.defineComponent)({__name:`MinesweeperBoard`,props:{board:{type:Array,default:void 0},size:{type:[Number,String],required:!0,validator:e=>e===`auto`||typeof e==`number`}},setup(e,{expose:n}){let r=e,i=(0,t.ref)(),s=(0,t.ref)(),c=(0,t.ref)({height:0,width:0}),l=(0,t.computed)(()=>r.board?.length??0),u=(0,t.computed)(()=>r.board?.reduce((e,t)=>Math.max(e,t.length),0)??0),d=(0,t.computed)(()=>{if(typeof r.size==`number`)return r.size;let e=u.value>0&&c.value.width>0?c.value.width/u.value:void 0,t=l.value>0&&c.value.height>0?c.value.height/l.value:void 0,n=Math.min(...[e,t].filter(e=>e!==void 0));return Number.isFinite(n)?Math.max(1,n):16});(0,t.provide)(a,{board:(0,t.computed)(()=>r.board),size:(0,t.computed)(()=>d.value)});let f=(0,t.computed)(()=>u.value*d.value),p=(0,t.computed)(()=>l.value*d.value);function m(){s.value!==void 0&&(s.value=void 0)}function h(e){let t=i.value;if(t===void 0||l.value===0||u.value===0){m();return}let n=t.getBoundingClientRect();if(n.width===0||n.height===0||f.value===0||p.value===0){m();return}let a=e.clientX-n.left,o=e.clientY-n.top;if(a<0||o<0||a>=f.value||o>=p.value){m();return}let s=Math.floor(o/d.value),c=Math.floor(a/d.value);if(r.board?.[s]?.[c]===void 0){m();return}g({rowIndex:s,columnIndex:c})}function g(e){s.value?.rowIndex===e.rowIndex&&s.value.columnIndex===e.columnIndex||(s.value=e)}let _;function v(){let e=i.value,t=e?.parentElement??e;if(t===void 0){c.value={height:0,width:0};return}let n=t.getBoundingClientRect();c.value={height:n.height,width:n.width}}function y(){if(_?.disconnect(),_=void 0,r.size!==`auto`)return;let e=i.value,t=e?.parentElement??e;t!==void 0&&(v(),!(typeof ResizeObserver>`u`)&&(_=new ResizeObserver(e=>{let t=e[0];if(t===void 0){v();return}c.value={height:t.contentRect.height,width:t.contentRect.width}}),_.observe(t)))}return(0,t.onMounted)(()=>{y()}),(0,t.onBeforeUnmount)(()=>{_?.disconnect()}),(0,t.watch)(()=>r.size,()=>{y()}),n({cellIndex:s}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`boardElement`,ref:i,class:`minesweeper-board-content`,onMouseleave:m,onMousemove:h},[(0,t.createElementVNode)(`div`,B,[(0,t.renderSlot)(e.$slots,`background`,{board:r.board,size:d.value},()=>[r.board===void 0?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)(o,{key:0}))],!0)]),(0,t.createElementVNode)(`div`,V,[(0,t.renderSlot)(e.$slots,`default`,{board:r.board,cellIndex:s.value,size:d.value},void 0,!0)]),(0,t.createElementVNode)(`div`,H,[(0,t.renderSlot)(e.$slots,`foreground`,{board:r.board,size:d.value},()=>[r.board===void 0?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)(b,{key:0}))],!0)])],544))}}),[[`__scopeId`,`data-v-ad3db891`]]),W=`outer-border`,G=`inner-border`,K={innerBorder:G,outerBorder:W};e.BoardBackground=o,e.BoardForeground=b,e.Counter=z,e.MinesweeperBoard=U,e.default=U,e.innerBorderClass=G,e.minesweeperBoardClasses=K,e.outerBorderClass=W});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue"),require("@putianyi888/vue3-plots")):typeof define==`function`&&define.amd?define([`exports`,`vue`,`@putianyi888/vue3-plots`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.MinesweeperBoard={},e.Vue,e.Vue3Plots))})(this,function(e,t,n){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='160'%20height='160'%20fill='%23808080'%20/%3e%3c!--%20dark%20frame%20--%3e%3crect%20x='10'%20y='10'%20width='150'%20height='150'%20fill='%23c0c0c0'%20/%3e%3c!--%20light%20background%20--%3e%3c/svg%3e`,i=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='0,0%20160,0%20140,20%2020,20%2020,140%200,160'%20fill='%23ffffff'%20/%3e%3c!--%20highlight%20--%3e%3cpolygon%20points='160,160%20160,0%20140,20%20140,140%2020,140%200,160'%20fill='%23808080'%20/%3e%3c!--%20shade%20--%3e%3crect%20x='20'%20y='20'%20width='120'%20height='120'%20fill='%23c0c0c0'%20/%3e%3c!--%20background%20--%3e%3c/svg%3e`,a=Symbol(`minesweeper-board`),o=(0,t.defineComponent)({__name:`BoardBackground`,props:{board:{type:Array,default:void 0}},setup(e,{expose:o}){let s=e,c=(0,t.inject)(a);if(c===void 0)throw Error(`BoardBackground must be used inside MinesweeperBoard.`);let l={down:r,up:i},u=new Set([0,1,2,3,4,5,6,7,8,14,15,18]),d=(0,t.computed)(()=>{if(s.board!==void 0)return s.board;let e=c.board.value;if(e===void 0)throw Error(`BoardBackground requires a board prop or MinesweeperBoard board context.`);return e.map(e=>e.map(e=>u.has(e)))}),f=(0,t.computed)(()=>d.value.map(e=>e.map(e=>e?`down`:`up`))),p=(0,t.ref)();return o({cellIndex:(0,t.computed)(()=>(0,t.unref)(p.value?.cellIndex))}),(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ImageGrid),{ref_key:`imageGrid`,ref:p,"cell-height":(0,t.unref)(c).size.value,"cell-width":(0,t.unref)(c).size.value,cells:f.value,images:l},null,8,[`cell-height`,`cell-width`,`cells`]))}}),s=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='160'%20height='160'%20fill='%23808080'%20/%3e%3c!--%20dark%20frame%20--%3e%3crect%20x='10'%20y='10'%20width='150'%20height='150'%20fill='%23ff0000'%20/%3e%3c!--%20background%20--%3e%3c!--%20mine.svg%20--%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3c/svg%3e`,c=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3c!--%20mine.svg%20--%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3cpolygon%20points='15,30%2035,30%20155,150%20135,150'%20fill='%23ff0000'%20/%3e%3c!--%20\\cross%20--%3e%3cpolygon%20points='155,30%20135,30%2015,150%2035,150'%20fill='%23ff0000'%20/%3e%3c!--%20/cross%20--%3e%3c/svg%3e`,l=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='40'%20y='110'%20width='80'%20height='20'%20fill='%23000000'%20/%3e%3c!--%20lower%20base%20--%3e%3crect%20x='60'%20y='100'%20width='40'%20height='10'%20fill='%23000000'%20/%3e%3c!--%20upper%20base%20--%3e%3crect%20x='80'%20y='40'%20width='10'%20height='60'%20fill='%23000000'%20/%3e%3c!--%20pole%20--%3e%3cpath%20d='M%2090%2030%20L%2035%2057%20L%2090%2084'%20fill='%23ff0000'%20/%3e%3c!--%20flag%20--%3e%3c/svg%3e`,u=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='85'%20cy='85'%20r='45'%20fill='%23000000'%20/%3e%3c!--%20mine%20body%20--%3e%3crect%20x='20'%20y='80'%20width='130'%20height='10'%20/%3e%3c!--%20-spike%20--%3e%3crect%20y='20'%20x='80'%20width='10'%20height='130'%20/%3e%3c!--%20|spike%20--%3e%3cline%20x1='40'%20y1='40'%20x2='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3c!--%20\\spike%20--%3e%3cline%20x2='40'%20y1='40'%20x1='130'%20y2='130'%20stroke-width='10'%20stroke='%23000000'%20/%3e%3c!--%20/spike%20--%3e%3ccircle%20cx='70'%20cy='70'%20r='11'%20fill='%23ffffff'%20/%3e%3c!--%20highlight%20--%3e%3c/svg%3e`,d=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3c/svg%3e`,f=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='50,110%2050,130%20120,130%20120,110%20100,110%20100,30%2085,30%2050,65%2050,70%2070,70%2070,110'%20fill='%230000ff'%20/%3e%3c/svg%3e`,p=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2060%20Q%2030%2030,%2065%2030%20H%2095%20Q%20130%2030,%20130%2060%20C%20130%2085,%2070%20100,%2060%20110%20H%20130%20V%20130%20H%2030%20V%20115%20C%2030%2080,%20100%2080,%20100%2060%20Q%20100%2050,%2090%2050%20H%2070%20Q%2060%2050,%2060%2060'%20fill='%23008000'/%3e%3c/svg%3e`,m=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2030%20H%2095%20Q%20130%2030,%20130%2060%20Q%20130%2075,%20115%2080%20Q%20130%2085,%20130%20100%20Q%20130%20130,%2095%20130%20H%2030%20V%20110%20H%2090%20Q%20100%20110,%20100%20100%20T%2090%2090%20H%2060%20V%2070%20H%2090%20Q%20100%2070,%20100%2060%20T%2090%2050%20H%2030'%20fill='%23ff0000'/%3e%3c/svg%3e`,h=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='55,30%2030,80%2030,90%2090,90%2090,130%20120,130%20120,90%20130,90%20130,70%20120,70%20120,30%2090,30%2090,70%2065,70%2085,30'%20fill='%23000080'%20/%3e%3c/svg%3e`,g=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2030%20H%20130%20V%2050%20H%2060%20V%2070%20H%2095%20Q%20130%2070,%20130%20100%20T%2095%20130%20H%2030%20V%20110%20H%2090%20Q%20100%20110,%20100%20100%20T%2090%2090%20H%2030'%20fill='%23800000'/%3e%3c/svg%3e`,_=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%20120%2030%20V%2050%20H%2080%20Q%2060%2050,%2060%2060%20V%20100%20Q%2060%20110,%2080%20110%20T%20100%20100%20T%2080%2090%20H%2060%20V%2070%20H%2095%20Q%20130%2070,%20130%20100%20T%2095%20130%20H%2065%20Q%2030%20130,%2030%20100%20V%2060%20Q%2030%2030,%2065%2030'%20fill='%23008080'/%3e%3c/svg%3e`,v=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2030%2030%20H%20130%20V%2060%20L%2095%20130%20H%2065%20L%20100%2060%20V%2050%20H%2030'%20fill='%23000000'/%3e%3c/svg%3e`,y=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='160'%20height='160'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M%2065%2030%20H%2095%20Q%20130%2030,%20130%2060%20Q%20130%2075,%20115%2080%20H%20100%20V%2060%20Q%20100%2050,%2090%2050%20H%2070%20Q%2060%2050,%2060%2060%20T%2070%2070%20H%2090%20Q%20100%2070,%20100%2060%20V%20100%20Q%20100%2090,%2090%2090%20H%2070%20Q%2060%2090,%2060%20100%20T%2070%20110%20H%2090%20Q%20100%20110,%20100%20100%20V%2080%20H%20115%20Q%20130%2085,%20130%20100%20Q%20130%20130,%2095%20130%20H%2065%20Q%2030%20130,%2030%20100%20Q%2030%2085,%2045%2080%20Q%2030%2075,%2030%2060%20Q%2030%2030,%2065%2030'%20fill='%23808080'/%3e%3c/svg%3e`,b=(0,t.defineComponent)({__name:`BoardForeground`,props:{board:{type:Array,default:void 0}},setup(e){let r=e,i=(0,t.inject)(a);if(i===void 0)throw Error(`BoardForeground must be used inside MinesweeperBoard.`);let o={blank:d,num1:f,num2:p,num3:m,num4:h,num5:g,num6:_,num7:v,num8:y,mine:u,flag:l,falsemine:c,blast:s},b={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,10:0,11:-2,12:0,14:-3,15:-4,16:-1,18:0},x={0:`blank`,1:`num1`,2:`num2`,3:`num3`,4:`num4`,5:`num5`,6:`num6`,7:`num7`,8:`num8`,[-1]:`mine`,[-2]:`flag`,[-3]:`falsemine`,[-4]:`blast`},S=(0,t.computed)(()=>{if(r.board!==void 0)return r.board;let e=i.board.value;if(e===void 0)throw Error(`BoardForeground requires a board prop or MinesweeperBoard board context.`);return e.map(e=>e.map(e=>b[e]??0))}),C=(0,t.computed)(()=>S.value.map(e=>e.map(e=>x[e]??`blank`)));return(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ImageGrid),{"cell-height":(0,t.unref)(i).size.value,"cell-width":(0,t.unref)(i).size.value,cells:C.value,images:o},null,8,[`cell-height`,`cell-width`,`cells`]))}}),x=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23400000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,S=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,C=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,w=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23400000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,T=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,E=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23400000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,D=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,O=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23400000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,k=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23400000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23400000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23400000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,A=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23ff0000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,j=`data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='yes'?%3e%3csvg%20width='130'%20height='250'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0'%20y='0'%20width='130'%20height='230'%20fill='%23000000'%20/%3e%3c!--%20background%20--%3e%3cpolygon%20points='15,10%20115,10%2085,40%2045,40'%20fill='%23ff0000'%20/%3e%3c!--%20top%20--%3e%3cpolygon%20points='15,220%20115,220%2085,190%2045,190'%20fill='%23ff0000'%20/%3e%3c!--%20bottom%20--%3e%3cpolygon%20points='10,15%2010,115%2040,85%2040,45'%20fill='%23ff0000'%20/%3e%3c!--%20left%20top%20--%3e%3cpolygon%20points='10,115%2010,215%2040,185%2040,145'%20fill='%23400000'%20/%3e%3c!--%20left%20bottom%20--%3e%3cpolygon%20points='120,15%20120,115%2090,85%2090,45'%20fill='%23ff0000'%20/%3e%3c!--%20right%20top%20--%3e%3cpolygon%20points='120,115%20120,215%2090,185%2090,145'%20fill='%23ff0000'%20/%3e%3c!--%20right%20bottom%20--%3e%3cpolygon%20points='20,115%2035,100%2095,100%20110,115%2095,130%2035,130'%20fill='%23ff0000'%20/%3e%3c!--%20center%20--%3e%3c/svg%3e`,M=[`aria-label`],N=[`data-counter-digit`,`src`],P={key:0,class:`counter__fraction`},F=[`data-counter-digit`,`src`],I=270,L=(0,t.defineComponent)({name:`MinesweeperCounter`,__name:`Counter`,props:{value:{type:Number,required:!0},size:{type:[Number,String],required:!0,validator:e=>e===`auto`||typeof e==`number`},fixed:{type:Number,default:0,validator:e=>Number.isInteger(e)&&e>=0&&e<=100},digits:{type:Number,default:1,validator:e=>Number.isInteger(e)&&e>=1&&e<=100}},setup(e){let n=e,r={"-":x,0:S,1:C,2:w,3:T,4:E,5:D,6:O,7:k,8:A,9:j},i=(0,t.computed)(()=>Math.min(100,Math.max(0,Math.trunc(n.fixed)))),a=(0,t.computed)(()=>(Number.isFinite(n.value)?n.value:0).toFixed(i.value)),o=(0,t.computed)(()=>a.value.split(`.`)),s=(0,t.computed)(()=>v(o.value[0]??`0`)),c=(0,t.computed)(()=>g(s.value)),l=(0,t.computed)(()=>g(o.value[1]??``)),u=(0,t.computed)(()=>{let e=o.value[1];return e===void 0?s.value:`${s.value}.${e}`}),d=(0,t.ref)(),f=(0,t.ref)({height:0,width:0}),p=(0,t.computed)(()=>20+c.value.length*130+l.value.length*78),m=(0,t.computed)(()=>{if(typeof n.size==`number`)return n.size;let e=p.value>0&&f.value.width>0?f.value.width*160/p.value:void 0,t=f.value.height>0?f.value.height*160/I:void 0,r=Math.min(...[e,t].filter(e=>e!==void 0));return Number.isFinite(r)?Math.max(1,r):16}),h=(0,t.computed)(()=>({"--counter-size":`${m.value}px`}));function g(e){return Array.from(e,e=>_(e)?e:`0`)}function _(e){return e in r}function v(e){let t=Math.min(100,Math.max(1,Math.trunc(n.digits)));return e.startsWith(`-`)?`-${e.slice(1).padStart(t,`0`)}`:e.padStart(t,`0`)}let y;function b(){let e=d.value,t=e?.parentElement??e;if(t===void 0){f.value={height:0,width:0};return}let n=t.getBoundingClientRect();f.value={height:n.height,width:n.width}}function L(){if(y?.disconnect(),y=void 0,n.size!==`auto`)return;let e=d.value,t=e?.parentElement??e;t!==void 0&&(b(),!(typeof ResizeObserver>`u`)&&(y=new ResizeObserver(e=>{let t=e[0];if(t===void 0){b();return}f.value={height:t.contentRect.height,width:t.contentRect.width}}),y.observe(t)))}return(0,t.onMounted)(()=>{L()}),(0,t.onBeforeUnmount)(()=>{y?.disconnect()}),(0,t.watch)(()=>n.size,()=>{L()}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`counterElement`,ref:d,class:`counter`,style:(0,t.normalizeStyle)(h.value),"aria-label":u.value,role:`img`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:`integer-${n}`,class:`counter__digit`,"data-counter-digit":e,src:r[e],alt:``,draggable:`false`},null,8,N))),128)),l.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,P,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(l.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:`fraction-${n}`,class:`counter__digit counter__digit--fraction`,"data-counter-digit":e,src:r[e],alt:``,draggable:`false`},null,8,F))),128))])):(0,t.createCommentVNode)(``,!0)],12,M))}}),R=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},z=R(L,[[`__scopeId`,`data-v-04cf9f01`]]),B={class:`minesweeper-board-layer`},V={class:`minesweeper-board-layer`},H={class:`minesweeper-board-layer minesweeper-board-layer--foreground`},U=R((0,t.defineComponent)({__name:`MinesweeperBoard`,props:{board:{type:Array,default:void 0},size:{type:[Number,String],required:!0,validator:e=>e===`auto`||typeof e==`number`},cursorPosition:{type:Object,default:void 0,validator:e=>Number.isFinite(e.rowIndex)&&Number.isFinite(e.columnIndex)}},setup(e,{expose:n}){let r=e,i=(0,t.ref)(),s=(0,t.ref)(),c=(0,t.ref)({height:0,width:0}),l=(0,t.computed)(()=>r.board?.length??0),u=(0,t.computed)(()=>r.board?.reduce((e,t)=>Math.max(e,t.length),0)??0),d=(0,t.computed)(()=>{if(typeof r.size==`number`)return r.size;let e=u.value>0&&c.value.width>0?c.value.width/u.value:void 0,t=l.value>0&&c.value.height>0?c.value.height/l.value:void 0,n=Math.min(...[e,t].filter(e=>e!==void 0));return Number.isFinite(n)?Math.max(1,n):16});(0,t.provide)(a,{board:(0,t.computed)(()=>r.board),size:(0,t.computed)(()=>d.value)});let f=(0,t.computed)(()=>u.value*d.value),p=(0,t.computed)(()=>l.value*d.value),m=(0,t.computed)(()=>{let e=r.cursorPosition;return e===void 0?{}:{"--minesweeper-cursor-size":`${d.value}px`,"--minesweeper-cursor-x":`${e.columnIndex*d.value}px`,"--minesweeper-cursor-y":`${e.rowIndex*d.value}px`}});function h(){s.value!==void 0&&(s.value=void 0)}function g(e){let t=i.value;if(t===void 0||l.value===0||u.value===0){h();return}let n=t.getBoundingClientRect();if(n.width===0||n.height===0||f.value===0||p.value===0){h();return}let a=e.clientX-n.left,o=e.clientY-n.top;if(a<0||o<0||a>=f.value||o>=p.value){h();return}let s=Math.floor(o/d.value),c=Math.floor(a/d.value);if(r.board?.[s]?.[c]===void 0){h();return}_({rowIndex:s,columnIndex:c})}function _(e){s.value?.rowIndex===e.rowIndex&&s.value.columnIndex===e.columnIndex||(s.value=e)}let v;function y(){let e=i.value,t=e?.parentElement??e;if(t===void 0){c.value={height:0,width:0};return}let n=t.getBoundingClientRect();c.value={height:n.height,width:n.width}}function x(){if(v?.disconnect(),v=void 0,r.size!==`auto`)return;let e=i.value,t=e?.parentElement??e;t!==void 0&&(y(),!(typeof ResizeObserver>`u`)&&(v=new ResizeObserver(e=>{let t=e[0];if(t===void 0){y();return}c.value={height:t.contentRect.height,width:t.contentRect.width}}),v.observe(t)))}return(0,t.onMounted)(()=>{x()}),(0,t.onBeforeUnmount)(()=>{v?.disconnect()}),(0,t.watch)(()=>r.size,()=>{x()}),n({cellIndex:s}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`boardElement`,ref:i,class:`minesweeper-board-content`,onMouseleave:h,onMousemove:g},[(0,t.createElementVNode)(`div`,B,[(0,t.renderSlot)(e.$slots,`background`,{board:r.board,size:d.value},()=>[r.board===void 0?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)(o,{key:0}))],!0)]),(0,t.createElementVNode)(`div`,V,[(0,t.renderSlot)(e.$slots,`default`,{board:r.board,cellIndex:s.value,size:d.value},void 0,!0)]),(0,t.createElementVNode)(`div`,H,[(0,t.renderSlot)(e.$slots,`foreground`,{board:r.board,size:d.value},()=>[r.board===void 0?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)(b,{key:0}))],!0)]),r.cursorPosition===void 0?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`minesweeper-board-layer minesweeper-board-layer--cursor`,style:(0,t.normalizeStyle)(m.value)},[(0,t.renderSlot)(e.$slots,`cursor`,{position:r.cursorPosition,size:d.value},()=>[n[0]||=(0,t.createElementVNode)(`div`,{class:`minesweeper-board-cursor`},null,-1)],!0)],4))],544))}}),[[`__scopeId`,`data-v-a543fc73`]]),W=`outer-border`,G=`inner-border`,K={innerBorder:G,outerBorder:W};e.BoardBackground=o,e.BoardForeground=b,e.Counter=z,e.MinesweeperBoard=U,e.default=U,e.innerBorderClass=G,e.minesweeperBoardClasses=K,e.outerBorderClass=W});
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putianyi888/vue3-minesweeper-board",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Vue 3 Minesweeper board component for ms_toollib game board values.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Tianyi Pu",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/putianyi889/minesweeper-board"
|
|
11
|
+
},
|
|
8
12
|
"main": "./dist/minesweeper-board.umd.cjs",
|
|
9
13
|
"module": "./dist/minesweeper-board.js",
|
|
10
14
|
"style": "./dist/minesweeper-board.css",
|
|
@@ -31,19 +35,23 @@
|
|
|
31
35
|
"lint:fix": "eslint . --fix",
|
|
32
36
|
"prepack": "npm run build",
|
|
33
37
|
"test": "vitest run",
|
|
38
|
+
"coverage": "vitest run --coverage",
|
|
34
39
|
"typecheck": "vue-tsc --noEmit",
|
|
35
40
|
"pack:dry-run": "npm pack --dry-run"
|
|
36
41
|
},
|
|
37
42
|
"peerDependencies": {
|
|
38
|
-
"@putianyi888/vue3-plots": "^0.6.0",
|
|
39
43
|
"vue": "^3.5.0"
|
|
40
44
|
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@putianyi888/vue3-plots": "^0.6.0"
|
|
47
|
+
},
|
|
41
48
|
"devDependencies": {
|
|
42
49
|
"@eslint/js": "^10.0.1",
|
|
43
|
-
"@putianyi888/vue3-plots": "^0.6.0",
|
|
44
50
|
"@types/node": "^26.1.1",
|
|
45
51
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
52
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
46
53
|
"@vue/test-utils": "^2.4.11",
|
|
54
|
+
"esbuild": "^0.28.1",
|
|
47
55
|
"eslint": "^10.7.0",
|
|
48
56
|
"eslint-plugin-vue": "^10.9.2",
|
|
49
57
|
"globals": "^17.7.0",
|