@bedard/hexboard 0.0.8 → 0.0.10

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/dist/index.js CHANGED
@@ -1,44 +1,44 @@
1
- import { defineComponent as ao, createElementBlock as P, openBlock as b, createElementVNode as fo, toDisplayString as vo, mergeModels as so, useModel as Zt, shallowRef as tt, useTemplateRef as Co, computed as W, onMounted as Eo, onUnmounted as $o, watch as ro, createCommentVNode as ot, unref as c, normalizeStyle as ft, Fragment as nt, renderList as lt, mergeProps as Lo, createBlock as io, resolveDynamicComponent as uo, withModifiers as Bo, renderSlot as Mo, h as To } from "vue";
2
- import { Hexchess as co, position as A, San as dt, isPromotionPosition as Fo } from "@bedard/hexchess";
3
- function r(u, $, d) {
4
- return [u[0] + d * ($[0] - u[0]), u[1] + d * ($[1] - u[1])];
1
+ import { defineComponent as fo, createElementBlock as C, openBlock as x, createElementVNode as vo, toDisplayString as ho, mergeModels as uo, useModel as Zt, shallowRef as et, useTemplateRef as Co, computed as W, onBeforeMount as Eo, onMounted as Lo, onUnmounted as Bo, watch as jt, createCommentVNode as tt, unref as a, normalizeStyle as ct, Fragment as ot, renderList as nt, mergeProps as Mo, createBlock as io, resolveDynamicComponent as co, withModifiers as $o, renderSlot as To, h as Fo } from "vue";
2
+ import { Hexchess as ao, position as ae, San as at, isPromotionPosition as Ro } from "@bedard/hexchess";
3
+ function r(i, B, v) {
4
+ return [i[0] + v * (B[0] - i[0]), i[1] + v * (B[1] - i[1])];
5
5
  }
6
- function n(u) {
7
- return u.map(t);
6
+ function n(i) {
7
+ return i.map(t);
8
8
  }
9
- function e(u) {
9
+ function e(i) {
10
10
  return [
11
- x(u, -300, ue),
12
- x(u, 0, ue),
13
- x(u, -60, ue),
14
- x(u, -120, ue),
15
- x(u, -180, ue),
16
- x(u, -240, ue)
11
+ k(i, -300, ue),
12
+ k(i, 0, ue),
13
+ k(i, -60, ue),
14
+ k(i, -120, ue),
15
+ k(i, -180, ue),
16
+ k(i, -240, ue)
17
17
  ];
18
18
  }
19
- function x(u, $, d) {
20
- const V = Ro($);
19
+ function k(i, B, v) {
20
+ const Q = So(B);
21
21
  return [
22
- d * Math.cos(V) + u[0],
23
- d * Math.sin(V) + u[1]
22
+ v * Math.cos(Q) + i[0],
23
+ v * Math.sin(Q) + i[1]
24
24
  ];
25
25
  }
26
- function Ro(u) {
27
- return u * (Math.PI / 180);
26
+ function So(i) {
27
+ return i * (Math.PI / 180);
28
28
  }
29
- function t(u) {
30
- return [-u[0], -u[1]];
29
+ function t(i) {
30
+ return [-i[0], -i[1]];
31
31
  }
32
- function l(u, $) {
33
- return [u[0] + $[0], u[1] + $[1]];
32
+ function l(i, B) {
33
+ return [i[0] + B[0], i[1] + B[1]];
34
34
  }
35
- function de(u) {
36
- return he / 2 + u;
35
+ function fe(i) {
36
+ return de / 2 + i;
37
37
  }
38
- function ve(u) {
39
- return he / 2 - u;
38
+ function ve(i) {
39
+ return de / 2 - i;
40
40
  }
41
- const he = 23.6, So = {
41
+ const de = 23.6, qo = {
42
42
  colors: [
43
43
  "oklch(0.9015 0.0729 70.7)",
44
44
  "oklch(0.8366 0.1165 66.29)",
@@ -57,133 +57,133 @@ const he = 23.6, So = {
57
57
  // red-500
58
58
  targetColor: "oklch(63.7% 0.237 25.331)"
59
59
  // red-500
60
- }, qo = "b/qbk/n1b1n/r5r/ppppppppp/11/5P5/4P1P4/3P1B1P3/2P2B2P2/1PRNQBKNRP1 w - 0 1", i = 1.7, U = 1.7, ue = 2 / Math.sqrt(3), p = ue * (Math.sqrt(3) / 2) * 2, w = p * 2, y = p * 3, k = p * 4, E = p * 5, m = [0, 0], D = x(m, 150, E), S = x(m, 150, k), H = x(m, 150, y), q = x(m, 150, w), M = x(m, 150, p), T = x(m, 30, p), N = x(m, 30, w), O = x(m, 30, y), z = x(m, 30, k), X = x(m, 30, E), Z = l(D, [0, -E]), j = l(S, [0, -E]), pe = l(H, [0, -E]), me = l(q, [0, -E]), ge = l(M, [0, -E]), we = l(m, [0, -E]), ye = l(T, [0, -E]), be = l(N, [0, -E]), xe = l(O, [0, -E]), G = l(z, [0, -E]), J = l(X, [0, -E]), I = l(D, [0, -k]), _ = l(S, [0, -k]), ke = l(H, [0, -k]), Pe = l(q, [0, -k]), Ce = l(M, [0, -k]), Ee = l(m, [0, -k]), $e = l(T, [0, -k]), Le = l(N, [0, -k]), Be = l(O, [0, -k]), ee = l(z, [0, -k]), te = l(X, [0, -k]), Me = l(D, [0, -y]), Te = l(S, [0, -y]), vt = l(H, [0, -y]), ht = l(q, [0, -y]), pt = l(M, [0, -y]), mt = l(m, [0, -y]), gt = l(T, [0, -y]), wt = l(N, [0, -y]), yt = l(O, [0, -y]), Fe = l(z, [0, -y]), Re = l(X, [0, -y]), Se = l(D, [0, -w]), qe = l(S, [0, -w]), bt = l(H, [0, -w]), xt = l(q, [0, -w]), kt = l(M, [0, -w]), Pt = l(m, [0, -w]), Ct = l(T, [0, -w]), Et = l(N, [0, -w]), $t = l(O, [0, -w]), Ne = l(z, [0, -w]), ze = l(X, [0, -w]), We = l(D, [0, -p]), Ae = l(S, [0, -p]), Lt = l(H, [0, -p]), Bt = l(q, [0, -p]), Mt = l(M, [0, -p]), Tt = l(m, [0, -p]), Ft = l(T, [0, -p]), Rt = l(N, [0, -p]), St = l(O, [0, -p]), De = l(z, [0, -p]), He = l(X, [0, -p]), Oe = l(S, [0, p]), Xe = l(H, [0, p]), qt = l(q, [0, p]), Nt = l(M, [0, p]), zt = l(m, [0, p]), Wt = l(T, [0, p]), At = l(N, [0, p]), Ye = l(O, [0, p]), Ke = l(z, [0, p]), Qe = l(H, [0, w]), Ve = l(q, [0, w]), Dt = l(M, [0, w]), Ht = l(m, [0, w]), Ot = l(T, [0, w]), Ue = l(N, [0, w]), Ze = l(O, [0, w]), je = l(q, [0, y]), Ge = l(M, [0, y]), Xt = l(m, [0, y]), Je = l(T, [0, y]), Ie = l(N, [0, y]), oe = l(M, [0, k]), ne = l(m, [0, k]), le = l(T, [0, k]), se = l(m, [0, E]), o = [
61
- [2, se, t(se), e(se), n(e(se))],
62
- [1, oe, t(oe), e(oe), n(e(oe))],
63
- [0, ne, t(ne), e(ne), n(e(ne))],
64
- [1, le, t(le), e(le), n(e(le))],
65
- [0, je, t(je), e(je), n(e(je))],
60
+ }, No = "b/qbk/n1b1n/r5r/ppppppppp/11/5P5/4P1P4/3P1B1P3/2P2B2P2/1PRNQBKNRP1 w - 0 1", u = 1.7, V = 1.7, ue = 2 / Math.sqrt(3), p = ue * (Math.sqrt(3) / 2) * 2, y = p * 2, w = p * 3, P = p * 4, L = p * 5, m = [0, 0], A = k(m, 150, L), S = k(m, 150, P), D = k(m, 150, w), q = k(m, 150, y), $ = k(m, 150, p), T = k(m, 30, p), N = k(m, 30, y), H = k(m, 30, w), z = k(m, 30, P), O = k(m, 30, L), U = l(A, [0, -L]), Z = l(S, [0, -L]), he = l(D, [0, -L]), pe = l(q, [0, -L]), me = l($, [0, -L]), ge = l(m, [0, -L]), ye = l(T, [0, -L]), we = l(N, [0, -L]), be = l(H, [0, -L]), j = l(z, [0, -L]), G = l(O, [0, -L]), I = l(A, [0, -P]), J = l(S, [0, -P]), xe = l(D, [0, -P]), ke = l(q, [0, -P]), Pe = l($, [0, -P]), Ce = l(m, [0, -P]), Ee = l(T, [0, -P]), Le = l(N, [0, -P]), Be = l(H, [0, -P]), _ = l(z, [0, -P]), ee = l(O, [0, -P]), Me = l(A, [0, -w]), $e = l(S, [0, -w]), ft = l(D, [0, -w]), vt = l(q, [0, -w]), dt = l($, [0, -w]), ht = l(m, [0, -w]), pt = l(T, [0, -w]), mt = l(N, [0, -w]), gt = l(H, [0, -w]), Te = l(z, [0, -w]), Fe = l(O, [0, -w]), Re = l(A, [0, -y]), Se = l(S, [0, -y]), yt = l(D, [0, -y]), wt = l(q, [0, -y]), bt = l($, [0, -y]), xt = l(m, [0, -y]), kt = l(T, [0, -y]), Pt = l(N, [0, -y]), Ct = l(H, [0, -y]), qe = l(z, [0, -y]), Ne = l(O, [0, -y]), ze = l(A, [0, -p]), We = l(S, [0, -p]), Et = l(D, [0, -p]), Lt = l(q, [0, -p]), Bt = l($, [0, -p]), Mt = l(m, [0, -p]), $t = l(T, [0, -p]), Tt = l(N, [0, -p]), Ft = l(H, [0, -p]), Ae = l(z, [0, -p]), De = l(O, [0, -p]), He = l(S, [0, p]), Oe = l(D, [0, p]), Rt = l(q, [0, p]), St = l($, [0, p]), qt = l(m, [0, p]), Nt = l(T, [0, p]), zt = l(N, [0, p]), Xe = l(H, [0, p]), Ye = l(z, [0, p]), Ke = l(D, [0, y]), Qe = l(q, [0, y]), Wt = l($, [0, y]), At = l(m, [0, y]), Dt = l(T, [0, y]), Ve = l(N, [0, y]), Ue = l(H, [0, y]), Ze = l(q, [0, w]), je = l($, [0, w]), Ht = l(m, [0, w]), Ge = l(T, [0, w]), Ie = l(N, [0, w]), te = l($, [0, P]), oe = l(m, [0, P]), ne = l(T, [0, P]), le = l(m, [0, L]), o = [
61
+ [2, le, t(le), e(le), n(e(le))],
62
+ [1, te, t(te), e(te), n(e(te))],
63
+ [0, oe, t(oe), e(oe), n(e(oe))],
64
+ [1, ne, t(ne), e(ne), n(e(ne))],
65
+ [0, Ze, t(Ze), e(Ze), n(e(Ze))],
66
+ [2, je, t(je), e(je), n(e(je))],
67
+ [1, Ht, t(Ht), e(Ht), n(e(Ht))],
66
68
  [2, Ge, t(Ge), e(Ge), n(e(Ge))],
67
- [1, Xt, t(Xt), e(Xt), n(e(Xt))],
68
- [2, Je, t(Je), e(Je), n(e(Je))],
69
69
  [0, Ie, t(Ie), e(Ie), n(e(Ie))],
70
- [2, Qe, t(Qe), e(Qe), n(e(Qe))],
71
- [1, Ve, t(Ve), e(Ve), n(e(Ve))],
70
+ [2, Ke, t(Ke), e(Ke), n(e(Ke))],
71
+ [1, Qe, t(Qe), e(Qe), n(e(Qe))],
72
+ [0, Wt, t(Wt), e(Wt), n(e(Wt))],
73
+ [2, At, t(At), e(At), n(e(At))],
72
74
  [0, Dt, t(Dt), e(Dt), n(e(Dt))],
73
- [2, Ht, t(Ht), e(Ht), n(e(Ht))],
74
- [0, Ot, t(Ot), e(Ot), n(e(Ot))],
75
- [1, Ue, t(Ue), e(Ue), n(e(Ue))],
76
- [2, Ze, t(Ze), e(Ze), n(e(Ze))],
77
- [1, Oe, t(Oe), e(Oe), n(e(Oe))],
78
- [0, Xe, t(Xe), e(Xe), n(e(Xe))],
79
- [2, qt, t(qt), e(qt), n(e(qt))],
75
+ [1, Ve, t(Ve), e(Ve), n(e(Ve))],
76
+ [2, Ue, t(Ue), e(Ue), n(e(Ue))],
77
+ [1, He, t(He), e(He), n(e(He))],
78
+ [0, Oe, t(Oe), e(Oe), n(e(Oe))],
79
+ [2, Rt, t(Rt), e(Rt), n(e(Rt))],
80
+ [1, St, t(St), e(St), n(e(St))],
81
+ [0, qt, t(qt), e(qt), n(e(qt))],
80
82
  [1, Nt, t(Nt), e(Nt), n(e(Nt))],
81
- [0, zt, t(zt), e(zt), n(e(zt))],
82
- [1, Wt, t(Wt), e(Wt), n(e(Wt))],
83
- [2, At, t(At), e(At), n(e(At))],
84
- [0, Ye, t(Ye), e(Ye), n(e(Ye))],
85
- [1, Ke, t(Ke), e(Ke), n(e(Ke))],
86
- [0, D, t(D), e(D), n(e(D))],
83
+ [2, zt, t(zt), e(zt), n(e(zt))],
84
+ [0, Xe, t(Xe), e(Xe), n(e(Xe))],
85
+ [1, Ye, t(Ye), e(Ye), n(e(Ye))],
86
+ [0, A, t(A), e(A), n(e(A))],
87
87
  [2, S, t(S), e(S), n(e(S))],
88
- [1, H, t(H), e(H), n(e(H))],
88
+ [1, D, t(D), e(D), n(e(D))],
89
89
  [0, q, t(q), e(q), n(e(q))],
90
- [2, M, t(M), e(M), n(e(M))],
90
+ [2, $, t($), e($), n(e($))],
91
91
  [1, m, t(m), e(m), n(e(m))],
92
92
  [2, T, t(T), e(T), n(e(T))],
93
93
  [0, N, t(N), e(N), n(e(N))],
94
- [1, O, t(O), e(O), n(e(O))],
94
+ [1, H, t(H), e(H), n(e(H))],
95
95
  [2, z, t(z), e(z), n(e(z))],
96
- [0, X, t(X), e(X), n(e(X))],
97
- [1, We, t(We), e(We), n(e(We))],
98
- [0, Ae, t(Ae), e(Ae), n(e(Ae))],
99
- [2, Lt, t(Lt), e(Lt), n(e(Lt))],
100
- [1, Bt, t(Bt), e(Bt), n(e(Bt))],
101
- [0, Mt, t(Mt), e(Mt), n(e(Mt))],
102
- [2, Tt, t(Tt), e(Tt), n(e(Tt))],
103
- [0, Ft, t(Ft), e(Ft), n(e(Ft))],
104
- [1, Rt, t(Rt), e(Rt), n(e(Rt))],
105
- [2, St, t(St), e(St), n(e(St))],
106
- [0, De, t(De), e(De), n(e(De))],
107
- [1, He, t(He), e(He), n(e(He))],
108
- [2, Se, t(Se), e(Se), n(e(Se))],
109
- [1, qe, t(qe), e(qe), n(e(qe))],
110
- [0, bt, t(bt), e(bt), n(e(bt))],
111
- [2, xt, t(xt), e(xt), n(e(xt))],
112
- [1, kt, t(kt), e(kt), n(e(kt))],
113
- [0, Pt, t(Pt), e(Pt), n(e(Pt))],
114
- [1, Ct, t(Ct), e(Ct), n(e(Ct))],
96
+ [0, O, t(O), e(O), n(e(O))],
97
+ [1, ze, t(ze), e(ze), n(e(ze))],
98
+ [0, We, t(We), e(We), n(e(We))],
115
99
  [2, Et, t(Et), e(Et), n(e(Et))],
100
+ [1, Lt, t(Lt), e(Lt), n(e(Lt))],
101
+ [0, Bt, t(Bt), e(Bt), n(e(Bt))],
102
+ [2, Mt, t(Mt), e(Mt), n(e(Mt))],
116
103
  [0, $t, t($t), e($t), n(e($t))],
117
- [1, Ne, t(Ne), e(Ne), n(e(Ne))],
118
- [2, ze, t(ze), e(ze), n(e(ze))],
104
+ [1, Tt, t(Tt), e(Tt), n(e(Tt))],
105
+ [2, Ft, t(Ft), e(Ft), n(e(Ft))],
106
+ [0, Ae, t(Ae), e(Ae), n(e(Ae))],
107
+ [1, De, t(De), e(De), n(e(De))],
108
+ [2, Re, t(Re), e(Re), n(e(Re))],
109
+ [1, Se, t(Se), e(Se), n(e(Se))],
110
+ [0, yt, t(yt), e(yt), n(e(yt))],
111
+ [2, wt, t(wt), e(wt), n(e(wt))],
112
+ [1, bt, t(bt), e(bt), n(e(bt))],
113
+ [0, xt, t(xt), e(xt), n(e(xt))],
114
+ [1, kt, t(kt), e(kt), n(e(kt))],
115
+ [2, Pt, t(Pt), e(Pt), n(e(Pt))],
116
+ [0, Ct, t(Ct), e(Ct), n(e(Ct))],
117
+ [1, qe, t(qe), e(qe), n(e(qe))],
118
+ [2, Ne, t(Ne), e(Ne), n(e(Ne))],
119
119
  [0, Me, t(Me), e(Me), n(e(Me))],
120
- [2, Te, t(Te), e(Te), n(e(Te))],
121
- [1, vt, t(vt), e(vt), n(e(vt))],
122
- [0, ht, t(ht), e(ht), n(e(ht))],
120
+ [2, $e, t($e), e($e), n(e($e))],
121
+ [1, ft, t(ft), e(ft), n(e(ft))],
122
+ [0, vt, t(vt), e(vt), n(e(vt))],
123
+ [2, dt, t(dt), e(dt), n(e(dt))],
124
+ [1, ht, t(ht), e(ht), n(e(ht))],
123
125
  [2, pt, t(pt), e(pt), n(e(pt))],
124
- [1, mt, t(mt), e(mt), n(e(mt))],
125
- [2, gt, t(gt), e(gt), n(e(gt))],
126
- [0, wt, t(wt), e(wt), n(e(wt))],
127
- [1, yt, t(yt), e(yt), n(e(yt))],
128
- [2, Fe, t(Fe), e(Fe), n(e(Fe))],
129
- [0, Re, t(Re), e(Re), n(e(Re))],
126
+ [0, mt, t(mt), e(mt), n(e(mt))],
127
+ [1, gt, t(gt), e(gt), n(e(gt))],
128
+ [2, Te, t(Te), e(Te), n(e(Te))],
129
+ [0, Fe, t(Fe), e(Fe), n(e(Fe))],
130
130
  [1, I, t(I), e(I), n(e(I))],
131
- [0, _, t(_), e(_), n(e(_))],
132
- [2, ke, t(ke), e(ke), n(e(ke))],
133
- [1, Pe, t(Pe), e(Pe), n(e(Pe))],
134
- [0, Ce, t(Ce), e(Ce), n(e(Ce))],
135
- [2, Ee, t(Ee), e(Ee), n(e(Ee))],
136
- [0, $e, t($e), e($e), n(e($e))],
131
+ [0, J, t(J), e(J), n(e(J))],
132
+ [2, xe, t(xe), e(xe), n(e(xe))],
133
+ [1, ke, t(ke), e(ke), n(e(ke))],
134
+ [0, Pe, t(Pe), e(Pe), n(e(Pe))],
135
+ [2, Ce, t(Ce), e(Ce), n(e(Ce))],
136
+ [0, Ee, t(Ee), e(Ee), n(e(Ee))],
137
137
  [1, Le, t(Le), e(Le), n(e(Le))],
138
138
  [2, Be, t(Be), e(Be), n(e(Be))],
139
- [0, ee, t(ee), e(ee), n(e(ee))],
140
- [1, te, t(te), e(te), n(e(te))],
141
- [2, Z, t(Z), e(Z), n(e(Z))],
142
- [1, j, t(j), e(j), n(e(j))],
143
- [0, pe, t(pe), e(pe), n(e(pe))],
144
- [2, me, t(me), e(me), n(e(me))],
145
- [1, ge, t(ge), e(ge), n(e(ge))],
146
- [0, we, t(we), e(we), n(e(we))],
139
+ [0, _, t(_), e(_), n(e(_))],
140
+ [1, ee, t(ee), e(ee), n(e(ee))],
141
+ [2, U, t(U), e(U), n(e(U))],
142
+ [1, Z, t(Z), e(Z), n(e(Z))],
143
+ [0, he, t(he), e(he), n(e(he))],
144
+ [2, pe, t(pe), e(pe), n(e(pe))],
145
+ [1, me, t(me), e(me), n(e(me))],
146
+ [0, ge, t(ge), e(ge), n(e(ge))],
147
147
  [1, ye, t(ye), e(ye), n(e(ye))],
148
- [2, be, t(be), e(be), n(e(be))],
149
- [0, xe, t(xe), e(xe), n(e(xe))],
150
- [1, G, t(G), e(G), n(e(G))],
151
- [2, J, t(J), e(J), n(e(J))]
152
- ], No = [
153
- ["11", r(le, se, i), t(r(le, se, i))],
154
- ["10", r(ne, oe, i), t(r(ne, oe, i))],
155
- ["9", r(Ge, je, i), t(r(Ge, je, i))],
156
- ["8", r(Ve, Qe, i), t(r(Ve, Qe, i))],
157
- ["7", r(Xe, Oe, i), t(r(Xe, Oe, i))],
158
- ["6", r(S, D, i), t(r(S, D, i))],
159
- ["5", r(Ae, We, i), t(r(Ae, We, i))],
160
- ["4", r(qe, Se, i), t(r(qe, Se, i))],
161
- ["3", r(Te, Me, i), t(r(Te, Me, i))],
162
- ["2", r(_, I, i), t(r(_, I, i))],
163
- ["1", r(j, Z, i), t(r(j, Z, i))],
164
- ["a", r(I, Z, i), t(r(I, Z, i))],
165
- ["b", r(_, j, i), t(r(_, j, i))],
166
- ["c", r(ke, pe, i), t(r(ke, pe, i))],
167
- ["d", r(Pe, me, i), t(r(Pe, me, i))],
168
- ["e", r(Ce, ge, i), t(r(Ce, ge, i))],
169
- ["f", r(Ee, we, i), t(r(Ee, we, i))],
170
- ["g", r($e, ye, i), t(r($e, ye, i))],
171
- ["h", r(Le, be, i), t(r(Le, be, i))],
172
- ["i", r(Be, xe, i), t(r(Be, xe, i))],
173
- ["k", r(ee, G, i), t(r(ee, G, i))],
174
- ["l", r(te, J, i), t(r(te, J, i))],
175
- ["1", r(G, J, i), t(r(G, J, i))],
176
- ["2", r(ee, te, i), t(r(ee, te, i))],
177
- ["3", r(Fe, Re, i), t(r(Fe, Re, i))],
178
- ["4", r(Ne, ze, i), t(r(Ne, ze, i))],
179
- ["5", r(De, He, i), t(r(De, He, i))],
180
- ["6", r(z, X, i), t(r(z, X, i))],
181
- ["7", r(Ye, Ke, i), t(r(Ye, Ke, i))],
182
- ["8", r(Ue, Ze, i), t(r(Ue, Ze, i))],
183
- ["9", r(Je, Ie, i), t(r(Je, Ie, i))],
184
- ["10", r(ne, le, i), t(r(ne, le, i))],
185
- ["11", r(oe, se, i), t(r(oe, se, i))]
148
+ [2, we, t(we), e(we), n(e(we))],
149
+ [0, be, t(be), e(be), n(e(be))],
150
+ [1, j, t(j), e(j), n(e(j))],
151
+ [2, G, t(G), e(G), n(e(G))]
186
152
  ], zo = [
153
+ ["11", r(ne, le, u), t(r(ne, le, u))],
154
+ ["10", r(oe, te, u), t(r(oe, te, u))],
155
+ ["9", r(je, Ze, u), t(r(je, Ze, u))],
156
+ ["8", r(Qe, Ke, u), t(r(Qe, Ke, u))],
157
+ ["7", r(Oe, He, u), t(r(Oe, He, u))],
158
+ ["6", r(S, A, u), t(r(S, A, u))],
159
+ ["5", r(We, ze, u), t(r(We, ze, u))],
160
+ ["4", r(Se, Re, u), t(r(Se, Re, u))],
161
+ ["3", r($e, Me, u), t(r($e, Me, u))],
162
+ ["2", r(J, I, u), t(r(J, I, u))],
163
+ ["1", r(Z, U, u), t(r(Z, U, u))],
164
+ ["a", r(I, U, u), t(r(I, U, u))],
165
+ ["b", r(J, Z, u), t(r(J, Z, u))],
166
+ ["c", r(xe, he, u), t(r(xe, he, u))],
167
+ ["d", r(ke, pe, u), t(r(ke, pe, u))],
168
+ ["e", r(Pe, me, u), t(r(Pe, me, u))],
169
+ ["f", r(Ce, ge, u), t(r(Ce, ge, u))],
170
+ ["g", r(Ee, ye, u), t(r(Ee, ye, u))],
171
+ ["h", r(Le, we, u), t(r(Le, we, u))],
172
+ ["i", r(Be, be, u), t(r(Be, be, u))],
173
+ ["k", r(_, j, u), t(r(_, j, u))],
174
+ ["l", r(ee, G, u), t(r(ee, G, u))],
175
+ ["1", r(j, G, u), t(r(j, G, u))],
176
+ ["2", r(_, ee, u), t(r(_, ee, u))],
177
+ ["3", r(Te, Fe, u), t(r(Te, Fe, u))],
178
+ ["4", r(qe, Ne, u), t(r(qe, Ne, u))],
179
+ ["5", r(Ae, De, u), t(r(Ae, De, u))],
180
+ ["6", r(z, O, u), t(r(z, O, u))],
181
+ ["7", r(Xe, Ye, u), t(r(Xe, Ye, u))],
182
+ ["8", r(Ve, Ue, u), t(r(Ve, Ue, u))],
183
+ ["9", r(Ge, Ie, u), t(r(Ge, Ie, u))],
184
+ ["10", r(oe, ne, u), t(r(oe, ne, u))],
185
+ ["11", r(te, le, u), t(r(te, le, u))]
186
+ ], Wo = [
187
187
  o[
188
188
  0
189
189
  /* f11 */
@@ -557,30 +557,30 @@ const he = 23.6, So = {
557
557
  /* e10 */
558
558
  ][3][0]
559
559
  ];
560
- function Yt(u) {
561
- if (u.length === 0)
560
+ function Ot(i) {
561
+ if (i.length === 0)
562
562
  return "";
563
- const [$, ...d] = u;
564
- let V = `M ${R(de($[0]))} ${R(ve($[1]))} L `;
565
- for (const F of d)
566
- V += `${R(de(F[0]))} ${R(ve(F[1]))} `;
567
- return `${V} Z`;
563
+ const [B, ...v] = i;
564
+ let Q = `M ${R(fe(B[0]))} ${R(ve(B[1]))} L `;
565
+ for (const F of v)
566
+ Q += `${R(fe(F[0]))} ${R(ve(F[1]))} `;
567
+ return `${Q} Z`;
568
568
  }
569
- function R(u) {
570
- return u.toFixed(8);
569
+ function R(i) {
570
+ return i.toFixed(8);
571
571
  }
572
- const Wo = {
572
+ const Ao = {
573
573
  viewBox: "0 0 50 50",
574
574
  xmlns: "http://www.w3.org/2000/svg"
575
- }, Ao = ["textContent", "fill"], Do = /* @__PURE__ */ ao({
575
+ }, Do = ["textContent", "fill"], Ho = /* @__PURE__ */ fo({
576
576
  __name: "Letter",
577
577
  props: {
578
578
  type: {}
579
579
  },
580
- setup(u) {
581
- return ($, d) => (b(), P("svg", Wo, [
582
- fo("text", {
583
- textContent: vo(u.type),
580
+ setup(i) {
581
+ return (B, v) => (x(), C("svg", Ao, [
582
+ vo("text", {
583
+ textContent: ho(i.type),
584
584
  "dominant-baseline": "middle",
585
585
  "font-family": "sans-serif",
586
586
  "font-size": "30",
@@ -590,23 +590,23 @@ const Wo = {
590
590
  y: "27",
591
591
  stroke: "oklch(37.3% 0.034 259.733)",
592
592
  "stroke-width": "2",
593
- fill: u.type === u.type.toLowerCase() ? "oklch(13% 0.028 261.692)" : "oklch(98.5% 0.002 247.839)"
594
- }, null, 8, Ao)
593
+ fill: i.type === i.type.toLowerCase() ? "oklch(13% 0.028 261.692)" : "oklch(98.5% 0.002 247.839)"
594
+ }, null, 8, Do)
595
595
  ]));
596
596
  }
597
- }), Ho = ["viewBox"], Oo = ["d", "fill"], Xo = ["d", "data-hexboard-position", "data-testid", "fill"], Yo = ["d", "data-testid", "fill"], Ko = ["d", "data-testid", "fill"], Qo = ["textContent", "data-testid", "x", "y"], Vo = ["cx", "cy", "data-testid", "fill"], Uo = ["viewBox"], Go = /* @__PURE__ */ ao({
597
+ }), Oo = ["viewBox"], Xo = ["d", "fill"], Yo = ["d", "data-hexboard-position", "fill"], Ko = ["d", "fill"], Qo = ["d", "fill"], Vo = ["textContent", "x", "y"], Uo = ["cx", "cy", "fill"], Zo = ["viewBox"], Io = /* @__PURE__ */ fo({
598
598
  __name: "Hexboard",
599
- props: /* @__PURE__ */ so({
599
+ props: /* @__PURE__ */ uo({
600
600
  active: { type: Boolean, default: !1 },
601
601
  autoselect: { type: Boolean, default: !1 },
602
602
  flipped: { type: Boolean, default: !1 },
603
- hexchess: { default: () => co.init() },
603
+ hexchess: { default: () => ao.init() },
604
604
  highlight: { default: () => [] },
605
605
  ignoreTurn: { type: Boolean, default: !1 },
606
606
  options: { default: () => ({}) },
607
- pieces: { default: () => Do },
607
+ pieces: { default: () => Ho },
608
608
  playing: { type: [String, Boolean], default: !1 },
609
- position: { default: qo }
609
+ position: { default: No }
610
610
  }, {
611
611
  "mouseover-position": {
612
612
  default: null,
@@ -624,215 +624,217 @@ const Wo = {
624
624
  },
625
625
  targetsModifiers: {}
626
626
  }),
627
- emits: /* @__PURE__ */ so(["clickPosition", "move"], ["update:mouseover-position", "update:selected", "update:targets"]),
628
- setup(u, { emit: $ }) {
629
- const d = u, V = $, F = Zt(u, "mouseover-position"), L = Zt(u, "selected"), Y = Zt(u, "targets"), _e = tt({ x: 0, y: 0 }), B = tt(null), ce = tt(re()), h = tt({
627
+ emits: /* @__PURE__ */ uo(["clickPosition", "move"], ["update:mouseover-position", "update:selected", "update:targets"]),
628
+ setup(i, { emit: B }) {
629
+ const v = i, Q = B, F = Zt(i, "mouseover-position"), b = Zt(i, "selected"), X = Zt(i, "targets"), Je = et({ x: 0, y: 0 }), M = et(null), ie = et(se()), h = et({
630
630
  hexchess: null,
631
631
  promotionEl: null,
632
632
  promotionFrom: null,
633
633
  promotionTo: null,
634
634
  selected: null
635
- }), Kt = Co("svgEl"), K = tt(re());
636
- let Qt = !1;
637
- const ho = W(() => h.value.hexchess ? [] : Y.value), ae = W(() => h.value.hexchess ? h.value.hexchess : d.hexchess ? d.hexchess : co.init()), po = W(() => ae.value.board.reduce(
638
- (s, f, a) => (f && a !== B.value && s.push({ piece: f, index: a }), s),
635
+ }), Xt = Co("svgEl"), Y = et(se());
636
+ let Yt = !1;
637
+ const po = W(() => h.value.hexchess ? [] : X.value), ce = W(() => h.value.hexchess ? h.value.hexchess : v.hexchess ? v.hexchess : ao.init()), mo = W(() => ce.value.board.reduce(
638
+ (s, f, c) => (f && c !== M.value && s.push({ piece: f, index: c }), s),
639
639
  []
640
- )), st = W(() => typeof h.value.selected == "number" ? null : L.value), jt = W(() => {
641
- var s, f, a;
642
- if (Vt.value)
640
+ )), Kt = W(() => typeof h.value.selected == "number" ? null : b.value), Gt = W(() => {
641
+ var s, f, c;
642
+ if (Qt.value)
643
643
  return "grabbing";
644
- if (!(!d.active || F.value === null || h.value.hexchess)) {
645
- if (L.value !== null && Y.value.includes(F.value)) {
646
- const v = (s = ae.value) == null ? void 0 : s.board[L.value];
647
- if (v) {
648
- const g = v === v.toLowerCase() ? "b" : "w", C = ((f = ae.value) == null ? void 0 : f.turn) === g;
649
- if ((d.playing === !0 || C) && ut(L.value))
644
+ if (!(!v.active || F.value === null || h.value.hexchess)) {
645
+ if (b.value !== null && X.value.includes(F.value)) {
646
+ const d = (s = ce.value) == null ? void 0 : s.board[b.value];
647
+ if (d) {
648
+ const g = d === d.toLowerCase() ? "b" : "w", E = ((f = ce.value) == null ? void 0 : f.turn) === g;
649
+ if ((v.playing === !0 || E) && rt(b.value))
650
650
  return "pointer";
651
651
  }
652
652
  }
653
- if (rt.value)
654
- return d.playing === !0 || d.playing && Jt.value === ((a = ae.value) == null ? void 0 : a.turn) && d.playing === Jt.value ? "grab" : "pointer";
653
+ if (lt.value)
654
+ return v.playing === !0 || v.playing && Jt.value === ((c = ce.value) == null ? void 0 : c.turn) && v.playing === Jt.value ? "grab" : "pointer";
655
655
  }
656
- }), Gt = W(() => ({
657
- x: _e.value.x - K.value.width / 2,
658
- y: _e.value.y - K.value.height / 2
659
- })), Vt = W(() => !d.hexchess || h.value.hexchess || B.value === null ? null : d.hexchess.board[B.value]), Q = W(() => ({ ...So, ...d.options })), Jt = W(() => rt.value ? rt.value === rt.value.toLowerCase() ? "b" : "w" : null), rt = W(() => {
656
+ }), It = W(() => ({
657
+ x: Je.value.x - Y.value.width / 2,
658
+ y: Je.value.y - Y.value.height / 2
659
+ })), Qt = W(() => !v.hexchess || h.value.hexchess || M.value === null ? null : v.hexchess.board[M.value]), K = W(() => ({ ...qo, ...v.options })), Jt = W(() => lt.value ? lt.value === lt.value.toLowerCase() ? "b" : "w" : null), lt = W(() => {
660
660
  var s;
661
- return F.value === null ? null : ((s = ae.value) == null ? void 0 : s.board[F.value]) ?? null;
662
- }), it = W(() => {
663
- var v;
664
- const s = (v = h.value.hexchess) == null ? void 0 : v.board[h.value.selected ?? -1], f = s === (s == null ? void 0 : s.toUpperCase()), a = (g) => (C) => To(d.pieces, { ...C, type: g });
661
+ return F.value === null ? null : ((s = ce.value) == null ? void 0 : s.board[F.value]) ?? null;
662
+ }), st = W(() => {
663
+ var d;
664
+ const s = (d = h.value.hexchess) == null ? void 0 : d.board[h.value.selected ?? -1], f = s === (s == null ? void 0 : s.toUpperCase()), c = (g) => (E) => Fo(v.pieces, { ...E, type: g });
665
665
  return {
666
- n: a(f ? "N" : "n"),
667
- b: a(f ? "B" : "b"),
668
- r: a(f ? "R" : "r"),
669
- q: a(f ? "Q" : "q")
666
+ n: c(f ? "N" : "n"),
667
+ b: c(f ? "B" : "b"),
668
+ r: c(f ? "R" : "r"),
669
+ q: c(f ? "Q" : "q")
670
670
  };
671
671
  });
672
672
  Eo(() => {
673
- d.active && It();
674
- }), $o(lo), ro(jt, (s) => {
673
+ v.autoselect && so();
674
+ }), Lo(() => {
675
+ v.active && _t();
676
+ }), Bo(ro), jt(Gt, (s) => {
675
677
  document.body.style.setProperty(
676
678
  "cursor",
677
679
  s === "grabbing" ? "grabbing" : null
678
680
  );
679
- }), ro(
680
- () => d.active,
681
- (s) => s ? It() : lo()
682
- );
683
- function Ut(s, f) {
684
- var C, ie;
685
- if (!Y.value.includes(s.to))
681
+ }), jt(
682
+ () => v.active,
683
+ (s) => s ? _t() : ro()
684
+ ), jt(b, so);
685
+ function Vt(s, f) {
686
+ var E, re;
687
+ if (!X.value.includes(s.to))
686
688
  return;
687
- const a = (C = d.hexchess) == null ? void 0 : C.board[s.from];
688
- if (!a)
689
+ const c = (E = v.hexchess) == null ? void 0 : E.board[s.from];
690
+ if (!c)
689
691
  return;
690
- const v = a === a.toLowerCase() ? "b" : "w", g = ((ie = d.hexchess) == null ? void 0 : ie.turn) === v;
691
- if (d.hexchess && (a === "p" || a === "P") && Fo(s.to, v)) {
692
- const fe = d.hexchess.clone();
693
- fe.board[s.from] = null, fe.board[s.to] = a, h.value = {
694
- hexchess: fe,
692
+ const d = c === c.toLowerCase() ? "b" : "w", g = ((re = v.hexchess) == null ? void 0 : re.turn) === d;
693
+ if (v.hexchess && (c === "p" || c === "P") && Ro(s.to, d)) {
694
+ const Ut = v.hexchess.clone();
695
+ Ut.board[s.from] = null, Ut.board[s.to] = c, h.value = {
696
+ hexchess: Ut,
695
697
  promotionEl: (f == null ? void 0 : f.target) instanceof Element ? f.target : null,
696
698
  promotionFrom: s.from,
697
699
  promotionTo: s.to,
698
700
  selected: s.to
699
- }, (f == null ? void 0 : f.target) instanceof Element && (ce.value = f.target.getBoundingClientRect());
701
+ }, (f == null ? void 0 : f.target) instanceof Element && (ie.value = f.target.getBoundingClientRect());
700
702
  return;
701
703
  }
702
- ut(s.from) && (d.ignoreTurn || g) && eo(s);
704
+ rt(s.from) && (v.ignoreTurn || g) && to(s);
703
705
  }
704
- function ut(s) {
705
- var v;
706
- const f = (v = d.hexchess) == null ? void 0 : v.board[s];
706
+ function _e() {
707
+ const s = h.value.promotionFrom;
708
+ h.value = {
709
+ hexchess: null,
710
+ promotionEl: null,
711
+ promotionFrom: null,
712
+ promotionTo: null,
713
+ selected: null
714
+ }, typeof s == "number" && (b.value = s), M.value = null, Yt = !0;
715
+ }
716
+ function go(s) {
717
+ var f, c;
718
+ return F.value === null ? K.value.labelColor : (f = ae(F.value)) != null && f.startsWith(s) || (c = ae(F.value)) != null && c.endsWith(s) ? K.value.labelActiveColor : K.value.labelInactiveColor;
719
+ }
720
+ function rt(s) {
721
+ var d;
722
+ const f = (d = v.hexchess) == null ? void 0 : d.board[s];
707
723
  if (!f)
708
724
  return !1;
709
- const a = f === f.toLowerCase() ? "b" : "w";
710
- return d.playing === !0 || d.playing === a;
725
+ const c = f === f.toLowerCase() ? "b" : "w";
726
+ return v.playing === !0 || v.playing === c;
711
727
  }
712
- function mo(s) {
713
- var f, a;
714
- return F.value === null ? Q.value.labelColor : (f = A(F.value)) != null && f.startsWith(s) || (a = A(F.value)) != null && a.endsWith(s) ? Q.value.labelActiveColor : Q.value.labelInactiveColor;
728
+ function _t() {
729
+ Je.value = { x: 0, y: 0 }, window.addEventListener("keyup", eo), window.addEventListener("pointermove", oo), window.addEventListener("pointerup", no), window.addEventListener("resize", ut), window.addEventListener("scroll", ut), window.addEventListener("touchmove", lo, { passive: !1 });
715
730
  }
716
- function It() {
717
- _e.value = { x: 0, y: 0 }, window.addEventListener("keyup", _t), window.addEventListener("pointermove", to), window.addEventListener("pointerup", no), window.addEventListener("resize", ct), window.addEventListener("scroll", ct), window.addEventListener("touchmove", oo, { passive: !1 });
718
- }
719
- function ct() {
731
+ function ut() {
720
732
  var s;
721
- ce.value = ((s = h.value.promotionEl) == null ? void 0 : s.getBoundingClientRect()) ?? re();
733
+ ie.value = ((s = h.value.promotionEl) == null ? void 0 : s.getBoundingClientRect()) ?? se();
722
734
  }
723
- function go(s, f) {
724
- if (d.active) {
725
- if (Qt) {
726
- Qt = !1;
735
+ function yo(s, f) {
736
+ if (v.active) {
737
+ if (Yt) {
738
+ Yt = !1;
727
739
  return;
728
740
  }
729
741
  if (h.value.hexchess) {
730
- h.value.selected !== s && et();
742
+ h.value.selected !== s && _e();
731
743
  return;
732
744
  }
733
- if (L.value !== null && Y.value.includes(s)) {
734
- const a = new dt({ from: L.value, to: s });
735
- Ut(a, f);
745
+ if (b.value !== null && X.value.includes(s)) {
746
+ const c = new at({ from: b.value, to: s });
747
+ Vt(c, f);
736
748
  return;
737
749
  }
738
- d.autoselect && !d.hexchess.board[s] && (L.value = null, Y.value = []), V("clickPosition", s);
750
+ v.autoselect && !v.hexchess.board[s] && (b.value = null), Q("clickPosition", s);
739
751
  }
740
752
  }
741
- function _t(s) {
753
+ function eo(s) {
742
754
  if (s.key === "Escape") {
743
755
  if (h.value.hexchess) {
744
- et();
756
+ _e();
745
757
  return;
746
758
  }
747
- d.autoselect && (L.value = null, Y.value = []);
759
+ v.autoselect && (b.value = null);
748
760
  }
749
761
  }
750
- function eo(s) {
751
- V("move", s), at();
762
+ function wo(s) {
763
+ F.value = s;
764
+ }
765
+ function bo() {
766
+ F.value = null;
767
+ }
768
+ function to(s) {
769
+ Q("move", s), it();
770
+ }
771
+ function xo(s, f) {
772
+ var E, re;
773
+ if (f.preventDefault(), h.value.hexchess || b.value !== null && X.value.includes(s))
774
+ return;
775
+ const c = (E = v.hexchess) == null ? void 0 : E.board[s];
776
+ if (!c || (v.autoselect && (b.value = s), !rt(s)))
777
+ return;
778
+ const d = c === c.toLowerCase() ? "b" : "w", g = ((re = v.hexchess) == null ? void 0 : re.turn) === d;
779
+ !v.ignoreTurn && !g || (M.value = s, Je.value = { x: f.clientX, y: f.clientY }, Xt.value instanceof Element && (Y.value = Xt.value.getBoundingClientRect()));
780
+ }
781
+ function oo(s) {
782
+ v.active && (Je.value = { x: s.clientX, y: s.clientY });
752
783
  }
753
- function wo(s, f) {
754
- var a;
755
- if (f.stopPropagation(), B.value !== null) {
756
- let v = s;
784
+ function ko(s, f) {
785
+ var c;
786
+ if (f.stopPropagation(), M.value !== null) {
787
+ let d = s;
757
788
  const g = document.elementFromPoint(
758
789
  f.clientX,
759
790
  f.clientY
760
- ), C = g == null ? void 0 : g.getAttribute("data-hexboard-position");
761
- C !== null && (v = Number(C));
762
- const ie = new dt({ from: B.value, to: v });
763
- if (Ut(ie, f), h.value.hexchess)
791
+ ), E = g == null ? void 0 : g.getAttribute("data-hexboard-position");
792
+ E !== null && (d = Number(E));
793
+ const re = new at({ from: M.value, to: d });
794
+ if (Vt(re, f), h.value.hexchess)
764
795
  return;
765
- B.value = null, K.value = re();
796
+ M.value = null, Y.value = se();
766
797
  return;
767
798
  }
768
- if (L.value !== null && Y.value.includes(s)) {
769
- const v = new dt({ from: L.value, to: s });
770
- return Ut(v, f), h.value.hexchess, void 0;
799
+ if (b.value !== null && X.value.includes(s)) {
800
+ const d = new at({ from: b.value, to: s });
801
+ return Vt(d, f), h.value.hexchess, void 0;
771
802
  }
772
803
  if (h.value.hexchess) {
773
- et();
804
+ _e();
774
805
  return;
775
806
  }
776
- if ((a = d.hexchess) != null && a.board[s]) {
777
- B.value = null, K.value = re();
807
+ if ((c = v.hexchess) != null && c.board[s]) {
808
+ M.value = null, Y.value = se();
778
809
  return;
779
810
  }
780
- at();
781
- }
782
- function et() {
783
- const s = h.value.promotionFrom;
784
- h.value = {
785
- hexchess: null,
786
- promotionEl: null,
787
- promotionFrom: null,
788
- promotionTo: null,
789
- selected: null
790
- }, typeof s == "number" && (L.value = s, Y.value = d.hexchess.movesFrom(s).map((f) => f.to) ?? []), B.value = null, Qt = !0;
791
- }
792
- function yo(s, f) {
793
- var C, ie, fe;
794
- if (f.preventDefault(), h.value.hexchess)
795
- return;
796
- const a = (C = d.hexchess) == null ? void 0 : C.board[s];
797
- if (!a || (d.autoselect && (L.value = s, Y.value = ((ie = d.hexchess) == null ? void 0 : ie.movesFrom(s).map((Po) => Po.to)) ?? []), !ut(s)))
798
- return;
799
- const v = a === a.toLowerCase() ? "b" : "w", g = ((fe = d.hexchess) == null ? void 0 : fe.turn) === v;
800
- !d.ignoreTurn && !g || (B.value = s, _e.value = { x: f.clientX, y: f.clientY }, Kt.value instanceof Element && (K.value = Kt.value.getBoundingClientRect()));
801
- }
802
- function bo(s) {
803
- F.value = s;
804
- }
805
- function xo() {
806
- F.value = null;
807
- }
808
- function to(s) {
809
- d.active && (_e.value = { x: s.clientX, y: s.clientY });
810
- }
811
- function oo(s) {
812
- B.value !== null && s.preventDefault();
811
+ it();
813
812
  }
814
813
  function no() {
815
814
  if (h.value.hexchess) {
816
- et();
815
+ _e();
817
816
  return;
818
817
  }
819
- if (B.value !== null) {
820
- B.value = null, K.value = re();
818
+ if (M.value !== null) {
819
+ M.value = null, Y.value = se();
821
820
  return;
822
821
  }
823
- at();
822
+ it();
823
+ }
824
+ function lo(s) {
825
+ M.value !== null && s.preventDefault();
824
826
  }
825
- function ko(s) {
826
- if (typeof h.value.promotionFrom == "number" && ut(h.value.promotionFrom)) {
827
- const f = new dt({
827
+ function Po(s) {
828
+ if (typeof h.value.promotionFrom == "number" && rt(h.value.promotionFrom)) {
829
+ const f = new at({
828
830
  from: h.value.promotionFrom ?? 0,
829
831
  to: h.value.promotionTo ?? 0,
830
832
  promotion: s
831
833
  });
832
- eo(f);
834
+ to(f);
833
835
  }
834
836
  }
835
- function re() {
837
+ function se() {
836
838
  return {
837
839
  bottom: 0,
838
840
  height: 0,
@@ -844,151 +846,148 @@ const Wo = {
844
846
  y: 0
845
847
  };
846
848
  }
847
- function at() {
848
- document.body.style.setProperty("cursor", null), B.value = null, L.value = null, h.value = {
849
+ function it() {
850
+ document.body.style.setProperty("cursor", null), M.value = null, b.value = null, h.value = {
849
851
  hexchess: null,
850
852
  promotionEl: null,
851
853
  promotionFrom: null,
852
854
  promotionTo: null,
853
855
  selected: null
854
- }, K.value = re(), Y.value = [];
856
+ }, Y.value = se(), X.value = [];
857
+ }
858
+ function so() {
859
+ var s;
860
+ typeof b.value == "number" ? X.value = ((s = v.hexchess) == null ? void 0 : s.movesFrom(b.value).map((f) => f.to)) ?? [] : X.value = [];
855
861
  }
856
- function lo() {
857
- at(), window.removeEventListener("keyup", _t), window.removeEventListener("pointermove", to), window.removeEventListener("pointerup", no), window.removeEventListener("resize", ct), window.removeEventListener("scroll", ct), window.removeEventListener("touchmove", oo);
862
+ function ro() {
863
+ it(), window.removeEventListener("keyup", eo), window.removeEventListener("pointermove", oo), window.removeEventListener("pointerup", no), window.removeEventListener("resize", ut), window.removeEventListener("scroll", ut), window.removeEventListener("touchmove", lo);
858
864
  }
859
- return (s, f) => (b(), P("div", null, [
860
- (b(), P("svg", {
865
+ return (s, f) => (x(), C("div", null, [
866
+ (x(), C("svg", {
861
867
  xmlns: "http://www.w3.org/2000/svg",
862
868
  ref_key: "svgEl",
863
- ref: Kt,
864
- style: ft({ cursor: jt.value }),
865
- viewBox: `0 0 ${c(he)} ${c(he)}`
869
+ ref: Xt,
870
+ style: ct({ cursor: Gt.value }),
871
+ viewBox: `0 0 ${a(de)} ${a(de)}`
866
872
  }, [
867
- fo("path", {
868
- d: c(Yt)(c(zo)),
869
- fill: Q.value.colors[1],
873
+ vo("path", {
874
+ d: a(Ot)(a(Wo)),
875
+ fill: K.value.colors[1],
870
876
  style: { pointerEvents: "none" }
871
- }, null, 8, Oo),
872
- (b(!0), P(nt, null, lt(c(o), (a, v) => (b(), P("path", Lo(
877
+ }, null, 8, Xo),
878
+ (x(!0), C(ot, null, nt(a(o), (c, d) => (x(), C("path", Mo(
873
879
  { ref_for: !0 },
874
- u.active ? {
875
- onClick: (g) => go(v, g),
876
- onMouseenter: () => bo(v),
877
- onMouseleave: () => xo(),
878
- onPointerdown: (g) => yo(v, g),
879
- onPointerup: (g) => wo(v, g)
880
+ i.active ? {
881
+ onClick: (g) => yo(d, g),
882
+ onMouseenter: () => wo(d),
883
+ onMouseleave: () => bo(),
884
+ onPointerdown: (g) => xo(d, g),
885
+ onPointerup: (g) => ko(d, g)
880
886
  } : {},
881
887
  {
882
- d: c(Yt)(u.flipped ? a[4] : a[3]),
883
- "data-hexboard-position": v,
884
- "data-testid": `position-${c(A)(v)}`,
885
- fill: Q.value.colors[c(o)[v][0]],
886
- key: v
888
+ d: a(Ot)(i.flipped ? c[4] : c[3]),
889
+ "data-hexboard-position": d,
890
+ fill: K.value.colors[a(o)[d][0]],
891
+ key: d
887
892
  }
888
- ), null, 16, Xo))), 128)),
889
- (b(!0), P(nt, null, lt(u.highlight, (a) => (b(), P("path", {
890
- d: c(Yt)(u.flipped ? c(o)[a][4] : c(o)[a][3]),
891
- "data-testid": `highlight-${c(A)(a)}`,
892
- fill: Q.value.highlightColor,
893
- key: `highlight-${a}`,
893
+ ), null, 16, Yo))), 128)),
894
+ (x(!0), C(ot, null, nt(i.highlight, (c) => (x(), C("path", {
895
+ d: a(Ot)(i.flipped ? a(o)[c][4] : a(o)[c][3]),
896
+ fill: K.value.highlightColor,
897
+ key: `highlight-${c}`,
894
898
  style: { pointerEvents: "none" }
895
- }, null, 8, Yo))), 128)),
896
- typeof st.value == "number" ? (b(), P("path", {
899
+ }, null, 8, Ko))), 128)),
900
+ typeof Kt.value == "number" ? (x(), C("path", {
897
901
  key: 0,
898
- d: c(Yt)(u.flipped ? c(o)[st.value][4] : c(o)[st.value][3]),
899
- "data-testid": `selected-${c(A)(st.value)}`,
900
- fill: Q.value.selectedColor,
902
+ d: a(Ot)(i.flipped ? a(o)[Kt.value][4] : a(o)[Kt.value][3]),
903
+ fill: K.value.selectedColor,
901
904
  ref: "selectedEl",
902
905
  style: { pointerEvents: "none" }
903
- }, null, 8, Ko)) : ot("", !0),
904
- Q.value.labels ? (b(!0), P(nt, { key: 1 }, lt(c(No), ([a, v, g], C) => (b(), P("text", {
905
- textContent: vo(a),
906
+ }, null, 8, Qo)) : tt("", !0),
907
+ K.value.labels ? (x(!0), C(ot, { key: 1 }, nt(a(zo), ([c, d, g], E) => (x(), C("text", {
908
+ textContent: ho(c),
906
909
  "dominant-baseline": "central",
907
910
  "text-anchor": "middle",
908
- "data-testid": `label-${a}`,
909
- key: `label-${C}`,
910
- style: ft({
911
- fill: mo(a),
911
+ key: `label-${E}`,
912
+ style: ct({
913
+ fill: go(c),
912
914
  fontSize: ".5px",
913
915
  pointerEvents: "none",
914
916
  userSelect: "none"
915
917
  }),
916
- x: c(R)(c(de)(u.flipped ? g[0] : v[0])),
917
- y: c(R)(c(ve)(u.flipped ? g[1] : v[1]))
918
- }, null, 12, Qo))), 128)) : ot("", !0),
919
- ae.value ? (b(!0), P(nt, { key: 2 }, lt(po.value, ({ piece: a, index: v }) => (b(), io(uo(u.pieces), {
920
- "data-piece-type": a,
921
- "data-testid": `piece-${c(A)(v)}`,
922
- height: c(U),
923
- key: `piece-${c(A)(v)}`,
918
+ x: a(R)(a(fe)(i.flipped ? g[0] : d[0])),
919
+ y: a(R)(a(ve)(i.flipped ? g[1] : d[1]))
920
+ }, null, 12, Vo))), 128)) : tt("", !0),
921
+ ce.value ? (x(!0), C(ot, { key: 2 }, nt(mo.value, ({ piece: c, index: d }) => (x(), io(co(i.pieces), {
922
+ "data-piece-type": c,
923
+ height: a(V),
924
+ key: `piece-${a(ae)(d)}`,
924
925
  style: { pointerEvents: "none" },
925
- type: a,
926
- width: c(U),
927
- x: c(R)(c(de)(c(o)[v][u.flipped ? 2 : 1][0] - c(U) / 2)),
928
- y: c(R)(c(ve)(c(o)[v][u.flipped ? 2 : 1][1] + c(U) / 2))
929
- }, null, 8, ["data-piece-type", "data-testid", "height", "type", "width", "x", "y"]))), 128)) : ot("", !0),
930
- (b(!0), P(nt, null, lt(ho.value, (a) => (b(), P("circle", {
931
- cx: c(R)(c(de)(c(o)[a][u.flipped ? 2 : 1][0])),
932
- cy: c(R)(c(ve)(c(o)[a][u.flipped ? 2 : 1][1])),
933
- "data-testid": `target-${c(A)(a)}`,
934
- fill: Q.value.targetColor,
935
- key: `target-${c(A)(a)}`,
926
+ type: c,
927
+ width: a(V),
928
+ x: a(R)(a(fe)(a(o)[d][i.flipped ? 2 : 1][0] - a(V) / 2)),
929
+ y: a(R)(a(ve)(a(o)[d][i.flipped ? 2 : 1][1] + a(V) / 2))
930
+ }, null, 8, ["data-piece-type", "height", "type", "width", "x", "y"]))), 128)) : tt("", !0),
931
+ (x(!0), C(ot, null, nt(po.value, (c) => (x(), C("circle", {
932
+ cx: a(R)(a(fe)(a(o)[c][i.flipped ? 2 : 1][0])),
933
+ cy: a(R)(a(ve)(a(o)[c][i.flipped ? 2 : 1][1])),
934
+ fill: K.value.targetColor,
935
+ key: `target-${a(ae)(c)}`,
936
936
  r: 0.3,
937
937
  style: { pointerEvents: "none" }
938
- }, null, 8, Vo))), 128))
939
- ], 12, Ho)),
940
- Vt.value ? (b(), P("svg", {
938
+ }, null, 8, Uo))), 128))
939
+ ], 12, Oo)),
940
+ Qt.value ? (x(), C("svg", {
941
941
  key: 0,
942
- "data-testid": "drag-piece",
943
942
  xmlns: "http://www.w3.org/2000/svg",
944
- style: ft({
945
- height: K.value.height + "px",
943
+ style: ct({
944
+ height: Y.value.height + "px",
946
945
  left: "0px",
947
946
  pointerEvents: "none",
948
947
  position: "fixed",
949
948
  top: "0px",
950
- transform: `translate(${Gt.value.x}px, ${Gt.value.y}px) scale(1.1)`,
951
- width: K.value.width + "px",
949
+ transform: `translate(${It.value.x}px, ${It.value.y}px) scale(1.1)`,
950
+ width: Y.value.width + "px",
952
951
  willChange: "transform"
953
952
  }),
954
- viewBox: `0 0 ${c(he)} ${c(he)}`
953
+ viewBox: `0 0 ${a(de)} ${a(de)}`
955
954
  }, [
956
- (b(), io(uo(u.pieces), {
957
- height: c(U),
955
+ (x(), io(co(i.pieces), {
956
+ height: a(V),
958
957
  style: { pointerEvents: "none" },
959
- type: Vt.value,
960
- width: c(U),
961
- x: c(R)(c(de)(c(U) / -2)),
962
- y: c(R)(c(ve)(c(U) / 2))
958
+ type: Qt.value,
959
+ width: a(V),
960
+ x: a(R)(a(fe)(a(V) / -2)),
961
+ y: a(R)(a(ve)(a(V) / 2))
963
962
  }, null, 8, ["height", "type", "width", "x", "y"]))
964
- ], 12, Uo)) : ot("", !0),
965
- typeof h.value.selected == "number" ? (b(), P("div", {
963
+ ], 12, Zo)) : tt("", !0),
964
+ typeof h.value.selected == "number" ? (x(), C("div", {
966
965
  key: 1,
967
- style: ft({
968
- height: ce.value.height + "px",
969
- left: ce.value.left + "px",
966
+ style: ct({
967
+ height: ie.value.height + "px",
968
+ left: ie.value.left + "px",
970
969
  position: "fixed",
971
- top: ce.value.top + "px",
972
- width: ce.value.width + "px"
970
+ top: ie.value.top + "px",
971
+ width: ie.value.width + "px"
973
972
  }),
974
- onPointerup: f[0] || (f[0] = Bo(() => {
973
+ onPointerup: f[0] || (f[0] = $o(() => {
975
974
  }, ["stop"]))
976
975
  }, [
977
- Mo(s.$slots, "promotion", {
978
- b: it.value.b,
979
- cancel: et,
980
- file: c(A)(h.value.selected)[0],
981
- n: it.value.n,
982
- promote: ko,
983
- q: it.value.q,
984
- r: it.value.r,
985
- rank: Number(c(A)(h.value.selected).slice(1))
976
+ To(s.$slots, "promotion", {
977
+ b: st.value.b,
978
+ cancel: _e,
979
+ file: a(ae)(h.value.selected)[0],
980
+ n: st.value.n,
981
+ promote: Po,
982
+ q: st.value.q,
983
+ r: st.value.r,
984
+ rank: Number(a(ae)(h.value.selected).slice(1))
986
985
  })
987
- ], 36)) : ot("", !0)
986
+ ], 36)) : tt("", !0)
988
987
  ]));
989
988
  }
990
989
  });
991
990
  export {
992
- Go as Hexboard,
993
- So as defaultOptions
991
+ Io as Hexboard,
992
+ qo as defaultOptions
994
993
  };