@zh-keyboard/vue 1.0.0 → 1.1.1

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.
@@ -1,36 +1,36 @@
1
1
  var Pe = Object.defineProperty;
2
- var _e = (e, o, s) => o in e ? Pe(e, o, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[o] = s;
3
- var T = (e, o, s) => _e(e, typeof o != "symbol" ? o + "" : o, s);
4
- import { onMounted as Q, nextTick as me, watch as Z, getCurrentScope as $e, onScopeDispose as Ee, getCurrentInstance as pe, toValue as B, shallowRef as G, computed as S, watchEffect as q, unref as n, ref as E, onUnmounted as ce, onBeforeUnmount as Se, defineComponent as I, createElementBlock as x, openBlock as y, Fragment as L, renderList as V, toDisplayString as D, createVNode as Le, createElementVNode as g, withModifiers as C, normalizeStyle as se, normalizeClass as O, mergeModels as ie, useModel as ke, createBlock as K, createCommentVNode as W, createTextVNode as re, withDirectives as Re, vShow as Te } from "vue";
2
+ var _e = (e, o, i) => o in e ? Pe(e, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[o] = i;
3
+ var R = (e, o, i) => _e(e, typeof o != "symbol" ? o + "" : o, i);
4
+ import { onMounted as Q, nextTick as fe, watch as X, getCurrentScope as Ee, onScopeDispose as $e, getCurrentInstance as me, toValue as B, shallowRef as G, computed as S, watchEffect as q, unref as n, ref as $, onUnmounted as de, onBeforeUnmount as Se, defineComponent as I, createElementBlock as x, openBlock as b, Fragment as L, renderList as V, toDisplayString as D, createVNode as Le, createElementVNode as g, withModifiers as C, normalizeStyle as pe, normalizeClass as O, mergeModels as se, useModel as ke, createBlock as K, createCommentVNode as W, createTextVNode as ie, withDirectives as Te, vShow as Re } from "vue";
5
5
  function ee(e) {
6
- return $e() ? (Ee(e), !0) : !1;
6
+ return Ee() ? ($e(e), !0) : !1;
7
7
  }
8
8
  const De = typeof window < "u" && typeof document < "u";
9
9
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
10
- const He = (e) => e != null, Me = Object.prototype.toString, Ve = (e) => Me.call(e) === "[object Object]", le = () => {
10
+ const Me = (e) => e != null, He = Object.prototype.toString, Ve = (e) => He.call(e) === "[object Object]", re = () => {
11
11
  };
12
12
  function Be(e, o) {
13
- function s(...a) {
14
- return new Promise((l, i) => {
15
- Promise.resolve(e(() => o.apply(this, a), { fn: o, thisArg: this, args: a })).then(l).catch(i);
13
+ function i(...a) {
14
+ return new Promise((r, s) => {
15
+ Promise.resolve(e(() => o.apply(this, a), { fn: o, thisArg: this, args: a })).then(r).catch(s);
16
16
  });
17
17
  }
18
- return s;
18
+ return i;
19
19
  }
20
20
  function Ie(e, o = {}) {
21
- let s, a, l = le;
22
- const i = (v) => {
23
- clearTimeout(v), l(), l = le;
21
+ let i, a, r = re;
22
+ const s = (c) => {
23
+ clearTimeout(c), r(), r = re;
24
24
  };
25
- let d;
26
- return (v) => {
27
- const b = B(e), h = B(o.maxWait);
28
- return s && i(s), b <= 0 || h !== void 0 && h <= 0 ? (a && (i(a), a = null), Promise.resolve(v())) : new Promise((u, p) => {
29
- l = o.rejectOnCancel ? p : u, d = v, h && !a && (a = setTimeout(() => {
30
- s && i(s), a = null, u(d());
31
- }, h)), s = setTimeout(() => {
32
- a && i(a), a = null, u(v());
33
- }, b);
25
+ let f;
26
+ return (c) => {
27
+ const y = B(e), h = B(o.maxWait);
28
+ return i && s(i), y <= 0 || h !== void 0 && h <= 0 ? (a && (s(a), a = null), Promise.resolve(c())) : new Promise((u, p) => {
29
+ r = o.rejectOnCancel ? p : u, f = c, h && !a && (a = setTimeout(() => {
30
+ i && s(i), a = null, u(f());
31
+ }, h)), i = setTimeout(() => {
32
+ a && s(a), a = null, u(c());
33
+ }, y);
34
34
  });
35
35
  };
36
36
  }
@@ -38,70 +38,70 @@ function j(e) {
38
38
  return Array.isArray(e) ? e : [e];
39
39
  }
40
40
  function Ae(e) {
41
- return pe();
41
+ return me();
42
42
  }
43
- function Ke(e, o = 200, s = {}) {
43
+ function Ke(e, o = 200, i = {}) {
44
44
  return Be(
45
- Ie(o, s),
45
+ Ie(o, i),
46
46
  e
47
47
  );
48
48
  }
49
- function We(e, o = !0, s) {
50
- Ae() ? Q(e, s) : o ? e() : me(e);
49
+ function We(e, o = !0, i) {
50
+ Ae() ? Q(e, i) : o ? e() : fe(e);
51
51
  }
52
- function Oe(e, o, s) {
53
- return Z(
52
+ function Oe(e, o, i) {
53
+ return X(
54
54
  e,
55
55
  o,
56
56
  {
57
- ...s,
57
+ ...i,
58
58
  immediate: !0
59
59
  }
60
60
  );
61
61
  }
62
- const X = De ? window : void 0;
63
- function M(e) {
62
+ const Y = De ? window : void 0;
63
+ function H(e) {
64
64
  var o;
65
- const s = B(e);
66
- return (o = s == null ? void 0 : s.$el) != null ? o : s;
65
+ const i = B(e);
66
+ return (o = i == null ? void 0 : i.$el) != null ? o : i;
67
67
  }
68
68
  function J(...e) {
69
- const o = [], s = () => {
70
- o.forEach((f) => f()), o.length = 0;
71
- }, a = (f, v, b, h) => (f.addEventListener(v, b, h), () => f.removeEventListener(v, b, h)), l = S(() => {
72
- const f = j(B(e[0])).filter((v) => v != null);
73
- return f.every((v) => typeof v != "string") ? f : void 0;
74
- }), i = Oe(
69
+ const o = [], i = () => {
70
+ o.forEach((v) => v()), o.length = 0;
71
+ }, a = (v, c, y, h) => (v.addEventListener(c, y, h), () => v.removeEventListener(c, y, h)), r = S(() => {
72
+ const v = j(B(e[0])).filter((c) => c != null);
73
+ return v.every((c) => typeof c != "string") ? v : void 0;
74
+ }), s = Oe(
75
75
  () => {
76
- var f, v;
76
+ var v, c;
77
77
  return [
78
- (v = (f = l.value) == null ? void 0 : f.map((b) => M(b))) != null ? v : [X].filter((b) => b != null),
79
- j(B(l.value ? e[1] : e[0])),
80
- j(n(l.value ? e[2] : e[1])),
78
+ (c = (v = r.value) == null ? void 0 : v.map((y) => H(y))) != null ? c : [Y].filter((y) => y != null),
79
+ j(B(r.value ? e[1] : e[0])),
80
+ j(n(r.value ? e[2] : e[1])),
81
81
  // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
82
- B(l.value ? e[3] : e[2])
82
+ B(r.value ? e[3] : e[2])
83
83
  ];
84
84
  },
85
- ([f, v, b, h]) => {
86
- if (s(), !(f != null && f.length) || !(v != null && v.length) || !(b != null && b.length))
85
+ ([v, c, y, h]) => {
86
+ if (i(), !(v != null && v.length) || !(c != null && c.length) || !(y != null && y.length))
87
87
  return;
88
88
  const u = Ve(h) ? { ...h } : h;
89
89
  o.push(
90
- ...f.flatMap(
91
- (p) => v.flatMap(
92
- (c) => b.map((m) => a(p, c, m, u))
90
+ ...v.flatMap(
91
+ (p) => c.flatMap(
92
+ (d) => y.map((m) => a(p, d, m, u))
93
93
  )
94
94
  )
95
95
  );
96
96
  },
97
97
  { flush: "post" }
98
- ), d = () => {
99
- i(), s();
98
+ ), f = () => {
99
+ s(), i();
100
100
  };
101
- return ee(s), d;
101
+ return ee(i), f;
102
102
  }
103
103
  function Ne() {
104
- const e = G(!1), o = pe();
104
+ const e = G(!1), o = me();
105
105
  return o && Q(() => {
106
106
  e.value = !0;
107
107
  }, o), e;
@@ -110,45 +110,45 @@ function he(e) {
110
110
  const o = Ne();
111
111
  return S(() => (o.value, !!e()));
112
112
  }
113
- function Ue(e, o, s = {}) {
114
- const { window: a = X, ...l } = s;
115
- let i;
116
- const d = he(() => a && "MutationObserver" in a), f = () => {
117
- i && (i.disconnect(), i = void 0);
118
- }, v = S(() => {
119
- const p = B(e), c = j(p).map(M).filter(He);
120
- return new Set(c);
121
- }), b = Z(
122
- () => v.value,
113
+ function Ue(e, o, i = {}) {
114
+ const { window: a = Y, ...r } = i;
115
+ let s;
116
+ const f = he(() => a && "MutationObserver" in a), v = () => {
117
+ s && (s.disconnect(), s = void 0);
118
+ }, c = S(() => {
119
+ const p = B(e), d = j(p).map(H).filter(Me);
120
+ return new Set(d);
121
+ }), y = X(
122
+ () => c.value,
123
123
  (p) => {
124
- f(), d.value && p.size && (i = new MutationObserver(o), p.forEach((c) => i.observe(c, l)));
124
+ v(), f.value && p.size && (s = new MutationObserver(o), p.forEach((d) => s.observe(d, r)));
125
125
  },
126
126
  { immediate: !0, flush: "post" }
127
- ), h = () => i == null ? void 0 : i.takeRecords(), u = () => {
128
- b(), f();
127
+ ), h = () => s == null ? void 0 : s.takeRecords(), u = () => {
128
+ y(), v();
129
129
  };
130
130
  return ee(u), {
131
- isSupported: d,
131
+ isSupported: f,
132
132
  stop: u,
133
133
  takeRecords: h
134
134
  };
135
135
  }
136
- function Fe(e, o, s = {}) {
136
+ function Fe(e, o, i = {}) {
137
137
  const {
138
- window: a = X,
139
- document: l = a == null ? void 0 : a.document,
140
- flush: i = "sync"
141
- } = s;
142
- if (!a || !l)
143
- return le;
144
- let d;
145
- const f = (h) => {
146
- d == null || d(), d = h;
147
- }, v = q(() => {
148
- const h = M(e);
138
+ window: a = Y,
139
+ document: r = a == null ? void 0 : a.document,
140
+ flush: s = "sync"
141
+ } = i;
142
+ if (!a || !r)
143
+ return re;
144
+ let f;
145
+ const v = (h) => {
146
+ f == null || f(), f = h;
147
+ }, c = q(() => {
148
+ const h = H(e);
149
149
  if (h) {
150
150
  const { stop: u } = Ue(
151
- l,
151
+ r,
152
152
  (p) => {
153
153
  p.map((m) => [...m.removedNodes]).flat().some((m) => m === h || m.contains(h)) && o(p);
154
154
  },
@@ -158,148 +158,148 @@ function Fe(e, o, s = {}) {
158
158
  subtree: !0
159
159
  }
160
160
  );
161
- f(u);
161
+ v(u);
162
162
  }
163
- }, { flush: i }), b = () => {
164
- v(), f();
163
+ }, { flush: s }), y = () => {
164
+ c(), v();
165
165
  };
166
- return ee(b), b;
166
+ return ee(y), y;
167
167
  }
168
168
  function Ze(e = {}) {
169
169
  var o;
170
170
  const {
171
- window: s = X,
171
+ window: i = Y,
172
172
  deep: a = !0,
173
- triggerOnRemoval: l = !1
174
- } = e, i = (o = e.document) != null ? o : s == null ? void 0 : s.document, d = () => {
175
- var b;
176
- let h = i == null ? void 0 : i.activeElement;
173
+ triggerOnRemoval: r = !1
174
+ } = e, s = (o = e.document) != null ? o : i == null ? void 0 : i.document, f = () => {
175
+ var y;
176
+ let h = s == null ? void 0 : s.activeElement;
177
177
  if (a)
178
178
  for (; h != null && h.shadowRoot; )
179
- h = (b = h == null ? void 0 : h.shadowRoot) == null ? void 0 : b.activeElement;
179
+ h = (y = h == null ? void 0 : h.shadowRoot) == null ? void 0 : y.activeElement;
180
180
  return h;
181
- }, f = G(), v = () => {
182
- f.value = d();
181
+ }, v = G(), c = () => {
182
+ v.value = f();
183
183
  };
184
- if (s) {
185
- const b = {
184
+ if (i) {
185
+ const y = {
186
186
  capture: !0,
187
187
  passive: !0
188
188
  };
189
189
  J(
190
- s,
190
+ i,
191
191
  "blur",
192
192
  (h) => {
193
- h.relatedTarget === null && v();
193
+ h.relatedTarget === null && c();
194
194
  },
195
- b
195
+ y
196
196
  ), J(
197
- s,
197
+ i,
198
198
  "focus",
199
- v,
200
- b
199
+ c,
200
+ y
201
201
  );
202
202
  }
203
- return l && Fe(f, v, { document: i }), v(), f;
203
+ return r && Fe(v, c, { document: s }), c(), v;
204
204
  }
205
- function Xe(e, o, s = {}) {
206
- const { window: a = X, ...l } = s;
207
- let i;
208
- const d = he(() => a && "ResizeObserver" in a), f = () => {
209
- i && (i.disconnect(), i = void 0);
210
- }, v = S(() => {
205
+ function Xe(e, o, i = {}) {
206
+ const { window: a = Y, ...r } = i;
207
+ let s;
208
+ const f = he(() => a && "ResizeObserver" in a), v = () => {
209
+ s && (s.disconnect(), s = void 0);
210
+ }, c = S(() => {
211
211
  const u = B(e);
212
- return Array.isArray(u) ? u.map((p) => M(p)) : [M(u)];
213
- }), b = Z(
214
- v,
212
+ return Array.isArray(u) ? u.map((p) => H(p)) : [H(u)];
213
+ }), y = X(
214
+ c,
215
215
  (u) => {
216
- if (f(), d.value && a) {
217
- i = new ResizeObserver(o);
216
+ if (v(), f.value && a) {
217
+ s = new ResizeObserver(o);
218
218
  for (const p of u)
219
- p && i.observe(p, l);
219
+ p && s.observe(p, r);
220
220
  }
221
221
  },
222
222
  { immediate: !0, flush: "post" }
223
223
  ), h = () => {
224
- f(), b();
224
+ v(), y();
225
225
  };
226
226
  return ee(h), {
227
- isSupported: d,
227
+ isSupported: f,
228
228
  stop: h
229
229
  };
230
230
  }
231
- function ge(e, o = { width: 0, height: 0 }, s = {}) {
232
- const { window: a = X, box: l = "content-box" } = s, i = S(() => {
231
+ function ge(e, o = { width: 0, height: 0 }, i = {}) {
232
+ const { window: a = Y, box: r = "content-box" } = i, s = S(() => {
233
233
  var u, p;
234
- return (p = (u = M(e)) == null ? void 0 : u.namespaceURI) == null ? void 0 : p.includes("svg");
235
- }), d = G(o.width), f = G(o.height), { stop: v } = Xe(
234
+ return (p = (u = H(e)) == null ? void 0 : u.namespaceURI) == null ? void 0 : p.includes("svg");
235
+ }), f = G(o.width), v = G(o.height), { stop: c } = Xe(
236
236
  e,
237
237
  ([u]) => {
238
- const p = l === "border-box" ? u.borderBoxSize : l === "content-box" ? u.contentBoxSize : u.devicePixelContentBoxSize;
239
- if (a && i.value) {
240
- const c = M(e);
241
- if (c) {
242
- const m = c.getBoundingClientRect();
243
- d.value = m.width, f.value = m.height;
238
+ const p = r === "border-box" ? u.borderBoxSize : r === "content-box" ? u.contentBoxSize : u.devicePixelContentBoxSize;
239
+ if (a && s.value) {
240
+ const d = H(e);
241
+ if (d) {
242
+ const m = d.getBoundingClientRect();
243
+ f.value = m.width, v.value = m.height;
244
244
  }
245
245
  } else if (p) {
246
- const c = j(p);
247
- d.value = c.reduce((m, { inlineSize: _ }) => m + _, 0), f.value = c.reduce((m, { blockSize: _ }) => m + _, 0);
246
+ const d = j(p);
247
+ f.value = d.reduce((m, { inlineSize: P }) => m + P, 0), v.value = d.reduce((m, { blockSize: P }) => m + P, 0);
248
248
  } else
249
- d.value = u.contentRect.width, f.value = u.contentRect.height;
249
+ f.value = u.contentRect.width, v.value = u.contentRect.height;
250
250
  },
251
- s
251
+ i
252
252
  );
253
253
  We(() => {
254
- const u = M(e);
255
- u && (d.value = "offsetWidth" in u ? u.offsetWidth : o.width, f.value = "offsetHeight" in u ? u.offsetHeight : o.height);
254
+ const u = H(e);
255
+ u && (f.value = "offsetWidth" in u ? u.offsetWidth : o.width, v.value = "offsetHeight" in u ? u.offsetHeight : o.height);
256
256
  });
257
- const b = Z(
258
- () => M(e),
257
+ const y = X(
258
+ () => H(e),
259
259
  (u) => {
260
- d.value = u ? o.width : 0, f.value = u ? o.height : 0;
260
+ f.value = u ? o.width : 0, v.value = u ? o.height : 0;
261
261
  }
262
262
  );
263
263
  function h() {
264
- v(), b();
264
+ c(), y();
265
265
  }
266
266
  return {
267
- width: d,
268
- height: f,
267
+ width: f,
268
+ height: v,
269
269
  stop: h
270
270
  };
271
271
  }
272
272
  var Ye = class {
273
273
  constructor(e, o = {}) {
274
- T(this, "canvas");
275
- T(this, "ctx");
276
- T(this, "lastX", 0);
277
- T(this, "lastY", 0);
278
- T(this, "strokeData", []);
279
- T(this, "clearTimerId", null);
280
- T(this, "isDrawing", !1);
281
- T(this, "options");
282
- T(this, "handleStart", (e) => {
274
+ R(this, "canvas");
275
+ R(this, "ctx");
276
+ R(this, "lastX", 0);
277
+ R(this, "lastY", 0);
278
+ R(this, "strokeData", []);
279
+ R(this, "clearTimerId", null);
280
+ R(this, "isDrawing", !1);
281
+ R(this, "options");
282
+ R(this, "handleStart", (e) => {
283
283
  e.preventDefault(), this.isDrawing = !0;
284
- const { offsetX: o, offsetY: s } = this.getEventCoordinates(e);
285
- this.startDrawing(o, s), this.resetClearTimer();
284
+ const { offsetX: o, offsetY: i } = this.getEventCoordinates(e);
285
+ this.startDrawing(o, i), this.resetClearTimer();
286
286
  });
287
- T(this, "handleMove", (e) => {
287
+ R(this, "handleMove", (e) => {
288
288
  if (!this.isDrawing) return;
289
289
  e.preventDefault();
290
- const { offsetX: o, offsetY: s } = this.getEventCoordinates(e);
291
- this.draw(o, s), this.resetClearTimer();
290
+ const { offsetX: o, offsetY: i } = this.getEventCoordinates(e);
291
+ this.draw(o, i), this.resetClearTimer();
292
292
  });
293
- T(this, "handleEnd", (e) => {
293
+ R(this, "handleEnd", (e) => {
294
294
  this.isDrawing && (e.preventDefault(), this.isDrawing = !1, this.endStroke(), this.startClearTimer(), this.options.onDrawEnd && this.options.onDrawEnd());
295
295
  });
296
296
  this.canvas = e, this.options = {
297
297
  clearDelay: 1e3,
298
298
  ...o
299
299
  };
300
- const s = this.canvas.getContext("2d");
301
- if (!s) throw new Error("Failed to get 2D rendering context");
302
- this.ctx = s, this.setupCanvas(), this.attachEvents();
300
+ const i = this.canvas.getContext("2d");
301
+ if (!i) throw new Error("Failed to get 2D rendering context");
302
+ this.ctx = i, this.setupCanvas(), this.attachEvents();
303
303
  }
304
304
  setupCanvas() {
305
305
  this.ctx.lineJoin = "round", this.ctx.lineCap = "round", this.ctx.lineWidth = 3, this.ctx.strokeStyle = "#000", this.clearCanvas(), this.drawGrid();
@@ -337,10 +337,10 @@ var Ye = class {
337
337
  offsetY: e.offsetY
338
338
  };
339
339
  {
340
- const o = e.touches[0] || e.changedTouches[0], s = e.target.getBoundingClientRect();
340
+ const o = e.touches[0] || e.changedTouches[0], i = e.target.getBoundingClientRect();
341
341
  return {
342
- offsetX: o.clientX - s.left,
343
- offsetY: o.clientY - s.top
342
+ offsetX: o.clientX - i.left,
343
+ offsetY: o.clientY - i.top
344
344
  };
345
345
  }
346
346
  }
@@ -360,54 +360,54 @@ var Ye = class {
360
360
  return this.ctx;
361
361
  }
362
362
  };
363
- let ae = {
363
+ let le = {
364
364
  defaultMode: "en",
365
365
  enableHandwriting: !1,
366
366
  position: "static",
367
367
  disableWhenNoFocus: !0
368
- }, be = null, ye = null;
369
- function Y() {
370
- return ae;
368
+ }, ye = null, be = null;
369
+ function Z() {
370
+ return le;
371
371
  }
372
- function vn(e) {
373
- ae = {
374
- ...ae,
372
+ function fn(e) {
373
+ le = {
374
+ ...le,
375
375
  ...e
376
376
  };
377
377
  }
378
- function fn(e) {
379
- be = e;
380
- }
381
- function ue() {
382
- return be;
383
- }
384
378
  function mn(e) {
385
379
  ye = e;
386
380
  }
387
- function je() {
381
+ function ae() {
388
382
  return ye;
389
383
  }
390
- function Ge(e, o, s) {
391
- if (!e || !o || s === "static") return null;
392
- let a, l;
393
- if (s === "bottom")
394
- a = window.innerHeight - o.offsetHeight, l = 0;
384
+ function pn(e) {
385
+ be = e;
386
+ }
387
+ function je() {
388
+ return be;
389
+ }
390
+ function Ge(e, o, i, a = 0) {
391
+ if (!e || !o || i === "static") return null;
392
+ let r, s;
393
+ if (i === "bottom")
394
+ r = window.innerHeight - o.offsetHeight, s = 0;
395
395
  else {
396
- const i = e.getBoundingClientRect(), d = o.offsetWidth;
397
- a = i.bottom + window.scrollY, l = i.left + window.scrollX + i.width / 2 - d / 2;
398
- const f = window.innerWidth;
399
- l + d > f && (l = f - d - 10), l < 10 && (l = 10);
396
+ const f = e.getBoundingClientRect(), v = o.offsetWidth;
397
+ r = f.bottom + window.scrollY + a, s = f.left + window.scrollX + f.width / 2 - v / 2;
398
+ const c = window.innerWidth;
399
+ s + v > c && (s = c - v - 10), s < 10 && (s = 10);
400
400
  }
401
401
  return {
402
- top: `${a}px`,
403
- left: `${l}px`
402
+ top: `${r}px`,
403
+ left: `${s}px`
404
404
  };
405
405
  }
406
- function de(e) {
406
+ function ue(e) {
407
407
  if (!e) return !1;
408
408
  if (e.tagName === "TEXTAREA") return !0;
409
409
  if (e.tagName === "INPUT") {
410
- const s = (e.type || "text").toLowerCase();
410
+ const i = (e.type || "text").toLowerCase();
411
411
  return ![
412
412
  "checkbox",
413
413
  "radio",
@@ -424,36 +424,36 @@ function de(e) {
424
424
  "month",
425
425
  "week",
426
426
  "time"
427
- ].includes(s);
427
+ ].includes(i);
428
428
  }
429
429
  return !1;
430
430
  }
431
- function pn() {
432
- if (document.activeElement && de(document.activeElement)) return document.activeElement;
431
+ function kn() {
432
+ if (document.activeElement && ue(document.activeElement)) return document.activeElement;
433
433
  throw new Error("输入框没有被激活");
434
434
  }
435
- function qe(e, o, s) {
436
- e.value = o, tt(e, s), e.dispatchEvent(new Event("input", { bubbles: !0 }));
435
+ function qe(e, o, i) {
436
+ e.value = o, tt(e, i), e.dispatchEvent(new Event("input", { bubbles: !0 }));
437
437
  }
438
- function Je(e, o, s, a = "") {
439
- return e.slice(0, o) + a + e.slice(o + s);
438
+ function Je(e, o, i, a = "") {
439
+ return e.slice(0, o) + a + e.slice(o + i);
440
440
  }
441
441
  function we(e, o = "") {
442
- const s = Number(e.getAttribute("maxlength"));
442
+ const i = Number(e.getAttribute("maxlength"));
443
443
  let a = e.selectionStart ?? 0;
444
- const l = e.selectionEnd ?? a;
445
- let i;
446
- if (o.length > 0) i = l - a;
444
+ const r = e.selectionEnd ?? a;
445
+ let s;
446
+ if (o.length > 0) s = r - a;
447
447
  else {
448
- const v = l - a;
449
- if (v > 0) i = v;
448
+ const c = r - a;
449
+ if (c > 0) s = c;
450
450
  else if (a > 0)
451
- i = 1, a--;
451
+ s = 1, a--;
452
452
  else return;
453
453
  }
454
- if (o.length > 0 && s && e.value.length - i + o.length > s) return;
455
- const d = Je(e.value, a, i, o), f = a + o.length;
456
- qe(e, d, f);
454
+ if (o.length > 0 && i && e.value.length - s + o.length > i) return;
455
+ const f = Je(e.value, a, s, o), v = a + o.length;
456
+ qe(e, f, v);
457
457
  }
458
458
  function Qe(e, o) {
459
459
  we(e, o);
@@ -465,73 +465,73 @@ function tt(e, o) {
465
465
  e.selectionStart = o, e.selectionEnd = o;
466
466
  }
467
467
  function nt(e = {}) {
468
- const o = e.delay ?? 400, s = e.interval ?? 60;
469
- let a, l;
470
- function i() {
471
- a && (clearTimeout(a), a = void 0), l && (clearInterval(l), l = void 0);
468
+ const o = e.delay ?? 400, i = e.interval ?? 60;
469
+ let a, r;
470
+ function s() {
471
+ a && (clearTimeout(a), a = void 0), r && (clearInterval(r), r = void 0);
472
472
  }
473
- function d(f) {
474
- i(), f(), a = setTimeout(() => {
475
- l = setInterval(() => {
476
- f();
477
- }, s);
473
+ function f(v) {
474
+ s(), v(), a = setTimeout(() => {
475
+ r = setInterval(() => {
476
+ v();
477
+ }, i);
478
478
  }, o);
479
479
  }
480
480
  return {
481
- start: d,
482
- stop: i
481
+ start: f,
482
+ stop: s
483
483
  };
484
484
  }
485
485
  function ot(e = !1) {
486
- const o = E(!1), s = E(0);
486
+ const o = $(!1), i = $(0);
487
487
  async function a() {
488
- const i = ue();
489
- if (i)
488
+ const s = ae();
489
+ if (s)
490
490
  try {
491
- o.value = await i.initialize({
492
- onProgress: (d) => {
493
- s.value = d;
491
+ o.value = await s.initialize({
492
+ onProgress: (f) => {
493
+ i.value = f;
494
494
  }
495
495
  });
496
- } catch (d) {
497
- console.error("初始化手写识别服务失败:", d), o.value = !1;
496
+ } catch (f) {
497
+ console.error("初始化手写识别服务失败:", f), o.value = !1;
498
498
  }
499
499
  else
500
500
  console.warn("未注册手写识别服务"), o.value = !1;
501
501
  }
502
- async function l() {
503
- const i = ue();
504
- if (i && o.value)
502
+ async function r() {
503
+ const s = ae();
504
+ if (s && o.value)
505
505
  try {
506
- await i.close(), o.value = !1;
507
- } catch (d) {
508
- console.error("关闭手写识别服务失败:", d);
506
+ await s.close(), o.value = !1;
507
+ } catch (f) {
508
+ console.error("关闭手写识别服务失败:", f);
509
509
  }
510
510
  }
511
511
  return Q(() => {
512
512
  e && a();
513
- }), ce(() => {
514
- l();
513
+ }), de(() => {
514
+ r();
515
515
  }), {
516
516
  recognizerInitialized: o,
517
- recognizerProgress: s
517
+ recognizerProgress: i
518
518
  };
519
519
  }
520
- const ve = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M21,11H6.83L10.41,7.41L9,6L3,12L9,18L10.41,16.58L6.83,13H21V11Z'%20/%3e%3c/svg%3e", fe = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M19,7V11H5.83L9.41,7.41L8,6L2,12L8,18L9.41,16.58L5.83,13H21V7H19Z'%20/%3e%3c/svg%3e";
520
+ const ce = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M21,11H6.83L10.41,7.41L9,6L3,12L9,18L10.41,16.58L6.83,13H21V11Z'%20/%3e%3c/svg%3e", ve = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M19,7V11H5.83L9.41,7.41L8,6L2,12L8,18L9.41,16.58L5.83,13H21V7H19Z'%20/%3e%3c/svg%3e";
521
521
  function te() {
522
522
  const e = nt();
523
- function o(a, l) {
524
- var i, d;
525
- a.preventDefault(), (d = (i = a.currentTarget) == null ? void 0 : i.setPointerCapture) == null || d.call(i, a.pointerId), e.start(l);
523
+ function o(a, r) {
524
+ var s, f;
525
+ a.preventDefault(), (f = (s = a.currentTarget) == null ? void 0 : s.setPointerCapture) == null || f.call(s, a.pointerId), e.start(r);
526
526
  }
527
- function s() {
527
+ function i() {
528
528
  e.stop();
529
529
  }
530
530
  return Se(() => {
531
531
  e.stop();
532
532
  }), {
533
533
  startRepeat: o,
534
- stopRepeat: s
534
+ stopRepeat: i
535
535
  };
536
536
  }
537
537
  const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__ */ I({
@@ -541,19 +541,22 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
541
541
  },
542
542
  emits: ["select"],
543
543
  setup(e, { emit: o }) {
544
- const s = o;
545
- function a(l) {
546
- s("select", l);
544
+ const i = o;
545
+ function a(r) {
546
+ i("select", r);
547
547
  }
548
- return (l, i) => (y(), x("div", st, [
549
- (y(!0), x(L, null, V(l.candidates, (d, f) => (y(), x("button", {
550
- key: `candidate-${f}`,
548
+ return (r, s) => (b(), x("div", st, [
549
+ (b(!0), x(L, null, V(r.candidates, (f, v) => (b(), x("button", {
550
+ key: `candidate-${v}`,
551
551
  class: "zhk-candidate-list__item",
552
- onClick: (v) => a(f)
553
- }, D(d), 9, it))), 128))
552
+ onClick: (c) => a(v)
553
+ }, D(f), 9, it))), 128))
554
554
  ]));
555
555
  }
556
- }), rt = { class: "handwriting-input" }, lt = { class: "handwriting-buttons" }, at = { class: "handwriting-canvas-container" }, ut = { class: "progress-bar" }, dt = { class: "progress-text" }, ct = ["width", "height"], vt = { class: "handwriting-buttons" }, ft = /* @__PURE__ */ I({
556
+ }), rt = { class: "handwriting-input" }, lt = { class: "handwriting-content" }, at = { class: "handwriting-buttons" }, ut = { class: "handwriting-canvas-container" }, dt = {
557
+ key: 0,
558
+ class: "handwriting-loading"
559
+ }, ct = { class: "progress-bar" }, vt = { class: "progress-text" }, ft = { class: "handwriting-buttons" }, mt = /* @__PURE__ */ I({
557
560
  __name: "HandwritingInput",
558
561
  props: {
559
562
  recognizerInitialized: { type: Boolean },
@@ -561,26 +564,26 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
561
564
  },
562
565
  emits: ["key", "exit"],
563
566
  setup(e, { emit: o }) {
564
- const s = e, a = o, l = E(null), i = E(null);
565
- let d = null;
566
- const f = E(!1), { height: v } = ge(i);
567
- function b() {
568
- d && d.clearCanvas();
567
+ const i = e, a = o, r = $(null);
568
+ let s = null;
569
+ const f = $(!1), { width: v, height: c } = ge(r);
570
+ function y() {
571
+ s && s.clearCanvas();
569
572
  }
570
573
  function h() {
571
- l.value && (d && d.destroy(), d = new Ye(l.value, {
574
+ r.value && (s && s.destroy(), r.value.width = v.value, r.value.height = c.value, s = new Ye(r.value, {
572
575
  onDrawEnd: m
573
576
  }));
574
577
  }
575
- const u = E([]), { startRepeat: p, stopRepeat: c } = te();
578
+ const u = $([]), { startRepeat: p, stopRepeat: d } = te();
576
579
  async function m() {
577
- if (!d || d.getStrokeData().length === 0 || f.value)
580
+ if (!s || s.getStrokeData().length === 0 || f.value)
578
581
  return;
579
- const z = ue();
582
+ const z = ae();
580
583
  if (z) {
581
584
  f.value = !0;
582
585
  try {
583
- const t = [...d.getStrokeData()], k = await z.recognize(t);
586
+ const t = [...s.getStrokeData()], k = await z.recognize(t);
584
587
  u.value = k;
585
588
  } catch (t) {
586
589
  console.error("识别笔迹失败:", t);
@@ -590,37 +593,33 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
590
593
  } else
591
594
  console.warn("手写识别服务不可用");
592
595
  }
593
- ce(() => {
594
- d && d.destroy();
596
+ de(() => {
597
+ s && s.destroy();
595
598
  }), q(() => {
596
- l.value && v.value && s.recognizerInitialized && me(() => {
599
+ r.value && (v.value || c.value) && i.recognizerInitialized && fe(() => {
597
600
  h();
598
601
  });
599
602
  });
600
- function _(z) {
603
+ function P(z) {
601
604
  const t = u.value[z];
602
- t && (a("key", { key: t }), u.value = [], b());
605
+ t && (a("key", { key: t }), u.value = [], y());
603
606
  }
604
- return (z, t) => (y(), x("div", rt, [
607
+ return (z, t) => (b(), x("div", rt, [
605
608
  Le(xe, {
606
609
  candidates: u.value,
607
- onSelect: _
610
+ onSelect: P
608
611
  }, null, 8, ["candidates"]),
609
- g("div", {
610
- ref_key: "containerRef",
611
- ref: i,
612
- class: "handwriting-content"
613
- }, [
614
- g("div", lt, [
612
+ g("div", lt, [
613
+ g("div", at, [
615
614
  g("button", {
616
615
  class: "handwriting-btn handwriting-btn--function",
617
616
  onPointerdown: t[0] || (t[0] = (k) => n(p)(k, () => a("key", { key: "。" }))),
618
617
  onPointerup: t[1] || (t[1] = //@ts-ignore
619
- (...k) => n(c) && n(c)(...k)),
618
+ (...k) => n(d) && n(d)(...k)),
620
619
  onPointerleave: t[2] || (t[2] = //@ts-ignore
621
- (...k) => n(c) && n(c)(...k)),
620
+ (...k) => n(d) && n(d)(...k)),
622
621
  onPointercancel: t[3] || (t[3] = //@ts-ignore
623
- (...k) => n(c) && n(c)(...k)),
622
+ (...k) => n(d) && n(d)(...k)),
624
623
  onContextmenu: t[4] || (t[4] = C(() => {
625
624
  }, ["prevent"]))
626
625
  }, " 。 ", 32),
@@ -628,11 +627,11 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
628
627
  class: "handwriting-btn handwriting-btn--function",
629
628
  onPointerdown: t[5] || (t[5] = (k) => n(p)(k, () => a("key", { key: "?" }))),
630
629
  onPointerup: t[6] || (t[6] = //@ts-ignore
631
- (...k) => n(c) && n(c)(...k)),
630
+ (...k) => n(d) && n(d)(...k)),
632
631
  onPointerleave: t[7] || (t[7] = //@ts-ignore
633
- (...k) => n(c) && n(c)(...k)),
632
+ (...k) => n(d) && n(d)(...k)),
634
633
  onPointercancel: t[8] || (t[8] = //@ts-ignore
635
- (...k) => n(c) && n(c)(...k)),
634
+ (...k) => n(d) && n(d)(...k)),
636
635
  onContextmenu: t[9] || (t[9] = C(() => {
637
636
  }, ["prevent"]))
638
637
  }, " ? ", 32),
@@ -640,11 +639,11 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
640
639
  class: "handwriting-btn handwriting-btn--function",
641
640
  onPointerdown: t[10] || (t[10] = (k) => n(p)(k, () => a("key", { key: "!" }))),
642
641
  onPointerup: t[11] || (t[11] = //@ts-ignore
643
- (...k) => n(c) && n(c)(...k)),
642
+ (...k) => n(d) && n(d)(...k)),
644
643
  onPointerleave: t[12] || (t[12] = //@ts-ignore
645
- (...k) => n(c) && n(c)(...k)),
644
+ (...k) => n(d) && n(d)(...k)),
646
645
  onPointercancel: t[13] || (t[13] = //@ts-ignore
647
- (...k) => n(c) && n(c)(...k)),
646
+ (...k) => n(d) && n(d)(...k)),
648
647
  onContextmenu: t[14] || (t[14] = C(() => {
649
648
  }, ["prevent"]))
650
649
  }, " ! ", 32),
@@ -652,53 +651,47 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
652
651
  class: "handwriting-btn handwriting-btn--function",
653
652
  onPointerdown: t[15] || (t[15] = (k) => n(p)(k, () => a("key", { key: "、" }))),
654
653
  onPointerup: t[16] || (t[16] = //@ts-ignore
655
- (...k) => n(c) && n(c)(...k)),
654
+ (...k) => n(d) && n(d)(...k)),
656
655
  onPointerleave: t[17] || (t[17] = //@ts-ignore
657
- (...k) => n(c) && n(c)(...k)),
656
+ (...k) => n(d) && n(d)(...k)),
658
657
  onPointercancel: t[18] || (t[18] = //@ts-ignore
659
- (...k) => n(c) && n(c)(...k)),
658
+ (...k) => n(d) && n(d)(...k)),
660
659
  onContextmenu: t[19] || (t[19] = C(() => {
661
660
  }, ["prevent"]))
662
661
  }, " 、 ", 32)
663
662
  ]),
664
- g("div", at, [
665
- z.recognizerInitialized ? (y(), x("canvas", {
663
+ g("div", ut, [
664
+ z.recognizerInitialized ? (b(), x("canvas", {
666
665
  key: 1,
667
666
  ref_key: "canvasRef",
668
- ref: l,
669
- class: "handwriting-canvas",
670
- width: n(v),
671
- height: n(v)
672
- }, null, 8, ct)) : (y(), x("div", {
673
- key: 0,
674
- class: "handwriting-loading",
675
- style: se({ width: `${n(v)}px`, height: `${n(v)}px` })
676
- }, [
667
+ ref: r,
668
+ class: "handwriting-canvas"
669
+ }, null, 512)) : (b(), x("div", dt, [
677
670
  t[37] || (t[37] = g("div", { class: "loading-text" }, " 正在加载手写识别... ", -1)),
678
- g("div", ut, [
671
+ g("div", ct, [
679
672
  g("div", {
680
673
  class: "progress-fill",
681
- style: se({ width: `${z.recognizerProgress * 100}%` })
674
+ style: pe({ width: `${z.recognizerProgress * 100}%` })
682
675
  }, null, 4)
683
676
  ]),
684
- g("div", dt, D(Math.round(z.recognizerProgress * 100)) + "% ", 1)
685
- ], 4))
677
+ g("div", vt, D(Math.round(z.recognizerProgress * 100)) + "% ", 1)
678
+ ]))
686
679
  ]),
687
- g("div", vt, [
680
+ g("div", ft, [
688
681
  g("button", {
689
682
  class: "handwriting-btn handwriting-btn--function",
690
683
  onPointerdown: t[20] || (t[20] = (k) => n(p)(k, () => a("key", { key: "delete", isControl: !0 }))),
691
684
  onPointerup: t[21] || (t[21] = //@ts-ignore
692
- (...k) => n(c) && n(c)(...k)),
685
+ (...k) => n(d) && n(d)(...k)),
693
686
  onPointerleave: t[22] || (t[22] = //@ts-ignore
694
- (...k) => n(c) && n(c)(...k)),
687
+ (...k) => n(d) && n(d)(...k)),
695
688
  onPointercancel: t[23] || (t[23] = //@ts-ignore
696
- (...k) => n(c) && n(c)(...k)),
689
+ (...k) => n(d) && n(d)(...k)),
697
690
  onContextmenu: t[24] || (t[24] = C(() => {
698
691
  }, ["prevent"]))
699
692
  }, t[38] || (t[38] = [
700
693
  g("img", {
701
- src: ve,
694
+ src: ce,
702
695
  alt: "删除"
703
696
  }, null, -1)
704
697
  ]), 32),
@@ -707,16 +700,16 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
707
700
  onClick: t[25] || (t[25] = (k) => a("exit")),
708
701
  onContextmenu: t[26] || (t[26] = C(() => {
709
702
  }, ["prevent"]))
710
- }, " 返回 ", 32),
703
+ }, " 拼音 ", 32),
711
704
  g("button", {
712
705
  class: "handwriting-btn handwriting-btn--function",
713
706
  onPointerdown: t[27] || (t[27] = (k) => n(p)(k, () => a("key", { key: "," }))),
714
707
  onPointerup: t[28] || (t[28] = //@ts-ignore
715
- (...k) => n(c) && n(c)(...k)),
708
+ (...k) => n(d) && n(d)(...k)),
716
709
  onPointerleave: t[29] || (t[29] = //@ts-ignore
717
- (...k) => n(c) && n(c)(...k)),
710
+ (...k) => n(d) && n(d)(...k)),
718
711
  onPointercancel: t[30] || (t[30] = //@ts-ignore
719
- (...k) => n(c) && n(c)(...k)),
712
+ (...k) => n(d) && n(d)(...k)),
720
713
  onContextmenu: t[31] || (t[31] = C(() => {
721
714
  }, ["prevent"]))
722
715
  }, " , ", 32),
@@ -724,61 +717,61 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
724
717
  class: "handwriting-btn handwriting-btn--function",
725
718
  onPointerdown: t[32] || (t[32] = (k) => n(p)(k, () => a("key", { key: "enter", isControl: !0 }))),
726
719
  onPointerup: t[33] || (t[33] = //@ts-ignore
727
- (...k) => n(c) && n(c)(...k)),
720
+ (...k) => n(d) && n(d)(...k)),
728
721
  onPointerleave: t[34] || (t[34] = //@ts-ignore
729
- (...k) => n(c) && n(c)(...k)),
722
+ (...k) => n(d) && n(d)(...k)),
730
723
  onPointercancel: t[35] || (t[35] = //@ts-ignore
731
- (...k) => n(c) && n(c)(...k)),
724
+ (...k) => n(d) && n(d)(...k)),
732
725
  onContextmenu: t[36] || (t[36] = C(() => {
733
726
  }, ["prevent"]))
734
727
  }, t[39] || (t[39] = [
735
728
  g("img", {
736
- src: fe,
729
+ src: ve,
737
730
  alt: "回车"
738
731
  }, null, -1)
739
732
  ]), 32)
740
733
  ])
741
- ], 512)
734
+ ])
742
735
  ]));
743
736
  }
744
- }), mt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M6,18H18V16H6M12,8.41L16.59,13L18,11.58L12,5.58L6,11.58L7.41,13L12,8.41Z'%20/%3e%3c/svg%3e", ze = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M3%2015H5V19H19V15H21V19C21%2020.1%2020.1%2021%2019%2021H5C3.9%2021%203%2020.1%203%2019V15Z'%20/%3e%3c/svg%3e", pt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z'%20/%3e%3c/svg%3e", kt = { class: "zhk-selection" }, ht = { class: "zhk-selection__list" }, gt = ["onClick"], bt = /* @__PURE__ */ I({
737
+ }), pt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M6,18H18V16H6M12,8.41L16.59,13L18,11.58L12,5.58L6,11.58L7.41,13L12,8.41Z'%20/%3e%3c/svg%3e", ze = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M3%2015H5V19H19V15H21V19C21%2020.1%2020.1%2021%2019%2021H5C3.9%2021%203%2020.1%203%2019V15Z'%20/%3e%3c/svg%3e", kt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z'%20/%3e%3c/svg%3e", ht = { class: "zhk-selection" }, gt = { class: "zhk-selection__list" }, yt = ["onClick"], bt = /* @__PURE__ */ I({
745
738
  __name: "CandidateSelection",
746
739
  props: {
747
740
  candidates: {}
748
741
  },
749
742
  emits: ["select", "close"],
750
743
  setup(e, { emit: o }) {
751
- const s = o;
752
- function a(d) {
753
- s("select", d);
744
+ const i = o;
745
+ function a(f) {
746
+ i("select", f);
754
747
  }
755
- function l() {
756
- s("close");
748
+ function r() {
749
+ i("close");
757
750
  }
758
- function i(d) {
759
- const f = Array.from(d).length;
760
- return f >= 2 && f <= 3 ? 2 : f >= 4 ? 3 : 1;
751
+ function s(f) {
752
+ const v = Array.from(f).length;
753
+ return v >= 2 && v <= 3 ? 2 : v >= 4 ? 3 : 1;
761
754
  }
762
- return (d, f) => (y(), x("div", kt, [
763
- g("div", ht, [
764
- (y(!0), x(L, null, V(d.candidates, (v, b) => (y(), x("div", {
765
- key: b,
766
- class: O(["zhk-selection__text", [`zhk-selection__text--span-${i(v)}`]]),
767
- onClick: (h) => a(b)
768
- }, D(v), 11, gt))), 128))
755
+ return (f, v) => (b(), x("div", ht, [
756
+ g("div", gt, [
757
+ (b(!0), x(L, null, V(f.candidates, (c, y) => (b(), x("div", {
758
+ key: y,
759
+ class: O(["zhk-selection__text", [`zhk-selection__text--span-${s(c)}`]]),
760
+ onClick: (h) => a(y)
761
+ }, D(c), 11, yt))), 128))
769
762
  ]),
770
763
  g("div", { class: "zhk-selection__func" }, [
771
764
  g("button", {
772
765
  class: "zhk-selection__func-btn",
773
- onClick: l
766
+ onClick: r
774
767
  }, " 返回 ")
775
768
  ])
776
769
  ]));
777
770
  }
778
- }), yt = { class: "zhk-candidate" }, wt = { class: "zhk-candidate__container" }, xt = {
771
+ }), wt = { class: "zhk-candidate" }, xt = { class: "zhk-candidate__container" }, zt = {
779
772
  key: 0,
780
773
  class: "zhk-candidate__pinyin"
781
- }, zt = { class: "zhk-candidate__bottom-container" }, Ct = /* @__PURE__ */ I({
774
+ }, Ct = { class: "zhk-candidate__bottom-container" }, Pt = /* @__PURE__ */ I({
782
775
  __name: "CandidateBar",
783
776
  props: {
784
777
  modelValue: {
@@ -786,80 +779,82 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
786
779
  },
787
780
  modelModifiers: {}
788
781
  },
789
- emits: /* @__PURE__ */ ie(["key", "input"], ["update:modelValue"]),
790
- setup(e, { expose: o, emit: s }) {
791
- const a = s, l = ke(e, "modelValue");
792
- let i = null;
793
- const d = E(null), f = S(() => {
782
+ emits: /* @__PURE__ */ se(["key", "input"], ["update:modelValue"]),
783
+ setup(e, { expose: o, emit: i }) {
784
+ const a = i, r = ke(e, "modelValue");
785
+ let s = null;
786
+ const f = $(null), v = S(() => {
794
787
  var u;
795
- return ((u = d.value) == null ? void 0 : u.candidates.map((p) => p.text)) ?? [];
796
- }), v = E(!1);
788
+ return ((u = f.value) == null ? void 0 : u.candidates.map((p) => p.text)) ?? [];
789
+ }), c = $(!1);
797
790
  Q(async () => {
798
- if (i = je(), !i)
791
+ if (s = je(), !s)
799
792
  throw new Error("未找到拼音引擎实例,请确保已正确注册引擎");
800
- l.value && (d.value = await i.processInput(l.value));
801
- }), ce(() => {
802
- i == null || i.clearInput(), i = null;
803
- }), Z(l, async (u) => {
804
- const p = i;
793
+ r.value && (f.value = await s.processInput(r.value));
794
+ }), de(() => {
795
+ s == null || s.processInput("").catch(() => {
796
+ }), s = null;
797
+ }), X(r, async (u) => {
798
+ const p = s;
805
799
  if (p) {
806
800
  if (u === "") {
807
- p.clearInput(), d.value = null;
801
+ p.processInput("").catch(() => {
802
+ }), f.value = null;
808
803
  return;
809
804
  }
810
- d.value = await p.processInput(u);
805
+ f.value = await p.processInput(u);
811
806
  }
812
807
  });
813
- async function b(u) {
814
- if (!i)
808
+ async function y(u) {
809
+ if (!s)
815
810
  return;
816
- const p = await i.pickCandidate(u);
817
- d.value = p, p.preeditBody || (a("input", p.committed || ""), l.value = "", d.value = null, v.value = !1);
811
+ const p = await s.pickCandidate(u);
812
+ f.value = p, p.preeditBody || (a("input", p.committed || ""), r.value = "", f.value = null, c.value = !1);
818
813
  }
819
814
  o({
820
- handleSelection: b
815
+ handleSelection: y
821
816
  });
822
817
  const h = S(() => {
823
- const u = d.value;
818
+ const u = f.value;
824
819
  return u ? u.preeditHead + u.preeditBody : "";
825
820
  });
826
- return (u, p) => (y(), x("div", yt, [
827
- g("div", wt, [
828
- h.value ? (y(), x("div", xt, D(h.value), 1)) : W("", !0),
829
- g("div", zt, [
830
- f.value.length > 0 ? (y(), K(xe, {
821
+ return (u, p) => (b(), x("div", wt, [
822
+ g("div", xt, [
823
+ h.value ? (b(), x("div", zt, D(h.value), 1)) : W("", !0),
824
+ g("div", Ct, [
825
+ v.value.length > 0 ? (b(), K(xe, {
831
826
  key: 0,
832
- candidates: f.value,
833
- onSelect: b
827
+ candidates: v.value,
828
+ onSelect: y
834
829
  }, null, 8, ["candidates"])) : W("", !0),
835
- f.value.length > 0 ? (y(), x("button", {
830
+ v.value.length > 0 ? (b(), x("button", {
836
831
  key: 1,
837
832
  class: "zhk-candidate__more",
838
- onClick: p[0] || (p[0] = (c) => v.value = !0)
833
+ onClick: p[0] || (p[0] = (d) => c.value = !0)
839
834
  }, p[2] || (p[2] = [
840
835
  g("img", {
841
- src: pt,
836
+ src: kt,
842
837
  alt: "更多"
843
838
  }, null, -1)
844
839
  ]))) : W("", !0)
845
840
  ])
846
841
  ]),
847
- v.value ? (y(), K(bt, {
842
+ c.value ? (b(), K(bt, {
848
843
  key: 0,
849
- candidates: f.value,
850
- onSelect: b,
851
- onClose: p[1] || (p[1] = (c) => v.value = !1)
844
+ candidates: v.value,
845
+ onSelect: y,
846
+ onClose: p[1] || (p[1] = (d) => c.value = !1)
852
847
  }, null, 8, ["candidates"])) : W("", !0)
853
848
  ]));
854
849
  }
855
- }), Pt = { class: "zhk-base" }, _t = { class: "zhk-base__row" }, $t = ["onPointerdown"], Et = ["disabled"], St = {
850
+ }), _t = { class: "zhk-base" }, Et = { class: "zhk-base__row" }, $t = ["onPointerdown"], St = ["disabled"], Lt = {
856
851
  key: 1,
857
- src: mt,
852
+ src: pt,
858
853
  class: "zhk-base__key-icon",
859
854
  alt: "Shift"
860
- }, Lt = ["onPointerdown"], Rt = { class: "zhk-base__row" }, Tt = { class: "zhk-base__toggle-main" }, Dt = { class: "zhk-base__toggle-sub" }, Ht = /* @__PURE__ */ I({
855
+ }, Tt = ["onPointerdown"], Rt = { class: "zhk-base__row" }, Dt = { class: "zhk-base__toggle-main" }, Mt = { class: "zhk-base__toggle-sub" }, Ht = /* @__PURE__ */ I({
861
856
  __name: "KeyboardBase",
862
- props: /* @__PURE__ */ ie({
857
+ props: /* @__PURE__ */ se({
863
858
  enableHandwriting: { type: Boolean }
864
859
  }, {
865
860
  modelValue: {
@@ -867,130 +862,130 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
867
862
  },
868
863
  modelModifiers: {}
869
864
  }),
870
- emits: /* @__PURE__ */ ie(["key"], ["update:modelValue"]),
865
+ emits: /* @__PURE__ */ se(["key"], ["update:modelValue"]),
871
866
  setup(e, { emit: o }) {
872
- const s = e, a = o, l = ke(e, "modelValue"), i = E(!1), d = S(() => l.value === "zh"), f = S(() => d.value ? !0 : i.value);
873
- function v(H, r = !1) {
874
- a("key", { key: H, isControl: r });
867
+ const i = e, a = o, r = ke(e, "modelValue"), s = S(() => r.value === "en_cap"), f = S(() => r.value === "zh"), v = S(() => f.value ? !0 : s.value);
868
+ function c(M, l = !1) {
869
+ a("key", { key: M, isControl: l });
875
870
  }
876
- function b() {
877
- d.value ? l.value = "hand" : i.value = !i.value;
871
+ function y() {
872
+ f.value ? r.value = "hand" : r.value = s.value ? "en" : "en_cap";
878
873
  }
879
874
  function h() {
880
- l.value = "num";
875
+ r.value = "num";
881
876
  }
882
877
  function u() {
883
- l.value = "symbol";
878
+ r.value = "symbol";
884
879
  }
885
- const p = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"], c = [
880
+ const p = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"], d = [
886
881
  ["q", "w", "e", "r", "t", "y", "u", "i", "o", "p"],
887
882
  ["a", "s", "d", "f", "g", "h", "j", "k", "l"],
888
883
  ["z", "x", "c", "v", "b", "n", "m"]
889
- ], m = E(""), _ = E(null), { startRepeat: z, stopRepeat: t } = te();
884
+ ], m = $(""), P = $(null), { startRepeat: z, stopRepeat: t } = te();
890
885
  function k() {
891
- if (l.value === "zh" && m.value) {
886
+ if (r.value === "zh" && m.value) {
892
887
  m.value = m.value.slice(0, -1);
893
888
  return;
894
889
  }
895
- v("delete", !0);
890
+ c("delete", !0);
896
891
  }
897
892
  function N() {
898
- var H;
899
- if (l.value === "zh" && m.value) {
900
- (H = _.value) == null || H.handleSelection(0);
893
+ var M;
894
+ if (r.value === "zh" && m.value) {
895
+ (M = P.value) == null || M.handleSelection(0);
901
896
  return;
902
897
  }
903
- v(" ");
898
+ c(" ");
904
899
  }
905
900
  function ne() {
906
- if (l.value === "zh" && m.value) {
907
- v(m.value), m.value = "";
901
+ if (r.value === "zh" && m.value) {
902
+ c(m.value), m.value = "";
908
903
  return;
909
904
  }
910
- v("enter", !0);
905
+ c("enter", !0);
911
906
  }
912
- function U(H) {
913
- if (l.value === "zh") {
914
- m.value += H;
907
+ function U(M) {
908
+ if (r.value === "zh") {
909
+ m.value += M;
915
910
  return;
916
911
  }
917
- const r = i.value ? H.toUpperCase() : H;
918
- v(r);
912
+ const l = s.value ? M.toUpperCase() : M;
913
+ c(l);
919
914
  }
920
915
  function oe() {
921
- l.value = l.value === "zh" ? "en" : "zh";
916
+ r.value = r.value === "zh" ? "en" : "zh";
922
917
  }
923
- const P = S(() => s.enableHandwriting ? "手写" : "-"), R = S(() => !s.enableHandwriting);
924
- return (H, r) => (y(), x("div", Pt, [
925
- g("div", _t, [
926
- l.value === "zh" ? (y(), K(Ct, {
918
+ const E = S(() => i.enableHandwriting ? "手写" : "-"), T = S(() => !i.enableHandwriting);
919
+ return (M, l) => (b(), x("div", _t, [
920
+ g("div", Et, [
921
+ r.value === "zh" ? (b(), K(Pt, {
927
922
  key: 0,
928
923
  ref_key: "candidateBarRef",
929
- ref: _,
924
+ ref: P,
930
925
  modelValue: m.value,
931
- "onUpdate:modelValue": r[0] || (r[0] = (w) => m.value = w),
932
- onInput: r[1] || (r[1] = (w) => v(w, !1))
933
- }, null, 8, ["modelValue"])) : (y(), x(L, { key: 1 }, V(p, (w, F) => g("button", {
926
+ "onUpdate:modelValue": l[0] || (l[0] = (w) => m.value = w),
927
+ onInput: l[1] || (l[1] = (w) => c(w, !1))
928
+ }, null, 8, ["modelValue"])) : (b(), x(L, { key: 1 }, V(p, (w, F) => g("button", {
934
929
  key: `number-${F}`,
935
930
  class: "zhk-base__key zhk-base__key--letter",
936
- onPointerdown: ($) => n(z)($, () => U(w)),
937
- onPointerup: r[2] || (r[2] = //@ts-ignore
938
- (...$) => n(t) && n(t)(...$)),
939
- onPointerleave: r[3] || (r[3] = //@ts-ignore
940
- (...$) => n(t) && n(t)(...$)),
941
- onPointercancel: r[4] || (r[4] = //@ts-ignore
942
- (...$) => n(t) && n(t)(...$)),
943
- onContextmenu: r[5] || (r[5] = C(() => {
931
+ onPointerdown: (_) => n(z)(_, () => U(w)),
932
+ onPointerup: l[2] || (l[2] = //@ts-ignore
933
+ (..._) => n(t) && n(t)(..._)),
934
+ onPointerleave: l[3] || (l[3] = //@ts-ignore
935
+ (..._) => n(t) && n(t)(..._)),
936
+ onPointercancel: l[4] || (l[4] = //@ts-ignore
937
+ (..._) => n(t) && n(t)(..._)),
938
+ onContextmenu: l[5] || (l[5] = C(() => {
944
939
  }, ["prevent"]))
945
940
  }, D(w), 41, $t)), 64))
946
941
  ]),
947
- (y(), x(L, null, V(c, (w, F) => g("div", {
942
+ (b(), x(L, null, V(d, (w, F) => g("div", {
948
943
  key: `row-${F}`,
949
944
  class: "zhk-base__row"
950
945
  }, [
951
- F === 2 ? (y(), x("button", {
946
+ F === 2 ? (b(), x("button", {
952
947
  key: 0,
953
948
  class: O(["zhk-base__key zhk-base__key--function zhk-base__key--shift", {
954
- "zhk-base__key--active": !d.value && i.value,
955
- "zhk-base__key--disabled": d.value && R.value
949
+ "zhk-base__key--active": !f.value && s.value,
950
+ "zhk-base__key--disabled": f.value && T.value
956
951
  }]),
957
- disabled: d.value && R.value,
958
- onClick: b,
959
- onContextmenu: r[6] || (r[6] = C(() => {
952
+ disabled: f.value && T.value,
953
+ onClick: y,
954
+ onContextmenu: l[6] || (l[6] = C(() => {
960
955
  }, ["prevent"]))
961
956
  }, [
962
- d.value ? (y(), x(L, { key: 0 }, [
963
- re(D(P.value), 1)
964
- ], 64)) : (y(), x("img", St))
965
- ], 42, Et)) : W("", !0),
966
- (y(!0), x(L, null, V(w, ($, Ce) => (y(), x("button", {
957
+ f.value ? (b(), x(L, { key: 0 }, [
958
+ ie(D(E.value), 1)
959
+ ], 64)) : (b(), x("img", Lt))
960
+ ], 42, St)) : W("", !0),
961
+ (b(!0), x(L, null, V(w, (_, Ce) => (b(), x("button", {
967
962
  key: `key-${F}-${Ce}`,
968
963
  class: "zhk-base__key zhk-base__key--letter",
969
- onPointerdown: (A) => n(z)(A, () => U($)),
970
- onPointerup: r[7] || (r[7] = //@ts-ignore
964
+ onPointerdown: (A) => n(z)(A, () => U(_)),
965
+ onPointerup: l[7] || (l[7] = //@ts-ignore
971
966
  (...A) => n(t) && n(t)(...A)),
972
- onPointerleave: r[8] || (r[8] = //@ts-ignore
967
+ onPointerleave: l[8] || (l[8] = //@ts-ignore
973
968
  (...A) => n(t) && n(t)(...A)),
974
- onPointercancel: r[9] || (r[9] = //@ts-ignore
969
+ onPointercancel: l[9] || (l[9] = //@ts-ignore
975
970
  (...A) => n(t) && n(t)(...A)),
976
- onContextmenu: r[10] || (r[10] = C(() => {
971
+ onContextmenu: l[10] || (l[10] = C(() => {
977
972
  }, ["prevent"]))
978
- }, D(f.value ? $.toUpperCase() : $), 41, Lt))), 128)),
979
- F === 2 ? (y(), x("button", {
973
+ }, D(v.value ? _.toUpperCase() : _), 41, Tt))), 128)),
974
+ F === 2 ? (b(), x("button", {
980
975
  key: 1,
981
976
  class: "zhk-base__key zhk-base__key--function zhk-base__key--delete",
982
- onPointerdown: r[11] || (r[11] = ($) => n(z)($, () => k())),
983
- onPointerup: r[12] || (r[12] = //@ts-ignore
984
- (...$) => n(t) && n(t)(...$)),
985
- onPointerleave: r[13] || (r[13] = //@ts-ignore
986
- (...$) => n(t) && n(t)(...$)),
987
- onPointercancel: r[14] || (r[14] = //@ts-ignore
988
- (...$) => n(t) && n(t)(...$)),
989
- onContextmenu: r[15] || (r[15] = C(() => {
977
+ onPointerdown: l[11] || (l[11] = (_) => n(z)(_, () => k())),
978
+ onPointerup: l[12] || (l[12] = //@ts-ignore
979
+ (..._) => n(t) && n(t)(..._)),
980
+ onPointerleave: l[13] || (l[13] = //@ts-ignore
981
+ (..._) => n(t) && n(t)(..._)),
982
+ onPointercancel: l[14] || (l[14] = //@ts-ignore
983
+ (..._) => n(t) && n(t)(..._)),
984
+ onContextmenu: l[15] || (l[15] = C(() => {
990
985
  }, ["prevent"]))
991
- }, r[39] || (r[39] = [
986
+ }, l[39] || (l[39] = [
992
987
  g("img", {
993
- src: ve,
988
+ src: ce,
994
989
  class: "zhk-base__key-icon",
995
990
  alt: "Delete"
996
991
  }, null, -1)
@@ -1000,39 +995,39 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
1000
995
  g("button", {
1001
996
  class: "zhk-base__key zhk-base__key--function",
1002
997
  onClick: u,
1003
- onContextmenu: r[16] || (r[16] = C(() => {
998
+ onContextmenu: l[16] || (l[16] = C(() => {
1004
999
  }, ["prevent"]))
1005
1000
  }, " 符 ", 32),
1006
1001
  g("button", {
1007
1002
  class: "zhk-base__key zhk-base__key--function",
1008
1003
  onClick: h,
1009
- onContextmenu: r[17] || (r[17] = C(() => {
1004
+ onContextmenu: l[17] || (l[17] = C(() => {
1010
1005
  }, ["prevent"]))
1011
1006
  }, " 123 ", 32),
1012
1007
  g("button", {
1013
1008
  class: "zhk-base__key",
1014
- onPointerdown: r[18] || (r[18] = (w) => n(z)(w, () => v(","))),
1015
- onPointerup: r[19] || (r[19] = //@ts-ignore
1009
+ onPointerdown: l[18] || (l[18] = (w) => n(z)(w, () => c(","))),
1010
+ onPointerup: l[19] || (l[19] = //@ts-ignore
1016
1011
  (...w) => n(t) && n(t)(...w)),
1017
- onPointerleave: r[20] || (r[20] = //@ts-ignore
1012
+ onPointerleave: l[20] || (l[20] = //@ts-ignore
1018
1013
  (...w) => n(t) && n(t)(...w)),
1019
- onPointercancel: r[21] || (r[21] = //@ts-ignore
1014
+ onPointercancel: l[21] || (l[21] = //@ts-ignore
1020
1015
  (...w) => n(t) && n(t)(...w)),
1021
- onContextmenu: r[22] || (r[22] = C(() => {
1016
+ onContextmenu: l[22] || (l[22] = C(() => {
1022
1017
  }, ["prevent"]))
1023
1018
  }, " , ", 32),
1024
1019
  g("button", {
1025
1020
  class: "zhk-base__key zhk-base__key--space",
1026
- onPointerdown: r[23] || (r[23] = (w) => n(z)(w, () => N())),
1027
- onPointerup: r[24] || (r[24] = //@ts-ignore
1021
+ onPointerdown: l[23] || (l[23] = (w) => n(z)(w, () => N())),
1022
+ onPointerup: l[24] || (l[24] = //@ts-ignore
1028
1023
  (...w) => n(t) && n(t)(...w)),
1029
- onPointerleave: r[25] || (r[25] = //@ts-ignore
1024
+ onPointerleave: l[25] || (l[25] = //@ts-ignore
1030
1025
  (...w) => n(t) && n(t)(...w)),
1031
- onPointercancel: r[26] || (r[26] = //@ts-ignore
1026
+ onPointercancel: l[26] || (l[26] = //@ts-ignore
1032
1027
  (...w) => n(t) && n(t)(...w)),
1033
- onContextmenu: r[27] || (r[27] = C(() => {
1028
+ onContextmenu: l[27] || (l[27] = C(() => {
1034
1029
  }, ["prevent"]))
1035
- }, r[40] || (r[40] = [
1030
+ }, l[40] || (l[40] = [
1036
1031
  g("img", {
1037
1032
  src: ze,
1038
1033
  class: "zhk-base__key-icon",
@@ -1041,39 +1036,39 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
1041
1036
  ]), 32),
1042
1037
  g("button", {
1043
1038
  class: "zhk-base__key",
1044
- onPointerdown: r[28] || (r[28] = (w) => n(z)(w, () => v("。"))),
1045
- onPointerup: r[29] || (r[29] = //@ts-ignore
1039
+ onPointerdown: l[28] || (l[28] = (w) => n(z)(w, () => c("。"))),
1040
+ onPointerup: l[29] || (l[29] = //@ts-ignore
1046
1041
  (...w) => n(t) && n(t)(...w)),
1047
- onPointerleave: r[30] || (r[30] = //@ts-ignore
1042
+ onPointerleave: l[30] || (l[30] = //@ts-ignore
1048
1043
  (...w) => n(t) && n(t)(...w)),
1049
- onPointercancel: r[31] || (r[31] = //@ts-ignore
1044
+ onPointercancel: l[31] || (l[31] = //@ts-ignore
1050
1045
  (...w) => n(t) && n(t)(...w)),
1051
- onContextmenu: r[32] || (r[32] = C(() => {
1046
+ onContextmenu: l[32] || (l[32] = C(() => {
1052
1047
  }, ["prevent"]))
1053
1048
  }, " 。 ", 32),
1054
1049
  g("button", {
1055
1050
  class: "zhk-base__key zhk-base__key--function",
1056
1051
  onClick: oe,
1057
- onContextmenu: r[33] || (r[33] = C(() => {
1052
+ onContextmenu: l[33] || (l[33] = C(() => {
1058
1053
  }, ["prevent"]))
1059
1054
  }, [
1060
- g("span", Tt, D(l.value === "zh" ? "中" : "英"), 1),
1061
- g("span", Dt, "/" + D(l.value === "zh" ? "英" : "中"), 1)
1055
+ g("span", Dt, D(r.value === "zh" ? "中" : "英"), 1),
1056
+ g("span", Mt, "/" + D(r.value === "zh" ? "英" : "中"), 1)
1062
1057
  ], 32),
1063
1058
  g("button", {
1064
1059
  class: "zhk-base__key zhk-base__key--function",
1065
- onPointerdown: r[34] || (r[34] = (w) => n(z)(w, () => ne())),
1066
- onPointerup: r[35] || (r[35] = //@ts-ignore
1060
+ onPointerdown: l[34] || (l[34] = (w) => n(z)(w, () => ne())),
1061
+ onPointerup: l[35] || (l[35] = //@ts-ignore
1067
1062
  (...w) => n(t) && n(t)(...w)),
1068
- onPointerleave: r[36] || (r[36] = //@ts-ignore
1063
+ onPointerleave: l[36] || (l[36] = //@ts-ignore
1069
1064
  (...w) => n(t) && n(t)(...w)),
1070
- onPointercancel: r[37] || (r[37] = //@ts-ignore
1065
+ onPointercancel: l[37] || (l[37] = //@ts-ignore
1071
1066
  (...w) => n(t) && n(t)(...w)),
1072
- onContextmenu: r[38] || (r[38] = C(() => {
1067
+ onContextmenu: l[38] || (l[38] = C(() => {
1073
1068
  }, ["prevent"]))
1074
- }, r[41] || (r[41] = [
1069
+ }, l[41] || (l[41] = [
1075
1070
  g("img", {
1076
- src: fe,
1071
+ src: ve,
1077
1072
  class: "zhk-base__key-icon",
1078
1073
  alt: "Enter"
1079
1074
  }, null, -1)
@@ -1081,15 +1076,15 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
1081
1076
  ])
1082
1077
  ]));
1083
1078
  }
1084
- }), Mt = { class: "num-keyboard" }, Vt = { class: "num-keyboard__container" }, Bt = { class: "num-keyboard__left" }, It = { class: "num-keyboard__rows" }, At = ["onClick", "onPointerdown"], Kt = {
1079
+ }), Vt = { class: "num-keyboard" }, Bt = { class: "num-keyboard__container" }, It = { class: "num-keyboard__left" }, At = { class: "num-keyboard__rows" }, Kt = ["onClick", "onPointerdown"], Wt = {
1085
1080
  key: 1,
1086
1081
  src: ze,
1087
1082
  class: "zhk-base__key-icon",
1088
1083
  alt: "Space"
1089
- }, Wt = { class: "num-keyboard__right" }, Ot = ["onPointerdown"], Nt = ["src", "alt"], Ut = { key: 1 }, Ft = /* @__PURE__ */ I({
1084
+ }, Ot = { class: "num-keyboard__right" }, Nt = ["onPointerdown"], Ut = ["src", "alt"], Ft = { key: 1 }, Zt = /* @__PURE__ */ I({
1090
1085
  __name: "NumericKeyboard",
1091
1086
  props: {
1092
- keyboardRows: { default: () => Y().numKeys || [
1087
+ keyboardRows: { default: () => Z().numKeys || [
1093
1088
  ["1", "2", "3"],
1094
1089
  ["4", "5", "6"],
1095
1090
  ["7", "8", "9"],
@@ -1098,137 +1093,137 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
1098
1093
  },
1099
1094
  emits: ["key", "exit"],
1100
1095
  setup(e, { emit: o }) {
1101
- const s = o, a = [
1102
- { key: "delete", icon: ve, text: "", alt: "Delete" },
1096
+ const i = o, a = [
1097
+ { key: "delete", icon: ce, text: "", alt: "Delete" },
1103
1098
  { key: ".", icon: "", text: ".", alt: "." },
1104
1099
  { key: "@", icon: "", text: "@", alt: "@" },
1105
- { key: "enter", icon: fe, text: "", alt: "Enter" }
1100
+ { key: "enter", icon: ve, text: "", alt: "Enter" }
1106
1101
  ];
1107
- function l(h) {
1108
- s("key", { key: h });
1102
+ function r(h) {
1103
+ i("key", { key: h });
1109
1104
  }
1110
- function i(h, u = !0) {
1111
- s("key", { key: h, isControl: u });
1105
+ function s(h, u = !0) {
1106
+ i("key", { key: h, isControl: u });
1112
1107
  }
1113
- function d() {
1114
- s("exit");
1108
+ function f() {
1109
+ i("exit");
1115
1110
  }
1116
- const { startRepeat: f, stopRepeat: v } = te();
1117
- function b(h, u) {
1118
- h === "back" || (h === "space" && (h = " "), h === "delete" || h === "enter" ? f(u, () => i(h)) : f(u, () => l(h)));
1111
+ const { startRepeat: v, stopRepeat: c } = te();
1112
+ function y(h, u) {
1113
+ h === "back" || (h === "space" && (h = " "), h === "delete" || h === "enter" ? v(u, () => s(h)) : v(u, () => r(h)));
1119
1114
  }
1120
- return (h, u) => (y(), x("div", Mt, [
1121
- g("div", Vt, [
1122
- g("div", Bt, [
1123
- g("div", It, [
1124
- (y(!0), x(L, null, V(h.keyboardRows, (p, c) => (y(), x("div", {
1125
- key: `row-${c}`,
1115
+ return (h, u) => (b(), x("div", Vt, [
1116
+ g("div", Bt, [
1117
+ g("div", It, [
1118
+ g("div", At, [
1119
+ (b(!0), x(L, null, V(h.keyboardRows, (p, d) => (b(), x("div", {
1120
+ key: `row-${d}`,
1126
1121
  class: "num-keyboard__row"
1127
1122
  }, [
1128
- (y(!0), x(L, null, V(p, (m, _) => (y(), x("button", {
1129
- key: `key-${c}-${_}`,
1123
+ (b(!0), x(L, null, V(p, (m, P) => (b(), x("button", {
1124
+ key: `key-${d}-${P}`,
1130
1125
  class: O(["num-keyboard__key", {
1131
1126
  "num-keyboard__key--back": m === "back",
1132
1127
  "num-keyboard__key--space": m === "space"
1133
1128
  }]),
1134
- onClick: (z) => m === "back" && d(),
1135
- onPointerdown: (z) => b(m, z),
1129
+ onClick: (z) => m === "back" && f(),
1130
+ onPointerdown: (z) => y(m, z),
1136
1131
  onPointerup: u[0] || (u[0] = //@ts-ignore
1137
- (...z) => n(v) && n(v)(...z)),
1132
+ (...z) => n(c) && n(c)(...z)),
1138
1133
  onPointerleave: u[1] || (u[1] = //@ts-ignore
1139
- (...z) => n(v) && n(v)(...z)),
1134
+ (...z) => n(c) && n(c)(...z)),
1140
1135
  onPointercancel: u[2] || (u[2] = //@ts-ignore
1141
- (...z) => n(v) && n(v)(...z)),
1136
+ (...z) => n(c) && n(c)(...z)),
1142
1137
  onContextmenu: u[3] || (u[3] = C(() => {
1143
1138
  }, ["prevent"]))
1144
1139
  }, [
1145
- m === "back" ? (y(), x(L, { key: 0 }, [
1146
- re(" 返回 ")
1147
- ], 64)) : m === "space" ? (y(), x("img", Kt)) : (y(), x(L, { key: 2 }, [
1148
- re(D(m), 1)
1140
+ m === "back" ? (b(), x(L, { key: 0 }, [
1141
+ ie(" 返回 ")
1142
+ ], 64)) : m === "space" ? (b(), x("img", Wt)) : (b(), x(L, { key: 2 }, [
1143
+ ie(D(m), 1)
1149
1144
  ], 64))
1150
- ], 42, At))), 128))
1145
+ ], 42, Kt))), 128))
1151
1146
  ]))), 128))
1152
1147
  ])
1153
1148
  ]),
1154
- g("div", Wt, [
1155
- (y(), x(L, null, V(a, (p, c) => g("button", {
1156
- key: `func-${c}`,
1149
+ g("div", Ot, [
1150
+ (b(), x(L, null, V(a, (p, d) => g("button", {
1151
+ key: `func-${d}`,
1157
1152
  class: "num-keyboard__key num-keyboard__key--function",
1158
- onPointerdown: (m) => b(p.key, m),
1153
+ onPointerdown: (m) => y(p.key, m),
1159
1154
  onPointerup: u[4] || (u[4] = //@ts-ignore
1160
- (...m) => n(v) && n(v)(...m)),
1155
+ (...m) => n(c) && n(c)(...m)),
1161
1156
  onPointerleave: u[5] || (u[5] = //@ts-ignore
1162
- (...m) => n(v) && n(v)(...m)),
1157
+ (...m) => n(c) && n(c)(...m)),
1163
1158
  onPointercancel: u[6] || (u[6] = //@ts-ignore
1164
- (...m) => n(v) && n(v)(...m)),
1159
+ (...m) => n(c) && n(c)(...m)),
1165
1160
  onContextmenu: u[7] || (u[7] = C(() => {
1166
1161
  }, ["prevent"]))
1167
1162
  }, [
1168
- p.icon ? (y(), x("img", {
1163
+ p.icon ? (b(), x("img", {
1169
1164
  key: 0,
1170
1165
  src: p.icon,
1171
1166
  class: "num-keyboard__key-icon",
1172
1167
  alt: p.alt
1173
- }, null, 8, Nt)) : (y(), x("span", Ut, D(p.text), 1))
1174
- ], 40, Ot)), 64))
1168
+ }, null, 8, Ut)) : (b(), x("span", Ft, D(p.text), 1))
1169
+ ], 40, Nt)), 64))
1175
1170
  ])
1176
1171
  ])
1177
1172
  ]));
1178
1173
  }
1179
- }), Zt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M18,20V10H6V20H18M18,8A2,2%200%200,1%2020,10V20A2,2%200%200,1%2018,22H6C4.89,22%204,21.1%204,20V10A2,2%200%200,1%206,8H15V6A3,3%200%200,0%2012,3A3,3%200%200,0%209,6H7A5,5%200%200,1%2012,1A5,5%200%200,1%2017,6V8H18M12,17A2,2%200%200,1%2010,15A2,2%200%200,1%2012,13A2,2%200%200,1%2014,15A2,2%200%200,1%2012,17Z'%20/%3e%3c/svg%3e", Xt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M12,17C10.89,17%2010,16.1%2010,15C10,13.89%2010.89,13%2012,13A2,2%200%200,1%2014,15A2,2%200%200,1%2012,17M18,20V10H6V20H18M18,8A2,2%200%200,1%2020,10V20A2,2%200%200,1%2018,22H6C4.89,22%204,21.1%204,20V10C4,8.89%204.89,8%206,8H7V6A5,5%200%200,1%2012,1A5,5%200%200,1%2017,6V8H18M12,3A3,3%200%200,0%209,6V8H15V6A3,3%200%200,0%2012,3Z'%20/%3e%3c/svg%3e", Yt = { class: "symbol-keyboard" }, jt = { class: "symbol-keyboard__content" }, Gt = { class: "symbol-keyboard__functions" }, qt = { class: "symbol-keyboard__lang-selector" }, Jt = { class: "symbol-keyboard__control-group" }, Qt = ["src"], en = ["src"], tn = { class: "symbol-keyboard__symbols-container" }, nn = { class: "symbol-keyboard__symbols-grid" }, on = ["onClick", "onPointerdown"], sn = "!@#$%^&*(){}[]<>/\\|:;\"',.?+-=_~`€£¥₹©®™°", rn = "!@#¥%…&*(){}[]<>/\|:;"',。?+-=_~·€£¥₹©®™°", ln = /* @__PURE__ */ I({
1174
+ }), Xt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M18,20V10H6V20H18M18,8A2,2%200%200,1%2020,10V20A2,2%200%200,1%2018,22H6C4.89,22%204,21.1%204,20V10A2,2%200%200,1%206,8H15V6A3,3%200%200,0%2012,3A3,3%200%200,0%209,6H7A5,5%200%200,1%2012,1A5,5%200%200,1%2017,6V8H18M12,17A2,2%200%200,1%2010,15A2,2%200%200,1%2012,13A2,2%200%200,1%2014,15A2,2%200%200,1%2012,17Z'%20/%3e%3c/svg%3e", Yt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M12,17C10.89,17%2010,16.1%2010,15C10,13.89%2010.89,13%2012,13A2,2%200%200,1%2014,15A2,2%200%200,1%2012,17M18,20V10H6V20H18M18,8A2,2%200%200,1%2020,10V20A2,2%200%200,1%2018,22H6C4.89,22%204,21.1%204,20V10C4,8.89%204.89,8%206,8H7V6A5,5%200%200,1%2012,1A5,5%200%200,1%2017,6V8H18M12,3A3,3%200%200,0%209,6V8H15V6A3,3%200%200,0%2012,3Z'%20/%3e%3c/svg%3e", jt = { class: "symbol-keyboard" }, Gt = { class: "symbol-keyboard__content" }, qt = { class: "symbol-keyboard__functions" }, Jt = { class: "symbol-keyboard__lang-selector" }, Qt = { class: "symbol-keyboard__control-group" }, en = ["src"], tn = ["src"], nn = { class: "symbol-keyboard__symbols-container" }, on = { class: "symbol-keyboard__symbols-grid" }, sn = ["onClick", "onPointerdown"], rn = "!@#$%^&*(){}[]<>/\\|:;\"',.?+-=_~`€£¥₹©®™°", ln = "!@#¥%…&*(){}[]<>/\|:;"',。?+-=_~·€£¥₹©®™°", an = /* @__PURE__ */ I({
1180
1175
  __name: "SymbolKeyboard",
1181
1176
  emits: ["key", "exit"],
1182
1177
  setup(e, { emit: o }) {
1183
- const s = o, a = E("en"), l = S(() => a.value === "zh" ? rn : sn), i = E(!1), { startRepeat: d, stopRepeat: f } = te();
1184
- function v(c, m) {
1185
- i.value && d(m, () => b(c));
1178
+ const i = o, a = $("en"), r = S(() => a.value === "zh" ? ln : rn), s = $(!1), { startRepeat: f, stopRepeat: v } = te();
1179
+ function c(d, m) {
1180
+ s.value && f(m, () => y(d));
1186
1181
  }
1187
- function b(c) {
1188
- s("key", { key: c }), i.value || s("exit");
1182
+ function y(d) {
1183
+ i("key", { key: d }), s.value || i("exit");
1189
1184
  }
1190
1185
  function h() {
1191
- s("exit");
1186
+ i("exit");
1192
1187
  }
1193
- function u(c) {
1194
- a.value = c;
1188
+ function u(d) {
1189
+ a.value = d;
1195
1190
  }
1196
1191
  function p() {
1197
- i.value = !i.value;
1192
+ s.value = !s.value;
1198
1193
  }
1199
- return (c, m) => (y(), x("div", Yt, [
1200
- g("div", jt, [
1201
- g("div", Gt, [
1202
- g("div", qt, [
1194
+ return (d, m) => (b(), x("div", jt, [
1195
+ g("div", Gt, [
1196
+ g("div", qt, [
1197
+ g("div", Jt, [
1203
1198
  g("button", {
1204
1199
  class: O(["symbol-keyboard__lang-btn", { "symbol-keyboard__lang-btn--active": a.value === "zh" }]),
1205
- onClick: m[0] || (m[0] = (_) => u("zh")),
1200
+ onClick: m[0] || (m[0] = (P) => u("zh")),
1206
1201
  onContextmenu: m[1] || (m[1] = C(() => {
1207
1202
  }, ["prevent"]))
1208
1203
  }, " 中文 ", 34),
1209
1204
  g("button", {
1210
1205
  class: O(["symbol-keyboard__lang-btn", { "symbol-keyboard__lang-btn--active": a.value === "en" }]),
1211
- onClick: m[2] || (m[2] = (_) => u("en")),
1206
+ onClick: m[2] || (m[2] = (P) => u("en")),
1212
1207
  onContextmenu: m[3] || (m[3] = C(() => {
1213
1208
  }, ["prevent"]))
1214
1209
  }, " 英文 ", 34)
1215
1210
  ]),
1216
- g("div", Jt, [
1211
+ g("div", Qt, [
1217
1212
  g("button", {
1218
- class: O(["symbol-keyboard__key symbol-keyboard__key--function symbol-keyboard__key--lock", { "symbol-keyboard__key--locked": i.value }]),
1213
+ class: O(["symbol-keyboard__key symbol-keyboard__key--function symbol-keyboard__key--lock", { "symbol-keyboard__key--locked": s.value }]),
1219
1214
  onClick: p,
1220
1215
  onContextmenu: m[4] || (m[4] = C(() => {
1221
1216
  }, ["prevent"]))
1222
1217
  }, [
1223
- i.value ? (y(), x("img", {
1218
+ s.value ? (b(), x("img", {
1224
1219
  key: 1,
1225
- src: n(Xt),
1220
+ src: n(Yt),
1226
1221
  alt: "Lock closed"
1227
- }, null, 8, en)) : (y(), x("img", {
1222
+ }, null, 8, tn)) : (b(), x("img", {
1228
1223
  key: 0,
1229
- src: n(Zt),
1224
+ src: n(Xt),
1230
1225
  alt: "Lock open"
1231
- }, null, 8, Qt))
1226
+ }, null, 8, en))
1232
1227
  ], 34),
1233
1228
  g("button", {
1234
1229
  class: "symbol-keyboard__key symbol-keyboard__key--function symbol-keyboard__key--back",
@@ -1238,157 +1233,197 @@ const st = { class: "zhk-candidate-list" }, it = ["onClick"], xe = /* @__PURE__
1238
1233
  }, " 返回 ", 32)
1239
1234
  ])
1240
1235
  ]),
1241
- g("div", tn, [
1242
- g("div", nn, [
1243
- (y(!0), x(L, null, V(l.value, (_, z) => (y(), x("button", {
1236
+ g("div", nn, [
1237
+ g("div", on, [
1238
+ (b(!0), x(L, null, V(r.value, (P, z) => (b(), x("button", {
1244
1239
  key: `key-${z}`,
1245
1240
  class: "symbol-keyboard__key",
1246
- onClick: (t) => !i.value && b(_),
1247
- onPointerdown: (t) => v(_, t),
1241
+ onClick: (t) => !s.value && y(P),
1242
+ onPointerdown: (t) => c(P, t),
1248
1243
  onPointerup: m[6] || (m[6] = //@ts-ignore
1249
- (...t) => n(f) && n(f)(...t)),
1244
+ (...t) => n(v) && n(v)(...t)),
1250
1245
  onPointerleave: m[7] || (m[7] = //@ts-ignore
1251
- (...t) => n(f) && n(f)(...t)),
1246
+ (...t) => n(v) && n(v)(...t)),
1252
1247
  onPointercancel: m[8] || (m[8] = //@ts-ignore
1253
- (...t) => n(f) && n(f)(...t)),
1248
+ (...t) => n(v) && n(v)(...t)),
1254
1249
  onContextmenu: m[9] || (m[9] = C(() => {
1255
1250
  }, ["prevent"]))
1256
- }, D(_), 41, on))), 128))
1251
+ }, D(P), 41, sn))), 128))
1257
1252
  ])
1258
1253
  ])
1259
1254
  ])
1260
1255
  ]));
1261
1256
  }
1262
- }), an = {
1257
+ }), un = {
1263
1258
  key: 0,
1264
1259
  class: "zhk__disabled-overlay"
1265
- }, un = /* @__PURE__ */ I({
1260
+ }, dn = /* @__PURE__ */ I({
1266
1261
  __name: "ZhKeyboard",
1267
1262
  props: {
1268
- defaultMode: { default: Y().defaultMode ?? "en" },
1269
- enableHandwriting: { type: Boolean, default: Y().enableHandwriting ?? !1 },
1270
- position: { default: Y().position ?? "static" },
1271
- disableWhenNoFocus: { type: Boolean, default: Y().disableWhenNoFocus ?? !0 },
1272
- numKeys: {}
1263
+ /**
1264
+ * 默认的键盘模式
1265
+ */
1266
+ defaultMode: {
1267
+ type: String,
1268
+ default: () => Z().defaultMode ?? "en"
1269
+ },
1270
+ /**
1271
+ * 是否启用手写输入
1272
+ */
1273
+ enableHandwriting: {
1274
+ type: Boolean,
1275
+ default: () => Z().enableHandwriting ?? !1
1276
+ },
1277
+ /**
1278
+ * 键盘定位模式
1279
+ * @default 'static'
1280
+ */
1281
+ position: {
1282
+ type: String,
1283
+ default: () => Z().position ?? "static"
1284
+ },
1285
+ /**
1286
+ * 浮动模式下键盘与输入框的距离
1287
+ * @default 10
1288
+ */
1289
+ floatMarginTop: {
1290
+ type: Number,
1291
+ default: () => Z().floatMarginTop ?? 0
1292
+ },
1293
+ /**
1294
+ * 当没有input获得焦点时是否禁用键盘
1295
+ * @default true
1296
+ */
1297
+ disableWhenNoFocus: {
1298
+ type: Boolean,
1299
+ default: () => Z().disableWhenNoFocus ?? !0
1300
+ },
1301
+ /**
1302
+ * 数字键盘的行配置
1303
+ */
1304
+ numKeys: {
1305
+ type: Array || void 0
1306
+ }
1273
1307
  },
1274
1308
  emits: ["key"],
1275
1309
  setup(e, { emit: o }) {
1276
- const s = e, a = o, l = E(s.defaultMode), i = E(s.defaultMode), d = E([]), f = E(!1), v = E(null), b = E(null), { recognizerInitialized: h, recognizerProgress: u } = ot(s.enableHandwriting);
1277
- Z(l, (P, R) => {
1278
- P !== R && (i.value = R);
1310
+ const i = e, a = o, r = $(i.defaultMode), s = $(i.defaultMode), f = $([]), v = $(!1), c = $(null), y = $(null), { recognizerInitialized: h, recognizerProgress: u } = ot(i.enableHandwriting);
1311
+ X(r, (E, T) => {
1312
+ E !== T && (s.value = T);
1279
1313
  });
1280
- const p = Ze(), c = S(() => p.value && de(p.value) ? p.value : null), m = S(() => s.position === "static" || !!(p.value && de(p.value))), { height: _ } = ge(b);
1314
+ const p = Ze(), d = S(() => p.value && ue(p.value) ? p.value : null), m = S(() => i.position === "static" || !!(p.value && ue(p.value))), { height: P } = ge(y);
1281
1315
  q(() => {
1282
- if (c.value) {
1283
- const P = c.value.dataset.inputmode;
1284
- P && (l.value = P);
1316
+ if (d.value) {
1317
+ const E = d.value.dataset.inputmode;
1318
+ E && (r.value = E);
1285
1319
  }
1286
1320
  });
1287
- const z = S(() => s.disableWhenNoFocus === !1 ? !1 : !c.value);
1321
+ const z = S(() => i.disableWhenNoFocus === !1 ? !1 : !d.value);
1288
1322
  function t() {
1289
- if (!_.value)
1323
+ if (!P.value)
1290
1324
  return;
1291
- const P = Ge(
1292
- c.value,
1293
- b.value,
1294
- s.position
1325
+ const E = Ge(
1326
+ d.value,
1327
+ y.value,
1328
+ i.position,
1329
+ i.floatMarginTop
1295
1330
  );
1296
- v.value = P;
1331
+ c.value = E;
1297
1332
  }
1298
1333
  q(t);
1299
1334
  const k = Ke(t, 100);
1300
1335
  J(window, "scroll", k, { passive: !0 }), J(window, "resize", k, { passive: !0 });
1301
- function N(P) {
1302
- if (P.isControl) {
1303
- switch (P.key) {
1336
+ function N(E) {
1337
+ if (E.isControl) {
1338
+ switch (E.key) {
1304
1339
  case "delete":
1305
- et(c.value);
1340
+ et(d.value);
1306
1341
  break;
1307
1342
  case "more":
1308
- f.value = !0;
1343
+ v.value = !0;
1309
1344
  break;
1310
1345
  }
1311
1346
  return;
1312
1347
  } else
1313
- ne(P.key);
1314
- a("key", P);
1348
+ ne(E.key);
1349
+ a("key", E);
1315
1350
  }
1316
- function ne(P) {
1317
- Qe(c.value, P);
1351
+ function ne(E) {
1352
+ Qe(d.value, E);
1318
1353
  }
1319
1354
  function U() {
1320
- ["hand", "num", "symbol"].includes(i.value) && (i.value = s.defaultMode), l.value = i.value;
1355
+ r.value === "hand" ? s.value = "zh" : ["num", "symbol"].includes(s.value) && (s.value = i.defaultMode), r.value = s.value;
1321
1356
  }
1322
- function oe(P) {
1323
- d.value = P;
1357
+ function oe(E) {
1358
+ f.value = E;
1324
1359
  }
1325
- return (P, R) => Re((y(), x("div", {
1360
+ return (E, T) => Te((b(), x("div", {
1326
1361
  ref_key: "keyboardRef",
1327
- ref: b,
1362
+ ref: y,
1328
1363
  class: O(["zhk", {
1329
- "zhk--floating": P.position === "float",
1330
- "zhk--bottom": P.position === "bottom",
1364
+ "zhk--floating": e.position === "float",
1365
+ "zhk--bottom": e.position === "bottom",
1331
1366
  "zhk--disabled": z.value
1332
1367
  }]),
1333
- style: se({
1334
- "--keyboard-height": `${n(_)}px`,
1335
- ...v.value
1368
+ style: pe({
1369
+ "--keyboard-height": `${n(P)}px`,
1370
+ ...c.value
1336
1371
  }),
1337
- onMousedown: R[1] || (R[1] = C(() => {
1372
+ onMousedown: T[1] || (T[1] = C(() => {
1338
1373
  }, ["prevent"]))
1339
1374
  }, [
1340
- z.value || !m.value || !n(_) ? (y(), x("div", an, R[2] || (R[2] = [
1375
+ z.value || !m.value || !n(P) ? (b(), x("div", un, T[2] || (T[2] = [
1341
1376
  g("span", null, "请选择输入框以启用键盘", -1)
1342
- ]))) : (y(), x(L, { key: 1 }, [
1343
- l.value === "hand" ? (y(), K(ft, {
1377
+ ]))) : (b(), x(L, { key: 1 }, [
1378
+ r.value === "hand" ? (b(), K(mt, {
1344
1379
  key: 0,
1345
1380
  "recognizer-initialized": n(h),
1346
1381
  "recognizer-progress": n(u),
1347
1382
  onKey: N,
1348
1383
  onExit: U,
1349
1384
  onRecognize: oe
1350
- }, null, 8, ["recognizer-initialized", "recognizer-progress"])) : l.value === "num" ? (y(), K(Ft, {
1385
+ }, null, 8, ["recognizer-initialized", "recognizer-progress"])) : r.value === "num" ? (b(), K(Zt, {
1351
1386
  key: 1,
1352
- "keyboard-rows": P.numKeys,
1387
+ "keyboard-rows": e.numKeys,
1353
1388
  onKey: N,
1354
1389
  onExit: U
1355
- }, null, 8, ["keyboard-rows"])) : l.value === "symbol" ? (y(), K(ln, {
1390
+ }, null, 8, ["keyboard-rows"])) : r.value === "symbol" ? (b(), K(an, {
1356
1391
  key: 2,
1357
1392
  onKey: N,
1358
1393
  onExit: U
1359
- })) : l.value === "en" || l.value === "zh" ? (y(), K(Ht, {
1394
+ })) : r.value === "en" || r.value === "en_cap" || r.value === "zh" ? (b(), K(Ht, {
1360
1395
  key: 3,
1361
- modelValue: l.value,
1362
- "onUpdate:modelValue": R[0] || (R[0] = (H) => l.value = H),
1363
- "enable-handwriting": P.enableHandwriting,
1396
+ modelValue: r.value,
1397
+ "onUpdate:modelValue": T[0] || (T[0] = (M) => r.value = M),
1398
+ "enable-handwriting": e.enableHandwriting,
1364
1399
  onKey: N
1365
1400
  }, null, 8, ["modelValue", "enable-handwriting"])) : W("", !0)
1366
1401
  ], 64))
1367
1402
  ], 38)), [
1368
- [Te, m.value]
1403
+ [Re, m.value]
1369
1404
  ]);
1370
1405
  }
1371
- }), kn = {
1406
+ }), hn = {
1372
1407
  install: (e) => {
1373
- e.component("ZhKeyboard", un);
1408
+ e.component("ZhKeyboard", dn);
1374
1409
  }
1375
1410
  };
1376
1411
  export {
1377
1412
  Ye as CanvasDrawer,
1378
- un as ZhKeyboard,
1413
+ dn as ZhKeyboard,
1379
1414
  Ge as calculateKeyboardPosition,
1380
1415
  nt as createKeyRepeater,
1381
- kn as default,
1416
+ hn as default,
1382
1417
  et as delToInputElement,
1383
- ue as getHandwritingRecognizer,
1384
- pn as getInputElement,
1385
- Y as getKeyboardConfig,
1418
+ ae as getHandwritingRecognizer,
1419
+ kn as getInputElement,
1420
+ Z as getKeyboardConfig,
1386
1421
  je as getPinyinEngine,
1387
- de as isInputElement,
1422
+ ue as isInputElement,
1388
1423
  tt as moveCursor,
1389
- fn as registerHandwritingRecognizer,
1390
- mn as registerPinyinEngine,
1391
- vn as setKeyboardConfig,
1424
+ mn as registerHandwritingRecognizer,
1425
+ pn as registerPinyinEngine,
1426
+ fn as setKeyboardConfig,
1392
1427
  Qe as writeToInputElement
1393
1428
  };
1394
1429
  //# sourceMappingURL=zh-keyboard-vue.js.map