aicodeman 0.8.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/config/instance.d.ts +42 -0
- package/dist/config/instance.d.ts.map +1 -0
- package/dist/config/instance.js +61 -0
- package/dist/config/instance.js.map +1 -0
- package/dist/mux-interface.d.ts +6 -2
- package/dist/mux-interface.d.ts.map +1 -1
- package/dist/push-store.d.ts.map +1 -1
- package/dist/push-store.js +2 -2
- package/dist/push-store.js.map +1 -1
- package/dist/session-cli-builder.d.ts +16 -2
- package/dist/session-cli-builder.d.ts.map +1 -1
- package/dist/session-cli-builder.js +21 -1
- package/dist/session-cli-builder.js.map +1 -1
- package/dist/session-lifecycle-log.d.ts.map +1 -1
- package/dist/session-lifecycle-log.js +3 -3
- package/dist/session-lifecycle-log.js.map +1 -1
- package/dist/session.d.ts +6 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +23 -6
- package/dist/session.js.map +1 -1
- package/dist/state-store.d.ts.map +1 -1
- package/dist/state-store.js +6 -3
- package/dist/state-store.js.map +1 -1
- package/dist/tmux-manager.d.ts.map +1 -1
- package/dist/tmux-manager.js +41 -10
- package/dist/tmux-manager.js.map +1 -1
- package/dist/types/session.d.ts +12 -0
- package/dist/types/session.d.ts.map +1 -1
- package/dist/types/session.js +10 -1
- package/dist/types/session.js.map +1 -1
- package/dist/web/middleware/auth.d.ts.map +1 -1
- package/dist/web/middleware/auth.js +12 -1
- package/dist/web/middleware/auth.js.map +1 -1
- package/dist/web/public/api-client.3adebdc2.js.gz +0 -0
- package/dist/web/public/{app.d044eb65.js → app.cc861c96.js} +9 -7
- package/dist/web/public/app.cc861c96.js.br +0 -0
- package/dist/web/public/app.cc861c96.js.gz +0 -0
- package/dist/web/public/constants.cb6426c4.js.gz +0 -0
- package/dist/web/public/gesture/gesture-codeman.js +4735 -0
- package/dist/web/public/gesture/gesture_recognizer.task +0 -0
- package/dist/web/public/gesture/wasm/vision_wasm_internal.js +20 -0
- package/dist/web/public/gesture/wasm/vision_wasm_internal.wasm +0 -0
- package/dist/web/public/gesture/wasm/vision_wasm_nosimd_internal.js +20 -0
- package/dist/web/public/gesture/wasm/vision_wasm_nosimd_internal.wasm +0 -0
- package/dist/web/public/image-input.7cade6a8.js.gz +0 -0
- package/dist/web/public/index.html +40 -11
- package/dist/web/public/index.html.br +0 -0
- package/dist/web/public/index.html.gz +0 -0
- package/dist/web/public/input-cjk.88082175.js.gz +0 -0
- package/dist/web/public/keyboard-accessory.cdfd8c04.js.gz +0 -0
- package/dist/web/public/mobile-handlers.1e2a8ef8.js.gz +0 -0
- package/dist/web/public/mobile.26dc30d6.css.gz +0 -0
- package/dist/web/public/notification-manager.9c984ac2.js.gz +0 -0
- package/dist/web/public/orchestrator-panel.js.gz +0 -0
- package/dist/web/public/{panels-ui.cf998835.js → panels-ui.3e304caf.js} +16 -16
- package/dist/web/public/panels-ui.3e304caf.js.br +0 -0
- package/dist/web/public/panels-ui.3e304caf.js.gz +0 -0
- package/dist/web/public/ralph-panel.61076370.js.gz +0 -0
- package/dist/web/public/{ralph-wizard.6b0f0be7.js → ralph-wizard.52d533d2.js} +4 -4
- package/dist/web/public/ralph-wizard.52d533d2.js.br +0 -0
- package/dist/web/public/{ralph-wizard.6b0f0be7.js.gz → ralph-wizard.52d533d2.js.gz} +0 -0
- package/dist/web/public/respawn-ui.5377f958.js.gz +0 -0
- package/dist/web/public/session-ui.3e0cf024.js +36 -0
- package/dist/web/public/session-ui.3e0cf024.js.br +0 -0
- package/dist/web/public/session-ui.3e0cf024.js.gz +0 -0
- package/dist/web/public/settings-ui.c06be9c3.js +55 -0
- package/dist/web/public/settings-ui.c06be9c3.js.br +0 -0
- package/dist/web/public/settings-ui.c06be9c3.js.gz +0 -0
- package/dist/web/public/styles.84a35202.css +1 -0
- package/dist/web/public/styles.84a35202.css.br +0 -0
- package/dist/web/public/styles.84a35202.css.gz +0 -0
- package/dist/web/public/subagent-windows.a366a4ad.js.gz +0 -0
- package/dist/web/public/sw.js.gz +0 -0
- package/dist/web/public/terminal-ui.37caa926.js +3 -0
- package/dist/web/public/terminal-ui.37caa926.js.br +0 -0
- package/dist/web/public/terminal-ui.37caa926.js.gz +0 -0
- package/dist/web/public/upload.html.gz +0 -0
- package/dist/web/public/vendor/marked.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-fit.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-unicode11.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-addon-webgl.min.js.gz +0 -0
- package/dist/web/public/vendor/xterm-zerolag-input.137ad9f0.js.gz +0 -0
- package/dist/web/public/vendor/xterm.css.gz +0 -0
- package/dist/web/public/vendor/xterm.min.js.gz +0 -0
- package/dist/web/public/voice-input.085e9e73.js.gz +0 -0
- package/dist/web/route-helpers.d.ts.map +1 -1
- package/dist/web/route-helpers.js +4 -2
- package/dist/web/route-helpers.js.map +1 -1
- package/dist/web/routes/case-routes.d.ts.map +1 -1
- package/dist/web/routes/case-routes.js +4 -3
- package/dist/web/routes/case-routes.js.map +1 -1
- package/dist/web/routes/ralph-routes.d.ts.map +1 -1
- package/dist/web/routes/ralph-routes.js +2 -1
- package/dist/web/routes/ralph-routes.js.map +1 -1
- package/dist/web/routes/session-routes.d.ts.map +1 -1
- package/dist/web/routes/session-routes.js +5 -2
- package/dist/web/routes/session-routes.js.map +1 -1
- package/dist/web/routes/system-routes.d.ts +7 -0
- package/dist/web/routes/system-routes.d.ts.map +1 -1
- package/dist/web/routes/system-routes.js +51 -5
- package/dist/web/routes/system-routes.js.map +1 -1
- package/dist/web/schemas.d.ts +26 -0
- package/dist/web/schemas.d.ts.map +1 -1
- package/dist/web/schemas.js +16 -0
- package/dist/web/schemas.js.map +1 -1
- package/dist/web/server.d.ts +21 -0
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/server.js +127 -15
- package/dist/web/server.js.map +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +14 -0
- package/dist/web/public/app.d044eb65.js.br +0 -0
- package/dist/web/public/app.d044eb65.js.gz +0 -0
- package/dist/web/public/panels-ui.cf998835.js.br +0 -0
- package/dist/web/public/panels-ui.cf998835.js.gz +0 -0
- package/dist/web/public/ralph-wizard.6b0f0be7.js.br +0 -0
- package/dist/web/public/session-ui.f1555cd1.js +0 -36
- package/dist/web/public/session-ui.f1555cd1.js.br +0 -0
- package/dist/web/public/session-ui.f1555cd1.js.gz +0 -0
- package/dist/web/public/settings-ui.25a18120.js +0 -55
- package/dist/web/public/settings-ui.25a18120.js.br +0 -0
- package/dist/web/public/settings-ui.25a18120.js.gz +0 -0
- package/dist/web/public/styles.42be1d59.css +0 -1
- package/dist/web/public/styles.42be1d59.css.br +0 -0
- package/dist/web/public/styles.42be1d59.css.gz +0 -0
- package/dist/web/public/terminal-ui.7616b9fd.js +0 -3
- package/dist/web/public/terminal-ui.7616b9fd.js.br +0 -0
- package/dist/web/public/terminal-ui.7616b9fd.js.gz +0 -0
|
@@ -0,0 +1,4735 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
|
|
5
|
+
// node_modules/@mediapipe/tasks-vision/vision_bundle.mjs
|
|
6
|
+
var t = "undefined" != typeof self ? self : {};
|
|
7
|
+
function e() {
|
|
8
|
+
throw Error("Invalid UTF8");
|
|
9
|
+
}
|
|
10
|
+
function n(t2, e2) {
|
|
11
|
+
return e2 = String.fromCharCode.apply(null, e2), null == t2 ? e2 : t2 + e2;
|
|
12
|
+
}
|
|
13
|
+
var r;
|
|
14
|
+
var i;
|
|
15
|
+
var s = "undefined" != typeof TextDecoder;
|
|
16
|
+
var o;
|
|
17
|
+
var a = "undefined" != typeof TextEncoder;
|
|
18
|
+
function c(t2) {
|
|
19
|
+
if (a) t2 = (o || (o = new TextEncoder())).encode(t2);
|
|
20
|
+
else {
|
|
21
|
+
let n2 = 0;
|
|
22
|
+
const r2 = new Uint8Array(3 * t2.length);
|
|
23
|
+
for (let i2 = 0; i2 < t2.length; i2++) {
|
|
24
|
+
var e2 = t2.charCodeAt(i2);
|
|
25
|
+
if (e2 < 128) r2[n2++] = e2;
|
|
26
|
+
else {
|
|
27
|
+
if (e2 < 2048) r2[n2++] = e2 >> 6 | 192;
|
|
28
|
+
else {
|
|
29
|
+
if (e2 >= 55296 && e2 <= 57343) {
|
|
30
|
+
if (e2 <= 56319 && i2 < t2.length) {
|
|
31
|
+
const s2 = t2.charCodeAt(++i2);
|
|
32
|
+
if (s2 >= 56320 && s2 <= 57343) {
|
|
33
|
+
e2 = 1024 * (e2 - 55296) + s2 - 56320 + 65536, r2[n2++] = e2 >> 18 | 240, r2[n2++] = e2 >> 12 & 63 | 128, r2[n2++] = e2 >> 6 & 63 | 128, r2[n2++] = 63 & e2 | 128;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
i2--;
|
|
37
|
+
}
|
|
38
|
+
e2 = 65533;
|
|
39
|
+
}
|
|
40
|
+
r2[n2++] = e2 >> 12 | 224, r2[n2++] = e2 >> 6 & 63 | 128;
|
|
41
|
+
}
|
|
42
|
+
r2[n2++] = 63 & e2 | 128;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
t2 = n2 === r2.length ? r2 : r2.subarray(0, n2);
|
|
46
|
+
}
|
|
47
|
+
return t2;
|
|
48
|
+
}
|
|
49
|
+
var h;
|
|
50
|
+
var u;
|
|
51
|
+
t: {
|
|
52
|
+
for (l = ["CLOSURE_FLAGS"], d = t, f = 0; f < l.length; f++) if (null == (d = d[l[f]])) {
|
|
53
|
+
u = null;
|
|
54
|
+
break t;
|
|
55
|
+
}
|
|
56
|
+
u = d;
|
|
57
|
+
}
|
|
58
|
+
var l;
|
|
59
|
+
var d;
|
|
60
|
+
var f;
|
|
61
|
+
var p;
|
|
62
|
+
var g = u && u[610401301];
|
|
63
|
+
h = null != g && g;
|
|
64
|
+
var m = t.navigator;
|
|
65
|
+
function y(t2) {
|
|
66
|
+
return !!h && (!!p && p.brands.some(({ brand: e2 }) => e2 && -1 != e2.indexOf(t2)));
|
|
67
|
+
}
|
|
68
|
+
function _(e2) {
|
|
69
|
+
var n2;
|
|
70
|
+
return (n2 = t.navigator) && (n2 = n2.userAgent) || (n2 = ""), -1 != n2.indexOf(e2);
|
|
71
|
+
}
|
|
72
|
+
function v() {
|
|
73
|
+
return !!h && (!!p && p.brands.length > 0);
|
|
74
|
+
}
|
|
75
|
+
function E() {
|
|
76
|
+
return v() ? y("Chromium") : (_("Chrome") || _("CriOS")) && !(!v() && _("Edge")) || _("Silk");
|
|
77
|
+
}
|
|
78
|
+
function w(t2) {
|
|
79
|
+
return w[" "](t2), t2;
|
|
80
|
+
}
|
|
81
|
+
p = m && m.userAgentData || null, w[" "] = function() {
|
|
82
|
+
};
|
|
83
|
+
var T = !v() && (_("Trident") || _("MSIE"));
|
|
84
|
+
!_("Android") || E(), E(), _("Safari") && (E() || !v() && _("Coast") || !v() && _("Opera") || !v() && _("Edge") || (v() ? y("Microsoft Edge") : _("Edg/")) || v() && y("Opera"));
|
|
85
|
+
var A = {};
|
|
86
|
+
var b = null;
|
|
87
|
+
function k(t2) {
|
|
88
|
+
const e2 = t2.length;
|
|
89
|
+
let n2 = 3 * e2 / 4;
|
|
90
|
+
n2 % 3 ? n2 = Math.floor(n2) : -1 != "=.".indexOf(t2[e2 - 1]) && (n2 = -1 != "=.".indexOf(t2[e2 - 2]) ? n2 - 2 : n2 - 1);
|
|
91
|
+
const r2 = new Uint8Array(n2);
|
|
92
|
+
let i2 = 0;
|
|
93
|
+
return function(t3, e3) {
|
|
94
|
+
function n3(e4) {
|
|
95
|
+
for (; r3 < t3.length; ) {
|
|
96
|
+
const e5 = t3.charAt(r3++), n4 = b[e5];
|
|
97
|
+
if (null != n4) return n4;
|
|
98
|
+
if (!/^[\s\xa0]*$/.test(e5)) throw Error("Unknown base64 encoding at char: " + e5);
|
|
99
|
+
}
|
|
100
|
+
return e4;
|
|
101
|
+
}
|
|
102
|
+
S();
|
|
103
|
+
let r3 = 0;
|
|
104
|
+
for (; ; ) {
|
|
105
|
+
const t4 = n3(-1), r4 = n3(0), i3 = n3(64), s2 = n3(64);
|
|
106
|
+
if (64 === s2 && -1 === t4) break;
|
|
107
|
+
e3(t4 << 2 | r4 >> 4), 64 != i3 && (e3(r4 << 4 & 240 | i3 >> 2), 64 != s2 && e3(i3 << 6 & 192 | s2));
|
|
108
|
+
}
|
|
109
|
+
}(t2, function(t3) {
|
|
110
|
+
r2[i2++] = t3;
|
|
111
|
+
}), i2 !== n2 ? r2.subarray(0, i2) : r2;
|
|
112
|
+
}
|
|
113
|
+
function S() {
|
|
114
|
+
if (!b) {
|
|
115
|
+
b = {};
|
|
116
|
+
var t2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""), e2 = ["+/=", "+/", "-_=", "-_.", "-_"];
|
|
117
|
+
for (let n2 = 0; n2 < 5; n2++) {
|
|
118
|
+
const r2 = t2.concat(e2[n2].split(""));
|
|
119
|
+
A[n2] = r2;
|
|
120
|
+
for (let t3 = 0; t3 < r2.length; t3++) {
|
|
121
|
+
const e3 = r2[t3];
|
|
122
|
+
void 0 === b[e3] && (b[e3] = t3);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
var x = "undefined" != typeof Uint8Array;
|
|
128
|
+
var L = !T && "function" == typeof btoa;
|
|
129
|
+
function R(t2) {
|
|
130
|
+
if (!L) {
|
|
131
|
+
var e2;
|
|
132
|
+
void 0 === e2 && (e2 = 0), S(), e2 = A[e2];
|
|
133
|
+
var n2 = Array(Math.floor(t2.length / 3)), r2 = e2[64] || "";
|
|
134
|
+
let c2 = 0, h2 = 0;
|
|
135
|
+
for (; c2 < t2.length - 2; c2 += 3) {
|
|
136
|
+
var i2 = t2[c2], s2 = t2[c2 + 1], o2 = t2[c2 + 2], a2 = e2[i2 >> 2];
|
|
137
|
+
i2 = e2[(3 & i2) << 4 | s2 >> 4], s2 = e2[(15 & s2) << 2 | o2 >> 6], o2 = e2[63 & o2], n2[h2++] = a2 + i2 + s2 + o2;
|
|
138
|
+
}
|
|
139
|
+
switch (a2 = 0, o2 = r2, t2.length - c2) {
|
|
140
|
+
case 2:
|
|
141
|
+
o2 = e2[(15 & (a2 = t2[c2 + 1])) << 2] || r2;
|
|
142
|
+
case 1:
|
|
143
|
+
t2 = t2[c2], n2[h2] = e2[t2 >> 2] + e2[(3 & t2) << 4 | a2 >> 4] + o2 + r2;
|
|
144
|
+
}
|
|
145
|
+
return n2.join("");
|
|
146
|
+
}
|
|
147
|
+
for (e2 = "", n2 = 0, r2 = t2.length - 10240; n2 < r2; ) e2 += String.fromCharCode.apply(null, t2.subarray(n2, n2 += 10240));
|
|
148
|
+
return e2 += String.fromCharCode.apply(null, n2 ? t2.subarray(n2) : t2), btoa(e2);
|
|
149
|
+
}
|
|
150
|
+
var F = /[-_.]/g;
|
|
151
|
+
var I = { "-": "+", _: "/", ".": "=" };
|
|
152
|
+
function M(t2) {
|
|
153
|
+
return I[t2] || "";
|
|
154
|
+
}
|
|
155
|
+
function P(t2) {
|
|
156
|
+
if (!L) return k(t2);
|
|
157
|
+
F.test(t2) && (t2 = t2.replace(F, M)), t2 = atob(t2);
|
|
158
|
+
const e2 = new Uint8Array(t2.length);
|
|
159
|
+
for (let n2 = 0; n2 < t2.length; n2++) e2[n2] = t2.charCodeAt(n2);
|
|
160
|
+
return e2;
|
|
161
|
+
}
|
|
162
|
+
function O(t2) {
|
|
163
|
+
return x && null != t2 && t2 instanceof Uint8Array;
|
|
164
|
+
}
|
|
165
|
+
var C = {};
|
|
166
|
+
function U() {
|
|
167
|
+
return B || (B = new N(null, C));
|
|
168
|
+
}
|
|
169
|
+
function D(t2) {
|
|
170
|
+
j(C);
|
|
171
|
+
var e2 = t2.g;
|
|
172
|
+
return null == (e2 = null == e2 || O(e2) ? e2 : "string" == typeof e2 ? P(e2) : null) ? e2 : t2.g = e2;
|
|
173
|
+
}
|
|
174
|
+
var N = class {
|
|
175
|
+
h() {
|
|
176
|
+
return new Uint8Array(D(this) || 0);
|
|
177
|
+
}
|
|
178
|
+
constructor(t2, e2) {
|
|
179
|
+
if (j(e2), this.g = t2, null != t2 && 0 === t2.length) throw Error("ByteString should be constructed with non-empty values");
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
var B;
|
|
183
|
+
var G;
|
|
184
|
+
function j(t2) {
|
|
185
|
+
if (t2 !== C) throw Error("illegal external caller");
|
|
186
|
+
}
|
|
187
|
+
function V(t2, e2) {
|
|
188
|
+
t2.__closure__error__context__984382 || (t2.__closure__error__context__984382 = {}), t2.__closure__error__context__984382.severity = e2;
|
|
189
|
+
}
|
|
190
|
+
function X(t2) {
|
|
191
|
+
return V(t2 = Error(t2), "warning"), t2;
|
|
192
|
+
}
|
|
193
|
+
var H = "function" == typeof Symbol && "symbol" == typeof Symbol();
|
|
194
|
+
var W = /* @__PURE__ */ new Set();
|
|
195
|
+
function z(t2, e2, n2 = false, r2 = false) {
|
|
196
|
+
return t2 = "function" == typeof Symbol && "symbol" == typeof Symbol() ? r2 && Symbol.for && t2 ? Symbol.for(t2) : null != t2 ? Symbol(t2) : Symbol() : e2, n2 && W.add(t2), t2;
|
|
197
|
+
}
|
|
198
|
+
var K = z("jas", void 0, true, true);
|
|
199
|
+
var Y = z(void 0, "0di");
|
|
200
|
+
var $ = z(void 0, "2ex");
|
|
201
|
+
var q = z(void 0, "1oa", true);
|
|
202
|
+
var J = z(void 0, Symbol(), true);
|
|
203
|
+
var Z = H ? K : "Ga";
|
|
204
|
+
var Q = { Ga: { value: 0, configurable: true, writable: true, enumerable: false } };
|
|
205
|
+
var tt = Object.defineProperties;
|
|
206
|
+
function et(t2, e2) {
|
|
207
|
+
H || Z in t2 || tt(t2, Q), t2[Z] |= e2;
|
|
208
|
+
}
|
|
209
|
+
function nt(t2, e2) {
|
|
210
|
+
H || Z in t2 || tt(t2, Q), t2[Z] = e2;
|
|
211
|
+
}
|
|
212
|
+
function rt(t2) {
|
|
213
|
+
return et(t2, 34), t2;
|
|
214
|
+
}
|
|
215
|
+
function it(t2, e2) {
|
|
216
|
+
nt(e2, -30975 & (0 | t2));
|
|
217
|
+
}
|
|
218
|
+
function st(t2, e2) {
|
|
219
|
+
nt(e2, -30941 & (34 | t2));
|
|
220
|
+
}
|
|
221
|
+
function ot() {
|
|
222
|
+
return "function" == typeof BigInt;
|
|
223
|
+
}
|
|
224
|
+
function at(t2) {
|
|
225
|
+
return Array.prototype.slice.call(t2);
|
|
226
|
+
}
|
|
227
|
+
var ct;
|
|
228
|
+
var ht = {};
|
|
229
|
+
var ut = {};
|
|
230
|
+
function lt(t2) {
|
|
231
|
+
return !(!t2 || "object" != typeof t2 || t2.Ia !== ut);
|
|
232
|
+
}
|
|
233
|
+
function dt(t2) {
|
|
234
|
+
return null !== t2 && "object" == typeof t2 && !Array.isArray(t2) && t2.constructor === Object;
|
|
235
|
+
}
|
|
236
|
+
function ft(t2, e2) {
|
|
237
|
+
if (null != t2) {
|
|
238
|
+
if ("string" == typeof t2) t2 = t2 ? new N(t2, C) : U();
|
|
239
|
+
else if (t2.constructor !== N) if (O(t2)) t2 = t2.length ? new N(new Uint8Array(t2), C) : U();
|
|
240
|
+
else {
|
|
241
|
+
if (!e2) throw Error();
|
|
242
|
+
t2 = void 0;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return t2;
|
|
246
|
+
}
|
|
247
|
+
function pt(t2) {
|
|
248
|
+
return !(!Array.isArray(t2) || t2.length) && !!(1 & (0 | t2[Z]));
|
|
249
|
+
}
|
|
250
|
+
var gt = [];
|
|
251
|
+
function mt(t2) {
|
|
252
|
+
if (2 & t2) throw Error();
|
|
253
|
+
}
|
|
254
|
+
nt(gt, 55), ct = Object.freeze(gt);
|
|
255
|
+
var yt = class _yt {
|
|
256
|
+
constructor(t2, e2, n2) {
|
|
257
|
+
this.l = 0, this.g = t2, this.h = e2, this.m = n2;
|
|
258
|
+
}
|
|
259
|
+
next() {
|
|
260
|
+
if (this.l < this.g.length) {
|
|
261
|
+
const t2 = this.g[this.l++];
|
|
262
|
+
return { done: false, value: this.h ? this.h.call(this.m, t2) : t2 };
|
|
263
|
+
}
|
|
264
|
+
return { done: true, value: void 0 };
|
|
265
|
+
}
|
|
266
|
+
[Symbol.iterator]() {
|
|
267
|
+
return new _yt(this.g, this.h, this.m);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
function _t(t2) {
|
|
271
|
+
return J ? t2[J] : void 0;
|
|
272
|
+
}
|
|
273
|
+
var vt = Object.freeze({});
|
|
274
|
+
function Et(t2) {
|
|
275
|
+
return t2.Qa = true, t2;
|
|
276
|
+
}
|
|
277
|
+
var wt = Et((t2) => "number" == typeof t2);
|
|
278
|
+
var Tt = Et((t2) => "string" == typeof t2);
|
|
279
|
+
var At = Et((t2) => "boolean" == typeof t2);
|
|
280
|
+
var bt = "function" == typeof t.BigInt && "bigint" == typeof t.BigInt(0);
|
|
281
|
+
var kt = Et((t2) => bt ? t2 >= xt && t2 <= Rt : "-" === t2[0] ? Ft(t2, St) : Ft(t2, Lt));
|
|
282
|
+
var St = Number.MIN_SAFE_INTEGER.toString();
|
|
283
|
+
var xt = bt ? BigInt(Number.MIN_SAFE_INTEGER) : void 0;
|
|
284
|
+
var Lt = Number.MAX_SAFE_INTEGER.toString();
|
|
285
|
+
var Rt = bt ? BigInt(Number.MAX_SAFE_INTEGER) : void 0;
|
|
286
|
+
function Ft(t2, e2) {
|
|
287
|
+
if (t2.length > e2.length) return false;
|
|
288
|
+
if (t2.length < e2.length || t2 === e2) return true;
|
|
289
|
+
for (let n2 = 0; n2 < t2.length; n2++) {
|
|
290
|
+
const r2 = t2[n2], i2 = e2[n2];
|
|
291
|
+
if (r2 > i2) return false;
|
|
292
|
+
if (r2 < i2) return true;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
var It = "function" == typeof Uint8Array.prototype.slice;
|
|
296
|
+
var Mt;
|
|
297
|
+
var Pt = 0;
|
|
298
|
+
var Ot = 0;
|
|
299
|
+
function Ct(t2) {
|
|
300
|
+
const e2 = t2 >>> 0;
|
|
301
|
+
Pt = e2, Ot = (t2 - e2) / 4294967296 >>> 0;
|
|
302
|
+
}
|
|
303
|
+
function Ut(t2) {
|
|
304
|
+
if (t2 < 0) {
|
|
305
|
+
Ct(-t2);
|
|
306
|
+
const [e2, n2] = Xt(Pt, Ot);
|
|
307
|
+
Pt = e2 >>> 0, Ot = n2 >>> 0;
|
|
308
|
+
} else Ct(t2);
|
|
309
|
+
}
|
|
310
|
+
function Dt(t2) {
|
|
311
|
+
const e2 = Mt || (Mt = new DataView(new ArrayBuffer(8)));
|
|
312
|
+
e2.setFloat32(0, +t2, true), Ot = 0, Pt = e2.getUint32(0, true);
|
|
313
|
+
}
|
|
314
|
+
function Nt(t2, e2) {
|
|
315
|
+
const n2 = 4294967296 * e2 + (t2 >>> 0);
|
|
316
|
+
return Number.isSafeInteger(n2) ? n2 : Gt(t2, e2);
|
|
317
|
+
}
|
|
318
|
+
function Bt(t2, e2) {
|
|
319
|
+
const n2 = 2147483648 & e2;
|
|
320
|
+
return n2 && (e2 = ~e2 >>> 0, 0 == (t2 = 1 + ~t2 >>> 0) && (e2 = e2 + 1 >>> 0)), "number" == typeof (t2 = Nt(t2, e2)) ? n2 ? -t2 : t2 : n2 ? "-" + t2 : t2;
|
|
321
|
+
}
|
|
322
|
+
function Gt(t2, e2) {
|
|
323
|
+
if (t2 >>>= 0, (e2 >>>= 0) <= 2097151) var n2 = "" + (4294967296 * e2 + t2);
|
|
324
|
+
else ot() ? n2 = "" + (BigInt(e2) << BigInt(32) | BigInt(t2)) : (t2 = (16777215 & t2) + 6777216 * (n2 = 16777215 & (t2 >>> 24 | e2 << 8)) + 6710656 * (e2 = e2 >> 16 & 65535), n2 += 8147497 * e2, e2 *= 2, t2 >= 1e7 && (n2 += t2 / 1e7 >>> 0, t2 %= 1e7), n2 >= 1e7 && (e2 += n2 / 1e7 >>> 0, n2 %= 1e7), n2 = e2 + jt(n2) + jt(t2));
|
|
325
|
+
return n2;
|
|
326
|
+
}
|
|
327
|
+
function jt(t2) {
|
|
328
|
+
return t2 = String(t2), "0000000".slice(t2.length) + t2;
|
|
329
|
+
}
|
|
330
|
+
function Vt(t2) {
|
|
331
|
+
if (t2.length < 16) Ut(Number(t2));
|
|
332
|
+
else if (ot()) t2 = BigInt(t2), Pt = Number(t2 & BigInt(4294967295)) >>> 0, Ot = Number(t2 >> BigInt(32) & BigInt(4294967295));
|
|
333
|
+
else {
|
|
334
|
+
const e2 = +("-" === t2[0]);
|
|
335
|
+
Ot = Pt = 0;
|
|
336
|
+
const n2 = t2.length;
|
|
337
|
+
for (let r2 = e2, i2 = (n2 - e2) % 6 + e2; i2 <= n2; r2 = i2, i2 += 6) {
|
|
338
|
+
const e3 = Number(t2.slice(r2, i2));
|
|
339
|
+
Ot *= 1e6, Pt = 1e6 * Pt + e3, Pt >= 4294967296 && (Ot += Math.trunc(Pt / 4294967296), Ot >>>= 0, Pt >>>= 0);
|
|
340
|
+
}
|
|
341
|
+
if (e2) {
|
|
342
|
+
const [t3, e3] = Xt(Pt, Ot);
|
|
343
|
+
Pt = t3, Ot = e3;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function Xt(t2, e2) {
|
|
348
|
+
return e2 = ~e2, t2 ? t2 = 1 + ~t2 : e2 += 1, [t2, e2];
|
|
349
|
+
}
|
|
350
|
+
var Ht = "function" == typeof BigInt ? BigInt.asIntN : void 0;
|
|
351
|
+
var Wt = "function" == typeof BigInt ? BigInt.asUintN : void 0;
|
|
352
|
+
var zt = Number.isSafeInteger;
|
|
353
|
+
var Kt = Number.isFinite;
|
|
354
|
+
var Yt = Math.trunc;
|
|
355
|
+
function $t(t2) {
|
|
356
|
+
return null == t2 || "number" == typeof t2 ? t2 : "NaN" === t2 || "Infinity" === t2 || "-Infinity" === t2 ? Number(t2) : void 0;
|
|
357
|
+
}
|
|
358
|
+
function qt(t2) {
|
|
359
|
+
return null == t2 || "boolean" == typeof t2 ? t2 : "number" == typeof t2 ? !!t2 : void 0;
|
|
360
|
+
}
|
|
361
|
+
var Jt = /^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;
|
|
362
|
+
function Zt(t2) {
|
|
363
|
+
switch (typeof t2) {
|
|
364
|
+
case "bigint":
|
|
365
|
+
return true;
|
|
366
|
+
case "number":
|
|
367
|
+
return Kt(t2);
|
|
368
|
+
case "string":
|
|
369
|
+
return Jt.test(t2);
|
|
370
|
+
default:
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
function Qt(t2) {
|
|
375
|
+
if (null == t2) return t2;
|
|
376
|
+
if ("string" == typeof t2 && t2) t2 = +t2;
|
|
377
|
+
else if ("number" != typeof t2) return;
|
|
378
|
+
return Kt(t2) ? 0 | t2 : void 0;
|
|
379
|
+
}
|
|
380
|
+
function te(t2) {
|
|
381
|
+
if (null == t2) return t2;
|
|
382
|
+
if ("string" == typeof t2 && t2) t2 = +t2;
|
|
383
|
+
else if ("number" != typeof t2) return;
|
|
384
|
+
return Kt(t2) ? t2 >>> 0 : void 0;
|
|
385
|
+
}
|
|
386
|
+
function ee(t2) {
|
|
387
|
+
if ("-" === t2[0]) return false;
|
|
388
|
+
const e2 = t2.length;
|
|
389
|
+
return e2 < 20 || 20 === e2 && Number(t2.substring(0, 6)) < 184467;
|
|
390
|
+
}
|
|
391
|
+
function ne(t2) {
|
|
392
|
+
return t2 = Yt(t2), zt(t2) || (Ut(t2), t2 = Bt(Pt, Ot)), t2;
|
|
393
|
+
}
|
|
394
|
+
function re(t2) {
|
|
395
|
+
var e2 = Yt(Number(t2));
|
|
396
|
+
if (zt(e2)) return String(e2);
|
|
397
|
+
if (-1 !== (e2 = t2.indexOf(".")) && (t2 = t2.substring(0, e2)), e2 = t2.length, !("-" === t2[0] ? e2 < 20 || 20 === e2 && Number(t2.substring(0, 7)) > -922337 : e2 < 19 || 19 === e2 && Number(t2.substring(0, 6)) < 922337)) if (Vt(t2), t2 = Pt, 2147483648 & (e2 = Ot)) if (ot()) t2 = "" + (BigInt(0 | e2) << BigInt(32) | BigInt(t2 >>> 0));
|
|
398
|
+
else {
|
|
399
|
+
const [n2, r2] = Xt(t2, e2);
|
|
400
|
+
t2 = "-" + Gt(n2, r2);
|
|
401
|
+
}
|
|
402
|
+
else t2 = Gt(t2, e2);
|
|
403
|
+
return t2;
|
|
404
|
+
}
|
|
405
|
+
function ie(t2) {
|
|
406
|
+
return null == t2 ? t2 : "bigint" == typeof t2 ? (kt(t2) ? t2 = Number(t2) : (t2 = Ht(64, t2), t2 = kt(t2) ? Number(t2) : String(t2)), t2) : Zt(t2) ? "number" == typeof t2 ? ne(t2) : re(t2) : void 0;
|
|
407
|
+
}
|
|
408
|
+
function se(t2) {
|
|
409
|
+
if (null == t2) return t2;
|
|
410
|
+
var e2 = typeof t2;
|
|
411
|
+
if ("bigint" === e2) return String(Wt(64, t2));
|
|
412
|
+
if (Zt(t2)) {
|
|
413
|
+
if ("string" === e2) return e2 = Yt(Number(t2)), zt(e2) && e2 >= 0 ? t2 = String(e2) : (-1 !== (e2 = t2.indexOf(".")) && (t2 = t2.substring(0, e2)), ee(t2) || (Vt(t2), t2 = Gt(Pt, Ot))), t2;
|
|
414
|
+
if ("number" === e2) return (t2 = Yt(t2)) >= 0 && zt(t2) ? t2 : function(t3) {
|
|
415
|
+
if (t3 < 0) {
|
|
416
|
+
Ut(t3);
|
|
417
|
+
var e3 = Gt(Pt, Ot);
|
|
418
|
+
return t3 = Number(e3), zt(t3) ? t3 : e3;
|
|
419
|
+
}
|
|
420
|
+
return ee(e3 = String(t3)) ? e3 : (Ut(t3), Nt(Pt, Ot));
|
|
421
|
+
}(t2);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
function oe(t2) {
|
|
425
|
+
if ("string" != typeof t2) throw Error();
|
|
426
|
+
return t2;
|
|
427
|
+
}
|
|
428
|
+
function ae(t2) {
|
|
429
|
+
if (null != t2 && "string" != typeof t2) throw Error();
|
|
430
|
+
return t2;
|
|
431
|
+
}
|
|
432
|
+
function ce(t2) {
|
|
433
|
+
return null == t2 || "string" == typeof t2 ? t2 : void 0;
|
|
434
|
+
}
|
|
435
|
+
function he(t2, e2, n2, r2) {
|
|
436
|
+
if (null != t2 && "object" == typeof t2 && t2.W === ht) return t2;
|
|
437
|
+
if (!Array.isArray(t2)) return n2 ? 2 & r2 ? ((t2 = e2[Y]) || (rt((t2 = new e2()).u), t2 = e2[Y] = t2), e2 = t2) : e2 = new e2() : e2 = void 0, e2;
|
|
438
|
+
let i2 = n2 = 0 | t2[Z];
|
|
439
|
+
return 0 === i2 && (i2 |= 32 & r2), i2 |= 2 & r2, i2 !== n2 && nt(t2, i2), new e2(t2);
|
|
440
|
+
}
|
|
441
|
+
function ue(t2, e2, n2) {
|
|
442
|
+
if (e2) t: {
|
|
443
|
+
if (!Zt(e2 = t2)) throw X("int64");
|
|
444
|
+
switch (typeof e2) {
|
|
445
|
+
case "string":
|
|
446
|
+
e2 = re(e2);
|
|
447
|
+
break t;
|
|
448
|
+
case "bigint":
|
|
449
|
+
if (t2 = e2 = Ht(64, e2), Tt(t2)) {
|
|
450
|
+
if (!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t2)) throw Error(String(t2));
|
|
451
|
+
} else if (wt(t2) && !Number.isSafeInteger(t2)) throw Error(String(t2));
|
|
452
|
+
e2 = bt ? BigInt(e2) : At(e2) ? e2 ? "1" : "0" : Tt(e2) ? e2.trim() || "0" : String(e2);
|
|
453
|
+
break t;
|
|
454
|
+
default:
|
|
455
|
+
e2 = ne(e2);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
else e2 = ie(t2);
|
|
459
|
+
return "string" == typeof (n2 = null == (t2 = e2) ? n2 ? 0 : void 0 : t2) && zt(e2 = +n2) ? e2 : n2;
|
|
460
|
+
}
|
|
461
|
+
var le = {};
|
|
462
|
+
var de = function() {
|
|
463
|
+
try {
|
|
464
|
+
return w(new class extends Map {
|
|
465
|
+
constructor() {
|
|
466
|
+
super();
|
|
467
|
+
}
|
|
468
|
+
}()), false;
|
|
469
|
+
} catch {
|
|
470
|
+
return true;
|
|
471
|
+
}
|
|
472
|
+
}();
|
|
473
|
+
var fe = class {
|
|
474
|
+
constructor() {
|
|
475
|
+
this.g = /* @__PURE__ */ new Map();
|
|
476
|
+
}
|
|
477
|
+
get(t2) {
|
|
478
|
+
return this.g.get(t2);
|
|
479
|
+
}
|
|
480
|
+
set(t2, e2) {
|
|
481
|
+
return this.g.set(t2, e2), this.size = this.g.size, this;
|
|
482
|
+
}
|
|
483
|
+
delete(t2) {
|
|
484
|
+
return t2 = this.g.delete(t2), this.size = this.g.size, t2;
|
|
485
|
+
}
|
|
486
|
+
clear() {
|
|
487
|
+
this.g.clear(), this.size = this.g.size;
|
|
488
|
+
}
|
|
489
|
+
has(t2) {
|
|
490
|
+
return this.g.has(t2);
|
|
491
|
+
}
|
|
492
|
+
entries() {
|
|
493
|
+
return this.g.entries();
|
|
494
|
+
}
|
|
495
|
+
keys() {
|
|
496
|
+
return this.g.keys();
|
|
497
|
+
}
|
|
498
|
+
values() {
|
|
499
|
+
return this.g.values();
|
|
500
|
+
}
|
|
501
|
+
forEach(t2, e2) {
|
|
502
|
+
return this.g.forEach(t2, e2);
|
|
503
|
+
}
|
|
504
|
+
[Symbol.iterator]() {
|
|
505
|
+
return this.entries();
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
var pe = de ? (Object.setPrototypeOf(fe.prototype, Map.prototype), Object.defineProperties(fe.prototype, { size: { value: 0, configurable: true, enumerable: true, writable: true } }), fe) : class extends Map {
|
|
509
|
+
constructor() {
|
|
510
|
+
super();
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
function ge(t2) {
|
|
514
|
+
return t2;
|
|
515
|
+
}
|
|
516
|
+
function me(t2) {
|
|
517
|
+
if (2 & t2.L) throw Error("Cannot mutate an immutable Map");
|
|
518
|
+
}
|
|
519
|
+
var ye = class extends pe {
|
|
520
|
+
constructor(t2, e2, n2 = ge, r2 = ge) {
|
|
521
|
+
super();
|
|
522
|
+
let i2 = 0 | t2[Z];
|
|
523
|
+
i2 |= 64, nt(t2, i2), this.L = i2, this.S = e2, this.R = n2, this.Y = this.S ? _e : r2;
|
|
524
|
+
for (let s2 = 0; s2 < t2.length; s2++) {
|
|
525
|
+
const o2 = t2[s2], a2 = n2(o2[0], false, true);
|
|
526
|
+
let c2 = o2[1];
|
|
527
|
+
e2 ? void 0 === c2 && (c2 = null) : c2 = r2(o2[1], false, true, void 0, void 0, i2), super.set(a2, c2);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
na(t2 = ve) {
|
|
531
|
+
if (0 !== this.size) return this.X(t2);
|
|
532
|
+
}
|
|
533
|
+
X(t2 = ve) {
|
|
534
|
+
const e2 = [], n2 = super.entries();
|
|
535
|
+
for (var r2; !(r2 = n2.next()).done; ) (r2 = r2.value)[0] = t2(r2[0]), r2[1] = t2(r2[1]), e2.push(r2);
|
|
536
|
+
return e2;
|
|
537
|
+
}
|
|
538
|
+
clear() {
|
|
539
|
+
me(this), super.clear();
|
|
540
|
+
}
|
|
541
|
+
delete(t2) {
|
|
542
|
+
return me(this), super.delete(this.R(t2, true, false));
|
|
543
|
+
}
|
|
544
|
+
entries() {
|
|
545
|
+
var t2 = this.ma();
|
|
546
|
+
return new yt(t2, Ee, this);
|
|
547
|
+
}
|
|
548
|
+
keys() {
|
|
549
|
+
return this.Ha();
|
|
550
|
+
}
|
|
551
|
+
values() {
|
|
552
|
+
var t2 = this.ma();
|
|
553
|
+
return new yt(t2, ye.prototype.get, this);
|
|
554
|
+
}
|
|
555
|
+
forEach(t2, e2) {
|
|
556
|
+
super.forEach((n2, r2) => {
|
|
557
|
+
t2.call(e2, this.get(r2), r2, this);
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
set(t2, e2) {
|
|
561
|
+
return me(this), null == (t2 = this.R(t2, true, false)) ? this : null == e2 ? (super.delete(t2), this) : super.set(t2, this.Y(e2, true, true, this.S, false, this.L));
|
|
562
|
+
}
|
|
563
|
+
Na(t2) {
|
|
564
|
+
const e2 = this.R(t2[0], false, true);
|
|
565
|
+
t2 = t2[1], t2 = this.S ? void 0 === t2 ? null : t2 : this.Y(t2, false, true, void 0, false, this.L), super.set(e2, t2);
|
|
566
|
+
}
|
|
567
|
+
has(t2) {
|
|
568
|
+
return super.has(this.R(t2, false, false));
|
|
569
|
+
}
|
|
570
|
+
get(t2) {
|
|
571
|
+
t2 = this.R(t2, false, false);
|
|
572
|
+
const e2 = super.get(t2);
|
|
573
|
+
if (void 0 !== e2) {
|
|
574
|
+
var n2 = this.S;
|
|
575
|
+
return n2 ? ((n2 = this.Y(e2, false, true, n2, this.ra, this.L)) !== e2 && super.set(t2, n2), n2) : e2;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
ma() {
|
|
579
|
+
return Array.from(super.keys());
|
|
580
|
+
}
|
|
581
|
+
Ha() {
|
|
582
|
+
return super.keys();
|
|
583
|
+
}
|
|
584
|
+
[Symbol.iterator]() {
|
|
585
|
+
return this.entries();
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
function _e(t2, e2, n2, r2, i2, s2) {
|
|
589
|
+
return t2 = he(t2, r2, n2, s2), i2 && (t2 = Oe(t2)), t2;
|
|
590
|
+
}
|
|
591
|
+
function ve(t2) {
|
|
592
|
+
return t2;
|
|
593
|
+
}
|
|
594
|
+
function Ee(t2) {
|
|
595
|
+
return [t2, this.get(t2)];
|
|
596
|
+
}
|
|
597
|
+
var we;
|
|
598
|
+
var Te;
|
|
599
|
+
var Ae;
|
|
600
|
+
function be() {
|
|
601
|
+
return we || (we = new ye(rt([]), void 0, void 0, void 0, le));
|
|
602
|
+
}
|
|
603
|
+
function ke(t2, e2, n2, r2, i2) {
|
|
604
|
+
if (null != t2) {
|
|
605
|
+
if (Array.isArray(t2)) t2 = pt(t2) ? void 0 : i2 && 2 & (0 | t2[Z]) ? t2 : Se(t2, e2, n2, void 0 !== r2, i2);
|
|
606
|
+
else if (dt(t2)) {
|
|
607
|
+
const s2 = {};
|
|
608
|
+
for (let o2 in t2) s2[o2] = ke(t2[o2], e2, n2, r2, i2);
|
|
609
|
+
t2 = s2;
|
|
610
|
+
} else t2 = e2(t2, r2);
|
|
611
|
+
return t2;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
function Se(t2, e2, n2, r2, i2) {
|
|
615
|
+
const s2 = r2 || n2 ? 0 | t2[Z] : 0, o2 = r2 ? !!(32 & s2) : void 0;
|
|
616
|
+
r2 = at(t2);
|
|
617
|
+
for (let t3 = 0; t3 < r2.length; t3++) r2[t3] = ke(r2[t3], e2, n2, o2, i2);
|
|
618
|
+
return n2 && ((t2 = _t(t2)) && (r2[J] = at(t2)), n2(s2, r2)), r2;
|
|
619
|
+
}
|
|
620
|
+
function xe(t2) {
|
|
621
|
+
return ke(t2, Le, void 0, void 0, false);
|
|
622
|
+
}
|
|
623
|
+
function Le(t2) {
|
|
624
|
+
return t2.W === ht ? t2.toJSON() : t2 instanceof ye ? t2.na(xe) : function(t3) {
|
|
625
|
+
switch (typeof t3) {
|
|
626
|
+
case "number":
|
|
627
|
+
return isFinite(t3) ? t3 : String(t3);
|
|
628
|
+
case "bigint":
|
|
629
|
+
return kt(t3) ? Number(t3) : String(t3);
|
|
630
|
+
case "boolean":
|
|
631
|
+
return t3 ? 1 : 0;
|
|
632
|
+
case "object":
|
|
633
|
+
if (t3) if (Array.isArray(t3)) {
|
|
634
|
+
if (pt(t3)) return;
|
|
635
|
+
} else {
|
|
636
|
+
if (O(t3)) return R(t3);
|
|
637
|
+
if (t3 instanceof N) {
|
|
638
|
+
const e2 = t3.g;
|
|
639
|
+
return null == e2 ? "" : "string" == typeof e2 ? e2 : t3.g = R(e2);
|
|
640
|
+
}
|
|
641
|
+
if (t3 instanceof ye) return t3.na();
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
return t3;
|
|
645
|
+
}(t2);
|
|
646
|
+
}
|
|
647
|
+
function Re(t2) {
|
|
648
|
+
return Se(t2, Le, void 0, void 0, false);
|
|
649
|
+
}
|
|
650
|
+
function Fe(t2, e2, n2) {
|
|
651
|
+
return t2 = Ie(t2, e2[0], e2[1], n2 ? 1 : 2), e2 !== Te && n2 && et(t2, 16384), t2;
|
|
652
|
+
}
|
|
653
|
+
function Ie(t2, e2, n2, r2) {
|
|
654
|
+
if (null == t2) {
|
|
655
|
+
var i2 = 96;
|
|
656
|
+
n2 ? (t2 = [n2], i2 |= 512) : t2 = [], e2 && (i2 = -33521665 & i2 | (1023 & e2) << 15);
|
|
657
|
+
} else {
|
|
658
|
+
if (!Array.isArray(t2)) throw Error("narr");
|
|
659
|
+
if (2048 & (i2 = 0 | t2[Z])) throw Error("farr");
|
|
660
|
+
if (64 & i2) return t2;
|
|
661
|
+
if (1 === r2 || 2 === r2 || (i2 |= 64), n2 && (i2 |= 512, n2 !== t2[0])) throw Error("mid");
|
|
662
|
+
t: {
|
|
663
|
+
if (r2 = (n2 = t2).length) {
|
|
664
|
+
const t3 = r2 - 1;
|
|
665
|
+
if (dt(n2[t3])) {
|
|
666
|
+
if ((e2 = t3 - (512 & (i2 |= 256) ? 0 : -1)) >= 1024) throw Error("pvtlmt");
|
|
667
|
+
i2 = -33521665 & i2 | (1023 & e2) << 15;
|
|
668
|
+
break t;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
if (e2) {
|
|
672
|
+
if ((e2 = Math.max(e2, r2 - (512 & i2 ? 0 : -1))) > 1024) throw Error("spvt");
|
|
673
|
+
i2 = -33521665 & i2 | (1023 & e2) << 15;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
return nt(t2, i2), t2;
|
|
678
|
+
}
|
|
679
|
+
function Me(t2, e2, n2 = st) {
|
|
680
|
+
if (null != t2) {
|
|
681
|
+
if (x && t2 instanceof Uint8Array) return e2 ? t2 : new Uint8Array(t2);
|
|
682
|
+
if (Array.isArray(t2)) {
|
|
683
|
+
var r2 = 0 | t2[Z];
|
|
684
|
+
return 2 & r2 ? t2 : (e2 && (e2 = 0 === r2 || !!(32 & r2) && !(64 & r2 || !(16 & r2))), e2 ? (nt(t2, -12293 & (34 | r2)), t2) : Se(t2, Me, 4 & r2 ? st : n2, true, true));
|
|
685
|
+
}
|
|
686
|
+
return t2.W === ht ? t2 = 2 & (r2 = 0 | (n2 = t2.u)[Z]) ? t2 : new t2.constructor(Pe(n2, r2, true)) : t2 instanceof ye && !(2 & t2.L) && (n2 = rt(t2.X(Me)), t2 = new ye(n2, t2.S, t2.R, t2.Y)), t2;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
function Pe(t2, e2, n2) {
|
|
690
|
+
const r2 = n2 || 2 & e2 ? st : it, i2 = !!(32 & e2);
|
|
691
|
+
return t2 = function(t3, e3, n3) {
|
|
692
|
+
const r3 = at(t3);
|
|
693
|
+
var i3 = r3.length;
|
|
694
|
+
const s2 = 256 & e3 ? r3[i3 - 1] : void 0;
|
|
695
|
+
for (i3 += s2 ? -1 : 0, e3 = 512 & e3 ? 1 : 0; e3 < i3; e3++) r3[e3] = n3(r3[e3]);
|
|
696
|
+
if (s2) {
|
|
697
|
+
e3 = r3[e3] = {};
|
|
698
|
+
for (const t4 in s2) e3[t4] = n3(s2[t4]);
|
|
699
|
+
}
|
|
700
|
+
return (t3 = _t(t3)) && (r3[J] = at(t3)), r3;
|
|
701
|
+
}(t2, e2, (t3) => Me(t3, i2, r2)), et(t2, 32 | (n2 ? 2 : 0)), t2;
|
|
702
|
+
}
|
|
703
|
+
function Oe(t2) {
|
|
704
|
+
const e2 = t2.u, n2 = 0 | e2[Z];
|
|
705
|
+
return 2 & n2 ? new t2.constructor(Pe(e2, n2, false)) : t2;
|
|
706
|
+
}
|
|
707
|
+
function Ce(t2, e2) {
|
|
708
|
+
return Ue(t2 = t2.u, 0 | t2[Z], e2);
|
|
709
|
+
}
|
|
710
|
+
function Ue(e2, n2, r2, i2) {
|
|
711
|
+
if (-1 === r2) return null;
|
|
712
|
+
var s2 = r2 + (512 & n2 ? 0 : -1);
|
|
713
|
+
const o2 = e2.length - 1;
|
|
714
|
+
return s2 >= o2 && 256 & n2 ? e2[o2][r2] : i2 && 256 & n2 && null != (n2 = e2[o2][r2]) ? (null != e2[s2] && null != $ && ((s2 = (e2 = G ?? (G = {}))[$] || 0) >= 4 || (e2[$] = s2 + 1, V(e2 = Error(), "incident"), function(e3) {
|
|
715
|
+
t.setTimeout(() => {
|
|
716
|
+
throw e3;
|
|
717
|
+
}, 0);
|
|
718
|
+
}(e2))), n2) : s2 <= o2 ? e2[s2] : void 0;
|
|
719
|
+
}
|
|
720
|
+
function De(t2, e2, n2) {
|
|
721
|
+
const r2 = t2.u;
|
|
722
|
+
let i2 = 0 | r2[Z];
|
|
723
|
+
return mt(i2), Ne(r2, i2, e2, n2), t2;
|
|
724
|
+
}
|
|
725
|
+
function Ne(t2, e2, n2, r2) {
|
|
726
|
+
const i2 = 512 & e2 ? 0 : -1, s2 = n2 + i2;
|
|
727
|
+
var o2 = t2.length - 1;
|
|
728
|
+
return s2 >= o2 && 256 & e2 ? (t2[o2][n2] = r2, e2) : s2 <= o2 ? (t2[s2] = r2, 256 & e2 && (n2 in (t2 = t2[o2]) && delete t2[n2]), e2) : (void 0 !== r2 && (n2 >= (o2 = e2 >> 15 & 1023 || 536870912) ? null != r2 && (t2[o2 + i2] = { [n2]: r2 }, nt(t2, e2 |= 256)) : t2[s2] = r2), e2);
|
|
729
|
+
}
|
|
730
|
+
function Be(t2, e2) {
|
|
731
|
+
let n2 = 0 | (t2 = t2.u)[Z];
|
|
732
|
+
const r2 = Ue(t2, n2, e2), i2 = $t(r2);
|
|
733
|
+
return null != i2 && i2 !== r2 && Ne(t2, n2, e2, i2), i2;
|
|
734
|
+
}
|
|
735
|
+
function Ge(t2) {
|
|
736
|
+
let e2 = 0 | (t2 = t2.u)[Z];
|
|
737
|
+
const n2 = Ue(t2, e2, 1), r2 = ft(n2, true);
|
|
738
|
+
return null != r2 && r2 !== n2 && Ne(t2, e2, 1, r2), r2;
|
|
739
|
+
}
|
|
740
|
+
function je() {
|
|
741
|
+
return void 0 === vt ? 2 : 4;
|
|
742
|
+
}
|
|
743
|
+
function Ve(t2, e2, n2, r2, i2) {
|
|
744
|
+
const s2 = t2.u, o2 = 2 & (t2 = 0 | s2[Z]) ? 1 : r2;
|
|
745
|
+
i2 = !!i2;
|
|
746
|
+
let a2 = 0 | (r2 = Xe(s2, t2, e2))[Z];
|
|
747
|
+
if (!(4 & a2)) {
|
|
748
|
+
4 & a2 && (r2 = at(r2), a2 = an(a2, t2), t2 = Ne(s2, t2, e2, r2));
|
|
749
|
+
let i3 = 0, o3 = 0;
|
|
750
|
+
for (; i3 < r2.length; i3++) {
|
|
751
|
+
const t3 = n2(r2[i3]);
|
|
752
|
+
null != t3 && (r2[o3++] = t3);
|
|
753
|
+
}
|
|
754
|
+
o3 < i3 && (r2.length = o3), a2 = He(a2, t2), n2 = -4097 & (20 | a2), a2 = n2 &= -8193, nt(r2, a2), 2 & a2 && Object.freeze(r2);
|
|
755
|
+
}
|
|
756
|
+
return 1 === o2 || 4 === o2 && 32 & a2 ? We(a2) || (i2 = a2, a2 |= 2, a2 !== i2 && nt(r2, a2), Object.freeze(r2)) : (2 === o2 && We(a2) && (r2 = at(r2), a2 = an(a2, t2), a2 = cn(a2, t2, i2), nt(r2, a2), t2 = Ne(s2, t2, e2, r2)), We(a2) || (e2 = a2, a2 = cn(a2, t2, i2), a2 !== e2 && nt(r2, a2))), r2;
|
|
757
|
+
}
|
|
758
|
+
function Xe(t2, e2, n2, r2) {
|
|
759
|
+
return t2 = Ue(t2, e2, n2, r2), Array.isArray(t2) ? t2 : ct;
|
|
760
|
+
}
|
|
761
|
+
function He(t2, e2) {
|
|
762
|
+
return 0 === t2 && (t2 = an(t2, e2)), 1 | t2;
|
|
763
|
+
}
|
|
764
|
+
function We(t2) {
|
|
765
|
+
return !!(2 & t2) && !!(4 & t2) || !!(2048 & t2);
|
|
766
|
+
}
|
|
767
|
+
function ze(t2) {
|
|
768
|
+
t2 = at(t2);
|
|
769
|
+
for (let e2 = 0; e2 < t2.length; e2++) {
|
|
770
|
+
const n2 = t2[e2] = at(t2[e2]);
|
|
771
|
+
Array.isArray(n2[1]) && (n2[1] = rt(n2[1]));
|
|
772
|
+
}
|
|
773
|
+
return t2;
|
|
774
|
+
}
|
|
775
|
+
function Ke(t2, e2, n2, r2) {
|
|
776
|
+
let i2 = 0 | (t2 = t2.u)[Z];
|
|
777
|
+
mt(i2), Ne(t2, i2, e2, ("0" === r2 ? 0 === Number(n2) : n2 === r2) ? void 0 : n2);
|
|
778
|
+
}
|
|
779
|
+
function Ye(t2, e2, n2, r2, i2) {
|
|
780
|
+
mt(e2);
|
|
781
|
+
var s2 = !(!(64 & e2) && 16384 & e2);
|
|
782
|
+
const o2 = (i2 = Xe(t2, e2, n2, i2)) !== ct;
|
|
783
|
+
if (s2 || !o2) {
|
|
784
|
+
let a2 = s2 = o2 ? 0 | i2[Z] : 0;
|
|
785
|
+
(!o2 || 2 & a2 || We(a2) || 4 & a2 && !(32 & a2)) && (i2 = at(i2), a2 = an(a2, e2), e2 = Ne(t2, e2, n2, i2)), a2 = -13 & He(a2, e2), a2 = cn(r2 ? -17 & a2 : 16 | a2, e2, true), a2 !== s2 && nt(i2, a2);
|
|
786
|
+
}
|
|
787
|
+
return i2;
|
|
788
|
+
}
|
|
789
|
+
function $e(t2, e2) {
|
|
790
|
+
var n2 = vs;
|
|
791
|
+
return Ze(qe(t2 = t2.u), t2, 0 | t2[Z], n2) === e2 ? e2 : -1;
|
|
792
|
+
}
|
|
793
|
+
function qe(t2) {
|
|
794
|
+
if (H) return t2[q] ?? (t2[q] = /* @__PURE__ */ new Map());
|
|
795
|
+
if (q in t2) return t2[q];
|
|
796
|
+
const e2 = /* @__PURE__ */ new Map();
|
|
797
|
+
return Object.defineProperty(t2, q, { value: e2 }), e2;
|
|
798
|
+
}
|
|
799
|
+
function Je(t2, e2, n2, r2) {
|
|
800
|
+
const i2 = qe(t2), s2 = Ze(i2, t2, e2, n2);
|
|
801
|
+
return s2 !== r2 && (s2 && (e2 = Ne(t2, e2, s2)), i2.set(n2, r2)), e2;
|
|
802
|
+
}
|
|
803
|
+
function Ze(t2, e2, n2, r2) {
|
|
804
|
+
let i2 = t2.get(r2);
|
|
805
|
+
if (null != i2) return i2;
|
|
806
|
+
i2 = 0;
|
|
807
|
+
for (let t3 = 0; t3 < r2.length; t3++) {
|
|
808
|
+
const s2 = r2[t3];
|
|
809
|
+
null != Ue(e2, n2, s2) && (0 !== i2 && (n2 = Ne(e2, n2, i2)), i2 = s2);
|
|
810
|
+
}
|
|
811
|
+
return t2.set(r2, i2), i2;
|
|
812
|
+
}
|
|
813
|
+
function Qe(t2, e2, n2, r2) {
|
|
814
|
+
let i2, s2 = 0 | t2[Z];
|
|
815
|
+
if (null != (r2 = Ue(t2, s2, n2, r2)) && r2.W === ht) return (e2 = Oe(r2)) !== r2 && Ne(t2, s2, n2, e2), e2.u;
|
|
816
|
+
if (Array.isArray(r2)) {
|
|
817
|
+
const t3 = 0 | r2[Z];
|
|
818
|
+
i2 = 2 & t3 ? Fe(Pe(r2, t3, false), e2, true) : 64 & t3 ? r2 : Fe(i2, e2, true);
|
|
819
|
+
} else i2 = Fe(void 0, e2, true);
|
|
820
|
+
return i2 !== r2 && Ne(t2, s2, n2, i2), i2;
|
|
821
|
+
}
|
|
822
|
+
function tn(t2, e2, n2, r2) {
|
|
823
|
+
let i2 = 0 | (t2 = t2.u)[Z];
|
|
824
|
+
return (e2 = he(r2 = Ue(t2, i2, n2, r2), e2, false, i2)) !== r2 && null != e2 && Ne(t2, i2, n2, e2), e2;
|
|
825
|
+
}
|
|
826
|
+
function en(t2, e2, n2, r2 = false) {
|
|
827
|
+
if (null == (e2 = tn(t2, e2, n2, r2))) return e2;
|
|
828
|
+
if (!(2 & (r2 = 0 | (t2 = t2.u)[Z]))) {
|
|
829
|
+
const i2 = Oe(e2);
|
|
830
|
+
i2 !== e2 && Ne(t2, r2, n2, e2 = i2);
|
|
831
|
+
}
|
|
832
|
+
return e2;
|
|
833
|
+
}
|
|
834
|
+
function nn(t2, e2, n2, r2, i2, s2, o2) {
|
|
835
|
+
t2 = t2.u;
|
|
836
|
+
var a2 = !!(2 & e2);
|
|
837
|
+
const c2 = a2 ? 1 : i2;
|
|
838
|
+
s2 = !!s2, o2 && (o2 = !a2);
|
|
839
|
+
var h2 = 0 | (i2 = Xe(t2, e2, r2))[Z];
|
|
840
|
+
if (!(a2 = !!(4 & h2))) {
|
|
841
|
+
var u2 = i2, l = e2;
|
|
842
|
+
const t3 = !!(2 & (h2 = He(h2, e2)));
|
|
843
|
+
t3 && (l |= 2);
|
|
844
|
+
let r3 = !t3, s3 = true, o3 = 0, a3 = 0;
|
|
845
|
+
for (; o3 < u2.length; o3++) {
|
|
846
|
+
const e3 = he(u2[o3], n2, false, l);
|
|
847
|
+
if (e3 instanceof n2) {
|
|
848
|
+
if (!t3) {
|
|
849
|
+
const t4 = !!(2 & (0 | e3.u[Z]));
|
|
850
|
+
r3 && (r3 = !t4), s3 && (s3 = t4);
|
|
851
|
+
}
|
|
852
|
+
u2[a3++] = e3;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
a3 < o3 && (u2.length = a3), h2 |= 4, h2 = s3 ? 16 | h2 : -17 & h2, nt(u2, h2 = r3 ? 8 | h2 : -9 & h2), t3 && Object.freeze(u2);
|
|
856
|
+
}
|
|
857
|
+
if (o2 && !(8 & h2 || !i2.length && (1 === c2 || 4 === c2 && 32 & h2))) {
|
|
858
|
+
for (We(h2) && (i2 = at(i2), h2 = an(h2, e2), e2 = Ne(t2, e2, r2, i2)), n2 = i2, o2 = h2, u2 = 0; u2 < n2.length; u2++) (h2 = n2[u2]) !== (l = Oe(h2)) && (n2[u2] = l);
|
|
859
|
+
o2 |= 8, nt(n2, o2 = n2.length ? -17 & o2 : 16 | o2), h2 = o2;
|
|
860
|
+
}
|
|
861
|
+
return 1 === c2 || 4 === c2 && 32 & h2 ? We(h2) || (e2 = h2, (h2 |= !i2.length || 16 & h2 && (!a2 || 32 & h2) ? 2 : 2048) !== e2 && nt(i2, h2), Object.freeze(i2)) : (2 === c2 && We(h2) && (nt(i2 = at(i2), h2 = cn(h2 = an(h2, e2), e2, s2)), e2 = Ne(t2, e2, r2, i2)), We(h2) || (r2 = h2, (h2 = cn(h2, e2, s2)) !== r2 && nt(i2, h2))), i2;
|
|
862
|
+
}
|
|
863
|
+
function rn(t2, e2, n2) {
|
|
864
|
+
const r2 = 0 | t2.u[Z];
|
|
865
|
+
return nn(t2, r2, e2, n2, je(), false, !(2 & r2));
|
|
866
|
+
}
|
|
867
|
+
function sn(t2, e2, n2, r2) {
|
|
868
|
+
return null == r2 && (r2 = void 0), De(t2, n2, r2);
|
|
869
|
+
}
|
|
870
|
+
function on(t2, e2, n2, r2) {
|
|
871
|
+
null == r2 && (r2 = void 0);
|
|
872
|
+
t: {
|
|
873
|
+
let i2 = 0 | (t2 = t2.u)[Z];
|
|
874
|
+
if (mt(i2), null == r2) {
|
|
875
|
+
const r3 = qe(t2);
|
|
876
|
+
if (Ze(r3, t2, i2, n2) !== e2) break t;
|
|
877
|
+
r3.set(n2, 0);
|
|
878
|
+
} else i2 = Je(t2, i2, n2, e2);
|
|
879
|
+
Ne(t2, i2, e2, r2);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
function an(t2, e2) {
|
|
883
|
+
return -2049 & (t2 = 32 | (2 & e2 ? 2 | t2 : -3 & t2));
|
|
884
|
+
}
|
|
885
|
+
function cn(t2, e2, n2) {
|
|
886
|
+
return 32 & e2 && n2 || (t2 &= -33), t2;
|
|
887
|
+
}
|
|
888
|
+
function hn(t2, e2, n2, r2) {
|
|
889
|
+
const i2 = 0 | t2.u[Z];
|
|
890
|
+
mt(i2), t2 = nn(t2, i2, n2, e2, 2, true), r2 = null != r2 ? r2 : new n2(), t2.push(r2), t2[Z] = 2 & (0 | r2.u[Z]) ? -9 & t2[Z] : -17 & t2[Z];
|
|
891
|
+
}
|
|
892
|
+
function un(t2, e2) {
|
|
893
|
+
return Qt(Ce(t2, e2));
|
|
894
|
+
}
|
|
895
|
+
function ln(t2, e2) {
|
|
896
|
+
return ce(Ce(t2, e2));
|
|
897
|
+
}
|
|
898
|
+
function dn(t2, e2) {
|
|
899
|
+
return Be(t2, e2) ?? 0;
|
|
900
|
+
}
|
|
901
|
+
function fn(t2, e2, n2) {
|
|
902
|
+
if (null != n2 && "boolean" != typeof n2) throw t2 = typeof n2, Error(`Expected boolean but got ${"object" != t2 ? t2 : n2 ? Array.isArray(n2) ? "array" : t2 : "null"}: ${n2}`);
|
|
903
|
+
De(t2, e2, n2);
|
|
904
|
+
}
|
|
905
|
+
function pn(t2, e2, n2) {
|
|
906
|
+
if (null != n2) {
|
|
907
|
+
if ("number" != typeof n2) throw X("int32");
|
|
908
|
+
if (!Kt(n2)) throw X("int32");
|
|
909
|
+
n2 |= 0;
|
|
910
|
+
}
|
|
911
|
+
De(t2, e2, n2);
|
|
912
|
+
}
|
|
913
|
+
function gn(t2, e2, n2) {
|
|
914
|
+
if (null != n2 && "number" != typeof n2) throw Error(`Value of float/double field must be a number, found ${typeof n2}: ${n2}`);
|
|
915
|
+
De(t2, e2, n2);
|
|
916
|
+
}
|
|
917
|
+
function mn(t2, e2, n2) {
|
|
918
|
+
{
|
|
919
|
+
const o2 = t2.u;
|
|
920
|
+
let a2 = 0 | o2[Z];
|
|
921
|
+
if (mt(a2), null == n2) Ne(o2, a2, e2);
|
|
922
|
+
else {
|
|
923
|
+
var r2 = t2 = 0 | n2[Z], i2 = We(t2), s2 = i2 || Object.isFrozen(n2);
|
|
924
|
+
for (i2 || (t2 = 0), s2 || (n2 = at(n2), r2 = 0, t2 = cn(t2 = an(t2, a2), a2, true), s2 = false), t2 |= 21, i2 = 0; i2 < n2.length; i2++) {
|
|
925
|
+
const e3 = n2[i2], o3 = oe(e3);
|
|
926
|
+
Object.is(e3, o3) || (s2 && (n2 = at(n2), r2 = 0, t2 = cn(t2 = an(t2, a2), a2, true), s2 = false), n2[i2] = o3);
|
|
927
|
+
}
|
|
928
|
+
t2 !== r2 && (s2 && (n2 = at(n2), t2 = cn(t2 = an(t2, a2), a2, true)), nt(n2, t2)), Ne(o2, a2, e2, n2);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
function yn(t2, e2, n2) {
|
|
933
|
+
mt(0 | t2.u[Z]), Ve(t2, e2, ce, 2, true).push(oe(n2));
|
|
934
|
+
}
|
|
935
|
+
function _n(t2, e2) {
|
|
936
|
+
return Error(`Invalid wire type: ${t2} (at position ${e2})`);
|
|
937
|
+
}
|
|
938
|
+
function vn() {
|
|
939
|
+
return Error("Failed to read varint, encoding is invalid.");
|
|
940
|
+
}
|
|
941
|
+
function En(t2, e2) {
|
|
942
|
+
return Error(`Tried to read past the end of the data ${e2} > ${t2}`);
|
|
943
|
+
}
|
|
944
|
+
function wn(t2) {
|
|
945
|
+
if ("string" == typeof t2) return { buffer: P(t2), N: false };
|
|
946
|
+
if (Array.isArray(t2)) return { buffer: new Uint8Array(t2), N: false };
|
|
947
|
+
if (t2.constructor === Uint8Array) return { buffer: t2, N: false };
|
|
948
|
+
if (t2.constructor === ArrayBuffer) return { buffer: new Uint8Array(t2), N: false };
|
|
949
|
+
if (t2.constructor === N) return { buffer: D(t2) || new Uint8Array(0), N: true };
|
|
950
|
+
if (t2 instanceof Uint8Array) return { buffer: new Uint8Array(t2.buffer, t2.byteOffset, t2.byteLength), N: false };
|
|
951
|
+
throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers");
|
|
952
|
+
}
|
|
953
|
+
function Tn(t2, e2) {
|
|
954
|
+
let n2, r2 = 0, i2 = 0, s2 = 0;
|
|
955
|
+
const o2 = t2.h;
|
|
956
|
+
let a2 = t2.g;
|
|
957
|
+
do {
|
|
958
|
+
n2 = o2[a2++], r2 |= (127 & n2) << s2, s2 += 7;
|
|
959
|
+
} while (s2 < 32 && 128 & n2);
|
|
960
|
+
for (s2 > 32 && (i2 |= (127 & n2) >> 4), s2 = 3; s2 < 32 && 128 & n2; s2 += 7) n2 = o2[a2++], i2 |= (127 & n2) << s2;
|
|
961
|
+
if (Fn(t2, a2), n2 < 128) return e2(r2 >>> 0, i2 >>> 0);
|
|
962
|
+
throw vn();
|
|
963
|
+
}
|
|
964
|
+
function An(t2) {
|
|
965
|
+
let e2 = 0, n2 = t2.g;
|
|
966
|
+
const r2 = n2 + 10, i2 = t2.h;
|
|
967
|
+
for (; n2 < r2; ) {
|
|
968
|
+
const r3 = i2[n2++];
|
|
969
|
+
if (e2 |= r3, 0 == (128 & r3)) return Fn(t2, n2), !!(127 & e2);
|
|
970
|
+
}
|
|
971
|
+
throw vn();
|
|
972
|
+
}
|
|
973
|
+
function bn(t2) {
|
|
974
|
+
const e2 = t2.h;
|
|
975
|
+
let n2 = t2.g, r2 = e2[n2++], i2 = 127 & r2;
|
|
976
|
+
if (128 & r2 && (r2 = e2[n2++], i2 |= (127 & r2) << 7, 128 & r2 && (r2 = e2[n2++], i2 |= (127 & r2) << 14, 128 & r2 && (r2 = e2[n2++], i2 |= (127 & r2) << 21, 128 & r2 && (r2 = e2[n2++], i2 |= r2 << 28, 128 & r2 && 128 & e2[n2++] && 128 & e2[n2++] && 128 & e2[n2++] && 128 & e2[n2++] && 128 & e2[n2++]))))) throw vn();
|
|
977
|
+
return Fn(t2, n2), i2;
|
|
978
|
+
}
|
|
979
|
+
function kn(t2) {
|
|
980
|
+
return bn(t2) >>> 0;
|
|
981
|
+
}
|
|
982
|
+
function Sn(t2) {
|
|
983
|
+
var e2 = t2.h;
|
|
984
|
+
const n2 = t2.g, r2 = e2[n2], i2 = e2[n2 + 1], s2 = e2[n2 + 2];
|
|
985
|
+
return e2 = e2[n2 + 3], Fn(t2, t2.g + 4), (r2 << 0 | i2 << 8 | s2 << 16 | e2 << 24) >>> 0;
|
|
986
|
+
}
|
|
987
|
+
function xn(t2) {
|
|
988
|
+
var e2 = Sn(t2);
|
|
989
|
+
t2 = 2 * (e2 >> 31) + 1;
|
|
990
|
+
const n2 = e2 >>> 23 & 255;
|
|
991
|
+
return e2 &= 8388607, 255 == n2 ? e2 ? NaN : t2 * (1 / 0) : 0 == n2 ? 1401298464324817e-60 * t2 * e2 : t2 * Math.pow(2, n2 - 150) * (e2 + 8388608);
|
|
992
|
+
}
|
|
993
|
+
function Ln(t2) {
|
|
994
|
+
return bn(t2);
|
|
995
|
+
}
|
|
996
|
+
function Rn(t2, e2, { ba: n2 = false } = {}) {
|
|
997
|
+
t2.ba = n2, e2 && (e2 = wn(e2), t2.h = e2.buffer, t2.m = e2.N, t2.j = 0, t2.l = t2.h.length, t2.g = t2.j);
|
|
998
|
+
}
|
|
999
|
+
function Fn(t2, e2) {
|
|
1000
|
+
if (t2.g = e2, e2 > t2.l) throw En(t2.l, e2);
|
|
1001
|
+
}
|
|
1002
|
+
function In(t2, e2) {
|
|
1003
|
+
if (e2 < 0) throw Error(`Tried to read a negative byte length: ${e2}`);
|
|
1004
|
+
const n2 = t2.g, r2 = n2 + e2;
|
|
1005
|
+
if (r2 > t2.l) throw En(e2, t2.l - n2);
|
|
1006
|
+
return t2.g = r2, n2;
|
|
1007
|
+
}
|
|
1008
|
+
function Mn(t2, e2) {
|
|
1009
|
+
if (0 == e2) return U();
|
|
1010
|
+
var n2 = In(t2, e2);
|
|
1011
|
+
return t2.ba && t2.m ? n2 = t2.h.subarray(n2, n2 + e2) : (t2 = t2.h, n2 = n2 === (e2 = n2 + e2) ? new Uint8Array(0) : It ? t2.slice(n2, e2) : new Uint8Array(t2.subarray(n2, e2))), 0 == n2.length ? U() : new N(n2, C);
|
|
1012
|
+
}
|
|
1013
|
+
ye.prototype.toJSON = void 0, ye.prototype.Ia = ut;
|
|
1014
|
+
var Pn = [];
|
|
1015
|
+
function On(t2) {
|
|
1016
|
+
var e2 = t2.g;
|
|
1017
|
+
if (e2.g == e2.l) return false;
|
|
1018
|
+
t2.l = t2.g.g;
|
|
1019
|
+
var n2 = kn(t2.g);
|
|
1020
|
+
if (e2 = n2 >>> 3, !((n2 &= 7) >= 0 && n2 <= 5)) throw _n(n2, t2.l);
|
|
1021
|
+
if (e2 < 1) throw Error(`Invalid field number: ${e2} (at position ${t2.l})`);
|
|
1022
|
+
return t2.m = e2, t2.h = n2, true;
|
|
1023
|
+
}
|
|
1024
|
+
function Cn(t2) {
|
|
1025
|
+
switch (t2.h) {
|
|
1026
|
+
case 0:
|
|
1027
|
+
0 != t2.h ? Cn(t2) : An(t2.g);
|
|
1028
|
+
break;
|
|
1029
|
+
case 1:
|
|
1030
|
+
Fn(t2 = t2.g, t2.g + 8);
|
|
1031
|
+
break;
|
|
1032
|
+
case 2:
|
|
1033
|
+
if (2 != t2.h) Cn(t2);
|
|
1034
|
+
else {
|
|
1035
|
+
var e2 = kn(t2.g);
|
|
1036
|
+
Fn(t2 = t2.g, t2.g + e2);
|
|
1037
|
+
}
|
|
1038
|
+
break;
|
|
1039
|
+
case 5:
|
|
1040
|
+
Fn(t2 = t2.g, t2.g + 4);
|
|
1041
|
+
break;
|
|
1042
|
+
case 3:
|
|
1043
|
+
for (e2 = t2.m; ; ) {
|
|
1044
|
+
if (!On(t2)) throw Error("Unmatched start-group tag: stream EOF");
|
|
1045
|
+
if (4 == t2.h) {
|
|
1046
|
+
if (t2.m != e2) throw Error("Unmatched end-group tag");
|
|
1047
|
+
break;
|
|
1048
|
+
}
|
|
1049
|
+
Cn(t2);
|
|
1050
|
+
}
|
|
1051
|
+
break;
|
|
1052
|
+
default:
|
|
1053
|
+
throw _n(t2.h, t2.l);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
function Un(t2, e2, n2) {
|
|
1057
|
+
const r2 = t2.g.l, i2 = kn(t2.g), s2 = t2.g.g + i2;
|
|
1058
|
+
let o2 = s2 - r2;
|
|
1059
|
+
if (o2 <= 0 && (t2.g.l = s2, n2(e2, t2, void 0, void 0, void 0), o2 = s2 - t2.g.g), o2) throw Error(`Message parsing ended unexpectedly. Expected to read ${i2} bytes, instead read ${i2 - o2} bytes, either the data ended unexpectedly or the message misreported its own length`);
|
|
1060
|
+
return t2.g.g = s2, t2.g.l = r2, e2;
|
|
1061
|
+
}
|
|
1062
|
+
function Dn(t2) {
|
|
1063
|
+
var o2 = kn(t2.g), a2 = In(t2 = t2.g, o2);
|
|
1064
|
+
if (t2 = t2.h, s) {
|
|
1065
|
+
var c2, h2 = t2;
|
|
1066
|
+
(c2 = i) || (c2 = i = new TextDecoder("utf-8", { fatal: true })), o2 = a2 + o2, h2 = 0 === a2 && o2 === h2.length ? h2 : h2.subarray(a2, o2);
|
|
1067
|
+
try {
|
|
1068
|
+
var u2 = c2.decode(h2);
|
|
1069
|
+
} catch (t3) {
|
|
1070
|
+
if (void 0 === r) {
|
|
1071
|
+
try {
|
|
1072
|
+
c2.decode(new Uint8Array([128]));
|
|
1073
|
+
} catch (t4) {
|
|
1074
|
+
}
|
|
1075
|
+
try {
|
|
1076
|
+
c2.decode(new Uint8Array([97])), r = true;
|
|
1077
|
+
} catch (t4) {
|
|
1078
|
+
r = false;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
throw !r && (i = void 0), t3;
|
|
1082
|
+
}
|
|
1083
|
+
} else {
|
|
1084
|
+
o2 = (u2 = a2) + o2, a2 = [];
|
|
1085
|
+
let r2, i2 = null;
|
|
1086
|
+
for (; u2 < o2; ) {
|
|
1087
|
+
var l = t2[u2++];
|
|
1088
|
+
l < 128 ? a2.push(l) : l < 224 ? u2 >= o2 ? e() : (r2 = t2[u2++], l < 194 || 128 != (192 & r2) ? (u2--, e()) : a2.push((31 & l) << 6 | 63 & r2)) : l < 240 ? u2 >= o2 - 1 ? e() : (r2 = t2[u2++], 128 != (192 & r2) || 224 === l && r2 < 160 || 237 === l && r2 >= 160 || 128 != (192 & (c2 = t2[u2++])) ? (u2--, e()) : a2.push((15 & l) << 12 | (63 & r2) << 6 | 63 & c2)) : l <= 244 ? u2 >= o2 - 2 ? e() : (r2 = t2[u2++], 128 != (192 & r2) || r2 - 144 + (l << 28) >> 30 != 0 || 128 != (192 & (c2 = t2[u2++])) || 128 != (192 & (h2 = t2[u2++])) ? (u2--, e()) : (l = (7 & l) << 18 | (63 & r2) << 12 | (63 & c2) << 6 | 63 & h2, l -= 65536, a2.push(55296 + (l >> 10 & 1023), 56320 + (1023 & l)))) : e(), a2.length >= 8192 && (i2 = n(i2, a2), a2.length = 0);
|
|
1089
|
+
}
|
|
1090
|
+
u2 = n(i2, a2);
|
|
1091
|
+
}
|
|
1092
|
+
return u2;
|
|
1093
|
+
}
|
|
1094
|
+
function Nn(t2) {
|
|
1095
|
+
const e2 = kn(t2.g);
|
|
1096
|
+
return Mn(t2.g, e2);
|
|
1097
|
+
}
|
|
1098
|
+
function Bn(t2, e2, n2) {
|
|
1099
|
+
var r2 = kn(t2.g);
|
|
1100
|
+
for (r2 = t2.g.g + r2; t2.g.g < r2; ) n2.push(e2(t2.g));
|
|
1101
|
+
}
|
|
1102
|
+
var Gn = [];
|
|
1103
|
+
function jn(t2) {
|
|
1104
|
+
return t2;
|
|
1105
|
+
}
|
|
1106
|
+
var Vn;
|
|
1107
|
+
function Xn(t2, e2, n2) {
|
|
1108
|
+
e2.g ? e2.m(t2, e2.g, e2.h, n2) : e2.m(t2, e2.h, n2);
|
|
1109
|
+
}
|
|
1110
|
+
var Hn = class {
|
|
1111
|
+
constructor(t2, e2) {
|
|
1112
|
+
this.u = Ie(t2, e2);
|
|
1113
|
+
}
|
|
1114
|
+
toJSON() {
|
|
1115
|
+
const t2 = !Vn;
|
|
1116
|
+
try {
|
|
1117
|
+
return t2 && (Vn = Re), Wn(this);
|
|
1118
|
+
} finally {
|
|
1119
|
+
t2 && (Vn = void 0);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
l() {
|
|
1123
|
+
var t2 = go;
|
|
1124
|
+
return t2.g ? t2.l(this, t2.g, t2.h, true) : t2.l(this, t2.h, t2.defaultValue, true);
|
|
1125
|
+
}
|
|
1126
|
+
clone() {
|
|
1127
|
+
const t2 = this.u;
|
|
1128
|
+
return new this.constructor(Pe(t2, 0 | t2[Z], false));
|
|
1129
|
+
}
|
|
1130
|
+
N() {
|
|
1131
|
+
return !!(2 & (0 | this.u[Z]));
|
|
1132
|
+
}
|
|
1133
|
+
};
|
|
1134
|
+
function Wn(t2) {
|
|
1135
|
+
var e2 = t2.u;
|
|
1136
|
+
{
|
|
1137
|
+
e2 = (t2 = Vn(e2)) !== e2;
|
|
1138
|
+
let h2 = t2.length;
|
|
1139
|
+
if (h2) {
|
|
1140
|
+
var n2 = t2[h2 - 1], r2 = dt(n2);
|
|
1141
|
+
r2 ? h2-- : n2 = void 0;
|
|
1142
|
+
var i2 = t2;
|
|
1143
|
+
if (r2) {
|
|
1144
|
+
t: {
|
|
1145
|
+
var s2, o2 = n2, a2 = false;
|
|
1146
|
+
if (o2) for (let t3 in o2) isNaN(+t3) ? (s2 ?? (s2 = {}))[t3] = o2[t3] : (r2 = o2[t3], Array.isArray(r2) && (pt(r2) || lt(r2) && 0 === r2.size) && (r2 = null), null == r2 && (a2 = true), null != r2 && ((s2 ?? (s2 = {}))[t3] = r2));
|
|
1147
|
+
if (a2 || (s2 = o2), s2) for (let t3 in s2) {
|
|
1148
|
+
a2 = s2;
|
|
1149
|
+
break t;
|
|
1150
|
+
}
|
|
1151
|
+
a2 = null;
|
|
1152
|
+
}
|
|
1153
|
+
o2 = null == a2 ? null != n2 : a2 !== n2;
|
|
1154
|
+
}
|
|
1155
|
+
for (; h2 > 0 && (null == (s2 = i2[h2 - 1]) || pt(s2) || lt(s2) && 0 === s2.size); h2--) var c2 = true;
|
|
1156
|
+
(i2 !== t2 || o2 || c2) && (e2 ? (c2 || o2 || a2) && (i2.length = h2) : i2 = Array.prototype.slice.call(i2, 0, h2), a2 && i2.push(a2)), c2 = i2;
|
|
1157
|
+
} else c2 = t2;
|
|
1158
|
+
}
|
|
1159
|
+
return c2;
|
|
1160
|
+
}
|
|
1161
|
+
function zn(t2) {
|
|
1162
|
+
return t2 ? /^\d+$/.test(t2) ? (Vt(t2), new Kn(Pt, Ot)) : null : Yn || (Yn = new Kn(0, 0));
|
|
1163
|
+
}
|
|
1164
|
+
Hn.prototype.W = ht, Hn.prototype.toString = function() {
|
|
1165
|
+
try {
|
|
1166
|
+
return Vn = jn, Wn(this).toString();
|
|
1167
|
+
} finally {
|
|
1168
|
+
Vn = void 0;
|
|
1169
|
+
}
|
|
1170
|
+
};
|
|
1171
|
+
var Kn = class {
|
|
1172
|
+
constructor(t2, e2) {
|
|
1173
|
+
this.h = t2 >>> 0, this.g = e2 >>> 0;
|
|
1174
|
+
}
|
|
1175
|
+
};
|
|
1176
|
+
var Yn;
|
|
1177
|
+
function $n(t2) {
|
|
1178
|
+
return t2 ? /^-?\d+$/.test(t2) ? (Vt(t2), new qn(Pt, Ot)) : null : Jn || (Jn = new qn(0, 0));
|
|
1179
|
+
}
|
|
1180
|
+
var qn = class {
|
|
1181
|
+
constructor(t2, e2) {
|
|
1182
|
+
this.h = t2 >>> 0, this.g = e2 >>> 0;
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
var Jn;
|
|
1186
|
+
function Zn(t2, e2, n2) {
|
|
1187
|
+
for (; n2 > 0 || e2 > 127; ) t2.g.push(127 & e2 | 128), e2 = (e2 >>> 7 | n2 << 25) >>> 0, n2 >>>= 7;
|
|
1188
|
+
t2.g.push(e2);
|
|
1189
|
+
}
|
|
1190
|
+
function Qn(t2, e2) {
|
|
1191
|
+
for (; e2 > 127; ) t2.g.push(127 & e2 | 128), e2 >>>= 7;
|
|
1192
|
+
t2.g.push(e2);
|
|
1193
|
+
}
|
|
1194
|
+
function tr(t2, e2) {
|
|
1195
|
+
if (e2 >= 0) Qn(t2, e2);
|
|
1196
|
+
else {
|
|
1197
|
+
for (let n2 = 0; n2 < 9; n2++) t2.g.push(127 & e2 | 128), e2 >>= 7;
|
|
1198
|
+
t2.g.push(1);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
function er(t2, e2) {
|
|
1202
|
+
t2.g.push(e2 >>> 0 & 255), t2.g.push(e2 >>> 8 & 255), t2.g.push(e2 >>> 16 & 255), t2.g.push(e2 >>> 24 & 255);
|
|
1203
|
+
}
|
|
1204
|
+
function nr(t2, e2) {
|
|
1205
|
+
0 !== e2.length && (t2.l.push(e2), t2.h += e2.length);
|
|
1206
|
+
}
|
|
1207
|
+
function rr(t2, e2, n2) {
|
|
1208
|
+
Qn(t2.g, 8 * e2 + n2);
|
|
1209
|
+
}
|
|
1210
|
+
function ir(t2, e2) {
|
|
1211
|
+
return rr(t2, e2, 2), e2 = t2.g.end(), nr(t2, e2), e2.push(t2.h), e2;
|
|
1212
|
+
}
|
|
1213
|
+
function sr(t2, e2) {
|
|
1214
|
+
var n2 = e2.pop();
|
|
1215
|
+
for (n2 = t2.h + t2.g.length() - n2; n2 > 127; ) e2.push(127 & n2 | 128), n2 >>>= 7, t2.h++;
|
|
1216
|
+
e2.push(n2), t2.h++;
|
|
1217
|
+
}
|
|
1218
|
+
function or(t2, e2, n2) {
|
|
1219
|
+
rr(t2, e2, 2), Qn(t2.g, n2.length), nr(t2, t2.g.end()), nr(t2, n2);
|
|
1220
|
+
}
|
|
1221
|
+
function ar(t2, e2, n2, r2) {
|
|
1222
|
+
null != n2 && (e2 = ir(t2, e2), r2(n2, t2), sr(t2, e2));
|
|
1223
|
+
}
|
|
1224
|
+
function cr() {
|
|
1225
|
+
const t2 = class {
|
|
1226
|
+
constructor() {
|
|
1227
|
+
throw Error();
|
|
1228
|
+
}
|
|
1229
|
+
};
|
|
1230
|
+
return Object.setPrototypeOf(t2, t2.prototype), t2;
|
|
1231
|
+
}
|
|
1232
|
+
var hr = cr();
|
|
1233
|
+
var ur = cr();
|
|
1234
|
+
var lr = cr();
|
|
1235
|
+
var dr = cr();
|
|
1236
|
+
var fr = cr();
|
|
1237
|
+
var pr = cr();
|
|
1238
|
+
var gr = cr();
|
|
1239
|
+
var mr = cr();
|
|
1240
|
+
var yr = cr();
|
|
1241
|
+
var _r = class {
|
|
1242
|
+
constructor(t2, e2, n2) {
|
|
1243
|
+
this.g = t2, this.h = e2, t2 = hr, this.l = !!t2 && n2 === t2 || false;
|
|
1244
|
+
}
|
|
1245
|
+
};
|
|
1246
|
+
function vr(t2, e2) {
|
|
1247
|
+
return new _r(t2, e2, hr);
|
|
1248
|
+
}
|
|
1249
|
+
function Er(t2, e2, n2, r2, i2) {
|
|
1250
|
+
ar(t2, n2, Ir(e2, r2), i2);
|
|
1251
|
+
}
|
|
1252
|
+
var wr = vr(function(t2, e2, n2, r2, i2) {
|
|
1253
|
+
return 2 === t2.h && (Un(t2, Qe(e2, r2, n2), i2), true);
|
|
1254
|
+
}, Er);
|
|
1255
|
+
var Tr = vr(function(t2, e2, n2, r2, i2) {
|
|
1256
|
+
return 2 === t2.h && (Un(t2, Qe(e2, r2, n2, true), i2), true);
|
|
1257
|
+
}, Er);
|
|
1258
|
+
var Ar = Symbol();
|
|
1259
|
+
var br = Symbol();
|
|
1260
|
+
var kr = Symbol();
|
|
1261
|
+
var Sr = Symbol();
|
|
1262
|
+
var xr;
|
|
1263
|
+
var Lr;
|
|
1264
|
+
function Rr(t2, e2, n2, r2) {
|
|
1265
|
+
var i2 = r2[t2];
|
|
1266
|
+
if (i2) return i2;
|
|
1267
|
+
(i2 = {}).Pa = r2, i2.V = function(t3) {
|
|
1268
|
+
switch (typeof t3) {
|
|
1269
|
+
case "boolean":
|
|
1270
|
+
return Te || (Te = [0, void 0, true]);
|
|
1271
|
+
case "number":
|
|
1272
|
+
return t3 > 0 ? void 0 : 0 === t3 ? Ae || (Ae = [0, void 0]) : [-t3, void 0];
|
|
1273
|
+
case "string":
|
|
1274
|
+
return [0, t3];
|
|
1275
|
+
case "object":
|
|
1276
|
+
return t3;
|
|
1277
|
+
}
|
|
1278
|
+
}(r2[0]);
|
|
1279
|
+
var s2 = r2[1];
|
|
1280
|
+
let o2 = 1;
|
|
1281
|
+
s2 && s2.constructor === Object && (i2.ga = s2, "function" == typeof (s2 = r2[++o2]) && (i2.la = true, xr ?? (xr = s2), Lr ?? (Lr = r2[o2 + 1]), s2 = r2[o2 += 2]));
|
|
1282
|
+
const a2 = {};
|
|
1283
|
+
for (; s2 && Array.isArray(s2) && s2.length && "number" == typeof s2[0] && s2[0] > 0; ) {
|
|
1284
|
+
for (var c2 = 0; c2 < s2.length; c2++) a2[s2[c2]] = s2;
|
|
1285
|
+
s2 = r2[++o2];
|
|
1286
|
+
}
|
|
1287
|
+
for (c2 = 1; void 0 !== s2; ) {
|
|
1288
|
+
let t3;
|
|
1289
|
+
"number" == typeof s2 && (c2 += s2, s2 = r2[++o2]);
|
|
1290
|
+
var h2 = void 0;
|
|
1291
|
+
if (s2 instanceof _r ? t3 = s2 : (t3 = wr, o2--), t3?.l) {
|
|
1292
|
+
s2 = r2[++o2], h2 = r2;
|
|
1293
|
+
var u2 = o2;
|
|
1294
|
+
"function" == typeof s2 && (s2 = s2(), h2[u2] = s2), h2 = s2;
|
|
1295
|
+
}
|
|
1296
|
+
for (u2 = c2 + 1, "number" == typeof (s2 = r2[++o2]) && s2 < 0 && (u2 -= s2, s2 = r2[++o2]); c2 < u2; c2++) {
|
|
1297
|
+
const r3 = a2[c2];
|
|
1298
|
+
h2 ? n2(i2, c2, t3, h2, r3) : e2(i2, c2, t3, r3);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
return r2[t2] = i2;
|
|
1302
|
+
}
|
|
1303
|
+
function Fr(t2) {
|
|
1304
|
+
return Array.isArray(t2) ? t2[0] instanceof _r ? t2 : [Tr, t2] : [t2, void 0];
|
|
1305
|
+
}
|
|
1306
|
+
function Ir(t2, e2) {
|
|
1307
|
+
return t2 instanceof Hn ? t2.u : Array.isArray(t2) ? Fe(t2, e2, false) : void 0;
|
|
1308
|
+
}
|
|
1309
|
+
function Mr(t2, e2, n2, r2) {
|
|
1310
|
+
const i2 = n2.g;
|
|
1311
|
+
t2[e2] = r2 ? (t3, e3, n3) => i2(t3, e3, n3, r2) : i2;
|
|
1312
|
+
}
|
|
1313
|
+
function Pr(t2, e2, n2, r2, i2) {
|
|
1314
|
+
const s2 = n2.g;
|
|
1315
|
+
let o2, a2;
|
|
1316
|
+
t2[e2] = (t3, e3, n3) => s2(t3, e3, n3, a2 || (a2 = Rr(br, Mr, Pr, r2).V), o2 || (o2 = Or(r2)), i2);
|
|
1317
|
+
}
|
|
1318
|
+
function Or(t2) {
|
|
1319
|
+
let e2 = t2[kr];
|
|
1320
|
+
if (null != e2) return e2;
|
|
1321
|
+
const n2 = Rr(br, Mr, Pr, t2);
|
|
1322
|
+
return e2 = n2.la ? (t3, e3) => xr(t3, e3, n2) : (t3, e3) => {
|
|
1323
|
+
const r2 = 0 | t3[Z];
|
|
1324
|
+
for (; On(e3) && 4 != e3.h; ) {
|
|
1325
|
+
var i2 = e3.m, s2 = n2[i2];
|
|
1326
|
+
if (null == s2) {
|
|
1327
|
+
var o2 = n2.ga;
|
|
1328
|
+
o2 && (o2 = o2[i2]) && (null != (o2 = Cr(o2)) && (s2 = n2[i2] = o2));
|
|
1329
|
+
}
|
|
1330
|
+
null != s2 && s2(e3, t3, i2) || (i2 = (s2 = e3).l, Cn(s2), s2.fa ? s2 = void 0 : (o2 = s2.g.g - i2, s2.g.g = i2, s2 = Mn(s2.g, o2)), i2 = t3, s2 && ((o2 = i2[J]) ? o2.push(s2) : i2[J] = [s2]));
|
|
1331
|
+
}
|
|
1332
|
+
return 16384 & r2 && rt(t3), true;
|
|
1333
|
+
}, t2[kr] = e2;
|
|
1334
|
+
}
|
|
1335
|
+
function Cr(t2) {
|
|
1336
|
+
const e2 = (t2 = Fr(t2))[0].g;
|
|
1337
|
+
if (t2 = t2[1]) {
|
|
1338
|
+
const n2 = Or(t2), r2 = Rr(br, Mr, Pr, t2).V;
|
|
1339
|
+
return (t3, i2, s2) => e2(t3, i2, s2, r2, n2);
|
|
1340
|
+
}
|
|
1341
|
+
return e2;
|
|
1342
|
+
}
|
|
1343
|
+
function Ur(t2, e2, n2) {
|
|
1344
|
+
t2[e2] = n2.h;
|
|
1345
|
+
}
|
|
1346
|
+
function Dr(t2, e2, n2, r2) {
|
|
1347
|
+
let i2, s2;
|
|
1348
|
+
const o2 = n2.h;
|
|
1349
|
+
t2[e2] = (t3, e3, n3) => o2(t3, e3, n3, s2 || (s2 = Rr(Ar, Ur, Dr, r2).V), i2 || (i2 = Nr(r2)));
|
|
1350
|
+
}
|
|
1351
|
+
function Nr(t2) {
|
|
1352
|
+
let e2 = t2[Sr];
|
|
1353
|
+
if (!e2) {
|
|
1354
|
+
const n2 = Rr(Ar, Ur, Dr, t2);
|
|
1355
|
+
e2 = (t3, e3) => Br(t3, e3, n2), t2[Sr] = e2;
|
|
1356
|
+
}
|
|
1357
|
+
return e2;
|
|
1358
|
+
}
|
|
1359
|
+
function Br(t2, e2, n2) {
|
|
1360
|
+
for (var r2 = 0 | t2[Z], i2 = 512 & r2 ? 0 : -1, s2 = t2.length, o2 = 512 & r2 ? 1 : 0, a2 = s2 + (256 & r2 ? -1 : 0); o2 < a2; o2++) {
|
|
1361
|
+
const r3 = t2[o2];
|
|
1362
|
+
if (null == r3) continue;
|
|
1363
|
+
const s3 = o2 - i2, a3 = Gr(n2, s3);
|
|
1364
|
+
a3 && a3(e2, r3, s3);
|
|
1365
|
+
}
|
|
1366
|
+
if (256 & r2) {
|
|
1367
|
+
r2 = t2[s2 - 1];
|
|
1368
|
+
for (const t3 in r2) i2 = +t3, Number.isNaN(i2) || null != (s2 = r2[i2]) && (a2 = Gr(n2, i2)) && a2(e2, s2, i2);
|
|
1369
|
+
}
|
|
1370
|
+
if (t2 = _t(t2)) for (nr(e2, e2.g.end()), n2 = 0; n2 < t2.length; n2++) nr(e2, D(t2[n2]) || new Uint8Array(0));
|
|
1371
|
+
}
|
|
1372
|
+
function Gr(t2, e2) {
|
|
1373
|
+
var n2 = t2[e2];
|
|
1374
|
+
if (n2) return n2;
|
|
1375
|
+
if ((n2 = t2.ga) && (n2 = n2[e2])) {
|
|
1376
|
+
var r2 = (n2 = Fr(n2))[0].h;
|
|
1377
|
+
if (n2 = n2[1]) {
|
|
1378
|
+
const e3 = Nr(n2), i2 = Rr(Ar, Ur, Dr, n2).V;
|
|
1379
|
+
n2 = t2.la ? Lr(i2, e3) : (t3, n3, s2) => r2(t3, n3, s2, i2, e3);
|
|
1380
|
+
} else n2 = r2;
|
|
1381
|
+
return t2[e2] = n2;
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
function jr(t2, e2) {
|
|
1385
|
+
if (Array.isArray(e2)) {
|
|
1386
|
+
var n2 = 0 | e2[Z];
|
|
1387
|
+
if (4 & n2) return e2;
|
|
1388
|
+
for (var r2 = 0, i2 = 0; r2 < e2.length; r2++) {
|
|
1389
|
+
const n3 = t2(e2[r2]);
|
|
1390
|
+
null != n3 && (e2[i2++] = n3);
|
|
1391
|
+
}
|
|
1392
|
+
return i2 < r2 && (e2.length = i2), nt(e2, -12289 & (5 | n2)), 2 & n2 && Object.freeze(e2), e2;
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
function Vr(t2, e2, n2) {
|
|
1396
|
+
return new _r(t2, e2, n2);
|
|
1397
|
+
}
|
|
1398
|
+
function Xr(t2, e2, n2) {
|
|
1399
|
+
return new _r(t2, e2, n2);
|
|
1400
|
+
}
|
|
1401
|
+
function Hr(t2, e2, n2) {
|
|
1402
|
+
Ne(t2, 0 | t2[Z], e2, n2);
|
|
1403
|
+
}
|
|
1404
|
+
var Wr = vr(function(t2, e2, n2, r2, i2) {
|
|
1405
|
+
return 2 === t2.h && (t2 = Un(t2, Fe([void 0, void 0], r2, true), i2), mt(r2 = 0 | e2[Z]), (i2 = Ue(e2, r2, n2)) instanceof ye ? 0 != (2 & i2.L) ? ((i2 = i2.X()).push(t2), Ne(e2, r2, n2, i2)) : i2.Na(t2) : Array.isArray(i2) ? (2 & (0 | i2[Z]) && Ne(e2, r2, n2, i2 = ze(i2)), i2.push(t2)) : Ne(e2, r2, n2, [t2]), true);
|
|
1406
|
+
}, function(t2, e2, n2, r2, i2) {
|
|
1407
|
+
if (e2 instanceof ye) e2.forEach((e3, s2) => {
|
|
1408
|
+
ar(t2, n2, Fe([s2, e3], r2, false), i2);
|
|
1409
|
+
});
|
|
1410
|
+
else if (Array.isArray(e2)) for (let s2 = 0; s2 < e2.length; s2++) {
|
|
1411
|
+
const o2 = e2[s2];
|
|
1412
|
+
Array.isArray(o2) && ar(t2, n2, Fe(o2, r2, false), i2);
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
function zr(t2, e2, n2) {
|
|
1416
|
+
if (e2 = function(t3) {
|
|
1417
|
+
if (null == t3) return t3;
|
|
1418
|
+
const e3 = typeof t3;
|
|
1419
|
+
if ("bigint" === e3) return String(Ht(64, t3));
|
|
1420
|
+
if (Zt(t3)) {
|
|
1421
|
+
if ("string" === e3) return re(t3);
|
|
1422
|
+
if ("number" === e3) return ne(t3);
|
|
1423
|
+
}
|
|
1424
|
+
}(e2), null != e2) {
|
|
1425
|
+
if ("string" == typeof e2) $n(e2);
|
|
1426
|
+
if (null != e2) switch (rr(t2, n2, 0), typeof e2) {
|
|
1427
|
+
case "number":
|
|
1428
|
+
t2 = t2.g, Ut(e2), Zn(t2, Pt, Ot);
|
|
1429
|
+
break;
|
|
1430
|
+
case "bigint":
|
|
1431
|
+
n2 = BigInt.asUintN(64, e2), n2 = new qn(Number(n2 & BigInt(4294967295)), Number(n2 >> BigInt(32))), Zn(t2.g, n2.h, n2.g);
|
|
1432
|
+
break;
|
|
1433
|
+
default:
|
|
1434
|
+
n2 = $n(e2), Zn(t2.g, n2.h, n2.g);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
function Kr(t2, e2, n2) {
|
|
1439
|
+
null != (e2 = Qt(e2)) && null != e2 && (rr(t2, n2, 0), tr(t2.g, e2));
|
|
1440
|
+
}
|
|
1441
|
+
function Yr(t2, e2, n2) {
|
|
1442
|
+
null != (e2 = qt(e2)) && (rr(t2, n2, 0), t2.g.g.push(e2 ? 1 : 0));
|
|
1443
|
+
}
|
|
1444
|
+
function $r(t2, e2, n2) {
|
|
1445
|
+
null != (e2 = ce(e2)) && or(t2, n2, c(e2));
|
|
1446
|
+
}
|
|
1447
|
+
function qr(t2, e2, n2, r2, i2) {
|
|
1448
|
+
ar(t2, n2, Ir(e2, r2), i2);
|
|
1449
|
+
}
|
|
1450
|
+
function Jr(t2, e2, n2) {
|
|
1451
|
+
null != (e2 = null == e2 || "string" == typeof e2 || O(e2) || e2 instanceof N ? e2 : void 0) && or(t2, n2, wn(e2).buffer);
|
|
1452
|
+
}
|
|
1453
|
+
function Zr(t2, e2, n2) {
|
|
1454
|
+
return (5 === t2.h || 2 === t2.h) && (e2 = Ye(e2, 0 | e2[Z], n2, false, false), 2 == t2.h ? Bn(t2, xn, e2) : e2.push(xn(t2.g)), true);
|
|
1455
|
+
}
|
|
1456
|
+
var Qr = Vr(function(t2, e2, n2) {
|
|
1457
|
+
if (1 !== t2.h) return false;
|
|
1458
|
+
var r2 = t2.g;
|
|
1459
|
+
t2 = Sn(r2);
|
|
1460
|
+
const i2 = Sn(r2);
|
|
1461
|
+
r2 = 2 * (i2 >> 31) + 1;
|
|
1462
|
+
const s2 = i2 >>> 20 & 2047;
|
|
1463
|
+
return t2 = 4294967296 * (1048575 & i2) + t2, Hr(e2, n2, 2047 == s2 ? t2 ? NaN : r2 * (1 / 0) : 0 == s2 ? 5e-324 * r2 * t2 : r2 * Math.pow(2, s2 - 1075) * (t2 + 4503599627370496)), true;
|
|
1464
|
+
}, function(t2, e2, n2) {
|
|
1465
|
+
null != (e2 = $t(e2)) && (rr(t2, n2, 1), t2 = t2.g, (n2 = Mt || (Mt = new DataView(new ArrayBuffer(8)))).setFloat64(0, +e2, true), Pt = n2.getUint32(0, true), Ot = n2.getUint32(4, true), er(t2, Pt), er(t2, Ot));
|
|
1466
|
+
}, cr());
|
|
1467
|
+
var ti = Vr(function(t2, e2, n2) {
|
|
1468
|
+
return 5 === t2.h && (Hr(e2, n2, xn(t2.g)), true);
|
|
1469
|
+
}, function(t2, e2, n2) {
|
|
1470
|
+
null != (e2 = $t(e2)) && (rr(t2, n2, 5), t2 = t2.g, Dt(e2), er(t2, Pt));
|
|
1471
|
+
}, gr);
|
|
1472
|
+
var ei = Xr(Zr, function(t2, e2, n2) {
|
|
1473
|
+
if (null != (e2 = jr($t, e2))) for (let o2 = 0; o2 < e2.length; o2++) {
|
|
1474
|
+
var r2 = t2, i2 = n2, s2 = e2[o2];
|
|
1475
|
+
null != s2 && (rr(r2, i2, 5), r2 = r2.g, Dt(s2), er(r2, Pt));
|
|
1476
|
+
}
|
|
1477
|
+
}, gr);
|
|
1478
|
+
var ni = Xr(Zr, function(t2, e2, n2) {
|
|
1479
|
+
if (null != (e2 = jr($t, e2)) && e2.length) {
|
|
1480
|
+
rr(t2, n2, 2), Qn(t2.g, 4 * e2.length);
|
|
1481
|
+
for (let r2 = 0; r2 < e2.length; r2++) n2 = t2.g, Dt(e2[r2]), er(n2, Pt);
|
|
1482
|
+
}
|
|
1483
|
+
}, gr);
|
|
1484
|
+
var ri = Vr(function(t2, e2, n2) {
|
|
1485
|
+
return 0 === t2.h && (Hr(e2, n2, Tn(t2.g, Bt)), true);
|
|
1486
|
+
}, zr, pr);
|
|
1487
|
+
var ii = Vr(function(t2, e2, n2) {
|
|
1488
|
+
return 0 === t2.h && (Hr(e2, n2, 0 === (t2 = Tn(t2.g, Bt)) ? void 0 : t2), true);
|
|
1489
|
+
}, zr, pr);
|
|
1490
|
+
var si = Vr(function(t2, e2, n2) {
|
|
1491
|
+
return 0 === t2.h && (Hr(e2, n2, Tn(t2.g, Nt)), true);
|
|
1492
|
+
}, function(t2, e2, n2) {
|
|
1493
|
+
if (null != (e2 = se(e2))) {
|
|
1494
|
+
if ("string" == typeof e2) zn(e2);
|
|
1495
|
+
if (null != e2) switch (rr(t2, n2, 0), typeof e2) {
|
|
1496
|
+
case "number":
|
|
1497
|
+
t2 = t2.g, Ut(e2), Zn(t2, Pt, Ot);
|
|
1498
|
+
break;
|
|
1499
|
+
case "bigint":
|
|
1500
|
+
n2 = BigInt.asUintN(64, e2), n2 = new Kn(Number(n2 & BigInt(4294967295)), Number(n2 >> BigInt(32))), Zn(t2.g, n2.h, n2.g);
|
|
1501
|
+
break;
|
|
1502
|
+
default:
|
|
1503
|
+
n2 = zn(e2), Zn(t2.g, n2.h, n2.g);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
}, cr());
|
|
1507
|
+
var oi = Vr(function(t2, e2, n2) {
|
|
1508
|
+
return 0 === t2.h && (Hr(e2, n2, bn(t2.g)), true);
|
|
1509
|
+
}, Kr, dr);
|
|
1510
|
+
var ai = Xr(function(t2, e2, n2) {
|
|
1511
|
+
return (0 === t2.h || 2 === t2.h) && (e2 = Ye(e2, 0 | e2[Z], n2, false, false), 2 == t2.h ? Bn(t2, bn, e2) : e2.push(bn(t2.g)), true);
|
|
1512
|
+
}, function(t2, e2, n2) {
|
|
1513
|
+
if (null != (e2 = jr(Qt, e2)) && e2.length) {
|
|
1514
|
+
n2 = ir(t2, n2);
|
|
1515
|
+
for (let n3 = 0; n3 < e2.length; n3++) tr(t2.g, e2[n3]);
|
|
1516
|
+
sr(t2, n2);
|
|
1517
|
+
}
|
|
1518
|
+
}, dr);
|
|
1519
|
+
var ci = Vr(function(t2, e2, n2) {
|
|
1520
|
+
return 0 === t2.h && (Hr(e2, n2, 0 === (t2 = bn(t2.g)) ? void 0 : t2), true);
|
|
1521
|
+
}, Kr, dr);
|
|
1522
|
+
var hi = Vr(function(t2, e2, n2) {
|
|
1523
|
+
return 0 === t2.h && (Hr(e2, n2, An(t2.g)), true);
|
|
1524
|
+
}, Yr, ur);
|
|
1525
|
+
var ui = Vr(function(t2, e2, n2) {
|
|
1526
|
+
return 0 === t2.h && (Hr(e2, n2, false === (t2 = An(t2.g)) ? void 0 : t2), true);
|
|
1527
|
+
}, Yr, ur);
|
|
1528
|
+
var li = Xr(function(t2, e2, n2) {
|
|
1529
|
+
return 2 === t2.h && (t2 = Dn(t2), Ye(e2, 0 | e2[Z], n2, false).push(t2), true);
|
|
1530
|
+
}, function(t2, e2, n2) {
|
|
1531
|
+
if (null != (e2 = jr(ce, e2))) for (let o2 = 0; o2 < e2.length; o2++) {
|
|
1532
|
+
var r2 = t2, i2 = n2, s2 = e2[o2];
|
|
1533
|
+
null != s2 && or(r2, i2, c(s2));
|
|
1534
|
+
}
|
|
1535
|
+
}, lr);
|
|
1536
|
+
var di = Vr(function(t2, e2, n2) {
|
|
1537
|
+
return 2 === t2.h && (Hr(e2, n2, "" === (t2 = Dn(t2)) ? void 0 : t2), true);
|
|
1538
|
+
}, $r, lr);
|
|
1539
|
+
var fi = Vr(function(t2, e2, n2) {
|
|
1540
|
+
return 2 === t2.h && (Hr(e2, n2, Dn(t2)), true);
|
|
1541
|
+
}, $r, lr);
|
|
1542
|
+
var pi = function(t2, e2, n2 = hr) {
|
|
1543
|
+
return new _r(t2, e2, n2);
|
|
1544
|
+
}(function(t2, e2, n2, r2, i2) {
|
|
1545
|
+
return 2 === t2.h && (r2 = Fe(void 0, r2, true), Ye(e2, 0 | e2[Z], n2, true).push(r2), Un(t2, r2, i2), true);
|
|
1546
|
+
}, function(t2, e2, n2, r2, i2) {
|
|
1547
|
+
if (Array.isArray(e2)) for (let s2 = 0; s2 < e2.length; s2++) qr(t2, e2[s2], n2, r2, i2);
|
|
1548
|
+
});
|
|
1549
|
+
var gi = vr(function(t2, e2, n2, r2, i2, s2) {
|
|
1550
|
+
return 2 === t2.h && (Je(e2, 0 | e2[Z], s2, n2), Un(t2, e2 = Qe(e2, r2, n2), i2), true);
|
|
1551
|
+
}, qr);
|
|
1552
|
+
var mi = Vr(function(t2, e2, n2) {
|
|
1553
|
+
return 2 === t2.h && (Hr(e2, n2, Nn(t2)), true);
|
|
1554
|
+
}, Jr, mr);
|
|
1555
|
+
var yi = Xr(function(t2, e2, n2) {
|
|
1556
|
+
return (0 === t2.h || 2 === t2.h) && (e2 = Ye(e2, 0 | e2[Z], n2, false, false), 2 == t2.h ? Bn(t2, kn, e2) : e2.push(kn(t2.g)), true);
|
|
1557
|
+
}, function(t2, e2, n2) {
|
|
1558
|
+
if (null != (e2 = jr(te, e2))) for (let o2 = 0; o2 < e2.length; o2++) {
|
|
1559
|
+
var r2 = t2, i2 = n2, s2 = e2[o2];
|
|
1560
|
+
null != s2 && (rr(r2, i2, 0), Qn(r2.g, s2));
|
|
1561
|
+
}
|
|
1562
|
+
}, fr);
|
|
1563
|
+
var _i = Vr(function(t2, e2, n2) {
|
|
1564
|
+
return 0 === t2.h && (Hr(e2, n2, 0 === (t2 = kn(t2.g)) ? void 0 : t2), true);
|
|
1565
|
+
}, function(t2, e2, n2) {
|
|
1566
|
+
null != (e2 = te(e2)) && null != e2 && (rr(t2, n2, 0), Qn(t2.g, e2));
|
|
1567
|
+
}, fr);
|
|
1568
|
+
var vi = Vr(function(t2, e2, n2) {
|
|
1569
|
+
return 0 === t2.h && (Hr(e2, n2, bn(t2.g)), true);
|
|
1570
|
+
}, function(t2, e2, n2) {
|
|
1571
|
+
null != (e2 = Qt(e2)) && (e2 = parseInt(e2, 10), rr(t2, n2, 0), tr(t2.g, e2));
|
|
1572
|
+
}, yr);
|
|
1573
|
+
var Ei = class {
|
|
1574
|
+
constructor(t2, e2) {
|
|
1575
|
+
this.h = t2, this.g = e2, this.l = en, this.m = sn, this.defaultValue = void 0;
|
|
1576
|
+
}
|
|
1577
|
+
};
|
|
1578
|
+
function wi(t2, e2) {
|
|
1579
|
+
return new Ei(t2, e2);
|
|
1580
|
+
}
|
|
1581
|
+
function Ti(t2, e2) {
|
|
1582
|
+
return (n2, r2) => {
|
|
1583
|
+
if (Gn.length) {
|
|
1584
|
+
const t3 = Gn.pop();
|
|
1585
|
+
t3.o(r2), Rn(t3.g, n2, r2), n2 = t3;
|
|
1586
|
+
} else n2 = new class {
|
|
1587
|
+
constructor(t3, e3) {
|
|
1588
|
+
if (Pn.length) {
|
|
1589
|
+
const n3 = Pn.pop();
|
|
1590
|
+
Rn(n3, t3, e3), t3 = n3;
|
|
1591
|
+
} else t3 = new class {
|
|
1592
|
+
constructor(t4, e4) {
|
|
1593
|
+
this.h = null, this.m = false, this.g = this.l = this.j = 0, Rn(this, t4, e4);
|
|
1594
|
+
}
|
|
1595
|
+
clear() {
|
|
1596
|
+
this.h = null, this.m = false, this.g = this.l = this.j = 0, this.ba = false;
|
|
1597
|
+
}
|
|
1598
|
+
}(t3, e3);
|
|
1599
|
+
this.g = t3, this.l = this.g.g, this.h = this.m = -1, this.o(e3);
|
|
1600
|
+
}
|
|
1601
|
+
o({ fa: t3 = false } = {}) {
|
|
1602
|
+
this.fa = t3;
|
|
1603
|
+
}
|
|
1604
|
+
}(n2, r2);
|
|
1605
|
+
try {
|
|
1606
|
+
const r3 = new t2(), s2 = r3.u;
|
|
1607
|
+
Or(e2)(s2, n2);
|
|
1608
|
+
var i2 = r3;
|
|
1609
|
+
} finally {
|
|
1610
|
+
n2.g.clear(), n2.m = -1, n2.h = -1, Gn.length < 100 && Gn.push(n2);
|
|
1611
|
+
}
|
|
1612
|
+
return i2;
|
|
1613
|
+
};
|
|
1614
|
+
}
|
|
1615
|
+
function Ai(t2) {
|
|
1616
|
+
return function() {
|
|
1617
|
+
const e2 = new class {
|
|
1618
|
+
constructor() {
|
|
1619
|
+
this.l = [], this.h = 0, this.g = new class {
|
|
1620
|
+
constructor() {
|
|
1621
|
+
this.g = [];
|
|
1622
|
+
}
|
|
1623
|
+
length() {
|
|
1624
|
+
return this.g.length;
|
|
1625
|
+
}
|
|
1626
|
+
end() {
|
|
1627
|
+
const t3 = this.g;
|
|
1628
|
+
return this.g = [], t3;
|
|
1629
|
+
}
|
|
1630
|
+
}();
|
|
1631
|
+
}
|
|
1632
|
+
}();
|
|
1633
|
+
Br(this.u, e2, Rr(Ar, Ur, Dr, t2)), nr(e2, e2.g.end());
|
|
1634
|
+
const n2 = new Uint8Array(e2.h), r2 = e2.l, i2 = r2.length;
|
|
1635
|
+
let s2 = 0;
|
|
1636
|
+
for (let t3 = 0; t3 < i2; t3++) {
|
|
1637
|
+
const e3 = r2[t3];
|
|
1638
|
+
n2.set(e3, s2), s2 += e3.length;
|
|
1639
|
+
}
|
|
1640
|
+
return e2.l = [n2], n2;
|
|
1641
|
+
};
|
|
1642
|
+
}
|
|
1643
|
+
var bi = class extends Hn {
|
|
1644
|
+
constructor(t2) {
|
|
1645
|
+
super(t2);
|
|
1646
|
+
}
|
|
1647
|
+
};
|
|
1648
|
+
var ki = [0, di, Vr(function(t2, e2, n2) {
|
|
1649
|
+
return 2 === t2.h && (Hr(e2, n2, (t2 = Nn(t2)) === U() ? void 0 : t2), true);
|
|
1650
|
+
}, function(t2, e2, n2) {
|
|
1651
|
+
if (null != e2) {
|
|
1652
|
+
if (e2 instanceof Hn) {
|
|
1653
|
+
const r2 = e2.Ra;
|
|
1654
|
+
return void (r2 && (e2 = r2(e2), null != e2 && or(t2, n2, wn(e2).buffer)));
|
|
1655
|
+
}
|
|
1656
|
+
if (Array.isArray(e2)) return;
|
|
1657
|
+
}
|
|
1658
|
+
Jr(t2, e2, n2);
|
|
1659
|
+
}, mr)];
|
|
1660
|
+
var Si;
|
|
1661
|
+
var xi = globalThis.trustedTypes;
|
|
1662
|
+
function Li(t2) {
|
|
1663
|
+
void 0 === Si && (Si = function() {
|
|
1664
|
+
let t3 = null;
|
|
1665
|
+
if (!xi) return t3;
|
|
1666
|
+
try {
|
|
1667
|
+
const e3 = (t4) => t4;
|
|
1668
|
+
t3 = xi.createPolicy("goog#html", { createHTML: e3, createScript: e3, createScriptURL: e3 });
|
|
1669
|
+
} catch (t4) {
|
|
1670
|
+
}
|
|
1671
|
+
return t3;
|
|
1672
|
+
}());
|
|
1673
|
+
var e2 = Si;
|
|
1674
|
+
return new class {
|
|
1675
|
+
constructor(t3) {
|
|
1676
|
+
this.g = t3;
|
|
1677
|
+
}
|
|
1678
|
+
toString() {
|
|
1679
|
+
return this.g + "";
|
|
1680
|
+
}
|
|
1681
|
+
}(e2 ? e2.createScriptURL(t2) : t2);
|
|
1682
|
+
}
|
|
1683
|
+
function Ri(t2, ...e2) {
|
|
1684
|
+
if (0 === e2.length) return Li(t2[0]);
|
|
1685
|
+
let n2 = t2[0];
|
|
1686
|
+
for (let r2 = 0; r2 < e2.length; r2++) n2 += encodeURIComponent(e2[r2]) + t2[r2 + 1];
|
|
1687
|
+
return Li(n2);
|
|
1688
|
+
}
|
|
1689
|
+
var Fi = [0, oi, vi, hi, -1, ai, vi, -1];
|
|
1690
|
+
var Ii = class extends Hn {
|
|
1691
|
+
constructor(t2) {
|
|
1692
|
+
super(t2);
|
|
1693
|
+
}
|
|
1694
|
+
};
|
|
1695
|
+
var Mi = [0, hi, fi, hi, vi, -1, Xr(function(t2, e2, n2) {
|
|
1696
|
+
return (0 === t2.h || 2 === t2.h) && (e2 = Ye(e2, 0 | e2[Z], n2, false, false), 2 == t2.h ? Bn(t2, Ln, e2) : e2.push(bn(t2.g)), true);
|
|
1697
|
+
}, function(t2, e2, n2) {
|
|
1698
|
+
if (null != (e2 = jr(Qt, e2)) && e2.length) {
|
|
1699
|
+
n2 = ir(t2, n2);
|
|
1700
|
+
for (let n3 = 0; n3 < e2.length; n3++) tr(t2.g, e2[n3]);
|
|
1701
|
+
sr(t2, n2);
|
|
1702
|
+
}
|
|
1703
|
+
}, yr), fi, -1, [0, hi, -1], vi, hi, -1];
|
|
1704
|
+
var Pi = [0, fi, -2];
|
|
1705
|
+
var Oi = class extends Hn {
|
|
1706
|
+
constructor(t2) {
|
|
1707
|
+
super(t2);
|
|
1708
|
+
}
|
|
1709
|
+
};
|
|
1710
|
+
var Ci = [0];
|
|
1711
|
+
var Ui = [0, oi, hi, 1, hi, -3];
|
|
1712
|
+
var Di = class extends Hn {
|
|
1713
|
+
constructor(t2) {
|
|
1714
|
+
super(t2, 2);
|
|
1715
|
+
}
|
|
1716
|
+
};
|
|
1717
|
+
var Ni = {};
|
|
1718
|
+
Ni[336783863] = [0, fi, hi, -1, oi, [0, [1, 2, 3, 4, 5, 6, 7, 8], gi, Ci, gi, Mi, gi, Pi, gi, Ui, gi, Fi, gi, [0, fi, -2], gi, [0, fi, vi], gi, [0, vi, fi]], [0, fi], hi, [0, [1, 3], [2, 4], gi, [0, ai], -1, gi, [0, li], -1, pi, [0, fi, -1]], fi];
|
|
1719
|
+
var Bi = [0, ii, -1, ui, -3, ii, ai, di, ci, ii, -1, ui, ci, ui, -2, di];
|
|
1720
|
+
function Gi(t2, e2) {
|
|
1721
|
+
Ke(t2, 2, ae(e2), "");
|
|
1722
|
+
}
|
|
1723
|
+
function ji(t2, e2) {
|
|
1724
|
+
yn(t2, 3, e2);
|
|
1725
|
+
}
|
|
1726
|
+
function Vi(t2, e2) {
|
|
1727
|
+
yn(t2, 4, e2);
|
|
1728
|
+
}
|
|
1729
|
+
var Xi = class extends Hn {
|
|
1730
|
+
constructor(t2) {
|
|
1731
|
+
super(t2, 500);
|
|
1732
|
+
}
|
|
1733
|
+
o(t2) {
|
|
1734
|
+
return sn(this, 0, 7, t2);
|
|
1735
|
+
}
|
|
1736
|
+
};
|
|
1737
|
+
var Hi = [-1, {}];
|
|
1738
|
+
var Wi = [0, fi, 1, Hi];
|
|
1739
|
+
var zi = [0, fi, li, Hi];
|
|
1740
|
+
function Ki(t2, e2) {
|
|
1741
|
+
hn(t2, 1, Xi, e2);
|
|
1742
|
+
}
|
|
1743
|
+
function Yi(t2, e2) {
|
|
1744
|
+
yn(t2, 10, e2);
|
|
1745
|
+
}
|
|
1746
|
+
function $i(t2, e2) {
|
|
1747
|
+
yn(t2, 15, e2);
|
|
1748
|
+
}
|
|
1749
|
+
var qi = class extends Hn {
|
|
1750
|
+
constructor(t2) {
|
|
1751
|
+
super(t2, 500);
|
|
1752
|
+
}
|
|
1753
|
+
o(t2) {
|
|
1754
|
+
return sn(this, 0, 1001, t2);
|
|
1755
|
+
}
|
|
1756
|
+
};
|
|
1757
|
+
var Ji = [-500, pi, [-500, di, -1, li, -3, [-2, Ni, hi], pi, ki, ci, -1, Wi, zi, pi, [0, di, ui], di, Bi, ci, li, 987, li], 4, pi, [-500, fi, -1, [-1, {}], 998, fi], pi, [-500, fi, li, -1, [-2, {}, hi], 997, li, -1], ci, pi, [-500, fi, li, Hi, 998, li], li, ci, Wi, zi, pi, [0, di, -1, Hi], li, -2, Bi, di, -1, ui, [0, ui, _i], 978, Hi, pi, ki];
|
|
1758
|
+
qi.prototype.g = Ai(Ji);
|
|
1759
|
+
var Zi = Ti(qi, Ji);
|
|
1760
|
+
var Qi = class extends Hn {
|
|
1761
|
+
constructor(t2) {
|
|
1762
|
+
super(t2);
|
|
1763
|
+
}
|
|
1764
|
+
};
|
|
1765
|
+
var ts = class extends Hn {
|
|
1766
|
+
constructor(t2) {
|
|
1767
|
+
super(t2);
|
|
1768
|
+
}
|
|
1769
|
+
g() {
|
|
1770
|
+
return rn(this, Qi, 1);
|
|
1771
|
+
}
|
|
1772
|
+
};
|
|
1773
|
+
var es = [0, pi, [0, oi, ti, fi, -1]];
|
|
1774
|
+
var ns = Ti(ts, es);
|
|
1775
|
+
var rs = class extends Hn {
|
|
1776
|
+
constructor(t2) {
|
|
1777
|
+
super(t2);
|
|
1778
|
+
}
|
|
1779
|
+
};
|
|
1780
|
+
var is = class extends Hn {
|
|
1781
|
+
constructor(t2) {
|
|
1782
|
+
super(t2);
|
|
1783
|
+
}
|
|
1784
|
+
};
|
|
1785
|
+
var ss = class extends Hn {
|
|
1786
|
+
constructor(t2) {
|
|
1787
|
+
super(t2);
|
|
1788
|
+
}
|
|
1789
|
+
h() {
|
|
1790
|
+
return en(this, rs, 2);
|
|
1791
|
+
}
|
|
1792
|
+
g() {
|
|
1793
|
+
return rn(this, is, 5);
|
|
1794
|
+
}
|
|
1795
|
+
};
|
|
1796
|
+
var os = Ti(class extends Hn {
|
|
1797
|
+
constructor(t2) {
|
|
1798
|
+
super(t2);
|
|
1799
|
+
}
|
|
1800
|
+
}, [0, li, ai, ni, [0, vi, [0, oi, -3], [0, ti, -3], [0, oi, -1, [0, pi, [0, oi, -2]]], pi, [0, ti, -1, fi, ti]], fi, -1, ri, pi, [0, oi, ti], li, ri]);
|
|
1801
|
+
var as = class extends Hn {
|
|
1802
|
+
constructor(t2) {
|
|
1803
|
+
super(t2);
|
|
1804
|
+
}
|
|
1805
|
+
};
|
|
1806
|
+
var cs = Ti(class extends Hn {
|
|
1807
|
+
constructor(t2) {
|
|
1808
|
+
super(t2);
|
|
1809
|
+
}
|
|
1810
|
+
}, [0, pi, [0, ti, -4]]);
|
|
1811
|
+
var hs = class extends Hn {
|
|
1812
|
+
constructor(t2) {
|
|
1813
|
+
super(t2);
|
|
1814
|
+
}
|
|
1815
|
+
};
|
|
1816
|
+
var us = Ti(class extends Hn {
|
|
1817
|
+
constructor(t2) {
|
|
1818
|
+
super(t2);
|
|
1819
|
+
}
|
|
1820
|
+
}, [0, pi, [0, ti, -4]]);
|
|
1821
|
+
var ls = class extends Hn {
|
|
1822
|
+
constructor(t2) {
|
|
1823
|
+
super(t2);
|
|
1824
|
+
}
|
|
1825
|
+
};
|
|
1826
|
+
var ds = [0, oi, -1, ni, vi];
|
|
1827
|
+
var fs = class extends Hn {
|
|
1828
|
+
constructor(t2) {
|
|
1829
|
+
super(t2);
|
|
1830
|
+
}
|
|
1831
|
+
};
|
|
1832
|
+
fs.prototype.g = Ai([0, ti, -4, ri]);
|
|
1833
|
+
var ps = class extends Hn {
|
|
1834
|
+
constructor(t2) {
|
|
1835
|
+
super(t2);
|
|
1836
|
+
}
|
|
1837
|
+
};
|
|
1838
|
+
var gs = Ti(class extends Hn {
|
|
1839
|
+
constructor(t2) {
|
|
1840
|
+
super(t2);
|
|
1841
|
+
}
|
|
1842
|
+
}, [0, pi, [0, 1, oi, fi, es], ri]);
|
|
1843
|
+
var ms = class extends Hn {
|
|
1844
|
+
constructor(t2) {
|
|
1845
|
+
super(t2);
|
|
1846
|
+
}
|
|
1847
|
+
};
|
|
1848
|
+
var ys = class extends Hn {
|
|
1849
|
+
constructor(t2) {
|
|
1850
|
+
super(t2);
|
|
1851
|
+
}
|
|
1852
|
+
oa() {
|
|
1853
|
+
const t2 = Ge(this);
|
|
1854
|
+
return null == t2 ? U() : t2;
|
|
1855
|
+
}
|
|
1856
|
+
};
|
|
1857
|
+
var _s = class extends Hn {
|
|
1858
|
+
constructor(t2) {
|
|
1859
|
+
super(t2);
|
|
1860
|
+
}
|
|
1861
|
+
};
|
|
1862
|
+
var vs = [1, 2];
|
|
1863
|
+
var Es = Ti(class extends Hn {
|
|
1864
|
+
constructor(t2) {
|
|
1865
|
+
super(t2);
|
|
1866
|
+
}
|
|
1867
|
+
}, [0, pi, [0, vs, gi, [0, ni], gi, [0, mi], oi, fi], ri]);
|
|
1868
|
+
var ws = class extends Hn {
|
|
1869
|
+
constructor(t2) {
|
|
1870
|
+
super(t2);
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
var Ts = [0, fi, oi, ti, li, -1];
|
|
1874
|
+
var As = class extends Hn {
|
|
1875
|
+
constructor(t2) {
|
|
1876
|
+
super(t2);
|
|
1877
|
+
}
|
|
1878
|
+
};
|
|
1879
|
+
var bs = [0, hi, -1];
|
|
1880
|
+
var ks = class extends Hn {
|
|
1881
|
+
constructor(t2) {
|
|
1882
|
+
super(t2);
|
|
1883
|
+
}
|
|
1884
|
+
};
|
|
1885
|
+
var Ss = [1, 2, 3, 4, 5];
|
|
1886
|
+
var xs = class extends Hn {
|
|
1887
|
+
constructor(t2) {
|
|
1888
|
+
super(t2);
|
|
1889
|
+
}
|
|
1890
|
+
g() {
|
|
1891
|
+
return null != Ge(this);
|
|
1892
|
+
}
|
|
1893
|
+
h() {
|
|
1894
|
+
return null != ln(this, 2);
|
|
1895
|
+
}
|
|
1896
|
+
};
|
|
1897
|
+
var Ls = class extends Hn {
|
|
1898
|
+
constructor(t2) {
|
|
1899
|
+
super(t2);
|
|
1900
|
+
}
|
|
1901
|
+
g() {
|
|
1902
|
+
return qt(Ce(this, 2)) ?? false;
|
|
1903
|
+
}
|
|
1904
|
+
};
|
|
1905
|
+
var Rs = [0, mi, fi, [0, oi, ri, -1], [0, si, ri]];
|
|
1906
|
+
var Fs = [0, Rs, hi, [0, Ss, gi, Ui, gi, Mi, gi, Fi, gi, Ci, gi, Pi], vi];
|
|
1907
|
+
var Is = class extends Hn {
|
|
1908
|
+
constructor(t2) {
|
|
1909
|
+
super(t2);
|
|
1910
|
+
}
|
|
1911
|
+
};
|
|
1912
|
+
var Ms = [0, Fs, ti, -1, oi];
|
|
1913
|
+
var Ps = wi(502141897, Is);
|
|
1914
|
+
Ni[502141897] = Ms;
|
|
1915
|
+
var Os = Ti(class extends Hn {
|
|
1916
|
+
constructor(t2) {
|
|
1917
|
+
super(t2);
|
|
1918
|
+
}
|
|
1919
|
+
}, [0, [0, vi, -1, ei, yi], ds]);
|
|
1920
|
+
var Cs = class extends Hn {
|
|
1921
|
+
constructor(t2) {
|
|
1922
|
+
super(t2);
|
|
1923
|
+
}
|
|
1924
|
+
};
|
|
1925
|
+
var Us = class extends Hn {
|
|
1926
|
+
constructor(t2) {
|
|
1927
|
+
super(t2);
|
|
1928
|
+
}
|
|
1929
|
+
};
|
|
1930
|
+
var Ds = [0, Fs, ti, [0, Fs], hi];
|
|
1931
|
+
var Ns = [0, Fs, Ms, Ds, ti, [0, [0, Rs]]];
|
|
1932
|
+
var Bs = wi(508968150, Us);
|
|
1933
|
+
Ni[508968150] = Ns, Ni[508968149] = Ds;
|
|
1934
|
+
var Gs = class extends Hn {
|
|
1935
|
+
constructor(t2) {
|
|
1936
|
+
super(t2);
|
|
1937
|
+
}
|
|
1938
|
+
};
|
|
1939
|
+
var js = wi(513916220, Gs);
|
|
1940
|
+
Ni[513916220] = [0, Fs, Ns, oi];
|
|
1941
|
+
var Vs = class extends Hn {
|
|
1942
|
+
constructor(t2) {
|
|
1943
|
+
super(t2);
|
|
1944
|
+
}
|
|
1945
|
+
h() {
|
|
1946
|
+
return en(this, ws, 2);
|
|
1947
|
+
}
|
|
1948
|
+
g() {
|
|
1949
|
+
De(this, 2);
|
|
1950
|
+
}
|
|
1951
|
+
};
|
|
1952
|
+
var Xs = [0, Fs, Ts];
|
|
1953
|
+
Ni[478825465] = Xs;
|
|
1954
|
+
var Hs = class extends Hn {
|
|
1955
|
+
constructor(t2) {
|
|
1956
|
+
super(t2);
|
|
1957
|
+
}
|
|
1958
|
+
};
|
|
1959
|
+
var Ws = class extends Hn {
|
|
1960
|
+
constructor(t2) {
|
|
1961
|
+
super(t2);
|
|
1962
|
+
}
|
|
1963
|
+
};
|
|
1964
|
+
var zs = class extends Hn {
|
|
1965
|
+
constructor(t2) {
|
|
1966
|
+
super(t2);
|
|
1967
|
+
}
|
|
1968
|
+
};
|
|
1969
|
+
var Ks = class extends Hn {
|
|
1970
|
+
constructor(t2) {
|
|
1971
|
+
super(t2);
|
|
1972
|
+
}
|
|
1973
|
+
};
|
|
1974
|
+
var Ys = class extends Hn {
|
|
1975
|
+
constructor(t2) {
|
|
1976
|
+
super(t2);
|
|
1977
|
+
}
|
|
1978
|
+
};
|
|
1979
|
+
var $s = [0, Fs, [0, Fs], Xs, -1];
|
|
1980
|
+
var qs = [0, Fs, ti, oi];
|
|
1981
|
+
var Js = [0, Fs, ti];
|
|
1982
|
+
var Zs = [0, Fs, qs, Js, ti];
|
|
1983
|
+
var Qs = wi(479097054, Ys);
|
|
1984
|
+
Ni[479097054] = [0, Fs, Zs, $s], Ni[463370452] = $s, Ni[464864288] = qs;
|
|
1985
|
+
var to = wi(462713202, Ks);
|
|
1986
|
+
Ni[462713202] = Zs, Ni[474472470] = Js;
|
|
1987
|
+
var eo = class extends Hn {
|
|
1988
|
+
constructor(t2) {
|
|
1989
|
+
super(t2);
|
|
1990
|
+
}
|
|
1991
|
+
};
|
|
1992
|
+
var no = class extends Hn {
|
|
1993
|
+
constructor(t2) {
|
|
1994
|
+
super(t2);
|
|
1995
|
+
}
|
|
1996
|
+
};
|
|
1997
|
+
var ro = class extends Hn {
|
|
1998
|
+
constructor(t2) {
|
|
1999
|
+
super(t2);
|
|
2000
|
+
}
|
|
2001
|
+
};
|
|
2002
|
+
var io = class extends Hn {
|
|
2003
|
+
constructor(t2) {
|
|
2004
|
+
super(t2);
|
|
2005
|
+
}
|
|
2006
|
+
};
|
|
2007
|
+
var so = [0, Fs, ti, -1, oi];
|
|
2008
|
+
var oo = [0, Fs, ti, hi];
|
|
2009
|
+
io.prototype.g = Ai([0, Fs, Js, [0, Fs], Ms, Ds, so, oo]);
|
|
2010
|
+
var ao = class extends Hn {
|
|
2011
|
+
constructor(t2) {
|
|
2012
|
+
super(t2);
|
|
2013
|
+
}
|
|
2014
|
+
};
|
|
2015
|
+
var co = wi(456383383, ao);
|
|
2016
|
+
Ni[456383383] = [0, Fs, Ts];
|
|
2017
|
+
var ho = class extends Hn {
|
|
2018
|
+
constructor(t2) {
|
|
2019
|
+
super(t2);
|
|
2020
|
+
}
|
|
2021
|
+
};
|
|
2022
|
+
var uo = wi(476348187, ho);
|
|
2023
|
+
Ni[476348187] = [0, Fs, bs];
|
|
2024
|
+
var lo = class extends Hn {
|
|
2025
|
+
constructor(t2) {
|
|
2026
|
+
super(t2);
|
|
2027
|
+
}
|
|
2028
|
+
};
|
|
2029
|
+
var fo = class extends Hn {
|
|
2030
|
+
constructor(t2) {
|
|
2031
|
+
super(t2);
|
|
2032
|
+
}
|
|
2033
|
+
};
|
|
2034
|
+
var po = [0, vi, -1];
|
|
2035
|
+
var go = wi(458105876, class extends Hn {
|
|
2036
|
+
constructor(t2) {
|
|
2037
|
+
super(t2);
|
|
2038
|
+
}
|
|
2039
|
+
g() {
|
|
2040
|
+
var t2 = this.u;
|
|
2041
|
+
const e2 = 0 | t2[Z];
|
|
2042
|
+
const n2 = 2 & e2;
|
|
2043
|
+
return t2 = function(t3, e3, n3) {
|
|
2044
|
+
var r2 = fo;
|
|
2045
|
+
const i2 = 2 & e3;
|
|
2046
|
+
let s2 = false;
|
|
2047
|
+
if (null == n3) {
|
|
2048
|
+
if (i2) return be();
|
|
2049
|
+
n3 = [];
|
|
2050
|
+
} else if (n3.constructor === ye) {
|
|
2051
|
+
if (0 == (2 & n3.L) || i2) return n3;
|
|
2052
|
+
n3 = n3.X();
|
|
2053
|
+
} else Array.isArray(n3) ? s2 = !!(2 & (0 | n3[Z])) : n3 = [];
|
|
2054
|
+
if (i2) {
|
|
2055
|
+
if (!n3.length) return be();
|
|
2056
|
+
s2 || (s2 = true, rt(n3));
|
|
2057
|
+
} else s2 && (s2 = false, n3 = ze(n3));
|
|
2058
|
+
return s2 || (64 & (0 | n3[Z]) ? n3[Z] &= -33 : 32 & e3 && et(n3, 32)), Ne(t3, e3, 2, r2 = new ye(n3, r2, ue, void 0)), r2;
|
|
2059
|
+
}(t2, e2, Ue(t2, e2, 2)), !n2 && fo && (t2.ra = true), t2;
|
|
2060
|
+
}
|
|
2061
|
+
});
|
|
2062
|
+
Ni[458105876] = [0, po, Wr, [true, ri, [0, fi, -1, li]]];
|
|
2063
|
+
var mo = class extends Hn {
|
|
2064
|
+
constructor(t2) {
|
|
2065
|
+
super(t2);
|
|
2066
|
+
}
|
|
2067
|
+
};
|
|
2068
|
+
var yo = wi(458105758, mo);
|
|
2069
|
+
Ni[458105758] = [0, Fs, fi, po];
|
|
2070
|
+
var _o = class extends Hn {
|
|
2071
|
+
constructor(t2) {
|
|
2072
|
+
super(t2);
|
|
2073
|
+
}
|
|
2074
|
+
};
|
|
2075
|
+
var vo = wi(443442058, _o);
|
|
2076
|
+
Ni[443442058] = [0, Fs, fi, oi, ti, li, -1, hi, ti], Ni[514774813] = so;
|
|
2077
|
+
var Eo = class extends Hn {
|
|
2078
|
+
constructor(t2) {
|
|
2079
|
+
super(t2);
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
2082
|
+
var wo = wi(516587230, Eo);
|
|
2083
|
+
function To(t2, e2) {
|
|
2084
|
+
return e2 = e2 ? e2.clone() : new ws(), void 0 !== t2.displayNamesLocale ? De(e2, 1, ae(t2.displayNamesLocale)) : void 0 === t2.displayNamesLocale && De(e2, 1), void 0 !== t2.maxResults ? pn(e2, 2, t2.maxResults) : "maxResults" in t2 && De(e2, 2), void 0 !== t2.scoreThreshold ? gn(e2, 3, t2.scoreThreshold) : "scoreThreshold" in t2 && De(e2, 3), void 0 !== t2.categoryAllowlist ? mn(e2, 4, t2.categoryAllowlist) : "categoryAllowlist" in t2 && De(e2, 4), void 0 !== t2.categoryDenylist ? mn(e2, 5, t2.categoryDenylist) : "categoryDenylist" in t2 && De(e2, 5), e2;
|
|
2085
|
+
}
|
|
2086
|
+
function Ao(t2, e2 = -1, n2 = "") {
|
|
2087
|
+
return { categories: t2.map((t3) => ({ index: un(t3, 1) ?? 0 ?? -1, score: dn(t3, 2) ?? 0, categoryName: ln(t3, 3) ?? "" ?? "", displayName: ln(t3, 4) ?? "" ?? "" })), headIndex: e2, headName: n2 };
|
|
2088
|
+
}
|
|
2089
|
+
function bo(t2) {
|
|
2090
|
+
var e2 = Ve(t2, 3, $t, je()), n2 = Ve(t2, 2, Qt, je()), r2 = Ve(t2, 1, ce, je()), i2 = Ve(t2, 9, ce, je());
|
|
2091
|
+
const s2 = { categories: [], keypoints: [] };
|
|
2092
|
+
for (let t3 = 0; t3 < e2.length; t3++) s2.categories.push({ score: e2[t3], index: n2[t3] ?? -1, categoryName: r2[t3] ?? "", displayName: i2[t3] ?? "" });
|
|
2093
|
+
if ((e2 = en(t2, ss, 4)?.h()) && (s2.boundingBox = { originX: un(e2, 1) ?? 0, originY: un(e2, 2) ?? 0, width: un(e2, 3) ?? 0, height: un(e2, 4) ?? 0, angle: 0 }), en(t2, ss, 4)?.g().length) for (const e3 of en(t2, ss, 4).g()) s2.keypoints.push({ x: Be(e3, 1) ?? 0, y: Be(e3, 2) ?? 0, score: Be(e3, 4) ?? 0, label: ln(e3, 3) ?? "" });
|
|
2094
|
+
return s2;
|
|
2095
|
+
}
|
|
2096
|
+
function ko(t2) {
|
|
2097
|
+
const e2 = [];
|
|
2098
|
+
for (const n2 of rn(t2, hs, 1)) e2.push({ x: dn(n2, 1) ?? 0, y: dn(n2, 2) ?? 0, z: dn(n2, 3) ?? 0, visibility: dn(n2, 4) ?? 0 });
|
|
2099
|
+
return e2;
|
|
2100
|
+
}
|
|
2101
|
+
function So(t2) {
|
|
2102
|
+
const e2 = [];
|
|
2103
|
+
for (const n2 of rn(t2, as, 1)) e2.push({ x: dn(n2, 1) ?? 0, y: dn(n2, 2) ?? 0, z: dn(n2, 3) ?? 0, visibility: dn(n2, 4) ?? 0 });
|
|
2104
|
+
return e2;
|
|
2105
|
+
}
|
|
2106
|
+
function xo(t2) {
|
|
2107
|
+
return Array.from(t2, (t3) => t3 > 127 ? t3 - 256 : t3);
|
|
2108
|
+
}
|
|
2109
|
+
function Lo(t2, e2) {
|
|
2110
|
+
if (t2.length !== e2.length) throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t2.length} vs. ${e2.length}).`);
|
|
2111
|
+
let n2 = 0, r2 = 0, i2 = 0;
|
|
2112
|
+
for (let s2 = 0; s2 < t2.length; s2++) n2 += t2[s2] * e2[s2], r2 += t2[s2] * t2[s2], i2 += e2[s2] * e2[s2];
|
|
2113
|
+
if (r2 <= 0 || i2 <= 0) throw Error("Cannot compute cosine similarity on embedding with 0 norm.");
|
|
2114
|
+
return n2 / Math.sqrt(r2 * i2);
|
|
2115
|
+
}
|
|
2116
|
+
var Ro;
|
|
2117
|
+
Ni[516587230] = [0, Fs, so, oo, ti], Ni[518928384] = oo;
|
|
2118
|
+
var Fo = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11]);
|
|
2119
|
+
async function Io() {
|
|
2120
|
+
if (void 0 === Ro) try {
|
|
2121
|
+
await WebAssembly.instantiate(Fo), Ro = true;
|
|
2122
|
+
} catch {
|
|
2123
|
+
Ro = false;
|
|
2124
|
+
}
|
|
2125
|
+
return Ro;
|
|
2126
|
+
}
|
|
2127
|
+
async function Mo(t2, e2 = Ri``) {
|
|
2128
|
+
const n2 = await Io() ? "wasm_internal" : "wasm_nosimd_internal";
|
|
2129
|
+
return { wasmLoaderPath: `${e2}/${t2}_${n2}.js`, wasmBinaryPath: `${e2}/${t2}_${n2}.wasm` };
|
|
2130
|
+
}
|
|
2131
|
+
var Po = class {
|
|
2132
|
+
};
|
|
2133
|
+
function Oo() {
|
|
2134
|
+
var t2 = navigator;
|
|
2135
|
+
return "undefined" != typeof OffscreenCanvas && (!function(t3 = navigator) {
|
|
2136
|
+
return (t3 = t3.userAgent).includes("Safari") && !t3.includes("Chrome");
|
|
2137
|
+
}(t2) || !!((t2 = t2.userAgent.match(/Version\/([\d]+).*Safari/)) && t2.length >= 1 && Number(t2[1]) >= 17));
|
|
2138
|
+
}
|
|
2139
|
+
async function Co(t2) {
|
|
2140
|
+
if ("function" != typeof importScripts) {
|
|
2141
|
+
const e2 = document.createElement("script");
|
|
2142
|
+
return e2.src = t2.toString(), e2.crossOrigin = "anonymous", new Promise((t3, n2) => {
|
|
2143
|
+
e2.addEventListener("load", () => {
|
|
2144
|
+
t3();
|
|
2145
|
+
}, false), e2.addEventListener("error", (t4) => {
|
|
2146
|
+
n2(t4);
|
|
2147
|
+
}, false), document.body.appendChild(e2);
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
importScripts(t2.toString());
|
|
2151
|
+
}
|
|
2152
|
+
function Uo(t2) {
|
|
2153
|
+
return void 0 !== t2.videoWidth ? [t2.videoWidth, t2.videoHeight] : void 0 !== t2.naturalWidth ? [t2.naturalWidth, t2.naturalHeight] : void 0 !== t2.displayWidth ? [t2.displayWidth, t2.displayHeight] : [t2.width, t2.height];
|
|
2154
|
+
}
|
|
2155
|
+
function Do(t2, e2, n2) {
|
|
2156
|
+
t2.m || console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"), n2(e2 = t2.i.stringToNewUTF8(e2)), t2.i._free(e2);
|
|
2157
|
+
}
|
|
2158
|
+
function No(t2, e2, n2) {
|
|
2159
|
+
if (!t2.i.canvas) throw Error("No OpenGL canvas configured.");
|
|
2160
|
+
if (n2 ? t2.i._bindTextureToStream(n2) : t2.i._bindTextureToCanvas(), !(n2 = t2.i.canvas.getContext("webgl2") || t2.i.canvas.getContext("webgl"))) throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");
|
|
2161
|
+
t2.i.gpuOriginForWebTexturesIsBottomLeft && n2.pixelStorei(n2.UNPACK_FLIP_Y_WEBGL, true), n2.texImage2D(n2.TEXTURE_2D, 0, n2.RGBA, n2.RGBA, n2.UNSIGNED_BYTE, e2), t2.i.gpuOriginForWebTexturesIsBottomLeft && n2.pixelStorei(n2.UNPACK_FLIP_Y_WEBGL, false);
|
|
2162
|
+
const [r2, i2] = Uo(e2);
|
|
2163
|
+
return !t2.l || r2 === t2.i.canvas.width && i2 === t2.i.canvas.height || (t2.i.canvas.width = r2, t2.i.canvas.height = i2), [r2, i2];
|
|
2164
|
+
}
|
|
2165
|
+
function Bo(t2, e2, n2) {
|
|
2166
|
+
t2.m || console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");
|
|
2167
|
+
const r2 = new Uint32Array(e2.length);
|
|
2168
|
+
for (let n3 = 0; n3 < e2.length; n3++) r2[n3] = t2.i.stringToNewUTF8(e2[n3]);
|
|
2169
|
+
e2 = t2.i._malloc(4 * r2.length), t2.i.HEAPU32.set(r2, e2 >> 2), n2(e2);
|
|
2170
|
+
for (const e3 of r2) t2.i._free(e3);
|
|
2171
|
+
t2.i._free(e2);
|
|
2172
|
+
}
|
|
2173
|
+
function Go(t2, e2, n2) {
|
|
2174
|
+
t2.i.simpleListeners = t2.i.simpleListeners || {}, t2.i.simpleListeners[e2] = n2;
|
|
2175
|
+
}
|
|
2176
|
+
function jo(t2, e2, n2) {
|
|
2177
|
+
let r2 = [];
|
|
2178
|
+
t2.i.simpleListeners = t2.i.simpleListeners || {}, t2.i.simpleListeners[e2] = (t3, e3, i2) => {
|
|
2179
|
+
e3 ? (n2(r2, i2), r2 = []) : r2.push(t3);
|
|
2180
|
+
};
|
|
2181
|
+
}
|
|
2182
|
+
Po.forVisionTasks = function(t2) {
|
|
2183
|
+
return Mo("vision", t2);
|
|
2184
|
+
}, Po.forTextTasks = function(t2) {
|
|
2185
|
+
return Mo("text", t2);
|
|
2186
|
+
}, Po.forGenAiExperimentalTasks = function(t2) {
|
|
2187
|
+
return Mo("genai_experimental", t2);
|
|
2188
|
+
}, Po.forGenAiTasks = function(t2) {
|
|
2189
|
+
return Mo("genai", t2);
|
|
2190
|
+
}, Po.forAudioTasks = function(t2) {
|
|
2191
|
+
return Mo("audio", t2);
|
|
2192
|
+
}, Po.isSimdSupported = function() {
|
|
2193
|
+
return Io();
|
|
2194
|
+
};
|
|
2195
|
+
async function Vo(t2, e2, n2, r2) {
|
|
2196
|
+
return t2 = await (async (t3, e3, n3, r3, i2) => {
|
|
2197
|
+
if (e3 && await Co(e3), !self.ModuleFactory) throw Error("ModuleFactory not set.");
|
|
2198
|
+
if (n3 && (await Co(n3), !self.ModuleFactory)) throw Error("ModuleFactory not set.");
|
|
2199
|
+
return self.Module && i2 && ((e3 = self.Module).locateFile = i2.locateFile, i2.mainScriptUrlOrBlob && (e3.mainScriptUrlOrBlob = i2.mainScriptUrlOrBlob)), i2 = await self.ModuleFactory(self.Module || i2), self.ModuleFactory = self.Module = void 0, new t3(i2, r3);
|
|
2200
|
+
})(t2, n2.wasmLoaderPath, n2.assetLoaderPath, e2, { locateFile: (t3) => t3.endsWith(".wasm") ? n2.wasmBinaryPath.toString() : n2.assetBinaryPath && t3.endsWith(".data") ? n2.assetBinaryPath.toString() : t3 }), await t2.o(r2), t2;
|
|
2201
|
+
}
|
|
2202
|
+
function Xo(t2, e2) {
|
|
2203
|
+
const n2 = en(t2.baseOptions, xs, 1) || new xs();
|
|
2204
|
+
"string" == typeof e2 ? (De(n2, 2, ae(e2)), De(n2, 1)) : e2 instanceof Uint8Array && (De(n2, 1, ft(e2, false)), De(n2, 2)), sn(t2.baseOptions, 0, 1, n2);
|
|
2205
|
+
}
|
|
2206
|
+
function Ho(t2) {
|
|
2207
|
+
try {
|
|
2208
|
+
const e2 = t2.G.length;
|
|
2209
|
+
if (1 === e2) throw Error(t2.G[0].message);
|
|
2210
|
+
if (e2 > 1) throw Error("Encountered multiple errors: " + t2.G.map((t3) => t3.message).join(", "));
|
|
2211
|
+
} finally {
|
|
2212
|
+
t2.G = [];
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
function Wo(t2, e2) {
|
|
2216
|
+
t2.B = Math.max(t2.B, e2);
|
|
2217
|
+
}
|
|
2218
|
+
function zo(t2, e2) {
|
|
2219
|
+
t2.A = new Xi(), Gi(t2.A, "PassThroughCalculator"), ji(t2.A, "free_memory"), Vi(t2.A, "free_memory_unused_out"), Yi(e2, "free_memory"), Ki(e2, t2.A);
|
|
2220
|
+
}
|
|
2221
|
+
function Ko(t2, e2) {
|
|
2222
|
+
ji(t2.A, e2), Vi(t2.A, e2 + "_unused_out");
|
|
2223
|
+
}
|
|
2224
|
+
function Yo(t2) {
|
|
2225
|
+
t2.g.addBoolToStream(true, "free_memory", t2.B);
|
|
2226
|
+
}
|
|
2227
|
+
var $o = class {
|
|
2228
|
+
constructor(t2) {
|
|
2229
|
+
this.g = t2, this.G = [], this.B = 0, this.g.setAutoRenderToScreen(false);
|
|
2230
|
+
}
|
|
2231
|
+
l(t2, e2 = true) {
|
|
2232
|
+
if (e2) {
|
|
2233
|
+
const e3 = t2.baseOptions || {};
|
|
2234
|
+
if (t2.baseOptions?.modelAssetBuffer && t2.baseOptions?.modelAssetPath) throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");
|
|
2235
|
+
if (!(en(this.baseOptions, xs, 1)?.g() || en(this.baseOptions, xs, 1)?.h() || t2.baseOptions?.modelAssetBuffer || t2.baseOptions?.modelAssetPath)) throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");
|
|
2236
|
+
if (function(t3, e4) {
|
|
2237
|
+
let n2 = en(t3.baseOptions, ks, 3);
|
|
2238
|
+
if (!n2) {
|
|
2239
|
+
var r2 = n2 = new ks(), i2 = new Oi();
|
|
2240
|
+
on(r2, 4, Ss, i2);
|
|
2241
|
+
}
|
|
2242
|
+
"delegate" in e4 && ("GPU" === e4.delegate ? (e4 = n2, r2 = new Ii(), on(e4, 2, Ss, r2)) : (e4 = n2, r2 = new Oi(), on(e4, 4, Ss, r2))), sn(t3.baseOptions, 0, 3, n2);
|
|
2243
|
+
}(this, e3), e3.modelAssetPath) return fetch(e3.modelAssetPath.toString()).then((t3) => {
|
|
2244
|
+
if (t3.ok) return t3.arrayBuffer();
|
|
2245
|
+
throw Error(`Failed to fetch model: ${e3.modelAssetPath} (${t3.status})`);
|
|
2246
|
+
}).then((t3) => {
|
|
2247
|
+
try {
|
|
2248
|
+
this.g.i.FS_unlink("/model.dat");
|
|
2249
|
+
} catch {
|
|
2250
|
+
}
|
|
2251
|
+
this.g.i.FS_createDataFile("/", "model.dat", new Uint8Array(t3), true, false, false), Xo(this, "/model.dat"), this.m(), this.I();
|
|
2252
|
+
});
|
|
2253
|
+
if (e3.modelAssetBuffer instanceof Uint8Array) Xo(this, e3.modelAssetBuffer);
|
|
2254
|
+
else if (e3.modelAssetBuffer) return async function(t3) {
|
|
2255
|
+
const e4 = [];
|
|
2256
|
+
for (var n2 = 0; ; ) {
|
|
2257
|
+
const { done: r2, value: i2 } = await t3.read();
|
|
2258
|
+
if (r2) break;
|
|
2259
|
+
e4.push(i2), n2 += i2.length;
|
|
2260
|
+
}
|
|
2261
|
+
if (0 === e4.length) return new Uint8Array(0);
|
|
2262
|
+
if (1 === e4.length) return e4[0];
|
|
2263
|
+
t3 = new Uint8Array(n2), n2 = 0;
|
|
2264
|
+
for (const r2 of e4) t3.set(r2, n2), n2 += r2.length;
|
|
2265
|
+
return t3;
|
|
2266
|
+
}(e3.modelAssetBuffer).then((t3) => {
|
|
2267
|
+
Xo(this, t3), this.m(), this.I();
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
return this.m(), this.I(), Promise.resolve();
|
|
2271
|
+
}
|
|
2272
|
+
I() {
|
|
2273
|
+
}
|
|
2274
|
+
da() {
|
|
2275
|
+
let t2;
|
|
2276
|
+
if (this.g.da((e2) => {
|
|
2277
|
+
t2 = Zi(e2);
|
|
2278
|
+
}), !t2) throw Error("Failed to retrieve CalculatorGraphConfig");
|
|
2279
|
+
return t2;
|
|
2280
|
+
}
|
|
2281
|
+
setGraph(t2, e2) {
|
|
2282
|
+
this.g.attachErrorListener((t3, e3) => {
|
|
2283
|
+
this.G.push(Error(e3));
|
|
2284
|
+
}), this.g.La(), this.g.setGraph(t2, e2), this.A = void 0, Ho(this);
|
|
2285
|
+
}
|
|
2286
|
+
finishProcessing() {
|
|
2287
|
+
this.g.finishProcessing(), Ho(this);
|
|
2288
|
+
}
|
|
2289
|
+
close() {
|
|
2290
|
+
this.A = void 0, this.g.closeGraph();
|
|
2291
|
+
}
|
|
2292
|
+
};
|
|
2293
|
+
function qo(t2, e2) {
|
|
2294
|
+
if (!t2) throw Error(`Unable to obtain required WebGL resource: ${e2}`);
|
|
2295
|
+
return t2;
|
|
2296
|
+
}
|
|
2297
|
+
$o.prototype.close = $o.prototype.close, function(e2, n2) {
|
|
2298
|
+
e2 = e2.split(".");
|
|
2299
|
+
var r2, i2 = t;
|
|
2300
|
+
e2[0] in i2 || void 0 === i2.execScript || i2.execScript("var " + e2[0]);
|
|
2301
|
+
for (; e2.length && (r2 = e2.shift()); ) e2.length || void 0 === n2 ? i2 = i2[r2] && i2[r2] !== Object.prototype[r2] ? i2[r2] : i2[r2] = {} : i2[r2] = n2;
|
|
2302
|
+
}("TaskRunner", $o);
|
|
2303
|
+
var Jo = class {
|
|
2304
|
+
constructor(t2, e2, n2, r2) {
|
|
2305
|
+
this.g = t2, this.h = e2, this.m = n2, this.l = r2;
|
|
2306
|
+
}
|
|
2307
|
+
bind() {
|
|
2308
|
+
this.g.bindVertexArray(this.h);
|
|
2309
|
+
}
|
|
2310
|
+
close() {
|
|
2311
|
+
this.g.deleteVertexArray(this.h), this.g.deleteBuffer(this.m), this.g.deleteBuffer(this.l);
|
|
2312
|
+
}
|
|
2313
|
+
};
|
|
2314
|
+
function Zo(t2, e2, n2) {
|
|
2315
|
+
const r2 = t2.g;
|
|
2316
|
+
if (n2 = qo(r2.createShader(n2), "Failed to create WebGL shader"), r2.shaderSource(n2, e2), r2.compileShader(n2), !r2.getShaderParameter(n2, r2.COMPILE_STATUS)) throw Error(`Could not compile WebGL shader: ${r2.getShaderInfoLog(n2)}`);
|
|
2317
|
+
return r2.attachShader(t2.h, n2), n2;
|
|
2318
|
+
}
|
|
2319
|
+
function Qo(t2, e2) {
|
|
2320
|
+
const n2 = t2.g, r2 = qo(n2.createVertexArray(), "Failed to create vertex array");
|
|
2321
|
+
n2.bindVertexArray(r2);
|
|
2322
|
+
const i2 = qo(n2.createBuffer(), "Failed to create buffer");
|
|
2323
|
+
n2.bindBuffer(n2.ARRAY_BUFFER, i2), n2.enableVertexAttribArray(t2.O), n2.vertexAttribPointer(t2.O, 2, n2.FLOAT, false, 0, 0), n2.bufferData(n2.ARRAY_BUFFER, new Float32Array([-1, -1, -1, 1, 1, 1, 1, -1]), n2.STATIC_DRAW);
|
|
2324
|
+
const s2 = qo(n2.createBuffer(), "Failed to create buffer");
|
|
2325
|
+
return n2.bindBuffer(n2.ARRAY_BUFFER, s2), n2.enableVertexAttribArray(t2.I), n2.vertexAttribPointer(t2.I, 2, n2.FLOAT, false, 0, 0), n2.bufferData(n2.ARRAY_BUFFER, new Float32Array(e2 ? [0, 1, 0, 0, 1, 0, 1, 1] : [0, 0, 0, 1, 1, 1, 1, 0]), n2.STATIC_DRAW), n2.bindBuffer(n2.ARRAY_BUFFER, null), n2.bindVertexArray(null), new Jo(n2, r2, i2, s2);
|
|
2326
|
+
}
|
|
2327
|
+
function ta(t2, e2) {
|
|
2328
|
+
if (t2.g) {
|
|
2329
|
+
if (e2 !== t2.g) throw Error("Cannot change GL context once initialized");
|
|
2330
|
+
} else t2.g = e2;
|
|
2331
|
+
}
|
|
2332
|
+
function ea(t2, e2, n2, r2) {
|
|
2333
|
+
return ta(t2, e2), t2.h || (t2.m(), t2.C()), n2 ? (t2.s || (t2.s = Qo(t2, true)), n2 = t2.s) : (t2.v || (t2.v = Qo(t2, false)), n2 = t2.v), e2.useProgram(t2.h), n2.bind(), t2.l(), t2 = r2(), n2.g.bindVertexArray(null), t2;
|
|
2334
|
+
}
|
|
2335
|
+
function na(t2, e2, n2) {
|
|
2336
|
+
return ta(t2, e2), t2 = qo(e2.createTexture(), "Failed to create texture"), e2.bindTexture(e2.TEXTURE_2D, t2), e2.texParameteri(e2.TEXTURE_2D, e2.TEXTURE_WRAP_S, e2.CLAMP_TO_EDGE), e2.texParameteri(e2.TEXTURE_2D, e2.TEXTURE_WRAP_T, e2.CLAMP_TO_EDGE), e2.texParameteri(e2.TEXTURE_2D, e2.TEXTURE_MIN_FILTER, n2 ?? e2.LINEAR), e2.texParameteri(e2.TEXTURE_2D, e2.TEXTURE_MAG_FILTER, n2 ?? e2.LINEAR), e2.bindTexture(e2.TEXTURE_2D, null), t2;
|
|
2337
|
+
}
|
|
2338
|
+
function ra(t2, e2, n2) {
|
|
2339
|
+
ta(t2, e2), t2.A || (t2.A = qo(e2.createFramebuffer(), "Failed to create framebuffe.")), e2.bindFramebuffer(e2.FRAMEBUFFER, t2.A), e2.framebufferTexture2D(e2.FRAMEBUFFER, e2.COLOR_ATTACHMENT0, e2.TEXTURE_2D, n2, 0);
|
|
2340
|
+
}
|
|
2341
|
+
function ia(t2) {
|
|
2342
|
+
t2.g?.bindFramebuffer(t2.g.FRAMEBUFFER, null);
|
|
2343
|
+
}
|
|
2344
|
+
var sa = class {
|
|
2345
|
+
G() {
|
|
2346
|
+
return "\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n ";
|
|
2347
|
+
}
|
|
2348
|
+
m() {
|
|
2349
|
+
const t2 = this.g;
|
|
2350
|
+
if (this.h = qo(t2.createProgram(), "Failed to create WebGL program"), this.aa = Zo(this, "\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }", t2.VERTEX_SHADER), this.Z = Zo(this, this.G(), t2.FRAGMENT_SHADER), t2.linkProgram(this.h), !t2.getProgramParameter(this.h, t2.LINK_STATUS)) throw Error(`Error during program linking: ${t2.getProgramInfoLog(this.h)}`);
|
|
2351
|
+
this.O = t2.getAttribLocation(this.h, "aVertex"), this.I = t2.getAttribLocation(this.h, "aTex");
|
|
2352
|
+
}
|
|
2353
|
+
C() {
|
|
2354
|
+
}
|
|
2355
|
+
l() {
|
|
2356
|
+
}
|
|
2357
|
+
close() {
|
|
2358
|
+
if (this.h) {
|
|
2359
|
+
const t2 = this.g;
|
|
2360
|
+
t2.deleteProgram(this.h), t2.deleteShader(this.aa), t2.deleteShader(this.Z);
|
|
2361
|
+
}
|
|
2362
|
+
this.A && this.g.deleteFramebuffer(this.A), this.v && this.v.close(), this.s && this.s.close();
|
|
2363
|
+
}
|
|
2364
|
+
};
|
|
2365
|
+
var oa = class extends sa {
|
|
2366
|
+
G() {
|
|
2367
|
+
return "\n precision mediump float;\n uniform sampler2D backgroundTexture;\n uniform sampler2D maskTexture;\n uniform sampler2D colorMappingTexture;\n varying vec2 vTex;\n void main() {\n vec4 backgroundColor = texture2D(backgroundTexture, vTex);\n float category = texture2D(maskTexture, vTex).r;\n vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));\n gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);\n }\n ";
|
|
2368
|
+
}
|
|
2369
|
+
C() {
|
|
2370
|
+
const t2 = this.g;
|
|
2371
|
+
t2.activeTexture(t2.TEXTURE1), this.B = na(this, t2, t2.LINEAR), t2.activeTexture(t2.TEXTURE2), this.j = na(this, t2, t2.NEAREST);
|
|
2372
|
+
}
|
|
2373
|
+
m() {
|
|
2374
|
+
super.m();
|
|
2375
|
+
const t2 = this.g;
|
|
2376
|
+
this.K = qo(t2.getUniformLocation(this.h, "backgroundTexture"), "Uniform location"), this.T = qo(t2.getUniformLocation(this.h, "colorMappingTexture"), "Uniform location"), this.J = qo(t2.getUniformLocation(this.h, "maskTexture"), "Uniform location");
|
|
2377
|
+
}
|
|
2378
|
+
l() {
|
|
2379
|
+
super.l();
|
|
2380
|
+
const t2 = this.g;
|
|
2381
|
+
t2.uniform1i(this.J, 0), t2.uniform1i(this.K, 1), t2.uniform1i(this.T, 2);
|
|
2382
|
+
}
|
|
2383
|
+
close() {
|
|
2384
|
+
this.B && this.g.deleteTexture(this.B), this.j && this.g.deleteTexture(this.j), super.close();
|
|
2385
|
+
}
|
|
2386
|
+
};
|
|
2387
|
+
var aa = class extends sa {
|
|
2388
|
+
G() {
|
|
2389
|
+
return "\n precision mediump float;\n uniform sampler2D maskTexture;\n uniform sampler2D defaultTexture;\n uniform sampler2D overlayTexture;\n varying vec2 vTex;\n void main() {\n float confidence = texture2D(maskTexture, vTex).r;\n vec4 defaultColor = texture2D(defaultTexture, vTex);\n vec4 overlayColor = texture2D(overlayTexture, vTex);\n // Apply the alpha from the overlay and merge in the default color\n overlayColor = mix(defaultColor, overlayColor, overlayColor.a);\n gl_FragColor = mix(defaultColor, overlayColor, confidence);\n }\n ";
|
|
2390
|
+
}
|
|
2391
|
+
C() {
|
|
2392
|
+
const t2 = this.g;
|
|
2393
|
+
t2.activeTexture(t2.TEXTURE1), this.j = na(this, t2), t2.activeTexture(t2.TEXTURE2), this.B = na(this, t2);
|
|
2394
|
+
}
|
|
2395
|
+
m() {
|
|
2396
|
+
super.m();
|
|
2397
|
+
const t2 = this.g;
|
|
2398
|
+
this.J = qo(t2.getUniformLocation(this.h, "defaultTexture"), "Uniform location"), this.K = qo(t2.getUniformLocation(this.h, "overlayTexture"), "Uniform location"), this.H = qo(t2.getUniformLocation(this.h, "maskTexture"), "Uniform location");
|
|
2399
|
+
}
|
|
2400
|
+
l() {
|
|
2401
|
+
super.l();
|
|
2402
|
+
const t2 = this.g;
|
|
2403
|
+
t2.uniform1i(this.H, 0), t2.uniform1i(this.J, 1), t2.uniform1i(this.K, 2);
|
|
2404
|
+
}
|
|
2405
|
+
close() {
|
|
2406
|
+
this.j && this.g.deleteTexture(this.j), this.B && this.g.deleteTexture(this.B), super.close();
|
|
2407
|
+
}
|
|
2408
|
+
};
|
|
2409
|
+
function ca(t2, e2) {
|
|
2410
|
+
switch (e2) {
|
|
2411
|
+
case 0:
|
|
2412
|
+
return t2.g.find((t3) => t3 instanceof Uint8Array);
|
|
2413
|
+
case 1:
|
|
2414
|
+
return t2.g.find((t3) => t3 instanceof Float32Array);
|
|
2415
|
+
case 2:
|
|
2416
|
+
return t2.g.find((t3) => "undefined" != typeof WebGLTexture && t3 instanceof WebGLTexture);
|
|
2417
|
+
default:
|
|
2418
|
+
throw Error(`Type is not supported: ${e2}`);
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
function ha(t2) {
|
|
2422
|
+
var e2 = ca(t2, 1);
|
|
2423
|
+
if (!e2) {
|
|
2424
|
+
if (e2 = ca(t2, 0)) e2 = new Float32Array(e2).map((t3) => t3 / 255);
|
|
2425
|
+
else {
|
|
2426
|
+
e2 = new Float32Array(t2.width * t2.height);
|
|
2427
|
+
const r2 = la(t2);
|
|
2428
|
+
var n2 = fa(t2);
|
|
2429
|
+
if (ra(n2, r2, ua(t2)), "iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform) || navigator.userAgent.includes("Mac") && "document" in self && "ontouchend" in self.document) {
|
|
2430
|
+
n2 = new Float32Array(t2.width * t2.height * 4), r2.readPixels(0, 0, t2.width, t2.height, r2.RGBA, r2.FLOAT, n2);
|
|
2431
|
+
for (let t3 = 0, r3 = 0; t3 < e2.length; ++t3, r3 += 4) e2[t3] = n2[r3];
|
|
2432
|
+
} else r2.readPixels(0, 0, t2.width, t2.height, r2.RED, r2.FLOAT, e2);
|
|
2433
|
+
}
|
|
2434
|
+
t2.g.push(e2);
|
|
2435
|
+
}
|
|
2436
|
+
return e2;
|
|
2437
|
+
}
|
|
2438
|
+
function ua(t2) {
|
|
2439
|
+
let e2 = ca(t2, 2);
|
|
2440
|
+
if (!e2) {
|
|
2441
|
+
const n2 = la(t2);
|
|
2442
|
+
e2 = pa(t2);
|
|
2443
|
+
const r2 = ha(t2), i2 = da(t2);
|
|
2444
|
+
n2.texImage2D(n2.TEXTURE_2D, 0, i2, t2.width, t2.height, 0, n2.RED, n2.FLOAT, r2), ga(t2);
|
|
2445
|
+
}
|
|
2446
|
+
return e2;
|
|
2447
|
+
}
|
|
2448
|
+
function la(t2) {
|
|
2449
|
+
if (!t2.canvas) throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");
|
|
2450
|
+
return t2.h || (t2.h = qo(t2.canvas.getContext("webgl2"), "You cannot use a canvas that is already bound to a different type of rendering context.")), t2.h;
|
|
2451
|
+
}
|
|
2452
|
+
function da(t2) {
|
|
2453
|
+
if (t2 = la(t2), !ma) if (t2.getExtension("EXT_color_buffer_float") && t2.getExtension("OES_texture_float_linear") && t2.getExtension("EXT_float_blend")) ma = t2.R32F;
|
|
2454
|
+
else {
|
|
2455
|
+
if (!t2.getExtension("EXT_color_buffer_half_float")) throw Error("GPU does not fully support 4-channel float32 or float16 formats");
|
|
2456
|
+
ma = t2.R16F;
|
|
2457
|
+
}
|
|
2458
|
+
return ma;
|
|
2459
|
+
}
|
|
2460
|
+
function fa(t2) {
|
|
2461
|
+
return t2.l || (t2.l = new sa()), t2.l;
|
|
2462
|
+
}
|
|
2463
|
+
function pa(t2) {
|
|
2464
|
+
const e2 = la(t2);
|
|
2465
|
+
e2.viewport(0, 0, t2.width, t2.height), e2.activeTexture(e2.TEXTURE0);
|
|
2466
|
+
let n2 = ca(t2, 2);
|
|
2467
|
+
return n2 || (n2 = na(fa(t2), e2, t2.m ? e2.LINEAR : e2.NEAREST), t2.g.push(n2), t2.j = true), e2.bindTexture(e2.TEXTURE_2D, n2), n2;
|
|
2468
|
+
}
|
|
2469
|
+
function ga(t2) {
|
|
2470
|
+
t2.h.bindTexture(t2.h.TEXTURE_2D, null);
|
|
2471
|
+
}
|
|
2472
|
+
var ma;
|
|
2473
|
+
var ya = class {
|
|
2474
|
+
constructor(t2, e2, n2, r2, i2, s2, o2) {
|
|
2475
|
+
this.g = t2, this.m = e2, this.j = n2, this.canvas = r2, this.l = i2, this.width = s2, this.height = o2, this.j && (0 === --_a && console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources."));
|
|
2476
|
+
}
|
|
2477
|
+
Fa() {
|
|
2478
|
+
return !!ca(this, 0);
|
|
2479
|
+
}
|
|
2480
|
+
ja() {
|
|
2481
|
+
return !!ca(this, 1);
|
|
2482
|
+
}
|
|
2483
|
+
P() {
|
|
2484
|
+
return !!ca(this, 2);
|
|
2485
|
+
}
|
|
2486
|
+
ia() {
|
|
2487
|
+
return (e2 = ca(t2 = this, 0)) || (e2 = ha(t2), e2 = new Uint8Array(e2.map((t3) => 255 * t3)), t2.g.push(e2)), e2;
|
|
2488
|
+
var t2, e2;
|
|
2489
|
+
}
|
|
2490
|
+
ha() {
|
|
2491
|
+
return ha(this);
|
|
2492
|
+
}
|
|
2493
|
+
M() {
|
|
2494
|
+
return ua(this);
|
|
2495
|
+
}
|
|
2496
|
+
clone() {
|
|
2497
|
+
const t2 = [];
|
|
2498
|
+
for (const e2 of this.g) {
|
|
2499
|
+
let n2;
|
|
2500
|
+
if (e2 instanceof Uint8Array) n2 = new Uint8Array(e2);
|
|
2501
|
+
else if (e2 instanceof Float32Array) n2 = new Float32Array(e2);
|
|
2502
|
+
else {
|
|
2503
|
+
if (!(e2 instanceof WebGLTexture)) throw Error(`Type is not supported: ${e2}`);
|
|
2504
|
+
{
|
|
2505
|
+
const t3 = la(this), e3 = fa(this);
|
|
2506
|
+
t3.activeTexture(t3.TEXTURE1), n2 = na(e3, t3, this.m ? t3.LINEAR : t3.NEAREST), t3.bindTexture(t3.TEXTURE_2D, n2);
|
|
2507
|
+
const r2 = da(this);
|
|
2508
|
+
t3.texImage2D(t3.TEXTURE_2D, 0, r2, this.width, this.height, 0, t3.RED, t3.FLOAT, null), t3.bindTexture(t3.TEXTURE_2D, null), ra(e3, t3, n2), ea(e3, t3, false, () => {
|
|
2509
|
+
pa(this), t3.clearColor(0, 0, 0, 0), t3.clear(t3.COLOR_BUFFER_BIT), t3.drawArrays(t3.TRIANGLE_FAN, 0, 4), ga(this);
|
|
2510
|
+
}), ia(e3), ga(this);
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
t2.push(n2);
|
|
2514
|
+
}
|
|
2515
|
+
return new ya(t2, this.m, this.P(), this.canvas, this.l, this.width, this.height);
|
|
2516
|
+
}
|
|
2517
|
+
close() {
|
|
2518
|
+
this.j && la(this).deleteTexture(ca(this, 2)), _a = -1;
|
|
2519
|
+
}
|
|
2520
|
+
};
|
|
2521
|
+
ya.prototype.close = ya.prototype.close, ya.prototype.clone = ya.prototype.clone, ya.prototype.getAsWebGLTexture = ya.prototype.M, ya.prototype.getAsFloat32Array = ya.prototype.ha, ya.prototype.getAsUint8Array = ya.prototype.ia, ya.prototype.hasWebGLTexture = ya.prototype.P, ya.prototype.hasFloat32Array = ya.prototype.ja, ya.prototype.hasUint8Array = ya.prototype.Fa;
|
|
2522
|
+
var _a = 250;
|
|
2523
|
+
var va = { color: "white", lineWidth: 4, radius: 6 };
|
|
2524
|
+
function Ea(t2) {
|
|
2525
|
+
return { ...va, fillColor: (t2 = t2 || {}).color, ...t2 };
|
|
2526
|
+
}
|
|
2527
|
+
function wa(t2, e2) {
|
|
2528
|
+
return t2 instanceof Function ? t2(e2) : t2;
|
|
2529
|
+
}
|
|
2530
|
+
function Ta(t2, e2, n2) {
|
|
2531
|
+
return Math.max(Math.min(e2, n2), Math.min(Math.max(e2, n2), t2));
|
|
2532
|
+
}
|
|
2533
|
+
function Aa(t2) {
|
|
2534
|
+
if (!t2.l) throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");
|
|
2535
|
+
return t2.l;
|
|
2536
|
+
}
|
|
2537
|
+
function ba(t2) {
|
|
2538
|
+
if (!t2.j) throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");
|
|
2539
|
+
return t2.j;
|
|
2540
|
+
}
|
|
2541
|
+
function ka(t2, e2, n2) {
|
|
2542
|
+
if (e2.P()) n2(e2.M());
|
|
2543
|
+
else {
|
|
2544
|
+
const r2 = e2.ja() ? e2.ha() : e2.ia();
|
|
2545
|
+
t2.m = t2.m ?? new sa();
|
|
2546
|
+
const i2 = ba(t2);
|
|
2547
|
+
n2((t2 = new ya([r2], e2.m, false, i2.canvas, t2.m, e2.width, e2.height)).M()), t2.close();
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
function Sa(t2, e2, n2, r2) {
|
|
2551
|
+
const i2 = function(t3) {
|
|
2552
|
+
return t3.g || (t3.g = new oa()), t3.g;
|
|
2553
|
+
}(t2), s2 = ba(t2), o2 = Array.isArray(n2) ? new ImageData(new Uint8ClampedArray(n2), 1, 1) : n2;
|
|
2554
|
+
ea(i2, s2, true, () => {
|
|
2555
|
+
!function(t4, e3, n3, r3) {
|
|
2556
|
+
const i3 = t4.g;
|
|
2557
|
+
if (i3.activeTexture(i3.TEXTURE0), i3.bindTexture(i3.TEXTURE_2D, e3), i3.activeTexture(i3.TEXTURE1), i3.bindTexture(i3.TEXTURE_2D, t4.B), i3.texImage2D(i3.TEXTURE_2D, 0, i3.RGBA, i3.RGBA, i3.UNSIGNED_BYTE, n3), t4.H && function(t5, e4) {
|
|
2558
|
+
if (t5 !== e4) return false;
|
|
2559
|
+
t5 = t5.entries(), e4 = e4.entries();
|
|
2560
|
+
for (const [r4, i4] of t5) {
|
|
2561
|
+
t5 = r4;
|
|
2562
|
+
const s3 = i4;
|
|
2563
|
+
var n4 = e4.next();
|
|
2564
|
+
if (n4.done) return false;
|
|
2565
|
+
const [o3, a2] = n4.value;
|
|
2566
|
+
if (n4 = a2, t5 !== o3 || s3[0] !== n4[0] || s3[1] !== n4[1] || s3[2] !== n4[2] || s3[3] !== n4[3]) return false;
|
|
2567
|
+
}
|
|
2568
|
+
return !!e4.next().done;
|
|
2569
|
+
}(t4.H, r3)) i3.activeTexture(i3.TEXTURE2), i3.bindTexture(i3.TEXTURE_2D, t4.j);
|
|
2570
|
+
else {
|
|
2571
|
+
t4.H = r3;
|
|
2572
|
+
const e4 = Array(1024).fill(0);
|
|
2573
|
+
r3.forEach((t5, n4) => {
|
|
2574
|
+
if (4 !== t5.length) throw Error(`Color at index ${n4} is not a four-channel value.`);
|
|
2575
|
+
e4[4 * n4] = t5[0], e4[4 * n4 + 1] = t5[1], e4[4 * n4 + 2] = t5[2], e4[4 * n4 + 3] = t5[3];
|
|
2576
|
+
}), i3.activeTexture(i3.TEXTURE2), i3.bindTexture(i3.TEXTURE_2D, t4.j), i3.texImage2D(i3.TEXTURE_2D, 0, i3.RGBA, 256, 1, 0, i3.RGBA, i3.UNSIGNED_BYTE, new Uint8Array(e4));
|
|
2577
|
+
}
|
|
2578
|
+
}(i2, e2, o2, r2), s2.clearColor(0, 0, 0, 0), s2.clear(s2.COLOR_BUFFER_BIT), s2.drawArrays(s2.TRIANGLE_FAN, 0, 4);
|
|
2579
|
+
const t3 = i2.g;
|
|
2580
|
+
t3.activeTexture(t3.TEXTURE0), t3.bindTexture(t3.TEXTURE_2D, null), t3.activeTexture(t3.TEXTURE1), t3.bindTexture(t3.TEXTURE_2D, null), t3.activeTexture(t3.TEXTURE2), t3.bindTexture(t3.TEXTURE_2D, null);
|
|
2581
|
+
});
|
|
2582
|
+
}
|
|
2583
|
+
function xa(t2, e2, n2, r2) {
|
|
2584
|
+
const i2 = ba(t2), s2 = function(t3) {
|
|
2585
|
+
return t3.h || (t3.h = new aa()), t3.h;
|
|
2586
|
+
}(t2), o2 = Array.isArray(n2) ? new ImageData(new Uint8ClampedArray(n2), 1, 1) : n2, a2 = Array.isArray(r2) ? new ImageData(new Uint8ClampedArray(r2), 1, 1) : r2;
|
|
2587
|
+
ea(s2, i2, true, () => {
|
|
2588
|
+
var t3 = s2.g;
|
|
2589
|
+
t3.activeTexture(t3.TEXTURE0), t3.bindTexture(t3.TEXTURE_2D, e2), t3.activeTexture(t3.TEXTURE1), t3.bindTexture(t3.TEXTURE_2D, s2.j), t3.texImage2D(t3.TEXTURE_2D, 0, t3.RGBA, t3.RGBA, t3.UNSIGNED_BYTE, o2), t3.activeTexture(t3.TEXTURE2), t3.bindTexture(t3.TEXTURE_2D, s2.B), t3.texImage2D(t3.TEXTURE_2D, 0, t3.RGBA, t3.RGBA, t3.UNSIGNED_BYTE, a2), i2.clearColor(0, 0, 0, 0), i2.clear(i2.COLOR_BUFFER_BIT), i2.drawArrays(i2.TRIANGLE_FAN, 0, 4), i2.bindTexture(i2.TEXTURE_2D, null), (t3 = s2.g).activeTexture(t3.TEXTURE0), t3.bindTexture(t3.TEXTURE_2D, null), t3.activeTexture(t3.TEXTURE1), t3.bindTexture(t3.TEXTURE_2D, null), t3.activeTexture(t3.TEXTURE2), t3.bindTexture(t3.TEXTURE_2D, null);
|
|
2590
|
+
});
|
|
2591
|
+
}
|
|
2592
|
+
var La = class {
|
|
2593
|
+
constructor(t2, e2) {
|
|
2594
|
+
t2 instanceof CanvasRenderingContext2D || t2 instanceof OffscreenCanvasRenderingContext2D ? (this.l = t2, this.j = e2) : this.j = t2;
|
|
2595
|
+
}
|
|
2596
|
+
ya(t2, e2) {
|
|
2597
|
+
if (t2) {
|
|
2598
|
+
var n2 = Aa(this);
|
|
2599
|
+
e2 = Ea(e2), n2.save();
|
|
2600
|
+
var r2 = n2.canvas, i2 = 0;
|
|
2601
|
+
for (const s2 of t2) n2.fillStyle = wa(e2.fillColor, { index: i2, from: s2 }), n2.strokeStyle = wa(e2.color, { index: i2, from: s2 }), n2.lineWidth = wa(e2.lineWidth, { index: i2, from: s2 }), (t2 = new Path2D()).arc(s2.x * r2.width, s2.y * r2.height, wa(e2.radius, { index: i2, from: s2 }), 0, 2 * Math.PI), n2.fill(t2), n2.stroke(t2), ++i2;
|
|
2602
|
+
n2.restore();
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
xa(t2, e2, n2) {
|
|
2606
|
+
if (t2 && e2) {
|
|
2607
|
+
var r2 = Aa(this);
|
|
2608
|
+
n2 = Ea(n2), r2.save();
|
|
2609
|
+
var i2 = r2.canvas, s2 = 0;
|
|
2610
|
+
for (const o2 of e2) {
|
|
2611
|
+
r2.beginPath(), e2 = t2[o2.start];
|
|
2612
|
+
const a2 = t2[o2.end];
|
|
2613
|
+
e2 && a2 && (r2.strokeStyle = wa(n2.color, { index: s2, from: e2, to: a2 }), r2.lineWidth = wa(n2.lineWidth, { index: s2, from: e2, to: a2 }), r2.moveTo(e2.x * i2.width, e2.y * i2.height), r2.lineTo(a2.x * i2.width, a2.y * i2.height)), ++s2, r2.stroke();
|
|
2614
|
+
}
|
|
2615
|
+
r2.restore();
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
ua(t2, e2) {
|
|
2619
|
+
const n2 = Aa(this);
|
|
2620
|
+
e2 = Ea(e2), n2.save(), n2.beginPath(), n2.lineWidth = wa(e2.lineWidth, {}), n2.strokeStyle = wa(e2.color, {}), n2.fillStyle = wa(e2.fillColor, {}), n2.moveTo(t2.originX, t2.originY), n2.lineTo(t2.originX + t2.width, t2.originY), n2.lineTo(t2.originX + t2.width, t2.originY + t2.height), n2.lineTo(t2.originX, t2.originY + t2.height), n2.lineTo(t2.originX, t2.originY), n2.stroke(), n2.fill(), n2.restore();
|
|
2621
|
+
}
|
|
2622
|
+
va(t2, e2, n2 = [0, 0, 0, 255]) {
|
|
2623
|
+
this.l ? function(t3, e3, n3, r2) {
|
|
2624
|
+
const i2 = ba(t3);
|
|
2625
|
+
ka(t3, e3, (e4) => {
|
|
2626
|
+
Sa(t3, e4, n3, r2), (e4 = Aa(t3)).drawImage(i2.canvas, 0, 0, e4.canvas.width, e4.canvas.height);
|
|
2627
|
+
});
|
|
2628
|
+
}(this, t2, n2, e2) : Sa(this, t2.M(), n2, e2);
|
|
2629
|
+
}
|
|
2630
|
+
wa(t2, e2, n2) {
|
|
2631
|
+
this.l ? function(t3, e3, n3, r2) {
|
|
2632
|
+
const i2 = ba(t3);
|
|
2633
|
+
ka(t3, e3, (e4) => {
|
|
2634
|
+
xa(t3, e4, n3, r2), (e4 = Aa(t3)).drawImage(i2.canvas, 0, 0, e4.canvas.width, e4.canvas.height);
|
|
2635
|
+
});
|
|
2636
|
+
}(this, t2, e2, n2) : xa(this, t2.M(), e2, n2);
|
|
2637
|
+
}
|
|
2638
|
+
close() {
|
|
2639
|
+
this.g?.close(), this.g = void 0, this.h?.close(), this.h = void 0, this.m?.close(), this.m = void 0;
|
|
2640
|
+
}
|
|
2641
|
+
};
|
|
2642
|
+
function Ra(t2, e2) {
|
|
2643
|
+
switch (e2) {
|
|
2644
|
+
case 0:
|
|
2645
|
+
return t2.g.find((t3) => t3 instanceof ImageData);
|
|
2646
|
+
case 1:
|
|
2647
|
+
return t2.g.find((t3) => "undefined" != typeof ImageBitmap && t3 instanceof ImageBitmap);
|
|
2648
|
+
case 2:
|
|
2649
|
+
return t2.g.find((t3) => "undefined" != typeof WebGLTexture && t3 instanceof WebGLTexture);
|
|
2650
|
+
default:
|
|
2651
|
+
throw Error(`Type is not supported: ${e2}`);
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
function Fa(t2) {
|
|
2655
|
+
var e2 = Ra(t2, 0);
|
|
2656
|
+
if (!e2) {
|
|
2657
|
+
e2 = Ma(t2);
|
|
2658
|
+
const n2 = Pa(t2), r2 = new Uint8Array(t2.width * t2.height * 4);
|
|
2659
|
+
ra(n2, e2, Ia(t2)), e2.readPixels(0, 0, t2.width, t2.height, e2.RGBA, e2.UNSIGNED_BYTE, r2), ia(n2), e2 = new ImageData(new Uint8ClampedArray(r2.buffer), t2.width, t2.height), t2.g.push(e2);
|
|
2660
|
+
}
|
|
2661
|
+
return e2;
|
|
2662
|
+
}
|
|
2663
|
+
function Ia(t2) {
|
|
2664
|
+
let e2 = Ra(t2, 2);
|
|
2665
|
+
if (!e2) {
|
|
2666
|
+
const n2 = Ma(t2);
|
|
2667
|
+
e2 = Oa(t2);
|
|
2668
|
+
const r2 = Ra(t2, 1) || Fa(t2);
|
|
2669
|
+
n2.texImage2D(n2.TEXTURE_2D, 0, n2.RGBA, n2.RGBA, n2.UNSIGNED_BYTE, r2), Ca(t2);
|
|
2670
|
+
}
|
|
2671
|
+
return e2;
|
|
2672
|
+
}
|
|
2673
|
+
function Ma(t2) {
|
|
2674
|
+
if (!t2.canvas) throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");
|
|
2675
|
+
return t2.h || (t2.h = qo(t2.canvas.getContext("webgl2"), "You cannot use a canvas that is already bound to a different type of rendering context.")), t2.h;
|
|
2676
|
+
}
|
|
2677
|
+
function Pa(t2) {
|
|
2678
|
+
return t2.l || (t2.l = new sa()), t2.l;
|
|
2679
|
+
}
|
|
2680
|
+
function Oa(t2) {
|
|
2681
|
+
const e2 = Ma(t2);
|
|
2682
|
+
e2.viewport(0, 0, t2.width, t2.height), e2.activeTexture(e2.TEXTURE0);
|
|
2683
|
+
let n2 = Ra(t2, 2);
|
|
2684
|
+
return n2 || (n2 = na(Pa(t2), e2), t2.g.push(n2), t2.m = true), e2.bindTexture(e2.TEXTURE_2D, n2), n2;
|
|
2685
|
+
}
|
|
2686
|
+
function Ca(t2) {
|
|
2687
|
+
t2.h.bindTexture(t2.h.TEXTURE_2D, null);
|
|
2688
|
+
}
|
|
2689
|
+
function Ua(t2) {
|
|
2690
|
+
const e2 = Ma(t2);
|
|
2691
|
+
return ea(Pa(t2), e2, true, () => function(t3, e3) {
|
|
2692
|
+
const n2 = t3.canvas;
|
|
2693
|
+
if (n2.width === t3.width && n2.height === t3.height) return e3();
|
|
2694
|
+
const r2 = n2.width, i2 = n2.height;
|
|
2695
|
+
return n2.width = t3.width, n2.height = t3.height, t3 = e3(), n2.width = r2, n2.height = i2, t3;
|
|
2696
|
+
}(t2, () => {
|
|
2697
|
+
if (e2.bindFramebuffer(e2.FRAMEBUFFER, null), e2.clearColor(0, 0, 0, 0), e2.clear(e2.COLOR_BUFFER_BIT), e2.drawArrays(e2.TRIANGLE_FAN, 0, 4), !(t2.canvas instanceof OffscreenCanvas)) throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");
|
|
2698
|
+
return t2.canvas.transferToImageBitmap();
|
|
2699
|
+
}));
|
|
2700
|
+
}
|
|
2701
|
+
La.prototype.close = La.prototype.close, La.prototype.drawConfidenceMask = La.prototype.wa, La.prototype.drawCategoryMask = La.prototype.va, La.prototype.drawBoundingBox = La.prototype.ua, La.prototype.drawConnectors = La.prototype.xa, La.prototype.drawLandmarks = La.prototype.ya, La.lerp = function(t2, e2, n2, r2, i2) {
|
|
2702
|
+
return Ta(r2 * (1 - (t2 - e2) / (n2 - e2)) + i2 * (1 - (n2 - t2) / (n2 - e2)), r2, i2);
|
|
2703
|
+
}, La.clamp = Ta;
|
|
2704
|
+
var Da = class {
|
|
2705
|
+
constructor(t2, e2, n2, r2, i2, s2, o2) {
|
|
2706
|
+
this.g = t2, this.j = e2, this.m = n2, this.canvas = r2, this.l = i2, this.width = s2, this.height = o2, (this.j || this.m) && (0 === --Na && console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources."));
|
|
2707
|
+
}
|
|
2708
|
+
Ea() {
|
|
2709
|
+
return !!Ra(this, 0);
|
|
2710
|
+
}
|
|
2711
|
+
ka() {
|
|
2712
|
+
return !!Ra(this, 1);
|
|
2713
|
+
}
|
|
2714
|
+
P() {
|
|
2715
|
+
return !!Ra(this, 2);
|
|
2716
|
+
}
|
|
2717
|
+
Ca() {
|
|
2718
|
+
return Fa(this);
|
|
2719
|
+
}
|
|
2720
|
+
Ba() {
|
|
2721
|
+
var t2 = Ra(this, 1);
|
|
2722
|
+
return t2 || (Ia(this), Oa(this), t2 = Ua(this), Ca(this), this.g.push(t2), this.j = true), t2;
|
|
2723
|
+
}
|
|
2724
|
+
M() {
|
|
2725
|
+
return Ia(this);
|
|
2726
|
+
}
|
|
2727
|
+
clone() {
|
|
2728
|
+
const t2 = [];
|
|
2729
|
+
for (const e2 of this.g) {
|
|
2730
|
+
let n2;
|
|
2731
|
+
if (e2 instanceof ImageData) n2 = new ImageData(e2.data, this.width, this.height);
|
|
2732
|
+
else if (e2 instanceof WebGLTexture) {
|
|
2733
|
+
const t3 = Ma(this), e3 = Pa(this);
|
|
2734
|
+
t3.activeTexture(t3.TEXTURE1), n2 = na(e3, t3), t3.bindTexture(t3.TEXTURE_2D, n2), t3.texImage2D(t3.TEXTURE_2D, 0, t3.RGBA, this.width, this.height, 0, t3.RGBA, t3.UNSIGNED_BYTE, null), t3.bindTexture(t3.TEXTURE_2D, null), ra(e3, t3, n2), ea(e3, t3, false, () => {
|
|
2735
|
+
Oa(this), t3.clearColor(0, 0, 0, 0), t3.clear(t3.COLOR_BUFFER_BIT), t3.drawArrays(t3.TRIANGLE_FAN, 0, 4), Ca(this);
|
|
2736
|
+
}), ia(e3), Ca(this);
|
|
2737
|
+
} else {
|
|
2738
|
+
if (!(e2 instanceof ImageBitmap)) throw Error(`Type is not supported: ${e2}`);
|
|
2739
|
+
Ia(this), Oa(this), n2 = Ua(this), Ca(this);
|
|
2740
|
+
}
|
|
2741
|
+
t2.push(n2);
|
|
2742
|
+
}
|
|
2743
|
+
return new Da(t2, this.ka(), this.P(), this.canvas, this.l, this.width, this.height);
|
|
2744
|
+
}
|
|
2745
|
+
close() {
|
|
2746
|
+
this.j && Ra(this, 1).close(), this.m && Ma(this).deleteTexture(Ra(this, 2)), Na = -1;
|
|
2747
|
+
}
|
|
2748
|
+
};
|
|
2749
|
+
Da.prototype.close = Da.prototype.close, Da.prototype.clone = Da.prototype.clone, Da.prototype.getAsWebGLTexture = Da.prototype.M, Da.prototype.getAsImageBitmap = Da.prototype.Ba, Da.prototype.getAsImageData = Da.prototype.Ca, Da.prototype.hasWebGLTexture = Da.prototype.P, Da.prototype.hasImageBitmap = Da.prototype.ka, Da.prototype.hasImageData = Da.prototype.Ea;
|
|
2750
|
+
var Na = 250;
|
|
2751
|
+
function Ba(...t2) {
|
|
2752
|
+
return t2.map(([t3, e2]) => ({ start: t3, end: e2 }));
|
|
2753
|
+
}
|
|
2754
|
+
var Ga = /* @__PURE__ */ function(t2) {
|
|
2755
|
+
return class extends t2 {
|
|
2756
|
+
La() {
|
|
2757
|
+
this.i._registerModelResourcesGraphService();
|
|
2758
|
+
}
|
|
2759
|
+
};
|
|
2760
|
+
}((ja = class {
|
|
2761
|
+
constructor(t2, e2) {
|
|
2762
|
+
this.l = true, this.i = t2, this.g = null, this.h = 0, this.m = "function" == typeof this.i._addIntToInputStream, void 0 !== e2 ? this.i.canvas = e2 : Oo() ? this.i.canvas = new OffscreenCanvas(1, 1) : (console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."), this.i.canvas = document.createElement("canvas"));
|
|
2763
|
+
}
|
|
2764
|
+
async initializeGraph(t2) {
|
|
2765
|
+
const e2 = await (await fetch(t2)).arrayBuffer();
|
|
2766
|
+
t2 = !(t2.endsWith(".pbtxt") || t2.endsWith(".textproto")), this.setGraph(new Uint8Array(e2), t2);
|
|
2767
|
+
}
|
|
2768
|
+
setGraphFromString(t2) {
|
|
2769
|
+
this.setGraph(new TextEncoder().encode(t2), false);
|
|
2770
|
+
}
|
|
2771
|
+
setGraph(t2, e2) {
|
|
2772
|
+
const n2 = t2.length, r2 = this.i._malloc(n2);
|
|
2773
|
+
this.i.HEAPU8.set(t2, r2), e2 ? this.i._changeBinaryGraph(n2, r2) : this.i._changeTextGraph(n2, r2), this.i._free(r2);
|
|
2774
|
+
}
|
|
2775
|
+
configureAudio(t2, e2, n2, r2, i2) {
|
|
2776
|
+
this.i._configureAudio || console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'), Do(this, r2 || "input_audio", (r3) => {
|
|
2777
|
+
Do(this, i2 = i2 || "audio_header", (i3) => {
|
|
2778
|
+
this.i._configureAudio(r3, i3, t2, e2 ?? 0, n2);
|
|
2779
|
+
});
|
|
2780
|
+
});
|
|
2781
|
+
}
|
|
2782
|
+
setAutoResizeCanvas(t2) {
|
|
2783
|
+
this.l = t2;
|
|
2784
|
+
}
|
|
2785
|
+
setAutoRenderToScreen(t2) {
|
|
2786
|
+
this.i._setAutoRenderToScreen(t2);
|
|
2787
|
+
}
|
|
2788
|
+
setGpuBufferVerticalFlip(t2) {
|
|
2789
|
+
this.i.gpuOriginForWebTexturesIsBottomLeft = t2;
|
|
2790
|
+
}
|
|
2791
|
+
da(t2) {
|
|
2792
|
+
Go(this, "__graph_config__", (e2) => {
|
|
2793
|
+
t2(e2);
|
|
2794
|
+
}), Do(this, "__graph_config__", (t3) => {
|
|
2795
|
+
this.i._getGraphConfig(t3, void 0);
|
|
2796
|
+
}), delete this.i.simpleListeners.__graph_config__;
|
|
2797
|
+
}
|
|
2798
|
+
attachErrorListener(t2) {
|
|
2799
|
+
this.i.errorListener = t2;
|
|
2800
|
+
}
|
|
2801
|
+
attachEmptyPacketListener(t2, e2) {
|
|
2802
|
+
this.i.emptyPacketListeners = this.i.emptyPacketListeners || {}, this.i.emptyPacketListeners[t2] = e2;
|
|
2803
|
+
}
|
|
2804
|
+
addAudioToStream(t2, e2, n2) {
|
|
2805
|
+
this.addAudioToStreamWithShape(t2, 0, 0, e2, n2);
|
|
2806
|
+
}
|
|
2807
|
+
addAudioToStreamWithShape(t2, e2, n2, r2, i2) {
|
|
2808
|
+
const s2 = 4 * t2.length;
|
|
2809
|
+
this.h !== s2 && (this.g && this.i._free(this.g), this.g = this.i._malloc(s2), this.h = s2), this.i.HEAPF32.set(t2, this.g / 4), Do(this, r2, (t3) => {
|
|
2810
|
+
this.i._addAudioToInputStream(this.g, e2, n2, t3, i2);
|
|
2811
|
+
});
|
|
2812
|
+
}
|
|
2813
|
+
addGpuBufferToStream(t2, e2, n2) {
|
|
2814
|
+
Do(this, e2, (e3) => {
|
|
2815
|
+
const [r2, i2] = No(this, t2, e3);
|
|
2816
|
+
this.i._addBoundTextureToStream(e3, r2, i2, n2);
|
|
2817
|
+
});
|
|
2818
|
+
}
|
|
2819
|
+
addBoolToStream(t2, e2, n2) {
|
|
2820
|
+
Do(this, e2, (e3) => {
|
|
2821
|
+
this.i._addBoolToInputStream(t2, e3, n2);
|
|
2822
|
+
});
|
|
2823
|
+
}
|
|
2824
|
+
addDoubleToStream(t2, e2, n2) {
|
|
2825
|
+
Do(this, e2, (e3) => {
|
|
2826
|
+
this.i._addDoubleToInputStream(t2, e3, n2);
|
|
2827
|
+
});
|
|
2828
|
+
}
|
|
2829
|
+
addFloatToStream(t2, e2, n2) {
|
|
2830
|
+
Do(this, e2, (e3) => {
|
|
2831
|
+
this.i._addFloatToInputStream(t2, e3, n2);
|
|
2832
|
+
});
|
|
2833
|
+
}
|
|
2834
|
+
addIntToStream(t2, e2, n2) {
|
|
2835
|
+
Do(this, e2, (e3) => {
|
|
2836
|
+
this.i._addIntToInputStream(t2, e3, n2);
|
|
2837
|
+
});
|
|
2838
|
+
}
|
|
2839
|
+
addUintToStream(t2, e2, n2) {
|
|
2840
|
+
Do(this, e2, (e3) => {
|
|
2841
|
+
this.i._addUintToInputStream(t2, e3, n2);
|
|
2842
|
+
});
|
|
2843
|
+
}
|
|
2844
|
+
addStringToStream(t2, e2, n2) {
|
|
2845
|
+
Do(this, e2, (e3) => {
|
|
2846
|
+
Do(this, t2, (t3) => {
|
|
2847
|
+
this.i._addStringToInputStream(t3, e3, n2);
|
|
2848
|
+
});
|
|
2849
|
+
});
|
|
2850
|
+
}
|
|
2851
|
+
addStringRecordToStream(t2, e2, n2) {
|
|
2852
|
+
Do(this, e2, (e3) => {
|
|
2853
|
+
Bo(this, Object.keys(t2), (r2) => {
|
|
2854
|
+
Bo(this, Object.values(t2), (i2) => {
|
|
2855
|
+
this.i._addFlatHashMapToInputStream(r2, i2, Object.keys(t2).length, e3, n2);
|
|
2856
|
+
});
|
|
2857
|
+
});
|
|
2858
|
+
});
|
|
2859
|
+
}
|
|
2860
|
+
addProtoToStream(t2, e2, n2, r2) {
|
|
2861
|
+
Do(this, n2, (n3) => {
|
|
2862
|
+
Do(this, e2, (e3) => {
|
|
2863
|
+
const i2 = this.i._malloc(t2.length);
|
|
2864
|
+
this.i.HEAPU8.set(t2, i2), this.i._addProtoToInputStream(i2, t2.length, e3, n3, r2), this.i._free(i2);
|
|
2865
|
+
});
|
|
2866
|
+
});
|
|
2867
|
+
}
|
|
2868
|
+
addEmptyPacketToStream(t2, e2) {
|
|
2869
|
+
Do(this, t2, (t3) => {
|
|
2870
|
+
this.i._addEmptyPacketToInputStream(t3, e2);
|
|
2871
|
+
});
|
|
2872
|
+
}
|
|
2873
|
+
addBoolVectorToStream(t2, e2, n2) {
|
|
2874
|
+
Do(this, e2, (e3) => {
|
|
2875
|
+
const r2 = this.i._allocateBoolVector(t2.length);
|
|
2876
|
+
if (!r2) throw Error("Unable to allocate new bool vector on heap.");
|
|
2877
|
+
for (const e4 of t2) this.i._addBoolVectorEntry(r2, e4);
|
|
2878
|
+
this.i._addBoolVectorToInputStream(r2, e3, n2);
|
|
2879
|
+
});
|
|
2880
|
+
}
|
|
2881
|
+
addDoubleVectorToStream(t2, e2, n2) {
|
|
2882
|
+
Do(this, e2, (e3) => {
|
|
2883
|
+
const r2 = this.i._allocateDoubleVector(t2.length);
|
|
2884
|
+
if (!r2) throw Error("Unable to allocate new double vector on heap.");
|
|
2885
|
+
for (const e4 of t2) this.i._addDoubleVectorEntry(r2, e4);
|
|
2886
|
+
this.i._addDoubleVectorToInputStream(r2, e3, n2);
|
|
2887
|
+
});
|
|
2888
|
+
}
|
|
2889
|
+
addFloatVectorToStream(t2, e2, n2) {
|
|
2890
|
+
Do(this, e2, (e3) => {
|
|
2891
|
+
const r2 = this.i._allocateFloatVector(t2.length);
|
|
2892
|
+
if (!r2) throw Error("Unable to allocate new float vector on heap.");
|
|
2893
|
+
for (const e4 of t2) this.i._addFloatVectorEntry(r2, e4);
|
|
2894
|
+
this.i._addFloatVectorToInputStream(r2, e3, n2);
|
|
2895
|
+
});
|
|
2896
|
+
}
|
|
2897
|
+
addIntVectorToStream(t2, e2, n2) {
|
|
2898
|
+
Do(this, e2, (e3) => {
|
|
2899
|
+
const r2 = this.i._allocateIntVector(t2.length);
|
|
2900
|
+
if (!r2) throw Error("Unable to allocate new int vector on heap.");
|
|
2901
|
+
for (const e4 of t2) this.i._addIntVectorEntry(r2, e4);
|
|
2902
|
+
this.i._addIntVectorToInputStream(r2, e3, n2);
|
|
2903
|
+
});
|
|
2904
|
+
}
|
|
2905
|
+
addUintVectorToStream(t2, e2, n2) {
|
|
2906
|
+
Do(this, e2, (e3) => {
|
|
2907
|
+
const r2 = this.i._allocateUintVector(t2.length);
|
|
2908
|
+
if (!r2) throw Error("Unable to allocate new unsigned int vector on heap.");
|
|
2909
|
+
for (const e4 of t2) this.i._addUintVectorEntry(r2, e4);
|
|
2910
|
+
this.i._addUintVectorToInputStream(r2, e3, n2);
|
|
2911
|
+
});
|
|
2912
|
+
}
|
|
2913
|
+
addStringVectorToStream(t2, e2, n2) {
|
|
2914
|
+
Do(this, e2, (e3) => {
|
|
2915
|
+
const r2 = this.i._allocateStringVector(t2.length);
|
|
2916
|
+
if (!r2) throw Error("Unable to allocate new string vector on heap.");
|
|
2917
|
+
for (const e4 of t2) Do(this, e4, (t3) => {
|
|
2918
|
+
this.i._addStringVectorEntry(r2, t3);
|
|
2919
|
+
});
|
|
2920
|
+
this.i._addStringVectorToInputStream(r2, e3, n2);
|
|
2921
|
+
});
|
|
2922
|
+
}
|
|
2923
|
+
addBoolToInputSidePacket(t2, e2) {
|
|
2924
|
+
Do(this, e2, (e3) => {
|
|
2925
|
+
this.i._addBoolToInputSidePacket(t2, e3);
|
|
2926
|
+
});
|
|
2927
|
+
}
|
|
2928
|
+
addDoubleToInputSidePacket(t2, e2) {
|
|
2929
|
+
Do(this, e2, (e3) => {
|
|
2930
|
+
this.i._addDoubleToInputSidePacket(t2, e3);
|
|
2931
|
+
});
|
|
2932
|
+
}
|
|
2933
|
+
addFloatToInputSidePacket(t2, e2) {
|
|
2934
|
+
Do(this, e2, (e3) => {
|
|
2935
|
+
this.i._addFloatToInputSidePacket(t2, e3);
|
|
2936
|
+
});
|
|
2937
|
+
}
|
|
2938
|
+
addIntToInputSidePacket(t2, e2) {
|
|
2939
|
+
Do(this, e2, (e3) => {
|
|
2940
|
+
this.i._addIntToInputSidePacket(t2, e3);
|
|
2941
|
+
});
|
|
2942
|
+
}
|
|
2943
|
+
addUintToInputSidePacket(t2, e2) {
|
|
2944
|
+
Do(this, e2, (e3) => {
|
|
2945
|
+
this.i._addUintToInputSidePacket(t2, e3);
|
|
2946
|
+
});
|
|
2947
|
+
}
|
|
2948
|
+
addStringToInputSidePacket(t2, e2) {
|
|
2949
|
+
Do(this, e2, (e3) => {
|
|
2950
|
+
Do(this, t2, (t3) => {
|
|
2951
|
+
this.i._addStringToInputSidePacket(t3, e3);
|
|
2952
|
+
});
|
|
2953
|
+
});
|
|
2954
|
+
}
|
|
2955
|
+
addProtoToInputSidePacket(t2, e2, n2) {
|
|
2956
|
+
Do(this, n2, (n3) => {
|
|
2957
|
+
Do(this, e2, (e3) => {
|
|
2958
|
+
const r2 = this.i._malloc(t2.length);
|
|
2959
|
+
this.i.HEAPU8.set(t2, r2), this.i._addProtoToInputSidePacket(r2, t2.length, e3, n3), this.i._free(r2);
|
|
2960
|
+
});
|
|
2961
|
+
});
|
|
2962
|
+
}
|
|
2963
|
+
addBoolVectorToInputSidePacket(t2, e2) {
|
|
2964
|
+
Do(this, e2, (e3) => {
|
|
2965
|
+
const n2 = this.i._allocateBoolVector(t2.length);
|
|
2966
|
+
if (!n2) throw Error("Unable to allocate new bool vector on heap.");
|
|
2967
|
+
for (const e4 of t2) this.i._addBoolVectorEntry(n2, e4);
|
|
2968
|
+
this.i._addBoolVectorToInputSidePacket(n2, e3);
|
|
2969
|
+
});
|
|
2970
|
+
}
|
|
2971
|
+
addDoubleVectorToInputSidePacket(t2, e2) {
|
|
2972
|
+
Do(this, e2, (e3) => {
|
|
2973
|
+
const n2 = this.i._allocateDoubleVector(t2.length);
|
|
2974
|
+
if (!n2) throw Error("Unable to allocate new double vector on heap.");
|
|
2975
|
+
for (const e4 of t2) this.i._addDoubleVectorEntry(n2, e4);
|
|
2976
|
+
this.i._addDoubleVectorToInputSidePacket(n2, e3);
|
|
2977
|
+
});
|
|
2978
|
+
}
|
|
2979
|
+
addFloatVectorToInputSidePacket(t2, e2) {
|
|
2980
|
+
Do(this, e2, (e3) => {
|
|
2981
|
+
const n2 = this.i._allocateFloatVector(t2.length);
|
|
2982
|
+
if (!n2) throw Error("Unable to allocate new float vector on heap.");
|
|
2983
|
+
for (const e4 of t2) this.i._addFloatVectorEntry(n2, e4);
|
|
2984
|
+
this.i._addFloatVectorToInputSidePacket(n2, e3);
|
|
2985
|
+
});
|
|
2986
|
+
}
|
|
2987
|
+
addIntVectorToInputSidePacket(t2, e2) {
|
|
2988
|
+
Do(this, e2, (e3) => {
|
|
2989
|
+
const n2 = this.i._allocateIntVector(t2.length);
|
|
2990
|
+
if (!n2) throw Error("Unable to allocate new int vector on heap.");
|
|
2991
|
+
for (const e4 of t2) this.i._addIntVectorEntry(n2, e4);
|
|
2992
|
+
this.i._addIntVectorToInputSidePacket(n2, e3);
|
|
2993
|
+
});
|
|
2994
|
+
}
|
|
2995
|
+
addUintVectorToInputSidePacket(t2, e2) {
|
|
2996
|
+
Do(this, e2, (e3) => {
|
|
2997
|
+
const n2 = this.i._allocateUintVector(t2.length);
|
|
2998
|
+
if (!n2) throw Error("Unable to allocate new unsigned int vector on heap.");
|
|
2999
|
+
for (const e4 of t2) this.i._addUintVectorEntry(n2, e4);
|
|
3000
|
+
this.i._addUintVectorToInputSidePacket(n2, e3);
|
|
3001
|
+
});
|
|
3002
|
+
}
|
|
3003
|
+
addStringVectorToInputSidePacket(t2, e2) {
|
|
3004
|
+
Do(this, e2, (e3) => {
|
|
3005
|
+
const n2 = this.i._allocateStringVector(t2.length);
|
|
3006
|
+
if (!n2) throw Error("Unable to allocate new string vector on heap.");
|
|
3007
|
+
for (const e4 of t2) Do(this, e4, (t3) => {
|
|
3008
|
+
this.i._addStringVectorEntry(n2, t3);
|
|
3009
|
+
});
|
|
3010
|
+
this.i._addStringVectorToInputSidePacket(n2, e3);
|
|
3011
|
+
});
|
|
3012
|
+
}
|
|
3013
|
+
attachBoolListener(t2, e2) {
|
|
3014
|
+
Go(this, t2, e2), Do(this, t2, (t3) => {
|
|
3015
|
+
this.i._attachBoolListener(t3);
|
|
3016
|
+
});
|
|
3017
|
+
}
|
|
3018
|
+
attachBoolVectorListener(t2, e2) {
|
|
3019
|
+
jo(this, t2, e2), Do(this, t2, (t3) => {
|
|
3020
|
+
this.i._attachBoolVectorListener(t3);
|
|
3021
|
+
});
|
|
3022
|
+
}
|
|
3023
|
+
attachIntListener(t2, e2) {
|
|
3024
|
+
Go(this, t2, e2), Do(this, t2, (t3) => {
|
|
3025
|
+
this.i._attachIntListener(t3);
|
|
3026
|
+
});
|
|
3027
|
+
}
|
|
3028
|
+
attachIntVectorListener(t2, e2) {
|
|
3029
|
+
jo(this, t2, e2), Do(this, t2, (t3) => {
|
|
3030
|
+
this.i._attachIntVectorListener(t3);
|
|
3031
|
+
});
|
|
3032
|
+
}
|
|
3033
|
+
attachUintListener(t2, e2) {
|
|
3034
|
+
Go(this, t2, e2), Do(this, t2, (t3) => {
|
|
3035
|
+
this.i._attachUintListener(t3);
|
|
3036
|
+
});
|
|
3037
|
+
}
|
|
3038
|
+
attachUintVectorListener(t2, e2) {
|
|
3039
|
+
jo(this, t2, e2), Do(this, t2, (t3) => {
|
|
3040
|
+
this.i._attachUintVectorListener(t3);
|
|
3041
|
+
});
|
|
3042
|
+
}
|
|
3043
|
+
attachDoubleListener(t2, e2) {
|
|
3044
|
+
Go(this, t2, e2), Do(this, t2, (t3) => {
|
|
3045
|
+
this.i._attachDoubleListener(t3);
|
|
3046
|
+
});
|
|
3047
|
+
}
|
|
3048
|
+
attachDoubleVectorListener(t2, e2) {
|
|
3049
|
+
jo(this, t2, e2), Do(this, t2, (t3) => {
|
|
3050
|
+
this.i._attachDoubleVectorListener(t3);
|
|
3051
|
+
});
|
|
3052
|
+
}
|
|
3053
|
+
attachFloatListener(t2, e2) {
|
|
3054
|
+
Go(this, t2, e2), Do(this, t2, (t3) => {
|
|
3055
|
+
this.i._attachFloatListener(t3);
|
|
3056
|
+
});
|
|
3057
|
+
}
|
|
3058
|
+
attachFloatVectorListener(t2, e2) {
|
|
3059
|
+
jo(this, t2, e2), Do(this, t2, (t3) => {
|
|
3060
|
+
this.i._attachFloatVectorListener(t3);
|
|
3061
|
+
});
|
|
3062
|
+
}
|
|
3063
|
+
attachStringListener(t2, e2) {
|
|
3064
|
+
Go(this, t2, e2), Do(this, t2, (t3) => {
|
|
3065
|
+
this.i._attachStringListener(t3);
|
|
3066
|
+
});
|
|
3067
|
+
}
|
|
3068
|
+
attachStringVectorListener(t2, e2) {
|
|
3069
|
+
jo(this, t2, e2), Do(this, t2, (t3) => {
|
|
3070
|
+
this.i._attachStringVectorListener(t3);
|
|
3071
|
+
});
|
|
3072
|
+
}
|
|
3073
|
+
attachProtoListener(t2, e2, n2) {
|
|
3074
|
+
Go(this, t2, e2), Do(this, t2, (t3) => {
|
|
3075
|
+
this.i._attachProtoListener(t3, n2 || false);
|
|
3076
|
+
});
|
|
3077
|
+
}
|
|
3078
|
+
attachProtoVectorListener(t2, e2, n2) {
|
|
3079
|
+
jo(this, t2, e2), Do(this, t2, (t3) => {
|
|
3080
|
+
this.i._attachProtoVectorListener(t3, n2 || false);
|
|
3081
|
+
});
|
|
3082
|
+
}
|
|
3083
|
+
attachAudioListener(t2, e2, n2) {
|
|
3084
|
+
this.i._attachAudioListener || console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'), Go(this, t2, (t3, n3) => {
|
|
3085
|
+
t3 = new Float32Array(t3.buffer, t3.byteOffset, t3.length / 4), e2(t3, n3);
|
|
3086
|
+
}), Do(this, t2, (t3) => {
|
|
3087
|
+
this.i._attachAudioListener(t3, n2 || false);
|
|
3088
|
+
});
|
|
3089
|
+
}
|
|
3090
|
+
finishProcessing() {
|
|
3091
|
+
this.i._waitUntilIdle();
|
|
3092
|
+
}
|
|
3093
|
+
closeGraph() {
|
|
3094
|
+
this.i._closeGraph(), this.i.simpleListeners = void 0, this.i.emptyPacketListeners = void 0;
|
|
3095
|
+
}
|
|
3096
|
+
}, class extends ja {
|
|
3097
|
+
get ea() {
|
|
3098
|
+
return this.i;
|
|
3099
|
+
}
|
|
3100
|
+
qa(t2, e2, n2) {
|
|
3101
|
+
Do(this, e2, (e3) => {
|
|
3102
|
+
const [r2, i2] = No(this, t2, e3);
|
|
3103
|
+
this.ea._addBoundTextureAsImageToStream(e3, r2, i2, n2);
|
|
3104
|
+
});
|
|
3105
|
+
}
|
|
3106
|
+
U(t2, e2) {
|
|
3107
|
+
Go(this, t2, e2), Do(this, t2, (t3) => {
|
|
3108
|
+
this.ea._attachImageListener(t3);
|
|
3109
|
+
});
|
|
3110
|
+
}
|
|
3111
|
+
ca(t2, e2) {
|
|
3112
|
+
jo(this, t2, e2), Do(this, t2, (t3) => {
|
|
3113
|
+
this.ea._attachImageVectorListener(t3);
|
|
3114
|
+
});
|
|
3115
|
+
}
|
|
3116
|
+
}));
|
|
3117
|
+
var ja;
|
|
3118
|
+
var Va = class extends Ga {
|
|
3119
|
+
};
|
|
3120
|
+
async function Xa(t2, e2, n2) {
|
|
3121
|
+
return async function(t3, e3, n3, r2) {
|
|
3122
|
+
return Vo(t3, e3, n3, r2);
|
|
3123
|
+
}(t2, n2.canvas ?? (Oo() ? void 0 : document.createElement("canvas")), e2, n2);
|
|
3124
|
+
}
|
|
3125
|
+
function Ha(t2, e2, n2, r2) {
|
|
3126
|
+
if (t2.T) {
|
|
3127
|
+
const s2 = new fs();
|
|
3128
|
+
if (n2?.regionOfInterest) {
|
|
3129
|
+
if (!t2.pa) throw Error("This task doesn't support region-of-interest.");
|
|
3130
|
+
var i2 = n2.regionOfInterest;
|
|
3131
|
+
if (i2.left >= i2.right || i2.top >= i2.bottom) throw Error("Expected RectF with left < right and top < bottom.");
|
|
3132
|
+
if (i2.left < 0 || i2.top < 0 || i2.right > 1 || i2.bottom > 1) throw Error("Expected RectF values to be in [0,1].");
|
|
3133
|
+
gn(s2, 1, (i2.left + i2.right) / 2), gn(s2, 2, (i2.top + i2.bottom) / 2), gn(s2, 4, i2.right - i2.left), gn(s2, 3, i2.bottom - i2.top);
|
|
3134
|
+
} else gn(s2, 1, 0.5), gn(s2, 2, 0.5), gn(s2, 4, 1), gn(s2, 3, 1);
|
|
3135
|
+
if (n2?.rotationDegrees) {
|
|
3136
|
+
if (n2?.rotationDegrees % 90 != 0) throw Error("Expected rotation to be a multiple of 90\xB0.");
|
|
3137
|
+
if (gn(s2, 5, -Math.PI * n2.rotationDegrees / 180), n2?.rotationDegrees % 180 != 0) {
|
|
3138
|
+
const [t3, r3] = Uo(e2);
|
|
3139
|
+
n2 = dn(s2, 3) * r3 / t3, i2 = dn(s2, 4) * t3 / r3, gn(s2, 4, n2), gn(s2, 3, i2);
|
|
3140
|
+
}
|
|
3141
|
+
}
|
|
3142
|
+
t2.g.addProtoToStream(s2.g(), "mediapipe.NormalizedRect", t2.T, r2);
|
|
3143
|
+
}
|
|
3144
|
+
t2.g.qa(e2, t2.aa, r2 ?? performance.now()), t2.finishProcessing();
|
|
3145
|
+
}
|
|
3146
|
+
function Wa(t2, e2, n2) {
|
|
3147
|
+
if (t2.baseOptions?.g()) throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");
|
|
3148
|
+
Ha(t2, e2, n2, t2.B + 1);
|
|
3149
|
+
}
|
|
3150
|
+
function za(t2, e2, n2, r2) {
|
|
3151
|
+
if (!t2.baseOptions?.g()) throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");
|
|
3152
|
+
Ha(t2, e2, n2, r2);
|
|
3153
|
+
}
|
|
3154
|
+
function Ka(t2, e2, n2, r2) {
|
|
3155
|
+
var i2 = e2.data;
|
|
3156
|
+
const s2 = e2.width, o2 = s2 * (e2 = e2.height);
|
|
3157
|
+
if ((i2 instanceof Uint8Array || i2 instanceof Float32Array) && i2.length !== o2) throw Error("Unsupported channel count: " + i2.length / o2);
|
|
3158
|
+
return t2 = new ya([i2], n2, false, t2.g.i.canvas, t2.O, s2, e2), r2 ? t2.clone() : t2;
|
|
3159
|
+
}
|
|
3160
|
+
var Ya = class extends $o {
|
|
3161
|
+
constructor(t2, e2, n2, r2) {
|
|
3162
|
+
super(t2), this.g = t2, this.aa = e2, this.T = n2, this.pa = r2, this.O = new sa();
|
|
3163
|
+
}
|
|
3164
|
+
l(t2, e2 = true) {
|
|
3165
|
+
if ("runningMode" in t2 && fn(this.baseOptions, 2, !!t2.runningMode && "IMAGE" !== t2.runningMode), void 0 !== t2.canvas && this.g.i.canvas !== t2.canvas) throw Error("You must create a new task to reset the canvas.");
|
|
3166
|
+
return super.l(t2, e2);
|
|
3167
|
+
}
|
|
3168
|
+
close() {
|
|
3169
|
+
this.O.close(), super.close();
|
|
3170
|
+
}
|
|
3171
|
+
};
|
|
3172
|
+
Ya.prototype.close = Ya.prototype.close;
|
|
3173
|
+
var $a = class extends Ya {
|
|
3174
|
+
constructor(t2, e2) {
|
|
3175
|
+
super(new Va(t2, e2), "image_in", "norm_rect_in", false), this.j = { detections: [] }, sn(t2 = this.h = new Is(), 0, 1, e2 = new Ls()), gn(this.h, 2, 0.5), gn(this.h, 3, 0.3);
|
|
3176
|
+
}
|
|
3177
|
+
get baseOptions() {
|
|
3178
|
+
return en(this.h, Ls, 1);
|
|
3179
|
+
}
|
|
3180
|
+
set baseOptions(t2) {
|
|
3181
|
+
sn(this.h, 0, 1, t2);
|
|
3182
|
+
}
|
|
3183
|
+
o(t2) {
|
|
3184
|
+
return "minDetectionConfidence" in t2 && gn(this.h, 2, t2.minDetectionConfidence ?? 0.5), "minSuppressionThreshold" in t2 && gn(this.h, 3, t2.minSuppressionThreshold ?? 0.3), this.l(t2);
|
|
3185
|
+
}
|
|
3186
|
+
D(t2, e2) {
|
|
3187
|
+
return this.j = { detections: [] }, Wa(this, t2, e2), this.j;
|
|
3188
|
+
}
|
|
3189
|
+
F(t2, e2, n2) {
|
|
3190
|
+
return this.j = { detections: [] }, za(this, t2, n2, e2), this.j;
|
|
3191
|
+
}
|
|
3192
|
+
m() {
|
|
3193
|
+
var t2 = new qi();
|
|
3194
|
+
Yi(t2, "image_in"), Yi(t2, "norm_rect_in"), $i(t2, "detections");
|
|
3195
|
+
const e2 = new Di();
|
|
3196
|
+
Xn(e2, Ps, this.h);
|
|
3197
|
+
const n2 = new Xi();
|
|
3198
|
+
Gi(n2, "mediapipe.tasks.vision.face_detector.FaceDetectorGraph"), ji(n2, "IMAGE:image_in"), ji(n2, "NORM_RECT:norm_rect_in"), Vi(n2, "DETECTIONS:detections"), n2.o(e2), Ki(t2, n2), this.g.attachProtoVectorListener("detections", (t3, e3) => {
|
|
3199
|
+
for (const e4 of t3) t3 = os(e4), this.j.detections.push(bo(t3));
|
|
3200
|
+
Wo(this, e3);
|
|
3201
|
+
}), this.g.attachEmptyPacketListener("detections", (t3) => {
|
|
3202
|
+
Wo(this, t3);
|
|
3203
|
+
}), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3204
|
+
}
|
|
3205
|
+
};
|
|
3206
|
+
$a.prototype.detectForVideo = $a.prototype.F, $a.prototype.detect = $a.prototype.D, $a.prototype.setOptions = $a.prototype.o, $a.createFromModelPath = async function(t2, e2) {
|
|
3207
|
+
return Xa($a, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3208
|
+
}, $a.createFromModelBuffer = function(t2, e2) {
|
|
3209
|
+
return Xa($a, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3210
|
+
}, $a.createFromOptions = function(t2, e2) {
|
|
3211
|
+
return Xa($a, t2, e2);
|
|
3212
|
+
};
|
|
3213
|
+
var qa = Ba([61, 146], [146, 91], [91, 181], [181, 84], [84, 17], [17, 314], [314, 405], [405, 321], [321, 375], [375, 291], [61, 185], [185, 40], [40, 39], [39, 37], [37, 0], [0, 267], [267, 269], [269, 270], [270, 409], [409, 291], [78, 95], [95, 88], [88, 178], [178, 87], [87, 14], [14, 317], [317, 402], [402, 318], [318, 324], [324, 308], [78, 191], [191, 80], [80, 81], [81, 82], [82, 13], [13, 312], [312, 311], [311, 310], [310, 415], [415, 308]);
|
|
3214
|
+
var Ja = Ba([263, 249], [249, 390], [390, 373], [373, 374], [374, 380], [380, 381], [381, 382], [382, 362], [263, 466], [466, 388], [388, 387], [387, 386], [386, 385], [385, 384], [384, 398], [398, 362]);
|
|
3215
|
+
var Za = Ba([276, 283], [283, 282], [282, 295], [295, 285], [300, 293], [293, 334], [334, 296], [296, 336]);
|
|
3216
|
+
var Qa = Ba([474, 475], [475, 476], [476, 477], [477, 474]);
|
|
3217
|
+
var tc = Ba([33, 7], [7, 163], [163, 144], [144, 145], [145, 153], [153, 154], [154, 155], [155, 133], [33, 246], [246, 161], [161, 160], [160, 159], [159, 158], [158, 157], [157, 173], [173, 133]);
|
|
3218
|
+
var ec = Ba([46, 53], [53, 52], [52, 65], [65, 55], [70, 63], [63, 105], [105, 66], [66, 107]);
|
|
3219
|
+
var nc = Ba([469, 470], [470, 471], [471, 472], [472, 469]);
|
|
3220
|
+
var rc = Ba([10, 338], [338, 297], [297, 332], [332, 284], [284, 251], [251, 389], [389, 356], [356, 454], [454, 323], [323, 361], [361, 288], [288, 397], [397, 365], [365, 379], [379, 378], [378, 400], [400, 377], [377, 152], [152, 148], [148, 176], [176, 149], [149, 150], [150, 136], [136, 172], [172, 58], [58, 132], [132, 93], [93, 234], [234, 127], [127, 162], [162, 21], [21, 54], [54, 103], [103, 67], [67, 109], [109, 10]);
|
|
3221
|
+
var ic = [...qa, ...Ja, ...Za, ...tc, ...ec, ...rc];
|
|
3222
|
+
var sc = Ba([127, 34], [34, 139], [139, 127], [11, 0], [0, 37], [37, 11], [232, 231], [231, 120], [120, 232], [72, 37], [37, 39], [39, 72], [128, 121], [121, 47], [47, 128], [232, 121], [121, 128], [128, 232], [104, 69], [69, 67], [67, 104], [175, 171], [171, 148], [148, 175], [118, 50], [50, 101], [101, 118], [73, 39], [39, 40], [40, 73], [9, 151], [151, 108], [108, 9], [48, 115], [115, 131], [131, 48], [194, 204], [204, 211], [211, 194], [74, 40], [40, 185], [185, 74], [80, 42], [42, 183], [183, 80], [40, 92], [92, 186], [186, 40], [230, 229], [229, 118], [118, 230], [202, 212], [212, 214], [214, 202], [83, 18], [18, 17], [17, 83], [76, 61], [61, 146], [146, 76], [160, 29], [29, 30], [30, 160], [56, 157], [157, 173], [173, 56], [106, 204], [204, 194], [194, 106], [135, 214], [214, 192], [192, 135], [203, 165], [165, 98], [98, 203], [21, 71], [71, 68], [68, 21], [51, 45], [45, 4], [4, 51], [144, 24], [24, 23], [23, 144], [77, 146], [146, 91], [91, 77], [205, 50], [50, 187], [187, 205], [201, 200], [200, 18], [18, 201], [91, 106], [106, 182], [182, 91], [90, 91], [91, 181], [181, 90], [85, 84], [84, 17], [17, 85], [206, 203], [203, 36], [36, 206], [148, 171], [171, 140], [140, 148], [92, 40], [40, 39], [39, 92], [193, 189], [189, 244], [244, 193], [159, 158], [158, 28], [28, 159], [247, 246], [246, 161], [161, 247], [236, 3], [3, 196], [196, 236], [54, 68], [68, 104], [104, 54], [193, 168], [168, 8], [8, 193], [117, 228], [228, 31], [31, 117], [189, 193], [193, 55], [55, 189], [98, 97], [97, 99], [99, 98], [126, 47], [47, 100], [100, 126], [166, 79], [79, 218], [218, 166], [155, 154], [154, 26], [26, 155], [209, 49], [49, 131], [131, 209], [135, 136], [136, 150], [150, 135], [47, 126], [126, 217], [217, 47], [223, 52], [52, 53], [53, 223], [45, 51], [51, 134], [134, 45], [211, 170], [170, 140], [140, 211], [67, 69], [69, 108], [108, 67], [43, 106], [106, 91], [91, 43], [230, 119], [119, 120], [120, 230], [226, 130], [130, 247], [247, 226], [63, 53], [53, 52], [52, 63], [238, 20], [20, 242], [242, 238], [46, 70], [70, 156], [156, 46], [78, 62], [62, 96], [96, 78], [46, 53], [53, 63], [63, 46], [143, 34], [34, 227], [227, 143], [123, 117], [117, 111], [111, 123], [44, 125], [125, 19], [19, 44], [236, 134], [134, 51], [51, 236], [216, 206], [206, 205], [205, 216], [154, 153], [153, 22], [22, 154], [39, 37], [37, 167], [167, 39], [200, 201], [201, 208], [208, 200], [36, 142], [142, 100], [100, 36], [57, 212], [212, 202], [202, 57], [20, 60], [60, 99], [99, 20], [28, 158], [158, 157], [157, 28], [35, 226], [226, 113], [113, 35], [160, 159], [159, 27], [27, 160], [204, 202], [202, 210], [210, 204], [113, 225], [225, 46], [46, 113], [43, 202], [202, 204], [204, 43], [62, 76], [76, 77], [77, 62], [137, 123], [123, 116], [116, 137], [41, 38], [38, 72], [72, 41], [203, 129], [129, 142], [142, 203], [64, 98], [98, 240], [240, 64], [49, 102], [102, 64], [64, 49], [41, 73], [73, 74], [74, 41], [212, 216], [216, 207], [207, 212], [42, 74], [74, 184], [184, 42], [169, 170], [170, 211], [211, 169], [170, 149], [149, 176], [176, 170], [105, 66], [66, 69], [69, 105], [122, 6], [6, 168], [168, 122], [123, 147], [147, 187], [187, 123], [96, 77], [77, 90], [90, 96], [65, 55], [55, 107], [107, 65], [89, 90], [90, 180], [180, 89], [101, 100], [100, 120], [120, 101], [63, 105], [105, 104], [104, 63], [93, 137], [137, 227], [227, 93], [15, 86], [86, 85], [85, 15], [129, 102], [102, 49], [49, 129], [14, 87], [87, 86], [86, 14], [55, 8], [8, 9], [9, 55], [100, 47], [47, 121], [121, 100], [145, 23], [23, 22], [22, 145], [88, 89], [89, 179], [179, 88], [6, 122], [122, 196], [196, 6], [88, 95], [95, 96], [96, 88], [138, 172], [172, 136], [136, 138], [215, 58], [58, 172], [172, 215], [115, 48], [48, 219], [219, 115], [42, 80], [80, 81], [81, 42], [195, 3], [3, 51], [51, 195], [43, 146], [146, 61], [61, 43], [171, 175], [175, 199], [199, 171], [81, 82], [82, 38], [38, 81], [53, 46], [46, 225], [225, 53], [144, 163], [163, 110], [110, 144], [52, 65], [65, 66], [66, 52], [229, 228], [228, 117], [117, 229], [34, 127], [127, 234], [234, 34], [107, 108], [108, 69], [69, 107], [109, 108], [108, 151], [151, 109], [48, 64], [64, 235], [235, 48], [62, 78], [78, 191], [191, 62], [129, 209], [209, 126], [126, 129], [111, 35], [35, 143], [143, 111], [117, 123], [123, 50], [50, 117], [222, 65], [65, 52], [52, 222], [19, 125], [125, 141], [141, 19], [221, 55], [55, 65], [65, 221], [3, 195], [195, 197], [197, 3], [25, 7], [7, 33], [33, 25], [220, 237], [237, 44], [44, 220], [70, 71], [71, 139], [139, 70], [122, 193], [193, 245], [245, 122], [247, 130], [130, 33], [33, 247], [71, 21], [21, 162], [162, 71], [170, 169], [169, 150], [150, 170], [188, 174], [174, 196], [196, 188], [216, 186], [186, 92], [92, 216], [2, 97], [97, 167], [167, 2], [141, 125], [125, 241], [241, 141], [164, 167], [167, 37], [37, 164], [72, 38], [38, 12], [12, 72], [38, 82], [82, 13], [13, 38], [63, 68], [68, 71], [71, 63], [226, 35], [35, 111], [111, 226], [101, 50], [50, 205], [205, 101], [206, 92], [92, 165], [165, 206], [209, 198], [198, 217], [217, 209], [165, 167], [167, 97], [97, 165], [220, 115], [115, 218], [218, 220], [133, 112], [112, 243], [243, 133], [239, 238], [238, 241], [241, 239], [214, 135], [135, 169], [169, 214], [190, 173], [173, 133], [133, 190], [171, 208], [208, 32], [32, 171], [125, 44], [44, 237], [237, 125], [86, 87], [87, 178], [178, 86], [85, 86], [86, 179], [179, 85], [84, 85], [85, 180], [180, 84], [83, 84], [84, 181], [181, 83], [201, 83], [83, 182], [182, 201], [137, 93], [93, 132], [132, 137], [76, 62], [62, 183], [183, 76], [61, 76], [76, 184], [184, 61], [57, 61], [61, 185], [185, 57], [212, 57], [57, 186], [186, 212], [214, 207], [207, 187], [187, 214], [34, 143], [143, 156], [156, 34], [79, 239], [239, 237], [237, 79], [123, 137], [137, 177], [177, 123], [44, 1], [1, 4], [4, 44], [201, 194], [194, 32], [32, 201], [64, 102], [102, 129], [129, 64], [213, 215], [215, 138], [138, 213], [59, 166], [166, 219], [219, 59], [242, 99], [99, 97], [97, 242], [2, 94], [94, 141], [141, 2], [75, 59], [59, 235], [235, 75], [24, 110], [110, 228], [228, 24], [25, 130], [130, 226], [226, 25], [23, 24], [24, 229], [229, 23], [22, 23], [23, 230], [230, 22], [26, 22], [22, 231], [231, 26], [112, 26], [26, 232], [232, 112], [189, 190], [190, 243], [243, 189], [221, 56], [56, 190], [190, 221], [28, 56], [56, 221], [221, 28], [27, 28], [28, 222], [222, 27], [29, 27], [27, 223], [223, 29], [30, 29], [29, 224], [224, 30], [247, 30], [30, 225], [225, 247], [238, 79], [79, 20], [20, 238], [166, 59], [59, 75], [75, 166], [60, 75], [75, 240], [240, 60], [147, 177], [177, 215], [215, 147], [20, 79], [79, 166], [166, 20], [187, 147], [147, 213], [213, 187], [112, 233], [233, 244], [244, 112], [233, 128], [128, 245], [245, 233], [128, 114], [114, 188], [188, 128], [114, 217], [217, 174], [174, 114], [131, 115], [115, 220], [220, 131], [217, 198], [198, 236], [236, 217], [198, 131], [131, 134], [134, 198], [177, 132], [132, 58], [58, 177], [143, 35], [35, 124], [124, 143], [110, 163], [163, 7], [7, 110], [228, 110], [110, 25], [25, 228], [356, 389], [389, 368], [368, 356], [11, 302], [302, 267], [267, 11], [452, 350], [350, 349], [349, 452], [302, 303], [303, 269], [269, 302], [357, 343], [343, 277], [277, 357], [452, 453], [453, 357], [357, 452], [333, 332], [332, 297], [297, 333], [175, 152], [152, 377], [377, 175], [347, 348], [348, 330], [330, 347], [303, 304], [304, 270], [270, 303], [9, 336], [336, 337], [337, 9], [278, 279], [279, 360], [360, 278], [418, 262], [262, 431], [431, 418], [304, 408], [408, 409], [409, 304], [310, 415], [415, 407], [407, 310], [270, 409], [409, 410], [410, 270], [450, 348], [348, 347], [347, 450], [422, 430], [430, 434], [434, 422], [313, 314], [314, 17], [17, 313], [306, 307], [307, 375], [375, 306], [387, 388], [388, 260], [260, 387], [286, 414], [414, 398], [398, 286], [335, 406], [406, 418], [418, 335], [364, 367], [367, 416], [416, 364], [423, 358], [358, 327], [327, 423], [251, 284], [284, 298], [298, 251], [281, 5], [5, 4], [4, 281], [373, 374], [374, 253], [253, 373], [307, 320], [320, 321], [321, 307], [425, 427], [427, 411], [411, 425], [421, 313], [313, 18], [18, 421], [321, 405], [405, 406], [406, 321], [320, 404], [404, 405], [405, 320], [315, 16], [16, 17], [17, 315], [426, 425], [425, 266], [266, 426], [377, 400], [400, 369], [369, 377], [322, 391], [391, 269], [269, 322], [417, 465], [465, 464], [464, 417], [386, 257], [257, 258], [258, 386], [466, 260], [260, 388], [388, 466], [456, 399], [399, 419], [419, 456], [284, 332], [332, 333], [333, 284], [417, 285], [285, 8], [8, 417], [346, 340], [340, 261], [261, 346], [413, 441], [441, 285], [285, 413], [327, 460], [460, 328], [328, 327], [355, 371], [371, 329], [329, 355], [392, 439], [439, 438], [438, 392], [382, 341], [341, 256], [256, 382], [429, 420], [420, 360], [360, 429], [364, 394], [394, 379], [379, 364], [277, 343], [343, 437], [437, 277], [443, 444], [444, 283], [283, 443], [275, 440], [440, 363], [363, 275], [431, 262], [262, 369], [369, 431], [297, 338], [338, 337], [337, 297], [273, 375], [375, 321], [321, 273], [450, 451], [451, 349], [349, 450], [446, 342], [342, 467], [467, 446], [293, 334], [334, 282], [282, 293], [458, 461], [461, 462], [462, 458], [276, 353], [353, 383], [383, 276], [308, 324], [324, 325], [325, 308], [276, 300], [300, 293], [293, 276], [372, 345], [345, 447], [447, 372], [352, 345], [345, 340], [340, 352], [274, 1], [1, 19], [19, 274], [456, 248], [248, 281], [281, 456], [436, 427], [427, 425], [425, 436], [381, 256], [256, 252], [252, 381], [269, 391], [391, 393], [393, 269], [200, 199], [199, 428], [428, 200], [266, 330], [330, 329], [329, 266], [287, 273], [273, 422], [422, 287], [250, 462], [462, 328], [328, 250], [258, 286], [286, 384], [384, 258], [265, 353], [353, 342], [342, 265], [387, 259], [259, 257], [257, 387], [424, 431], [431, 430], [430, 424], [342, 353], [353, 276], [276, 342], [273, 335], [335, 424], [424, 273], [292, 325], [325, 307], [307, 292], [366, 447], [447, 345], [345, 366], [271, 303], [303, 302], [302, 271], [423, 266], [266, 371], [371, 423], [294, 455], [455, 460], [460, 294], [279, 278], [278, 294], [294, 279], [271, 272], [272, 304], [304, 271], [432, 434], [434, 427], [427, 432], [272, 407], [407, 408], [408, 272], [394, 430], [430, 431], [431, 394], [395, 369], [369, 400], [400, 395], [334, 333], [333, 299], [299, 334], [351, 417], [417, 168], [168, 351], [352, 280], [280, 411], [411, 352], [325, 319], [319, 320], [320, 325], [295, 296], [296, 336], [336, 295], [319, 403], [403, 404], [404, 319], [330, 348], [348, 349], [349, 330], [293, 298], [298, 333], [333, 293], [323, 454], [454, 447], [447, 323], [15, 16], [16, 315], [315, 15], [358, 429], [429, 279], [279, 358], [14, 15], [15, 316], [316, 14], [285, 336], [336, 9], [9, 285], [329, 349], [349, 350], [350, 329], [374, 380], [380, 252], [252, 374], [318, 402], [402, 403], [403, 318], [6, 197], [197, 419], [419, 6], [318, 319], [319, 325], [325, 318], [367, 364], [364, 365], [365, 367], [435, 367], [367, 397], [397, 435], [344, 438], [438, 439], [439, 344], [272, 271], [271, 311], [311, 272], [195, 5], [5, 281], [281, 195], [273, 287], [287, 291], [291, 273], [396, 428], [428, 199], [199, 396], [311, 271], [271, 268], [268, 311], [283, 444], [444, 445], [445, 283], [373, 254], [254, 339], [339, 373], [282, 334], [334, 296], [296, 282], [449, 347], [347, 346], [346, 449], [264, 447], [447, 454], [454, 264], [336, 296], [296, 299], [299, 336], [338, 10], [10, 151], [151, 338], [278, 439], [439, 455], [455, 278], [292, 407], [407, 415], [415, 292], [358, 371], [371, 355], [355, 358], [340, 345], [345, 372], [372, 340], [346, 347], [347, 280], [280, 346], [442, 443], [443, 282], [282, 442], [19, 94], [94, 370], [370, 19], [441, 442], [442, 295], [295, 441], [248, 419], [419, 197], [197, 248], [263, 255], [255, 359], [359, 263], [440, 275], [275, 274], [274, 440], [300, 383], [383, 368], [368, 300], [351, 412], [412, 465], [465, 351], [263, 467], [467, 466], [466, 263], [301, 368], [368, 389], [389, 301], [395, 378], [378, 379], [379, 395], [412, 351], [351, 419], [419, 412], [436, 426], [426, 322], [322, 436], [2, 164], [164, 393], [393, 2], [370, 462], [462, 461], [461, 370], [164, 0], [0, 267], [267, 164], [302, 11], [11, 12], [12, 302], [268, 12], [12, 13], [13, 268], [293, 300], [300, 301], [301, 293], [446, 261], [261, 340], [340, 446], [330, 266], [266, 425], [425, 330], [426, 423], [423, 391], [391, 426], [429, 355], [355, 437], [437, 429], [391, 327], [327, 326], [326, 391], [440, 457], [457, 438], [438, 440], [341, 382], [382, 362], [362, 341], [459, 457], [457, 461], [461, 459], [434, 430], [430, 394], [394, 434], [414, 463], [463, 362], [362, 414], [396, 369], [369, 262], [262, 396], [354, 461], [461, 457], [457, 354], [316, 403], [403, 402], [402, 316], [315, 404], [404, 403], [403, 315], [314, 405], [405, 404], [404, 314], [313, 406], [406, 405], [405, 313], [421, 418], [418, 406], [406, 421], [366, 401], [401, 361], [361, 366], [306, 408], [408, 407], [407, 306], [291, 409], [409, 408], [408, 291], [287, 410], [410, 409], [409, 287], [432, 436], [436, 410], [410, 432], [434, 416], [416, 411], [411, 434], [264, 368], [368, 383], [383, 264], [309, 438], [438, 457], [457, 309], [352, 376], [376, 401], [401, 352], [274, 275], [275, 4], [4, 274], [421, 428], [428, 262], [262, 421], [294, 327], [327, 358], [358, 294], [433, 416], [416, 367], [367, 433], [289, 455], [455, 439], [439, 289], [462, 370], [370, 326], [326, 462], [2, 326], [326, 370], [370, 2], [305, 460], [460, 455], [455, 305], [254, 449], [449, 448], [448, 254], [255, 261], [261, 446], [446, 255], [253, 450], [450, 449], [449, 253], [252, 451], [451, 450], [450, 252], [256, 452], [452, 451], [451, 256], [341, 453], [453, 452], [452, 341], [413, 464], [464, 463], [463, 413], [441, 413], [413, 414], [414, 441], [258, 442], [442, 441], [441, 258], [257, 443], [443, 442], [442, 257], [259, 444], [444, 443], [443, 259], [260, 445], [445, 444], [444, 260], [467, 342], [342, 445], [445, 467], [459, 458], [458, 250], [250, 459], [289, 392], [392, 290], [290, 289], [290, 328], [328, 460], [460, 290], [376, 433], [433, 435], [435, 376], [250, 290], [290, 392], [392, 250], [411, 416], [416, 433], [433, 411], [341, 463], [463, 464], [464, 341], [453, 464], [464, 465], [465, 453], [357, 465], [465, 412], [412, 357], [343, 412], [412, 399], [399, 343], [360, 363], [363, 440], [440, 360], [437, 399], [399, 456], [456, 437], [420, 456], [456, 363], [363, 420], [401, 435], [435, 288], [288, 401], [372, 383], [383, 353], [353, 372], [339, 255], [255, 249], [249, 339], [448, 261], [261, 255], [255, 448], [133, 243], [243, 190], [190, 133], [133, 155], [155, 112], [112, 133], [33, 246], [246, 247], [247, 33], [33, 130], [130, 25], [25, 33], [398, 384], [384, 286], [286, 398], [362, 398], [398, 414], [414, 362], [362, 463], [463, 341], [341, 362], [263, 359], [359, 467], [467, 263], [263, 249], [249, 255], [255, 263], [466, 467], [467, 260], [260, 466], [75, 60], [60, 166], [166, 75], [238, 239], [239, 79], [79, 238], [162, 127], [127, 139], [139, 162], [72, 11], [11, 37], [37, 72], [121, 232], [232, 120], [120, 121], [73, 72], [72, 39], [39, 73], [114, 128], [128, 47], [47, 114], [233, 232], [232, 128], [128, 233], [103, 104], [104, 67], [67, 103], [152, 175], [175, 148], [148, 152], [119, 118], [118, 101], [101, 119], [74, 73], [73, 40], [40, 74], [107, 9], [9, 108], [108, 107], [49, 48], [48, 131], [131, 49], [32, 194], [194, 211], [211, 32], [184, 74], [74, 185], [185, 184], [191, 80], [80, 183], [183, 191], [185, 40], [40, 186], [186, 185], [119, 230], [230, 118], [118, 119], [210, 202], [202, 214], [214, 210], [84, 83], [83, 17], [17, 84], [77, 76], [76, 146], [146, 77], [161, 160], [160, 30], [30, 161], [190, 56], [56, 173], [173, 190], [182, 106], [106, 194], [194, 182], [138, 135], [135, 192], [192, 138], [129, 203], [203, 98], [98, 129], [54, 21], [21, 68], [68, 54], [5, 51], [51, 4], [4, 5], [145, 144], [144, 23], [23, 145], [90, 77], [77, 91], [91, 90], [207, 205], [205, 187], [187, 207], [83, 201], [201, 18], [18, 83], [181, 91], [91, 182], [182, 181], [180, 90], [90, 181], [181, 180], [16, 85], [85, 17], [17, 16], [205, 206], [206, 36], [36, 205], [176, 148], [148, 140], [140, 176], [165, 92], [92, 39], [39, 165], [245, 193], [193, 244], [244, 245], [27, 159], [159, 28], [28, 27], [30, 247], [247, 161], [161, 30], [174, 236], [236, 196], [196, 174], [103, 54], [54, 104], [104, 103], [55, 193], [193, 8], [8, 55], [111, 117], [117, 31], [31, 111], [221, 189], [189, 55], [55, 221], [240, 98], [98, 99], [99, 240], [142, 126], [126, 100], [100, 142], [219, 166], [166, 218], [218, 219], [112, 155], [155, 26], [26, 112], [198, 209], [209, 131], [131, 198], [169, 135], [135, 150], [150, 169], [114, 47], [47, 217], [217, 114], [224, 223], [223, 53], [53, 224], [220, 45], [45, 134], [134, 220], [32, 211], [211, 140], [140, 32], [109, 67], [67, 108], [108, 109], [146, 43], [43, 91], [91, 146], [231, 230], [230, 120], [120, 231], [113, 226], [226, 247], [247, 113], [105, 63], [63, 52], [52, 105], [241, 238], [238, 242], [242, 241], [124, 46], [46, 156], [156, 124], [95, 78], [78, 96], [96, 95], [70, 46], [46, 63], [63, 70], [116, 143], [143, 227], [227, 116], [116, 123], [123, 111], [111, 116], [1, 44], [44, 19], [19, 1], [3, 236], [236, 51], [51, 3], [207, 216], [216, 205], [205, 207], [26, 154], [154, 22], [22, 26], [165, 39], [39, 167], [167, 165], [199, 200], [200, 208], [208, 199], [101, 36], [36, 100], [100, 101], [43, 57], [57, 202], [202, 43], [242, 20], [20, 99], [99, 242], [56, 28], [28, 157], [157, 56], [124, 35], [35, 113], [113, 124], [29, 160], [160, 27], [27, 29], [211, 204], [204, 210], [210, 211], [124, 113], [113, 46], [46, 124], [106, 43], [43, 204], [204, 106], [96, 62], [62, 77], [77, 96], [227, 137], [137, 116], [116, 227], [73, 41], [41, 72], [72, 73], [36, 203], [203, 142], [142, 36], [235, 64], [64, 240], [240, 235], [48, 49], [49, 64], [64, 48], [42, 41], [41, 74], [74, 42], [214, 212], [212, 207], [207, 214], [183, 42], [42, 184], [184, 183], [210, 169], [169, 211], [211, 210], [140, 170], [170, 176], [176, 140], [104, 105], [105, 69], [69, 104], [193, 122], [122, 168], [168, 193], [50, 123], [123, 187], [187, 50], [89, 96], [96, 90], [90, 89], [66, 65], [65, 107], [107, 66], [179, 89], [89, 180], [180, 179], [119, 101], [101, 120], [120, 119], [68, 63], [63, 104], [104, 68], [234, 93], [93, 227], [227, 234], [16, 15], [15, 85], [85, 16], [209, 129], [129, 49], [49, 209], [15, 14], [14, 86], [86, 15], [107, 55], [55, 9], [9, 107], [120, 100], [100, 121], [121, 120], [153, 145], [145, 22], [22, 153], [178, 88], [88, 179], [179, 178], [197, 6], [6, 196], [196, 197], [89, 88], [88, 96], [96, 89], [135, 138], [138, 136], [136, 135], [138, 215], [215, 172], [172, 138], [218, 115], [115, 219], [219, 218], [41, 42], [42, 81], [81, 41], [5, 195], [195, 51], [51, 5], [57, 43], [43, 61], [61, 57], [208, 171], [171, 199], [199, 208], [41, 81], [81, 38], [38, 41], [224, 53], [53, 225], [225, 224], [24, 144], [144, 110], [110, 24], [105, 52], [52, 66], [66, 105], [118, 229], [229, 117], [117, 118], [227, 34], [34, 234], [234, 227], [66, 107], [107, 69], [69, 66], [10, 109], [109, 151], [151, 10], [219, 48], [48, 235], [235, 219], [183, 62], [62, 191], [191, 183], [142, 129], [129, 126], [126, 142], [116, 111], [111, 143], [143, 116], [118, 117], [117, 50], [50, 118], [223, 222], [222, 52], [52, 223], [94, 19], [19, 141], [141, 94], [222, 221], [221, 65], [65, 222], [196, 3], [3, 197], [197, 196], [45, 220], [220, 44], [44, 45], [156, 70], [70, 139], [139, 156], [188, 122], [122, 245], [245, 188], [139, 71], [71, 162], [162, 139], [149, 170], [170, 150], [150, 149], [122, 188], [188, 196], [196, 122], [206, 216], [216, 92], [92, 206], [164, 2], [2, 167], [167, 164], [242, 141], [141, 241], [241, 242], [0, 164], [164, 37], [37, 0], [11, 72], [72, 12], [12, 11], [12, 38], [38, 13], [13, 12], [70, 63], [63, 71], [71, 70], [31, 226], [226, 111], [111, 31], [36, 101], [101, 205], [205, 36], [203, 206], [206, 165], [165, 203], [126, 209], [209, 217], [217, 126], [98, 165], [165, 97], [97, 98], [237, 220], [220, 218], [218, 237], [237, 239], [239, 241], [241, 237], [210, 214], [214, 169], [169, 210], [140, 171], [171, 32], [32, 140], [241, 125], [125, 237], [237, 241], [179, 86], [86, 178], [178, 179], [180, 85], [85, 179], [179, 180], [181, 84], [84, 180], [180, 181], [182, 83], [83, 181], [181, 182], [194, 201], [201, 182], [182, 194], [177, 137], [137, 132], [132, 177], [184, 76], [76, 183], [183, 184], [185, 61], [61, 184], [184, 185], [186, 57], [57, 185], [185, 186], [216, 212], [212, 186], [186, 216], [192, 214], [214, 187], [187, 192], [139, 34], [34, 156], [156, 139], [218, 79], [79, 237], [237, 218], [147, 123], [123, 177], [177, 147], [45, 44], [44, 4], [4, 45], [208, 201], [201, 32], [32, 208], [98, 64], [64, 129], [129, 98], [192, 213], [213, 138], [138, 192], [235, 59], [59, 219], [219, 235], [141, 242], [242, 97], [97, 141], [97, 2], [2, 141], [141, 97], [240, 75], [75, 235], [235, 240], [229, 24], [24, 228], [228, 229], [31, 25], [25, 226], [226, 31], [230, 23], [23, 229], [229, 230], [231, 22], [22, 230], [230, 231], [232, 26], [26, 231], [231, 232], [233, 112], [112, 232], [232, 233], [244, 189], [189, 243], [243, 244], [189, 221], [221, 190], [190, 189], [222, 28], [28, 221], [221, 222], [223, 27], [27, 222], [222, 223], [224, 29], [29, 223], [223, 224], [225, 30], [30, 224], [224, 225], [113, 247], [247, 225], [225, 113], [99, 60], [60, 240], [240, 99], [213, 147], [147, 215], [215, 213], [60, 20], [20, 166], [166, 60], [192, 187], [187, 213], [213, 192], [243, 112], [112, 244], [244, 243], [244, 233], [233, 245], [245, 244], [245, 128], [128, 188], [188, 245], [188, 114], [114, 174], [174, 188], [134, 131], [131, 220], [220, 134], [174, 217], [217, 236], [236, 174], [236, 198], [198, 134], [134, 236], [215, 177], [177, 58], [58, 215], [156, 143], [143, 124], [124, 156], [25, 110], [110, 7], [7, 25], [31, 228], [228, 25], [25, 31], [264, 356], [356, 368], [368, 264], [0, 11], [11, 267], [267, 0], [451, 452], [452, 349], [349, 451], [267, 302], [302, 269], [269, 267], [350, 357], [357, 277], [277, 350], [350, 452], [452, 357], [357, 350], [299, 333], [333, 297], [297, 299], [396, 175], [175, 377], [377, 396], [280, 347], [347, 330], [330, 280], [269, 303], [303, 270], [270, 269], [151, 9], [9, 337], [337, 151], [344, 278], [278, 360], [360, 344], [424, 418], [418, 431], [431, 424], [270, 304], [304, 409], [409, 270], [272, 310], [310, 407], [407, 272], [322, 270], [270, 410], [410, 322], [449, 450], [450, 347], [347, 449], [432, 422], [422, 434], [434, 432], [18, 313], [313, 17], [17, 18], [291, 306], [306, 375], [375, 291], [259, 387], [387, 260], [260, 259], [424, 335], [335, 418], [418, 424], [434, 364], [364, 416], [416, 434], [391, 423], [423, 327], [327, 391], [301, 251], [251, 298], [298, 301], [275, 281], [281, 4], [4, 275], [254, 373], [373, 253], [253, 254], [375, 307], [307, 321], [321, 375], [280, 425], [425, 411], [411, 280], [200, 421], [421, 18], [18, 200], [335, 321], [321, 406], [406, 335], [321, 320], [320, 405], [405, 321], [314, 315], [315, 17], [17, 314], [423, 426], [426, 266], [266, 423], [396, 377], [377, 369], [369, 396], [270, 322], [322, 269], [269, 270], [413, 417], [417, 464], [464, 413], [385, 386], [386, 258], [258, 385], [248, 456], [456, 419], [419, 248], [298, 284], [284, 333], [333, 298], [168, 417], [417, 8], [8, 168], [448, 346], [346, 261], [261, 448], [417, 413], [413, 285], [285, 417], [326, 327], [327, 328], [328, 326], [277, 355], [355, 329], [329, 277], [309, 392], [392, 438], [438, 309], [381, 382], [382, 256], [256, 381], [279, 429], [429, 360], [360, 279], [365, 364], [364, 379], [379, 365], [355, 277], [277, 437], [437, 355], [282, 443], [443, 283], [283, 282], [281, 275], [275, 363], [363, 281], [395, 431], [431, 369], [369, 395], [299, 297], [297, 337], [337, 299], [335, 273], [273, 321], [321, 335], [348, 450], [450, 349], [349, 348], [359, 446], [446, 467], [467, 359], [283, 293], [293, 282], [282, 283], [250, 458], [458, 462], [462, 250], [300, 276], [276, 383], [383, 300], [292, 308], [308, 325], [325, 292], [283, 276], [276, 293], [293, 283], [264, 372], [372, 447], [447, 264], [346, 352], [352, 340], [340, 346], [354, 274], [274, 19], [19, 354], [363, 456], [456, 281], [281, 363], [426, 436], [436, 425], [425, 426], [380, 381], [381, 252], [252, 380], [267, 269], [269, 393], [393, 267], [421, 200], [200, 428], [428, 421], [371, 266], [266, 329], [329, 371], [432, 287], [287, 422], [422, 432], [290, 250], [250, 328], [328, 290], [385, 258], [258, 384], [384, 385], [446, 265], [265, 342], [342, 446], [386, 387], [387, 257], [257, 386], [422, 424], [424, 430], [430, 422], [445, 342], [342, 276], [276, 445], [422, 273], [273, 424], [424, 422], [306, 292], [292, 307], [307, 306], [352, 366], [366, 345], [345, 352], [268, 271], [271, 302], [302, 268], [358, 423], [423, 371], [371, 358], [327, 294], [294, 460], [460, 327], [331, 279], [279, 294], [294, 331], [303, 271], [271, 304], [304, 303], [436, 432], [432, 427], [427, 436], [304, 272], [272, 408], [408, 304], [395, 394], [394, 431], [431, 395], [378, 395], [395, 400], [400, 378], [296, 334], [334, 299], [299, 296], [6, 351], [351, 168], [168, 6], [376, 352], [352, 411], [411, 376], [307, 325], [325, 320], [320, 307], [285, 295], [295, 336], [336, 285], [320, 319], [319, 404], [404, 320], [329, 330], [330, 349], [349, 329], [334, 293], [293, 333], [333, 334], [366, 323], [323, 447], [447, 366], [316, 15], [15, 315], [315, 316], [331, 358], [358, 279], [279, 331], [317, 14], [14, 316], [316, 317], [8, 285], [285, 9], [9, 8], [277, 329], [329, 350], [350, 277], [253, 374], [374, 252], [252, 253], [319, 318], [318, 403], [403, 319], [351, 6], [6, 419], [419, 351], [324, 318], [318, 325], [325, 324], [397, 367], [367, 365], [365, 397], [288, 435], [435, 397], [397, 288], [278, 344], [344, 439], [439, 278], [310, 272], [272, 311], [311, 310], [248, 195], [195, 281], [281, 248], [375, 273], [273, 291], [291, 375], [175, 396], [396, 199], [199, 175], [312, 311], [311, 268], [268, 312], [276, 283], [283, 445], [445, 276], [390, 373], [373, 339], [339, 390], [295, 282], [282, 296], [296, 295], [448, 449], [449, 346], [346, 448], [356, 264], [264, 454], [454, 356], [337, 336], [336, 299], [299, 337], [337, 338], [338, 151], [151, 337], [294, 278], [278, 455], [455, 294], [308, 292], [292, 415], [415, 308], [429, 358], [358, 355], [355, 429], [265, 340], [340, 372], [372, 265], [352, 346], [346, 280], [280, 352], [295, 442], [442, 282], [282, 295], [354, 19], [19, 370], [370, 354], [285, 441], [441, 295], [295, 285], [195, 248], [248, 197], [197, 195], [457, 440], [440, 274], [274, 457], [301, 300], [300, 368], [368, 301], [417, 351], [351, 465], [465, 417], [251, 301], [301, 389], [389, 251], [394, 395], [395, 379], [379, 394], [399, 412], [412, 419], [419, 399], [410, 436], [436, 322], [322, 410], [326, 2], [2, 393], [393, 326], [354, 370], [370, 461], [461, 354], [393, 164], [164, 267], [267, 393], [268, 302], [302, 12], [12, 268], [312, 268], [268, 13], [13, 312], [298, 293], [293, 301], [301, 298], [265, 446], [446, 340], [340, 265], [280, 330], [330, 425], [425, 280], [322, 426], [426, 391], [391, 322], [420, 429], [429, 437], [437, 420], [393, 391], [391, 326], [326, 393], [344, 440], [440, 438], [438, 344], [458, 459], [459, 461], [461, 458], [364, 434], [434, 394], [394, 364], [428, 396], [396, 262], [262, 428], [274, 354], [354, 457], [457, 274], [317, 316], [316, 402], [402, 317], [316, 315], [315, 403], [403, 316], [315, 314], [314, 404], [404, 315], [314, 313], [313, 405], [405, 314], [313, 421], [421, 406], [406, 313], [323, 366], [366, 361], [361, 323], [292, 306], [306, 407], [407, 292], [306, 291], [291, 408], [408, 306], [291, 287], [287, 409], [409, 291], [287, 432], [432, 410], [410, 287], [427, 434], [434, 411], [411, 427], [372, 264], [264, 383], [383, 372], [459, 309], [309, 457], [457, 459], [366, 352], [352, 401], [401, 366], [1, 274], [274, 4], [4, 1], [418, 421], [421, 262], [262, 418], [331, 294], [294, 358], [358, 331], [435, 433], [433, 367], [367, 435], [392, 289], [289, 439], [439, 392], [328, 462], [462, 326], [326, 328], [94, 2], [2, 370], [370, 94], [289, 305], [305, 455], [455, 289], [339, 254], [254, 448], [448, 339], [359, 255], [255, 446], [446, 359], [254, 253], [253, 449], [449, 254], [253, 252], [252, 450], [450, 253], [252, 256], [256, 451], [451, 252], [256, 341], [341, 452], [452, 256], [414, 413], [413, 463], [463, 414], [286, 441], [441, 414], [414, 286], [286, 258], [258, 441], [441, 286], [258, 257], [257, 442], [442, 258], [257, 259], [259, 443], [443, 257], [259, 260], [260, 444], [444, 259], [260, 467], [467, 445], [445, 260], [309, 459], [459, 250], [250, 309], [305, 289], [289, 290], [290, 305], [305, 290], [290, 460], [460, 305], [401, 376], [376, 435], [435, 401], [309, 250], [250, 392], [392, 309], [376, 411], [411, 433], [433, 376], [453, 341], [341, 464], [464, 453], [357, 453], [453, 465], [465, 357], [343, 357], [357, 412], [412, 343], [437, 343], [343, 399], [399, 437], [344, 360], [360, 440], [440, 344], [420, 437], [437, 456], [456, 420], [360, 420], [420, 363], [363, 360], [361, 401], [401, 288], [288, 361], [265, 372], [372, 353], [353, 265], [390, 339], [339, 249], [249, 390], [339, 448], [448, 255], [255, 339]);
|
|
3223
|
+
function oc(t2) {
|
|
3224
|
+
t2.j = { faceLandmarks: [], faceBlendshapes: [], facialTransformationMatrixes: [] };
|
|
3225
|
+
}
|
|
3226
|
+
var ac = class extends Ya {
|
|
3227
|
+
constructor(t2, e2) {
|
|
3228
|
+
super(new Va(t2, e2), "image_in", "norm_rect", false), this.j = { faceLandmarks: [], faceBlendshapes: [], facialTransformationMatrixes: [] }, this.outputFacialTransformationMatrixes = this.outputFaceBlendshapes = false, sn(t2 = this.h = new Us(), 0, 1, e2 = new Ls()), this.v = new Cs(), sn(this.h, 0, 3, this.v), this.s = new Is(), sn(this.h, 0, 2, this.s), pn(this.s, 4, 1), gn(this.s, 2, 0.5), gn(this.v, 2, 0.5), gn(this.h, 4, 0.5);
|
|
3229
|
+
}
|
|
3230
|
+
get baseOptions() {
|
|
3231
|
+
return en(this.h, Ls, 1);
|
|
3232
|
+
}
|
|
3233
|
+
set baseOptions(t2) {
|
|
3234
|
+
sn(this.h, 0, 1, t2);
|
|
3235
|
+
}
|
|
3236
|
+
o(t2) {
|
|
3237
|
+
return "numFaces" in t2 && pn(this.s, 4, t2.numFaces ?? 1), "minFaceDetectionConfidence" in t2 && gn(this.s, 2, t2.minFaceDetectionConfidence ?? 0.5), "minTrackingConfidence" in t2 && gn(this.h, 4, t2.minTrackingConfidence ?? 0.5), "minFacePresenceConfidence" in t2 && gn(this.v, 2, t2.minFacePresenceConfidence ?? 0.5), "outputFaceBlendshapes" in t2 && (this.outputFaceBlendshapes = !!t2.outputFaceBlendshapes), "outputFacialTransformationMatrixes" in t2 && (this.outputFacialTransformationMatrixes = !!t2.outputFacialTransformationMatrixes), this.l(t2);
|
|
3238
|
+
}
|
|
3239
|
+
D(t2, e2) {
|
|
3240
|
+
return oc(this), Wa(this, t2, e2), this.j;
|
|
3241
|
+
}
|
|
3242
|
+
F(t2, e2, n2) {
|
|
3243
|
+
return oc(this), za(this, t2, n2, e2), this.j;
|
|
3244
|
+
}
|
|
3245
|
+
m() {
|
|
3246
|
+
var t2 = new qi();
|
|
3247
|
+
Yi(t2, "image_in"), Yi(t2, "norm_rect"), $i(t2, "face_landmarks");
|
|
3248
|
+
const e2 = new Di();
|
|
3249
|
+
Xn(e2, Bs, this.h);
|
|
3250
|
+
const n2 = new Xi();
|
|
3251
|
+
Gi(n2, "mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"), ji(n2, "IMAGE:image_in"), ji(n2, "NORM_RECT:norm_rect"), Vi(n2, "NORM_LANDMARKS:face_landmarks"), n2.o(e2), Ki(t2, n2), this.g.attachProtoVectorListener("face_landmarks", (t3, e3) => {
|
|
3252
|
+
for (const e4 of t3) t3 = us(e4), this.j.faceLandmarks.push(ko(t3));
|
|
3253
|
+
Wo(this, e3);
|
|
3254
|
+
}), this.g.attachEmptyPacketListener("face_landmarks", (t3) => {
|
|
3255
|
+
Wo(this, t3);
|
|
3256
|
+
}), this.outputFaceBlendshapes && ($i(t2, "blendshapes"), Vi(n2, "BLENDSHAPES:blendshapes"), this.g.attachProtoVectorListener("blendshapes", (t3, e3) => {
|
|
3257
|
+
if (this.outputFaceBlendshapes) for (const e4 of t3) t3 = ns(e4), this.j.faceBlendshapes.push(Ao(t3.g() ?? []));
|
|
3258
|
+
Wo(this, e3);
|
|
3259
|
+
}), this.g.attachEmptyPacketListener("blendshapes", (t3) => {
|
|
3260
|
+
Wo(this, t3);
|
|
3261
|
+
})), this.outputFacialTransformationMatrixes && ($i(t2, "face_geometry"), Vi(n2, "FACE_GEOMETRY:face_geometry"), this.g.attachProtoVectorListener("face_geometry", (t3, e3) => {
|
|
3262
|
+
if (this.outputFacialTransformationMatrixes) for (const e4 of t3) (t3 = en(Os(e4), ls, 2)) && this.j.facialTransformationMatrixes.push({ rows: un(t3, 1) ?? 0 ?? 0, columns: un(t3, 2) ?? 0 ?? 0, data: Ve(t3, 3, $t, je()).slice() ?? [] });
|
|
3263
|
+
Wo(this, e3);
|
|
3264
|
+
}), this.g.attachEmptyPacketListener("face_geometry", (t3) => {
|
|
3265
|
+
Wo(this, t3);
|
|
3266
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3267
|
+
}
|
|
3268
|
+
};
|
|
3269
|
+
ac.prototype.detectForVideo = ac.prototype.F, ac.prototype.detect = ac.prototype.D, ac.prototype.setOptions = ac.prototype.o, ac.createFromModelPath = function(t2, e2) {
|
|
3270
|
+
return Xa(ac, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3271
|
+
}, ac.createFromModelBuffer = function(t2, e2) {
|
|
3272
|
+
return Xa(ac, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3273
|
+
}, ac.createFromOptions = function(t2, e2) {
|
|
3274
|
+
return Xa(ac, t2, e2);
|
|
3275
|
+
}, ac.FACE_LANDMARKS_LIPS = qa, ac.FACE_LANDMARKS_LEFT_EYE = Ja, ac.FACE_LANDMARKS_LEFT_EYEBROW = Za, ac.FACE_LANDMARKS_LEFT_IRIS = Qa, ac.FACE_LANDMARKS_RIGHT_EYE = tc, ac.FACE_LANDMARKS_RIGHT_EYEBROW = ec, ac.FACE_LANDMARKS_RIGHT_IRIS = nc, ac.FACE_LANDMARKS_FACE_OVAL = rc, ac.FACE_LANDMARKS_CONTOURS = ic, ac.FACE_LANDMARKS_TESSELATION = sc;
|
|
3276
|
+
var cc = class extends Ya {
|
|
3277
|
+
constructor(t2, e2) {
|
|
3278
|
+
super(new Va(t2, e2), "image_in", "norm_rect", true), sn(t2 = this.j = new Gs(), 0, 1, e2 = new Ls());
|
|
3279
|
+
}
|
|
3280
|
+
get baseOptions() {
|
|
3281
|
+
return en(this.j, Ls, 1);
|
|
3282
|
+
}
|
|
3283
|
+
set baseOptions(t2) {
|
|
3284
|
+
sn(this.j, 0, 1, t2);
|
|
3285
|
+
}
|
|
3286
|
+
o(t2) {
|
|
3287
|
+
return super.l(t2);
|
|
3288
|
+
}
|
|
3289
|
+
Oa(t2, e2, n2) {
|
|
3290
|
+
const r2 = "function" != typeof e2 ? e2 : {};
|
|
3291
|
+
if (this.h = "function" == typeof e2 ? e2 : n2, Wa(this, t2, r2 ?? {}), !this.h) return this.s;
|
|
3292
|
+
}
|
|
3293
|
+
m() {
|
|
3294
|
+
var t2 = new qi();
|
|
3295
|
+
Yi(t2, "image_in"), Yi(t2, "norm_rect"), $i(t2, "stylized_image");
|
|
3296
|
+
const e2 = new Di();
|
|
3297
|
+
Xn(e2, js, this.j);
|
|
3298
|
+
const n2 = new Xi();
|
|
3299
|
+
Gi(n2, "mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"), ji(n2, "IMAGE:image_in"), ji(n2, "NORM_RECT:norm_rect"), Vi(n2, "STYLIZED_IMAGE:stylized_image"), n2.o(e2), Ki(t2, n2), this.g.U("stylized_image", (t3, e3) => {
|
|
3300
|
+
var n3 = !this.h, r2 = t3.data, i2 = t3.width;
|
|
3301
|
+
const s2 = i2 * (t3 = t3.height);
|
|
3302
|
+
if (r2 instanceof Uint8Array) if (r2.length === 3 * s2) {
|
|
3303
|
+
const e4 = new Uint8ClampedArray(4 * s2);
|
|
3304
|
+
for (let t4 = 0; t4 < s2; ++t4) e4[4 * t4] = r2[3 * t4], e4[4 * t4 + 1] = r2[3 * t4 + 1], e4[4 * t4 + 2] = r2[3 * t4 + 2], e4[4 * t4 + 3] = 255;
|
|
3305
|
+
r2 = new ImageData(e4, i2, t3);
|
|
3306
|
+
} else {
|
|
3307
|
+
if (r2.length !== 4 * s2) throw Error("Unsupported channel count: " + r2.length / s2);
|
|
3308
|
+
r2 = new ImageData(new Uint8ClampedArray(r2.buffer, r2.byteOffset, r2.length), i2, t3);
|
|
3309
|
+
}
|
|
3310
|
+
else if (!(r2 instanceof WebGLTexture)) throw Error(`Unsupported format: ${r2.constructor.name}`);
|
|
3311
|
+
i2 = new Da([r2], false, false, this.g.i.canvas, this.O, i2, t3), this.s = n3 = n3 ? i2.clone() : i2, this.h && this.h(n3), Wo(this, e3);
|
|
3312
|
+
}), this.g.attachEmptyPacketListener("stylized_image", (t3) => {
|
|
3313
|
+
this.s = null, this.h && this.h(null), Wo(this, t3);
|
|
3314
|
+
}), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3315
|
+
}
|
|
3316
|
+
};
|
|
3317
|
+
cc.prototype.stylize = cc.prototype.Oa, cc.prototype.setOptions = cc.prototype.o, cc.createFromModelPath = function(t2, e2) {
|
|
3318
|
+
return Xa(cc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3319
|
+
}, cc.createFromModelBuffer = function(t2, e2) {
|
|
3320
|
+
return Xa(cc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3321
|
+
}, cc.createFromOptions = function(t2, e2) {
|
|
3322
|
+
return Xa(cc, t2, e2);
|
|
3323
|
+
};
|
|
3324
|
+
var hc = Ba([0, 1], [1, 2], [2, 3], [3, 4], [0, 5], [5, 6], [6, 7], [7, 8], [5, 9], [9, 10], [10, 11], [11, 12], [9, 13], [13, 14], [14, 15], [15, 16], [13, 17], [0, 17], [17, 18], [18, 19], [19, 20]);
|
|
3325
|
+
function uc(t2) {
|
|
3326
|
+
t2.gestures = [], t2.landmarks = [], t2.worldLandmarks = [], t2.handedness = [];
|
|
3327
|
+
}
|
|
3328
|
+
function lc(t2) {
|
|
3329
|
+
return 0 === t2.gestures.length ? { gestures: [], landmarks: [], worldLandmarks: [], handedness: [], handednesses: [] } : { gestures: t2.gestures, landmarks: t2.landmarks, worldLandmarks: t2.worldLandmarks, handedness: t2.handedness, handednesses: t2.handedness };
|
|
3330
|
+
}
|
|
3331
|
+
function dc(t2, e2 = true) {
|
|
3332
|
+
const n2 = [];
|
|
3333
|
+
for (const i2 of t2) {
|
|
3334
|
+
var r2 = ns(i2);
|
|
3335
|
+
t2 = [];
|
|
3336
|
+
for (const n3 of r2.g()) r2 = e2 && null != un(n3, 1) ? un(n3, 1) ?? 0 : -1, t2.push({ score: dn(n3, 2) ?? 0, index: r2, categoryName: ln(n3, 3) ?? "" ?? "", displayName: ln(n3, 4) ?? "" ?? "" });
|
|
3337
|
+
n2.push(t2);
|
|
3338
|
+
}
|
|
3339
|
+
return n2;
|
|
3340
|
+
}
|
|
3341
|
+
var fc = class extends Ya {
|
|
3342
|
+
constructor(t2, e2) {
|
|
3343
|
+
super(new Va(t2, e2), "image_in", "norm_rect", false), this.gestures = [], this.landmarks = [], this.worldLandmarks = [], this.handedness = [], sn(t2 = this.j = new Ys(), 0, 1, e2 = new Ls()), this.s = new Ks(), sn(this.j, 0, 2, this.s), this.C = new zs(), sn(this.s, 0, 3, this.C), this.v = new Ws(), sn(this.s, 0, 2, this.v), this.h = new Hs(), sn(this.j, 0, 3, this.h), gn(this.v, 2, 0.5), gn(this.s, 4, 0.5), gn(this.C, 2, 0.5);
|
|
3344
|
+
}
|
|
3345
|
+
get baseOptions() {
|
|
3346
|
+
return en(this.j, Ls, 1);
|
|
3347
|
+
}
|
|
3348
|
+
set baseOptions(t2) {
|
|
3349
|
+
sn(this.j, 0, 1, t2);
|
|
3350
|
+
}
|
|
3351
|
+
o(t2) {
|
|
3352
|
+
if (pn(this.v, 3, t2.numHands ?? 1), "minHandDetectionConfidence" in t2 && gn(this.v, 2, t2.minHandDetectionConfidence ?? 0.5), "minTrackingConfidence" in t2 && gn(this.s, 4, t2.minTrackingConfidence ?? 0.5), "minHandPresenceConfidence" in t2 && gn(this.C, 2, t2.minHandPresenceConfidence ?? 0.5), t2.cannedGesturesClassifierOptions) {
|
|
3353
|
+
var e2 = new Vs(), n2 = e2, r2 = To(t2.cannedGesturesClassifierOptions, en(this.h, Vs, 3)?.h());
|
|
3354
|
+
sn(n2, 0, 2, r2), sn(this.h, 0, 3, e2);
|
|
3355
|
+
} else void 0 === t2.cannedGesturesClassifierOptions && en(this.h, Vs, 3)?.g();
|
|
3356
|
+
return t2.customGesturesClassifierOptions ? (sn(n2 = e2 = new Vs(), 0, 2, r2 = To(t2.customGesturesClassifierOptions, en(this.h, Vs, 4)?.h())), sn(this.h, 0, 4, e2)) : void 0 === t2.customGesturesClassifierOptions && en(this.h, Vs, 4)?.g(), this.l(t2);
|
|
3357
|
+
}
|
|
3358
|
+
Ja(t2, e2) {
|
|
3359
|
+
return uc(this), Wa(this, t2, e2), lc(this);
|
|
3360
|
+
}
|
|
3361
|
+
Ka(t2, e2, n2) {
|
|
3362
|
+
return uc(this), za(this, t2, n2, e2), lc(this);
|
|
3363
|
+
}
|
|
3364
|
+
m() {
|
|
3365
|
+
var t2 = new qi();
|
|
3366
|
+
Yi(t2, "image_in"), Yi(t2, "norm_rect"), $i(t2, "hand_gestures"), $i(t2, "hand_landmarks"), $i(t2, "world_hand_landmarks"), $i(t2, "handedness");
|
|
3367
|
+
const e2 = new Di();
|
|
3368
|
+
Xn(e2, Qs, this.j);
|
|
3369
|
+
const n2 = new Xi();
|
|
3370
|
+
Gi(n2, "mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"), ji(n2, "IMAGE:image_in"), ji(n2, "NORM_RECT:norm_rect"), Vi(n2, "HAND_GESTURES:hand_gestures"), Vi(n2, "LANDMARKS:hand_landmarks"), Vi(n2, "WORLD_LANDMARKS:world_hand_landmarks"), Vi(n2, "HANDEDNESS:handedness"), n2.o(e2), Ki(t2, n2), this.g.attachProtoVectorListener("hand_landmarks", (t3, e3) => {
|
|
3371
|
+
for (const e4 of t3) {
|
|
3372
|
+
t3 = us(e4);
|
|
3373
|
+
const n3 = [];
|
|
3374
|
+
for (const e5 of rn(t3, hs, 1)) n3.push({ x: dn(e5, 1) ?? 0, y: dn(e5, 2) ?? 0, z: dn(e5, 3) ?? 0, visibility: dn(e5, 4) ?? 0 });
|
|
3375
|
+
this.landmarks.push(n3);
|
|
3376
|
+
}
|
|
3377
|
+
Wo(this, e3);
|
|
3378
|
+
}), this.g.attachEmptyPacketListener("hand_landmarks", (t3) => {
|
|
3379
|
+
Wo(this, t3);
|
|
3380
|
+
}), this.g.attachProtoVectorListener("world_hand_landmarks", (t3, e3) => {
|
|
3381
|
+
for (const e4 of t3) {
|
|
3382
|
+
t3 = cs(e4);
|
|
3383
|
+
const n3 = [];
|
|
3384
|
+
for (const e5 of rn(t3, as, 1)) n3.push({ x: dn(e5, 1) ?? 0, y: dn(e5, 2) ?? 0, z: dn(e5, 3) ?? 0, visibility: dn(e5, 4) ?? 0 });
|
|
3385
|
+
this.worldLandmarks.push(n3);
|
|
3386
|
+
}
|
|
3387
|
+
Wo(this, e3);
|
|
3388
|
+
}), this.g.attachEmptyPacketListener("world_hand_landmarks", (t3) => {
|
|
3389
|
+
Wo(this, t3);
|
|
3390
|
+
}), this.g.attachProtoVectorListener("hand_gestures", (t3, e3) => {
|
|
3391
|
+
this.gestures.push(...dc(t3, false)), Wo(this, e3);
|
|
3392
|
+
}), this.g.attachEmptyPacketListener("hand_gestures", (t3) => {
|
|
3393
|
+
Wo(this, t3);
|
|
3394
|
+
}), this.g.attachProtoVectorListener("handedness", (t3, e3) => {
|
|
3395
|
+
this.handedness.push(...dc(t3)), Wo(this, e3);
|
|
3396
|
+
}), this.g.attachEmptyPacketListener("handedness", (t3) => {
|
|
3397
|
+
Wo(this, t3);
|
|
3398
|
+
}), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3399
|
+
}
|
|
3400
|
+
};
|
|
3401
|
+
function pc(t2) {
|
|
3402
|
+
return { landmarks: t2.landmarks, worldLandmarks: t2.worldLandmarks, handednesses: t2.handedness, handedness: t2.handedness };
|
|
3403
|
+
}
|
|
3404
|
+
fc.prototype.recognizeForVideo = fc.prototype.Ka, fc.prototype.recognize = fc.prototype.Ja, fc.prototype.setOptions = fc.prototype.o, fc.createFromModelPath = function(t2, e2) {
|
|
3405
|
+
return Xa(fc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3406
|
+
}, fc.createFromModelBuffer = function(t2, e2) {
|
|
3407
|
+
return Xa(fc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3408
|
+
}, fc.createFromOptions = function(t2, e2) {
|
|
3409
|
+
return Xa(fc, t2, e2);
|
|
3410
|
+
}, fc.HAND_CONNECTIONS = hc;
|
|
3411
|
+
var gc = class extends Ya {
|
|
3412
|
+
constructor(t2, e2) {
|
|
3413
|
+
super(new Va(t2, e2), "image_in", "norm_rect", false), this.landmarks = [], this.worldLandmarks = [], this.handedness = [], sn(t2 = this.h = new Ks(), 0, 1, e2 = new Ls()), this.s = new zs(), sn(this.h, 0, 3, this.s), this.j = new Ws(), sn(this.h, 0, 2, this.j), pn(this.j, 3, 1), gn(this.j, 2, 0.5), gn(this.s, 2, 0.5), gn(this.h, 4, 0.5);
|
|
3414
|
+
}
|
|
3415
|
+
get baseOptions() {
|
|
3416
|
+
return en(this.h, Ls, 1);
|
|
3417
|
+
}
|
|
3418
|
+
set baseOptions(t2) {
|
|
3419
|
+
sn(this.h, 0, 1, t2);
|
|
3420
|
+
}
|
|
3421
|
+
o(t2) {
|
|
3422
|
+
return "numHands" in t2 && pn(this.j, 3, t2.numHands ?? 1), "minHandDetectionConfidence" in t2 && gn(this.j, 2, t2.minHandDetectionConfidence ?? 0.5), "minTrackingConfidence" in t2 && gn(this.h, 4, t2.minTrackingConfidence ?? 0.5), "minHandPresenceConfidence" in t2 && gn(this.s, 2, t2.minHandPresenceConfidence ?? 0.5), this.l(t2);
|
|
3423
|
+
}
|
|
3424
|
+
D(t2, e2) {
|
|
3425
|
+
return this.landmarks = [], this.worldLandmarks = [], this.handedness = [], Wa(this, t2, e2), pc(this);
|
|
3426
|
+
}
|
|
3427
|
+
F(t2, e2, n2) {
|
|
3428
|
+
return this.landmarks = [], this.worldLandmarks = [], this.handedness = [], za(this, t2, n2, e2), pc(this);
|
|
3429
|
+
}
|
|
3430
|
+
m() {
|
|
3431
|
+
var t2 = new qi();
|
|
3432
|
+
Yi(t2, "image_in"), Yi(t2, "norm_rect"), $i(t2, "hand_landmarks"), $i(t2, "world_hand_landmarks"), $i(t2, "handedness");
|
|
3433
|
+
const e2 = new Di();
|
|
3434
|
+
Xn(e2, to, this.h);
|
|
3435
|
+
const n2 = new Xi();
|
|
3436
|
+
Gi(n2, "mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"), ji(n2, "IMAGE:image_in"), ji(n2, "NORM_RECT:norm_rect"), Vi(n2, "LANDMARKS:hand_landmarks"), Vi(n2, "WORLD_LANDMARKS:world_hand_landmarks"), Vi(n2, "HANDEDNESS:handedness"), n2.o(e2), Ki(t2, n2), this.g.attachProtoVectorListener("hand_landmarks", (t3, e3) => {
|
|
3437
|
+
for (const e4 of t3) t3 = us(e4), this.landmarks.push(ko(t3));
|
|
3438
|
+
Wo(this, e3);
|
|
3439
|
+
}), this.g.attachEmptyPacketListener("hand_landmarks", (t3) => {
|
|
3440
|
+
Wo(this, t3);
|
|
3441
|
+
}), this.g.attachProtoVectorListener("world_hand_landmarks", (t3, e3) => {
|
|
3442
|
+
for (const e4 of t3) t3 = cs(e4), this.worldLandmarks.push(So(t3));
|
|
3443
|
+
Wo(this, e3);
|
|
3444
|
+
}), this.g.attachEmptyPacketListener("world_hand_landmarks", (t3) => {
|
|
3445
|
+
Wo(this, t3);
|
|
3446
|
+
}), this.g.attachProtoVectorListener("handedness", (t3, e3) => {
|
|
3447
|
+
var n3 = this.handedness, r2 = n3.push;
|
|
3448
|
+
const i2 = [];
|
|
3449
|
+
for (const e4 of t3) {
|
|
3450
|
+
t3 = ns(e4);
|
|
3451
|
+
const n4 = [];
|
|
3452
|
+
for (const e5 of t3.g()) n4.push({ score: dn(e5, 2) ?? 0, index: un(e5, 1) ?? 0 ?? -1, categoryName: ln(e5, 3) ?? "" ?? "", displayName: ln(e5, 4) ?? "" ?? "" });
|
|
3453
|
+
i2.push(n4);
|
|
3454
|
+
}
|
|
3455
|
+
r2.call(n3, ...i2), Wo(this, e3);
|
|
3456
|
+
}), this.g.attachEmptyPacketListener("handedness", (t3) => {
|
|
3457
|
+
Wo(this, t3);
|
|
3458
|
+
}), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3459
|
+
}
|
|
3460
|
+
};
|
|
3461
|
+
gc.prototype.detectForVideo = gc.prototype.F, gc.prototype.detect = gc.prototype.D, gc.prototype.setOptions = gc.prototype.o, gc.createFromModelPath = function(t2, e2) {
|
|
3462
|
+
return Xa(gc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3463
|
+
}, gc.createFromModelBuffer = function(t2, e2) {
|
|
3464
|
+
return Xa(gc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3465
|
+
}, gc.createFromOptions = function(t2, e2) {
|
|
3466
|
+
return Xa(gc, t2, e2);
|
|
3467
|
+
}, gc.HAND_CONNECTIONS = hc;
|
|
3468
|
+
var mc = Ba([0, 1], [1, 2], [2, 3], [3, 7], [0, 4], [4, 5], [5, 6], [6, 8], [9, 10], [11, 12], [11, 13], [13, 15], [15, 17], [15, 19], [15, 21], [17, 19], [12, 14], [14, 16], [16, 18], [16, 20], [16, 22], [18, 20], [11, 23], [12, 24], [23, 24], [23, 25], [24, 26], [25, 27], [26, 28], [27, 29], [28, 30], [29, 31], [30, 32], [27, 31], [28, 32]);
|
|
3469
|
+
function yc(t2) {
|
|
3470
|
+
t2.h = { faceLandmarks: [], faceBlendshapes: [], poseLandmarks: [], poseWorldLandmarks: [], poseSegmentationMasks: [], leftHandLandmarks: [], leftHandWorldLandmarks: [], rightHandLandmarks: [], rightHandWorldLandmarks: [] };
|
|
3471
|
+
}
|
|
3472
|
+
function _c(t2) {
|
|
3473
|
+
try {
|
|
3474
|
+
if (!t2.C) return t2.h;
|
|
3475
|
+
t2.C(t2.h);
|
|
3476
|
+
} finally {
|
|
3477
|
+
Yo(t2);
|
|
3478
|
+
}
|
|
3479
|
+
}
|
|
3480
|
+
function vc(t2, e2) {
|
|
3481
|
+
t2 = us(t2), e2.push(ko(t2));
|
|
3482
|
+
}
|
|
3483
|
+
var Ec = class extends Ya {
|
|
3484
|
+
constructor(t2, e2) {
|
|
3485
|
+
super(new Va(t2, e2), "input_frames_image", null, false), this.h = { faceLandmarks: [], faceBlendshapes: [], poseLandmarks: [], poseWorldLandmarks: [], poseSegmentationMasks: [], leftHandLandmarks: [], leftHandWorldLandmarks: [], rightHandLandmarks: [], rightHandWorldLandmarks: [] }, this.outputPoseSegmentationMasks = this.outputFaceBlendshapes = false, sn(t2 = this.j = new io(), 0, 1, e2 = new Ls()), this.J = new zs(), sn(this.j, 0, 2, this.J), this.Z = new eo(), sn(this.j, 0, 3, this.Z), this.s = new Is(), sn(this.j, 0, 4, this.s), this.H = new Cs(), sn(this.j, 0, 5, this.H), this.v = new no(), sn(this.j, 0, 6, this.v), this.K = new ro(), sn(this.j, 0, 7, this.K), gn(this.s, 2, 0.5), gn(this.s, 3, 0.3), gn(this.H, 2, 0.5), gn(this.v, 2, 0.5), gn(this.v, 3, 0.3), gn(this.K, 2, 0.5), gn(this.J, 2, 0.5);
|
|
3486
|
+
}
|
|
3487
|
+
get baseOptions() {
|
|
3488
|
+
return en(this.j, Ls, 1);
|
|
3489
|
+
}
|
|
3490
|
+
set baseOptions(t2) {
|
|
3491
|
+
sn(this.j, 0, 1, t2);
|
|
3492
|
+
}
|
|
3493
|
+
o(t2) {
|
|
3494
|
+
return "minFaceDetectionConfidence" in t2 && gn(this.s, 2, t2.minFaceDetectionConfidence ?? 0.5), "minFaceSuppressionThreshold" in t2 && gn(this.s, 3, t2.minFaceSuppressionThreshold ?? 0.3), "minFacePresenceConfidence" in t2 && gn(this.H, 2, t2.minFacePresenceConfidence ?? 0.5), "outputFaceBlendshapes" in t2 && (this.outputFaceBlendshapes = !!t2.outputFaceBlendshapes), "minPoseDetectionConfidence" in t2 && gn(this.v, 2, t2.minPoseDetectionConfidence ?? 0.5), "minPoseSuppressionThreshold" in t2 && gn(this.v, 3, t2.minPoseSuppressionThreshold ?? 0.3), "minPosePresenceConfidence" in t2 && gn(this.K, 2, t2.minPosePresenceConfidence ?? 0.5), "outputPoseSegmentationMasks" in t2 && (this.outputPoseSegmentationMasks = !!t2.outputPoseSegmentationMasks), "minHandLandmarksConfidence" in t2 && gn(this.J, 2, t2.minHandLandmarksConfidence ?? 0.5), this.l(t2);
|
|
3495
|
+
}
|
|
3496
|
+
D(t2, e2, n2) {
|
|
3497
|
+
const r2 = "function" != typeof e2 ? e2 : {};
|
|
3498
|
+
return this.C = "function" == typeof e2 ? e2 : n2, yc(this), Wa(this, t2, r2), _c(this);
|
|
3499
|
+
}
|
|
3500
|
+
F(t2, e2, n2, r2) {
|
|
3501
|
+
const i2 = "function" != typeof n2 ? n2 : {};
|
|
3502
|
+
return this.C = "function" == typeof n2 ? n2 : r2, yc(this), za(this, t2, i2, e2), _c(this);
|
|
3503
|
+
}
|
|
3504
|
+
m() {
|
|
3505
|
+
var t2 = new qi();
|
|
3506
|
+
Yi(t2, "input_frames_image"), $i(t2, "pose_landmarks"), $i(t2, "pose_world_landmarks"), $i(t2, "face_landmarks"), $i(t2, "left_hand_landmarks"), $i(t2, "left_hand_world_landmarks"), $i(t2, "right_hand_landmarks"), $i(t2, "right_hand_world_landmarks");
|
|
3507
|
+
const e2 = new Di(), n2 = new bi();
|
|
3508
|
+
Ke(n2, 1, ae("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"), ""), function(t3, e3) {
|
|
3509
|
+
if (null != e3) if (Array.isArray(e3)) De(t3, 2, Re(e3));
|
|
3510
|
+
else {
|
|
3511
|
+
if (!("string" == typeof e3 || e3 instanceof N || O(e3))) throw Error("invalid value in Any.value field: " + e3 + " expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");
|
|
3512
|
+
Ke(t3, 2, ft(e3, false), U());
|
|
3513
|
+
}
|
|
3514
|
+
}(n2, this.j.g());
|
|
3515
|
+
const r2 = new Xi();
|
|
3516
|
+
Gi(r2, "mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"), hn(r2, 8, bi, n2), ji(r2, "IMAGE:input_frames_image"), Vi(r2, "POSE_LANDMARKS:pose_landmarks"), Vi(r2, "POSE_WORLD_LANDMARKS:pose_world_landmarks"), Vi(r2, "FACE_LANDMARKS:face_landmarks"), Vi(r2, "LEFT_HAND_LANDMARKS:left_hand_landmarks"), Vi(r2, "LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"), Vi(r2, "RIGHT_HAND_LANDMARKS:right_hand_landmarks"), Vi(r2, "RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"), r2.o(e2), Ki(t2, r2), zo(this, t2), this.g.attachProtoListener("pose_landmarks", (t3, e3) => {
|
|
3517
|
+
vc(t3, this.h.poseLandmarks), Wo(this, e3);
|
|
3518
|
+
}), this.g.attachEmptyPacketListener("pose_landmarks", (t3) => {
|
|
3519
|
+
Wo(this, t3);
|
|
3520
|
+
}), this.g.attachProtoListener("pose_world_landmarks", (t3, e3) => {
|
|
3521
|
+
var n3 = this.h.poseWorldLandmarks;
|
|
3522
|
+
t3 = cs(t3), n3.push(So(t3)), Wo(this, e3);
|
|
3523
|
+
}), this.g.attachEmptyPacketListener("pose_world_landmarks", (t3) => {
|
|
3524
|
+
Wo(this, t3);
|
|
3525
|
+
}), this.outputPoseSegmentationMasks && (Vi(r2, "POSE_SEGMENTATION_MASK:pose_segmentation_mask"), Ko(this, "pose_segmentation_mask"), this.g.U("pose_segmentation_mask", (t3, e3) => {
|
|
3526
|
+
this.h.poseSegmentationMasks = [Ka(this, t3, true, !this.C)], Wo(this, e3);
|
|
3527
|
+
}), this.g.attachEmptyPacketListener("pose_segmentation_mask", (t3) => {
|
|
3528
|
+
this.h.poseSegmentationMasks = [], Wo(this, t3);
|
|
3529
|
+
})), this.g.attachProtoListener("face_landmarks", (t3, e3) => {
|
|
3530
|
+
vc(t3, this.h.faceLandmarks), Wo(this, e3);
|
|
3531
|
+
}), this.g.attachEmptyPacketListener("face_landmarks", (t3) => {
|
|
3532
|
+
Wo(this, t3);
|
|
3533
|
+
}), this.outputFaceBlendshapes && ($i(t2, "extra_blendshapes"), Vi(r2, "FACE_BLENDSHAPES:extra_blendshapes"), this.g.attachProtoListener("extra_blendshapes", (t3, e3) => {
|
|
3534
|
+
var n3 = this.h.faceBlendshapes;
|
|
3535
|
+
this.outputFaceBlendshapes && (t3 = ns(t3), n3.push(Ao(t3.g() ?? []))), Wo(this, e3);
|
|
3536
|
+
}), this.g.attachEmptyPacketListener("extra_blendshapes", (t3) => {
|
|
3537
|
+
Wo(this, t3);
|
|
3538
|
+
})), this.g.attachProtoListener("left_hand_landmarks", (t3, e3) => {
|
|
3539
|
+
vc(t3, this.h.leftHandLandmarks), Wo(this, e3);
|
|
3540
|
+
}), this.g.attachEmptyPacketListener("left_hand_landmarks", (t3) => {
|
|
3541
|
+
Wo(this, t3);
|
|
3542
|
+
}), this.g.attachProtoListener("left_hand_world_landmarks", (t3, e3) => {
|
|
3543
|
+
var n3 = this.h.leftHandWorldLandmarks;
|
|
3544
|
+
t3 = cs(t3), n3.push(So(t3)), Wo(this, e3);
|
|
3545
|
+
}), this.g.attachEmptyPacketListener("left_hand_world_landmarks", (t3) => {
|
|
3546
|
+
Wo(this, t3);
|
|
3547
|
+
}), this.g.attachProtoListener("right_hand_landmarks", (t3, e3) => {
|
|
3548
|
+
vc(t3, this.h.rightHandLandmarks), Wo(this, e3);
|
|
3549
|
+
}), this.g.attachEmptyPacketListener("right_hand_landmarks", (t3) => {
|
|
3550
|
+
Wo(this, t3);
|
|
3551
|
+
}), this.g.attachProtoListener("right_hand_world_landmarks", (t3, e3) => {
|
|
3552
|
+
var n3 = this.h.rightHandWorldLandmarks;
|
|
3553
|
+
t3 = cs(t3), n3.push(So(t3)), Wo(this, e3);
|
|
3554
|
+
}), this.g.attachEmptyPacketListener("right_hand_world_landmarks", (t3) => {
|
|
3555
|
+
Wo(this, t3);
|
|
3556
|
+
}), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3557
|
+
}
|
|
3558
|
+
};
|
|
3559
|
+
Ec.prototype.detectForVideo = Ec.prototype.F, Ec.prototype.detect = Ec.prototype.D, Ec.prototype.setOptions = Ec.prototype.o, Ec.createFromModelPath = function(t2, e2) {
|
|
3560
|
+
return Xa(Ec, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3561
|
+
}, Ec.createFromModelBuffer = function(t2, e2) {
|
|
3562
|
+
return Xa(Ec, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3563
|
+
}, Ec.createFromOptions = function(t2, e2) {
|
|
3564
|
+
return Xa(Ec, t2, e2);
|
|
3565
|
+
}, Ec.HAND_CONNECTIONS = hc, Ec.POSE_CONNECTIONS = mc, Ec.FACE_LANDMARKS_LIPS = qa, Ec.FACE_LANDMARKS_LEFT_EYE = Ja, Ec.FACE_LANDMARKS_LEFT_EYEBROW = Za, Ec.FACE_LANDMARKS_LEFT_IRIS = Qa, Ec.FACE_LANDMARKS_RIGHT_EYE = tc, Ec.FACE_LANDMARKS_RIGHT_EYEBROW = ec, Ec.FACE_LANDMARKS_RIGHT_IRIS = nc, Ec.FACE_LANDMARKS_FACE_OVAL = rc, Ec.FACE_LANDMARKS_CONTOURS = ic, Ec.FACE_LANDMARKS_TESSELATION = sc;
|
|
3566
|
+
var wc = class extends Ya {
|
|
3567
|
+
constructor(t2, e2) {
|
|
3568
|
+
super(new Va(t2, e2), "input_image", "norm_rect", true), this.j = { classifications: [] }, sn(t2 = this.h = new ao(), 0, 1, e2 = new Ls());
|
|
3569
|
+
}
|
|
3570
|
+
get baseOptions() {
|
|
3571
|
+
return en(this.h, Ls, 1);
|
|
3572
|
+
}
|
|
3573
|
+
set baseOptions(t2) {
|
|
3574
|
+
sn(this.h, 0, 1, t2);
|
|
3575
|
+
}
|
|
3576
|
+
o(t2) {
|
|
3577
|
+
return sn(this.h, 0, 2, To(t2, en(this.h, ws, 2))), this.l(t2);
|
|
3578
|
+
}
|
|
3579
|
+
sa(t2, e2) {
|
|
3580
|
+
return this.j = { classifications: [] }, Wa(this, t2, e2), this.j;
|
|
3581
|
+
}
|
|
3582
|
+
ta(t2, e2, n2) {
|
|
3583
|
+
return this.j = { classifications: [] }, za(this, t2, n2, e2), this.j;
|
|
3584
|
+
}
|
|
3585
|
+
m() {
|
|
3586
|
+
var t2 = new qi();
|
|
3587
|
+
Yi(t2, "input_image"), Yi(t2, "norm_rect"), $i(t2, "classifications");
|
|
3588
|
+
const e2 = new Di();
|
|
3589
|
+
Xn(e2, co, this.h);
|
|
3590
|
+
const n2 = new Xi();
|
|
3591
|
+
Gi(n2, "mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"), ji(n2, "IMAGE:input_image"), ji(n2, "NORM_RECT:norm_rect"), Vi(n2, "CLASSIFICATIONS:classifications"), n2.o(e2), Ki(t2, n2), this.g.attachProtoListener("classifications", (t3, e3) => {
|
|
3592
|
+
this.j = function(t4) {
|
|
3593
|
+
const e4 = { classifications: rn(t4, ps, 1).map((t5) => Ao(en(t5, ts, 4)?.g() ?? [], un(t5, 2) ?? 0, ln(t5, 3) ?? "")) };
|
|
3594
|
+
return null != ie(Ce(t4, 2)) && (e4.timestampMs = ie(Ce(t4, 2)) ?? 0), e4;
|
|
3595
|
+
}(gs(t3)), Wo(this, e3);
|
|
3596
|
+
}), this.g.attachEmptyPacketListener("classifications", (t3) => {
|
|
3597
|
+
Wo(this, t3);
|
|
3598
|
+
}), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3599
|
+
}
|
|
3600
|
+
};
|
|
3601
|
+
wc.prototype.classifyForVideo = wc.prototype.ta, wc.prototype.classify = wc.prototype.sa, wc.prototype.setOptions = wc.prototype.o, wc.createFromModelPath = function(t2, e2) {
|
|
3602
|
+
return Xa(wc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3603
|
+
}, wc.createFromModelBuffer = function(t2, e2) {
|
|
3604
|
+
return Xa(wc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3605
|
+
}, wc.createFromOptions = function(t2, e2) {
|
|
3606
|
+
return Xa(wc, t2, e2);
|
|
3607
|
+
};
|
|
3608
|
+
var Tc = class extends Ya {
|
|
3609
|
+
constructor(t2, e2) {
|
|
3610
|
+
super(new Va(t2, e2), "image_in", "norm_rect", true), this.h = new ho(), this.embeddings = { embeddings: [] }, sn(t2 = this.h, 0, 1, e2 = new Ls());
|
|
3611
|
+
}
|
|
3612
|
+
get baseOptions() {
|
|
3613
|
+
return en(this.h, Ls, 1);
|
|
3614
|
+
}
|
|
3615
|
+
set baseOptions(t2) {
|
|
3616
|
+
sn(this.h, 0, 1, t2);
|
|
3617
|
+
}
|
|
3618
|
+
o(t2) {
|
|
3619
|
+
var e2 = this.h, n2 = en(this.h, As, 2);
|
|
3620
|
+
return n2 = n2 ? n2.clone() : new As(), void 0 !== t2.l2Normalize ? fn(n2, 1, t2.l2Normalize) : "l2Normalize" in t2 && De(n2, 1), void 0 !== t2.quantize ? fn(n2, 2, t2.quantize) : "quantize" in t2 && De(n2, 2), sn(e2, 0, 2, n2), this.l(t2);
|
|
3621
|
+
}
|
|
3622
|
+
za(t2, e2) {
|
|
3623
|
+
return Wa(this, t2, e2), this.embeddings;
|
|
3624
|
+
}
|
|
3625
|
+
Aa(t2, e2, n2) {
|
|
3626
|
+
return za(this, t2, n2, e2), this.embeddings;
|
|
3627
|
+
}
|
|
3628
|
+
m() {
|
|
3629
|
+
var t2 = new qi();
|
|
3630
|
+
Yi(t2, "image_in"), Yi(t2, "norm_rect"), $i(t2, "embeddings_out");
|
|
3631
|
+
const e2 = new Di();
|
|
3632
|
+
Xn(e2, uo, this.h);
|
|
3633
|
+
const n2 = new Xi();
|
|
3634
|
+
Gi(n2, "mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"), ji(n2, "IMAGE:image_in"), ji(n2, "NORM_RECT:norm_rect"), Vi(n2, "EMBEDDINGS:embeddings_out"), n2.o(e2), Ki(t2, n2), this.g.attachProtoListener("embeddings_out", (t3, e3) => {
|
|
3635
|
+
t3 = Es(t3), this.embeddings = function(t4) {
|
|
3636
|
+
return { embeddings: rn(t4, _s, 1).map((t5) => {
|
|
3637
|
+
const e4 = { headIndex: un(t5, 3) ?? 0 ?? -1, headName: ln(t5, 4) ?? "" ?? "" };
|
|
3638
|
+
if (void 0 !== tn(t5, ms, $e(t5, 1))) t5 = Ve(t5 = en(t5, ms, $e(t5, 1)), 1, $t, je()), e4.floatEmbedding = t5.slice();
|
|
3639
|
+
else {
|
|
3640
|
+
const n3 = new Uint8Array(0);
|
|
3641
|
+
e4.quantizedEmbedding = en(t5, ys, $e(t5, 2))?.oa()?.h() ?? n3;
|
|
3642
|
+
}
|
|
3643
|
+
return e4;
|
|
3644
|
+
}), timestampMs: ie(Ce(t4, 2)) ?? 0 };
|
|
3645
|
+
}(t3), Wo(this, e3);
|
|
3646
|
+
}), this.g.attachEmptyPacketListener("embeddings_out", (t3) => {
|
|
3647
|
+
Wo(this, t3);
|
|
3648
|
+
}), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3649
|
+
}
|
|
3650
|
+
};
|
|
3651
|
+
Tc.cosineSimilarity = function(t2, e2) {
|
|
3652
|
+
if (t2.floatEmbedding && e2.floatEmbedding) t2 = Lo(t2.floatEmbedding, e2.floatEmbedding);
|
|
3653
|
+
else {
|
|
3654
|
+
if (!t2.quantizedEmbedding || !e2.quantizedEmbedding) throw Error("Cannot compute cosine similarity between quantized and float embeddings.");
|
|
3655
|
+
t2 = Lo(xo(t2.quantizedEmbedding), xo(e2.quantizedEmbedding));
|
|
3656
|
+
}
|
|
3657
|
+
return t2;
|
|
3658
|
+
}, Tc.prototype.embedForVideo = Tc.prototype.Aa, Tc.prototype.embed = Tc.prototype.za, Tc.prototype.setOptions = Tc.prototype.o, Tc.createFromModelPath = function(t2, e2) {
|
|
3659
|
+
return Xa(Tc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3660
|
+
}, Tc.createFromModelBuffer = function(t2, e2) {
|
|
3661
|
+
return Xa(Tc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3662
|
+
}, Tc.createFromOptions = function(t2, e2) {
|
|
3663
|
+
return Xa(Tc, t2, e2);
|
|
3664
|
+
};
|
|
3665
|
+
var Ac = class {
|
|
3666
|
+
constructor(t2, e2, n2) {
|
|
3667
|
+
this.confidenceMasks = t2, this.categoryMask = e2, this.qualityScores = n2;
|
|
3668
|
+
}
|
|
3669
|
+
close() {
|
|
3670
|
+
this.confidenceMasks?.forEach((t2) => {
|
|
3671
|
+
t2.close();
|
|
3672
|
+
}), this.categoryMask?.close();
|
|
3673
|
+
}
|
|
3674
|
+
};
|
|
3675
|
+
function bc(t2) {
|
|
3676
|
+
t2.categoryMask = void 0, t2.confidenceMasks = void 0, t2.qualityScores = void 0;
|
|
3677
|
+
}
|
|
3678
|
+
function kc(t2) {
|
|
3679
|
+
try {
|
|
3680
|
+
const e2 = new Ac(t2.confidenceMasks, t2.categoryMask, t2.qualityScores);
|
|
3681
|
+
if (!t2.j) return e2;
|
|
3682
|
+
t2.j(e2);
|
|
3683
|
+
} finally {
|
|
3684
|
+
Yo(t2);
|
|
3685
|
+
}
|
|
3686
|
+
}
|
|
3687
|
+
Ac.prototype.close = Ac.prototype.close;
|
|
3688
|
+
var Sc = class extends Ya {
|
|
3689
|
+
constructor(t2, e2) {
|
|
3690
|
+
super(new Va(t2, e2), "image_in", "norm_rect", false), this.s = [], this.outputCategoryMask = false, this.outputConfidenceMasks = true, this.h = new mo(), this.v = new lo(), sn(this.h, 0, 3, this.v), sn(t2 = this.h, 0, 1, e2 = new Ls());
|
|
3691
|
+
}
|
|
3692
|
+
get baseOptions() {
|
|
3693
|
+
return en(this.h, Ls, 1);
|
|
3694
|
+
}
|
|
3695
|
+
set baseOptions(t2) {
|
|
3696
|
+
sn(this.h, 0, 1, t2);
|
|
3697
|
+
}
|
|
3698
|
+
o(t2) {
|
|
3699
|
+
return void 0 !== t2.displayNamesLocale ? De(this.h, 2, ae(t2.displayNamesLocale)) : "displayNamesLocale" in t2 && De(this.h, 2), "outputCategoryMask" in t2 && (this.outputCategoryMask = t2.outputCategoryMask ?? false), "outputConfidenceMasks" in t2 && (this.outputConfidenceMasks = t2.outputConfidenceMasks ?? true), super.l(t2);
|
|
3700
|
+
}
|
|
3701
|
+
I() {
|
|
3702
|
+
!function(t2) {
|
|
3703
|
+
const e2 = rn(t2.da(), Xi, 1).filter((t3) => (ln(t3, 1) ?? "").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));
|
|
3704
|
+
if (t2.s = [], e2.length > 1) throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");
|
|
3705
|
+
1 === e2.length && (en(e2[0], Di, 7)?.l()?.g() ?? /* @__PURE__ */ new Map()).forEach((e3, n2) => {
|
|
3706
|
+
t2.s[Number(n2)] = ln(e3, 1) ?? "";
|
|
3707
|
+
});
|
|
3708
|
+
}(this);
|
|
3709
|
+
}
|
|
3710
|
+
segment(t2, e2, n2) {
|
|
3711
|
+
const r2 = "function" != typeof e2 ? e2 : {};
|
|
3712
|
+
return this.j = "function" == typeof e2 ? e2 : n2, bc(this), Wa(this, t2, r2), kc(this);
|
|
3713
|
+
}
|
|
3714
|
+
Ma(t2, e2, n2, r2) {
|
|
3715
|
+
const i2 = "function" != typeof n2 ? n2 : {};
|
|
3716
|
+
return this.j = "function" == typeof n2 ? n2 : r2, bc(this), za(this, t2, i2, e2), kc(this);
|
|
3717
|
+
}
|
|
3718
|
+
Da() {
|
|
3719
|
+
return this.s;
|
|
3720
|
+
}
|
|
3721
|
+
m() {
|
|
3722
|
+
var t2 = new qi();
|
|
3723
|
+
Yi(t2, "image_in"), Yi(t2, "norm_rect");
|
|
3724
|
+
const e2 = new Di();
|
|
3725
|
+
Xn(e2, yo, this.h);
|
|
3726
|
+
const n2 = new Xi();
|
|
3727
|
+
Gi(n2, "mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"), ji(n2, "IMAGE:image_in"), ji(n2, "NORM_RECT:norm_rect"), n2.o(e2), Ki(t2, n2), zo(this, t2), this.outputConfidenceMasks && ($i(t2, "confidence_masks"), Vi(n2, "CONFIDENCE_MASKS:confidence_masks"), Ko(this, "confidence_masks"), this.g.ca("confidence_masks", (t3, e3) => {
|
|
3728
|
+
this.confidenceMasks = t3.map((t4) => Ka(this, t4, true, !this.j)), Wo(this, e3);
|
|
3729
|
+
}), this.g.attachEmptyPacketListener("confidence_masks", (t3) => {
|
|
3730
|
+
this.confidenceMasks = [], Wo(this, t3);
|
|
3731
|
+
})), this.outputCategoryMask && ($i(t2, "category_mask"), Vi(n2, "CATEGORY_MASK:category_mask"), Ko(this, "category_mask"), this.g.U("category_mask", (t3, e3) => {
|
|
3732
|
+
this.categoryMask = Ka(this, t3, false, !this.j), Wo(this, e3);
|
|
3733
|
+
}), this.g.attachEmptyPacketListener("category_mask", (t3) => {
|
|
3734
|
+
this.categoryMask = void 0, Wo(this, t3);
|
|
3735
|
+
})), $i(t2, "quality_scores"), Vi(n2, "QUALITY_SCORES:quality_scores"), this.g.attachFloatVectorListener("quality_scores", (t3, e3) => {
|
|
3736
|
+
this.qualityScores = t3, Wo(this, e3);
|
|
3737
|
+
}), this.g.attachEmptyPacketListener("quality_scores", (t3) => {
|
|
3738
|
+
this.categoryMask = void 0, Wo(this, t3);
|
|
3739
|
+
}), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3740
|
+
}
|
|
3741
|
+
};
|
|
3742
|
+
Sc.prototype.getLabels = Sc.prototype.Da, Sc.prototype.segmentForVideo = Sc.prototype.Ma, Sc.prototype.segment = Sc.prototype.segment, Sc.prototype.setOptions = Sc.prototype.o, Sc.createFromModelPath = function(t2, e2) {
|
|
3743
|
+
return Xa(Sc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3744
|
+
}, Sc.createFromModelBuffer = function(t2, e2) {
|
|
3745
|
+
return Xa(Sc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3746
|
+
}, Sc.createFromOptions = function(t2, e2) {
|
|
3747
|
+
return Xa(Sc, t2, e2);
|
|
3748
|
+
};
|
|
3749
|
+
var xc = class {
|
|
3750
|
+
constructor(t2, e2, n2) {
|
|
3751
|
+
this.confidenceMasks = t2, this.categoryMask = e2, this.qualityScores = n2;
|
|
3752
|
+
}
|
|
3753
|
+
close() {
|
|
3754
|
+
this.confidenceMasks?.forEach((t2) => {
|
|
3755
|
+
t2.close();
|
|
3756
|
+
}), this.categoryMask?.close();
|
|
3757
|
+
}
|
|
3758
|
+
};
|
|
3759
|
+
xc.prototype.close = xc.prototype.close;
|
|
3760
|
+
var Lc = class extends Hn {
|
|
3761
|
+
constructor(t2) {
|
|
3762
|
+
super(t2);
|
|
3763
|
+
}
|
|
3764
|
+
};
|
|
3765
|
+
var Rc = [0, oi, -2];
|
|
3766
|
+
var Fc = [0, Qr, -3, hi, Qr, -1];
|
|
3767
|
+
var Ic = [0, Fc];
|
|
3768
|
+
var Mc = [0, Fc, oi, -1];
|
|
3769
|
+
var Pc = class extends Hn {
|
|
3770
|
+
constructor(t2) {
|
|
3771
|
+
super(t2);
|
|
3772
|
+
}
|
|
3773
|
+
};
|
|
3774
|
+
var Oc = [0, Qr, -1, hi];
|
|
3775
|
+
var Cc = class extends Hn {
|
|
3776
|
+
constructor(t2) {
|
|
3777
|
+
super(t2);
|
|
3778
|
+
}
|
|
3779
|
+
};
|
|
3780
|
+
var Uc = class extends Hn {
|
|
3781
|
+
constructor(t2) {
|
|
3782
|
+
super(t2);
|
|
3783
|
+
}
|
|
3784
|
+
};
|
|
3785
|
+
var Dc = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 15];
|
|
3786
|
+
var Nc = class extends Hn {
|
|
3787
|
+
constructor(t2) {
|
|
3788
|
+
super(t2);
|
|
3789
|
+
}
|
|
3790
|
+
};
|
|
3791
|
+
Nc.prototype.g = Ai([0, pi, [0, Dc, gi, Fc, gi, [0, Fc, Rc], gi, Ic, gi, [0, Ic, Rc], gi, Oc, gi, [0, Qr, -3, hi, vi], gi, [0, Qr, -3, hi], gi, [0, fi, Qr, -2, hi, oi, hi, -1, 2, Qr, Rc], gi, Mc, gi, [0, Mc, Rc], Qr, Rc, fi, gi, [0, Qr, -3, hi, Rc, -1], gi, [0, pi, Oc]], fi, [0, fi, oi, -1, hi]]);
|
|
3792
|
+
var Bc = class extends Ya {
|
|
3793
|
+
constructor(t2, e2) {
|
|
3794
|
+
super(new Va(t2, e2), "image_in", "norm_rect_in", false), this.outputCategoryMask = false, this.outputConfidenceMasks = true, this.h = new mo(), this.s = new lo(), sn(this.h, 0, 3, this.s), sn(t2 = this.h, 0, 1, e2 = new Ls());
|
|
3795
|
+
}
|
|
3796
|
+
get baseOptions() {
|
|
3797
|
+
return en(this.h, Ls, 1);
|
|
3798
|
+
}
|
|
3799
|
+
set baseOptions(t2) {
|
|
3800
|
+
sn(this.h, 0, 1, t2);
|
|
3801
|
+
}
|
|
3802
|
+
o(t2) {
|
|
3803
|
+
return "outputCategoryMask" in t2 && (this.outputCategoryMask = t2.outputCategoryMask ?? false), "outputConfidenceMasks" in t2 && (this.outputConfidenceMasks = t2.outputConfidenceMasks ?? true), super.l(t2);
|
|
3804
|
+
}
|
|
3805
|
+
segment(t2, e2, n2, r2) {
|
|
3806
|
+
const i2 = "function" != typeof n2 ? n2 : {};
|
|
3807
|
+
this.j = "function" == typeof n2 ? n2 : r2, this.qualityScores = this.categoryMask = this.confidenceMasks = void 0, n2 = this.B + 1, r2 = new Nc();
|
|
3808
|
+
const s2 = new Uc();
|
|
3809
|
+
var o2 = new Lc();
|
|
3810
|
+
if (pn(o2, 1, 255), sn(s2, 0, 12, o2), e2.keypoint && e2.scribble) throw Error("Cannot provide both keypoint and scribble.");
|
|
3811
|
+
if (e2.keypoint) {
|
|
3812
|
+
var a2 = new Pc();
|
|
3813
|
+
fn(a2, 3, true), gn(a2, 1, e2.keypoint.x), gn(a2, 2, e2.keypoint.y), on(s2, 5, Dc, a2);
|
|
3814
|
+
} else {
|
|
3815
|
+
if (!e2.scribble) throw Error("Must provide either a keypoint or a scribble.");
|
|
3816
|
+
for (a2 of (o2 = new Cc(), e2.scribble)) fn(e2 = new Pc(), 3, true), gn(e2, 1, a2.x), gn(e2, 2, a2.y), hn(o2, 1, Pc, e2);
|
|
3817
|
+
on(s2, 15, Dc, o2);
|
|
3818
|
+
}
|
|
3819
|
+
hn(r2, 1, Uc, s2), this.g.addProtoToStream(r2.g(), "drishti.RenderData", "roi_in", n2), Wa(this, t2, i2);
|
|
3820
|
+
t: {
|
|
3821
|
+
try {
|
|
3822
|
+
const t3 = new xc(this.confidenceMasks, this.categoryMask, this.qualityScores);
|
|
3823
|
+
if (!this.j) {
|
|
3824
|
+
var c2 = t3;
|
|
3825
|
+
break t;
|
|
3826
|
+
}
|
|
3827
|
+
this.j(t3);
|
|
3828
|
+
} finally {
|
|
3829
|
+
Yo(this);
|
|
3830
|
+
}
|
|
3831
|
+
c2 = void 0;
|
|
3832
|
+
}
|
|
3833
|
+
return c2;
|
|
3834
|
+
}
|
|
3835
|
+
m() {
|
|
3836
|
+
var t2 = new qi();
|
|
3837
|
+
Yi(t2, "image_in"), Yi(t2, "roi_in"), Yi(t2, "norm_rect_in");
|
|
3838
|
+
const e2 = new Di();
|
|
3839
|
+
Xn(e2, yo, this.h);
|
|
3840
|
+
const n2 = new Xi();
|
|
3841
|
+
Gi(n2, "mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"), ji(n2, "IMAGE:image_in"), ji(n2, "ROI:roi_in"), ji(n2, "NORM_RECT:norm_rect_in"), n2.o(e2), Ki(t2, n2), zo(this, t2), this.outputConfidenceMasks && ($i(t2, "confidence_masks"), Vi(n2, "CONFIDENCE_MASKS:confidence_masks"), Ko(this, "confidence_masks"), this.g.ca("confidence_masks", (t3, e3) => {
|
|
3842
|
+
this.confidenceMasks = t3.map((t4) => Ka(this, t4, true, !this.j)), Wo(this, e3);
|
|
3843
|
+
}), this.g.attachEmptyPacketListener("confidence_masks", (t3) => {
|
|
3844
|
+
this.confidenceMasks = [], Wo(this, t3);
|
|
3845
|
+
})), this.outputCategoryMask && ($i(t2, "category_mask"), Vi(n2, "CATEGORY_MASK:category_mask"), Ko(this, "category_mask"), this.g.U("category_mask", (t3, e3) => {
|
|
3846
|
+
this.categoryMask = Ka(this, t3, false, !this.j), Wo(this, e3);
|
|
3847
|
+
}), this.g.attachEmptyPacketListener("category_mask", (t3) => {
|
|
3848
|
+
this.categoryMask = void 0, Wo(this, t3);
|
|
3849
|
+
})), $i(t2, "quality_scores"), Vi(n2, "QUALITY_SCORES:quality_scores"), this.g.attachFloatVectorListener("quality_scores", (t3, e3) => {
|
|
3850
|
+
this.qualityScores = t3, Wo(this, e3);
|
|
3851
|
+
}), this.g.attachEmptyPacketListener("quality_scores", (t3) => {
|
|
3852
|
+
this.categoryMask = void 0, Wo(this, t3);
|
|
3853
|
+
}), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3854
|
+
}
|
|
3855
|
+
};
|
|
3856
|
+
Bc.prototype.segment = Bc.prototype.segment, Bc.prototype.setOptions = Bc.prototype.o, Bc.createFromModelPath = function(t2, e2) {
|
|
3857
|
+
return Xa(Bc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3858
|
+
}, Bc.createFromModelBuffer = function(t2, e2) {
|
|
3859
|
+
return Xa(Bc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3860
|
+
}, Bc.createFromOptions = function(t2, e2) {
|
|
3861
|
+
return Xa(Bc, t2, e2);
|
|
3862
|
+
};
|
|
3863
|
+
var Gc = class extends Ya {
|
|
3864
|
+
constructor(t2, e2) {
|
|
3865
|
+
super(new Va(t2, e2), "input_frame_gpu", "norm_rect", false), this.j = { detections: [] }, sn(t2 = this.h = new _o(), 0, 1, e2 = new Ls());
|
|
3866
|
+
}
|
|
3867
|
+
get baseOptions() {
|
|
3868
|
+
return en(this.h, Ls, 1);
|
|
3869
|
+
}
|
|
3870
|
+
set baseOptions(t2) {
|
|
3871
|
+
sn(this.h, 0, 1, t2);
|
|
3872
|
+
}
|
|
3873
|
+
o(t2) {
|
|
3874
|
+
return void 0 !== t2.displayNamesLocale ? De(this.h, 2, ae(t2.displayNamesLocale)) : "displayNamesLocale" in t2 && De(this.h, 2), void 0 !== t2.maxResults ? pn(this.h, 3, t2.maxResults) : "maxResults" in t2 && De(this.h, 3), void 0 !== t2.scoreThreshold ? gn(this.h, 4, t2.scoreThreshold) : "scoreThreshold" in t2 && De(this.h, 4), void 0 !== t2.categoryAllowlist ? mn(this.h, 5, t2.categoryAllowlist) : "categoryAllowlist" in t2 && De(this.h, 5), void 0 !== t2.categoryDenylist ? mn(this.h, 6, t2.categoryDenylist) : "categoryDenylist" in t2 && De(this.h, 6), this.l(t2);
|
|
3875
|
+
}
|
|
3876
|
+
D(t2, e2) {
|
|
3877
|
+
return this.j = { detections: [] }, Wa(this, t2, e2), this.j;
|
|
3878
|
+
}
|
|
3879
|
+
F(t2, e2, n2) {
|
|
3880
|
+
return this.j = { detections: [] }, za(this, t2, n2, e2), this.j;
|
|
3881
|
+
}
|
|
3882
|
+
m() {
|
|
3883
|
+
var t2 = new qi();
|
|
3884
|
+
Yi(t2, "input_frame_gpu"), Yi(t2, "norm_rect"), $i(t2, "detections");
|
|
3885
|
+
const e2 = new Di();
|
|
3886
|
+
Xn(e2, vo, this.h);
|
|
3887
|
+
const n2 = new Xi();
|
|
3888
|
+
Gi(n2, "mediapipe.tasks.vision.ObjectDetectorGraph"), ji(n2, "IMAGE:input_frame_gpu"), ji(n2, "NORM_RECT:norm_rect"), Vi(n2, "DETECTIONS:detections"), n2.o(e2), Ki(t2, n2), this.g.attachProtoVectorListener("detections", (t3, e3) => {
|
|
3889
|
+
for (const e4 of t3) t3 = os(e4), this.j.detections.push(bo(t3));
|
|
3890
|
+
Wo(this, e3);
|
|
3891
|
+
}), this.g.attachEmptyPacketListener("detections", (t3) => {
|
|
3892
|
+
Wo(this, t3);
|
|
3893
|
+
}), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3894
|
+
}
|
|
3895
|
+
};
|
|
3896
|
+
Gc.prototype.detectForVideo = Gc.prototype.F, Gc.prototype.detect = Gc.prototype.D, Gc.prototype.setOptions = Gc.prototype.o, Gc.createFromModelPath = async function(t2, e2) {
|
|
3897
|
+
return Xa(Gc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3898
|
+
}, Gc.createFromModelBuffer = function(t2, e2) {
|
|
3899
|
+
return Xa(Gc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3900
|
+
}, Gc.createFromOptions = function(t2, e2) {
|
|
3901
|
+
return Xa(Gc, t2, e2);
|
|
3902
|
+
};
|
|
3903
|
+
var jc = class {
|
|
3904
|
+
constructor(t2, e2, n2) {
|
|
3905
|
+
this.landmarks = t2, this.worldLandmarks = e2, this.segmentationMasks = n2;
|
|
3906
|
+
}
|
|
3907
|
+
close() {
|
|
3908
|
+
this.segmentationMasks?.forEach((t2) => {
|
|
3909
|
+
t2.close();
|
|
3910
|
+
});
|
|
3911
|
+
}
|
|
3912
|
+
};
|
|
3913
|
+
function Vc(t2) {
|
|
3914
|
+
t2.landmarks = [], t2.worldLandmarks = [], t2.segmentationMasks = void 0;
|
|
3915
|
+
}
|
|
3916
|
+
function Xc(t2) {
|
|
3917
|
+
try {
|
|
3918
|
+
const e2 = new jc(t2.landmarks, t2.worldLandmarks, t2.segmentationMasks);
|
|
3919
|
+
if (!t2.s) return e2;
|
|
3920
|
+
t2.s(e2);
|
|
3921
|
+
} finally {
|
|
3922
|
+
Yo(t2);
|
|
3923
|
+
}
|
|
3924
|
+
}
|
|
3925
|
+
jc.prototype.close = jc.prototype.close;
|
|
3926
|
+
var Hc = class extends Ya {
|
|
3927
|
+
constructor(t2, e2) {
|
|
3928
|
+
super(new Va(t2, e2), "image_in", "norm_rect", false), this.landmarks = [], this.worldLandmarks = [], this.outputSegmentationMasks = false, sn(t2 = this.h = new Eo(), 0, 1, e2 = new Ls()), this.v = new ro(), sn(this.h, 0, 3, this.v), this.j = new no(), sn(this.h, 0, 2, this.j), pn(this.j, 4, 1), gn(this.j, 2, 0.5), gn(this.v, 2, 0.5), gn(this.h, 4, 0.5);
|
|
3929
|
+
}
|
|
3930
|
+
get baseOptions() {
|
|
3931
|
+
return en(this.h, Ls, 1);
|
|
3932
|
+
}
|
|
3933
|
+
set baseOptions(t2) {
|
|
3934
|
+
sn(this.h, 0, 1, t2);
|
|
3935
|
+
}
|
|
3936
|
+
o(t2) {
|
|
3937
|
+
return "numPoses" in t2 && pn(this.j, 4, t2.numPoses ?? 1), "minPoseDetectionConfidence" in t2 && gn(this.j, 2, t2.minPoseDetectionConfidence ?? 0.5), "minTrackingConfidence" in t2 && gn(this.h, 4, t2.minTrackingConfidence ?? 0.5), "minPosePresenceConfidence" in t2 && gn(this.v, 2, t2.minPosePresenceConfidence ?? 0.5), "outputSegmentationMasks" in t2 && (this.outputSegmentationMasks = t2.outputSegmentationMasks ?? false), this.l(t2);
|
|
3938
|
+
}
|
|
3939
|
+
D(t2, e2, n2) {
|
|
3940
|
+
const r2 = "function" != typeof e2 ? e2 : {};
|
|
3941
|
+
return this.s = "function" == typeof e2 ? e2 : n2, Vc(this), Wa(this, t2, r2), Xc(this);
|
|
3942
|
+
}
|
|
3943
|
+
F(t2, e2, n2, r2) {
|
|
3944
|
+
const i2 = "function" != typeof n2 ? n2 : {};
|
|
3945
|
+
return this.s = "function" == typeof n2 ? n2 : r2, Vc(this), za(this, t2, i2, e2), Xc(this);
|
|
3946
|
+
}
|
|
3947
|
+
m() {
|
|
3948
|
+
var t2 = new qi();
|
|
3949
|
+
Yi(t2, "image_in"), Yi(t2, "norm_rect"), $i(t2, "normalized_landmarks"), $i(t2, "world_landmarks"), $i(t2, "segmentation_masks");
|
|
3950
|
+
const e2 = new Di();
|
|
3951
|
+
Xn(e2, wo, this.h);
|
|
3952
|
+
const n2 = new Xi();
|
|
3953
|
+
Gi(n2, "mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"), ji(n2, "IMAGE:image_in"), ji(n2, "NORM_RECT:norm_rect"), Vi(n2, "NORM_LANDMARKS:normalized_landmarks"), Vi(n2, "WORLD_LANDMARKS:world_landmarks"), n2.o(e2), Ki(t2, n2), zo(this, t2), this.g.attachProtoVectorListener("normalized_landmarks", (t3, e3) => {
|
|
3954
|
+
this.landmarks = [];
|
|
3955
|
+
for (const e4 of t3) t3 = us(e4), this.landmarks.push(ko(t3));
|
|
3956
|
+
Wo(this, e3);
|
|
3957
|
+
}), this.g.attachEmptyPacketListener("normalized_landmarks", (t3) => {
|
|
3958
|
+
this.landmarks = [], Wo(this, t3);
|
|
3959
|
+
}), this.g.attachProtoVectorListener("world_landmarks", (t3, e3) => {
|
|
3960
|
+
this.worldLandmarks = [];
|
|
3961
|
+
for (const e4 of t3) t3 = cs(e4), this.worldLandmarks.push(So(t3));
|
|
3962
|
+
Wo(this, e3);
|
|
3963
|
+
}), this.g.attachEmptyPacketListener("world_landmarks", (t3) => {
|
|
3964
|
+
this.worldLandmarks = [], Wo(this, t3);
|
|
3965
|
+
}), this.outputSegmentationMasks && (Vi(n2, "SEGMENTATION_MASK:segmentation_masks"), Ko(this, "segmentation_masks"), this.g.ca("segmentation_masks", (t3, e3) => {
|
|
3966
|
+
this.segmentationMasks = t3.map((t4) => Ka(this, t4, true, !this.s)), Wo(this, e3);
|
|
3967
|
+
}), this.g.attachEmptyPacketListener("segmentation_masks", (t3) => {
|
|
3968
|
+
this.segmentationMasks = [], Wo(this, t3);
|
|
3969
|
+
})), t2 = t2.g(), this.setGraph(new Uint8Array(t2), true);
|
|
3970
|
+
}
|
|
3971
|
+
};
|
|
3972
|
+
Hc.prototype.detectForVideo = Hc.prototype.F, Hc.prototype.detect = Hc.prototype.D, Hc.prototype.setOptions = Hc.prototype.o, Hc.createFromModelPath = function(t2, e2) {
|
|
3973
|
+
return Xa(Hc, t2, { baseOptions: { modelAssetPath: e2 } });
|
|
3974
|
+
}, Hc.createFromModelBuffer = function(t2, e2) {
|
|
3975
|
+
return Xa(Hc, t2, { baseOptions: { modelAssetBuffer: e2 } });
|
|
3976
|
+
}, Hc.createFromOptions = function(t2, e2) {
|
|
3977
|
+
return Xa(Hc, t2, e2);
|
|
3978
|
+
}, Hc.POSE_CONNECTIONS = mc;
|
|
3979
|
+
|
|
3980
|
+
// src/gesture/landmarks.ts
|
|
3981
|
+
var LANDMARK = {
|
|
3982
|
+
WRIST: 0,
|
|
3983
|
+
THUMB_CMC: 1,
|
|
3984
|
+
THUMB_MCP: 2,
|
|
3985
|
+
THUMB_IP: 3,
|
|
3986
|
+
THUMB_TIP: 4,
|
|
3987
|
+
INDEX_MCP: 5,
|
|
3988
|
+
INDEX_PIP: 6,
|
|
3989
|
+
INDEX_DIP: 7,
|
|
3990
|
+
INDEX_TIP: 8,
|
|
3991
|
+
MIDDLE_MCP: 9,
|
|
3992
|
+
MIDDLE_PIP: 10,
|
|
3993
|
+
MIDDLE_DIP: 11,
|
|
3994
|
+
MIDDLE_TIP: 12,
|
|
3995
|
+
RING_MCP: 13,
|
|
3996
|
+
RING_PIP: 14,
|
|
3997
|
+
RING_DIP: 15,
|
|
3998
|
+
RING_TIP: 16,
|
|
3999
|
+
PINKY_MCP: 17,
|
|
4000
|
+
PINKY_PIP: 18,
|
|
4001
|
+
PINKY_DIP: 19,
|
|
4002
|
+
PINKY_TIP: 20
|
|
4003
|
+
};
|
|
4004
|
+
function dist2d(a2, b2) {
|
|
4005
|
+
const dx = a2.x - b2.x;
|
|
4006
|
+
const dy = a2.y - b2.y;
|
|
4007
|
+
return Math.hypot(dx, dy);
|
|
4008
|
+
}
|
|
4009
|
+
function midpoint(a2, b2) {
|
|
4010
|
+
return { x: (a2.x + b2.x) / 2, y: (a2.y + b2.y) / 2 };
|
|
4011
|
+
}
|
|
4012
|
+
|
|
4013
|
+
// src/gesture/OneEuroFilter.ts
|
|
4014
|
+
function smoothingAlpha(cutoffHz, dtSec) {
|
|
4015
|
+
const tau = 1 / (2 * Math.PI * cutoffHz);
|
|
4016
|
+
return 1 / (1 + tau / dtSec);
|
|
4017
|
+
}
|
|
4018
|
+
var LowPass = class {
|
|
4019
|
+
constructor() {
|
|
4020
|
+
__publicField(this, "value", null);
|
|
4021
|
+
}
|
|
4022
|
+
filter(x2, alpha) {
|
|
4023
|
+
this.value = this.value === null ? x2 : alpha * x2 + (1 - alpha) * this.value;
|
|
4024
|
+
return this.value;
|
|
4025
|
+
}
|
|
4026
|
+
reset() {
|
|
4027
|
+
this.value = null;
|
|
4028
|
+
}
|
|
4029
|
+
get initialized() {
|
|
4030
|
+
return this.value !== null;
|
|
4031
|
+
}
|
|
4032
|
+
};
|
|
4033
|
+
var OneEuroFilter = class {
|
|
4034
|
+
/**
|
|
4035
|
+
* @param minCutoff Baseline cutoff (Hz). Lower → smoother but laggier when still.
|
|
4036
|
+
* @param beta Speed coefficient. Higher → less lag during fast moves.
|
|
4037
|
+
* @param dCutoff Cutoff for the derivative low-pass (Hz). 1.0 is fine.
|
|
4038
|
+
*/
|
|
4039
|
+
constructor(minCutoff = 1, beta = 0.01, dCutoff = 1) {
|
|
4040
|
+
this.minCutoff = minCutoff;
|
|
4041
|
+
this.beta = beta;
|
|
4042
|
+
this.dCutoff = dCutoff;
|
|
4043
|
+
__publicField(this, "signal", new LowPass());
|
|
4044
|
+
__publicField(this, "derivative", new LowPass());
|
|
4045
|
+
__publicField(this, "lastTimeSec", null);
|
|
4046
|
+
__publicField(this, "lastRaw", 0);
|
|
4047
|
+
}
|
|
4048
|
+
reset() {
|
|
4049
|
+
this.signal.reset();
|
|
4050
|
+
this.derivative.reset();
|
|
4051
|
+
this.lastTimeSec = null;
|
|
4052
|
+
this.lastRaw = 0;
|
|
4053
|
+
}
|
|
4054
|
+
/** @param timeSec strictly-increasing timestamp in seconds. */
|
|
4055
|
+
filter(x2, timeSec) {
|
|
4056
|
+
let dt2 = this.lastTimeSec === null ? 1 / 60 : timeSec - this.lastTimeSec;
|
|
4057
|
+
if (dt2 <= 0) dt2 = 1 / 60;
|
|
4058
|
+
this.lastTimeSec = timeSec;
|
|
4059
|
+
const dRaw = this.signal.initialized ? (x2 - this.lastRaw) / dt2 : 0;
|
|
4060
|
+
this.lastRaw = x2;
|
|
4061
|
+
const edRaw = this.derivative.filter(dRaw, smoothingAlpha(this.dCutoff, dt2));
|
|
4062
|
+
const cutoff = this.minCutoff + this.beta * Math.abs(edRaw);
|
|
4063
|
+
return this.signal.filter(x2, smoothingAlpha(cutoff, dt2));
|
|
4064
|
+
}
|
|
4065
|
+
};
|
|
4066
|
+
|
|
4067
|
+
// src/gesture/pinch.ts
|
|
4068
|
+
function pinchDistance(landmarks) {
|
|
4069
|
+
const thumb = landmarks[LANDMARK.THUMB_TIP];
|
|
4070
|
+
const index = landmarks[LANDMARK.INDEX_TIP];
|
|
4071
|
+
const wrist = landmarks[LANDMARK.WRIST];
|
|
4072
|
+
const middleMcp = landmarks[LANDMARK.MIDDLE_MCP];
|
|
4073
|
+
const handSize = dist2d(wrist, middleMcp) || 1e-6;
|
|
4074
|
+
return dist2d(thumb, index) / handSize;
|
|
4075
|
+
}
|
|
4076
|
+
var PinchDetector = class {
|
|
4077
|
+
constructor(onThreshold = 0.35, offThreshold = 0.5, persistFrames = 2) {
|
|
4078
|
+
this.onThreshold = onThreshold;
|
|
4079
|
+
this.offThreshold = offThreshold;
|
|
4080
|
+
this.persistFrames = persistFrames;
|
|
4081
|
+
__publicField(this, "pinching", false);
|
|
4082
|
+
__publicField(this, "pendingFrames", 0);
|
|
4083
|
+
}
|
|
4084
|
+
reset() {
|
|
4085
|
+
this.pinching = false;
|
|
4086
|
+
this.pendingFrames = 0;
|
|
4087
|
+
}
|
|
4088
|
+
get isPinching() {
|
|
4089
|
+
return this.pinching;
|
|
4090
|
+
}
|
|
4091
|
+
/** Feed one frame's distance. Returns true if the committed state CHANGED. */
|
|
4092
|
+
update(distance) {
|
|
4093
|
+
const target = this.pinching ? distance < this.offThreshold : distance < this.onThreshold;
|
|
4094
|
+
if (target === this.pinching) {
|
|
4095
|
+
this.pendingFrames = 0;
|
|
4096
|
+
return false;
|
|
4097
|
+
}
|
|
4098
|
+
this.pendingFrames += 1;
|
|
4099
|
+
if (this.pendingFrames >= this.persistFrames) {
|
|
4100
|
+
this.pinching = target;
|
|
4101
|
+
this.pendingFrames = 0;
|
|
4102
|
+
return true;
|
|
4103
|
+
}
|
|
4104
|
+
return false;
|
|
4105
|
+
}
|
|
4106
|
+
};
|
|
4107
|
+
|
|
4108
|
+
// src/gesture/commands.ts
|
|
4109
|
+
var GESTURE_COMMANDS = {
|
|
4110
|
+
Open_Palm: { name: "halt-all", holdMs: -1 },
|
|
4111
|
+
// holdMs filled from palmHoldMs
|
|
4112
|
+
Thumb_Up: { name: "approve" },
|
|
4113
|
+
Victory: { name: "new-session" }
|
|
4114
|
+
};
|
|
4115
|
+
var CommandDetector = class {
|
|
4116
|
+
constructor(palmHoldMs = 1e3) {
|
|
4117
|
+
this.palmHoldMs = palmHoldMs;
|
|
4118
|
+
/** gesture category → timestamp (ms) it was first seen in the current hold. */
|
|
4119
|
+
__publicField(this, "heldSince", /* @__PURE__ */ new Map());
|
|
4120
|
+
/** gestures that already fired during the current hold (cleared on release). */
|
|
4121
|
+
__publicField(this, "fired", /* @__PURE__ */ new Set());
|
|
4122
|
+
}
|
|
4123
|
+
reset() {
|
|
4124
|
+
this.heldSince.clear();
|
|
4125
|
+
this.fired.clear();
|
|
4126
|
+
}
|
|
4127
|
+
holdMsFor(spec) {
|
|
4128
|
+
return spec.holdMs === -1 ? this.palmHoldMs : spec.holdMs ?? 0;
|
|
4129
|
+
}
|
|
4130
|
+
/**
|
|
4131
|
+
* Feed the set of command-gestures currently shown (across all hands).
|
|
4132
|
+
* @returns the commands that fired on this frame (usually empty).
|
|
4133
|
+
*/
|
|
4134
|
+
update(gestures, nowMs) {
|
|
4135
|
+
for (const g2 of [...this.heldSince.keys()]) {
|
|
4136
|
+
if (!gestures.has(g2)) {
|
|
4137
|
+
this.heldSince.delete(g2);
|
|
4138
|
+
this.fired.delete(g2);
|
|
4139
|
+
}
|
|
4140
|
+
}
|
|
4141
|
+
const fired = [];
|
|
4142
|
+
for (const g2 of gestures) {
|
|
4143
|
+
const spec = GESTURE_COMMANDS[g2];
|
|
4144
|
+
if (!spec) continue;
|
|
4145
|
+
const since = this.heldSince.get(g2) ?? nowMs;
|
|
4146
|
+
if (!this.heldSince.has(g2)) this.heldSince.set(g2, since);
|
|
4147
|
+
if (this.fired.has(g2)) continue;
|
|
4148
|
+
if (nowMs - since >= this.holdMsFor(spec)) {
|
|
4149
|
+
fired.push(spec.name);
|
|
4150
|
+
this.fired.add(g2);
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
return fired;
|
|
4154
|
+
}
|
|
4155
|
+
/** 0–1 charge of the held halt-all gesture (1 once fired, 0 when released). */
|
|
4156
|
+
haltProgress(nowMs) {
|
|
4157
|
+
const since = this.heldSince.get("Open_Palm");
|
|
4158
|
+
if (since === void 0) return 0;
|
|
4159
|
+
if (this.fired.has("Open_Palm")) return 1;
|
|
4160
|
+
return Math.min(1, (nowMs - since) / this.palmHoldMs);
|
|
4161
|
+
}
|
|
4162
|
+
};
|
|
4163
|
+
|
|
4164
|
+
// src/gesture/GestureController.ts
|
|
4165
|
+
var DEFAULTS = {
|
|
4166
|
+
numHands: 1,
|
|
4167
|
+
deviceId: "",
|
|
4168
|
+
pinchOn: 0.35,
|
|
4169
|
+
pinchOff: 0.5,
|
|
4170
|
+
minCutoff: 1,
|
|
4171
|
+
beta: 0.01,
|
|
4172
|
+
palmHoldMs: 1e3,
|
|
4173
|
+
minDetectionConfidence: 0.6,
|
|
4174
|
+
minTrackingConfidence: 0.6,
|
|
4175
|
+
// Pinned to the @mediapipe/tasks-vision version in package.json.
|
|
4176
|
+
wasmBase: "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.21/wasm",
|
|
4177
|
+
modelUrl: "https://storage.googleapis.com/mediapipe-models/gesture_recognizer/gesture_recognizer/float16/1/gesture_recognizer.task"
|
|
4178
|
+
};
|
|
4179
|
+
var GestureController = class {
|
|
4180
|
+
constructor(options) {
|
|
4181
|
+
__publicField(this, "opts");
|
|
4182
|
+
__publicField(this, "recognizer", null);
|
|
4183
|
+
__publicField(this, "stream", null);
|
|
4184
|
+
__publicField(this, "rafId", null);
|
|
4185
|
+
__publicField(this, "running", false);
|
|
4186
|
+
// Timestamps must be strictly increasing for recognizeForVideo.
|
|
4187
|
+
__publicField(this, "lastVideoTime", -1);
|
|
4188
|
+
__publicField(this, "lastTimestamp", -1);
|
|
4189
|
+
// FPS tracking (rolling over a short window).
|
|
4190
|
+
__publicField(this, "frameTimes", []);
|
|
4191
|
+
// Per-hand smoothing + pinch state, keyed by handedness ("Left"/"Right") so a
|
|
4192
|
+
// hand keeps its own filters even when MediaPipe reorders the hands array.
|
|
4193
|
+
__publicField(this, "handStates", /* @__PURE__ */ new Map());
|
|
4194
|
+
// Discrete gesture → command bus (debounced; Open_Palm held = halt-all).
|
|
4195
|
+
__publicField(this, "commands");
|
|
4196
|
+
// Internal storage is intentionally loose; the public on/off/emit signatures
|
|
4197
|
+
// below keep callers fully type-safe per event name.
|
|
4198
|
+
__publicField(this, "listeners", {});
|
|
4199
|
+
// ---- Loop ------------------------------------------------------------
|
|
4200
|
+
__publicField(this, "loop", () => {
|
|
4201
|
+
if (!this.running || !this.recognizer) return;
|
|
4202
|
+
this.rafId = requestAnimationFrame(this.loop);
|
|
4203
|
+
const video = this.opts.video;
|
|
4204
|
+
if (video.readyState < 2) return;
|
|
4205
|
+
let ts2 = performance.now();
|
|
4206
|
+
if (ts2 <= this.lastTimestamp) ts2 = this.lastTimestamp + 1;
|
|
4207
|
+
this.lastTimestamp = ts2;
|
|
4208
|
+
if (video.currentTime === this.lastVideoTime) return;
|
|
4209
|
+
this.lastVideoTime = video.currentTime;
|
|
4210
|
+
let result;
|
|
4211
|
+
try {
|
|
4212
|
+
result = this.recognizer.recognizeForVideo(video, ts2);
|
|
4213
|
+
} catch (err) {
|
|
4214
|
+
console.error("recognizeForVideo failed", err);
|
|
4215
|
+
return;
|
|
4216
|
+
}
|
|
4217
|
+
this.trackFps(ts2);
|
|
4218
|
+
this.publish(result, ts2);
|
|
4219
|
+
});
|
|
4220
|
+
this.opts = {
|
|
4221
|
+
surface: options.surface ?? options.video,
|
|
4222
|
+
numHands: options.numHands ?? DEFAULTS.numHands,
|
|
4223
|
+
deviceId: options.deviceId ?? DEFAULTS.deviceId,
|
|
4224
|
+
pinchOn: options.pinchOn ?? DEFAULTS.pinchOn,
|
|
4225
|
+
pinchOff: options.pinchOff ?? DEFAULTS.pinchOff,
|
|
4226
|
+
minCutoff: options.minCutoff ?? DEFAULTS.minCutoff,
|
|
4227
|
+
beta: options.beta ?? DEFAULTS.beta,
|
|
4228
|
+
palmHoldMs: options.palmHoldMs ?? DEFAULTS.palmHoldMs,
|
|
4229
|
+
minDetectionConfidence: options.minDetectionConfidence ?? DEFAULTS.minDetectionConfidence,
|
|
4230
|
+
minTrackingConfidence: options.minTrackingConfidence ?? DEFAULTS.minTrackingConfidence,
|
|
4231
|
+
wasmBase: options.wasmBase ?? DEFAULTS.wasmBase,
|
|
4232
|
+
modelUrl: options.modelUrl ?? DEFAULTS.modelUrl,
|
|
4233
|
+
video: options.video
|
|
4234
|
+
};
|
|
4235
|
+
this.commands = new CommandDetector(this.opts.palmHoldMs);
|
|
4236
|
+
}
|
|
4237
|
+
/** Get (or lazily create) the smoothing + pinch state for one hand. */
|
|
4238
|
+
handState(key) {
|
|
4239
|
+
let state = this.handStates.get(key);
|
|
4240
|
+
if (!state) {
|
|
4241
|
+
state = {
|
|
4242
|
+
cursorX: new OneEuroFilter(this.opts.minCutoff, this.opts.beta),
|
|
4243
|
+
cursorY: new OneEuroFilter(this.opts.minCutoff, this.opts.beta),
|
|
4244
|
+
pinch: new PinchDetector(this.opts.pinchOn, this.opts.pinchOff),
|
|
4245
|
+
label: key,
|
|
4246
|
+
lastX: 0,
|
|
4247
|
+
lastY: 0
|
|
4248
|
+
};
|
|
4249
|
+
this.handStates.set(key, state);
|
|
4250
|
+
}
|
|
4251
|
+
return state;
|
|
4252
|
+
}
|
|
4253
|
+
// ---- Event emitter ---------------------------------------------------
|
|
4254
|
+
on(event, handler) {
|
|
4255
|
+
var _a2;
|
|
4256
|
+
((_a2 = this.listeners)[event] ?? (_a2[event] = /* @__PURE__ */ new Set())).add(
|
|
4257
|
+
handler
|
|
4258
|
+
);
|
|
4259
|
+
return this;
|
|
4260
|
+
}
|
|
4261
|
+
off(event, handler) {
|
|
4262
|
+
this.listeners[event]?.delete(handler);
|
|
4263
|
+
return this;
|
|
4264
|
+
}
|
|
4265
|
+
emit(event, payload) {
|
|
4266
|
+
this.listeners[event]?.forEach((h2) => h2(payload));
|
|
4267
|
+
}
|
|
4268
|
+
// ---- Lifecycle -------------------------------------------------------
|
|
4269
|
+
/** Request the camera, load the model, and start the recognition loop. */
|
|
4270
|
+
async start() {
|
|
4271
|
+
if (this.running) return;
|
|
4272
|
+
await this.openCamera();
|
|
4273
|
+
await this.loadRecognizer();
|
|
4274
|
+
this.running = true;
|
|
4275
|
+
this.lastVideoTime = -1;
|
|
4276
|
+
this.lastTimestamp = -1;
|
|
4277
|
+
this.frameTimes = [];
|
|
4278
|
+
this.handStates.clear();
|
|
4279
|
+
this.commands.reset();
|
|
4280
|
+
this.loop();
|
|
4281
|
+
}
|
|
4282
|
+
/** Stop the loop, release the camera, and close the recognizer. */
|
|
4283
|
+
stop() {
|
|
4284
|
+
this.running = false;
|
|
4285
|
+
if (this.rafId !== null) {
|
|
4286
|
+
cancelAnimationFrame(this.rafId);
|
|
4287
|
+
this.rafId = null;
|
|
4288
|
+
}
|
|
4289
|
+
if (this.stream) {
|
|
4290
|
+
this.stream.getTracks().forEach((t2) => t2.stop());
|
|
4291
|
+
this.stream = null;
|
|
4292
|
+
}
|
|
4293
|
+
this.opts.video.srcObject = null;
|
|
4294
|
+
this.recognizer?.close();
|
|
4295
|
+
this.recognizer = null;
|
|
4296
|
+
}
|
|
4297
|
+
/** The camera currently in use (resolved deviceId), or "" if not started. */
|
|
4298
|
+
get deviceId() {
|
|
4299
|
+
return this.opts.deviceId;
|
|
4300
|
+
}
|
|
4301
|
+
/** List available video input devices. Labels are only populated once the
|
|
4302
|
+
* user has granted camera permission (i.e. after the first start()). */
|
|
4303
|
+
async listCameras() {
|
|
4304
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
4305
|
+
return devices.filter((d) => d.kind === "videoinput");
|
|
4306
|
+
}
|
|
4307
|
+
/** Switch to a different camera. Reopens the stream live if already running. */
|
|
4308
|
+
async useCamera(deviceId) {
|
|
4309
|
+
this.opts.deviceId = deviceId;
|
|
4310
|
+
if (!this.running) return;
|
|
4311
|
+
if (this.stream) {
|
|
4312
|
+
this.stream.getTracks().forEach((t2) => t2.stop());
|
|
4313
|
+
this.stream = null;
|
|
4314
|
+
}
|
|
4315
|
+
await this.openCamera();
|
|
4316
|
+
this.handStates.clear();
|
|
4317
|
+
this.lastVideoTime = -1;
|
|
4318
|
+
}
|
|
4319
|
+
// ---- Setup -----------------------------------------------------------
|
|
4320
|
+
async openCamera() {
|
|
4321
|
+
if (!navigator.mediaDevices?.getUserMedia) {
|
|
4322
|
+
throw new Error("getUserMedia is not available (needs a secure context).");
|
|
4323
|
+
}
|
|
4324
|
+
const videoConstraints = {
|
|
4325
|
+
width: { ideal: 1280 },
|
|
4326
|
+
height: { ideal: 720 },
|
|
4327
|
+
frameRate: { ideal: 60, max: 60 }
|
|
4328
|
+
};
|
|
4329
|
+
if (this.opts.deviceId)
|
|
4330
|
+
videoConstraints.deviceId = { exact: this.opts.deviceId };
|
|
4331
|
+
else videoConstraints.facingMode = "user";
|
|
4332
|
+
const stream = await navigator.mediaDevices.getUserMedia({
|
|
4333
|
+
video: videoConstraints,
|
|
4334
|
+
audio: false
|
|
4335
|
+
});
|
|
4336
|
+
this.stream = stream;
|
|
4337
|
+
this.opts.deviceId = stream.getVideoTracks()[0]?.getSettings().deviceId ?? this.opts.deviceId;
|
|
4338
|
+
const video = this.opts.video;
|
|
4339
|
+
video.srcObject = stream;
|
|
4340
|
+
video.muted = true;
|
|
4341
|
+
video.playsInline = true;
|
|
4342
|
+
await video.play();
|
|
4343
|
+
if (!video.videoWidth) {
|
|
4344
|
+
await new Promise((resolve) => {
|
|
4345
|
+
const onMeta = () => {
|
|
4346
|
+
video.removeEventListener("loadedmetadata", onMeta);
|
|
4347
|
+
resolve();
|
|
4348
|
+
};
|
|
4349
|
+
video.addEventListener("loadedmetadata", onMeta);
|
|
4350
|
+
});
|
|
4351
|
+
}
|
|
4352
|
+
}
|
|
4353
|
+
async loadRecognizer() {
|
|
4354
|
+
const fileset = await Po.forVisionTasks(this.opts.wasmBase);
|
|
4355
|
+
const build = (delegate) => fc.createFromOptions(fileset, {
|
|
4356
|
+
baseOptions: {
|
|
4357
|
+
modelAssetPath: this.opts.modelUrl,
|
|
4358
|
+
delegate
|
|
4359
|
+
},
|
|
4360
|
+
runningMode: "VIDEO",
|
|
4361
|
+
numHands: this.opts.numHands,
|
|
4362
|
+
minHandDetectionConfidence: this.opts.minDetectionConfidence,
|
|
4363
|
+
minHandPresenceConfidence: this.opts.minDetectionConfidence,
|
|
4364
|
+
minTrackingConfidence: this.opts.minTrackingConfidence
|
|
4365
|
+
});
|
|
4366
|
+
try {
|
|
4367
|
+
this.recognizer = await build("GPU");
|
|
4368
|
+
} catch (err) {
|
|
4369
|
+
console.warn("[gesture] GPU delegate failed; falling back to CPU.", err);
|
|
4370
|
+
this.recognizer = await build("CPU");
|
|
4371
|
+
}
|
|
4372
|
+
}
|
|
4373
|
+
trackFps(nowMs) {
|
|
4374
|
+
this.frameTimes.push(nowMs);
|
|
4375
|
+
const windowStart = nowMs - 1e3;
|
|
4376
|
+
while (this.frameTimes.length && this.frameTimes[0] < windowStart) {
|
|
4377
|
+
this.frameTimes.shift();
|
|
4378
|
+
}
|
|
4379
|
+
}
|
|
4380
|
+
get fps() {
|
|
4381
|
+
if (this.frameTimes.length < 2) return 0;
|
|
4382
|
+
const span = this.frameTimes[this.frameTimes.length - 1] - this.frameTimes[0];
|
|
4383
|
+
if (span <= 0) return 0;
|
|
4384
|
+
return Math.round((this.frameTimes.length - 1) / span * 1e3);
|
|
4385
|
+
}
|
|
4386
|
+
publish(result, ts2) {
|
|
4387
|
+
const allLandmarks = result.landmarks ?? [];
|
|
4388
|
+
const handedness = result.handedness ?? [];
|
|
4389
|
+
const gestures = result.gestures ?? [];
|
|
4390
|
+
const tSec = ts2 / 1e3;
|
|
4391
|
+
const rect = this.opts.surface.getBoundingClientRect();
|
|
4392
|
+
const hands = [];
|
|
4393
|
+
const activeKeys = /* @__PURE__ */ new Set();
|
|
4394
|
+
for (let i2 = 0; i2 < allLandmarks.length; i2++) {
|
|
4395
|
+
const lm = allLandmarks[i2];
|
|
4396
|
+
if (!lm || lm.length === 0) continue;
|
|
4397
|
+
const label = handedness[i2]?.[0]?.categoryName ?? `hand${i2}`;
|
|
4398
|
+
let key = label;
|
|
4399
|
+
if (activeKeys.has(key)) key = `${label}#${i2}`;
|
|
4400
|
+
activeKeys.add(key);
|
|
4401
|
+
const state = this.handState(key);
|
|
4402
|
+
const mid = midpoint(lm[LANDMARK.THUMB_TIP], lm[LANDMARK.INDEX_TIP]);
|
|
4403
|
+
const cursor = {
|
|
4404
|
+
x: state.cursorX.filter(mid.x, tSec),
|
|
4405
|
+
y: state.cursorY.filter(mid.y, tSec)
|
|
4406
|
+
};
|
|
4407
|
+
const pinchDist = pinchDistance(lm);
|
|
4408
|
+
const changed = state.pinch.update(pinchDist);
|
|
4409
|
+
const gesture = gestures[i2]?.[0]?.categoryName ?? null;
|
|
4410
|
+
const sx = (1 - cursor.x) * rect.width;
|
|
4411
|
+
const sy = cursor.y * rect.height;
|
|
4412
|
+
state.lastX = sx;
|
|
4413
|
+
state.lastY = sy;
|
|
4414
|
+
const pointer = { hand: label, x: sx, y: sy };
|
|
4415
|
+
if (state.pinch.isPinching) {
|
|
4416
|
+
this.emit(changed ? "grab" : "drag", pointer);
|
|
4417
|
+
} else if (changed) {
|
|
4418
|
+
this.emit("drop", pointer);
|
|
4419
|
+
}
|
|
4420
|
+
hands.push({
|
|
4421
|
+
handedness: label,
|
|
4422
|
+
cursor,
|
|
4423
|
+
pinchDist,
|
|
4424
|
+
pinching: state.pinch.isPinching,
|
|
4425
|
+
gesture: gesture && gesture !== "None" ? gesture : null
|
|
4426
|
+
});
|
|
4427
|
+
}
|
|
4428
|
+
for (const key of [...this.handStates.keys()]) {
|
|
4429
|
+
if (activeKeys.has(key)) continue;
|
|
4430
|
+
const stale = this.handStates.get(key);
|
|
4431
|
+
if (stale.pinch.isPinching) {
|
|
4432
|
+
this.emit("drop", { hand: stale.label, x: stale.lastX, y: stale.lastY });
|
|
4433
|
+
}
|
|
4434
|
+
this.handStates.delete(key);
|
|
4435
|
+
}
|
|
4436
|
+
const commandGestures = /* @__PURE__ */ new Set();
|
|
4437
|
+
for (const h2 of hands) {
|
|
4438
|
+
if (!h2.pinching && h2.gesture) commandGestures.add(h2.gesture);
|
|
4439
|
+
}
|
|
4440
|
+
for (const name of this.commands.update(commandGestures, ts2)) {
|
|
4441
|
+
this.emit("command", { name });
|
|
4442
|
+
}
|
|
4443
|
+
this.emit("status", {
|
|
4444
|
+
fps: this.fps,
|
|
4445
|
+
hands,
|
|
4446
|
+
haltProgress: this.commands.haltProgress(ts2)
|
|
4447
|
+
});
|
|
4448
|
+
this.emit("results", { result, timestampMs: ts2 });
|
|
4449
|
+
}
|
|
4450
|
+
};
|
|
4451
|
+
|
|
4452
|
+
// src/codeman/entry.ts
|
|
4453
|
+
var TAB_SELECTOR = ".session-tab";
|
|
4454
|
+
var CLICK_SELECTOR = "#runBtn, .btn-shell";
|
|
4455
|
+
var Z2 = 2147483e3;
|
|
4456
|
+
var DETACH_PULL_PX = 70;
|
|
4457
|
+
var TAP_CANCEL_PX = 45;
|
|
4458
|
+
var handColor = (handedness, pinching) => pinching ? "#4ade80" : handedness === "Right" ? "#a78bfa" : "#38bdf8";
|
|
4459
|
+
var GestureBridge = class {
|
|
4460
|
+
constructor() {
|
|
4461
|
+
__publicField(this, "surface");
|
|
4462
|
+
__publicField(this, "canvas");
|
|
4463
|
+
__publicField(this, "ctx");
|
|
4464
|
+
__publicField(this, "video");
|
|
4465
|
+
__publicField(this, "button");
|
|
4466
|
+
__publicField(this, "camBtn");
|
|
4467
|
+
__publicField(this, "status");
|
|
4468
|
+
__publicField(this, "gc");
|
|
4469
|
+
__publicField(this, "running", false);
|
|
4470
|
+
/** Camera view: full-viewport dimmed background, or small corner preview. */
|
|
4471
|
+
__publicField(this, "camMode", "full");
|
|
4472
|
+
/** Per-hand in-progress grab (the tab grabbed at pinch-start). */
|
|
4473
|
+
__publicField(this, "grabs", /* @__PURE__ */ new Map());
|
|
4474
|
+
/** Per-hand in-progress button pinch (fires on release if it didn't drift). */
|
|
4475
|
+
__publicField(this, "taps", /* @__PURE__ */ new Map());
|
|
4476
|
+
injectStyles();
|
|
4477
|
+
this.surface = el("div", "cg-surface");
|
|
4478
|
+
this.canvas = el("canvas", "cg-canvas");
|
|
4479
|
+
this.video = el("video", "cg-preview");
|
|
4480
|
+
this.video.muted = true;
|
|
4481
|
+
this.video.playsInline = true;
|
|
4482
|
+
this.applyCamMode();
|
|
4483
|
+
const dock = el("div", "cg-dock");
|
|
4484
|
+
this.button = el("button", "cg-btn");
|
|
4485
|
+
this.button.textContent = "\u{1F590} Gesture";
|
|
4486
|
+
this.camBtn = el("button", "cg-btn cg-btn-icon");
|
|
4487
|
+
this.camBtn.textContent = "\u26F6";
|
|
4488
|
+
this.camBtn.title = "Toggle camera size (fullscreen / corner)";
|
|
4489
|
+
this.status = el("span", "cg-status");
|
|
4490
|
+
this.status.textContent = "off";
|
|
4491
|
+
dock.append(this.button, this.camBtn, this.status);
|
|
4492
|
+
document.body.append(this.surface, this.video, this.canvas, dock);
|
|
4493
|
+
this.ctx = this.canvas.getContext("2d");
|
|
4494
|
+
this.sizeCanvas();
|
|
4495
|
+
window.addEventListener("resize", () => this.sizeCanvas());
|
|
4496
|
+
this.gc = new GestureController({
|
|
4497
|
+
video: this.video,
|
|
4498
|
+
surface: this.surface,
|
|
4499
|
+
numHands: 1,
|
|
4500
|
+
// Self-host the MediaPipe runtime + model from Codeman (same-origin) instead
|
|
4501
|
+
// of the CDN, so an ad/content blocker, offline desk, or strict browser
|
|
4502
|
+
// can't break startup (the CDN failure surfaced as `failed: {isTrusted}` —
|
|
4503
|
+
// a resource load-error Event). Served from public/gesture/.
|
|
4504
|
+
wasmBase: "/gesture/wasm",
|
|
4505
|
+
modelUrl: "/gesture/gesture_recognizer.task"
|
|
4506
|
+
});
|
|
4507
|
+
this.gc.on("grab", (p2) => this.onGrab(p2.hand, p2.x, p2.y));
|
|
4508
|
+
this.gc.on("drag", (p2) => this.onDrag(p2.hand, p2.x, p2.y));
|
|
4509
|
+
this.gc.on("drop", (p2) => this.onDrop(p2.hand));
|
|
4510
|
+
this.gc.on("status", ({ fps, hands }) => this.onStatus(fps, hands));
|
|
4511
|
+
this.button.addEventListener("click", () => void this.toggle());
|
|
4512
|
+
this.camBtn.addEventListener("click", () => this.toggleCamMode());
|
|
4513
|
+
}
|
|
4514
|
+
async toggle() {
|
|
4515
|
+
if (this.running) {
|
|
4516
|
+
this.gc.stop();
|
|
4517
|
+
this.running = false;
|
|
4518
|
+
this.cancelAllGrabs();
|
|
4519
|
+
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
4520
|
+
this.button.classList.remove("on");
|
|
4521
|
+
this.status.textContent = "off";
|
|
4522
|
+
return;
|
|
4523
|
+
}
|
|
4524
|
+
this.button.disabled = true;
|
|
4525
|
+
this.status.textContent = "starting\u2026";
|
|
4526
|
+
try {
|
|
4527
|
+
await this.gc.start();
|
|
4528
|
+
this.running = true;
|
|
4529
|
+
this.button.classList.add("on");
|
|
4530
|
+
this.status.textContent = "on \u2014 pinch a tab or button";
|
|
4531
|
+
} catch (err) {
|
|
4532
|
+
const msg = describeError(err);
|
|
4533
|
+
this.status.textContent = `failed: ${msg}`;
|
|
4534
|
+
this.status.title = msg;
|
|
4535
|
+
console.error("[gesture] start failed", err);
|
|
4536
|
+
} finally {
|
|
4537
|
+
this.button.disabled = false;
|
|
4538
|
+
}
|
|
4539
|
+
}
|
|
4540
|
+
toggleCamMode() {
|
|
4541
|
+
this.camMode = this.camMode === "full" ? "pip" : "full";
|
|
4542
|
+
this.applyCamMode();
|
|
4543
|
+
}
|
|
4544
|
+
applyCamMode() {
|
|
4545
|
+
this.video.classList.toggle("cg-full", this.camMode === "full");
|
|
4546
|
+
this.video.classList.toggle("cg-pip", this.camMode === "pip");
|
|
4547
|
+
}
|
|
4548
|
+
/** Top-most element matching `sel` at a viewport point (overlays are
|
|
4549
|
+
* click-through, so elementFromPoint sees the dashboard beneath). */
|
|
4550
|
+
hitClosest(x2, y2, sel) {
|
|
4551
|
+
const hit = document.elementFromPoint(x2, y2);
|
|
4552
|
+
return hit?.closest(sel) ?? null;
|
|
4553
|
+
}
|
|
4554
|
+
onGrab(hand, x2, y2) {
|
|
4555
|
+
const tab = this.hitClosest(x2, y2, TAB_SELECTOR);
|
|
4556
|
+
const id = tab?.dataset.id;
|
|
4557
|
+
if (tab && id) {
|
|
4558
|
+
const rect = tab.getBoundingClientRect();
|
|
4559
|
+
const ghost = tab.cloneNode(true);
|
|
4560
|
+
ghost.classList.add("cg-ghost");
|
|
4561
|
+
ghost.removeAttribute("id");
|
|
4562
|
+
ghost.style.width = `${rect.width}px`;
|
|
4563
|
+
ghost.style.height = `${rect.height}px`;
|
|
4564
|
+
document.body.append(ghost);
|
|
4565
|
+
tab.classList.add("cg-grabbed");
|
|
4566
|
+
const grab = { id, tab, ghost, ox: x2, oy: y2, armed: false };
|
|
4567
|
+
this.grabs.set(hand, grab);
|
|
4568
|
+
this.positionGhost(grab, x2, y2);
|
|
4569
|
+
return;
|
|
4570
|
+
}
|
|
4571
|
+
const btn = this.hitClosest(x2, y2, CLICK_SELECTOR);
|
|
4572
|
+
if (btn) {
|
|
4573
|
+
const label = (btn.textContent || btn.getAttribute("title") || "button").trim();
|
|
4574
|
+
btn.classList.add("cg-tap-armed");
|
|
4575
|
+
this.taps.set(hand, { el: btn, label, ox: x2, oy: y2 });
|
|
4576
|
+
this.status.textContent = `release to ${label.toLowerCase()}`;
|
|
4577
|
+
}
|
|
4578
|
+
}
|
|
4579
|
+
onDrag(hand, x2, y2) {
|
|
4580
|
+
const grab = this.grabs.get(hand);
|
|
4581
|
+
if (grab) {
|
|
4582
|
+
this.positionGhost(grab, x2, y2);
|
|
4583
|
+
const pulled = Math.hypot(x2 - grab.ox, y2 - grab.oy) >= DETACH_PULL_PX;
|
|
4584
|
+
if (pulled !== grab.armed) {
|
|
4585
|
+
grab.armed = pulled;
|
|
4586
|
+
grab.ghost.classList.toggle("cg-armed", pulled);
|
|
4587
|
+
this.status.textContent = pulled ? "release to detach" : "on \u2014 pinch a tab";
|
|
4588
|
+
}
|
|
4589
|
+
return;
|
|
4590
|
+
}
|
|
4591
|
+
const tap = this.taps.get(hand);
|
|
4592
|
+
if (tap && Math.hypot(x2 - tap.ox, y2 - tap.oy) > TAP_CANCEL_PX) {
|
|
4593
|
+
tap.el.classList.remove("cg-tap-armed");
|
|
4594
|
+
this.taps.delete(hand);
|
|
4595
|
+
this.status.textContent = "on \u2014 pinch a tab or button";
|
|
4596
|
+
}
|
|
4597
|
+
}
|
|
4598
|
+
onDrop(hand) {
|
|
4599
|
+
const grab = this.grabs.get(hand);
|
|
4600
|
+
if (grab) {
|
|
4601
|
+
this.grabs.delete(hand);
|
|
4602
|
+
grab.ghost.remove();
|
|
4603
|
+
grab.tab.classList.remove("cg-grabbed");
|
|
4604
|
+
if (grab.armed) this.detach(grab.id);
|
|
4605
|
+
else this.flash("cancelled");
|
|
4606
|
+
return;
|
|
4607
|
+
}
|
|
4608
|
+
const tap = this.taps.get(hand);
|
|
4609
|
+
if (tap) {
|
|
4610
|
+
this.taps.delete(hand);
|
|
4611
|
+
tap.el.classList.remove("cg-tap-armed");
|
|
4612
|
+
tap.el.click();
|
|
4613
|
+
this.flash(tap.label.toLowerCase());
|
|
4614
|
+
}
|
|
4615
|
+
}
|
|
4616
|
+
/** Undock a session by calling Codeman's own wired entry point directly. */
|
|
4617
|
+
detach(id) {
|
|
4618
|
+
const app = window.app;
|
|
4619
|
+
if (app && typeof app.detachSession === "function") {
|
|
4620
|
+
app.detachSession(id);
|
|
4621
|
+
this.flash("undocked");
|
|
4622
|
+
return;
|
|
4623
|
+
}
|
|
4624
|
+
this.flash("undock unavailable");
|
|
4625
|
+
console.warn(
|
|
4626
|
+
"[gesture] window.app.detachSession not found \u2014 is Codeman on the session-detach build?"
|
|
4627
|
+
);
|
|
4628
|
+
}
|
|
4629
|
+
positionGhost(grab, x2, y2) {
|
|
4630
|
+
grab.ghost.style.left = `${x2}px`;
|
|
4631
|
+
grab.ghost.style.top = `${y2}px`;
|
|
4632
|
+
}
|
|
4633
|
+
cancelAllGrabs() {
|
|
4634
|
+
for (const grab of this.grabs.values()) {
|
|
4635
|
+
grab.ghost.remove();
|
|
4636
|
+
grab.tab.classList.remove("cg-grabbed");
|
|
4637
|
+
}
|
|
4638
|
+
this.grabs.clear();
|
|
4639
|
+
for (const tap of this.taps.values()) tap.el.classList.remove("cg-tap-armed");
|
|
4640
|
+
this.taps.clear();
|
|
4641
|
+
document.querySelectorAll(`${TAB_SELECTOR}.cg-grabbed, .cg-tap-armed`).forEach((t2) => t2.classList.remove("cg-grabbed", "cg-tap-armed"));
|
|
4642
|
+
}
|
|
4643
|
+
onStatus(fps, hands) {
|
|
4644
|
+
const { width, height } = this.canvas;
|
|
4645
|
+
const dpr = window.devicePixelRatio || 1;
|
|
4646
|
+
this.ctx.clearRect(0, 0, width, height);
|
|
4647
|
+
const rect = this.surface.getBoundingClientRect();
|
|
4648
|
+
for (const h2 of hands) {
|
|
4649
|
+
const x2 = (1 - h2.cursor.x) * rect.width;
|
|
4650
|
+
const y2 = h2.cursor.y * rect.height;
|
|
4651
|
+
this.ctx.beginPath();
|
|
4652
|
+
this.ctx.arc(x2 * dpr, y2 * dpr, (h2.pinching ? 14 : 9) * dpr, 0, Math.PI * 2);
|
|
4653
|
+
this.ctx.fillStyle = handColor(h2.handedness, h2.pinching);
|
|
4654
|
+
this.ctx.globalAlpha = 0.85;
|
|
4655
|
+
this.ctx.fill();
|
|
4656
|
+
this.ctx.globalAlpha = 1;
|
|
4657
|
+
}
|
|
4658
|
+
if (this.running && this.grabs.size === 0 && this.taps.size === 0) {
|
|
4659
|
+
this.status.textContent = `on \xB7 ${fps}fps`;
|
|
4660
|
+
}
|
|
4661
|
+
}
|
|
4662
|
+
flash(msg) {
|
|
4663
|
+
this.status.textContent = msg;
|
|
4664
|
+
}
|
|
4665
|
+
sizeCanvas() {
|
|
4666
|
+
const dpr = window.devicePixelRatio || 1;
|
|
4667
|
+
this.canvas.width = Math.floor(window.innerWidth * dpr);
|
|
4668
|
+
this.canvas.height = Math.floor(window.innerHeight * dpr);
|
|
4669
|
+
}
|
|
4670
|
+
};
|
|
4671
|
+
function el(tag, className) {
|
|
4672
|
+
const node = document.createElement(tag);
|
|
4673
|
+
node.className = className;
|
|
4674
|
+
return node;
|
|
4675
|
+
}
|
|
4676
|
+
function describeError(err) {
|
|
4677
|
+
if (err instanceof Error) return err.message || err.name || "Error";
|
|
4678
|
+
if (typeof err === "string") return err;
|
|
4679
|
+
if (typeof err === "number") return `code ${err}`;
|
|
4680
|
+
if (err && typeof err === "object") {
|
|
4681
|
+
const m2 = err.message;
|
|
4682
|
+
if (typeof m2 === "string" && m2) return m2;
|
|
4683
|
+
try {
|
|
4684
|
+
return JSON.stringify(err);
|
|
4685
|
+
} catch {
|
|
4686
|
+
return Object.prototype.toString.call(err);
|
|
4687
|
+
}
|
|
4688
|
+
}
|
|
4689
|
+
return String(err);
|
|
4690
|
+
}
|
|
4691
|
+
function injectStyles() {
|
|
4692
|
+
if (document.getElementById("cg-styles")) return;
|
|
4693
|
+
const css = `
|
|
4694
|
+
.cg-surface, .cg-canvas { position: fixed; inset: 0; pointer-events: none; }
|
|
4695
|
+
.cg-surface { z-index: ${Z2}; }
|
|
4696
|
+
.cg-canvas { z-index: ${Z2 + 1}; width: 100vw; height: 100vh; }
|
|
4697
|
+
.cg-preview { transform: scaleX(-1); pointer-events: none; background: #000; }
|
|
4698
|
+
.cg-preview.cg-pip {
|
|
4699
|
+
position: fixed; right: 12px; bottom: 12px; width: 240px; height: 135px;
|
|
4700
|
+
object-fit: cover; border-radius: 8px; z-index: ${Z2 + 2};
|
|
4701
|
+
box-shadow: 0 4px 16px rgba(0,0,0,.5); opacity: 1;
|
|
4702
|
+
}
|
|
4703
|
+
.cg-preview.cg-full {
|
|
4704
|
+
position: fixed; inset: 0; width: 100vw; height: 100vh;
|
|
4705
|
+
object-fit: cover; opacity: .28; z-index: ${Z2};
|
|
4706
|
+
}
|
|
4707
|
+
.cg-ghost {
|
|
4708
|
+
position: fixed; left: 0; top: 0; transform: translate(-50%, -50%) scale(1.06);
|
|
4709
|
+
z-index: ${Z2 + 2}; pointer-events: none; opacity: .92;
|
|
4710
|
+
box-shadow: 0 8px 28px rgba(0,0,0,.55); border-radius: 8px;
|
|
4711
|
+
outline: 2px solid #38bdf8; outline-offset: -2px;
|
|
4712
|
+
}
|
|
4713
|
+
.cg-ghost.cg-armed { outline-color: #4ade80; box-shadow: 0 8px 28px rgba(74,222,128,.5); }
|
|
4714
|
+
.cg-dock {
|
|
4715
|
+
position: fixed; right: 12px; bottom: 156px; z-index: ${Z2 + 3};
|
|
4716
|
+
display: flex; align-items: center; gap: 8px; font: 12px/1 system-ui, sans-serif;
|
|
4717
|
+
}
|
|
4718
|
+
.cg-btn {
|
|
4719
|
+
padding: 6px 12px; border-radius: 6px; border: 1px solid #3a3a40;
|
|
4720
|
+
background: #1b1b1f; color: #e5e5e7; cursor: pointer;
|
|
4721
|
+
}
|
|
4722
|
+
.cg-btn-icon { padding: 6px 9px; }
|
|
4723
|
+
.cg-btn.on { background: #16331f; border-color: #2f6b41; color: #4ade80; }
|
|
4724
|
+
.cg-status { color: #9aa0a6; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
4725
|
+
.session-tab.cg-grabbed { opacity: .35; outline: 2px dashed #4ade80; outline-offset: -2px; }
|
|
4726
|
+
.cg-tap-armed { outline: 2px solid #4ade80 !important; outline-offset: 2px; box-shadow: 0 0 0 4px rgba(74,222,128,.25) !important; }
|
|
4727
|
+
`;
|
|
4728
|
+
const style = document.createElement("style");
|
|
4729
|
+
style.id = "cg-styles";
|
|
4730
|
+
style.textContent = css;
|
|
4731
|
+
document.head.append(style);
|
|
4732
|
+
}
|
|
4733
|
+
if (!window.__codemanGesture) {
|
|
4734
|
+
window.__codemanGesture = new GestureBridge();
|
|
4735
|
+
}
|