@tdh-keyboard/react 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2403 @@
1
+ import e, { forwardRef as t, useCallback as n, useEffect as r, useImperativeHandle as i, useLayoutEffect as a, useMemo as o, useReducer as s, useRef as c, useState as l } from "react";
2
+ import { CanvasDrawer as u, calculateKeyboardPosition as d, createKeyRepeater as f, delToInputElement as p, getHandwritingRecognizer as m, getKeyboardConfig as h, getPinyinEngine as g, isInputElement as _, writeToInputElement as v } from "@tdh-keyboard/core";
3
+ import y from "react-dom";
4
+ export * from "@tdh-keyboard/core";
5
+ //#region \0rolldown/runtime.js
6
+ var b = Object.create, x = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, te = Object.getOwnPropertyNames, S = Object.getPrototypeOf, C = Object.prototype.hasOwnProperty, w = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), T = (e, t, n, r) => {
7
+ if (t && typeof t == "object" || typeof t == "function") for (var i = te(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !C.call(e, s) && s !== n && x(e, s, {
8
+ get: ((e) => t[e]).bind(null, s),
9
+ enumerable: !(r = ee(t, s)) || r.enumerable
10
+ });
11
+ return e;
12
+ }, ne = (e, t, n) => (n = e == null ? {} : b(S(e)), T(t || !e || !e.__esModule ? x(n, "default", {
13
+ value: e,
14
+ enumerable: !0
15
+ }) : n, e)), E = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
16
+ if (typeof require < "u") return require.apply(this, arguments);
17
+ throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
18
+ }), re = typeof global == "object" && global && global.Object === Object && global, D = typeof self == "object" && self && self.Object === Object && self, O = re || D || Function("return this")(), k = O.Symbol, ie = Object.prototype, ae = ie.hasOwnProperty, A = ie.toString, j = k ? k.toStringTag : void 0;
19
+ function M(e) {
20
+ var t = ae.call(e, j), n = e[j];
21
+ try {
22
+ e[j] = void 0;
23
+ var r = !0;
24
+ } catch {}
25
+ var i = A.call(e);
26
+ return r && (t ? e[j] = n : delete e[j]), i;
27
+ }
28
+ //#endregion
29
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js
30
+ var N = Object.prototype.toString;
31
+ function P(e) {
32
+ return N.call(e);
33
+ }
34
+ //#endregion
35
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js
36
+ var F = "[object Null]", oe = "[object Undefined]", I = k ? k.toStringTag : void 0;
37
+ function L(e) {
38
+ return e == null ? e === void 0 ? oe : F : I && I in Object(e) ? M(e) : P(e);
39
+ }
40
+ //#endregion
41
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js
42
+ function R(e) {
43
+ return typeof e == "object" && !!e;
44
+ }
45
+ //#endregion
46
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
47
+ var z = Array.isArray;
48
+ //#endregion
49
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js
50
+ function se(e) {
51
+ var t = typeof e;
52
+ return e != null && (t == "object" || t == "function");
53
+ }
54
+ //#endregion
55
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js
56
+ var B = "[object AsyncFunction]", ce = "[object Function]", le = "[object GeneratorFunction]", ue = "[object Proxy]";
57
+ function V(e) {
58
+ if (!se(e)) return !1;
59
+ var t = L(e);
60
+ return t == ce || t == le || t == B || t == ue;
61
+ }
62
+ //#endregion
63
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js
64
+ var H = O["__core-js_shared__"], de = function() {
65
+ var e = /[^.]+$/.exec(H && H.keys && H.keys.IE_PROTO || "");
66
+ return e ? "Symbol(src)_1." + e : "";
67
+ }();
68
+ function fe(e) {
69
+ return !!de && de in e;
70
+ }
71
+ //#endregion
72
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js
73
+ var U = Function.prototype.toString;
74
+ function W(e) {
75
+ if (e != null) {
76
+ try {
77
+ return U.call(e);
78
+ } catch {}
79
+ try {
80
+ return e + "";
81
+ } catch {}
82
+ }
83
+ return "";
84
+ }
85
+ //#endregion
86
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js
87
+ var pe = /[\\^$.*+?()[\]{}|]/g, me = /^\[object .+?Constructor\]$/, he = Function.prototype, ge = Object.prototype, _e = he.toString, ve = ge.hasOwnProperty, ye = RegExp("^" + _e.call(ve).replace(pe, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
88
+ function be(e) {
89
+ return !se(e) || fe(e) ? !1 : (V(e) ? ye : me).test(W(e));
90
+ }
91
+ //#endregion
92
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js
93
+ function xe(e, t) {
94
+ return e?.[t];
95
+ }
96
+ //#endregion
97
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js
98
+ function G(e, t) {
99
+ var n = xe(e, t);
100
+ return be(n) ? n : void 0;
101
+ }
102
+ //#endregion
103
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_WeakMap.js
104
+ var Se = G(O, "WeakMap"), Ce = 9007199254740991, we = /^(?:0|[1-9]\d*)$/;
105
+ function Te(e, t) {
106
+ var n = typeof e;
107
+ return t ??= Ce, !!t && (n == "number" || n != "symbol" && we.test(e)) && e > -1 && e % 1 == 0 && e < t;
108
+ }
109
+ //#endregion
110
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js
111
+ function Ee(e, t) {
112
+ return e === t || e !== e && t !== t;
113
+ }
114
+ //#endregion
115
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isLength.js
116
+ var De = 9007199254740991;
117
+ function Oe(e) {
118
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= De;
119
+ }
120
+ //#endregion
121
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLike.js
122
+ function ke(e) {
123
+ return e != null && Oe(e.length) && !V(e);
124
+ }
125
+ //#endregion
126
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isPrototype.js
127
+ var Ae = Object.prototype;
128
+ function je(e) {
129
+ var t = e && e.constructor;
130
+ return e === (typeof t == "function" && t.prototype || Ae);
131
+ }
132
+ //#endregion
133
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTimes.js
134
+ function K(e, t) {
135
+ for (var n = -1, r = Array(e); ++n < e;) r[n] = t(n);
136
+ return r;
137
+ }
138
+ //#endregion
139
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsArguments.js
140
+ var Me = "[object Arguments]";
141
+ function Ne(e) {
142
+ return R(e) && L(e) == Me;
143
+ }
144
+ //#endregion
145
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArguments.js
146
+ var Pe = Object.prototype, Fe = Pe.hasOwnProperty, Ie = Pe.propertyIsEnumerable, Le = Ne(function() {
147
+ return arguments;
148
+ }()) ? Ne : function(e) {
149
+ return R(e) && Fe.call(e, "callee") && !Ie.call(e, "callee");
150
+ };
151
+ //#endregion
152
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubFalse.js
153
+ function Re() {
154
+ return !1;
155
+ }
156
+ //#endregion
157
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isBuffer.js
158
+ var ze = typeof exports == "object" && exports && !exports.nodeType && exports, Be = ze && typeof module == "object" && module && !module.nodeType && module, Ve = Be && Be.exports === ze ? O.Buffer : void 0, He = (Ve ? Ve.isBuffer : void 0) || Re, Ue = "[object Arguments]", We = "[object Array]", Ge = "[object Boolean]", Ke = "[object Date]", qe = "[object Error]", Je = "[object Function]", Ye = "[object Map]", Xe = "[object Number]", Ze = "[object Object]", Qe = "[object RegExp]", $e = "[object Set]", et = "[object String]", tt = "[object WeakMap]", nt = "[object ArrayBuffer]", rt = "[object DataView]", it = "[object Float32Array]", at = "[object Float64Array]", ot = "[object Int8Array]", st = "[object Int16Array]", ct = "[object Int32Array]", lt = "[object Uint8Array]", ut = "[object Uint8ClampedArray]", dt = "[object Uint16Array]", ft = "[object Uint32Array]", q = {};
159
+ q[it] = q[at] = q[ot] = q[st] = q[ct] = q[lt] = q[ut] = q[dt] = q[ft] = !0, q[Ue] = q[We] = q[nt] = q[Ge] = q[rt] = q[Ke] = q[qe] = q[Je] = q[Ye] = q[Xe] = q[Ze] = q[Qe] = q[$e] = q[et] = q[tt] = !1;
160
+ function pt(e) {
161
+ return R(e) && Oe(e.length) && !!q[L(e)];
162
+ }
163
+ //#endregion
164
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUnary.js
165
+ function mt(e) {
166
+ return function(t) {
167
+ return e(t);
168
+ };
169
+ }
170
+ //#endregion
171
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nodeUtil.js
172
+ var ht = typeof exports == "object" && exports && !exports.nodeType && exports, gt = ht && typeof module == "object" && module && !module.nodeType && module, _t = gt && gt.exports === ht && re.process, vt = function() {
173
+ try {
174
+ return gt && gt.require && gt.require("util").types || _t && _t.binding && _t.binding("util");
175
+ } catch {}
176
+ }(), yt = vt && vt.isTypedArray, bt = yt ? mt(yt) : pt, xt = Object.prototype.hasOwnProperty;
177
+ function St(e, t) {
178
+ var n = z(e), r = !n && Le(e), i = !n && !r && He(e), a = !n && !r && !i && bt(e), o = n || r || i || a, s = o ? K(e.length, String) : [], c = s.length;
179
+ for (var l in e) (t || xt.call(e, l)) && !(o && (l == "length" || i && (l == "offset" || l == "parent") || a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || Te(l, c))) && s.push(l);
180
+ return s;
181
+ }
182
+ //#endregion
183
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overArg.js
184
+ function Ct(e, t) {
185
+ return function(n) {
186
+ return e(t(n));
187
+ };
188
+ }
189
+ //#endregion
190
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeys.js
191
+ var wt = Ct(Object.keys, Object), Tt = Object.prototype.hasOwnProperty;
192
+ function Et(e) {
193
+ if (!je(e)) return wt(e);
194
+ var t = [];
195
+ for (var n in Object(e)) Tt.call(e, n) && n != "constructor" && t.push(n);
196
+ return t;
197
+ }
198
+ //#endregion
199
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js
200
+ function Dt(e) {
201
+ return ke(e) ? St(e) : Et(e);
202
+ }
203
+ //#endregion
204
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js
205
+ var Ot = G(Object, "create");
206
+ //#endregion
207
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js
208
+ function kt() {
209
+ this.__data__ = Ot ? Ot(null) : {}, this.size = 0;
210
+ }
211
+ //#endregion
212
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js
213
+ function At(e) {
214
+ var t = this.has(e) && delete this.__data__[e];
215
+ return this.size -= t ? 1 : 0, t;
216
+ }
217
+ //#endregion
218
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js
219
+ var jt = "__lodash_hash_undefined__", Mt = Object.prototype.hasOwnProperty;
220
+ function Nt(e) {
221
+ var t = this.__data__;
222
+ if (Ot) {
223
+ var n = t[e];
224
+ return n === jt ? void 0 : n;
225
+ }
226
+ return Mt.call(t, e) ? t[e] : void 0;
227
+ }
228
+ //#endregion
229
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js
230
+ var Pt = Object.prototype.hasOwnProperty;
231
+ function Ft(e) {
232
+ var t = this.__data__;
233
+ return Ot ? t[e] !== void 0 : Pt.call(t, e);
234
+ }
235
+ //#endregion
236
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js
237
+ var It = "__lodash_hash_undefined__";
238
+ function Lt(e, t) {
239
+ var n = this.__data__;
240
+ return this.size += this.has(e) ? 0 : 1, n[e] = Ot && t === void 0 ? It : t, this;
241
+ }
242
+ //#endregion
243
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js
244
+ function J(e) {
245
+ var t = -1, n = e == null ? 0 : e.length;
246
+ for (this.clear(); ++t < n;) {
247
+ var r = e[t];
248
+ this.set(r[0], r[1]);
249
+ }
250
+ }
251
+ J.prototype.clear = kt, J.prototype.delete = At, J.prototype.get = Nt, J.prototype.has = Ft, J.prototype.set = Lt;
252
+ //#endregion
253
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js
254
+ function Rt() {
255
+ this.__data__ = [], this.size = 0;
256
+ }
257
+ //#endregion
258
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js
259
+ function zt(e, t) {
260
+ for (var n = e.length; n--;) if (Ee(e[n][0], t)) return n;
261
+ return -1;
262
+ }
263
+ //#endregion
264
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js
265
+ var Bt = Array.prototype.splice;
266
+ function Vt(e) {
267
+ var t = this.__data__, n = zt(t, e);
268
+ return n < 0 ? !1 : (n == t.length - 1 ? t.pop() : Bt.call(t, n, 1), --this.size, !0);
269
+ }
270
+ //#endregion
271
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js
272
+ function Ht(e) {
273
+ var t = this.__data__, n = zt(t, e);
274
+ return n < 0 ? void 0 : t[n][1];
275
+ }
276
+ //#endregion
277
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js
278
+ function Ut(e) {
279
+ return zt(this.__data__, e) > -1;
280
+ }
281
+ //#endregion
282
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js
283
+ function Wt(e, t) {
284
+ var n = this.__data__, r = zt(n, e);
285
+ return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this;
286
+ }
287
+ //#endregion
288
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js
289
+ function Y(e) {
290
+ var t = -1, n = e == null ? 0 : e.length;
291
+ for (this.clear(); ++t < n;) {
292
+ var r = e[t];
293
+ this.set(r[0], r[1]);
294
+ }
295
+ }
296
+ Y.prototype.clear = Rt, Y.prototype.delete = Vt, Y.prototype.get = Ht, Y.prototype.has = Ut, Y.prototype.set = Wt;
297
+ //#endregion
298
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js
299
+ var Gt = G(O, "Map");
300
+ //#endregion
301
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js
302
+ function Kt() {
303
+ this.size = 0, this.__data__ = {
304
+ hash: new J(),
305
+ map: new (Gt || Y)(),
306
+ string: new J()
307
+ };
308
+ }
309
+ //#endregion
310
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js
311
+ function qt(e) {
312
+ var t = typeof e;
313
+ return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
314
+ }
315
+ //#endregion
316
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js
317
+ function Jt(e, t) {
318
+ var n = e.__data__;
319
+ return qt(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
320
+ }
321
+ //#endregion
322
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js
323
+ function Yt(e) {
324
+ var t = Jt(this, e).delete(e);
325
+ return this.size -= t ? 1 : 0, t;
326
+ }
327
+ //#endregion
328
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js
329
+ function Xt(e) {
330
+ return Jt(this, e).get(e);
331
+ }
332
+ //#endregion
333
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js
334
+ function Zt(e) {
335
+ return Jt(this, e).has(e);
336
+ }
337
+ //#endregion
338
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js
339
+ function Qt(e, t) {
340
+ var n = Jt(this, e), r = n.size;
341
+ return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
342
+ }
343
+ //#endregion
344
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js
345
+ function X(e) {
346
+ var t = -1, n = e == null ? 0 : e.length;
347
+ for (this.clear(); ++t < n;) {
348
+ var r = e[t];
349
+ this.set(r[0], r[1]);
350
+ }
351
+ }
352
+ X.prototype.clear = Kt, X.prototype.delete = Yt, X.prototype.get = Xt, X.prototype.has = Zt, X.prototype.set = Qt;
353
+ //#endregion
354
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js
355
+ function $t(e, t) {
356
+ for (var n = -1, r = t.length, i = e.length; ++n < r;) e[i + n] = t[n];
357
+ return e;
358
+ }
359
+ //#endregion
360
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackClear.js
361
+ function en() {
362
+ this.__data__ = new Y(), this.size = 0;
363
+ }
364
+ //#endregion
365
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackDelete.js
366
+ function tn(e) {
367
+ var t = this.__data__, n = t.delete(e);
368
+ return this.size = t.size, n;
369
+ }
370
+ //#endregion
371
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackGet.js
372
+ function nn(e) {
373
+ return this.__data__.get(e);
374
+ }
375
+ //#endregion
376
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackHas.js
377
+ function rn(e) {
378
+ return this.__data__.has(e);
379
+ }
380
+ //#endregion
381
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackSet.js
382
+ var an = 200;
383
+ function on(e, t) {
384
+ var n = this.__data__;
385
+ if (n instanceof Y) {
386
+ var r = n.__data__;
387
+ if (!Gt || r.length < an - 1) return r.push([e, t]), this.size = ++n.size, this;
388
+ n = this.__data__ = new X(r);
389
+ }
390
+ return n.set(e, t), this.size = n.size, this;
391
+ }
392
+ //#endregion
393
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js
394
+ function Z(e) {
395
+ this.size = (this.__data__ = new Y(e)).size;
396
+ }
397
+ Z.prototype.clear = en, Z.prototype.delete = tn, Z.prototype.get = nn, Z.prototype.has = rn, Z.prototype.set = on;
398
+ //#endregion
399
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayFilter.js
400
+ function sn(e, t) {
401
+ for (var n = -1, r = e == null ? 0 : e.length, i = 0, a = []; ++n < r;) {
402
+ var o = e[n];
403
+ t(o, n, e) && (a[i++] = o);
404
+ }
405
+ return a;
406
+ }
407
+ //#endregion
408
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js
409
+ function cn() {
410
+ return [];
411
+ }
412
+ //#endregion
413
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbols.js
414
+ var ln = Object.prototype.propertyIsEnumerable, un = Object.getOwnPropertySymbols, dn = un ? function(e) {
415
+ return e == null ? [] : (e = Object(e), sn(un(e), function(t) {
416
+ return ln.call(e, t);
417
+ }));
418
+ } : cn;
419
+ //#endregion
420
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetAllKeys.js
421
+ function fn(e, t, n) {
422
+ var r = t(e);
423
+ return z(e) ? r : $t(r, n(e));
424
+ }
425
+ //#endregion
426
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js
427
+ function pn(e) {
428
+ return fn(e, Dt, dn);
429
+ }
430
+ //#endregion
431
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_DataView.js
432
+ var mn = G(O, "DataView"), hn = G(O, "Promise"), gn = G(O, "Set"), _n = "[object Map]", vn = "[object Object]", yn = "[object Promise]", bn = "[object Set]", xn = "[object WeakMap]", Sn = "[object DataView]", Cn = W(mn), wn = W(Gt), Tn = W(hn), En = W(gn), Dn = W(Se), Q = L;
433
+ (mn && Q(new mn(/* @__PURE__ */ new ArrayBuffer(1))) != Sn || Gt && Q(new Gt()) != _n || hn && Q(hn.resolve()) != yn || gn && Q(new gn()) != bn || Se && Q(new Se()) != xn) && (Q = function(e) {
434
+ var t = L(e), n = t == vn ? e.constructor : void 0, r = n ? W(n) : "";
435
+ if (r) switch (r) {
436
+ case Cn: return Sn;
437
+ case wn: return _n;
438
+ case Tn: return yn;
439
+ case En: return bn;
440
+ case Dn: return xn;
441
+ }
442
+ return t;
443
+ });
444
+ var On = Q, kn = O.Uint8Array, An = "__lodash_hash_undefined__";
445
+ function jn(e) {
446
+ return this.__data__.set(e, An), this;
447
+ }
448
+ //#endregion
449
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js
450
+ function Mn(e) {
451
+ return this.__data__.has(e);
452
+ }
453
+ //#endregion
454
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js
455
+ function Nn(e) {
456
+ var t = -1, n = e == null ? 0 : e.length;
457
+ for (this.__data__ = new X(); ++t < n;) this.add(e[t]);
458
+ }
459
+ Nn.prototype.add = Nn.prototype.push = jn, Nn.prototype.has = Mn;
460
+ //#endregion
461
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arraySome.js
462
+ function Pn(e, t) {
463
+ for (var n = -1, r = e == null ? 0 : e.length; ++n < r;) if (t(e[n], n, e)) return !0;
464
+ return !1;
465
+ }
466
+ //#endregion
467
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js
468
+ function Fn(e, t) {
469
+ return e.has(t);
470
+ }
471
+ //#endregion
472
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalArrays.js
473
+ var In = 1, Ln = 2;
474
+ function Rn(e, t, n, r, i, a) {
475
+ var o = n & In, s = e.length, c = t.length;
476
+ if (s != c && !(o && c > s)) return !1;
477
+ var l = a.get(e), u = a.get(t);
478
+ if (l && u) return l == t && u == e;
479
+ var d = -1, f = !0, p = n & Ln ? new Nn() : void 0;
480
+ for (a.set(e, t), a.set(t, e); ++d < s;) {
481
+ var m = e[d], h = t[d];
482
+ if (r) var g = o ? r(h, m, d, t, e, a) : r(m, h, d, e, t, a);
483
+ if (g !== void 0) {
484
+ if (g) continue;
485
+ f = !1;
486
+ break;
487
+ }
488
+ if (p) {
489
+ if (!Pn(t, function(e, t) {
490
+ if (!Fn(p, t) && (m === e || i(m, e, n, r, a))) return p.push(t);
491
+ })) {
492
+ f = !1;
493
+ break;
494
+ }
495
+ } else if (!(m === h || i(m, h, n, r, a))) {
496
+ f = !1;
497
+ break;
498
+ }
499
+ }
500
+ return a.delete(e), a.delete(t), f;
501
+ }
502
+ //#endregion
503
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapToArray.js
504
+ function zn(e) {
505
+ var t = -1, n = Array(e.size);
506
+ return e.forEach(function(e, r) {
507
+ n[++t] = [r, e];
508
+ }), n;
509
+ }
510
+ //#endregion
511
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js
512
+ function Bn(e) {
513
+ var t = -1, n = Array(e.size);
514
+ return e.forEach(function(e) {
515
+ n[++t] = e;
516
+ }), n;
517
+ }
518
+ //#endregion
519
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalByTag.js
520
+ var Vn = 1, Hn = 2, Un = "[object Boolean]", Wn = "[object Date]", Gn = "[object Error]", Kn = "[object Map]", qn = "[object Number]", Jn = "[object RegExp]", Yn = "[object Set]", Xn = "[object String]", Zn = "[object Symbol]", Qn = "[object ArrayBuffer]", $n = "[object DataView]", er = k ? k.prototype : void 0, tr = er ? er.valueOf : void 0;
521
+ function nr(e, t, n, r, i, a, o) {
522
+ switch (n) {
523
+ case $n:
524
+ if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1;
525
+ e = e.buffer, t = t.buffer;
526
+ case Qn: return !(e.byteLength != t.byteLength || !a(new kn(e), new kn(t)));
527
+ case Un:
528
+ case Wn:
529
+ case qn: return Ee(+e, +t);
530
+ case Gn: return e.name == t.name && e.message == t.message;
531
+ case Jn:
532
+ case Xn: return e == t + "";
533
+ case Kn: var s = zn;
534
+ case Yn:
535
+ var c = r & Vn;
536
+ if (s ||= Bn, e.size != t.size && !c) return !1;
537
+ var l = o.get(e);
538
+ if (l) return l == t;
539
+ r |= Hn, o.set(e, t);
540
+ var u = Rn(s(e), s(t), r, i, a, o);
541
+ return o.delete(e), u;
542
+ case Zn: if (tr) return tr.call(e) == tr.call(t);
543
+ }
544
+ return !1;
545
+ }
546
+ //#endregion
547
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalObjects.js
548
+ var rr = 1, ir = Object.prototype.hasOwnProperty;
549
+ function ar(e, t, n, r, i, a) {
550
+ var o = n & rr, s = pn(e), c = s.length;
551
+ if (c != pn(t).length && !o) return !1;
552
+ for (var l = c; l--;) {
553
+ var u = s[l];
554
+ if (!(o ? u in t : ir.call(t, u))) return !1;
555
+ }
556
+ var d = a.get(e), f = a.get(t);
557
+ if (d && f) return d == t && f == e;
558
+ var p = !0;
559
+ a.set(e, t), a.set(t, e);
560
+ for (var m = o; ++l < c;) {
561
+ u = s[l];
562
+ var h = e[u], g = t[u];
563
+ if (r) var _ = o ? r(g, h, u, t, e, a) : r(h, g, u, e, t, a);
564
+ if (!(_ === void 0 ? h === g || i(h, g, n, r, a) : _)) {
565
+ p = !1;
566
+ break;
567
+ }
568
+ m ||= u == "constructor";
569
+ }
570
+ if (p && !m) {
571
+ var v = e.constructor, y = t.constructor;
572
+ v != y && "constructor" in e && "constructor" in t && !(typeof v == "function" && v instanceof v && typeof y == "function" && y instanceof y) && (p = !1);
573
+ }
574
+ return a.delete(e), a.delete(t), p;
575
+ }
576
+ //#endregion
577
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqualDeep.js
578
+ var or = 1, sr = "[object Arguments]", cr = "[object Array]", lr = "[object Object]", ur = Object.prototype.hasOwnProperty;
579
+ function dr(e, t, n, r, i, a) {
580
+ var o = z(e), s = z(t), c = o ? cr : On(e), l = s ? cr : On(t);
581
+ c = c == sr ? lr : c, l = l == sr ? lr : l;
582
+ var u = c == lr, d = l == lr, f = c == l;
583
+ if (f && He(e)) {
584
+ if (!He(t)) return !1;
585
+ o = !0, u = !1;
586
+ }
587
+ if (f && !u) return a ||= new Z(), o || bt(e) ? Rn(e, t, n, r, i, a) : nr(e, t, c, n, r, i, a);
588
+ if (!(n & or)) {
589
+ var p = u && ur.call(e, "__wrapped__"), m = d && ur.call(t, "__wrapped__");
590
+ if (p || m) {
591
+ var h = p ? e.value() : e, g = m ? t.value() : t;
592
+ return a ||= new Z(), i(h, g, n, r, a);
593
+ }
594
+ }
595
+ return f ? (a ||= new Z(), ar(e, t, n, r, i, a)) : !1;
596
+ }
597
+ //#endregion
598
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqual.js
599
+ function fr(e, t, n, r, i) {
600
+ return e === t ? !0 : e == null || t == null || !R(e) && !R(t) ? e !== e && t !== t : dr(e, t, n, r, fr, i);
601
+ }
602
+ //#endregion
603
+ //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isEqual.js
604
+ function pr(e, t) {
605
+ return fr(e, t);
606
+ }
607
+ //#endregion
608
+ //#region ../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs
609
+ function mr(e) {
610
+ for (var t = 1; t < arguments.length; t++) {
611
+ var n = arguments[t];
612
+ for (var r in n) e[r] = n[r];
613
+ }
614
+ return e;
615
+ }
616
+ var hr = {
617
+ read: function(e) {
618
+ return e[0] === "\"" && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
619
+ },
620
+ write: function(e) {
621
+ return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
622
+ }
623
+ };
624
+ function gr(e, t) {
625
+ function n(n, r, i) {
626
+ if (!(typeof document > "u")) {
627
+ i = mr({}, t, i), typeof i.expires == "number" && (i.expires = new Date(Date.now() + i.expires * 864e5)), i.expires &&= i.expires.toUTCString(), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
628
+ var a = "";
629
+ for (var o in i) i[o] && (a += "; " + o, i[o] !== !0 && (a += "=" + i[o].split(";")[0]));
630
+ return document.cookie = n + "=" + e.write(r, n) + a;
631
+ }
632
+ }
633
+ function r(t) {
634
+ if (!(typeof document > "u" || arguments.length && !t)) {
635
+ for (var n = document.cookie ? document.cookie.split("; ") : [], r = {}, i = 0; i < n.length; i++) {
636
+ var a = n[i].split("="), o = a.slice(1).join("=");
637
+ try {
638
+ var s = decodeURIComponent(a[0]);
639
+ if (r[s] = e.read(o, s), t === s) break;
640
+ } catch {}
641
+ }
642
+ return t ? r[t] : r;
643
+ }
644
+ }
645
+ return Object.create({
646
+ set: n,
647
+ get: r,
648
+ remove: function(e, t) {
649
+ n(e, "", mr({}, t, { expires: -1 }));
650
+ },
651
+ withAttributes: function(e) {
652
+ return gr(this.converter, mr({}, this.attributes, e));
653
+ },
654
+ withConverter: function(e) {
655
+ return gr(mr({}, this.converter, e), this.attributes);
656
+ }
657
+ }, {
658
+ attributes: { value: Object.freeze(t) },
659
+ converter: { value: Object.freeze(e) }
660
+ });
661
+ }
662
+ gr(hr, { path: "/" });
663
+ //#endregion
664
+ //#region ../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js
665
+ var _r = /* @__PURE__ */ w(((e, t) => {
666
+ (function() {
667
+ var e = typeof window < "u" && window.document !== void 0 ? window.document : {}, n = t !== void 0 && t.exports, r = (function() {
668
+ for (var t, n = [
669
+ [
670
+ "requestFullscreen",
671
+ "exitFullscreen",
672
+ "fullscreenElement",
673
+ "fullscreenEnabled",
674
+ "fullscreenchange",
675
+ "fullscreenerror"
676
+ ],
677
+ [
678
+ "webkitRequestFullscreen",
679
+ "webkitExitFullscreen",
680
+ "webkitFullscreenElement",
681
+ "webkitFullscreenEnabled",
682
+ "webkitfullscreenchange",
683
+ "webkitfullscreenerror"
684
+ ],
685
+ [
686
+ "webkitRequestFullScreen",
687
+ "webkitCancelFullScreen",
688
+ "webkitCurrentFullScreenElement",
689
+ "webkitCancelFullScreen",
690
+ "webkitfullscreenchange",
691
+ "webkitfullscreenerror"
692
+ ],
693
+ [
694
+ "mozRequestFullScreen",
695
+ "mozCancelFullScreen",
696
+ "mozFullScreenElement",
697
+ "mozFullScreenEnabled",
698
+ "mozfullscreenchange",
699
+ "mozfullscreenerror"
700
+ ],
701
+ [
702
+ "msRequestFullscreen",
703
+ "msExitFullscreen",
704
+ "msFullscreenElement",
705
+ "msFullscreenEnabled",
706
+ "MSFullscreenChange",
707
+ "MSFullscreenError"
708
+ ]
709
+ ], r = 0, i = n.length, a = {}; r < i; r++) if (t = n[r], t && t[1] in e) {
710
+ for (r = 0; r < t.length; r++) a[n[0][r]] = t[r];
711
+ return a;
712
+ }
713
+ return !1;
714
+ })(), i = {
715
+ change: r.fullscreenchange,
716
+ error: r.fullscreenerror
717
+ }, a = {
718
+ request: function(t, n) {
719
+ return new Promise(function(i, a) {
720
+ var o = function() {
721
+ this.off("change", o), i();
722
+ }.bind(this);
723
+ this.on("change", o), t ||= e.documentElement;
724
+ var s = t[r.requestFullscreen](n);
725
+ s instanceof Promise && s.then(o).catch(a);
726
+ }.bind(this));
727
+ },
728
+ exit: function() {
729
+ return new Promise(function(t, n) {
730
+ if (!this.isFullscreen) {
731
+ t();
732
+ return;
733
+ }
734
+ var i = function() {
735
+ this.off("change", i), t();
736
+ }.bind(this);
737
+ this.on("change", i);
738
+ var a = e[r.exitFullscreen]();
739
+ a instanceof Promise && a.then(i).catch(n);
740
+ }.bind(this));
741
+ },
742
+ toggle: function(e, t) {
743
+ return this.isFullscreen ? this.exit() : this.request(e, t);
744
+ },
745
+ onchange: function(e) {
746
+ this.on("change", e);
747
+ },
748
+ onerror: function(e) {
749
+ this.on("error", e);
750
+ },
751
+ on: function(t, n) {
752
+ var r = i[t];
753
+ r && e.addEventListener(r, n, !1);
754
+ },
755
+ off: function(t, n) {
756
+ var r = i[t];
757
+ r && e.removeEventListener(r, n, !1);
758
+ },
759
+ raw: r
760
+ };
761
+ if (!r) {
762
+ n ? t.exports = { isEnabled: !1 } : window.screenfull = { isEnabled: !1 };
763
+ return;
764
+ }
765
+ Object.defineProperties(a, {
766
+ isFullscreen: { get: function() {
767
+ return !!e[r.fullscreenElement];
768
+ } },
769
+ element: {
770
+ enumerable: !0,
771
+ get: function() {
772
+ return e[r.fullscreenElement];
773
+ }
774
+ },
775
+ isEnabled: {
776
+ enumerable: !0,
777
+ get: function() {
778
+ return !!e[r.fullscreenEnabled];
779
+ }
780
+ }
781
+ }), n ? t.exports = a : window.screenfull = a;
782
+ })();
783
+ })), vr = /* @__PURE__ */ w(((e) => {
784
+ var t = E("react");
785
+ function n(e, t) {
786
+ return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
787
+ }
788
+ var r = typeof Object.is == "function" ? Object.is : n, i = t.useState, a = t.useEffect, o = t.useLayoutEffect, s = t.useDebugValue;
789
+ function c(e, t) {
790
+ var n = t(), r = i({ inst: {
791
+ value: n,
792
+ getSnapshot: t
793
+ } }), c = r[0].inst, u = r[1];
794
+ return o(function() {
795
+ c.value = n, c.getSnapshot = t, l(c) && u({ inst: c });
796
+ }, [
797
+ e,
798
+ n,
799
+ t
800
+ ]), a(function() {
801
+ return l(c) && u({ inst: c }), e(function() {
802
+ l(c) && u({ inst: c });
803
+ });
804
+ }, [e]), s(n), n;
805
+ }
806
+ function l(e) {
807
+ var t = e.getSnapshot;
808
+ e = e.value;
809
+ try {
810
+ var n = t();
811
+ return !r(e, n);
812
+ } catch {
813
+ return !0;
814
+ }
815
+ }
816
+ function u(e, t) {
817
+ return t();
818
+ }
819
+ var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
820
+ e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
821
+ })), yr = /* @__PURE__ */ w(((e) => {
822
+ process.env.NODE_ENV !== "production" && (function() {
823
+ function t(e, t) {
824
+ return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
825
+ }
826
+ function n(e, t) {
827
+ d || a.startTransition === void 0 || (d = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
828
+ var n = t();
829
+ if (!f) {
830
+ var i = t();
831
+ o(n, i) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), f = !0);
832
+ }
833
+ i = s({ inst: {
834
+ value: n,
835
+ getSnapshot: t
836
+ } });
837
+ var p = i[0].inst, m = i[1];
838
+ return l(function() {
839
+ p.value = n, p.getSnapshot = t, r(p) && m({ inst: p });
840
+ }, [
841
+ e,
842
+ n,
843
+ t
844
+ ]), c(function() {
845
+ return r(p) && m({ inst: p }), e(function() {
846
+ r(p) && m({ inst: p });
847
+ });
848
+ }, [e]), u(n), n;
849
+ }
850
+ function r(e) {
851
+ var t = e.getSnapshot;
852
+ e = e.value;
853
+ try {
854
+ var n = t();
855
+ return !o(e, n);
856
+ } catch {
857
+ return !0;
858
+ }
859
+ }
860
+ function i(e, t) {
861
+ return t();
862
+ }
863
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
864
+ var a = E("react"), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
865
+ e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
866
+ })();
867
+ })), br = /* @__PURE__ */ w(((e, t) => {
868
+ process.env.NODE_ENV === "production" ? t.exports = vr() : t.exports = yr();
869
+ }));
870
+ _r(), br();
871
+ function xr(e) {
872
+ return typeof e == "function";
873
+ }
874
+ var Sr = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test", Cr = typeof window < "u", wr = typeof navigator < "u";
875
+ Cr && window?.navigator?.userAgent && /iP(?:ad|hone|od)/.test(window.navigator.userAgent);
876
+ var Tr = Cr ? a : r, Er = (e) => {
877
+ let t = c(e);
878
+ return Tr(() => {
879
+ t.current = e;
880
+ }, [e]), t;
881
+ };
882
+ function Dr(e, ...t) {
883
+ e && e.addEventListener && e.addEventListener(...t);
884
+ }
885
+ function Or(e, ...t) {
886
+ e && e.removeEventListener && e.removeEventListener(...t);
887
+ }
888
+ var kr = typeof window < "u" ? window : void 0, Ar = {};
889
+ function jr(e, t) {
890
+ if (!Cr) return;
891
+ if (!e) return t;
892
+ let n;
893
+ return n = xr(e) ? e() : "current" in e ? e.current : e, n;
894
+ }
895
+ var Mr = (e) => (e + 1) % 1e6;
896
+ function Nr() {
897
+ let [, e] = s(Mr, 0);
898
+ return e;
899
+ }
900
+ var Pr = (e, t, n) => {
901
+ process.env.NODE_ENV !== "production" && ((!Array.isArray(t) || !t.length) && console.warn("`useCustomCompareEffect` should not be used with no dependencies. Use React.useEffect instead."), typeof n != "function" && console.warn("`useCustomCompareEffect` should be used with depsEqual callback for comparing deps list"));
902
+ let i = c(void 0), a = Nr();
903
+ i.current ||= t, Tr(() => {
904
+ n(t, i.current) || (i.current = t, a());
905
+ }), r(e, i.current);
906
+ }, Fr = (e, t) => {
907
+ process.env.NODE_ENV !== "production" && (!Array.isArray(t) || !t.length) && console.warn("`useDeepCompareEffect` should not be used with no dependencies. Use React.useEffect instead."), Pr(e, t, pr);
908
+ };
909
+ function Ir(e, t, n, r = Ar) {
910
+ let i = Er(t);
911
+ Fr(() => {
912
+ let t = jr(n, kr);
913
+ if (!(t && t.addEventListener)) return;
914
+ let a = (e) => i.current(e);
915
+ return Dr(t, e, a, r), () => {
916
+ t && t.removeEventListener && Or(t, e, a);
917
+ };
918
+ }, [
919
+ e,
920
+ n,
921
+ r
922
+ ]);
923
+ }
924
+ var Lr = (e) => {
925
+ Sr && (xr(e) || console.error(`useMount: parameter \`fn\` expected to be a function, but got "${typeof e}".`)), r(() => {
926
+ e?.();
927
+ }, []);
928
+ }, Rr = () => {
929
+ let [e, t] = l(null), r = n(() => {
930
+ t(window?.document.activeElement);
931
+ }, []);
932
+ return Ir("blur", r, kr, !0), Ir("focus", r, kr, !0), Lr(() => {
933
+ t(window?.document.activeElement);
934
+ }), e;
935
+ }, zr = (e, t, r = Ar) => {
936
+ let i = Er(t), a = c(), o = n(() => {
937
+ a.current && a.current.disconnect();
938
+ }, []);
939
+ return Fr(() => {
940
+ let t = jr(e);
941
+ if (t) return a.current = new ResizeObserver(i.current), a.current.observe(t, r), o;
942
+ }, [
943
+ i,
944
+ o,
945
+ e,
946
+ r
947
+ ]), o;
948
+ }, Br = (e, t = Ar) => {
949
+ let { box: n = "content-box" } = t, [r, i] = l(0), [a, o] = l(0);
950
+ return zr(e, ([e]) => {
951
+ let t = n === "border-box" ? e.borderBoxSize : n === "content-box" ? e.contentBoxSize : e.devicePixelContentBoxSize;
952
+ t ? (i(t.reduce((e, { inlineSize: t }) => e + t, 0)), o(t.reduce((e, { blockSize: t }) => e + t, 0))) : (i(e.contentRect.width), o(e.contentRect.height));
953
+ }, t), [r, a];
954
+ }, Vr = wr ? navigator : void 0;
955
+ Vr && (Vr.connection || Vr.mozConnection || Vr.webkitConnection), e.use;
956
+ //#endregion
957
+ //#region src/utils/useHandwritingRecognizer.ts
958
+ var Hr = /* @__PURE__ */ ne((/* @__PURE__ */ w(((e, t) => {
959
+ (function() {
960
+ var e = {}.hasOwnProperty;
961
+ function n() {
962
+ for (var e = "", t = 0; t < arguments.length; t++) {
963
+ var n = arguments[t];
964
+ n && (e = i(e, r(n)));
965
+ }
966
+ return e;
967
+ }
968
+ function r(t) {
969
+ if (typeof t == "string" || typeof t == "number") return t;
970
+ if (typeof t != "object") return "";
971
+ if (Array.isArray(t)) return n.apply(null, t);
972
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]")) return t.toString();
973
+ var r = "";
974
+ for (var a in t) e.call(t, a) && t[a] && (r = i(r, a));
975
+ return r;
976
+ }
977
+ function i(e, t) {
978
+ return t ? e ? e + " " + t : e + t : e;
979
+ }
980
+ t !== void 0 && t.exports ? (n.default = n, t.exports = n) : typeof define == "function" && typeof define.amd == "object" && define.amd ? define("classnames", [], function() {
981
+ return n;
982
+ }) : window.classNames = n;
983
+ })();
984
+ })))(), 1);
985
+ function Ur(e = !1) {
986
+ let [t, n] = l(!1), [i, a] = l(0), o = c(!1);
987
+ return r(() => {
988
+ o.current = t;
989
+ }, [t]), r(() => {
990
+ if (!e) {
991
+ n(!1), a(0);
992
+ return;
993
+ }
994
+ let t = !1;
995
+ async function r() {
996
+ let e = m();
997
+ if (e) try {
998
+ let r = await e.initialize({ onProgress: (e) => {
999
+ t || a(e);
1000
+ } });
1001
+ t || n(r);
1002
+ } catch (e) {
1003
+ console.error("初始化手写识别服务失败:", e), t || n(!1);
1004
+ }
1005
+ else console.warn("未注册手写识别服务"), t || n(!1);
1006
+ }
1007
+ return r(), () => {
1008
+ t = !0;
1009
+ let e = m();
1010
+ e && o.current && e.close().catch((e) => {
1011
+ console.error("关闭手写识别服务失败:", e);
1012
+ });
1013
+ };
1014
+ }, [e]), {
1015
+ recognizerInitialized: t,
1016
+ recognizerProgress: i
1017
+ };
1018
+ }
1019
+ //#endregion
1020
+ //#region src/assets/icons/keyboard-backspace.svg
1021
+ var Wr = "data:image/svg+xml,%3csvg%20t='1777011781316'%20class='icon'%20viewBox='0%200%201439%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5887'%20width='200'%20height='200'%3e%3cpath%20d='M1283.03672%200.000187H465.243153a158.045778%20158.045778%200%200%200-122.329921%2057.680486L24.083875%20440.475014c-0.622227%200.68445-1.182232%201.431123-1.742237%202.177796A115.672087%20115.672087%200%200%200%200.003672%20511.906728a118.658779%20118.658779%200%200%200%2026.818004%2074.667297l316.713783%20380.492099a158.232446%20158.232446%200%200%200%20121.707694%2056.933814H1283.03672a156.303541%20156.303541%200%200%200%20156.05465-156.116873V156.054837A156.241318%20156.241318%200%200%200%201283.03672%200.000187z%20m-257.477728%20689.863598a47.538179%2047.538179%200%200%201-33.600284%2013.937896%2047.662624%2047.662624%200%200%201-33.662506-13.937896L847.72638%20579.293963l-110.569822%20110.569822a47.911515%2047.911515%200%200%201-33.724729%2013.937896%2047.662624%2047.662624%200%200%201-33.662506-81.325131l110.383154-110.569822-110.569822-110.569822a47.662624%2047.662624%200%200%201%200-67.387235%2047.600402%2047.600402%200%200%201%2067.325012%200l110.632045%20110.632045%20110.569822-110.632045A47.625291%2047.625291%200%200%201%201025.434546%20401.336906l-110.383153%20110.569822%20110.569821%20110.569822a47.662624%2047.662624%200%200%201-0.062222%2067.387235z'%20fill='%232C2C2C'%20p-id='5888'%3e%3c/path%3e%3c/svg%3e", Gr = "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";
1022
+ //#endregion
1023
+ //#region src/hooks/useKeyRepeater.ts
1024
+ function Kr() {
1025
+ let e = c(f());
1026
+ return r(() => {
1027
+ let t = e.current;
1028
+ return () => {
1029
+ t.stop();
1030
+ };
1031
+ }, []), {
1032
+ startRepeat: n((t, n) => {
1033
+ t.preventDefault(), t.currentTarget?.setPointerCapture?.(t.pointerId), e.current.start(n);
1034
+ }, []),
1035
+ stopRepeat: n(() => {
1036
+ e.current.stop();
1037
+ }, [])
1038
+ };
1039
+ }
1040
+ //#endregion
1041
+ //#region ../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js
1042
+ var qr = /* @__PURE__ */ w(((e) => {
1043
+ var t = E("react"), n = Symbol.for("react.element"), r = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = {
1044
+ key: !0,
1045
+ ref: !0,
1046
+ __self: !0,
1047
+ __source: !0
1048
+ };
1049
+ function s(e, t, r) {
1050
+ var s, c = {}, l = null, u = null;
1051
+ for (s in r !== void 0 && (l = "" + r), t.key !== void 0 && (l = "" + t.key), t.ref !== void 0 && (u = t.ref), t) i.call(t, s) && !o.hasOwnProperty(s) && (c[s] = t[s]);
1052
+ if (e && e.defaultProps) for (s in t = e.defaultProps, t) c[s] === void 0 && (c[s] = t[s]);
1053
+ return {
1054
+ $$typeof: n,
1055
+ type: e,
1056
+ key: l,
1057
+ ref: u,
1058
+ props: c,
1059
+ _owner: a.current
1060
+ };
1061
+ }
1062
+ e.Fragment = r, e.jsx = s, e.jsxs = s;
1063
+ })), Jr = /* @__PURE__ */ w(((e) => {
1064
+ process.env.NODE_ENV !== "production" && (function() {
1065
+ var t = E("react"), n = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), h = Symbol.iterator, g = "@@iterator";
1066
+ function _(e) {
1067
+ if (typeof e != "object" || !e) return null;
1068
+ var t = h && e[h] || e[g];
1069
+ return typeof t == "function" ? t : null;
1070
+ }
1071
+ var v = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1072
+ function y(e) {
1073
+ b("error", e, [...arguments].slice(1));
1074
+ }
1075
+ function b(e, t, n) {
1076
+ var r = v.ReactDebugCurrentFrame.getStackAddendum();
1077
+ r !== "" && (t += "%s", n = n.concat([r]));
1078
+ var i = n.map(function(e) {
1079
+ return String(e);
1080
+ });
1081
+ i.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, i);
1082
+ }
1083
+ var x = !1, ee = !1, te = !1, S = !1, C = !1, w = Symbol.for("react.module.reference");
1084
+ function T(e) {
1085
+ return !!(typeof e == "string" || typeof e == "function" || e === i || e === o || C || e === a || e === u || e === d || S || e === m || x || ee || te || typeof e == "object" && e && (e.$$typeof === p || e.$$typeof === f || e.$$typeof === s || e.$$typeof === c || e.$$typeof === l || e.$$typeof === w || e.getModuleId !== void 0));
1086
+ }
1087
+ function ne(e, t, n) {
1088
+ var r = e.displayName;
1089
+ if (r) return r;
1090
+ var i = t.displayName || t.name || "";
1091
+ return i === "" ? n : n + "(" + i + ")";
1092
+ }
1093
+ function re(e) {
1094
+ return e.displayName || "Context";
1095
+ }
1096
+ function D(e) {
1097
+ if (e == null) return null;
1098
+ if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null;
1099
+ if (typeof e == "string") return e;
1100
+ switch (e) {
1101
+ case i: return "Fragment";
1102
+ case r: return "Portal";
1103
+ case o: return "Profiler";
1104
+ case a: return "StrictMode";
1105
+ case u: return "Suspense";
1106
+ case d: return "SuspenseList";
1107
+ }
1108
+ if (typeof e == "object") switch (e.$$typeof) {
1109
+ case c: return re(e) + ".Consumer";
1110
+ case s: return re(e._context) + ".Provider";
1111
+ case l: return ne(e, e.render, "ForwardRef");
1112
+ case f:
1113
+ var t = e.displayName || null;
1114
+ return t === null ? D(e.type) || "Memo" : t;
1115
+ case p:
1116
+ var n = e, m = n._payload, h = n._init;
1117
+ try {
1118
+ return D(h(m));
1119
+ } catch {
1120
+ return null;
1121
+ }
1122
+ }
1123
+ return null;
1124
+ }
1125
+ var O = Object.assign, k = 0, ie, ae, A, j, M, N, P;
1126
+ function F() {}
1127
+ F.__reactDisabledLog = !0;
1128
+ function oe() {
1129
+ if (k === 0) {
1130
+ ie = console.log, ae = console.info, A = console.warn, j = console.error, M = console.group, N = console.groupCollapsed, P = console.groupEnd;
1131
+ var e = {
1132
+ configurable: !0,
1133
+ enumerable: !0,
1134
+ value: F,
1135
+ writable: !0
1136
+ };
1137
+ Object.defineProperties(console, {
1138
+ info: e,
1139
+ log: e,
1140
+ warn: e,
1141
+ error: e,
1142
+ group: e,
1143
+ groupCollapsed: e,
1144
+ groupEnd: e
1145
+ });
1146
+ }
1147
+ k++;
1148
+ }
1149
+ function I() {
1150
+ if (k--, k === 0) {
1151
+ var e = {
1152
+ configurable: !0,
1153
+ enumerable: !0,
1154
+ writable: !0
1155
+ };
1156
+ Object.defineProperties(console, {
1157
+ log: O({}, e, { value: ie }),
1158
+ info: O({}, e, { value: ae }),
1159
+ warn: O({}, e, { value: A }),
1160
+ error: O({}, e, { value: j }),
1161
+ group: O({}, e, { value: M }),
1162
+ groupCollapsed: O({}, e, { value: N }),
1163
+ groupEnd: O({}, e, { value: P })
1164
+ });
1165
+ }
1166
+ k < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1167
+ }
1168
+ var L = v.ReactCurrentDispatcher, R;
1169
+ function z(e, t, n) {
1170
+ if (R === void 0) try {
1171
+ throw Error();
1172
+ } catch (e) {
1173
+ var r = e.stack.trim().match(/\n( *(at )?)/);
1174
+ R = r && r[1] || "";
1175
+ }
1176
+ return "\n" + R + e;
1177
+ }
1178
+ var se = !1, B = new (typeof WeakMap == "function" ? WeakMap : Map)();
1179
+ function ce(e, t) {
1180
+ if (!e || se) return "";
1181
+ var n = B.get(e);
1182
+ if (n !== void 0) return n;
1183
+ var r;
1184
+ se = !0;
1185
+ var i = Error.prepareStackTrace;
1186
+ Error.prepareStackTrace = void 0;
1187
+ var a = L.current;
1188
+ L.current = null, oe();
1189
+ try {
1190
+ if (t) {
1191
+ var o = function() {
1192
+ throw Error();
1193
+ };
1194
+ if (Object.defineProperty(o.prototype, "props", { set: function() {
1195
+ throw Error();
1196
+ } }), typeof Reflect == "object" && Reflect.construct) {
1197
+ try {
1198
+ Reflect.construct(o, []);
1199
+ } catch (e) {
1200
+ r = e;
1201
+ }
1202
+ Reflect.construct(e, [], o);
1203
+ } else {
1204
+ try {
1205
+ o.call();
1206
+ } catch (e) {
1207
+ r = e;
1208
+ }
1209
+ e.call(o.prototype);
1210
+ }
1211
+ } else {
1212
+ try {
1213
+ throw Error();
1214
+ } catch (e) {
1215
+ r = e;
1216
+ }
1217
+ e();
1218
+ }
1219
+ } catch (t) {
1220
+ if (t && r && typeof t.stack == "string") {
1221
+ for (var s = t.stack.split("\n"), c = r.stack.split("\n"), l = s.length - 1, u = c.length - 1; l >= 1 && u >= 0 && s[l] !== c[u];) u--;
1222
+ for (; l >= 1 && u >= 0; l--, u--) if (s[l] !== c[u]) {
1223
+ if (l !== 1 || u !== 1) do
1224
+ if (l--, u--, u < 0 || s[l] !== c[u]) {
1225
+ var d = "\n" + s[l].replace(" at new ", " at ");
1226
+ return e.displayName && d.includes("<anonymous>") && (d = d.replace("<anonymous>", e.displayName)), typeof e == "function" && B.set(e, d), d;
1227
+ }
1228
+ while (l >= 1 && u >= 0);
1229
+ break;
1230
+ }
1231
+ }
1232
+ } finally {
1233
+ se = !1, L.current = a, I(), Error.prepareStackTrace = i;
1234
+ }
1235
+ var f = e ? e.displayName || e.name : "", p = f ? z(f) : "";
1236
+ return typeof e == "function" && B.set(e, p), p;
1237
+ }
1238
+ function le(e, t, n) {
1239
+ return ce(e, !1);
1240
+ }
1241
+ function ue(e) {
1242
+ var t = e.prototype;
1243
+ return !!(t && t.isReactComponent);
1244
+ }
1245
+ function V(e, t, n) {
1246
+ if (e == null) return "";
1247
+ if (typeof e == "function") return ce(e, ue(e));
1248
+ if (typeof e == "string") return z(e);
1249
+ switch (e) {
1250
+ case u: return z("Suspense");
1251
+ case d: return z("SuspenseList");
1252
+ }
1253
+ if (typeof e == "object") switch (e.$$typeof) {
1254
+ case l: return le(e.render);
1255
+ case f: return V(e.type, t, n);
1256
+ case p:
1257
+ var r = e, i = r._payload, a = r._init;
1258
+ try {
1259
+ return V(a(i), t, n);
1260
+ } catch {}
1261
+ }
1262
+ return "";
1263
+ }
1264
+ var H = Object.prototype.hasOwnProperty, de = {}, fe = v.ReactDebugCurrentFrame;
1265
+ function U(e) {
1266
+ if (e) {
1267
+ var t = e._owner, n = V(e.type, e._source, t ? t.type : null);
1268
+ fe.setExtraStackFrame(n);
1269
+ } else fe.setExtraStackFrame(null);
1270
+ }
1271
+ function W(e, t, n, r, i) {
1272
+ var a = Function.call.bind(H);
1273
+ for (var o in e) if (a(e, o)) {
1274
+ var s = void 0;
1275
+ try {
1276
+ if (typeof e[o] != "function") {
1277
+ var c = Error((r || "React class") + ": " + n + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1278
+ throw c.name = "Invariant Violation", c;
1279
+ }
1280
+ s = e[o](t, o, r, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1281
+ } catch (e) {
1282
+ s = e;
1283
+ }
1284
+ s && !(s instanceof Error) && (U(i), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", r || "React class", n, o, typeof s), U(null)), s instanceof Error && !(s.message in de) && (de[s.message] = !0, U(i), y("Failed %s type: %s", n, s.message), U(null));
1285
+ }
1286
+ }
1287
+ var pe = Array.isArray;
1288
+ function me(e) {
1289
+ return pe(e);
1290
+ }
1291
+ function he(e) {
1292
+ return typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
1293
+ }
1294
+ function ge(e) {
1295
+ try {
1296
+ return _e(e), !1;
1297
+ } catch {
1298
+ return !0;
1299
+ }
1300
+ }
1301
+ function _e(e) {
1302
+ return "" + e;
1303
+ }
1304
+ function ve(e) {
1305
+ if (ge(e)) return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", he(e)), _e(e);
1306
+ }
1307
+ var ye = v.ReactCurrentOwner, be = {
1308
+ key: !0,
1309
+ ref: !0,
1310
+ __self: !0,
1311
+ __source: !0
1312
+ }, xe, G, Se = {};
1313
+ function Ce(e) {
1314
+ if (H.call(e, "ref")) {
1315
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
1316
+ if (t && t.isReactWarning) return !1;
1317
+ }
1318
+ return e.ref !== void 0;
1319
+ }
1320
+ function we(e) {
1321
+ if (H.call(e, "key")) {
1322
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
1323
+ if (t && t.isReactWarning) return !1;
1324
+ }
1325
+ return e.key !== void 0;
1326
+ }
1327
+ function Te(e, t) {
1328
+ if (typeof e.ref == "string" && ye.current && t && ye.current.stateNode !== t) {
1329
+ var n = D(ye.current.type);
1330
+ Se[n] || (y("Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref", D(ye.current.type), e.ref), Se[n] = !0);
1331
+ }
1332
+ }
1333
+ function Ee(e, t) {
1334
+ var n = function() {
1335
+ xe || (xe = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
1336
+ };
1337
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
1338
+ get: n,
1339
+ configurable: !0
1340
+ });
1341
+ }
1342
+ function De(e, t) {
1343
+ var n = function() {
1344
+ G || (G = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
1345
+ };
1346
+ n.isReactWarning = !0, Object.defineProperty(e, "ref", {
1347
+ get: n,
1348
+ configurable: !0
1349
+ });
1350
+ }
1351
+ var Oe = function(e, t, r, i, a, o, s) {
1352
+ var c = {
1353
+ $$typeof: n,
1354
+ type: e,
1355
+ key: t,
1356
+ ref: r,
1357
+ props: s,
1358
+ _owner: o
1359
+ };
1360
+ return c._store = {}, Object.defineProperty(c._store, "validated", {
1361
+ configurable: !1,
1362
+ enumerable: !1,
1363
+ writable: !0,
1364
+ value: !1
1365
+ }), Object.defineProperty(c, "_self", {
1366
+ configurable: !1,
1367
+ enumerable: !1,
1368
+ writable: !1,
1369
+ value: i
1370
+ }), Object.defineProperty(c, "_source", {
1371
+ configurable: !1,
1372
+ enumerable: !1,
1373
+ writable: !1,
1374
+ value: a
1375
+ }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
1376
+ };
1377
+ function ke(e, t, n, r, i) {
1378
+ var a, o = {}, s = null, c = null;
1379
+ for (a in n !== void 0 && (ve(n), s = "" + n), we(t) && (ve(t.key), s = "" + t.key), Ce(t) && (c = t.ref, Te(t, i)), t) H.call(t, a) && !be.hasOwnProperty(a) && (o[a] = t[a]);
1380
+ if (e && e.defaultProps) {
1381
+ var l = e.defaultProps;
1382
+ for (a in l) o[a] === void 0 && (o[a] = l[a]);
1383
+ }
1384
+ if (s || c) {
1385
+ var u = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
1386
+ s && Ee(o, u), c && De(o, u);
1387
+ }
1388
+ return Oe(e, s, c, i, r, ye.current, o);
1389
+ }
1390
+ var Ae = v.ReactCurrentOwner, je = v.ReactDebugCurrentFrame;
1391
+ function K(e) {
1392
+ if (e) {
1393
+ var t = e._owner, n = V(e.type, e._source, t ? t.type : null);
1394
+ je.setExtraStackFrame(n);
1395
+ } else je.setExtraStackFrame(null);
1396
+ }
1397
+ var Me = !1;
1398
+ function Ne(e) {
1399
+ return typeof e == "object" && !!e && e.$$typeof === n;
1400
+ }
1401
+ function Pe() {
1402
+ if (Ae.current) {
1403
+ var e = D(Ae.current.type);
1404
+ if (e) return "\n\nCheck the render method of `" + e + "`.";
1405
+ }
1406
+ return "";
1407
+ }
1408
+ function Fe(e) {
1409
+ if (e !== void 0) {
1410
+ var t = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
1411
+ return "\n\nCheck your code at " + t + ":" + n + ".";
1412
+ }
1413
+ return "";
1414
+ }
1415
+ var Ie = {};
1416
+ function Le(e) {
1417
+ var t = Pe();
1418
+ if (!t) {
1419
+ var n = typeof e == "string" ? e : e.displayName || e.name;
1420
+ n && (t = "\n\nCheck the top-level render call using <" + n + ">.");
1421
+ }
1422
+ return t;
1423
+ }
1424
+ function Re(e, t) {
1425
+ if (!(!e._store || e._store.validated || e.key != null)) {
1426
+ e._store.validated = !0;
1427
+ var n = Le(t);
1428
+ if (!Ie[n]) {
1429
+ Ie[n] = !0;
1430
+ var r = "";
1431
+ e && e._owner && e._owner !== Ae.current && (r = " It was passed a child from " + D(e._owner.type) + "."), K(e), y("Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.", n, r), K(null);
1432
+ }
1433
+ }
1434
+ }
1435
+ function ze(e, t) {
1436
+ if (typeof e == "object") {
1437
+ if (me(e)) for (var n = 0; n < e.length; n++) {
1438
+ var r = e[n];
1439
+ Ne(r) && Re(r, t);
1440
+ }
1441
+ else if (Ne(e)) e._store && (e._store.validated = !0);
1442
+ else if (e) {
1443
+ var i = _(e);
1444
+ if (typeof i == "function" && i !== e.entries) for (var a = i.call(e), o; !(o = a.next()).done;) Ne(o.value) && Re(o.value, t);
1445
+ }
1446
+ }
1447
+ }
1448
+ function Be(e) {
1449
+ var t = e.type;
1450
+ if (!(t == null || typeof t == "string")) {
1451
+ var n;
1452
+ if (typeof t == "function") n = t.propTypes;
1453
+ else if (typeof t == "object" && (t.$$typeof === l || t.$$typeof === f)) n = t.propTypes;
1454
+ else return;
1455
+ if (n) {
1456
+ var r = D(t);
1457
+ W(n, e.props, "prop", r, e);
1458
+ } else t.PropTypes !== void 0 && !Me && (Me = !0, y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D(t) || "Unknown"));
1459
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1460
+ }
1461
+ }
1462
+ function Ve(e) {
1463
+ for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
1464
+ var r = t[n];
1465
+ if (r !== "children" && r !== "key") {
1466
+ K(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", r), K(null);
1467
+ break;
1468
+ }
1469
+ }
1470
+ e.ref !== null && (K(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
1471
+ }
1472
+ var He = {};
1473
+ function Ue(e, t, r, a, o, s) {
1474
+ var c = T(e);
1475
+ if (!c) {
1476
+ var l = "";
1477
+ (e === void 0 || typeof e == "object" && e && Object.keys(e).length === 0) && (l += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1478
+ var u = Fe(o);
1479
+ u ? l += u : l += Pe();
1480
+ var d;
1481
+ e === null ? d = "null" : me(e) ? d = "array" : e !== void 0 && e.$$typeof === n ? (d = "<" + (D(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, l);
1482
+ }
1483
+ var f = ke(e, t, r, o, s);
1484
+ if (f == null) return f;
1485
+ if (c) {
1486
+ var p = t.children;
1487
+ if (p !== void 0) if (a) if (me(p)) {
1488
+ for (var m = 0; m < p.length; m++) ze(p[m], e);
1489
+ Object.freeze && Object.freeze(p);
1490
+ } else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1491
+ else ze(p, e);
1492
+ }
1493
+ if (H.call(t, "key")) {
1494
+ var h = D(e), g = Object.keys(t).filter(function(e) {
1495
+ return e !== "key";
1496
+ }), _ = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
1497
+ He[h + _] || (y("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", _, h, g.length > 0 ? "{" + g.join(": ..., ") + ": ...}" : "{}", h), He[h + _] = !0);
1498
+ }
1499
+ return e === i ? Ve(f) : Be(f), f;
1500
+ }
1501
+ function We(e, t, n) {
1502
+ return Ue(e, t, n, !0);
1503
+ }
1504
+ function Ge(e, t, n) {
1505
+ return Ue(e, t, n, !1);
1506
+ }
1507
+ var Ke = Ge, qe = We;
1508
+ e.Fragment = i, e.jsx = Ke, e.jsxs = qe;
1509
+ })();
1510
+ })), $ = (/* @__PURE__ */ w(((e, t) => {
1511
+ process.env.NODE_ENV === "production" ? t.exports = qr() : t.exports = Jr();
1512
+ })))(), Yr = ({ candidates: e, onSelect: t }) => /* @__PURE__ */ (0, $.jsx)("div", {
1513
+ className: "tdhk-candidate-list",
1514
+ children: e.map((e, n) => /* @__PURE__ */ (0, $.jsx)("button", {
1515
+ className: "tdhk-candidate-list__item",
1516
+ onClick: () => t(n),
1517
+ children: e
1518
+ }, `candidate-${n}`))
1519
+ }), Xr = "data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%2011L14%2018L21%2011'%20stroke='%235E6773'%20stroke-width='2.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e", Zr = "data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='4.5'%20y='5.5'%20width='19'%20height='17'%20rx='3.5'%20stroke='%235E6773'%20stroke-width='2'/%3e%3cpath%20d='M8.5%2010H10'%20stroke='%235E6773'%20stroke-width='2'%20stroke-linecap='round'/%3e%3cpath%20d='M12%2010H13.5'%20stroke='%235E6773'%20stroke-width='2'%20stroke-linecap='round'/%3e%3cpath%20d='M15.5%2010H17'%20stroke='%235E6773'%20stroke-width='2'%20stroke-linecap='round'/%3e%3cpath%20d='M19%2010H20.5'%20stroke='%235E6773'%20stroke-width='2'%20stroke-linecap='round'/%3e%3cpath%20d='M8%2014H10.5'%20stroke='%235E6773'%20stroke-width='2'%20stroke-linecap='round'/%3e%3cpath%20d='M12%2014H14.5'%20stroke='%235E6773'%20stroke-width='2'%20stroke-linecap='round'/%3e%3cpath%20d='M16%2014H18.5'%20stroke='%235E6773'%20stroke-width='2'%20stroke-linecap='round'/%3e%3cpath%20d='M10%2018.5H18'%20stroke='%235E6773'%20stroke-width='2'%20stroke-linecap='round'/%3e%3c/svg%3e", Qr = "data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='6.5'%20y='3.5'%20width='15'%20height='21'%20rx='3.5'%20stroke='%235E6773'%20stroke-width='2'/%3e%3cpath%20d='M14%207H14.01'%20stroke='%235E6773'%20stroke-width='2.4'%20stroke-linecap='round'/%3e%3cpath%20d='M17.5%2016.5V14C17.5%2012.6193%2016.3807%2011.5%2015%2011.5C13.6193%2011.5%2012.5%2012.6193%2012.5%2014V19L11.25%2017.75C10.4697%2016.9697%209.20435%2016.9697%208.42401%2017.75C7.64366%2018.5303%207.64366%2019.7956%208.42401%2020.576L11.6766%2023.8284C12.0516%2024.2034%2012.5603%2024.4141%2013.0909%2024.4141H16C18.4853%2024.4141%2020.5%2022.3994%2020.5%2019.9141V16.5'%20stroke='%235E6773'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e", $r = ({ enableHandwriting: e = !1, isHandwritingMode: t = !1, onToggleKeyboard: n, onCollapse: r }) => {
1520
+ let i = o(() => t ? "切换到输入键盘" : "切换到手写键盘", [t]), a = o(() => t ? Zr : Qr, [t]);
1521
+ function s(e) {
1522
+ e.preventDefault();
1523
+ }
1524
+ return /* @__PURE__ */ (0, $.jsxs)("div", {
1525
+ className: "tdhk-toolbar",
1526
+ children: [
1527
+ /* @__PURE__ */ (0, $.jsx)("button", {
1528
+ className: `tdhk-toolbar__button ${e ? "" : "tdhk-toolbar__button--disabled"}`,
1529
+ type: "button",
1530
+ "aria-label": i,
1531
+ disabled: !e,
1532
+ onClick: n,
1533
+ onContextMenu: s,
1534
+ children: /* @__PURE__ */ (0, $.jsx)("img", {
1535
+ src: a,
1536
+ className: "tdhk-toolbar__icon",
1537
+ alt: i
1538
+ })
1539
+ }),
1540
+ /* @__PURE__ */ (0, $.jsx)("div", { className: "tdhk-toolbar__spacer" }),
1541
+ /* @__PURE__ */ (0, $.jsx)("div", { className: "tdhk-toolbar__divider" }),
1542
+ /* @__PURE__ */ (0, $.jsx)("button", {
1543
+ className: "tdhk-toolbar__button tdhk-toolbar__button--collapse",
1544
+ type: "button",
1545
+ "aria-label": "收起键盘",
1546
+ onClick: r,
1547
+ onContextMenu: s,
1548
+ children: /* @__PURE__ */ (0, $.jsx)("img", {
1549
+ src: Xr,
1550
+ className: "tdhk-toolbar__icon",
1551
+ alt: "收起键盘"
1552
+ })
1553
+ })
1554
+ ]
1555
+ });
1556
+ }, ei = ({ recognizerInitialized: e, recognizerProgress: t, onKey: r, onCollapse: i, onSwitchToSymbol: o, onToggleKeyboard: s }) => {
1557
+ let d = c(null), f = c(null), p = c(!1), [h, g] = l([]), { startRepeat: _, stopRepeat: v } = Kr(), y = n(async () => {
1558
+ if (!f.current || f.current.getStrokeData().length === 0 || p.current) return;
1559
+ let e = m();
1560
+ if (e) {
1561
+ p.current = !0;
1562
+ try {
1563
+ let t = [...f.current.getStrokeData()];
1564
+ g(await e.recognize(t));
1565
+ } catch (e) {
1566
+ console.error("识别笔迹失败:", e);
1567
+ } finally {
1568
+ p.current = !1;
1569
+ }
1570
+ } else console.warn("手写识别服务不可用");
1571
+ }, []), b = n(() => {
1572
+ d.current && (f.current && f.current.destroy(), d.current.width = d.current.clientWidth, d.current.height = d.current.clientHeight, f.current = new u(d.current, { onDrawEnd: y }));
1573
+ }, [y]), [x, ee] = Br(d);
1574
+ a(() => {
1575
+ if (x && ee && e) return b(), () => {
1576
+ f.current && f.current.destroy();
1577
+ };
1578
+ }, [
1579
+ x,
1580
+ ee,
1581
+ e,
1582
+ b
1583
+ ]);
1584
+ function te() {
1585
+ f.current && f.current.clearCanvas();
1586
+ }
1587
+ function S(e) {
1588
+ let t = h[e];
1589
+ t && (r({ key: t }), g([]), te());
1590
+ }
1591
+ function C(e) {
1592
+ e.preventDefault();
1593
+ }
1594
+ return /* @__PURE__ */ (0, $.jsxs)("div", {
1595
+ className: "handwriting-input",
1596
+ children: [/* @__PURE__ */ (0, $.jsx)("div", {
1597
+ className: "handwriting-input__header",
1598
+ children: h.length > 0 ? /* @__PURE__ */ (0, $.jsx)("div", {
1599
+ className: "handwriting-input__candidates",
1600
+ children: /* @__PURE__ */ (0, $.jsx)(Yr, {
1601
+ candidates: h,
1602
+ onSelect: S
1603
+ })
1604
+ }) : /* @__PURE__ */ (0, $.jsx)($r, {
1605
+ enableHandwriting: !0,
1606
+ isHandwritingMode: !0,
1607
+ onToggleKeyboard: s,
1608
+ onCollapse: i
1609
+ })
1610
+ }), /* @__PURE__ */ (0, $.jsxs)("div", {
1611
+ className: "handwriting-content",
1612
+ children: [
1613
+ /* @__PURE__ */ (0, $.jsxs)("div", {
1614
+ className: "handwriting-buttons",
1615
+ children: [
1616
+ /* @__PURE__ */ (0, $.jsx)("button", {
1617
+ className: "handwriting-btn handwriting-btn--function",
1618
+ onPointerDown: (e) => _(e, () => r({ key: "。" })),
1619
+ onPointerUp: v,
1620
+ onPointerLeave: v,
1621
+ onPointerCancel: v,
1622
+ onContextMenu: C,
1623
+ children: "。"
1624
+ }),
1625
+ /* @__PURE__ */ (0, $.jsx)("button", {
1626
+ className: "handwriting-btn handwriting-btn--function",
1627
+ onPointerDown: (e) => _(e, () => r({ key: "?" })),
1628
+ onPointerUp: v,
1629
+ onPointerLeave: v,
1630
+ onPointerCancel: v,
1631
+ onContextMenu: C,
1632
+ children: "?"
1633
+ }),
1634
+ /* @__PURE__ */ (0, $.jsx)("button", {
1635
+ className: "handwriting-btn handwriting-btn--function",
1636
+ onPointerDown: (e) => _(e, () => r({ key: "!" })),
1637
+ onPointerUp: v,
1638
+ onPointerLeave: v,
1639
+ onPointerCancel: v,
1640
+ onContextMenu: C,
1641
+ children: "!"
1642
+ }),
1643
+ /* @__PURE__ */ (0, $.jsx)("button", {
1644
+ className: "handwriting-btn handwriting-btn--function",
1645
+ onClick: o,
1646
+ onContextMenu: C,
1647
+ children: "符"
1648
+ })
1649
+ ]
1650
+ }),
1651
+ /* @__PURE__ */ (0, $.jsx)("div", {
1652
+ className: "handwriting-canvas-container",
1653
+ children: e ? /* @__PURE__ */ (0, $.jsx)("canvas", {
1654
+ ref: d,
1655
+ className: "handwriting-canvas"
1656
+ }) : /* @__PURE__ */ (0, $.jsxs)("div", {
1657
+ className: "handwriting-loading",
1658
+ children: [
1659
+ /* @__PURE__ */ (0, $.jsx)("div", {
1660
+ className: "loading-text",
1661
+ children: "正在加载手写识别..."
1662
+ }),
1663
+ /* @__PURE__ */ (0, $.jsx)("div", {
1664
+ className: "progress-bar",
1665
+ children: /* @__PURE__ */ (0, $.jsx)("div", {
1666
+ className: "progress-fill",
1667
+ style: { width: `${t * 100}%` }
1668
+ })
1669
+ }),
1670
+ /* @__PURE__ */ (0, $.jsxs)("div", {
1671
+ className: "progress-text",
1672
+ children: [Math.round(t * 100), "%"]
1673
+ })
1674
+ ]
1675
+ })
1676
+ }),
1677
+ /* @__PURE__ */ (0, $.jsxs)("div", {
1678
+ className: "handwriting-buttons",
1679
+ children: [
1680
+ /* @__PURE__ */ (0, $.jsx)("button", {
1681
+ className: "handwriting-btn handwriting-btn--function",
1682
+ onPointerDown: (e) => _(e, () => r({
1683
+ key: "delete",
1684
+ isControl: !0
1685
+ })),
1686
+ onPointerUp: v,
1687
+ onPointerLeave: v,
1688
+ onPointerCancel: v,
1689
+ onContextMenu: C,
1690
+ children: /* @__PURE__ */ (0, $.jsx)("img", {
1691
+ src: Wr,
1692
+ alt: "删除"
1693
+ })
1694
+ }),
1695
+ /* @__PURE__ */ (0, $.jsx)("button", {
1696
+ className: "handwriting-btn handwriting-btn--function",
1697
+ onPointerDown: (e) => _(e, () => r({ key: "、" })),
1698
+ onPointerUp: v,
1699
+ onPointerLeave: v,
1700
+ onPointerCancel: v,
1701
+ onContextMenu: C,
1702
+ children: "、"
1703
+ }),
1704
+ /* @__PURE__ */ (0, $.jsx)("button", {
1705
+ className: "handwriting-btn handwriting-btn--function",
1706
+ onPointerDown: (e) => _(e, () => r({ key: "," })),
1707
+ onPointerUp: v,
1708
+ onPointerLeave: v,
1709
+ onPointerCancel: v,
1710
+ onContextMenu: C,
1711
+ children: ","
1712
+ }),
1713
+ /* @__PURE__ */ (0, $.jsx)("button", {
1714
+ className: "handwriting-btn handwriting-btn--function",
1715
+ onPointerDown: (e) => _(e, () => r({
1716
+ key: "enter",
1717
+ isControl: !0
1718
+ })),
1719
+ onPointerUp: v,
1720
+ onPointerLeave: v,
1721
+ onPointerCancel: v,
1722
+ onContextMenu: C,
1723
+ children: /* @__PURE__ */ (0, $.jsx)("img", {
1724
+ src: Gr,
1725
+ alt: "回车"
1726
+ })
1727
+ })
1728
+ ]
1729
+ })
1730
+ ]
1731
+ })]
1732
+ });
1733
+ }, ti = "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", ni = ({ candidates: e, onSelect: t, onClose: n }) => {
1734
+ function r(e) {
1735
+ let t = Array.from(e).length;
1736
+ return t >= 2 && t <= 3 ? 2 : t >= 4 ? 3 : 1;
1737
+ }
1738
+ return /* @__PURE__ */ (0, $.jsxs)("div", {
1739
+ className: "tdhk-selection",
1740
+ children: [/* @__PURE__ */ (0, $.jsx)("div", {
1741
+ className: "tdhk-selection__list",
1742
+ children: e.map((e, n) => /* @__PURE__ */ (0, $.jsx)("div", {
1743
+ className: `tdhk-selection__text tdhk-selection__text--span-${r(e)}`,
1744
+ onClick: () => t(n),
1745
+ children: e
1746
+ }, n))
1747
+ }), /* @__PURE__ */ (0, $.jsx)("div", {
1748
+ className: "tdhk-selection__func",
1749
+ children: /* @__PURE__ */ (0, $.jsx)("button", {
1750
+ className: "tdhk-selection__func-btn",
1751
+ onClick: n,
1752
+ children: "返回"
1753
+ })
1754
+ })]
1755
+ });
1756
+ }, ri = t(({ currentPinyin: e, onInput: t, setCurrentPinyin: n }, r) => {
1757
+ let s = c(null), [u, d] = l(!1), [f, p] = l(null), [m, h] = l(!1), _ = o(() => f?.candidates.map((e) => e.text) ?? [], [f]), v = o(() => f ? f.preeditHead + f.preeditBody : "", [f]);
1758
+ i(r, () => ({ handleSelection: y })), a(() => {
1759
+ let e = g();
1760
+ if (e) s.current = e, d(!0);
1761
+ else throw Error("未找到拼音引擎实例,请确保已正确注册引擎");
1762
+ return () => {
1763
+ s.current?.processInput("")?.catch(() => {}), d(!1);
1764
+ };
1765
+ }, []), a(() => {
1766
+ let t = s.current;
1767
+ if (!(!t || !u)) {
1768
+ if (e === "") {
1769
+ t.processInput("")?.catch(() => {}), p(null);
1770
+ return;
1771
+ }
1772
+ (async () => {
1773
+ p(await t.processInput(e));
1774
+ })();
1775
+ }
1776
+ }, [e, u]);
1777
+ async function y(e) {
1778
+ let r = s.current;
1779
+ if (!r) return;
1780
+ let i = await r.pickCandidate(e);
1781
+ p(i), i.preeditBody || (t(i.committed || ""), n(""), p(null), h(!1));
1782
+ }
1783
+ return /* @__PURE__ */ (0, $.jsxs)("div", {
1784
+ className: "tdhk-candidate",
1785
+ children: [/* @__PURE__ */ (0, $.jsxs)("div", {
1786
+ className: "tdhk-candidate__container",
1787
+ children: [v && /* @__PURE__ */ (0, $.jsx)("div", {
1788
+ className: "tdhk-candidate__pinyin",
1789
+ children: v
1790
+ }), /* @__PURE__ */ (0, $.jsxs)("div", {
1791
+ className: "tdhk-candidate__bottom-container",
1792
+ children: [_.length > 0 && /* @__PURE__ */ (0, $.jsx)(Yr, {
1793
+ candidates: _,
1794
+ onSelect: y
1795
+ }), _.length > 0 && /* @__PURE__ */ (0, $.jsx)("button", {
1796
+ className: "tdhk-candidate__more",
1797
+ onClick: () => h(!0),
1798
+ children: /* @__PURE__ */ (0, $.jsx)("img", {
1799
+ src: "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",
1800
+ alt: "更多"
1801
+ })
1802
+ })]
1803
+ })]
1804
+ }), m && /* @__PURE__ */ (0, $.jsx)(ni, {
1805
+ candidates: _,
1806
+ onSelect: y,
1807
+ onClose: () => h(!1)
1808
+ })]
1809
+ });
1810
+ }), ii = ({ enableHandwriting: e, capsReturnToChinese: t, mode: n, onKey: r, onCollapse: i, onToggleKeyboard: a, setCapsReturnToChinese: s, setMode: u }) => {
1811
+ let [d, f] = l(""), p = c(null), { startRepeat: m, stopRepeat: h } = Kr(), g = o(() => n === "zh", [n]), _ = o(() => n === "en_cap", [n]), v = o(() => g ? !0 : _, [g, _]);
1812
+ function y(e, t = !1) {
1813
+ r({
1814
+ key: e,
1815
+ isControl: t
1816
+ });
1817
+ }
1818
+ function b() {
1819
+ g ? (f(""), s(!0), u("en_cap")) : _ && t ? (s(!1), u("zh")) : (s(!1), u(_ ? "en" : "en_cap"));
1820
+ }
1821
+ function x() {
1822
+ u("num");
1823
+ }
1824
+ function ee() {
1825
+ u("symbol");
1826
+ }
1827
+ let te = [
1828
+ [
1829
+ "q",
1830
+ "w",
1831
+ "e",
1832
+ "r",
1833
+ "t",
1834
+ "y",
1835
+ "u",
1836
+ "i",
1837
+ "o",
1838
+ "p"
1839
+ ],
1840
+ [
1841
+ "a",
1842
+ "s",
1843
+ "d",
1844
+ "f",
1845
+ "g",
1846
+ "h",
1847
+ "j",
1848
+ "k",
1849
+ "l"
1850
+ ],
1851
+ [
1852
+ "z",
1853
+ "x",
1854
+ "c",
1855
+ "v",
1856
+ "b",
1857
+ "n",
1858
+ "m"
1859
+ ]
1860
+ ];
1861
+ function S() {
1862
+ if (n === "zh" && d) {
1863
+ f(d.slice(0, -1));
1864
+ return;
1865
+ }
1866
+ y("delete", !0);
1867
+ }
1868
+ function C() {
1869
+ if (n === "zh" && d) {
1870
+ p.current?.handleSelection(0);
1871
+ return;
1872
+ }
1873
+ y(" ");
1874
+ }
1875
+ function w() {
1876
+ if (n === "zh" && d) {
1877
+ y(d), f("");
1878
+ return;
1879
+ }
1880
+ y("enter", !0);
1881
+ }
1882
+ function T(e) {
1883
+ if (n === "zh") {
1884
+ f(d + e);
1885
+ return;
1886
+ }
1887
+ y(_ ? e.toUpperCase() : e);
1888
+ }
1889
+ function ne() {
1890
+ s(!1), u(n === "zh" ? "en" : "zh");
1891
+ }
1892
+ function E(e) {
1893
+ e.preventDefault();
1894
+ }
1895
+ return /* @__PURE__ */ (0, $.jsxs)("div", {
1896
+ className: "tdhk-base",
1897
+ children: [
1898
+ /* @__PURE__ */ (0, $.jsx)("div", {
1899
+ className: "tdhk-base__row tdhk-base__row--header",
1900
+ children: o(() => g && d.length > 0, [g, d.length]) ? /* @__PURE__ */ (0, $.jsx)(ri, {
1901
+ ref: p,
1902
+ currentPinyin: d,
1903
+ onInput: (e) => y(e, !1),
1904
+ onKey: r,
1905
+ setCurrentPinyin: f
1906
+ }) : /* @__PURE__ */ (0, $.jsx)($r, {
1907
+ enableHandwriting: e,
1908
+ onToggleKeyboard: a,
1909
+ onCollapse: i
1910
+ })
1911
+ }),
1912
+ te.map((e, t) => /* @__PURE__ */ (0, $.jsxs)("div", {
1913
+ className: "tdhk-base__row",
1914
+ children: [
1915
+ t === 2 && /* @__PURE__ */ (0, $.jsx)("button", {
1916
+ className: `tdhk-base__key tdhk-base__key--function tdhk-base__key--shift ${_ ? "tdhk-base__key--active" : ""}`,
1917
+ onClick: b,
1918
+ onContextMenu: E,
1919
+ children: /* @__PURE__ */ (0, $.jsx)("img", {
1920
+ src: "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",
1921
+ className: "tdhk-base__key-icon",
1922
+ alt: "Shift"
1923
+ })
1924
+ }),
1925
+ e.map((e) => /* @__PURE__ */ (0, $.jsx)("button", {
1926
+ className: "tdhk-base__key tdhk-base__key--letter",
1927
+ onPointerDown: (t) => m(t, () => T(e)),
1928
+ onPointerUp: h,
1929
+ onPointerLeave: h,
1930
+ onPointerCancel: h,
1931
+ onContextMenu: E,
1932
+ children: v ? e.toUpperCase() : e
1933
+ }, e)),
1934
+ t === 2 && /* @__PURE__ */ (0, $.jsx)("button", {
1935
+ className: "tdhk-base__key tdhk-base__key--function tdhk-base__key--delete",
1936
+ onPointerDown: (e) => m(e, () => S()),
1937
+ onPointerUp: h,
1938
+ onPointerLeave: h,
1939
+ onPointerCancel: h,
1940
+ onContextMenu: E,
1941
+ children: /* @__PURE__ */ (0, $.jsx)("img", {
1942
+ src: "data:image/svg+xml,%3csvg%20t='1777011781316'%20class='icon'%20viewBox='0%200%201439%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5887'%20width='200'%20height='200'%3e%3cpath%20d='M1283.03672%200.000187H465.243153a158.045778%20158.045778%200%200%200-122.329921%2057.680486L24.083875%20440.475014c-0.622227%200.68445-1.182232%201.431123-1.742237%202.177796A115.672087%20115.672087%200%200%200%200.003672%20511.906728a118.658779%20118.658779%200%200%200%2026.818004%2074.667297l316.713783%20380.492099a158.232446%20158.232446%200%200%200%20121.707694%2056.933814H1283.03672a156.303541%20156.303541%200%200%200%20156.05465-156.116873V156.054837A156.241318%20156.241318%200%200%200%201283.03672%200.000187z%20m-257.477728%20689.863598a47.538179%2047.538179%200%200%201-33.600284%2013.937896%2047.662624%2047.662624%200%200%201-33.662506-13.937896L847.72638%20579.293963l-110.569822%20110.569822a47.911515%2047.911515%200%200%201-33.724729%2013.937896%2047.662624%2047.662624%200%200%201-33.662506-81.325131l110.383154-110.569822-110.569822-110.569822a47.662624%2047.662624%200%200%201%200-67.387235%2047.600402%2047.600402%200%200%201%2067.325012%200l110.632045%20110.632045%20110.569822-110.632045A47.625291%2047.625291%200%200%201%201025.434546%20401.336906l-110.383153%20110.569822%20110.569821%20110.569822a47.662624%2047.662624%200%200%201-0.062222%2067.387235z'%20fill='%232C2C2C'%20p-id='5888'%3e%3c/path%3e%3c/svg%3e",
1943
+ className: "tdhk-base__key-icon",
1944
+ alt: "Delete"
1945
+ })
1946
+ })
1947
+ ]
1948
+ }, `row-${e.join("")}`)),
1949
+ /* @__PURE__ */ (0, $.jsxs)("div", {
1950
+ className: "tdhk-base__row",
1951
+ children: [
1952
+ /* @__PURE__ */ (0, $.jsx)("button", {
1953
+ className: "tdhk-base__key tdhk-base__key--function",
1954
+ onClick: ee,
1955
+ onContextMenu: E,
1956
+ children: "符"
1957
+ }),
1958
+ /* @__PURE__ */ (0, $.jsx)("button", {
1959
+ className: "tdhk-base__key tdhk-base__key--function",
1960
+ onClick: x,
1961
+ onContextMenu: E,
1962
+ children: "123"
1963
+ }),
1964
+ /* @__PURE__ */ (0, $.jsx)("button", {
1965
+ className: "tdhk-base__key",
1966
+ onPointerDown: (e) => m(e, () => y(",")),
1967
+ onPointerUp: h,
1968
+ onPointerLeave: h,
1969
+ onPointerCancel: h,
1970
+ onContextMenu: E,
1971
+ children: ","
1972
+ }),
1973
+ /* @__PURE__ */ (0, $.jsx)("button", {
1974
+ className: "tdhk-base__key tdhk-base__key--space",
1975
+ onPointerDown: (e) => m(e, () => C()),
1976
+ onPointerUp: h,
1977
+ onPointerLeave: h,
1978
+ onPointerCancel: h,
1979
+ onContextMenu: E,
1980
+ children: /* @__PURE__ */ (0, $.jsx)("img", {
1981
+ src: ti,
1982
+ className: "tdhk-base__key-icon",
1983
+ alt: "Space"
1984
+ })
1985
+ }),
1986
+ /* @__PURE__ */ (0, $.jsx)("button", {
1987
+ className: "tdhk-base__key",
1988
+ onPointerDown: (e) => m(e, () => y("。")),
1989
+ onPointerUp: h,
1990
+ onPointerLeave: h,
1991
+ onPointerCancel: h,
1992
+ onContextMenu: E,
1993
+ children: "。"
1994
+ }),
1995
+ /* @__PURE__ */ (0, $.jsxs)("button", {
1996
+ className: "tdhk-base__key tdhk-base__key--function",
1997
+ onClick: ne,
1998
+ onContextMenu: E,
1999
+ children: [/* @__PURE__ */ (0, $.jsx)("span", {
2000
+ className: "tdhk-base__toggle-main",
2001
+ children: n === "zh" ? "中" : "英"
2002
+ }), /* @__PURE__ */ (0, $.jsxs)("span", {
2003
+ className: "tdhk-base__toggle-sub",
2004
+ children: ["/", n === "zh" ? "英" : "中"]
2005
+ })]
2006
+ }),
2007
+ /* @__PURE__ */ (0, $.jsx)("button", {
2008
+ className: "tdhk-base__key tdhk-base__key--function",
2009
+ onPointerDown: (e) => m(e, () => w()),
2010
+ onPointerUp: h,
2011
+ onPointerLeave: h,
2012
+ onPointerCancel: h,
2013
+ onContextMenu: E,
2014
+ children: /* @__PURE__ */ (0, $.jsx)("img", {
2015
+ src: Gr,
2016
+ className: "tdhk-base__key-icon",
2017
+ alt: "Enter"
2018
+ })
2019
+ })
2020
+ ]
2021
+ })
2022
+ ]
2023
+ });
2024
+ }, ai = [
2025
+ [
2026
+ "1",
2027
+ "2",
2028
+ "3"
2029
+ ],
2030
+ [
2031
+ "4",
2032
+ "5",
2033
+ "6"
2034
+ ],
2035
+ [
2036
+ "7",
2037
+ "8",
2038
+ "9"
2039
+ ],
2040
+ [
2041
+ "back",
2042
+ "0",
2043
+ "space"
2044
+ ]
2045
+ ], oi = ({ onKey: e, onExit: t, keyboardRows: n = h().numKeys || ai }) => {
2046
+ let { startRepeat: r, stopRepeat: i } = Kr(), a = [
2047
+ {
2048
+ key: "delete",
2049
+ icon: Wr,
2050
+ text: "",
2051
+ alt: "Delete"
2052
+ },
2053
+ {
2054
+ key: ".",
2055
+ icon: "",
2056
+ text: ".",
2057
+ alt: "."
2058
+ },
2059
+ {
2060
+ key: "@",
2061
+ icon: "",
2062
+ text: "@",
2063
+ alt: "@"
2064
+ },
2065
+ {
2066
+ key: "enter",
2067
+ icon: Gr,
2068
+ text: "",
2069
+ alt: "Enter"
2070
+ }
2071
+ ];
2072
+ function o(t) {
2073
+ e({ key: t });
2074
+ }
2075
+ function s(t, n = !0) {
2076
+ e({
2077
+ key: t,
2078
+ isControl: n
2079
+ });
2080
+ }
2081
+ function c() {
2082
+ t();
2083
+ }
2084
+ function l(e) {
2085
+ e.preventDefault();
2086
+ }
2087
+ function u(e, t) {
2088
+ e === "back" || (e === "space" && (e = " "), e === "delete" || e === "enter" ? r(t, () => s(e)) : r(t, () => o(e)));
2089
+ }
2090
+ let d = (e) => e === "back" ? "返回" : e === "space" ? /* @__PURE__ */ (0, $.jsx)("img", {
2091
+ src: ti,
2092
+ className: "tdhk-base__key-icon",
2093
+ alt: "Space"
2094
+ }) : e;
2095
+ return /* @__PURE__ */ (0, $.jsx)("div", {
2096
+ className: "num-keyboard",
2097
+ children: /* @__PURE__ */ (0, $.jsxs)("div", {
2098
+ className: "num-keyboard__container",
2099
+ children: [/* @__PURE__ */ (0, $.jsx)("div", {
2100
+ className: "num-keyboard__left",
2101
+ children: /* @__PURE__ */ (0, $.jsx)("div", {
2102
+ className: "num-keyboard__rows",
2103
+ children: n.map((e) => /* @__PURE__ */ (0, $.jsx)("div", {
2104
+ className: "num-keyboard__row",
2105
+ children: e.map((t) => /* @__PURE__ */ (0, $.jsx)("button", {
2106
+ className: `num-keyboard__key ${t === "back" ? "num-keyboard__key--back" : ""} ${t === "space" ? "num-keyboard__key--space" : ""}`,
2107
+ onClick: () => t === "back" && c(),
2108
+ onPointerDown: (e) => u(t, e),
2109
+ onPointerUp: i,
2110
+ onPointerLeave: i,
2111
+ onPointerCancel: i,
2112
+ onContextMenu: l,
2113
+ children: d(t)
2114
+ }, `key-${e.join("")}-${t}`))
2115
+ }, `row-${e.join("")}`))
2116
+ })
2117
+ }), /* @__PURE__ */ (0, $.jsx)("div", {
2118
+ className: "num-keyboard__right",
2119
+ children: a.map((e) => /* @__PURE__ */ (0, $.jsx)("button", {
2120
+ className: "num-keyboard__key num-keyboard__key--function",
2121
+ onPointerDown: (t) => {
2122
+ if (e.key === "." || e.key === "@") {
2123
+ r(t, () => o(e.key));
2124
+ return;
2125
+ }
2126
+ r(t, () => s(e.key));
2127
+ },
2128
+ onPointerUp: i,
2129
+ onPointerLeave: i,
2130
+ onPointerCancel: i,
2131
+ onContextMenu: l,
2132
+ children: e.icon ? /* @__PURE__ */ (0, $.jsx)("img", {
2133
+ src: e.icon,
2134
+ className: "num-keyboard__key-icon",
2135
+ alt: e.alt
2136
+ }) : /* @__PURE__ */ (0, $.jsx)("span", { children: e.text })
2137
+ }, `func-${e.key}`))
2138
+ })]
2139
+ })
2140
+ });
2141
+ }, si = "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", ci = "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", li = ({ onKey: e, onExit: t }) => {
2142
+ let [n, r] = l("en"), i = o(() => n === "zh" ? "!@#¥%…&*(){}[]<>/\|:;"',。?+-=_~·€£¥₹©®™°" : "!@#$%^&*(){}[]<>/\\|:;\"',.?+-=_~`€£¥₹©®™°", [n]), [a, s] = l(!1), { startRepeat: c, stopRepeat: u } = Kr();
2143
+ function d(n) {
2144
+ e({ key: n }), a || t();
2145
+ }
2146
+ function f() {
2147
+ t();
2148
+ }
2149
+ function p() {
2150
+ s(!a);
2151
+ }
2152
+ function m(e) {
2153
+ e.preventDefault();
2154
+ }
2155
+ function h(e, t) {
2156
+ a && c(t, () => d(e));
2157
+ }
2158
+ return /* @__PURE__ */ (0, $.jsx)("div", {
2159
+ className: "symbol-keyboard",
2160
+ children: /* @__PURE__ */ (0, $.jsxs)("div", {
2161
+ className: "symbol-keyboard__content",
2162
+ children: [/* @__PURE__ */ (0, $.jsxs)("div", {
2163
+ className: "symbol-keyboard__functions",
2164
+ children: [/* @__PURE__ */ (0, $.jsxs)("div", {
2165
+ className: "symbol-keyboard__lang-selector",
2166
+ children: [/* @__PURE__ */ (0, $.jsx)("button", {
2167
+ type: "button",
2168
+ className: `symbol-keyboard__lang-btn ${n === "zh" ? "symbol-keyboard__lang-btn--active" : ""}`,
2169
+ onClick: () => r("zh"),
2170
+ onContextMenu: m,
2171
+ children: "中文"
2172
+ }), /* @__PURE__ */ (0, $.jsx)("button", {
2173
+ className: `symbol-keyboard__lang-btn ${n === "en" ? "symbol-keyboard__lang-btn--active" : ""}`,
2174
+ onClick: () => r("en"),
2175
+ onContextMenu: m,
2176
+ children: "英文"
2177
+ })]
2178
+ }), /* @__PURE__ */ (0, $.jsxs)("div", {
2179
+ className: "symbol-keyboard__control-group",
2180
+ children: [/* @__PURE__ */ (0, $.jsx)("button", {
2181
+ className: `symbol-keyboard__key symbol-keyboard__key--function symbol-keyboard__key--lock ${a ? "symbol-keyboard__key--locked" : ""}`,
2182
+ onClick: p,
2183
+ onContextMenu: m,
2184
+ children: a ? /* @__PURE__ */ (0, $.jsx)("img", {
2185
+ src: ci,
2186
+ alt: "Lock closed"
2187
+ }) : /* @__PURE__ */ (0, $.jsx)("img", {
2188
+ src: si,
2189
+ alt: "Lock open"
2190
+ })
2191
+ }), /* @__PURE__ */ (0, $.jsx)("button", {
2192
+ className: "symbol-keyboard__key symbol-keyboard__key--function symbol-keyboard__key--back",
2193
+ onClick: f,
2194
+ onContextMenu: m,
2195
+ children: "返回"
2196
+ })]
2197
+ })]
2198
+ }), /* @__PURE__ */ (0, $.jsx)("div", {
2199
+ className: "symbol-keyboard__symbols-container",
2200
+ children: /* @__PURE__ */ (0, $.jsx)("div", {
2201
+ className: "symbol-keyboard__symbols-grid",
2202
+ children: i.split("").map((e) => /* @__PURE__ */ (0, $.jsx)("button", {
2203
+ className: "symbol-keyboard__key",
2204
+ onClick: () => !a && d(e),
2205
+ onPointerDown: (t) => h(e, t),
2206
+ onPointerUp: u,
2207
+ onPointerLeave: u,
2208
+ onPointerCancel: u,
2209
+ onContextMenu: m,
2210
+ children: e
2211
+ }, `key-${e}`))
2212
+ })
2213
+ })]
2214
+ })
2215
+ });
2216
+ };
2217
+ //#endregion
2218
+ //#region src/components/TdhKeyboard.tsx
2219
+ function ui(e) {
2220
+ return e === "zh" || e === "en" || e === "en_cap";
2221
+ }
2222
+ function di(e) {
2223
+ return ui(e) ? e : "zh";
2224
+ }
2225
+ var fi = t((e, t) => {
2226
+ let { defaultMode: s = h().defaultMode ?? "en", enableHandwriting: u = h().enableHandwriting ?? !1, position: f = h().position ?? "static", floatMarginTop: m = h().floatMarginTop ?? 0, disableWhenNoFocus: g = h().disableWhenNoFocus ?? !0, manual: y = h().manual ?? !1, onKey: b, className: x, style: ee, numKeys: te } = e, [S, C] = l(s), [w, T] = l(!1), [ne, E] = l(!1), [re, D] = l(!1), O = c(di(s)), [k, ie] = l(null), ae = c(null), A = Rr(), [j, M] = l(null), [N, P] = l(!y), [F, oe] = l(!1), I = o(() => y ? j : A && _(A) ? A : null, [
2227
+ A,
2228
+ y,
2229
+ j
2230
+ ]), [L, R] = Br(ae), { recognizerInitialized: z, recognizerProgress: se } = Ur(u);
2231
+ r(() => {
2232
+ ui(S) && (O.current = S);
2233
+ }, [S]);
2234
+ let [B, ce] = l(!1), le = c(null), ue = c(null);
2235
+ r(() => {
2236
+ !y && !F && I && I !== ue.current && P(!0), ue.current = I;
2237
+ }, [
2238
+ I,
2239
+ F,
2240
+ y
2241
+ ]);
2242
+ let V = n(() => {
2243
+ R && ie(d(I, ae.current, f, m));
2244
+ }, [
2245
+ m,
2246
+ I,
2247
+ R,
2248
+ f
2249
+ ]), H = o(() => F || !N || w && !I ? !1 : y || f === "static" || !!I, [
2250
+ I,
2251
+ w,
2252
+ F,
2253
+ N,
2254
+ y,
2255
+ f
2256
+ ]);
2257
+ a(() => {
2258
+ let e = le.current !== I;
2259
+ H && R && e && (le.current = I, V());
2260
+ }, [
2261
+ H,
2262
+ I,
2263
+ V,
2264
+ R
2265
+ ]), a(() => {
2266
+ if (R && !B) {
2267
+ V();
2268
+ let e = setTimeout(() => {
2269
+ ce(!0);
2270
+ }, 0);
2271
+ return () => clearTimeout(e);
2272
+ }
2273
+ }, [
2274
+ R,
2275
+ B,
2276
+ V
2277
+ ]), a(() => {
2278
+ if (N && I) {
2279
+ T(!1);
2280
+ let e = I.dataset.inputmode;
2281
+ C((t) => e ? (E(!1), D(!1), ui(e) ? O.current = e : e === "hand" && (O.current = "zh"), e) : t);
2282
+ }
2283
+ }, [I, N]);
2284
+ let de = o(() => y ? !j : g === !1 ? !1 : !I, [
2285
+ g,
2286
+ I,
2287
+ y,
2288
+ j
2289
+ ]), fe = o(() => {
2290
+ let e;
2291
+ return () => {
2292
+ clearTimeout(e), e = setTimeout(V, 100);
2293
+ };
2294
+ }, [V]);
2295
+ Ir("scroll", fe, window, { passive: !0 }), Ir("resize", fe, window, { passive: !0 });
2296
+ let U = n((e) => {
2297
+ if (e.isControl) switch (e.key) {
2298
+ case "delete":
2299
+ I && p(I);
2300
+ break;
2301
+ case "more": break;
2302
+ default: break;
2303
+ }
2304
+ else I && v(I, e.key);
2305
+ b && b(e);
2306
+ }, [I, b]), W = n(() => {
2307
+ if (S === "symbol" && re) {
2308
+ D(!1), C("hand");
2309
+ return;
2310
+ }
2311
+ D(!1), C(O.current);
2312
+ }, [S, re]), pe = n(() => {
2313
+ if (u) {
2314
+ if (S === "hand") {
2315
+ C(O.current);
2316
+ return;
2317
+ }
2318
+ ui(S) && (O.current = S, C("hand"));
2319
+ }
2320
+ }, [u, S]), me = n(() => {
2321
+ _e(), I?.blur();
2322
+ }, [I]), he = n(() => {
2323
+ D(!0), C("symbol");
2324
+ }, []), ge = n((e) => {
2325
+ oe(!1), e ? (M(e), e.focus()) : A && _(A) && M(A), T(!1), P(!0), V();
2326
+ }, [A, V]), _e = n(() => {
2327
+ T(!0), P(!1);
2328
+ }, []), ve = n(() => {
2329
+ T(!0), P(!1), M(null), ie(null), oe(!0);
2330
+ }, []);
2331
+ return r(() => {
2332
+ if (!y) {
2333
+ P(!0), M(null), oe(!1);
2334
+ return;
2335
+ }
2336
+ P(!1), M(null);
2337
+ }, [y]), i(t, () => ({
2338
+ open: ge,
2339
+ close: _e,
2340
+ destroy: ve
2341
+ }), [
2342
+ _e,
2343
+ ve,
2344
+ ge
2345
+ ]), /* @__PURE__ */ (0, $.jsx)("div", {
2346
+ ref: ae,
2347
+ className: (0, Hr.default)("tdhk", {
2348
+ "tdhk--floating": f === "float",
2349
+ "tdhk--bottom": f === "bottom",
2350
+ "tdhk--disabled": de
2351
+ }, x),
2352
+ style: {
2353
+ "--keyboard-height": `${R}px`,
2354
+ ...k,
2355
+ ...ee,
2356
+ display: H ? void 0 : "none",
2357
+ opacity: B ? 1 : 0
2358
+ },
2359
+ onMouseDown: (e) => e.preventDefault(),
2360
+ children: de || !H || !R ? /* @__PURE__ */ (0, $.jsx)("div", {
2361
+ className: (0, Hr.default)("tdhk__disabled-overlay"),
2362
+ children: /* @__PURE__ */ (0, $.jsx)("span", { children: "请选择输入框以启用键盘" })
2363
+ }) : /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
2364
+ S === "hand" && /* @__PURE__ */ (0, $.jsx)(ei, {
2365
+ recognizerInitialized: z,
2366
+ recognizerProgress: se,
2367
+ onKey: U,
2368
+ onToggleKeyboard: pe,
2369
+ onSwitchToSymbol: he,
2370
+ onCollapse: me
2371
+ }),
2372
+ S === "num" && /* @__PURE__ */ (0, $.jsx)(oi, {
2373
+ onKey: U,
2374
+ onExit: W,
2375
+ keyboardRows: te
2376
+ }),
2377
+ S === "symbol" && /* @__PURE__ */ (0, $.jsx)(li, {
2378
+ onKey: U,
2379
+ onExit: W
2380
+ }),
2381
+ (S === "en" || S === "en_cap" || S === "zh") && /* @__PURE__ */ (0, $.jsx)(ii, {
2382
+ capsReturnToChinese: ne,
2383
+ mode: S,
2384
+ setMode: C,
2385
+ setCapsReturnToChinese: E,
2386
+ enableHandwriting: u,
2387
+ onKey: U,
2388
+ onToggleKeyboard: pe,
2389
+ onCollapse: me
2390
+ })
2391
+ ] })
2392
+ });
2393
+ }), pi = t((e, t) => {
2394
+ let { position: n = "static" } = e, r = /* @__PURE__ */ (0, $.jsx)(fi, {
2395
+ ...e,
2396
+ ref: t
2397
+ });
2398
+ return n === "static" ? r : y.createPortal(r, document.body);
2399
+ }), mi = pi;
2400
+ //#endregion
2401
+ export { pi as TdhKeyboard, mi as default };
2402
+
2403
+ //# sourceMappingURL=tdh-keyboard-react.js.map