@alfadocs/ui-kit-debug 0.72.1 → 0.72.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/_chunks/{face-scheme-DruX4mca.js → face-scheme-BT9_KdL0.js} +77 -77
- package/dist/_chunks/face-scheme-BT9_KdL0.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/_chunks/face-scheme-DruX4mca.js.map +0 -1
|
@@ -258,14 +258,14 @@ async function Gt(t, n) {
|
|
|
258
258
|
}
|
|
259
259
|
return R.length >= 3 ? R : null;
|
|
260
260
|
}
|
|
261
|
-
const Jt = "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.2/dist/ort.min.mjs", Qt = "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.2/dist/", L = 640,
|
|
261
|
+
const Jt = "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.2/dist/ort.min.mjs", Qt = "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.2/dist/", L = 640, en = [8, 16, 32], tn = [
|
|
262
262
|
"right-eye",
|
|
263
263
|
"left-eye",
|
|
264
264
|
"nose-tip",
|
|
265
265
|
"mouth-right",
|
|
266
266
|
"mouth-left"
|
|
267
267
|
], Oe = /* @__PURE__ */ new Map();
|
|
268
|
-
async function
|
|
268
|
+
async function nn(t, n, c, o) {
|
|
269
269
|
const d = `${t}|${n}|${c}`, s = Oe.get(d);
|
|
270
270
|
if (s) return s;
|
|
271
271
|
o == null || o("loading");
|
|
@@ -282,14 +282,14 @@ async function n1(t, n, c, o) {
|
|
|
282
282
|
})();
|
|
283
283
|
return Oe.set(d, u), u.catch(() => Oe.delete(d)), u;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function rn(t) {
|
|
286
286
|
const n = new Image();
|
|
287
287
|
return n.crossOrigin = "anonymous", n.src = t, n.decode().then(() => n);
|
|
288
288
|
}
|
|
289
|
-
async function
|
|
289
|
+
async function an() {
|
|
290
290
|
return (await import("./face_detection_yunet_2023mar-BnsRs4bD.js")).default;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function sn(t, n) {
|
|
293
293
|
const c = n.naturalWidth || n.width, o = n.naturalHeight || n.height, d = Math.min(L / c, L / o), s = Math.round(c * d), u = Math.round(o * d), l = Math.floor((L - s) / 2), f = Math.floor((L - u) / 2), m = document.createElement("canvas");
|
|
294
294
|
m.width = L, m.height = L;
|
|
295
295
|
const w = m.getContext("2d");
|
|
@@ -306,7 +306,7 @@ function i1(t, n) {
|
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
const rt = (t) => 1 / (1 + Math.exp(-t));
|
|
309
|
-
function
|
|
309
|
+
function cn(t, n) {
|
|
310
310
|
let c = !1;
|
|
311
311
|
const o = t.cls_8.data;
|
|
312
312
|
for (let s = 0; s < Math.min(o.length, 256); s++)
|
|
@@ -315,7 +315,7 @@ function s1(t, n) {
|
|
|
315
315
|
break;
|
|
316
316
|
}
|
|
317
317
|
let d = null;
|
|
318
|
-
for (const s of
|
|
318
|
+
for (const s of en) {
|
|
319
319
|
const u = t[`cls_${s}`].data, l = t[`obj_${s}`].data, f = t[`kps_${s}`].data, m = L / s, w = L / s, x = m * w;
|
|
320
320
|
for (let y = 0; y < x; y++) {
|
|
321
321
|
let C = u[y], p = l[y];
|
|
@@ -333,7 +333,7 @@ function s1(t, n) {
|
|
|
333
333
|
}
|
|
334
334
|
return d;
|
|
335
335
|
}
|
|
336
|
-
async function
|
|
336
|
+
async function on(t, n) {
|
|
337
337
|
if (typeof window > "u" || typeof Image > "u")
|
|
338
338
|
throw new Error("detectFaceYuNet runs in the browser only.");
|
|
339
339
|
const {
|
|
@@ -341,21 +341,21 @@ async function c1(t, n) {
|
|
|
341
341
|
viewHeight: o,
|
|
342
342
|
ortModuleUrl: d = Jt,
|
|
343
343
|
ortWasmBaseUrl: s = Qt,
|
|
344
|
-
modelUrl: u = await
|
|
344
|
+
modelUrl: u = await an(),
|
|
345
345
|
scoreThreshold: l = 0.6,
|
|
346
346
|
onStage: f
|
|
347
347
|
} = n, [m, { ort: w, session: x }] = await Promise.all([
|
|
348
|
-
|
|
349
|
-
|
|
348
|
+
rn(t),
|
|
349
|
+
nn(d, s, u, f)
|
|
350
350
|
]);
|
|
351
351
|
f == null || f("detecting");
|
|
352
|
-
const { tensor: y, scale: C, padX: p, padY: N } =
|
|
352
|
+
const { tensor: y, scale: C, padX: p, padY: N } = sn(w.Tensor, m), z = await x.run({ [x.inputNames[0]]: y }), K = cn(z, l);
|
|
353
353
|
if (!K) return null;
|
|
354
354
|
const R = m.naturalWidth || m.width, E = m.naturalHeight || m.height, I = Math.max(c / R, o / E), Z = (c - R * I) / 2, V = (o - E * I) / 2;
|
|
355
355
|
return K.keypoints.map(([D, q], Y) => {
|
|
356
356
|
const h = (D - p) / C, ce = (q - N) / C;
|
|
357
357
|
return {
|
|
358
|
-
id:
|
|
358
|
+
id: tn[Y],
|
|
359
359
|
photo: {
|
|
360
360
|
x: Z + h * I,
|
|
361
361
|
y: V + ce * I
|
|
@@ -367,7 +367,7 @@ const je = "0 0 808 944", $e = { x: 404, y: 472 }, ut = {
|
|
|
367
367
|
id: "faceContour",
|
|
368
368
|
labelKey: "faceContour",
|
|
369
369
|
d: "M688.38,439.4c-9.78,0-15.37,4.04-17.86,6.47,1.31-10.99,2.5-20.62,3.49-28.2,7.55-57.89,5.03-94.39,5.03-94.39-15.15-165.92-111.73-221.46-186.21-239.39h0s-.1-.02-.1-.02c-6.18-1.49-12.21-2.72-18.02-3.73l-.96-.2c-46.02-9.51-93.5-9.51-139.52,0l-.95.2c-5.82,1.01-11.85,2.24-18.04,3.73l-.08.02h0c-74.48,17.94-171.06,73.48-186.21,239.39,0,0-2.52,36.5,5.03,94.39,1,7.68,2.2,17.45,3.53,28.61-2.25-2.35-7.91-6.88-18.26-6.88-13.97,0-29.06,16.21-20.12,63.71,8.94,47.5,17.3,80.48,18.43,97.24,1.11,16.47,24.08,47.91,41.43,38.23.9,8.33,1.42,13.17,1.42,13.17,0,0,8.81,59.15,56.63,104.46,12.62,11.95,25.84,23.46,38.49,33.94,7.14-4.56,24-16.96,29.06-35.21.9-3.24,1.73-6.33,2.52-9.29,2.46-9.17,4.59-17.1,7.4-24.46,3.44-9.01,7.62-16.28,13.25-23.04-47.54-46.57-49.82-89.3-48.75-104.93-21.75-2.47-38.06-19.4-47.37-49.37-7.27-23.39-7.77-46.39-7.79-47.36-.02-1.34.43-2.57,1.21-3.54-.47-2.21-.65-3.58-.67-3.77-.28-2.23.97-4.38,3.05-5.24.34-.14.69-.23,1.04-.29.47-3.26,2.23-10.86,8.8-18.21,10.82-12.11,28.95-17.92,53.93-17.22,41.5,1.13,55.11,17.49,59.58,28.15,1.45.85,2.49,2.34,2.68,4.14,0,.05.02.21.05.45.22.48.36,1,.42,1.56.04.41.34,3.71.16,8.68.17,6.11.1,14.39-.75,23.68-.27,2.9-.6,5.73-.98,8.49,4.1-9.94,7.68-20.29,11.15-30.32l.31-.89-10.84-54.18c-2.15-3.39-8.76-12.5-21.75-19.51-21.63-11.68-51.16-12.3-85.4-1.8-2.58.79-5.32-.61-6.19-3.16l-53.03-154.45c-.88-1.09-1.31-2.52-1.05-4.01.26-1.43,6.68-35.35,39.46-69.52,19.15-19.96,43.37-35.84,72.01-47.21,35.3-14.02,77.45-21.18,125.28-21.27h0s.98,0,.98,0c47.83.1,89.98,7.25,125.28,21.27,28.63,11.37,52.86,27.26,72.01,47.21,30.62,31.92,38.24,63.61,39.32,68.82.29.8.42,1.35.47,1.59.17.87.11,1.77-.17,2.61l-53.21,154.96c-.88,2.55-3.62,3.95-6.19,3.16-34.24-10.5-63.77-9.88-85.4,1.8-11.42,6.17-17.92,13.96-20.78,18.06l-11.25,56.25.04.11c2.95,8.52,5.98,17.28,9.34,25.81-.14-1.26-.28-2.53-.4-3.82-.53-5.79-.75-11.19-.81-15.92-1.11-9.09-.51-15.85-.45-16.44.11-1.1.59-2.08,1.3-2.85.19-.72.52-1.37.96-1.94,3.86-10.54,16.77-28.3,60.04-29.48,24.93-.69,43.04,5.1,53.85,17.2,6.53,7.3,8.3,14.85,8.78,18.13.53.04,1.05.16,1.56.37,2.08.86,3.32,3.01,3.05,5.24-.02.14-.12.93-.37,2.25,1.7.96,2.84,2.8,2.8,4.89-.02.97-.52,23.97-7.79,47.36-8.99,28.91-24.49,45.69-45.11,49.05,1.16,15.29-.68,58.78-49.42,106.1,5.35,6.56,9.36,13.63,12.68,22.33,2.81,7.36,4.94,15.28,7.4,24.45.79,2.96,1.62,6.05,2.52,9.29,5.07,18.28,21.97,30.69,29.09,35.23,12.65-10.48,25.88-21.99,38.5-33.95,47.82-45.31,56.63-104.46,56.63-104.46,0,0,.51-4.77,1.4-13,17.31,9.1,39.99-22.04,41.09-38.41,1.13-16.77,9.49-49.74,18.43-97.24,8.94-47.5-6.15-63.71-20.12-63.71Z"
|
|
370
|
-
},
|
|
370
|
+
}, dn = [
|
|
371
371
|
{
|
|
372
372
|
id: "lateralNeckRight",
|
|
373
373
|
labelKey: "lateralNeckRight",
|
|
@@ -544,7 +544,7 @@ const je = "0 0 808 944", $e = { x: 404, y: 472 }, ut = {
|
|
|
544
544
|
cy: 487,
|
|
545
545
|
side: "left"
|
|
546
546
|
}
|
|
547
|
-
],
|
|
547
|
+
], ln = [
|
|
548
548
|
{ id: "right-eye", labelKey: "rightEye", x: 268, y: 487 },
|
|
549
549
|
{ id: "left-eye", labelKey: "leftEye", x: 535, y: 487 },
|
|
550
550
|
{ id: "nose-tip", labelKey: "noseTip", x: 403, y: 620 },
|
|
@@ -553,72 +553,72 @@ const je = "0 0 808 944", $e = { x: 404, y: 472 }, ut = {
|
|
|
553
553
|
{
|
|
554
554
|
id: "cheekbone",
|
|
555
555
|
labelKey: "cheekbone",
|
|
556
|
-
d: "
|
|
557
|
-
cx:
|
|
558
|
-
cy:
|
|
556
|
+
d: "M587.86 415.87C586.01 408.8 583.79 409.02 576.91 410.15C573.08 410.38 567.86 410.32 561.24 408.36C547.07 403.39 488.66 358.5 465.97 345.98C436.12 334.42 407.31 328.09 390.38 326.48C395.19 331.07 399.27 338.58 388.69 345.72C397.48 346.49 408.73 348.34 421.39 351.61C467.3 374.36 523.12 420.78 541.55 435.68C550.62 443.21 555.39 449.39 559.11 454.28C564.66 461.73 567.89 466.16 579.26 467.46C583.31 467.67 586.22 465.29 588.19 460.34C591.18 452.28 592.1 431.43 587.86 415.88Z",
|
|
557
|
+
cx: 490,
|
|
558
|
+
cy: 397
|
|
559
559
|
},
|
|
560
560
|
{
|
|
561
561
|
id: "profileContour",
|
|
562
562
|
labelKey: "profileContour",
|
|
563
|
-
d: "
|
|
564
|
-
cx:
|
|
565
|
-
cy:
|
|
563
|
+
d: "M657.04 427.15C645.32 417.42 612.92 377.67 608.47 342.76C610.05 315.91 614.77 299.37 606.91 241.79C600.19 175.54 556.62 116.74 420.63 130.08C253.44 160.79 152.79 273.93 132.98 380.57C116.36 516.03 182.43 589.12 182.43 589.12L226.57 641.41C234.86 650.15 249.78 644.43 261.09 627.35L321.54 525.13C328.57 512.58 325.7 495.54 318.17 493.61C294.63 488.83 257.86 468.83 262.84 409.94C267.69 380.06 284 357.04 302.38 340.78C330.2 319.79 367.62 311.97 382.74 320.74C382.87 320.84 382.94 320.94 382.99 321.04C388.82 321.28 405.44 322.73 426.75 326.43C424.09 323.46 422.53 319.98 422.13 315.98C421.41 309.9 423.49 304.51 423.88 303.54C426.23 284.75 477.87 242.7 506.61 211.31L506.84 210.99C508.32 208.89 511.62 207.65 515.45 207.77C519.23 207.92 522.88 209.42 524.98 211.72L567.11 326.31C568.13 330.65 567.2 335.05 564.76 336.69C563.35 337.54 561.24 339.5 558.91 342.14C559.06 342.41 559.15 342.57 559.15 342.57L573.97 372.38C575.71 369.67 578.22 365.84 581.33 362.37C585.49 356.14 590.79 348.98 597.61 352.24C598.15 352.43 598.76 354.7 598.84 357.08C598.91 358.84 598.59 359.88 598.14 359.69C597.37 359.38 596.65 359.2 595.96 359.12C597.33 369.53 600.96 398.18 595.38 398C588.92 397.38 587.72 374.56 588.46 362.31C586.69 363.79 584.85 365.85 582.96 368.5C580.04 371.85 577.73 375.59 576.26 377.97L577.27 380.55C577.56 381.29 577.66 382.22 577.55 383.11C577.43 384 577.11 384.76 576.66 385.24L553.04 396.96C558.13 400.5 560.86 401.88 562.35 402.34C568.32 404.04 572.97 404.02 576.7 403.74C583.09 402.53 587.8 400.9 590.94 412.75C594.16 424.28 596.78 449.29 591.87 464.27C589.18 471.56 584.78 475.46 579.05 475.22C575.99 474.97 573.36 474.4 571.04 473.57C567.75 472.35 565.15 470.69 562.9 468.71C562.88 472.1 562.76 476.4 562.38 481.46C567.8 483.15 578.56 487.63 584.78 500.94C588.58 509.77 589.68 521.45 587.53 535.74C590.03 539.27 597.49 548.85 608.32 547.11C615.16 544.28 621.37 543.88 625.6 545.18C627.13 536.84 628.35 525.82 627.96 516.71C626.08 501.81 623.74 494.92 625.48 485.82C627.82 477.03 640.49 466.24 651.72 451.57C662.37 438.81 663.39 438.52 657.07 427.15Z",
|
|
564
|
+
cx: 390,
|
|
565
|
+
cy: 383
|
|
566
566
|
},
|
|
567
567
|
{
|
|
568
568
|
id: "temple",
|
|
569
569
|
labelKey: "temple",
|
|
570
|
-
d: "
|
|
571
|
-
cx:
|
|
572
|
-
cy:
|
|
570
|
+
d: "M551.29 339.27C551.73 338.72 552.17 338.34 552.62 338.11C556.19 334.28 559.65 331.21 562.14 329.85C562.68 329.54 562.9 328.65 562.67 327.75L518.07 213.95C517.55 213.37 516.78 213.26 516.36 213.24C515.95 213.22 515.19 213.27 514.81 213.81L514.57 214.13C507.63 223.01 490.31 241.35 473.08 259.55C456.86 274.15 435.38 293.06 434.06 303.22L434.04 303.36L433.97 303.51C433.88 303.72 424.42 324.26 448.09 332.54C448.37 332.66 448.62 332.79 448.84 332.93C456.22 335.74 463.82 338.97 471.46 342.54C502.66 360.75 523.25 375.04 536.66 384.85C535.73 382.31 534.95 379.47 534.57 376.45C533.66 370.15 534.7 364.78 536.86 360.11C539.61 349.89 545.41 345.33 549.41 341.41C549.46 341.36 549.51 341.3 549.56 341.25C550.19 340.57 550.77 339.92 551.29 339.26Z",
|
|
571
|
+
cx: 494,
|
|
572
|
+
cy: 299
|
|
573
573
|
},
|
|
574
574
|
{
|
|
575
575
|
id: "preauricularArea",
|
|
576
576
|
labelKey: "preauricularArea",
|
|
577
|
-
d: "
|
|
578
|
-
cx:
|
|
579
|
-
cy:
|
|
577
|
+
d: "M399.04 423.47C400.19 426.46 399.28 429.83 397.03 431.07L421.24 493.26C429.33 496.6 440.56 504.27 451.47 519.28C455.98 526.45 460.47 535.45 464.49 546.37C473.34 527.06 479.06 492.31 479.5 447.01C480.52 417.95 479.02 394.87 478.75 390.28C457.75 375.55 435.02 362.96 415.32 355.59C403.76 352.86 393.4 351.38 385.05 350.82C383.53 355.04 382.54 362.85 384.93 378.19C389.1 396.84 398.92 423.16 399.04 423.46Z",
|
|
578
|
+
cx: 432,
|
|
579
|
+
cy: 449
|
|
580
580
|
},
|
|
581
581
|
{
|
|
582
582
|
id: "mandibularBody",
|
|
583
583
|
labelKey: "mandibularBody",
|
|
584
|
-
d: "
|
|
585
|
-
cx:
|
|
586
|
-
cy:
|
|
584
|
+
d: "M448.9 529.33C441.36 518.39 433.39 511.79 426.69 508.14L444.05 565.22L444.11 565.55C444.61 568.53 446.18 612.75 465.58 621.58C467.31 622.11 469.2 622.59 471.21 623.04C472.27 587.41 463.32 555.13 448.9 529.33Z",
|
|
585
|
+
cx: 449,
|
|
586
|
+
cy: 566
|
|
587
587
|
},
|
|
588
588
|
{
|
|
589
589
|
id: "submentalProfile",
|
|
590
590
|
labelKey: "submentalProfile",
|
|
591
|
-
d: "
|
|
592
|
-
cx:
|
|
593
|
-
cy:
|
|
591
|
+
d: "M499.51 624.48C500.22 624.28 501.01 624.05 501.85 623.78C506.95 622.1 508.34 617.25 499.33 608.72C499.3 608.71 499.28 608.69 499.25 608.67C498.87 608.43 498.48 608.2 498.08 607.95C489.61 603.09 481.6 597.71 477.16 594.66C477.83 603.57 477.42 613.28 475.61 623.94C494.7 628.41 483.66 636.08 483.66 636.08C483.66 636.08 476.69 649.28 527.7 627.3C518.99 627.63 510.52 627.34 503.56 626.55C496.4 626.16 495.89 625.71 499.5 624.48Z",
|
|
592
|
+
cx: 502,
|
|
593
|
+
cy: 622
|
|
594
594
|
},
|
|
595
595
|
{
|
|
596
596
|
id: "masseter",
|
|
597
597
|
labelKey: "masseter",
|
|
598
|
-
d: "M554.
|
|
599
|
-
cx:
|
|
600
|
-
cy:
|
|
598
|
+
d: "M554.71 459.19C550.92 454.22 546.49 448.51 537.91 441.39C528.42 433.63 510.52 417.13 488.4 397.93C489.3 421.03 491.75 514.66 467.63 555.34C470.6 563.87 473.34 573.19 475.46 583.39C476.18 582.97 476.93 582.94 477.54 583.4C477.77 583.56 487.55 590.84 499.76 598.04C530.58 563.84 546.09 529.73 552.28 505.65C557.13 483.51 556.81 466.48 556.58 461.68C555.96 460.87 555.34 460.04 554.7 459.2Z",
|
|
599
|
+
cx: 512,
|
|
600
|
+
cy: 498
|
|
601
601
|
},
|
|
602
602
|
{
|
|
603
603
|
id: "cheek",
|
|
604
604
|
labelKey: "cheek",
|
|
605
|
-
d: "
|
|
606
|
-
cx:
|
|
607
|
-
cy:
|
|
605
|
+
d: "M503.7 600.29L503.69 600.76C506.68 599.48 519.15 594.49 532.76 586.74C551.63 579.2 568.84 567.08 579.23 546.08C584.39 529.37 584.46 515.84 580.48 506.25C575.46 495.21 566.3 491.13 561.55 489.57C560.86 495.06 559.83 501.15 558.34 507.68C551.78 532.36 535.25 566.52 503.69 600.3Z",
|
|
606
|
+
cx: 544,
|
|
607
|
+
cy: 545
|
|
608
608
|
},
|
|
609
609
|
{
|
|
610
610
|
id: "chin",
|
|
611
611
|
labelKey: "chin",
|
|
612
|
-
d: "
|
|
613
|
-
cx:
|
|
614
|
-
cy:
|
|
612
|
+
d: "M622.37 557.72C618.53 556.38 613.08 555.94 606.76 557.59C595.83 558.3 588.65 550.46 584.99 545.44C584.69 546.34 584.38 547.24 584.03 548.15C571.22 572.11 550.01 585.32 530.6 593C522.53 597.65 514.89 601.46 509.24 604.26C515.21 610.11 514.33 615.81 510.02 618.18C502.34 623.58 523.79 624.61 543.95 623.09C547.34 622.17 550.83 621.19 554.45 620.12L594.99 602.7L595.21 602.54C596.13 601.8 602.57 595.37 608.29 593.49C613.07 590.42 621.01 568.35 622.15 559.26C622.19 558.76 622.27 558.26 622.36 557.75Z",
|
|
613
|
+
cx: 562,
|
|
614
|
+
cy: 585
|
|
615
615
|
},
|
|
616
616
|
{
|
|
617
617
|
id: "browTail",
|
|
618
618
|
labelKey: "browTail",
|
|
619
|
-
d: "
|
|
620
|
-
cx:
|
|
621
|
-
cy:
|
|
619
|
+
d: "M555.64 346.57C555.64 346.57 530.25 360.36 547.29 391.38L572.95 381.28L555.64 346.57Z",
|
|
620
|
+
cx: 552,
|
|
621
|
+
cy: 369
|
|
622
622
|
}
|
|
623
623
|
], at = mt.find((t) => t.id === "profileContour") ?? ut, it = mt.filter(
|
|
624
624
|
(t) => t.id !== "profileContour"
|
|
@@ -641,8 +641,8 @@ const je = "0 0 808 944", $e = { x: 404, y: 472 }, ut = {
|
|
|
641
641
|
pivot: $e,
|
|
642
642
|
contour: ut,
|
|
643
643
|
// The generator guarantees every clickable zone carries cx/cy/side.
|
|
644
|
-
zones:
|
|
645
|
-
landmarks:
|
|
644
|
+
zones: dn,
|
|
645
|
+
landmarks: ln
|
|
646
646
|
},
|
|
647
647
|
// The reshaped profile zones face +x; the right profile is the same mesh
|
|
648
648
|
// mirrored. Both fit on the eye/nose-tip/mouth anchors — auto-detect and manual
|
|
@@ -670,7 +670,7 @@ const je = "0 0 808 944", $e = { x: 404, y: 472 }, ut = {
|
|
|
670
670
|
"front",
|
|
671
671
|
"profile-left",
|
|
672
672
|
"profile-right"
|
|
673
|
-
],
|
|
673
|
+
], fn = [
|
|
674
674
|
"observation",
|
|
675
675
|
"treatment",
|
|
676
676
|
"concern",
|
|
@@ -691,11 +691,11 @@ function ze(t, n) {
|
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
693
|
const xe = Math.PI / 180;
|
|
694
|
-
function
|
|
694
|
+
function un(t, n) {
|
|
695
695
|
const c = t.rotation * xe, o = Math.cos(c), d = Math.sin(c), s = Math.tan(t.shear * xe), u = t.scaleX * o, l = t.scaleX * d, f = t.scaleY * (s * o - d), m = t.scaleY * (s * d + o), w = t.translateX + n.x - (u * n.x + f * n.y), x = t.translateY + n.y - (l * n.x + m * n.y);
|
|
696
696
|
return [u, l, f, m, w, x];
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function mn(t, n) {
|
|
699
699
|
const [c, o, d, s, u, l] = t, f = Math.hypot(c, o), m = Math.atan2(o, c) / xe, w = c * s - o * d, x = f === 0 ? 0 : w / f, y = Math.atan2(c * d + o * s, w) / xe, C = u - n.x + (c * n.x + d * n.y), p = l - n.y + (o * n.x + s * n.y);
|
|
700
700
|
return { scaleX: f, scaleY: x, rotation: m, shear: y, translateX: C, translateY: p };
|
|
701
701
|
}
|
|
@@ -716,7 +716,7 @@ function ft(t, n) {
|
|
|
716
716
|
], [V, D, q] = Z(f, m, w), [Y, h, ce] = Z(x, y, C);
|
|
717
717
|
return [V, Y, D, h, q, ce];
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function hn(t) {
|
|
720
720
|
const n = (f) => {
|
|
721
721
|
var m;
|
|
722
722
|
return (m = t.find((w) => w.id === f)) == null ? void 0 : m.photo;
|
|
@@ -729,27 +729,27 @@ function m1(t) {
|
|
|
729
729
|
{ id: "mouth", photo: l(s, u) }
|
|
730
730
|
];
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function pn() {
|
|
733
733
|
return typeof navigator < "u" && typeof navigator.mediaDevices < "u" && typeof navigator.mediaDevices.getUserMedia == "function";
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function gn(t) {
|
|
736
736
|
const n = t instanceof Error ? t.name : "";
|
|
737
737
|
return n === "NotAllowedError" || n === "SecurityError" ? "permission-denied" : n === "NotFoundError" || n === "OverconstrainedError" ? "no-camera" : n === "NotReadableError" || n === "AbortError" ? "not-readable" : "capture-failed";
|
|
738
738
|
}
|
|
739
|
-
const
|
|
739
|
+
const yn = {
|
|
740
740
|
"permission-denied": "faceScheme.capture.error.permissionDenied",
|
|
741
741
|
"no-camera": "faceScheme.capture.error.noCamera",
|
|
742
742
|
"not-readable": "faceScheme.capture.error.notReadable",
|
|
743
743
|
"insecure-context": "faceScheme.capture.error.insecureContext",
|
|
744
744
|
"capture-failed": "faceScheme.capture.error.captureFailed"
|
|
745
|
-
},
|
|
745
|
+
}, vn = {
|
|
746
746
|
neutral: "ds:[fill:var(--muted-foreground)]",
|
|
747
747
|
info: "ds:[fill:var(--info)]",
|
|
748
748
|
success: "ds:[fill:var(--success)]",
|
|
749
749
|
warning: "ds:[fill:var(--warning)]",
|
|
750
750
|
error: "ds:[fill:var(--destructive)]",
|
|
751
751
|
accent: "ds:[fill:var(--accent)]"
|
|
752
|
-
},
|
|
752
|
+
}, xn = It(
|
|
753
753
|
[
|
|
754
754
|
"ds:[vector-effect:non-scaling-stroke]",
|
|
755
755
|
"ds:transition-[fill-opacity] ds:[transition-duration:var(--animation-duration)]",
|
|
@@ -773,21 +773,21 @@ const g1 = {
|
|
|
773
773
|
],
|
|
774
774
|
defaultVariants: { interactive: !1, marked: !1 }
|
|
775
775
|
}
|
|
776
|
-
),
|
|
776
|
+
), Cn = {
|
|
777
777
|
scaleX: { min: 0.3, max: 1.8, step: 0.01 },
|
|
778
778
|
scaleY: { min: 0.3, max: 1.8, step: 0.01 },
|
|
779
779
|
rotation: { min: -20, max: 20, step: 0.5 },
|
|
780
780
|
shear: { min: -20, max: 20, step: 0.5 },
|
|
781
781
|
translateX: { min: -240, max: 240, step: 1 },
|
|
782
782
|
translateY: { min: -240, max: 240, step: 1 }
|
|
783
|
-
},
|
|
783
|
+
}, bn = [
|
|
784
784
|
"scaleX",
|
|
785
785
|
"scaleY",
|
|
786
786
|
"rotation",
|
|
787
787
|
"shear",
|
|
788
788
|
"translateX",
|
|
789
789
|
"translateY"
|
|
790
|
-
],
|
|
790
|
+
], wn = At(
|
|
791
791
|
({
|
|
792
792
|
id: t,
|
|
793
793
|
patientPhoto: n,
|
|
@@ -866,7 +866,7 @@ const g1 = {
|
|
|
866
866
|
},
|
|
867
867
|
[Se, N, A]
|
|
868
868
|
), Re = nt(
|
|
869
|
-
() =>
|
|
869
|
+
() => mn(P, b.pivot),
|
|
870
870
|
[P, b.pivot]
|
|
871
871
|
), H = k(
|
|
872
872
|
(e) => b.mirror ? { x: B - e.x, y: e.y } : e,
|
|
@@ -930,7 +930,7 @@ const g1 = {
|
|
|
930
930
|
}, [ne]), Fe = k(async () => {
|
|
931
931
|
var e;
|
|
932
932
|
if (E) {
|
|
933
|
-
if (!
|
|
933
|
+
if (!pn()) {
|
|
934
934
|
te("insecure-context"), W("error");
|
|
935
935
|
return;
|
|
936
936
|
}
|
|
@@ -957,7 +957,7 @@ const g1 = {
|
|
|
957
957
|
}
|
|
958
958
|
W("streaming");
|
|
959
959
|
} catch (r) {
|
|
960
|
-
ne(), te(
|
|
960
|
+
ne(), te(gn(r)), W("error");
|
|
961
961
|
}
|
|
962
962
|
}
|
|
963
963
|
}, [E, I, ne]), de = k(
|
|
@@ -1030,7 +1030,7 @@ const g1 = {
|
|
|
1030
1030
|
modelAssetPath: e.modelAssetPath
|
|
1031
1031
|
});
|
|
1032
1032
|
else {
|
|
1033
|
-
const i = await
|
|
1033
|
+
const i = await on($, {
|
|
1034
1034
|
viewWidth: B,
|
|
1035
1035
|
viewHeight: Q,
|
|
1036
1036
|
onStage: r,
|
|
@@ -1038,7 +1038,7 @@ const g1 = {
|
|
|
1038
1038
|
ortWasmBaseUrl: e.ortWasmBaseUrl,
|
|
1039
1039
|
modelUrl: e.yunetModelUrl
|
|
1040
1040
|
});
|
|
1041
|
-
a = i &&
|
|
1041
|
+
a = i && hn(i);
|
|
1042
1042
|
}
|
|
1043
1043
|
return !a || a.length < 3 ? (re("no-face"), !1) : (ge(a), re("done"), !0);
|
|
1044
1044
|
} catch {
|
|
@@ -1111,7 +1111,7 @@ const g1 = {
|
|
|
1111
1111
|
[G, y, We, x]
|
|
1112
1112
|
), Lt = J != null && J.altKey ? h(J.altKey) : h("faceScheme.photo.defaultAlt"), Kt = b.mirror ? `translate(${B} 0) scale(-1 1) ${lt(P)}` : lt(P), Nt = k(
|
|
1113
1113
|
(e, r) => {
|
|
1114
|
-
U(
|
|
1114
|
+
U(un({ ...Re, [e]: r }, b.pivot));
|
|
1115
1115
|
},
|
|
1116
1116
|
[U, Re, b.pivot]
|
|
1117
1117
|
), tt = !!K && !!$ && b.landmarks.length > 0, Ft = E;
|
|
@@ -1221,7 +1221,7 @@ const g1 = {
|
|
|
1221
1221
|
"path",
|
|
1222
1222
|
{
|
|
1223
1223
|
d: e.d,
|
|
1224
|
-
className:
|
|
1224
|
+
className: xn({ interactive: G, marked: a })
|
|
1225
1225
|
}
|
|
1226
1226
|
),
|
|
1227
1227
|
r.map((i, v) => {
|
|
@@ -1236,7 +1236,7 @@ const g1 = {
|
|
|
1236
1236
|
11
|
|
1237
1237
|
),
|
|
1238
1238
|
"aria-hidden": "true",
|
|
1239
|
-
className:
|
|
1239
|
+
className: vn[S.tone]
|
|
1240
1240
|
},
|
|
1241
1241
|
i.type
|
|
1242
1242
|
);
|
|
@@ -1335,7 +1335,7 @@ const g1 = {
|
|
|
1335
1335
|
role: "status",
|
|
1336
1336
|
"aria-live": "polite",
|
|
1337
1337
|
className: "ds:text-center ds:text-[length:var(--font-size-xs)] ds:text-[var(--destructive)] ds:empty:hidden",
|
|
1338
|
-
children: Ke === "error" && qe ? h(
|
|
1338
|
+
children: Ke === "error" && qe ? h(yn[qe]) : ""
|
|
1339
1339
|
}
|
|
1340
1340
|
)
|
|
1341
1341
|
] }),
|
|
@@ -1346,8 +1346,8 @@ const g1 = {
|
|
|
1346
1346
|
"data-testid": "face-scheme-registration",
|
|
1347
1347
|
children: [
|
|
1348
1348
|
/* @__PURE__ */ g("p", { className: "ds:m-0 ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]", children: h("faceScheme.registration.hint") }),
|
|
1349
|
-
/* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-xs)] ds:sm:grid-cols-2", children:
|
|
1350
|
-
const r =
|
|
1349
|
+
/* @__PURE__ */ g("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-xs)] ds:sm:grid-cols-2", children: bn.map((e) => {
|
|
1350
|
+
const r = Cn[e], a = e === "scaleX" || e === "scaleY";
|
|
1351
1351
|
return /* @__PURE__ */ T(
|
|
1352
1352
|
"div",
|
|
1353
1353
|
{
|
|
@@ -1412,7 +1412,7 @@ const g1 = {
|
|
|
1412
1412
|
{
|
|
1413
1413
|
"aria-label": h("faceScheme.legendLabel"),
|
|
1414
1414
|
className: "ds:flex ds:flex-wrap ds:gap-x-4 ds:gap-y-1 ds:p-0 ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]",
|
|
1415
|
-
children:
|
|
1415
|
+
children: fn.map((e) => {
|
|
1416
1416
|
const r = dt[e];
|
|
1417
1417
|
return /* @__PURE__ */ g("li", { className: "ds:flex ds:list-none ds:items-center", children: /* @__PURE__ */ g(
|
|
1418
1418
|
$t,
|
|
@@ -1431,20 +1431,20 @@ const g1 = {
|
|
|
1431
1431
|
);
|
|
1432
1432
|
}
|
|
1433
1433
|
);
|
|
1434
|
-
|
|
1434
|
+
wn.displayName = "FaceScheme";
|
|
1435
1435
|
export {
|
|
1436
1436
|
dt as F,
|
|
1437
1437
|
fe as I,
|
|
1438
|
-
|
|
1438
|
+
fn as a,
|
|
1439
1439
|
ct as b,
|
|
1440
1440
|
ot as c,
|
|
1441
|
-
|
|
1441
|
+
wn as d,
|
|
1442
1442
|
lt as e,
|
|
1443
1443
|
ze as f,
|
|
1444
|
-
|
|
1445
|
-
|
|
1444
|
+
un as g,
|
|
1445
|
+
mn as h,
|
|
1446
1446
|
Gt as i,
|
|
1447
1447
|
Bt as j,
|
|
1448
1448
|
ft as s
|
|
1449
1449
|
};
|
|
1450
|
-
//# sourceMappingURL=face-scheme-
|
|
1450
|
+
//# sourceMappingURL=face-scheme-BT9_KdL0.js.map
|