@richard.fadiora/liveness-detection 3.0.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +146 -120
- package/dist/index.es.js +1487 -1483
- package/dist/index.umd.js +11 -11
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
(function(Ye,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react"),require("react-webcam")):typeof define=="function"&&define.amd?define(["exports","react","react-webcam"],N):(Ye=typeof globalThis<"u"?globalThis:Ye||self,N(Ye.LivenessSDK={},Ye.React,Ye.Webcam))})(this,function(Ye,N,N2){"use strict";var Vt=typeof self<"u"?self:{};function br(e,t){e:{for(var r=["CLOSURE_FLAGS"],n=Vt,s=0;s<r.length;s++)if((n=n[r[s]])==null){r=null;break e}r=n}return(e=r&&r[e])!=null?e:t}function At(){throw Error("Invalid UTF8")}function pi(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let Hr,Mn;const D2=typeof TextDecoder<"u";let j2;const B2=typeof TextEncoder<"u";function gi(e){if(B2)e=(j2||(j2=new TextEncoder)).encode(e);else{let r=0;const n=new Uint8Array(3*e.length);for(let s=0;s<e.length;s++){var t=e.charCodeAt(s);if(t<128)n[r++]=t;else{if(t<2048)n[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&s<e.length){const i=e.charCodeAt(++s);if(i>=56320&&i<=57343){t=1024*(t-55296)+i-56320+65536,n[r++]=t>>18|240,n[r++]=t>>12&63|128,n[r++]=t>>6&63|128,n[r++]=63&t|128;continue}s--}t=65533}n[r++]=t>>12|224,n[r++]=t>>6&63|128}n[r++]=63&t|128}}e=r===n.length?n:n.subarray(0,r)}return e}function mi(e){Vt.setTimeout(()=>{throw e},0)}var In,U2=br(610401301,!1),vi=br(748402147,!0),Cn=br(824648567,!0),Nn=br(824656860,br(1,!0));function yi(){var e=Vt.navigator;return e&&(e=e.userAgent)?e:""}const _i=Vt.navigator;function Kr(e){return Kr[" "](e),e}In=_i&&_i.userAgentData||null,Kr[" "]=function(){};const bi={};let wr=null;function V2(e){const t=e.length;let r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);const n=new Uint8Array(r);let s=0;return function(i,o){function c(f){for(;u<i.length;){const h=i.charAt(u++),d=wr[h];if(d!=null)return d;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return f}wi();let u=0;for(;;){const f=c(-1),h=c(0),d=c(64),b=c(64);if(b===64&&f===-1)break;o(f<<2|h>>4),d!=64&&(o(h<<4&240|d>>2),b!=64&&o(d<<6&192|b))}}(e,function(i){n[s++]=i}),s!==r?n.subarray(0,s):n}function wi(){if(!wr){wr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){const n=e.concat(t[r].split(""));bi[r]=n;for(let s=0;s<n.length;s++){const i=n[s];wr[i]===void 0&&(wr[i]=s)}}}}var G2=typeof Uint8Array<"u",Ei=!(!(U2&&In&&In.brands.length>0)&&(yi().indexOf("Trident")!=-1||yi().indexOf("MSIE")!=-1))&&typeof btoa=="function";const Ai=/[-_.]/g,W2={"-":"+",_:"/",".":"="};function H2(e){return W2[e]||""}function ki(e){if(!Ei)return V2(e);e=Ai.test(e)?e.replace(Ai,H2):e,e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function Dn(e){return G2&&e!=null&&e instanceof Uint8Array}var Gt={};function kt(){return K2||(K2=new Xe(null,Gt))}function jn(e){Si(Gt);var t=e.g;return(t=t==null||Dn(t)?t:typeof t=="string"?ki(t):null)==null?t:e.g=t}var Xe=class{h(){return new Uint8Array(jn(this)||0)}constructor(e,t){if(Si(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let K2,z2;function Si(e){if(e!==Gt)throw Error("illegal external caller")}function Ti(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Bn(e){return Ti(e=Error(e),"warning"),e}function Wt(e,t){if(e!=null){var r=z2??(z2={}),n=r[e]||0;n>=t||(r[e]=n+1,Ti(e=Error(),"incident"),mi(e))}}function Ht(){return typeof BigInt=="function"}var Kt=typeof Symbol=="function"&&typeof Symbol()=="symbol";function qe(e,t,r=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?r&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var Y2=qe("jas",void 0,!0),Li=qe(void 0,"0di"),Er=qe(void 0,"1oa"),Ee=qe(void 0,Symbol()),X2=qe(void 0,"0ub"),q2=qe(void 0,"0ubs"),Un=qe(void 0,"0ubsb"),J2=qe(void 0,"0actk"),zt=qe("m_m","Pa",!0),Oi=qe();const Pi={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},Ri=Object.defineProperties,m=Kt?Y2:"Ga";var St;const Fi=[];function Ar(e,t){Kt||m in e||Ri(e,Pi),e[m]|=t}function te(e,t){Kt||m in e||Ri(e,Pi),e[m]=t}function kr(e){return Ar(e,34),e}function Sr(e){return Ar(e,8192),e}te(Fi,7),St=Object.freeze(Fi);var Yt={};function Ae(e,t){return t===void 0?e.h!==Tt&&!!(2&(0|e.v[m])):!!(2&t)&&e.h!==Tt}const Tt={};function Vn(e,t){if(e!=null){if(typeof e=="string")e=e?new Xe(e,Gt):kt();else if(e.constructor!==Xe)if(Dn(e))e=e.length?new Xe(new Uint8Array(e),Gt):kt();else{if(!t)throw Error();e=void 0}}return e}class xi{constructor(t,r,n){this.g=t,this.h=r,this.l=n}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var $2=Object.freeze({});function Mi(e,t,r){const n=128&t?0:-1,s=e.length;var i;(i=!!s)&&(i=(i=e[s-1])!=null&&typeof i=="object"&&i.constructor===Object);const o=s+(i?-1:0);for(t=128&t?1:0;t<o;t++)r(t-n,e[t]);if(i){e=e[s-1];for(const c in e)!isNaN(c)&&r(+c,e[c])}}var Ii={};function Xt(e){return 128&e?Ii:void 0}function zr(e){return e.Na=!0,e}var Z2=zr(e=>typeof e=="number"),Ci=zr(e=>typeof e=="string"),Q2=zr(e=>typeof e=="boolean"),Yr=typeof Vt.BigInt=="function"&&typeof Vt.BigInt(0)=="bigint";function ke(e){var t=e;if(Ci(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(Z2(t)&&!Number.isSafeInteger(t))throw Error(String(t));return Yr?BigInt(e):e=Q2(e)?e?"1":"0":Ci(e)?e.trim()||"0":String(e)}var Gn=zr(e=>Yr?e>=t1&&e<=n1:e[0]==="-"?Ni(e,e1):Ni(e,r1));const e1=Number.MIN_SAFE_INTEGER.toString(),t1=Yr?BigInt(Number.MIN_SAFE_INTEGER):void 0,r1=Number.MAX_SAFE_INTEGER.toString(),n1=Yr?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Ni(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){const n=e[r],s=t[r];if(n>s)return!1;if(n<s)return!0}}const s1=typeof Uint8Array.prototype.slice=="function";let i1,U=0,$=0;function Di(e){const t=e>>>0;U=t,$=(e-t)/4294967296>>>0}function qt(e){if(e<0){Di(-e);const[t,r]=Yn(U,$);U=t>>>0,$=r>>>0}else Di(e)}function Wn(e){const t=i1||(i1=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),$=0,U=t.getUint32(0,!0)}function Hn(e,t){const r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:Tr(e,t)}function o1(e,t){return ke(Ht()?BigInt.asUintN(64,(BigInt(t>>>0)<<BigInt(32))+BigInt(e>>>0)):Tr(e,t))}function Kn(e,t){const r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Hn(e,t))=="number"?r?-e:e:r?"-"+e:e}function ji(e,t){return Ht()?ke(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(t))<<BigInt(32))+BigInt.asUintN(32,BigInt(e)))):ke(zn(e,t))}function Tr(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else Ht()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+Bi(r)+Bi(e));return r}function Bi(e){return e=String(e),"0000000".slice(e.length)+e}function zn(e,t){if(2147483648&t)if(Ht())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[r,n]=Yn(e,t);e="-"+Tr(r,n)}else e=Tr(e,t);return e}function Xr(e){if(e.length<16)qt(Number(e));else if(Ht())e=BigInt(e),U=Number(e&BigInt(4294967295))>>>0,$=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");$=U=0;const r=e.length;for(let n=t,s=(r-t)%6+t;s<=r;n=s,s+=6){const i=Number(e.slice(n,s));$*=1e6,U=1e6*U+i,U>=4294967296&&($+=Math.trunc(U/4294967296),$>>>=0,U>>>=0)}if(t){const[n,s]=Yn(U,$);U=n,$=s}}}function Yn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Ve(e){return Array.prototype.slice.call(e)}const Lr=typeof BigInt=="function"?BigInt.asIntN:void 0,a1=typeof BigInt=="function"?BigInt.asUintN:void 0,Lt=Number.isSafeInteger,qr=Number.isFinite,Jt=Math.trunc,c1=ke(0);function Or(e){if(e!=null&&typeof e!="number")throw Error(`Value of float/double field must be a number, found ${typeof e}: ${e}`);return e}function Je(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Pr(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error(`Expected boolean but got ${t!="object"?t:e?Array.isArray(e)?"array":t:"null"}: ${e}`)}return e}function Ui(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const u1=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Rr(e){switch(typeof e){case"bigint":return!0;case"number":return qr(e);case"string":return u1.test(e);default:return!1}}function $t(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return qr(e)?0|e:void 0}function Vi(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return qr(e)?e>>>0:void 0}function Gi(e){const t=e.length;return(e[0]==="-"?t<20||t===20&&e<="-9223372036854775808":t<19||t===19&&e<="9223372036854775807")?e:(Xr(e),zn(U,$))}function Xn(e){return e=Jt(e),Lt(e)||(qt(e),e=Kn(U,$)),e}function Wi(e){var t=Jt(Number(e));return Lt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Gi(e))}function Hi(e){var t=Jt(Number(e));return Lt(t)?ke(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Ht()?ke(Lr(64,BigInt(e))):ke(Gi(e)))}function Ki(e){return Lt(e)?e=ke(Xn(e)):(e=Jt(e),Lt(e)?e=String(e):(qt(e),e=zn(U,$)),e=ke(e)),e}function h1(e){return e==null?e:typeof e=="bigint"?(Gn(e)?e=Number(e):(e=Lr(64,e),e=Gn(e)?Number(e):String(e)),e):Rr(e)?typeof e=="number"?Xn(e):Wi(e):void 0}function Jr(e){const t=typeof e;return e==null?e:t==="bigint"?ke(Lr(64,e)):Rr(e)?t==="string"?Hi(e):Ki(e):void 0}function zi(e){if(typeof e!="string")throw Error();return e}function Fr(e){if(e!=null&&typeof e!="string")throw Error();return e}function ue(e){return e==null||typeof e=="string"?e:void 0}function qn(e,t,r,n){return e!=null&&e[zt]===Yt?e:Array.isArray(e)?((n=(r=0|e[m])|32&n|2&n)!==r&&te(e,n),new t(e)):(r?2&n?((e=t[Li])||(kr((e=new t).v),e=t[Li]=e),t=e):t=new t:t=void 0,t)}function l1(e,t,r){if(t)e:{if(!Rr(t=e))throw Bn("int64");switch(typeof t){case"string":t=Hi(t);break e;case"bigint":t=ke(Lr(64,t));break e;default:t=Ki(t)}}else t=Jr(e);return(e=t)==null?r?c1:void 0:e}const f1={};let d1=function(){try{return Kr(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class Jn{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}}const p1=d1?(Object.setPrototypeOf(Jn.prototype,Map.prototype),Object.defineProperties(Jn.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Jn):class extends Map{constructor(){super()}};function Yi(e){return e}function $n(e){if(2&e.J)throw Error("Cannot mutate an immutable Map")}var st=class extends p1{constructor(e,t,r=Yi,n=Yi){super(),this.J=0|e[m],this.K=t,this.S=r,this.fa=this.K?g1:n;for(let s=0;s<e.length;s++){const i=e[s],o=r(i[0],!1,!0);let c=i[1];t?c===void 0&&(c=null):c=n(i[1],!1,!0,void 0,void 0,this.J),super.set(o,c)}}V(e){return Sr(Array.from(super.entries(),e))}clear(){$n(this),super.clear()}delete(e){return $n(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new xi(e,m1,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new xi(e,st.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.K?super.forEach((r,n,s)=>{e.call(t,s.get(n),n,s)}):super.forEach(e,t)}set(e,t){return $n(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.fa(t,!0,!0,this.K,!1,this.J))}Ma(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.K?e===void 0?null:e:this.fa(e,!1,!0,void 0,!1,this.J),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var r=this.K;return r?((r=this.fa(t,!1,!0,r,this.ra,this.J))!==t&&super.set(e,r),r):t}}[Symbol.iterator](){return this.entries()}};function g1(e,t,r,n,s,i){return e=qn(e,n,r,i),s&&(e=es(e)),e}function m1(e){return[e,this.get(e)]}let v1;function Xi(){return v1||(v1=new st(kr([]),void 0,void 0,void 0,f1))}function $r(e){return Ee?e[Ee]:void 0}function Zr(e,t){for(const r in e)!isNaN(r)&&t(e,+r,e[r])}st.prototype.toJSON=void 0;var Zn=class{};const y1={Ka:!0};function _1(e,t){t<100||Wt(q2,1)}function Qr(e,t,r,n){const s=n!==void 0;n=!!n;var i,o=Ee;!s&&Kt&&o&&(i=e[o])&&Zr(i,_1),o=[];var c=e.length;let u;i=4294967295;let f=!1;const h=!!(64&t),d=h?128&t?0:-1:void 0;1&t||(u=c&&e[c-1],u!=null&&typeof u=="object"&&u.constructor===Object?i=--c:u=void 0,!h||128&t||s||(f=!0,i=i-d+d)),t=void 0;for(var b=0;b<c;b++){let A=e[b];if(A!=null&&(A=r(A,n))!=null)if(h&&b>=i){const W=b-d;(t??(t={}))[W]=A}else o[b]=A}if(u)for(let A in u){if((c=u[A])==null||(c=r(c,n))==null)continue;let W;b=+A,h&&!Number.isNaN(b)&&(W=b+d)<i?o[W]=c:(t??(t={}))[A]=c}return t&&(f?o.push(t):o[i]=t),s&&Ee&&(e=$r(e))&&e instanceof Zn&&(o[Ee]=function(A){const W=new Zn;return Zr(A,(nt,Ke,he)=>{W[Ke]=Ve(he)}),W.da=A.da,W}(e)),o}function b1(e){return e[0]=xr(e[0]),e[1]=xr(e[1]),e}function xr(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Gn(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Array.isArray(e)){var t=0|e[m];return e.length===0&&1&t?void 0:Qr(e,t,xr)}if(e!=null&&e[zt]===Yt)return qi(e);if(e instanceof Xe){if((t=e.g)==null)e="";else if(typeof t=="string")e=t;else{if(Ei){for(var r="",n=0,s=t.length-10240;n<s;)r+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?t.subarray(n):t),t=btoa(r)}else{r===void 0&&(r=0),wi(),r=bi[r],n=Array(Math.floor(t.length/3)),s=r[64]||"";let f=0,h=0;for(;f<t.length-2;f+=3){var i=t[f],o=t[f+1],c=t[f+2],u=r[i>>2];i=r[(3&i)<<4|o>>4],o=r[(15&o)<<2|c>>6],c=r[63&c],n[h++]=u+i+o+c}switch(u=0,c=s,t.length-f){case 2:c=r[(15&(u=t[f+1]))<<2]||s;case 1:t=t[f],n[h]=r[t>>2]+r[(3&t)<<4|u>>4]+c+s}t=n.join("")}e=e.g=t}return e}return e instanceof st?e=e.size!==0?e.V(b1):void 0:void 0}return e}function qi(e){return Qr(e=e.v,0|e[m],xr)}let w1,E1;function Ot(e,t){return Ji(e,t[0],t[1])}function Ji(e,t,r,n=0){if(e==null){var s=32;r?(e=[r],s|=128):e=[],t&&(s=-16760833&s|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(s=0|e[m],vi&&1&s)throw Error("rfarr");if(2048&s&&!(2&s)&&function(){if(vi)throw Error("carr");Wt(J2,5)}(),256&s)throw Error("farr");if(64&s)return(s|n)!==s&&te(e,s|n),e;if(r&&(s|=128,r!==e[0]))throw Error("mid");e:{s|=64;var i=(r=e).length;if(i){var o=i-1;const u=r[o];if(u!=null&&typeof u=="object"&&u.constructor===Object){if((o-=t=128&s?0:-1)>=1024)throw Error("pvtlmt");for(var c in u)(i=+c)<o&&(r[i+t]=u[c],delete u[c]);s=-16760833&s|(1023&o)<<14;break e}}if(t){if((c=Math.max(t,i-(128&s?0:-1)))>1024)throw Error("spvt");s=-16760833&s|(1023&c)<<14}}}return te(e,64|s|n),e}function A1(e,t){if(typeof e!="object")return e;if(Array.isArray(e)){var r=0|e[m];return e.length===0&&1&r?void 0:$i(e,r,t)}if(e!=null&&e[zt]===Yt)return Zi(e);if(e instanceof st){if(2&(t=e.J))return e;if(!e.size)return;if(r=kr(e.V()),e.K)for(e=0;e<r.length;e++){const n=r[e];let s=n[1];s=s==null||typeof s!="object"?void 0:s!=null&&s[zt]===Yt?Zi(s):Array.isArray(s)?$i(s,0|s[m],!!(32&t)):void 0,n[1]=s}return r}return e instanceof Xe?e:void 0}function $i(e,t,r){return 2&t||(!r||4096&t||16&t?e=Zt(e,t,!1,r&&!(16&t)):(Ar(e,34),4&t&&Object.freeze(e))),e}function Qn(e,t,r){return e=new e.constructor(t),r&&(e.h=Tt),e.m=Tt,e}function Zi(e){const t=e.v,r=0|t[m];return Ae(e,r)?e:ts(e,t,r)?Qn(e,t):Zt(t,r)}function Zt(e,t,r,n){return n??(n=!!(34&t)),e=Qr(e,t,A1,n),n=32,r&&(n|=2),te(e,t=16769217&t|n),e}function es(e){const t=e.v,r=0|t[m];return Ae(e,r)?ts(e,t,r)?Qn(e,t,!0):new e.constructor(Zt(t,r,!1)):e}function Qt(e){if(e.h!==Tt)return!1;var t=e.v;return Ar(t=Zt(t,0|t[m]),2048),e.v=t,e.h=void 0,e.m=void 0,!0}function er(e){if(!Qt(e)&&Ae(e,0|e.v[m]))throw Error()}function Pt(e,t){t===void 0&&(t=0|e[m]),32&t&&!(4096&t)&&te(e,4096|t)}function ts(e,t,r){return!!(2&r)||!(!(32&r)||4096&r)&&(te(t,2|r),e.h=Tt,!0)}const k1=ke(0),dt={};function D(e,t,r,n,s){if((t=it(e.v,t,r,s))!==null||n&&e.m!==Tt)return t}function it(e,t,r,n){if(t===-1)return null;const s=t+(r?0:-1),i=e.length-1;let o,c;if(!(i<1+(r?0:-1))){if(s>=i)if(o=e[i],o!=null&&typeof o=="object"&&o.constructor===Object)r=o[t],c=!0;else{if(s!==i)return;r=o}else r=e[s];if(n&&r!=null){if((n=n(r))==null)return n;if(!Object.is(n,r))return c?o[t]=n:e[s]=n,n}return r}}function F(e,t,r,n){er(e),re(e=e.v,0|e[m],t,r,n)}function re(e,t,r,n,s){const i=r+(s?0:-1);var o=e.length-1;if(o>=1+(s?0:-1)&&i>=o){const c=e[o];if(c!=null&&typeof c=="object"&&c.constructor===Object)return c[r]=n,t}return i<=o?(e[i]=n,t):(n!==void 0&&(r>=(o=(t??(t=0|e[m]))>>14&1023||536870912)?n!=null&&(e[o+(s?0:-1)]={[r]:n}):e[i]=n),t)}function Rt(){return $2===void 0?2:4}function Ft(e,t,r,n,s){let i=e.v,o=0|i[m];n=Ae(e,o)?1:n,s=!!s||n===3,n===2&&Qt(e)&&(i=e.v,o=0|i[m]);let c=(e=rs(i,t))===St?7:0|e[m],u=ns(c,o);var f=!(4&u);if(f){4&u&&(e=Ve(e),c=0,u=Mt(u,o),o=re(i,o,t,e));let h=0,d=0;for(;h<e.length;h++){const b=r(e[h]);b!=null&&(e[d++]=b)}d<h&&(e.length=d),r=-513&(4|u),u=r&=-1025,u&=-4097}return u!==c&&(te(e,u),2&u&&Object.freeze(e)),Qi(e,u,i,o,t,n,f,s)}function Qi(e,t,r,n,s,i,o,c){let u=t;return i===1||i===4&&(2&t||!(16&t)&&32&n)?xt(t)||((t|=!e.length||o&&!(4096&t)||32&n&&!(4096&t||16&t)?2:256)!==u&&te(e,t),Object.freeze(e)):(i===2&&xt(t)&&(e=Ve(e),u=0,t=Mt(t,n),n=re(r,n,s,e)),xt(t)||(c||(t|=16),t!==u&&te(e,t))),2&t||!(4096&t||16&t)||Pt(r,n),e}function rs(e,t,r){return e=it(e,t,r),Array.isArray(e)?e:St}function ns(e,t){return 2&t&&(e|=2),1|e}function xt(e){return!!(2&e)&&!!(4&e)||!!(256&e)}function eo(e){return Vn(e,!0)}function to(e){e=Ve(e);for(let t=0;t<e.length;t++){const r=e[t]=Ve(e[t]);Array.isArray(r[1])&&(r[1]=kr(r[1]))}return Sr(e)}function pt(e,t,r,n){er(e),re(e=e.v,0|e[m],t,(n==="0"?Number(r)===0:r===n)?void 0:r)}function tr(e,t,r){if(2&t)throw Error();const n=Xt(t);let s=rs(e,r,n),i=s===St?7:0|s[m],o=ns(i,t);return(2&o||xt(o)||16&o)&&(o===i||xt(o)||te(s,o),s=Ve(s),i=0,o=Mt(o,t),re(e,t,r,s,n)),o&=-13,o!==i&&te(s,o),s}function ss(e,t){var r=ca;return os(is(e=e.v),e,void 0,r)===t?t:-1}function is(e){if(Kt)return e[Er]??(e[Er]=new Map);if(Er in e)return e[Er];const t=new Map;return Object.defineProperty(e,Er,{value:t}),t}function ro(e,t,r,n,s){const i=is(e),o=os(i,e,t,r,s);return o!==n&&(o&&(t=re(e,t,o,void 0,s)),i.set(r,n)),t}function os(e,t,r,n,s){let i=e.get(n);if(i!=null)return i;i=0;for(let o=0;o<n.length;o++){const c=n[o];it(t,c,s)!=null&&(i!==0&&(r=re(t,r,i,void 0,s)),i=c)}return e.set(n,i),i}function as(e,t,r){let n=0|e[m];const s=Xt(n),i=it(e,r,s);let o;if(i!=null&&i[zt]===Yt){if(!Ae(i))return Qt(i),i.v;o=i.v}else Array.isArray(i)&&(o=i);if(o){const c=0|o[m];2&c&&(o=Zt(o,c))}return o=Ot(o,t),o!==i&&re(e,n,r,o,s),o}function no(e,t,r,n,s){let i=!1;if((n=it(e,n,s,o=>{const c=qn(o,r,!1,t);return i=c!==o&&c!=null,c}))!=null)return i&&!Ae(n)&&Pt(e,t),n}function O(e,t,r,n){let s=e.v,i=0|s[m];if((t=no(s,i,t,r,n))==null)return t;if(i=0|s[m],!Ae(e,i)){const o=es(t);o!==t&&(Qt(e)&&(s=e.v,i=0|s[m]),i=re(s,i,r,t=o,n),Pt(s,i))}return t}function so(e,t,r,n,s,i,o,c){var u=Ae(e,r);i=u?1:i,o=!!o||i===3,u=c&&!u,(i===2||u)&&Qt(e)&&(r=0|(t=e.v)[m]);var f=(e=rs(t,s))===St?7:0|e[m],h=ns(f,r);if(c=!(4&h)){var d=e,b=r;const A=!!(2&h);A&&(b|=2);let W=!A,nt=!0,Ke=0,he=0;for(;Ke<d.length;Ke++){const K=qn(d[Ke],n,!1,b);if(K instanceof n){if(!A){const ht=Ae(K);W&&(W=!ht),nt&&(nt=ht)}d[he++]=K}}he<Ke&&(d.length=he),h|=4,h=nt?-4097&h:4096|h,h=W?8|h:-9&h}if(h!==f&&(te(e,h),2&h&&Object.freeze(e)),u&&!(8&h||!e.length&&(i===1||i===4&&(2&h||!(16&h)&&32&r)))){for(xt(h)&&(e=Ve(e),h=Mt(h,r),r=re(t,r,s,e)),n=e,u=h,f=0;f<n.length;f++)(d=n[f])!==(h=es(d))&&(n[f]=h);u|=8,te(e,h=u=n.length?4096|u:-4097&u)}return Qi(e,h,t,r,s,i,c,o)}function ot(e,t,r){const n=e.v;return so(e,n,0|n[m],t,r,Rt(),!1,!0)}function io(e){return e==null&&(e=void 0),e}function w(e,t,r,n,s){return F(e,r,n=io(n),s),n&&!Ae(n)&&Pt(e.v),e}function Mr(e,t,r,n){e:{var s=n=io(n);er(e);const i=e.v;let o=0|i[m];if(s==null){const c=is(i);if(os(c,i,o,r)!==t)break e;c.set(r,0)}else o=ro(i,o,r,t);re(i,o,t,s)}n&&!Ae(n)&&Pt(e.v)}function Mt(e,t){return-273&(2&t?2|e:-3&e)}function cs(e,t,r,n){var s=n;er(e),e=so(e,n=e.v,0|n[m],r,t,2,!0),s=s??new r,e.push(s),t=r=e===St?7:0|e[m],(s=Ae(s))?(r&=-9,e.length===1&&(r&=-4097)):r|=4096,r!==t&&te(e,r),s||Pt(n)}function Me(e,t,r){return $t(D(e,t,void 0,r))}function oo(e){return(Nn?D(e,2,void 0,void 0,Jr):Jr(D(e,2)))??k1}function Y(e,t){return D(e,t,void 0,void 0,Je)??0}function at(e,t,r){if(r!=null){if(typeof r!="number"||!qr(r))throw Bn("int32");r|=0}F(e,t,r)}function _(e,t,r){F(e,t,Or(r))}function Se(e,t,r){pt(e,t,Fr(r),"")}function en(e,t,r){{er(e);const o=e.v;let c=0|o[m];if(r==null)re(o,c,t);else{var n=e=r===St?7:0|r[m],s=xt(e),i=s||Object.isFrozen(r);for(s||(e=0),i||(r=Ve(r),n=0,e=Mt(e,c),i=!1),e|=5,e|=(4&e?512&e?512:1024&e?1024:0:void 0)??(Nn?1024:0),s=0;s<r.length;s++){const u=r[s],f=zi(u);Object.is(u,f)||(i&&(r=Ve(r),n=0,e=Mt(e,c),i=!1),r[s]=f)}e!==n&&(i&&(r=Ve(r),e=Mt(e,c)),te(r,e)),re(o,c,t,r)}}}function tn(e,t,r){er(e),Ft(e,t,ue,2,!0).push(zi(r))}var rr=class{constructor(e,t,r){if(this.buffer=e,r&&!t)throw Error();this.g=t}};function us(e,t){if(typeof e=="string")return new rr(ki(e),t);if(Array.isArray(e))return new rr(new Uint8Array(e),t);if(e.constructor===Uint8Array)return new rr(e,!1);if(e.constructor===ArrayBuffer)return e=new Uint8Array(e),new rr(e,!1);if(e.constructor===Xe)return t=jn(e)||new Uint8Array(0),new rr(t,!0,e);if(e instanceof Uint8Array)return e=e.constructor===Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new rr(e,!1);throw Error()}function nr(e,t){let r,n=0,s=0,i=0;const o=e.h;let c=e.g;do r=o[c++],n|=(127&r)<<i,i+=7;while(i<32&&128&r);if(i>32)for(s|=(127&r)>>4,i=3;i<32&&128&r;i+=7)r=o[c++],s|=(127&r)<<i;if(It(e,c),!(128&r))return t(n>>>0,s>>>0);throw Error()}function hs(e){let t=0,r=e.g;const n=r+10,s=e.h;for(;r<n;){const i=s[r++];if(t|=i,(128&i)==0)return It(e,r),!!(127&t)}throw Error()}function gt(e){const t=e.h;let r=e.g,n=t[r++],s=127&n;if(128&n&&(n=t[r++],s|=(127&n)<<7,128&n&&(n=t[r++],s|=(127&n)<<14,128&n&&(n=t[r++],s|=(127&n)<<21,128&n&&(n=t[r++],s|=n<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Error();return It(e,r),s}function ct(e){return gt(e)>>>0}function rn(e){var t=e.h;const r=e.g;var n=t[r],s=t[r+1];const i=t[r+2];return t=t[r+3],It(e,e.g+4),e=2*((s=(n<<0|s<<8|i<<16|t<<24)>>>0)>>31)+1,n=s>>>23&255,s&=8388607,n==255?s?NaN:e*(1/0):n==0?1401298464324817e-60*e*s:e*Math.pow(2,n-150)*(s+8388608)}function S1(e){return gt(e)}function It(e,t){if(e.g=t,t>e.l)throw Error()}function ao(e,t){if(t<0)throw Error();const r=e.g;if((t=r+t)>e.l)throw Error();return e.g=t,r}function co(e,t){if(t==0)return kt();var r=ao(e,t);return e.Y&&e.j?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):s1?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?kt():new Xe(r,Gt)}var uo=[];function ho(e,t,r,n){if(on.length){const s=on.pop();return s.o(n),s.g.init(e,t,r,n),s}return new T1(e,t,r,n)}function lo(e){e.g.clear(),e.l=-1,e.h=-1,on.length<100&&on.push(e)}function fo(e){var t=e.g;if(t.g==t.l)return!1;e.m=e.g.g;var r=ct(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5)||t<1)throw Error();return e.l=t,e.h=r,!0}function nn(e){switch(e.h){case 0:e.h!=0?nn(e):hs(e.g);break;case 1:It(e=e.g,e.g+8);break;case 2:if(e.h!=2)nn(e);else{var t=ct(e.g);It(e=e.g,e.g+t)}break;case 5:It(e=e.g,e.g+4);break;case 3:for(t=e.l;;){if(!fo(e))throw Error();if(e.h==4){if(e.l!=t)throw Error();break}nn(e)}break;default:throw Error()}}function Ir(e,t,r){const n=e.g.l;var s=ct(e.g);let i=(s=e.g.g+s)-n;if(i<=0&&(e.g.l=s,r(t,e,void 0,void 0,void 0),i=s-e.g.g),i)throw Error();return e.g.g=s,e.g.l=n,t}function ls(e){var t=ct(e.g),r=ao(e=e.g,t);if(e=e.h,D2){var n,s=e;(n=Mn)||(n=Mn=new TextDecoder("utf-8",{fatal:!0})),t=r+t,s=r===0&&t===s.length?s:s.subarray(r,t);try{var i=n.decode(s)}catch(c){if(Hr===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),Hr=!0}catch{Hr=!1}}throw!Hr&&(Mn=void 0),c}}else{t=(i=r)+t,r=[];let c,u=null;for(;i<t;){var o=e[i++];o<128?r.push(o):o<224?i>=t?At():(c=e[i++],o<194||(192&c)!=128?(i--,At()):r.push((31&o)<<6|63&c)):o<240?i>=t-1?At():(c=e[i++],(192&c)!=128||o===224&&c<160||o===237&&c>=160||(192&(n=e[i++]))!=128?(i--,At()):r.push((15&o)<<12|(63&c)<<6|63&n)):o<=244?i>=t-2?At():(c=e[i++],(192&c)!=128||c-144+(o<<28)>>30||(192&(n=e[i++]))!=128||(192&(s=e[i++]))!=128?(i--,At()):(o=(7&o)<<18|(63&c)<<12|(63&n)<<6|63&s,o-=65536,r.push(55296+(o>>10&1023),56320+(1023&o)))):At(),r.length>=8192&&(u=pi(u,r),r.length=0)}i=pi(u,r)}return i}function po(e){const t=ct(e.g);return co(e.g,t)}function sn(e,t,r){var n=ct(e.g);for(n=e.g.g+n;e.g.g<n;)r.push(t(e.g))}var T1=class{constructor(e,t,r,n){if(uo.length){const s=uo.pop();s.init(e,t,r,n),e=s}else e=new class{constructor(s,i,o,c){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(s,i,o,c)}init(s,i,o,{Y:c=!1,ea:u=!1}={}){this.Y=c,this.ea=u,s&&(s=us(s,this.ea),this.h=s.buffer,this.j=s.g,this.m=i||0,this.l=o!==void 0?this.m+o:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(e,t,r,n);this.g=e,this.m=this.g.g,this.h=this.l=-1,this.o(n)}o({ha:e=!1}={}){this.ha=e}},on=[];function go(e){return e?/^\d+$/.test(e)?(Xr(e),new fs(U,$)):null:L1||(L1=new fs(0,0))}var fs=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let L1;function mo(e){return e?/^-?\d+$/.test(e)?(Xr(e),new ds(U,$)):null:O1||(O1=new ds(0,0))}var ds=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let O1;function sr(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function ir(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function an(e,t){if(t>=0)ir(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function ps(e){var t=U;e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function or(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function Ie(e,t,r){ir(e.g,8*t+r)}function gs(e,t){return Ie(e,t,2),t=e.g.end(),or(e,t),t.push(e.h),t}function ms(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function cn(e,t,r){Ie(e,t,2),ir(e.g,r.length),or(e,e.g.end()),or(e,r)}function un(e,t,r,n){r!=null&&(t=gs(e,t),n(r,e),ms(e,t))}function $e(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var vs=$e(),vo=$e(),ys=$e(),_s=$e(),yo=$e(),_o=$e(),P1=$e(),hn=$e(),bo=$e(),wo=$e();function Ze(e,t,r){var n=e.v;Ee&&Ee in n&&(n=n[Ee])&&delete n[t.g],t.h?t.j(e,t.h,t.g,r,t.l):t.j(e,t.g,r,t.l)}var v=class{constructor(e,t){this.v=Ji(e,t,void 0,2048)}toJSON(){return qi(this)}j(){var s;var e=lc,t=this.v,r=e.g,n=Ee;if(Kt&&n&&((s=t[n])==null?void 0:s[r])!=null&&Wt(X2,3),t=e.g,Oi&&Ee&&Oi===void 0&&(n=(r=this.v)[Ee])&&(n=n.da))try{n(r,t,y1)}catch(i){mi(i)}return e.h?e.m(this,e.h,e.g,e.l):e.m(this,e.g,e.defaultValue,e.l)}clone(){const e=this.v,t=0|e[m];return ts(this,e,t)?Qn(this,e,!0):new this.constructor(Zt(e,t,!1))}};v.prototype[zt]=Yt,v.prototype.toString=function(){return this.v.toString()};var ar=class{constructor(e,t,r){this.g=e,this.h=t,e=vs,this.l=!!e&&r===e||!1}};function ln(e,t){return new ar(e,t,vs)}function Eo(e,t,r,n,s){un(e,r,Oo(t,n),s)}const R1=ln(function(e,t,r,n,s){return e.h===2&&(Ir(e,as(t,n,r),s),!0)},Eo),F1=ln(function(e,t,r,n,s){return e.h===2&&(Ir(e,as(t,n,r),s),!0)},Eo);var fn=Symbol(),dn=Symbol(),bs=Symbol(),Ao=Symbol(),ko=Symbol();let So,To;function Ct(e,t,r,n){var s=n[e];if(s)return s;(s={}).qa=n,s.T=function(d){switch(typeof d){case"boolean":return w1||(w1=[0,void 0,!0]);case"number":return d>0?void 0:d===0?E1||(E1=[0,void 0]):[-d,void 0];case"string":return[0,d];case"object":return d}}(n[0]);var i=n[1];let o=1;i&&i.constructor===Object&&(s.ba=i,typeof(i=n[++o])=="function"&&(s.ma=!0,So??(So=i),To??(To=n[o+1]),i=n[o+=2]));const c={};for(;i&&Array.isArray(i)&&i.length&&typeof i[0]=="number"&&i[0]>0;){for(var u=0;u<i.length;u++)c[i[u]]=i;i=n[++o]}for(u=1;i!==void 0;){let d;typeof i=="number"&&(u+=i,i=n[++o]);var f=void 0;if(i instanceof ar?d=i:(d=R1,o--),d==null?void 0:d.l){i=n[++o],f=n;var h=o;typeof i=="function"&&(i=i(),f[h]=i),f=i}for(h=u+1,typeof(i=n[++o])=="number"&&i<0&&(h-=i,i=n[++o]);u<h;u++){const b=c[u];f?r(s,u,d,f,b):t(s,u,d,b)}}return n[e]=s}function Lo(e){return Array.isArray(e)?e[0]instanceof ar?e:[F1,e]:[e,void 0]}function Oo(e,t){return e instanceof v?e.v:Array.isArray(e)?Ot(e,t):void 0}function ws(e,t,r,n){const s=r.g;e[t]=n?(i,o,c)=>s(i,o,c,n):s}function Es(e,t,r,n,s){const i=r.g;let o,c;e[t]=(u,f,h)=>i(u,f,h,c||(c=Ct(dn,ws,Es,n).T),o||(o=As(n)),s)}function As(e){let t=e[bs];if(t!=null)return t;const r=Ct(dn,ws,Es,e);return t=r.ma?(n,s)=>So(n,s,r):(n,s)=>{for(;fo(s)&&s.h!=4;){var i=s.l,o=r[i];if(o==null){var c=r.ba;c&&(c=c[i])&&(c=M1(c))!=null&&(o=r[i]=c)}if(o==null||!o(s,n,i)){if(o=(c=s).m,nn(c),c.ha)var u=void 0;else u=c.g.g-o,c.g.g=o,u=co(c.g,u);o=void 0,c=n,u&&((o=c[Ee]??(c[Ee]=new Zn))[i]??(o[i]=[])).push(u)}}return(n=$r(n))&&(n.da=r.qa[ko]),!0},e[bs]=t,e[ko]=x1.bind(e),t}function x1(e,t,r,n){var s=this[dn];const i=this[bs],o=Ot(void 0,s.T),c=$r(e);if(c){var u=!1,f=s.ba;if(f){if(s=(h,d,b)=>{if(b.length!==0)if(f[d])for(const A of b){h=ho(A);try{u=!0,i(o,h)}finally{lo(h)}}else n==null||n(e,d,b)},t==null)Zr(c,s);else if(c!=null){const h=c[t];h&&s(c,t,h)}if(u){let h=0|e[m];if(2&h&&2048&h&&!(r!=null&&r.Ka))throw Error();const d=Xt(h),b=(A,W)=>{if(it(e,A,d)!=null){if((r==null?void 0:r.Qa)===1)return;throw Error()}W!=null&&(h=re(e,h,A,W,d)),delete c[A]};t==null?Mi(o,0|o[m],(A,W)=>{b(A,W)}):b(t,it(o,t,d))}}}}function M1(e){const t=(e=Lo(e))[0].g;if(e=e[1]){const r=As(e),n=Ct(dn,ws,Es,e).T;return(s,i,o)=>t(s,i,o,n,r)}return t}function pn(e,t,r){e[t]=r.h}function gn(e,t,r,n){let s,i;const o=r.h;e[t]=(c,u,f)=>o(c,u,f,i||(i=Ct(fn,pn,gn,n).T),s||(s=Po(n)))}function Po(e){let t=e[Ao];if(!t){const r=Ct(fn,pn,gn,e);t=(n,s)=>Ro(n,s,r),e[Ao]=t}return t}function Ro(e,t,r){Mi(e,0|e[m],(n,s)=>{if(s!=null){var i=function(o,c){var u=o[c];if(u)return u;if((u=o.ba)&&(u=u[c])){var f=(u=Lo(u))[0].h;if(u=u[1]){const h=Po(u),d=Ct(fn,pn,gn,u).T;u=o.ma?To(d,h):(b,A,W)=>f(b,A,W,d,h)}else u=f;return o[c]=u}}(r,n);i?i(t,s,n):n<500||Wt(Un,3)}}),(e=$r(e))&&Zr(e,(n,s,i)=>{for(or(t,t.g.end()),n=0;n<i.length;n++)or(t,jn(i[n])||new Uint8Array(0))})}const I1=ke(0);function cr(e,t){if(Array.isArray(t)){var r=0|t[m];if(4&r)return t;for(var n=0,s=0;n<t.length;n++){const i=e(t[n]);i!=null&&(t[s++]=i)}return s<n&&(t.length=s),(e=-1537&(5|r))!==r&&te(t,e),2&e&&Object.freeze(t),t}}function ge(e,t,r){return new ar(e,t,r)}function ur(e,t,r){return new ar(e,t,r)}function se(e,t,r){re(e,0|e[m],t,r,Xt(0|e[m]))}var C1=ln(function(e,t,r,n,s){if(e.h!==2)return!1;if(e=Ve(e=Ir(e,Ot([void 0,void 0],n),s)),s=Xt(n=0|t[m]),2&n)throw Error();let i=it(t,r,s);if(i instanceof st)2&i.J?(i=i.V(),i.push(e),re(t,n,r,i,s)):i.Ma(e);else if(Array.isArray(i)){var o=0|i[m];8192&o||te(i,o|=8192),2&o&&(i=to(i),re(t,n,r,i,s)),i.push(e)}else re(t,n,r,Sr([e]),s);return!0},function(e,t,r,n,s){if(t instanceof st)t.forEach((i,o)=>{un(e,r,Ot([o,i],n),s)});else if(Array.isArray(t)){for(let i=0;i<t.length;i++){const o=t[i];Array.isArray(o)&&un(e,r,Ot(o,n),s)}Sr(t)}});function Fo(e,t,r){(t=Je(t))!=null&&(Ie(e,r,5),e=e.g,Wn(t),ps(e))}function xo(e,t,r){if(t=function(n){if(n==null)return n;const s=typeof n;if(s==="bigint")return String(Lr(64,n));if(Rr(n)){if(s==="string")return Wi(n);if(s==="number")return Xn(n)}}(t),t!=null&&(typeof t=="string"&&mo(t),t!=null))switch(Ie(e,r,0),typeof t){case"number":e=e.g,qt(t),sr(e,U,$);break;case"bigint":r=BigInt.asUintN(64,t),r=new ds(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),sr(e.g,r.h,r.g);break;default:r=mo(t),sr(e.g,r.h,r.g)}}function Mo(e,t,r){(t=$t(t))!=null&&t!=null&&(Ie(e,r,0),an(e.g,t))}function Io(e,t,r){(t=Ui(t))!=null&&(Ie(e,r,0),e.g.g.push(t?1:0))}function Co(e,t,r){(t=ue(t))!=null&&cn(e,r,gi(t))}function No(e,t,r,n,s){un(e,r,Oo(t,n),s)}function Do(e,t,r){(t=t==null||typeof t=="string"||t instanceof Xe?t:void 0)!=null&&cn(e,r,us(t,!0).buffer)}function jo(e,t,r){return(e.h===5||e.h===2)&&(t=tr(t,0|t[m],r),e.h==2?sn(e,rn,t):t.push(rn(e.g)),!0)}var Z=ge(function(e,t,r){return e.h===5&&(se(t,r,rn(e.g)),!0)},Fo,hn),N1=ur(jo,function(e,t,r){if((t=cr(Je,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Ie(n,s,5),n=n.g,Wn(i),ps(n))}},hn),ks=ur(jo,function(e,t,r){if((t=cr(Je,t))!=null&&t.length){Ie(e,r,2),ir(e.g,4*t.length);for(let n=0;n<t.length;n++)r=e.g,Wn(t[n]),ps(r)}},hn),D1=ge(function(e,t,r){return e.h===5&&(se(t,r,(e=rn(e.g))===0?void 0:e),!0)},Fo,hn),mt=ge(function(e,t,r){return Cn?(e.h!==0?e=!1:(se(t,r,nr(e.g,ji)),e=!0),e):e.h===0&&(se(t,r,nr(e.g,Kn)),!0)},xo,_o),Ss=ge(function(e,t,r){return Cn?(e.h!==0?t=!1:(se(t,r,(e=nr(e.g,ji))===I1?void 0:e),t=!0),t):e.h===0&&(se(t,r,(e=nr(e.g,Kn))===0?void 0:e),!0)},xo,_o),j1=ge(function(e,t,r){return Cn?(e.h!==0?e=!1:(se(t,r,nr(e.g,o1)),e=!0),e):e.h===0&&(se(t,r,nr(e.g,Hn)),!0)},function(e,t,r){if(t=function(n){if(n==null)return n;var s=typeof n;if(s==="bigint")return String(a1(64,n));if(Rr(n)){if(s==="string")return s=Jt(Number(n)),Lt(s)&&s>=0?n=String(s):((s=n.indexOf("."))!==-1&&(n=n.substring(0,s)),(s=n[0]!=="-"&&((s=n.length)<20||s===20&&n<="18446744073709551615"))||(Xr(n),n=Tr(U,$))),n;if(s==="number")return(n=Jt(n))>=0&&Lt(n)||(qt(n),n=Hn(U,$)),n}}(t),t!=null&&(typeof t=="string"&&go(t),t!=null))switch(Ie(e,r,0),typeof t){case"number":e=e.g,qt(t),sr(e,U,$);break;case"bigint":r=BigInt.asUintN(64,t),r=new fs(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),sr(e.g,r.h,r.g);break;default:r=go(t),sr(e.g,r.h,r.g)}},P1),ie=ge(function(e,t,r){return e.h===0&&(se(t,r,gt(e.g)),!0)},Mo,_s),Cr=ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[m],r),e.h==2?sn(e,gt,t):t.push(gt(e.g)),!0)},function(e,t,r){if((t=cr($t,t))!=null&&t.length){r=gs(e,r);for(let n=0;n<t.length;n++)an(e.g,t[n]);ms(e,r)}},_s),hr=ge(function(e,t,r){return e.h===0&&(se(t,r,(e=gt(e.g))===0?void 0:e),!0)},Mo,_s),X=ge(function(e,t,r){return e.h===0&&(se(t,r,hs(e.g)),!0)},Io,vo),Nt=ge(function(e,t,r){return e.h===0&&(se(t,r,(e=hs(e.g))===!1?void 0:e),!0)},Io,vo),pe=ur(function(e,t,r){return e.h===2&&(e=ls(e),tr(t,0|t[m],r).push(e),!0)},function(e,t,r){if((t=cr(ue,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&cn(n,s,gi(i))}},ys),vt=ge(function(e,t,r){return e.h===2&&(se(t,r,(e=ls(e))===""?void 0:e),!0)},Co,ys),M=ge(function(e,t,r){return e.h===2&&(se(t,r,ls(e)),!0)},Co,ys),oe=function(e,t,r=vs){return new ar(e,t,r)}(function(e,t,r,n,s){return e.h===2&&(n=Ot(void 0,n),tr(t,0|t[m],r).push(n),Ir(e,n,s),!0)},function(e,t,r,n,s){if(Array.isArray(t)){for(let i=0;i<t.length;i++)No(e,t[i],r,n,s);1&(e=0|t[m])||te(t,1|e)}}),q=ln(function(e,t,r,n,s,i){if(e.h!==2)return!1;let o=0|t[m];return ro(t,o,i,r,Xt(o)),Ir(e,t=as(t,n,r),s),!0},No),Bo=ge(function(e,t,r){return e.h===2&&(se(t,r,po(e)),!0)},Do,bo),B1=ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[m],r),e.h==2?sn(e,ct,t):t.push(ct(e.g)),!0)},function(e,t,r){if((t=cr(Vi,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Ie(n,s,0),ir(n.g,i))}},yo),U1=ge(function(e,t,r){return e.h===0&&(se(t,r,(e=ct(e.g))===0?void 0:e),!0)},function(e,t,r){(t=Vi(t))!=null&&t!=null&&(Ie(e,r,0),ir(e.g,t))},yo),Te=ge(function(e,t,r){return e.h===0&&(se(t,r,gt(e.g)),!0)},function(e,t,r){(t=$t(t))!=null&&(t=parseInt(t,10),Ie(e,r,0),an(e.g,t))},wo);class V1{constructor(t,r){var n=Le;this.g=t,this.h=r,this.m=O,this.j=w,this.defaultValue=void 0,this.l=n.Oa!=null?Ii:void 0}register(){Kr(this)}}function Qe(e,t){return new V1(e,t)}function yt(e,t){return(r,n)=>{{const i={ea:!0};n&&Object.assign(i,n),r=ho(r,void 0,void 0,i);try{const o=new e,c=o.v;As(t)(c,r);var s=o}finally{lo(r)}}return s}}function mn(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};Ro(this.v,t,Ct(fn,pn,gn,e)),or(t,t.g.end());const r=new Uint8Array(t.h),n=t.l,s=n.length;let i=0;for(let o=0;o<s;o++){const c=n[o];r.set(c,i),i+=c.length}return t.l=[r],r}}var Uo=class extends v{constructor(e){super(e)}},Vo=[0,vt,ge(function(e,t,r){return e.h===2&&(se(t,r,(e=po(e))===kt()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof v){const n=t.Ra;return void(n?(t=n(t),t!=null&&cn(e,r,us(t,!0).buffer)):Wt(Un,3))}if(Array.isArray(t))return void Wt(Un,3)}Do(e,t,r)},bo)];let Ts,Go=globalThis.trustedTypes;function Wo(e){var t;return Ts===void 0&&(Ts=function(){let r=null;if(!Go)return r;try{const n=s=>s;r=Go.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return r}()),e=(t=Ts)?t.createScriptURL(e):e,new class{constructor(r){this.g=r}toString(){return this.g+""}}(e)}function G1(e,...t){if(t.length===0)return Wo(e[0]);let r=e[0];for(let n=0;n<t.length;n++)r+=encodeURIComponent(t[n])+e[n+1];return Wo(r)}var Ho=[0,ie,Te,X,-1,Cr,Te,-1,X],W1=class extends v{constructor(e){super(e)}},Ko=[0,X,M,X,Te,-1,ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[m],r),e.h==2?sn(e,S1,t):t.push(gt(e.g)),!0)},function(e,t,r){if((t=cr($t,t))!=null&&t.length){r=gs(e,r);for(let n=0;n<t.length;n++)an(e.g,t[n]);ms(e,r)}},wo),M,-1,[0,X,-1],Te,X,-1],zo=[0,3,X,-1,2,[0,ie],[0,Te,X],[0,M,-1],[0]],Yo=[0,M,-2],Xo=class extends v{constructor(e){super(e)}},qo=[0],Jo=[0,ie,X,1,X,-4],Le=class extends v{constructor(e){super(e,2)}},ne={};ne[336783863]=[0,M,X,-1,ie,[0,[1,2,3,4,5,6,7,8,9],q,qo,q,Ko,q,Yo,q,Jo,q,Ho,q,[0,M,-2],q,[0,M,Te],q,zo,q,[0,Te,-1,X]],[0,M],X,[0,[1,3],[2,4],q,[0,Cr],-1,q,[0,pe],-1,oe,[0,M,-1]],M];var $o=[0,Ss,-1,Nt,-3,Ss,Cr,vt,hr,Ss,-1,Nt,hr,Nt,-2,vt];function j(e,t){tn(e,3,t)}function S(e,t){tn(e,4,t)}var ve=class extends v{constructor(e){super(e,500)}o(e){return w(this,0,7,e)}},Nr=[-1,{}],Zo=[0,M,1,Nr],Qo=[0,M,pe,Nr];function Ce(e,t){cs(e,1,ve,t)}function V(e,t){tn(e,10,t)}function P(e,t){tn(e,15,t)}var Oe=class extends v{constructor(e){super(e,500)}o(e){return w(this,0,1001,e)}},ea=[-500,oe,[-500,vt,-1,pe,-3,[-2,ne,X],oe,Vo,hr,-1,Zo,Qo,oe,[0,vt,Nt],vt,$o,hr,pe,987,pe],4,oe,[-500,M,-1,[-1,{}],998,M],oe,[-500,M,pe,-1,[-2,{},X],997,pe,-1],hr,oe,[-500,M,pe,Nr,998,pe],pe,hr,Zo,Qo,oe,[0,vt,-1,Nr],pe,-2,$o,vt,-1,Nt,[0,Nt,U1],978,Nr,oe,Vo];Oe.prototype.g=mn(ea);var H1=yt(Oe,ea),K1=class extends v{constructor(e){super(e)}},ta=class extends v{constructor(e){super(e)}g(){return ot(this,K1,1)}},ra=[0,oe,[0,ie,Z,M,-1]],vn=yt(ta,ra),z1=class extends v{constructor(e){super(e)}},Y1=class extends v{constructor(e){super(e)}},Ls=class extends v{constructor(e){super(e)}l(){return O(this,z1,2)}g(){return ot(this,Y1,5)}},na=yt(class extends v{constructor(e){super(e)}},[0,pe,Cr,ks,[0,Te,[0,ie,-3],[0,Z,-3],[0,ie,-1,[0,oe,[0,ie,-2]]],oe,[0,Z,-1,M,Z]],M,-1,mt,oe,[0,ie,Z],pe,mt]),sa=class extends v{constructor(e){super(e)}},lr=yt(class extends v{constructor(e){super(e)}},[0,oe,[0,Z,-4]]),ia=class extends v{constructor(e){super(e)}},Dr=yt(class extends v{constructor(e){super(e)}},[0,oe,[0,Z,-4]]),X1=class extends v{constructor(e){super(e)}},q1=[0,ie,-1,ks,Te],oa=class extends v{constructor(e){super(e)}};oa.prototype.g=mn([0,Z,-4,mt]);var J1=class extends v{constructor(e){super(e)}},$1=yt(class extends v{constructor(e){super(e)}},[0,oe,[0,1,ie,M,ra],mt]),aa=class extends v{constructor(e){super(e)}},Z1=class extends v{constructor(e){super(e)}na(){const e=D(this,1,void 0,void 0,eo);return e??kt()}},Q1=class extends v{constructor(e){super(e)}},ca=[1,2],ec=yt(class extends v{constructor(e){super(e)}},[0,oe,[0,ca,q,[0,ks],q,[0,Bo],ie,M],mt]),Os=class extends v{constructor(e){super(e)}},ua=[0,M,ie,Z,pe,-1],ha=class extends v{constructor(e){super(e)}},tc=[0,X,-1],la=class extends v{constructor(e){super(e)}},yn=[1,2,3,4,5,6],_n=class extends v{constructor(e){super(e)}g(){return D(this,1,void 0,void 0,eo)!=null}l(){return ue(D(this,2))!=null}},H=class extends v{constructor(e){super(e)}g(){return Ui(D(this,2))??!1}},fa=[0,Bo,M,[0,ie,mt,-1],[0,j1,mt]],Q=[0,fa,X,[0,yn,q,Jo,q,Ko,q,Ho,q,qo,q,Yo,q,zo],Te],bn=class extends v{constructor(e){super(e)}},Ps=[0,Q,Z,-1,ie],rc=Qe(502141897,bn);ne[502141897]=Ps;var nc=yt(class extends v{constructor(e){super(e)}},[0,[0,Te,-1,N1,B1],q1]),da=class extends v{constructor(e){super(e)}},pa=class extends v{constructor(e){super(e)}},Rs=[0,Q,Z,[0,Q],X],sc=Qe(508968150,pa);ne[508968150]=[0,Q,Ps,Rs,Z,[0,[0,fa]]],ne[508968149]=Rs;var fr=class extends v{constructor(e){super(e)}l(){return O(this,Os,2)}g(){F(this,2)}},ga=[0,Q,ua];ne[478825465]=ga;var ic=class extends v{constructor(e){super(e)}},ma=class extends v{constructor(e){super(e)}},Fs=class extends v{constructor(e){super(e)}},xs=class extends v{constructor(e){super(e)}},va=class extends v{constructor(e){super(e)}},ya=[0,Q,[0,Q],ga,-1],_a=[0,Q,Z,ie],Ms=[0,Q,Z],ba=[0,Q,_a,Ms,Z],oc=Qe(479097054,va);ne[479097054]=[0,Q,ba,ya],ne[463370452]=ya,ne[464864288]=_a;var ac=Qe(462713202,xs);ne[462713202]=ba,ne[474472470]=Ms;var cc=class extends v{constructor(e){super(e)}},wa=class extends v{constructor(e){super(e)}},Ea=class extends v{constructor(e){super(e)}},Aa=class extends v{constructor(e){super(e)}},Is=[0,Q,Z,-1,ie],Cs=[0,Q,Z,X];Aa.prototype.g=mn([0,Q,Ms,[0,Q],Ps,Rs,Is,Cs]);var ka=class extends v{constructor(e){super(e)}},uc=Qe(456383383,ka);ne[456383383]=[0,Q,ua];var Sa=class extends v{constructor(e){super(e)}},hc=Qe(476348187,Sa);ne[476348187]=[0,Q,tc];var Ta=class extends v{constructor(e){super(e)}},La=class extends v{constructor(e){super(e)}},Oa=[0,Te,-1],lc=Qe(458105876,class extends v{constructor(e){super(e)}g(){let e;var t=this.v;const r=0|t[m];return e=Ae(this,r),t=function(n,s,i,o){var c=La;!o&&Qt(n)&&(i=0|(s=n.v)[m]);var u=it(s,2);if(n=!1,u==null){if(o)return Xi();u=[]}else if(u.constructor===st){if(!(2&u.J)||o)return u;u=u.V()}else Array.isArray(u)?n=!!(2&(0|u[m])):u=[];if(o){if(!u.length)return Xi();n||(n=!0,kr(u))}else n&&(n=!1,Sr(u),u=to(u));return!n&&32&i&&Ar(u,32),i=re(s,i,2,o=new st(u,c,l1,void 0)),n||Pt(s,i),o}(this,t,r,e),!e&&La&&(t.ra=!0),t}});ne[458105876]=[0,Oa,C1,[!0,mt,[0,M,-1,pe]],[0,Cr,X,Te]];var Ns=class extends v{constructor(e){super(e)}},Pa=Qe(458105758,Ns);ne[458105758]=[0,Q,M,Oa];var Ds=class extends v{constructor(e){super(e)}},Ra=[0,D1,-1,Nt],fc=class extends v{constructor(e){super(e)}},Fa=class extends v{constructor(e){super(e)}},js=[1,2];Fa.prototype.g=mn([0,js,q,Ra,q,[0,oe,Ra]]);var xa=class extends v{constructor(e){super(e)}},dc=Qe(443442058,xa);ne[443442058]=[0,Q,M,ie,Z,pe,-1,X,Z],ne[514774813]=Is;var Ma=class extends v{constructor(e){super(e)}},pc=Qe(516587230,Ma);function Bs(e,t){return t=t?t.clone():new Os,e.displayNamesLocale!==void 0?F(t,1,Fr(e.displayNamesLocale)):e.displayNamesLocale===void 0&&F(t,1),e.maxResults!==void 0?at(t,2,e.maxResults):"maxResults"in e&&F(t,2),e.scoreThreshold!==void 0?_(t,3,e.scoreThreshold):"scoreThreshold"in e&&F(t,3),e.categoryAllowlist!==void 0?en(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&F(t,4),e.categoryDenylist!==void 0?en(t,5,e.categoryDenylist):"categoryDenylist"in e&&F(t,5),t}function Ia(e){const t=Number(e);return Number.isSafeInteger(t)?t:String(e)}function Us(e,t=-1,r=""){return{categories:e.map(n=>({index:Me(n,1)??0??-1,score:Y(n,2)??0,categoryName:ue(D(n,3))??""??"",displayName:ue(D(n,4))??""??""})),headIndex:t,headName:r}}function gc(e){const t={classifications:ot(e,J1,1).map(r=>{var n;return Us(((n=O(r,ta,4))==null?void 0:n.g())??[],Me(r,2)??0,ue(D(r,3))??"")})};return function(r){return h1(Nn?D(r,2,void 0,void 0,Jr):D(r,2))}(e)!=null&&(t.timestampMs=Ia(oo(e))),t}function Ca(e){var o,c;var t=Ft(e,3,Je,Rt()),r=Ft(e,2,$t,Rt()),n=Ft(e,1,ue,Rt()),s=Ft(e,9,ue,Rt());const i={categories:[],keypoints:[]};for(let u=0;u<t.length;u++)i.categories.push({score:t[u],index:r[u]??-1,categoryName:n[u]??"",displayName:s[u]??""});if((t=(o=O(e,Ls,4))==null?void 0:o.l())&&(i.boundingBox={originX:Me(t,1,dt)??0,originY:Me(t,2,dt)??0,width:Me(t,3,dt)??0,height:Me(t,4,dt)??0,angle:0}),(c=O(e,Ls,4))==null?void 0:c.g().length)for(const u of O(e,Ls,4).g())i.keypoints.push({x:D(u,1,void 0,dt,Je)??0,y:D(u,2,void 0,dt,Je)??0,score:D(u,4,void 0,dt,Je)??0,label:ue(D(u,3,void 0,dt))??""});return i}function wn(e){const t=[];for(const r of ot(e,ia,1))t.push({x:Y(r,1)??0,y:Y(r,2)??0,z:Y(r,3)??0,visibility:Y(r,4)??0});return t}function jr(e){const t=[];for(const r of ot(e,sa,1))t.push({x:Y(r,1)??0,y:Y(r,2)??0,z:Y(r,3)??0,visibility:Y(r,4)??0});return t}function Na(e){return Array.from(e,t=>t>127?t-256:t)}function Da(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,n=0,s=0;for(let i=0;i<e.length;i++)r+=e[i]*t[i],n+=e[i]*e[i],s+=t[i]*t[i];if(n<=0||s<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*s)}let En;ne[516587230]=[0,Q,Is,Cs,Z],ne[518928384]=Cs;const mc=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]);async function ja(){if(En===void 0)try{await WebAssembly.instantiate(mc),En=!0}catch{En=!1}return En}async function Br(e,t=G1``){const r=await ja()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var Dt=class{};function Ba(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Ua(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,n)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",s=>{n(s)},!1),document.body.appendChild(t)})}try{importScripts(e.toString())}catch(t){if(!(t instanceof TypeError))throw t;await self.import(e.toString())}}function Va(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function y(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Ga(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[n,s]=Va(t);return!e.l||n===e.i.canvas.width&&s===e.i.canvas.height||(e.i.canvas.width=n,e.i.canvas.height=s),[n,s]}function Wa(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const n=new Uint32Array(t.length);for(let s=0;s<t.length;s++)n[s]=e.i.stringToNewUTF8(t[s]);t=e.i._malloc(4*n.length),e.i.HEAPU32.set(n,t>>2),r(t);for(const s of n)e.i._free(s);e.i._free(t)}function et(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function _t(e,t,r){let n=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(s,i,o)=>{i?(r(n,o),n=[]):n.push(s)}}Dt.forVisionTasks=function(e){return Br("vision",e)},Dt.forTextTasks=function(e){return Br("text",e)},Dt.forGenAiExperimentalTasks=function(e){return Br("genai_experimental",e)},Dt.forGenAiTasks=function(e){return Br("genai",e)},Dt.forAudioTasks=function(e){return Br("audio",e)},Dt.isSimdSupported=function(){return ja()};async function vc(e,t,r,n){return e=await(async(s,i,o,c,u)=>{if(i&&await Ua(i),!self.ModuleFactory||o&&(await Ua(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&u&&((i=self.Module).locateFile=u.locateFile,u.mainScriptUrlOrBlob&&(i.mainScriptUrlOrBlob=u.mainScriptUrlOrBlob)),u=await self.ModuleFactory(self.Module||u),self.ModuleFactory=self.Module=void 0,new s(u,c)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:s=>s.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&s.endsWith(".data")?r.assetBinaryPath.toString():s}),await e.o(n),e}function Vs(e,t){const r=O(e.baseOptions,_n,1)||new _n;typeof t=="string"?(F(r,2,Fr(t)),F(r,1)):t instanceof Uint8Array&&(F(r,1,Vn(t,!1)),F(r,2)),w(e.baseOptions,0,1,r)}function Ha(e){try{const t=e.H.length;if(t===1)throw Error(e.H[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.H.map(r=>r.message).join(", "))}finally{e.H=[]}}function g(e,t){e.C=Math.max(e.C,t)}function An(e,t){e.B=new ve,Se(e.B,2,"PassThroughCalculator"),j(e.B,"free_memory"),S(e.B,"free_memory_unused_out"),V(t,"free_memory"),Ce(t,e.B)}function dr(e,t){j(e.B,t),S(e.B,t+"_unused_out")}function kn(e){e.g.addBoolToStream(!0,"free_memory",e.C)}var Gs=class{constructor(e){this.g=e,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var r,n,s,i,o,c;if(t){const u=e.baseOptions||{};if((r=e.baseOptions)!=null&&r.modelAssetBuffer&&((n=e.baseOptions)!=null&&n.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((s=O(this.baseOptions,_n,1))!=null&&s.g()||(i=O(this.baseOptions,_n,1))!=null&&i.l()||(o=e.baseOptions)!=null&&o.modelAssetBuffer||(c=e.baseOptions)!=null&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(f,h){let d=O(f.baseOptions,la,3);if(!d){var b=d=new la,A=new Xo;Mr(b,4,yn,A)}"delegate"in h&&(h.delegate==="GPU"?(h=d,b=new W1,Mr(h,2,yn,b)):(h=d,b=new Xo,Mr(h,4,yn,b))),w(f.baseOptions,0,3,d)}(this,u),u.modelAssetPath)return fetch(u.modelAssetPath.toString()).then(f=>{if(f.ok)return f.arrayBuffer();throw Error(`Failed to fetch model: ${u.modelAssetPath} (${f.status})`)}).then(f=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(f),!0,!1,!1),Vs(this,"/model.dat"),this.m(),this.L()});if(u.modelAssetBuffer instanceof Uint8Array)Vs(this,u.modelAssetBuffer);else if(u.modelAssetBuffer)return async function(f){const h=[];for(var d=0;;){const{done:b,value:A}=await f.read();if(b)break;h.push(A),d+=A.length}if(h.length===0)return new Uint8Array(0);if(h.length===1)return h[0];f=new Uint8Array(d),d=0;for(const b of h)f.set(b,d),d+=b.length;return f}(u.modelAssetBuffer).then(f=>{Vs(this,f),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let e;if(this.g.ca(t=>{e=H1(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,n)=>{this.H.push(Error(n))}),this.g.Ja(),this.g.setGraph(e,t),this.B=void 0,Ha(this)}finishProcessing(){this.g.finishProcessing(),Ha(this)}close(){this.B=void 0,this.g.closeGraph()}};function bt(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Gs.prototype.close=Gs.prototype.close;class yc{constructor(t,r,n,s){this.g=t,this.h=r,this.m=n,this.l=s}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Ka(e,t,r){const n=e.g;if(r=bt(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(e.h,r),r}function za(e,t){const r=e.g,n=bt(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);const s=bt(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(e.O),r.vertexAttribPointer(e.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);const i=bt(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(e.L),r.vertexAttribPointer(e.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new yc(r,n,s,i)}function Ws(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function _c(e,t,r,n){return Ws(e,t),e.h||(e.m(),e.D()),r?(e.u||(e.u=za(e,!0)),r=e.u):(e.A||(e.A=za(e,!1)),r=e.A),t.useProgram(e.h),r.bind(),e.l(),e=n(),r.g.bindVertexArray(null),e}function Ya(e,t,r){return Ws(e,t),e=bt(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Xa(e,t,r){Ws(e,t),e.B||(e.B=bt(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.B),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function bc(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var qa=class{H(){return`
|
|
1
|
+
(function(ze,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react"),require("react-webcam")):typeof define=="function"&&define.amd?define(["exports","react","react-webcam"],N):(ze=typeof globalThis<"u"?globalThis:ze||self,N(ze.LivenessSDK={},ze.React,ze.Webcam))})(this,function(ze,N,D2){"use strict";var Wt=typeof self<"u"?self:{};function Ar(e,t){e:{for(var r=["CLOSURE_FLAGS"],n=Wt,s=0;s<r.length;s++)if((n=n[r[s]])==null){r=null;break e}r=n}return(e=r&&r[e])!=null?e:t}function St(){throw Error("Invalid UTF8")}function gi(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let Jr,Bn;const j2=typeof TextDecoder<"u";let B2;const U2=typeof TextEncoder<"u";function mi(e){if(U2)e=(B2||(B2=new TextEncoder)).encode(e);else{let r=0;const n=new Uint8Array(3*e.length);for(let s=0;s<e.length;s++){var t=e.charCodeAt(s);if(t<128)n[r++]=t;else{if(t<2048)n[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&s<e.length){const i=e.charCodeAt(++s);if(i>=56320&&i<=57343){t=1024*(t-55296)+i-56320+65536,n[r++]=t>>18|240,n[r++]=t>>12&63|128,n[r++]=t>>6&63|128,n[r++]=63&t|128;continue}s--}t=65533}n[r++]=t>>12|224,n[r++]=t>>6&63|128}n[r++]=63&t|128}}e=r===n.length?n:n.subarray(0,r)}return e}function vi(e){Wt.setTimeout(()=>{throw e},0)}var Un,V2=Ar(610401301,!1),yi=Ar(748402147,!0),Vn=Ar(824648567,!0),Gn=Ar(824656860,Ar(1,!0));function _i(){var e=Wt.navigator;return e&&(e=e.userAgent)?e:""}const bi=Wt.navigator;function $r(e){return $r[" "](e),e}Un=bi&&bi.userAgentData||null,$r[" "]=function(){};const wi={};let kr=null;function G2(e){const t=e.length;let r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);const n=new Uint8Array(r);let s=0;return function(i,o){function c(f){for(;u<i.length;){const h=i.charAt(u++),d=kr[h];if(d!=null)return d;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return f}Ei();let u=0;for(;;){const f=c(-1),h=c(0),d=c(64),b=c(64);if(b===64&&f===-1)break;o(f<<2|h>>4),d!=64&&(o(h<<4&240|d>>2),b!=64&&o(d<<6&192|b))}}(e,function(i){n[s++]=i}),s!==r?n.subarray(0,s):n}function Ei(){if(!kr){kr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){const n=e.concat(t[r].split(""));wi[r]=n;for(let s=0;s<n.length;s++){const i=n[s];kr[i]===void 0&&(kr[i]=s)}}}}var W2=typeof Uint8Array<"u",Ai=!(!(V2&&Un&&Un.brands.length>0)&&(_i().indexOf("Trident")!=-1||_i().indexOf("MSIE")!=-1))&&typeof btoa=="function";const ki=/[-_.]/g,H2={"-":"+",_:"/",".":"="};function K2(e){return H2[e]||""}function Si(e){if(!Ai)return G2(e);e=ki.test(e)?e.replace(ki,K2):e,e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function Wn(e){return W2&&e!=null&&e instanceof Uint8Array}var Ht={};function Tt(){return z2||(z2=new Ye(null,Ht))}function Hn(e){Ti(Ht);var t=e.g;return(t=t==null||Wn(t)?t:typeof t=="string"?Si(t):null)==null?t:e.g=t}var Ye=class{h(){return new Uint8Array(Hn(this)||0)}constructor(e,t){if(Ti(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let z2,Y2;function Ti(e){if(e!==Ht)throw Error("illegal external caller")}function Li(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Kn(e){return Li(e=Error(e),"warning"),e}function Kt(e,t){if(e!=null){var r=Y2??(Y2={}),n=r[e]||0;n>=t||(r[e]=n+1,Li(e=Error(),"incident"),vi(e))}}function zt(){return typeof BigInt=="function"}var Yt=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Xe(e,t,r=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?r&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var X2=Xe("jas",void 0,!0),Oi=Xe(void 0,"0di"),Sr=Xe(void 0,"1oa"),Ee=Xe(void 0,Symbol()),q2=Xe(void 0,"0ub"),J2=Xe(void 0,"0ubs"),zn=Xe(void 0,"0ubsb"),$2=Xe(void 0,"0actk"),Xt=Xe("m_m","Pa",!0),Pi=Xe();const Ri={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},Fi=Object.defineProperties,m=Yt?X2:"Ga";var Lt;const xi=[];function Tr(e,t){Yt||m in e||Fi(e,Ri),e[m]|=t}function ee(e,t){Yt||m in e||Fi(e,Ri),e[m]=t}function Lr(e){return Tr(e,34),e}function Or(e){return Tr(e,8192),e}ee(xi,7),Lt=Object.freeze(xi);var qt={};function Ae(e,t){return t===void 0?e.h!==Ot&&!!(2&(0|e.v[m])):!!(2&t)&&e.h!==Ot}const Ot={};function Yn(e,t){if(e!=null){if(typeof e=="string")e=e?new Ye(e,Ht):Tt();else if(e.constructor!==Ye)if(Wn(e))e=e.length?new Ye(new Uint8Array(e),Ht):Tt();else{if(!t)throw Error();e=void 0}}return e}class Mi{constructor(t,r,n){this.g=t,this.h=r,this.l=n}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var Z2=Object.freeze({});function Ii(e,t,r){const n=128&t?0:-1,s=e.length;var i;(i=!!s)&&(i=(i=e[s-1])!=null&&typeof i=="object"&&i.constructor===Object);const o=s+(i?-1:0);for(t=128&t?1:0;t<o;t++)r(t-n,e[t]);if(i){e=e[s-1];for(const c in e)!isNaN(c)&&r(+c,e[c])}}var Ci={};function Jt(e){return 128&e?Ci:void 0}function Zr(e){return e.Na=!0,e}var Q2=Zr(e=>typeof e=="number"),Ni=Zr(e=>typeof e=="string"),e1=Zr(e=>typeof e=="boolean"),Qr=typeof Wt.BigInt=="function"&&typeof Wt.BigInt(0)=="bigint";function ke(e){var t=e;if(Ni(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(Q2(t)&&!Number.isSafeInteger(t))throw Error(String(t));return Qr?BigInt(e):e=e1(e)?e?"1":"0":Ni(e)?e.trim()||"0":String(e)}var Xn=Zr(e=>Qr?e>=r1&&e<=s1:e[0]==="-"?Di(e,t1):Di(e,n1));const t1=Number.MIN_SAFE_INTEGER.toString(),r1=Qr?BigInt(Number.MIN_SAFE_INTEGER):void 0,n1=Number.MAX_SAFE_INTEGER.toString(),s1=Qr?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Di(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){const n=e[r],s=t[r];if(n>s)return!1;if(n<s)return!0}}const i1=typeof Uint8Array.prototype.slice=="function";let o1,U=0,q=0;function ji(e){const t=e>>>0;U=t,q=(e-t)/4294967296>>>0}function $t(e){if(e<0){ji(-e);const[t,r]=Qn(U,q);U=t>>>0,q=r>>>0}else ji(e)}function qn(e){const t=o1||(o1=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),q=0,U=t.getUint32(0,!0)}function Jn(e,t){const r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:Pr(e,t)}function a1(e,t){return ke(zt()?BigInt.asUintN(64,(BigInt(t>>>0)<<BigInt(32))+BigInt(e>>>0)):Pr(e,t))}function $n(e,t){const r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Jn(e,t))=="number"?r?-e:e:r?"-"+e:e}function Bi(e,t){return zt()?ke(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(t))<<BigInt(32))+BigInt.asUintN(32,BigInt(e)))):ke(Zn(e,t))}function Pr(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else zt()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+Ui(r)+Ui(e));return r}function Ui(e){return e=String(e),"0000000".slice(e.length)+e}function Zn(e,t){if(2147483648&t)if(zt())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[r,n]=Qn(e,t);e="-"+Pr(r,n)}else e=Pr(e,t);return e}function en(e){if(e.length<16)$t(Number(e));else if(zt())e=BigInt(e),U=Number(e&BigInt(4294967295))>>>0,q=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");q=U=0;const r=e.length;for(let n=t,s=(r-t)%6+t;s<=r;n=s,s+=6){const i=Number(e.slice(n,s));q*=1e6,U=1e6*U+i,U>=4294967296&&(q+=Math.trunc(U/4294967296),q>>>=0,U>>>=0)}if(t){const[n,s]=Qn(U,q);U=n,q=s}}}function Qn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Ge(e){return Array.prototype.slice.call(e)}const Rr=typeof BigInt=="function"?BigInt.asIntN:void 0,c1=typeof BigInt=="function"?BigInt.asUintN:void 0,Pt=Number.isSafeInteger,tn=Number.isFinite,Zt=Math.trunc,u1=ke(0);function Fr(e){if(e!=null&&typeof e!="number")throw Error(`Value of float/double field must be a number, found ${typeof e}: ${e}`);return e}function qe(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function xr(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error(`Expected boolean but got ${t!="object"?t:e?Array.isArray(e)?"array":t:"null"}: ${e}`)}return e}function Vi(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const h1=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Mr(e){switch(typeof e){case"bigint":return!0;case"number":return tn(e);case"string":return h1.test(e);default:return!1}}function Qt(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return tn(e)?0|e:void 0}function Gi(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return tn(e)?e>>>0:void 0}function Wi(e){const t=e.length;return(e[0]==="-"?t<20||t===20&&e<="-9223372036854775808":t<19||t===19&&e<="9223372036854775807")?e:(en(e),Zn(U,q))}function es(e){return e=Zt(e),Pt(e)||($t(e),e=$n(U,q)),e}function Hi(e){var t=Zt(Number(e));return Pt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Wi(e))}function Ki(e){var t=Zt(Number(e));return Pt(t)?ke(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),zt()?ke(Rr(64,BigInt(e))):ke(Wi(e)))}function zi(e){return Pt(e)?e=ke(es(e)):(e=Zt(e),Pt(e)?e=String(e):($t(e),e=Zn(U,q)),e=ke(e)),e}function l1(e){return e==null?e:typeof e=="bigint"?(Xn(e)?e=Number(e):(e=Rr(64,e),e=Xn(e)?Number(e):String(e)),e):Mr(e)?typeof e=="number"?es(e):Hi(e):void 0}function rn(e){const t=typeof e;return e==null?e:t==="bigint"?ke(Rr(64,e)):Mr(e)?t==="string"?Ki(e):zi(e):void 0}function Yi(e){if(typeof e!="string")throw Error();return e}function Ir(e){if(e!=null&&typeof e!="string")throw Error();return e}function ce(e){return e==null||typeof e=="string"?e:void 0}function ts(e,t,r,n){return e!=null&&e[Xt]===qt?e:Array.isArray(e)?((n=(r=0|e[m])|32&n|2&n)!==r&&ee(e,n),new t(e)):(r?2&n?((e=t[Oi])||(Lr((e=new t).v),e=t[Oi]=e),t=e):t=new t:t=void 0,t)}function f1(e,t,r){if(t)e:{if(!Mr(t=e))throw Kn("int64");switch(typeof t){case"string":t=Ki(t);break e;case"bigint":t=ke(Rr(64,t));break e;default:t=zi(t)}}else t=rn(e);return(e=t)==null?r?u1:void 0:e}const d1={};let p1=function(){try{return $r(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class rs{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}}const g1=p1?(Object.setPrototypeOf(rs.prototype,Map.prototype),Object.defineProperties(rs.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),rs):class extends Map{constructor(){super()}};function Xi(e){return e}function ns(e){if(2&e.J)throw Error("Cannot mutate an immutable Map")}var it=class extends g1{constructor(e,t,r=Xi,n=Xi){super(),this.J=0|e[m],this.K=t,this.S=r,this.fa=this.K?m1:n;for(let s=0;s<e.length;s++){const i=e[s],o=r(i[0],!1,!0);let c=i[1];t?c===void 0&&(c=null):c=n(i[1],!1,!0,void 0,void 0,this.J),super.set(o,c)}}V(e){return Or(Array.from(super.entries(),e))}clear(){ns(this),super.clear()}delete(e){return ns(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new Mi(e,v1,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new Mi(e,it.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.K?super.forEach((r,n,s)=>{e.call(t,s.get(n),n,s)}):super.forEach(e,t)}set(e,t){return ns(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.fa(t,!0,!0,this.K,!1,this.J))}Ma(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.K?e===void 0?null:e:this.fa(e,!1,!0,void 0,!1,this.J),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var r=this.K;return r?((r=this.fa(t,!1,!0,r,this.ra,this.J))!==t&&super.set(e,r),r):t}}[Symbol.iterator](){return this.entries()}};function m1(e,t,r,n,s,i){return e=ts(e,n,r,i),s&&(e=os(e)),e}function v1(e){return[e,this.get(e)]}let y1;function qi(){return y1||(y1=new it(Lr([]),void 0,void 0,void 0,d1))}function nn(e){return Ee?e[Ee]:void 0}function sn(e,t){for(const r in e)!isNaN(r)&&t(e,+r,e[r])}it.prototype.toJSON=void 0;var ss=class{};const _1={Ka:!0};function b1(e,t){t<100||Kt(J2,1)}function on(e,t,r,n){const s=n!==void 0;n=!!n;var i,o=Ee;!s&&Yt&&o&&(i=e[o])&&sn(i,b1),o=[];var c=e.length;let u;i=4294967295;let f=!1;const h=!!(64&t),d=h?128&t?0:-1:void 0;1&t||(u=c&&e[c-1],u!=null&&typeof u=="object"&&u.constructor===Object?i=--c:u=void 0,!h||128&t||s||(f=!0,i=i-d+d)),t=void 0;for(var b=0;b<c;b++){let A=e[b];if(A!=null&&(A=r(A,n))!=null)if(h&&b>=i){const R=b-d;(t??(t={}))[R]=A}else o[b]=A}if(u)for(let A in u){if((c=u[A])==null||(c=r(c,n))==null)continue;let R;b=+A,h&&!Number.isNaN(b)&&(R=b+d)<i?o[R]=c:(t??(t={}))[A]=c}return t&&(f?o.push(t):o[i]=t),s&&Ee&&(e=nn(e))&&e instanceof ss&&(o[Ee]=function(A){const R=new ss;return sn(A,(Ut,Me,ue)=>{R[Me]=Ge(ue)}),R.da=A.da,R}(e)),o}function w1(e){return e[0]=Cr(e[0]),e[1]=Cr(e[1]),e}function Cr(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Xn(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Array.isArray(e)){var t=0|e[m];return e.length===0&&1&t?void 0:on(e,t,Cr)}if(e!=null&&e[Xt]===qt)return Ji(e);if(e instanceof Ye){if((t=e.g)==null)e="";else if(typeof t=="string")e=t;else{if(Ai){for(var r="",n=0,s=t.length-10240;n<s;)r+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?t.subarray(n):t),t=btoa(r)}else{r===void 0&&(r=0),Ei(),r=wi[r],n=Array(Math.floor(t.length/3)),s=r[64]||"";let f=0,h=0;for(;f<t.length-2;f+=3){var i=t[f],o=t[f+1],c=t[f+2],u=r[i>>2];i=r[(3&i)<<4|o>>4],o=r[(15&o)<<2|c>>6],c=r[63&c],n[h++]=u+i+o+c}switch(u=0,c=s,t.length-f){case 2:c=r[(15&(u=t[f+1]))<<2]||s;case 1:t=t[f],n[h]=r[t>>2]+r[(3&t)<<4|u>>4]+c+s}t=n.join("")}e=e.g=t}return e}return e instanceof it?e=e.size!==0?e.V(w1):void 0:void 0}return e}function Ji(e){return on(e=e.v,0|e[m],Cr)}let E1,A1;function Rt(e,t){return $i(e,t[0],t[1])}function $i(e,t,r,n=0){if(e==null){var s=32;r?(e=[r],s|=128):e=[],t&&(s=-16760833&s|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(s=0|e[m],yi&&1&s)throw Error("rfarr");if(2048&s&&!(2&s)&&function(){if(yi)throw Error("carr");Kt($2,5)}(),256&s)throw Error("farr");if(64&s)return(s|n)!==s&&ee(e,s|n),e;if(r&&(s|=128,r!==e[0]))throw Error("mid");e:{s|=64;var i=(r=e).length;if(i){var o=i-1;const u=r[o];if(u!=null&&typeof u=="object"&&u.constructor===Object){if((o-=t=128&s?0:-1)>=1024)throw Error("pvtlmt");for(var c in u)(i=+c)<o&&(r[i+t]=u[c],delete u[c]);s=-16760833&s|(1023&o)<<14;break e}}if(t){if((c=Math.max(t,i-(128&s?0:-1)))>1024)throw Error("spvt");s=-16760833&s|(1023&c)<<14}}}return ee(e,64|s|n),e}function k1(e,t){if(typeof e!="object")return e;if(Array.isArray(e)){var r=0|e[m];return e.length===0&&1&r?void 0:Zi(e,r,t)}if(e!=null&&e[Xt]===qt)return Qi(e);if(e instanceof it){if(2&(t=e.J))return e;if(!e.size)return;if(r=Lr(e.V()),e.K)for(e=0;e<r.length;e++){const n=r[e];let s=n[1];s=s==null||typeof s!="object"?void 0:s!=null&&s[Xt]===qt?Qi(s):Array.isArray(s)?Zi(s,0|s[m],!!(32&t)):void 0,n[1]=s}return r}return e instanceof Ye?e:void 0}function Zi(e,t,r){return 2&t||(!r||4096&t||16&t?e=er(e,t,!1,r&&!(16&t)):(Tr(e,34),4&t&&Object.freeze(e))),e}function is(e,t,r){return e=new e.constructor(t),r&&(e.h=Ot),e.m=Ot,e}function Qi(e){const t=e.v,r=0|t[m];return Ae(e,r)?e:as(e,t,r)?is(e,t):er(t,r)}function er(e,t,r,n){return n??(n=!!(34&t)),e=on(e,t,k1,n),n=32,r&&(n|=2),ee(e,t=16769217&t|n),e}function os(e){const t=e.v,r=0|t[m];return Ae(e,r)?as(e,t,r)?is(e,t,!0):new e.constructor(er(t,r,!1)):e}function tr(e){if(e.h!==Ot)return!1;var t=e.v;return Tr(t=er(t,0|t[m]),2048),e.v=t,e.h=void 0,e.m=void 0,!0}function rr(e){if(!tr(e)&&Ae(e,0|e.v[m]))throw Error()}function Ft(e,t){t===void 0&&(t=0|e[m]),32&t&&!(4096&t)&&ee(e,4096|t)}function as(e,t,r){return!!(2&r)||!(!(32&r)||4096&r)&&(ee(t,2|r),e.h=Ot,!0)}const S1=ke(0),gt={};function D(e,t,r,n,s){if((t=ot(e.v,t,r,s))!==null||n&&e.m!==Ot)return t}function ot(e,t,r,n){if(t===-1)return null;const s=t+(r?0:-1),i=e.length-1;let o,c;if(!(i<1+(r?0:-1))){if(s>=i)if(o=e[i],o!=null&&typeof o=="object"&&o.constructor===Object)r=o[t],c=!0;else{if(s!==i)return;r=o}else r=e[s];if(n&&r!=null){if((n=n(r))==null)return n;if(!Object.is(n,r))return c?o[t]=n:e[s]=n,n}return r}}function x(e,t,r,n){rr(e),te(e=e.v,0|e[m],t,r,n)}function te(e,t,r,n,s){const i=r+(s?0:-1);var o=e.length-1;if(o>=1+(s?0:-1)&&i>=o){const c=e[o];if(c!=null&&typeof c=="object"&&c.constructor===Object)return c[r]=n,t}return i<=o?(e[i]=n,t):(n!==void 0&&(r>=(o=(t??(t=0|e[m]))>>14&1023||536870912)?n!=null&&(e[o+(s?0:-1)]={[r]:n}):e[i]=n),t)}function xt(){return Z2===void 0?2:4}function Mt(e,t,r,n,s){let i=e.v,o=0|i[m];n=Ae(e,o)?1:n,s=!!s||n===3,n===2&&tr(e)&&(i=e.v,o=0|i[m]);let c=(e=cs(i,t))===Lt?7:0|e[m],u=us(c,o);var f=!(4&u);if(f){4&u&&(e=Ge(e),c=0,u=Ct(u,o),o=te(i,o,t,e));let h=0,d=0;for(;h<e.length;h++){const b=r(e[h]);b!=null&&(e[d++]=b)}d<h&&(e.length=d),r=-513&(4|u),u=r&=-1025,u&=-4097}return u!==c&&(ee(e,u),2&u&&Object.freeze(e)),eo(e,u,i,o,t,n,f,s)}function eo(e,t,r,n,s,i,o,c){let u=t;return i===1||i===4&&(2&t||!(16&t)&&32&n)?It(t)||((t|=!e.length||o&&!(4096&t)||32&n&&!(4096&t||16&t)?2:256)!==u&&ee(e,t),Object.freeze(e)):(i===2&&It(t)&&(e=Ge(e),u=0,t=Ct(t,n),n=te(r,n,s,e)),It(t)||(c||(t|=16),t!==u&&ee(e,t))),2&t||!(4096&t||16&t)||Ft(r,n),e}function cs(e,t,r){return e=ot(e,t,r),Array.isArray(e)?e:Lt}function us(e,t){return 2&t&&(e|=2),1|e}function It(e){return!!(2&e)&&!!(4&e)||!!(256&e)}function to(e){return Yn(e,!0)}function ro(e){e=Ge(e);for(let t=0;t<e.length;t++){const r=e[t]=Ge(e[t]);Array.isArray(r[1])&&(r[1]=Lr(r[1]))}return Or(e)}function mt(e,t,r,n){rr(e),te(e=e.v,0|e[m],t,(n==="0"?Number(r)===0:r===n)?void 0:r)}function nr(e,t,r){if(2&t)throw Error();const n=Jt(t);let s=cs(e,r,n),i=s===Lt?7:0|s[m],o=us(i,t);return(2&o||It(o)||16&o)&&(o===i||It(o)||ee(s,o),s=Ge(s),i=0,o=Ct(o,t),te(e,t,r,s,n)),o&=-13,o!==i&&ee(s,o),s}function hs(e,t){var r=ua;return fs(ls(e=e.v),e,void 0,r)===t?t:-1}function ls(e){if(Yt)return e[Sr]??(e[Sr]=new Map);if(Sr in e)return e[Sr];const t=new Map;return Object.defineProperty(e,Sr,{value:t}),t}function no(e,t,r,n,s){const i=ls(e),o=fs(i,e,t,r,s);return o!==n&&(o&&(t=te(e,t,o,void 0,s)),i.set(r,n)),t}function fs(e,t,r,n,s){let i=e.get(n);if(i!=null)return i;i=0;for(let o=0;o<n.length;o++){const c=n[o];ot(t,c,s)!=null&&(i!==0&&(r=te(t,r,i,void 0,s)),i=c)}return e.set(n,i),i}function ds(e,t,r){let n=0|e[m];const s=Jt(n),i=ot(e,r,s);let o;if(i!=null&&i[Xt]===qt){if(!Ae(i))return tr(i),i.v;o=i.v}else Array.isArray(i)&&(o=i);if(o){const c=0|o[m];2&c&&(o=er(o,c))}return o=Rt(o,t),o!==i&&te(e,n,r,o,s),o}function so(e,t,r,n,s){let i=!1;if((n=ot(e,n,s,o=>{const c=ts(o,r,!1,t);return i=c!==o&&c!=null,c}))!=null)return i&&!Ae(n)&&Ft(e,t),n}function O(e,t,r,n){let s=e.v,i=0|s[m];if((t=so(s,i,t,r,n))==null)return t;if(i=0|s[m],!Ae(e,i)){const o=os(t);o!==t&&(tr(e)&&(s=e.v,i=0|s[m]),i=te(s,i,r,t=o,n),Ft(s,i))}return t}function io(e,t,r,n,s,i,o,c){var u=Ae(e,r);i=u?1:i,o=!!o||i===3,u=c&&!u,(i===2||u)&&tr(e)&&(r=0|(t=e.v)[m]);var f=(e=cs(t,s))===Lt?7:0|e[m],h=us(f,r);if(c=!(4&h)){var d=e,b=r;const A=!!(2&h);A&&(b|=2);let R=!A,Ut=!0,Me=0,ue=0;for(;Me<d.length;Me++){const Y=ts(d[Me],n,!1,b);if(Y instanceof n){if(!A){const lt=Ae(Y);R&&(R=!lt),Ut&&(Ut=lt)}d[ue++]=Y}}ue<Me&&(d.length=ue),h|=4,h=Ut?-4097&h:4096|h,h=R?8|h:-9&h}if(h!==f&&(ee(e,h),2&h&&Object.freeze(e)),u&&!(8&h||!e.length&&(i===1||i===4&&(2&h||!(16&h)&&32&r)))){for(It(h)&&(e=Ge(e),h=Ct(h,r),r=te(t,r,s,e)),n=e,u=h,f=0;f<n.length;f++)(d=n[f])!==(h=os(d))&&(n[f]=h);u|=8,ee(e,h=u=n.length?4096|u:-4097&u)}return eo(e,h,t,r,s,i,c,o)}function at(e,t,r){const n=e.v;return io(e,n,0|n[m],t,r,xt(),!1,!0)}function oo(e){return e==null&&(e=void 0),e}function w(e,t,r,n,s){return x(e,r,n=oo(n),s),n&&!Ae(n)&&Ft(e.v),e}function Nr(e,t,r,n){e:{var s=n=oo(n);rr(e);const i=e.v;let o=0|i[m];if(s==null){const c=ls(i);if(fs(c,i,o,r)!==t)break e;c.set(r,0)}else o=no(i,o,r,t);te(i,o,t,s)}n&&!Ae(n)&&Ft(e.v)}function Ct(e,t){return-273&(2&t?2|e:-3&e)}function ps(e,t,r,n){var s=n;rr(e),e=io(e,n=e.v,0|n[m],r,t,2,!0),s=s??new r,e.push(s),t=r=e===Lt?7:0|e[m],(s=Ae(s))?(r&=-9,e.length===1&&(r&=-4097)):r|=4096,r!==t&&ee(e,r),s||Ft(n)}function Ie(e,t,r){return Qt(D(e,t,void 0,r))}function ao(e){return(Gn?D(e,2,void 0,void 0,rn):rn(D(e,2)))??S1}function H(e,t){return D(e,t,void 0,void 0,qe)??0}function ct(e,t,r){if(r!=null){if(typeof r!="number"||!tn(r))throw Kn("int32");r|=0}x(e,t,r)}function _(e,t,r){x(e,t,Fr(r))}function Se(e,t,r){mt(e,t,Ir(r),"")}function an(e,t,r){{rr(e);const o=e.v;let c=0|o[m];if(r==null)te(o,c,t);else{var n=e=r===Lt?7:0|r[m],s=It(e),i=s||Object.isFrozen(r);for(s||(e=0),i||(r=Ge(r),n=0,e=Ct(e,c),i=!1),e|=5,e|=(4&e?512&e?512:1024&e?1024:0:void 0)??(Gn?1024:0),s=0;s<r.length;s++){const u=r[s],f=Yi(u);Object.is(u,f)||(i&&(r=Ge(r),n=0,e=Ct(e,c),i=!1),r[s]=f)}e!==n&&(i&&(r=Ge(r),e=Ct(e,c)),ee(r,e)),te(o,c,t,r)}}}function cn(e,t,r){rr(e),Mt(e,t,ce,2,!0).push(Yi(r))}var sr=class{constructor(e,t,r){if(this.buffer=e,r&&!t)throw Error();this.g=t}};function gs(e,t){if(typeof e=="string")return new sr(Si(e),t);if(Array.isArray(e))return new sr(new Uint8Array(e),t);if(e.constructor===Uint8Array)return new sr(e,!1);if(e.constructor===ArrayBuffer)return e=new Uint8Array(e),new sr(e,!1);if(e.constructor===Ye)return t=Hn(e)||new Uint8Array(0),new sr(t,!0,e);if(e instanceof Uint8Array)return e=e.constructor===Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new sr(e,!1);throw Error()}function ir(e,t){let r,n=0,s=0,i=0;const o=e.h;let c=e.g;do r=o[c++],n|=(127&r)<<i,i+=7;while(i<32&&128&r);if(i>32)for(s|=(127&r)>>4,i=3;i<32&&128&r;i+=7)r=o[c++],s|=(127&r)<<i;if(Nt(e,c),!(128&r))return t(n>>>0,s>>>0);throw Error()}function ms(e){let t=0,r=e.g;const n=r+10,s=e.h;for(;r<n;){const i=s[r++];if(t|=i,(128&i)==0)return Nt(e,r),!!(127&t)}throw Error()}function vt(e){const t=e.h;let r=e.g,n=t[r++],s=127&n;if(128&n&&(n=t[r++],s|=(127&n)<<7,128&n&&(n=t[r++],s|=(127&n)<<14,128&n&&(n=t[r++],s|=(127&n)<<21,128&n&&(n=t[r++],s|=n<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Error();return Nt(e,r),s}function ut(e){return vt(e)>>>0}function un(e){var t=e.h;const r=e.g;var n=t[r],s=t[r+1];const i=t[r+2];return t=t[r+3],Nt(e,e.g+4),e=2*((s=(n<<0|s<<8|i<<16|t<<24)>>>0)>>31)+1,n=s>>>23&255,s&=8388607,n==255?s?NaN:e*(1/0):n==0?1401298464324817e-60*e*s:e*Math.pow(2,n-150)*(s+8388608)}function T1(e){return vt(e)}function Nt(e,t){if(e.g=t,t>e.l)throw Error()}function co(e,t){if(t<0)throw Error();const r=e.g;if((t=r+t)>e.l)throw Error();return e.g=t,r}function uo(e,t){if(t==0)return Tt();var r=co(e,t);return e.Y&&e.j?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):i1?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?Tt():new Ye(r,Ht)}var ho=[];function lo(e,t,r,n){if(fn.length){const s=fn.pop();return s.o(n),s.g.init(e,t,r,n),s}return new L1(e,t,r,n)}function fo(e){e.g.clear(),e.l=-1,e.h=-1,fn.length<100&&fn.push(e)}function po(e){var t=e.g;if(t.g==t.l)return!1;e.m=e.g.g;var r=ut(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5)||t<1)throw Error();return e.l=t,e.h=r,!0}function hn(e){switch(e.h){case 0:e.h!=0?hn(e):ms(e.g);break;case 1:Nt(e=e.g,e.g+8);break;case 2:if(e.h!=2)hn(e);else{var t=ut(e.g);Nt(e=e.g,e.g+t)}break;case 5:Nt(e=e.g,e.g+4);break;case 3:for(t=e.l;;){if(!po(e))throw Error();if(e.h==4){if(e.l!=t)throw Error();break}hn(e)}break;default:throw Error()}}function Dr(e,t,r){const n=e.g.l;var s=ut(e.g);let i=(s=e.g.g+s)-n;if(i<=0&&(e.g.l=s,r(t,e,void 0,void 0,void 0),i=s-e.g.g),i)throw Error();return e.g.g=s,e.g.l=n,t}function vs(e){var t=ut(e.g),r=co(e=e.g,t);if(e=e.h,j2){var n,s=e;(n=Bn)||(n=Bn=new TextDecoder("utf-8",{fatal:!0})),t=r+t,s=r===0&&t===s.length?s:s.subarray(r,t);try{var i=n.decode(s)}catch(c){if(Jr===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),Jr=!0}catch{Jr=!1}}throw!Jr&&(Bn=void 0),c}}else{t=(i=r)+t,r=[];let c,u=null;for(;i<t;){var o=e[i++];o<128?r.push(o):o<224?i>=t?St():(c=e[i++],o<194||(192&c)!=128?(i--,St()):r.push((31&o)<<6|63&c)):o<240?i>=t-1?St():(c=e[i++],(192&c)!=128||o===224&&c<160||o===237&&c>=160||(192&(n=e[i++]))!=128?(i--,St()):r.push((15&o)<<12|(63&c)<<6|63&n)):o<=244?i>=t-2?St():(c=e[i++],(192&c)!=128||c-144+(o<<28)>>30||(192&(n=e[i++]))!=128||(192&(s=e[i++]))!=128?(i--,St()):(o=(7&o)<<18|(63&c)<<12|(63&n)<<6|63&s,o-=65536,r.push(55296+(o>>10&1023),56320+(1023&o)))):St(),r.length>=8192&&(u=gi(u,r),r.length=0)}i=gi(u,r)}return i}function go(e){const t=ut(e.g);return uo(e.g,t)}function ln(e,t,r){var n=ut(e.g);for(n=e.g.g+n;e.g.g<n;)r.push(t(e.g))}var L1=class{constructor(e,t,r,n){if(ho.length){const s=ho.pop();s.init(e,t,r,n),e=s}else e=new class{constructor(s,i,o,c){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(s,i,o,c)}init(s,i,o,{Y:c=!1,ea:u=!1}={}){this.Y=c,this.ea=u,s&&(s=gs(s,this.ea),this.h=s.buffer,this.j=s.g,this.m=i||0,this.l=o!==void 0?this.m+o:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(e,t,r,n);this.g=e,this.m=this.g.g,this.h=this.l=-1,this.o(n)}o({ha:e=!1}={}){this.ha=e}},fn=[];function mo(e){return e?/^\d+$/.test(e)?(en(e),new ys(U,q)):null:O1||(O1=new ys(0,0))}var ys=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let O1;function vo(e){return e?/^-?\d+$/.test(e)?(en(e),new _s(U,q)):null:P1||(P1=new _s(0,0))}var _s=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let P1;function or(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function ar(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function dn(e,t){if(t>=0)ar(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function bs(e){var t=U;e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function cr(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function Ce(e,t,r){ar(e.g,8*t+r)}function ws(e,t){return Ce(e,t,2),t=e.g.end(),cr(e,t),t.push(e.h),t}function Es(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function pn(e,t,r){Ce(e,t,2),ar(e.g,r.length),cr(e,e.g.end()),cr(e,r)}function gn(e,t,r,n){r!=null&&(t=ws(e,t),n(r,e),Es(e,t))}function Je(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var As=Je(),yo=Je(),ks=Je(),Ss=Je(),_o=Je(),bo=Je(),R1=Je(),mn=Je(),wo=Je(),Eo=Je();function $e(e,t,r){var n=e.v;Ee&&Ee in n&&(n=n[Ee])&&delete n[t.g],t.h?t.j(e,t.h,t.g,r,t.l):t.j(e,t.g,r,t.l)}var v=class{constructor(e,t){this.v=$i(e,t,void 0,2048)}toJSON(){return Ji(this)}j(){var s;var e=fc,t=this.v,r=e.g,n=Ee;if(Yt&&n&&((s=t[n])==null?void 0:s[r])!=null&&Kt(q2,3),t=e.g,Pi&&Ee&&Pi===void 0&&(n=(r=this.v)[Ee])&&(n=n.da))try{n(r,t,_1)}catch(i){vi(i)}return e.h?e.m(this,e.h,e.g,e.l):e.m(this,e.g,e.defaultValue,e.l)}clone(){const e=this.v,t=0|e[m];return as(this,e,t)?is(this,e,!0):new this.constructor(er(e,t,!1))}};v.prototype[Xt]=qt,v.prototype.toString=function(){return this.v.toString()};var ur=class{constructor(e,t,r){this.g=e,this.h=t,e=As,this.l=!!e&&r===e||!1}};function vn(e,t){return new ur(e,t,As)}function Ao(e,t,r,n,s){gn(e,r,Po(t,n),s)}const F1=vn(function(e,t,r,n,s){return e.h===2&&(Dr(e,ds(t,n,r),s),!0)},Ao),x1=vn(function(e,t,r,n,s){return e.h===2&&(Dr(e,ds(t,n,r),s),!0)},Ao);var yn=Symbol(),_n=Symbol(),Ts=Symbol(),ko=Symbol(),So=Symbol();let To,Lo;function Dt(e,t,r,n){var s=n[e];if(s)return s;(s={}).qa=n,s.T=function(d){switch(typeof d){case"boolean":return E1||(E1=[0,void 0,!0]);case"number":return d>0?void 0:d===0?A1||(A1=[0,void 0]):[-d,void 0];case"string":return[0,d];case"object":return d}}(n[0]);var i=n[1];let o=1;i&&i.constructor===Object&&(s.ba=i,typeof(i=n[++o])=="function"&&(s.ma=!0,To??(To=i),Lo??(Lo=n[o+1]),i=n[o+=2]));const c={};for(;i&&Array.isArray(i)&&i.length&&typeof i[0]=="number"&&i[0]>0;){for(var u=0;u<i.length;u++)c[i[u]]=i;i=n[++o]}for(u=1;i!==void 0;){let d;typeof i=="number"&&(u+=i,i=n[++o]);var f=void 0;if(i instanceof ur?d=i:(d=F1,o--),d==null?void 0:d.l){i=n[++o],f=n;var h=o;typeof i=="function"&&(i=i(),f[h]=i),f=i}for(h=u+1,typeof(i=n[++o])=="number"&&i<0&&(h-=i,i=n[++o]);u<h;u++){const b=c[u];f?r(s,u,d,f,b):t(s,u,d,b)}}return n[e]=s}function Oo(e){return Array.isArray(e)?e[0]instanceof ur?e:[x1,e]:[e,void 0]}function Po(e,t){return e instanceof v?e.v:Array.isArray(e)?Rt(e,t):void 0}function Ls(e,t,r,n){const s=r.g;e[t]=n?(i,o,c)=>s(i,o,c,n):s}function Os(e,t,r,n,s){const i=r.g;let o,c;e[t]=(u,f,h)=>i(u,f,h,c||(c=Dt(_n,Ls,Os,n).T),o||(o=Ps(n)),s)}function Ps(e){let t=e[Ts];if(t!=null)return t;const r=Dt(_n,Ls,Os,e);return t=r.ma?(n,s)=>To(n,s,r):(n,s)=>{for(;po(s)&&s.h!=4;){var i=s.l,o=r[i];if(o==null){var c=r.ba;c&&(c=c[i])&&(c=I1(c))!=null&&(o=r[i]=c)}if(o==null||!o(s,n,i)){if(o=(c=s).m,hn(c),c.ha)var u=void 0;else u=c.g.g-o,c.g.g=o,u=uo(c.g,u);o=void 0,c=n,u&&((o=c[Ee]??(c[Ee]=new ss))[i]??(o[i]=[])).push(u)}}return(n=nn(n))&&(n.da=r.qa[So]),!0},e[Ts]=t,e[So]=M1.bind(e),t}function M1(e,t,r,n){var s=this[_n];const i=this[Ts],o=Rt(void 0,s.T),c=nn(e);if(c){var u=!1,f=s.ba;if(f){if(s=(h,d,b)=>{if(b.length!==0)if(f[d])for(const A of b){h=lo(A);try{u=!0,i(o,h)}finally{fo(h)}}else n==null||n(e,d,b)},t==null)sn(c,s);else if(c!=null){const h=c[t];h&&s(c,t,h)}if(u){let h=0|e[m];if(2&h&&2048&h&&!(r!=null&&r.Ka))throw Error();const d=Jt(h),b=(A,R)=>{if(ot(e,A,d)!=null){if((r==null?void 0:r.Qa)===1)return;throw Error()}R!=null&&(h=te(e,h,A,R,d)),delete c[A]};t==null?Ii(o,0|o[m],(A,R)=>{b(A,R)}):b(t,ot(o,t,d))}}}}function I1(e){const t=(e=Oo(e))[0].g;if(e=e[1]){const r=Ps(e),n=Dt(_n,Ls,Os,e).T;return(s,i,o)=>t(s,i,o,n,r)}return t}function bn(e,t,r){e[t]=r.h}function wn(e,t,r,n){let s,i;const o=r.h;e[t]=(c,u,f)=>o(c,u,f,i||(i=Dt(yn,bn,wn,n).T),s||(s=Ro(n)))}function Ro(e){let t=e[ko];if(!t){const r=Dt(yn,bn,wn,e);t=(n,s)=>Fo(n,s,r),e[ko]=t}return t}function Fo(e,t,r){Ii(e,0|e[m],(n,s)=>{if(s!=null){var i=function(o,c){var u=o[c];if(u)return u;if((u=o.ba)&&(u=u[c])){var f=(u=Oo(u))[0].h;if(u=u[1]){const h=Ro(u),d=Dt(yn,bn,wn,u).T;u=o.ma?Lo(d,h):(b,A,R)=>f(b,A,R,d,h)}else u=f;return o[c]=u}}(r,n);i?i(t,s,n):n<500||Kt(zn,3)}}),(e=nn(e))&&sn(e,(n,s,i)=>{for(cr(t,t.g.end()),n=0;n<i.length;n++)cr(t,Hn(i[n])||new Uint8Array(0))})}const C1=ke(0);function hr(e,t){if(Array.isArray(t)){var r=0|t[m];if(4&r)return t;for(var n=0,s=0;n<t.length;n++){const i=e(t[n]);i!=null&&(t[s++]=i)}return s<n&&(t.length=s),(e=-1537&(5|r))!==r&&ee(t,e),2&e&&Object.freeze(t),t}}function ge(e,t,r){return new ur(e,t,r)}function lr(e,t,r){return new ur(e,t,r)}function se(e,t,r){te(e,0|e[m],t,r,Jt(0|e[m]))}var N1=vn(function(e,t,r,n,s){if(e.h!==2)return!1;if(e=Ge(e=Dr(e,Rt([void 0,void 0],n),s)),s=Jt(n=0|t[m]),2&n)throw Error();let i=ot(t,r,s);if(i instanceof it)2&i.J?(i=i.V(),i.push(e),te(t,n,r,i,s)):i.Ma(e);else if(Array.isArray(i)){var o=0|i[m];8192&o||ee(i,o|=8192),2&o&&(i=ro(i),te(t,n,r,i,s)),i.push(e)}else te(t,n,r,Or([e]),s);return!0},function(e,t,r,n,s){if(t instanceof it)t.forEach((i,o)=>{gn(e,r,Rt([o,i],n),s)});else if(Array.isArray(t)){for(let i=0;i<t.length;i++){const o=t[i];Array.isArray(o)&&gn(e,r,Rt(o,n),s)}Or(t)}});function xo(e,t,r){(t=qe(t))!=null&&(Ce(e,r,5),e=e.g,qn(t),bs(e))}function Mo(e,t,r){if(t=function(n){if(n==null)return n;const s=typeof n;if(s==="bigint")return String(Rr(64,n));if(Mr(n)){if(s==="string")return Hi(n);if(s==="number")return es(n)}}(t),t!=null&&(typeof t=="string"&&vo(t),t!=null))switch(Ce(e,r,0),typeof t){case"number":e=e.g,$t(t),or(e,U,q);break;case"bigint":r=BigInt.asUintN(64,t),r=new _s(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),or(e.g,r.h,r.g);break;default:r=vo(t),or(e.g,r.h,r.g)}}function Io(e,t,r){(t=Qt(t))!=null&&t!=null&&(Ce(e,r,0),dn(e.g,t))}function Co(e,t,r){(t=Vi(t))!=null&&(Ce(e,r,0),e.g.g.push(t?1:0))}function No(e,t,r){(t=ce(t))!=null&&pn(e,r,mi(t))}function Do(e,t,r,n,s){gn(e,r,Po(t,n),s)}function jo(e,t,r){(t=t==null||typeof t=="string"||t instanceof Ye?t:void 0)!=null&&pn(e,r,gs(t,!0).buffer)}function Bo(e,t,r){return(e.h===5||e.h===2)&&(t=nr(t,0|t[m],r),e.h==2?ln(e,un,t):t.push(un(e.g)),!0)}var J=ge(function(e,t,r){return e.h===5&&(se(t,r,un(e.g)),!0)},xo,mn),D1=lr(Bo,function(e,t,r){if((t=hr(qe,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Ce(n,s,5),n=n.g,qn(i),bs(n))}},mn),Rs=lr(Bo,function(e,t,r){if((t=hr(qe,t))!=null&&t.length){Ce(e,r,2),ar(e.g,4*t.length);for(let n=0;n<t.length;n++)r=e.g,qn(t[n]),bs(r)}},mn),j1=ge(function(e,t,r){return e.h===5&&(se(t,r,(e=un(e.g))===0?void 0:e),!0)},xo,mn),yt=ge(function(e,t,r){return Vn?(e.h!==0?e=!1:(se(t,r,ir(e.g,Bi)),e=!0),e):e.h===0&&(se(t,r,ir(e.g,$n)),!0)},Mo,bo),Fs=ge(function(e,t,r){return Vn?(e.h!==0?t=!1:(se(t,r,(e=ir(e.g,Bi))===C1?void 0:e),t=!0),t):e.h===0&&(se(t,r,(e=ir(e.g,$n))===0?void 0:e),!0)},Mo,bo),B1=ge(function(e,t,r){return Vn?(e.h!==0?e=!1:(se(t,r,ir(e.g,a1)),e=!0),e):e.h===0&&(se(t,r,ir(e.g,Jn)),!0)},function(e,t,r){if(t=function(n){if(n==null)return n;var s=typeof n;if(s==="bigint")return String(c1(64,n));if(Mr(n)){if(s==="string")return s=Zt(Number(n)),Pt(s)&&s>=0?n=String(s):((s=n.indexOf("."))!==-1&&(n=n.substring(0,s)),(s=n[0]!=="-"&&((s=n.length)<20||s===20&&n<="18446744073709551615"))||(en(n),n=Pr(U,q))),n;if(s==="number")return(n=Zt(n))>=0&&Pt(n)||($t(n),n=Jn(U,q)),n}}(t),t!=null&&(typeof t=="string"&&mo(t),t!=null))switch(Ce(e,r,0),typeof t){case"number":e=e.g,$t(t),or(e,U,q);break;case"bigint":r=BigInt.asUintN(64,t),r=new ys(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),or(e.g,r.h,r.g);break;default:r=mo(t),or(e.g,r.h,r.g)}},R1),ie=ge(function(e,t,r){return e.h===0&&(se(t,r,vt(e.g)),!0)},Io,Ss),jr=lr(function(e,t,r){return(e.h===0||e.h===2)&&(t=nr(t,0|t[m],r),e.h==2?ln(e,vt,t):t.push(vt(e.g)),!0)},function(e,t,r){if((t=hr(Qt,t))!=null&&t.length){r=ws(e,r);for(let n=0;n<t.length;n++)dn(e.g,t[n]);Es(e,r)}},Ss),fr=ge(function(e,t,r){return e.h===0&&(se(t,r,(e=vt(e.g))===0?void 0:e),!0)},Io,Ss),K=ge(function(e,t,r){return e.h===0&&(se(t,r,ms(e.g)),!0)},Co,yo),jt=ge(function(e,t,r){return e.h===0&&(se(t,r,(e=ms(e.g))===!1?void 0:e),!0)},Co,yo),de=lr(function(e,t,r){return e.h===2&&(e=vs(e),nr(t,0|t[m],r).push(e),!0)},function(e,t,r){if((t=hr(ce,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&pn(n,s,mi(i))}},ks),_t=ge(function(e,t,r){return e.h===2&&(se(t,r,(e=vs(e))===""?void 0:e),!0)},No,ks),I=ge(function(e,t,r){return e.h===2&&(se(t,r,vs(e)),!0)},No,ks),oe=function(e,t,r=As){return new ur(e,t,r)}(function(e,t,r,n,s){return e.h===2&&(n=Rt(void 0,n),nr(t,0|t[m],r).push(n),Dr(e,n,s),!0)},function(e,t,r,n,s){if(Array.isArray(t)){for(let i=0;i<t.length;i++)Do(e,t[i],r,n,s);1&(e=0|t[m])||ee(t,1|e)}}),z=vn(function(e,t,r,n,s,i){if(e.h!==2)return!1;let o=0|t[m];return no(t,o,i,r,Jt(o)),Dr(e,t=ds(t,n,r),s),!0},Do),Uo=ge(function(e,t,r){return e.h===2&&(se(t,r,go(e)),!0)},jo,wo),U1=lr(function(e,t,r){return(e.h===0||e.h===2)&&(t=nr(t,0|t[m],r),e.h==2?ln(e,ut,t):t.push(ut(e.g)),!0)},function(e,t,r){if((t=hr(Gi,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Ce(n,s,0),ar(n.g,i))}},_o),V1=ge(function(e,t,r){return e.h===0&&(se(t,r,(e=ut(e.g))===0?void 0:e),!0)},function(e,t,r){(t=Gi(t))!=null&&t!=null&&(Ce(e,r,0),ar(e.g,t))},_o),Te=ge(function(e,t,r){return e.h===0&&(se(t,r,vt(e.g)),!0)},function(e,t,r){(t=Qt(t))!=null&&(t=parseInt(t,10),Ce(e,r,0),dn(e.g,t))},Eo);class G1{constructor(t,r){var n=Le;this.g=t,this.h=r,this.m=O,this.j=w,this.defaultValue=void 0,this.l=n.Oa!=null?Ci:void 0}register(){$r(this)}}function Ze(e,t){return new G1(e,t)}function bt(e,t){return(r,n)=>{{const i={ea:!0};n&&Object.assign(i,n),r=lo(r,void 0,void 0,i);try{const o=new e,c=o.v;Ps(t)(c,r);var s=o}finally{fo(r)}}return s}}function En(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};Fo(this.v,t,Dt(yn,bn,wn,e)),cr(t,t.g.end());const r=new Uint8Array(t.h),n=t.l,s=n.length;let i=0;for(let o=0;o<s;o++){const c=n[o];r.set(c,i),i+=c.length}return t.l=[r],r}}var Vo=class extends v{constructor(e){super(e)}},Go=[0,_t,ge(function(e,t,r){return e.h===2&&(se(t,r,(e=go(e))===Tt()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof v){const n=t.Ra;return void(n?(t=n(t),t!=null&&pn(e,r,gs(t,!0).buffer)):Kt(zn,3))}if(Array.isArray(t))return void Kt(zn,3)}jo(e,t,r)},wo)];let xs,Wo=globalThis.trustedTypes;function Ho(e){var t;return xs===void 0&&(xs=function(){let r=null;if(!Wo)return r;try{const n=s=>s;r=Wo.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return r}()),e=(t=xs)?t.createScriptURL(e):e,new class{constructor(r){this.g=r}toString(){return this.g+""}}(e)}function W1(e,...t){if(t.length===0)return Ho(e[0]);let r=e[0];for(let n=0;n<t.length;n++)r+=encodeURIComponent(t[n])+e[n+1];return Ho(r)}var Ko=[0,ie,Te,K,-1,jr,Te,-1,K],H1=class extends v{constructor(e){super(e)}},zo=[0,K,I,K,Te,-1,lr(function(e,t,r){return(e.h===0||e.h===2)&&(t=nr(t,0|t[m],r),e.h==2?ln(e,T1,t):t.push(vt(e.g)),!0)},function(e,t,r){if((t=hr(Qt,t))!=null&&t.length){r=ws(e,r);for(let n=0;n<t.length;n++)dn(e.g,t[n]);Es(e,r)}},Eo),I,-1,[0,K,-1],Te,K,-1],Yo=[0,3,K,-1,2,[0,ie],[0,Te,K],[0,I,-1],[0]],Xo=[0,I,-2],qo=class extends v{constructor(e){super(e)}},Jo=[0],$o=[0,ie,K,1,K,-4],Le=class extends v{constructor(e){super(e,2)}},re={};re[336783863]=[0,I,K,-1,ie,[0,[1,2,3,4,5,6,7,8,9],z,Jo,z,zo,z,Xo,z,$o,z,Ko,z,[0,I,-2],z,[0,I,Te],z,Yo,z,[0,Te,-1,K]],[0,I],K,[0,[1,3],[2,4],z,[0,jr],-1,z,[0,de],-1,oe,[0,I,-1]],I];var Zo=[0,Fs,-1,jt,-3,Fs,jr,_t,fr,Fs,-1,jt,fr,jt,-2,_t];function j(e,t){cn(e,3,t)}function S(e,t){cn(e,4,t)}var ve=class extends v{constructor(e){super(e,500)}o(e){return w(this,0,7,e)}},Br=[-1,{}],Qo=[0,I,1,Br],ea=[0,I,de,Br];function Ne(e,t){ps(e,1,ve,t)}function V(e,t){cn(e,10,t)}function P(e,t){cn(e,15,t)}var Oe=class extends v{constructor(e){super(e,500)}o(e){return w(this,0,1001,e)}},ta=[-500,oe,[-500,_t,-1,de,-3,[-2,re,K],oe,Go,fr,-1,Qo,ea,oe,[0,_t,jt],_t,Zo,fr,de,987,de],4,oe,[-500,I,-1,[-1,{}],998,I],oe,[-500,I,de,-1,[-2,{},K],997,de,-1],fr,oe,[-500,I,de,Br,998,de],de,fr,Qo,ea,oe,[0,_t,-1,Br],de,-2,Zo,_t,-1,jt,[0,jt,V1],978,Br,oe,Go];Oe.prototype.g=En(ta);var K1=bt(Oe,ta),z1=class extends v{constructor(e){super(e)}},ra=class extends v{constructor(e){super(e)}g(){return at(this,z1,1)}},na=[0,oe,[0,ie,J,I,-1]],An=bt(ra,na),Y1=class extends v{constructor(e){super(e)}},X1=class extends v{constructor(e){super(e)}},Ms=class extends v{constructor(e){super(e)}l(){return O(this,Y1,2)}g(){return at(this,X1,5)}},sa=bt(class extends v{constructor(e){super(e)}},[0,de,jr,Rs,[0,Te,[0,ie,-3],[0,J,-3],[0,ie,-1,[0,oe,[0,ie,-2]]],oe,[0,J,-1,I,J]],I,-1,yt,oe,[0,ie,J],de,yt]),ia=class extends v{constructor(e){super(e)}},dr=bt(class extends v{constructor(e){super(e)}},[0,oe,[0,J,-4]]),oa=class extends v{constructor(e){super(e)}},Ur=bt(class extends v{constructor(e){super(e)}},[0,oe,[0,J,-4]]),q1=class extends v{constructor(e){super(e)}},J1=[0,ie,-1,Rs,Te],aa=class extends v{constructor(e){super(e)}};aa.prototype.g=En([0,J,-4,yt]);var $1=class extends v{constructor(e){super(e)}},Z1=bt(class extends v{constructor(e){super(e)}},[0,oe,[0,1,ie,I,na],yt]),ca=class extends v{constructor(e){super(e)}},Q1=class extends v{constructor(e){super(e)}na(){const e=D(this,1,void 0,void 0,to);return e??Tt()}},ec=class extends v{constructor(e){super(e)}},ua=[1,2],tc=bt(class extends v{constructor(e){super(e)}},[0,oe,[0,ua,z,[0,Rs],z,[0,Uo],ie,I],yt]),Is=class extends v{constructor(e){super(e)}},ha=[0,I,ie,J,de,-1],la=class extends v{constructor(e){super(e)}},rc=[0,K,-1],fa=class extends v{constructor(e){super(e)}},kn=[1,2,3,4,5,6],Sn=class extends v{constructor(e){super(e)}g(){return D(this,1,void 0,void 0,to)!=null}l(){return ce(D(this,2))!=null}},W=class extends v{constructor(e){super(e)}g(){return Vi(D(this,2))??!1}},da=[0,Uo,I,[0,ie,yt,-1],[0,B1,yt]],$=[0,da,K,[0,kn,z,$o,z,zo,z,Ko,z,Jo,z,Xo,z,Yo],Te],Tn=class extends v{constructor(e){super(e)}},Cs=[0,$,J,-1,ie],nc=Ze(502141897,Tn);re[502141897]=Cs;var sc=bt(class extends v{constructor(e){super(e)}},[0,[0,Te,-1,D1,U1],J1]),pa=class extends v{constructor(e){super(e)}},ga=class extends v{constructor(e){super(e)}},Ns=[0,$,J,[0,$],K],ic=Ze(508968150,ga);re[508968150]=[0,$,Cs,Ns,J,[0,[0,da]]],re[508968149]=Ns;var pr=class extends v{constructor(e){super(e)}l(){return O(this,Is,2)}g(){x(this,2)}},ma=[0,$,ha];re[478825465]=ma;var oc=class extends v{constructor(e){super(e)}},va=class extends v{constructor(e){super(e)}},Ds=class extends v{constructor(e){super(e)}},js=class extends v{constructor(e){super(e)}},ya=class extends v{constructor(e){super(e)}},_a=[0,$,[0,$],ma,-1],ba=[0,$,J,ie],Bs=[0,$,J],wa=[0,$,ba,Bs,J],ac=Ze(479097054,ya);re[479097054]=[0,$,wa,_a],re[463370452]=_a,re[464864288]=ba;var cc=Ze(462713202,js);re[462713202]=wa,re[474472470]=Bs;var uc=class extends v{constructor(e){super(e)}},Ea=class extends v{constructor(e){super(e)}},Aa=class extends v{constructor(e){super(e)}},ka=class extends v{constructor(e){super(e)}},Us=[0,$,J,-1,ie],Vs=[0,$,J,K];ka.prototype.g=En([0,$,Bs,[0,$],Cs,Ns,Us,Vs]);var Sa=class extends v{constructor(e){super(e)}},hc=Ze(456383383,Sa);re[456383383]=[0,$,ha];var Ta=class extends v{constructor(e){super(e)}},lc=Ze(476348187,Ta);re[476348187]=[0,$,rc];var La=class extends v{constructor(e){super(e)}},Oa=class extends v{constructor(e){super(e)}},Pa=[0,Te,-1],fc=Ze(458105876,class extends v{constructor(e){super(e)}g(){let e;var t=this.v;const r=0|t[m];return e=Ae(this,r),t=function(n,s,i,o){var c=Oa;!o&&tr(n)&&(i=0|(s=n.v)[m]);var u=ot(s,2);if(n=!1,u==null){if(o)return qi();u=[]}else if(u.constructor===it){if(!(2&u.J)||o)return u;u=u.V()}else Array.isArray(u)?n=!!(2&(0|u[m])):u=[];if(o){if(!u.length)return qi();n||(n=!0,Lr(u))}else n&&(n=!1,Or(u),u=ro(u));return!n&&32&i&&Tr(u,32),i=te(s,i,2,o=new it(u,c,f1,void 0)),n||Ft(s,i),o}(this,t,r,e),!e&&Oa&&(t.ra=!0),t}});re[458105876]=[0,Pa,N1,[!0,yt,[0,I,-1,de]],[0,jr,K,Te]];var Gs=class extends v{constructor(e){super(e)}},Ra=Ze(458105758,Gs);re[458105758]=[0,$,I,Pa];var Ws=class extends v{constructor(e){super(e)}},Fa=[0,j1,-1,jt],dc=class extends v{constructor(e){super(e)}},xa=class extends v{constructor(e){super(e)}},Hs=[1,2];xa.prototype.g=En([0,Hs,z,Fa,z,[0,oe,Fa]]);var Ma=class extends v{constructor(e){super(e)}},pc=Ze(443442058,Ma);re[443442058]=[0,$,I,ie,J,de,-1,K,J],re[514774813]=Us;var Ia=class extends v{constructor(e){super(e)}},gc=Ze(516587230,Ia);function Ks(e,t){return t=t?t.clone():new Is,e.displayNamesLocale!==void 0?x(t,1,Ir(e.displayNamesLocale)):e.displayNamesLocale===void 0&&x(t,1),e.maxResults!==void 0?ct(t,2,e.maxResults):"maxResults"in e&&x(t,2),e.scoreThreshold!==void 0?_(t,3,e.scoreThreshold):"scoreThreshold"in e&&x(t,3),e.categoryAllowlist!==void 0?an(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&x(t,4),e.categoryDenylist!==void 0?an(t,5,e.categoryDenylist):"categoryDenylist"in e&&x(t,5),t}function Ca(e){const t=Number(e);return Number.isSafeInteger(t)?t:String(e)}function zs(e,t=-1,r=""){return{categories:e.map(n=>({index:Ie(n,1)??0??-1,score:H(n,2)??0,categoryName:ce(D(n,3))??""??"",displayName:ce(D(n,4))??""??""})),headIndex:t,headName:r}}function mc(e){const t={classifications:at(e,$1,1).map(r=>{var n;return zs(((n=O(r,ra,4))==null?void 0:n.g())??[],Ie(r,2)??0,ce(D(r,3))??"")})};return function(r){return l1(Gn?D(r,2,void 0,void 0,rn):D(r,2))}(e)!=null&&(t.timestampMs=Ca(ao(e))),t}function Na(e){var o,c;var t=Mt(e,3,qe,xt()),r=Mt(e,2,Qt,xt()),n=Mt(e,1,ce,xt()),s=Mt(e,9,ce,xt());const i={categories:[],keypoints:[]};for(let u=0;u<t.length;u++)i.categories.push({score:t[u],index:r[u]??-1,categoryName:n[u]??"",displayName:s[u]??""});if((t=(o=O(e,Ms,4))==null?void 0:o.l())&&(i.boundingBox={originX:Ie(t,1,gt)??0,originY:Ie(t,2,gt)??0,width:Ie(t,3,gt)??0,height:Ie(t,4,gt)??0,angle:0}),(c=O(e,Ms,4))==null?void 0:c.g().length)for(const u of O(e,Ms,4).g())i.keypoints.push({x:D(u,1,void 0,gt,qe)??0,y:D(u,2,void 0,gt,qe)??0,score:D(u,4,void 0,gt,qe)??0,label:ce(D(u,3,void 0,gt))??""});return i}function Ln(e){const t=[];for(const r of at(e,oa,1))t.push({x:H(r,1)??0,y:H(r,2)??0,z:H(r,3)??0,visibility:H(r,4)??0});return t}function Vr(e){const t=[];for(const r of at(e,ia,1))t.push({x:H(r,1)??0,y:H(r,2)??0,z:H(r,3)??0,visibility:H(r,4)??0});return t}function Da(e){return Array.from(e,t=>t>127?t-256:t)}function ja(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,n=0,s=0;for(let i=0;i<e.length;i++)r+=e[i]*t[i],n+=e[i]*e[i],s+=t[i]*t[i];if(n<=0||s<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*s)}let On;re[516587230]=[0,$,Us,Vs,J],re[518928384]=Vs;const vc=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]);async function Ba(){if(On===void 0)try{await WebAssembly.instantiate(vc),On=!0}catch{On=!1}return On}async function Gr(e,t=W1``){const r=await Ba()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var Bt=class{};function Ua(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Va(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,n)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",s=>{n(s)},!1),document.body.appendChild(t)})}try{importScripts(e.toString())}catch(t){if(!(t instanceof TypeError))throw t;await self.import(e.toString())}}function Ga(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function y(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Wa(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[n,s]=Ga(t);return!e.l||n===e.i.canvas.width&&s===e.i.canvas.height||(e.i.canvas.width=n,e.i.canvas.height=s),[n,s]}function Ha(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const n=new Uint32Array(t.length);for(let s=0;s<t.length;s++)n[s]=e.i.stringToNewUTF8(t[s]);t=e.i._malloc(4*n.length),e.i.HEAPU32.set(n,t>>2),r(t);for(const s of n)e.i._free(s);e.i._free(t)}function Qe(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function wt(e,t,r){let n=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(s,i,o)=>{i?(r(n,o),n=[]):n.push(s)}}Bt.forVisionTasks=function(e){return Gr("vision",e)},Bt.forTextTasks=function(e){return Gr("text",e)},Bt.forGenAiExperimentalTasks=function(e){return Gr("genai_experimental",e)},Bt.forGenAiTasks=function(e){return Gr("genai",e)},Bt.forAudioTasks=function(e){return Gr("audio",e)},Bt.isSimdSupported=function(){return Ba()};async function yc(e,t,r,n){return e=await(async(s,i,o,c,u)=>{if(i&&await Va(i),!self.ModuleFactory||o&&(await Va(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&u&&((i=self.Module).locateFile=u.locateFile,u.mainScriptUrlOrBlob&&(i.mainScriptUrlOrBlob=u.mainScriptUrlOrBlob)),u=await self.ModuleFactory(self.Module||u),self.ModuleFactory=self.Module=void 0,new s(u,c)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:s=>s.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&s.endsWith(".data")?r.assetBinaryPath.toString():s}),await e.o(n),e}function Ys(e,t){const r=O(e.baseOptions,Sn,1)||new Sn;typeof t=="string"?(x(r,2,Ir(t)),x(r,1)):t instanceof Uint8Array&&(x(r,1,Yn(t,!1)),x(r,2)),w(e.baseOptions,0,1,r)}function Ka(e){try{const t=e.H.length;if(t===1)throw Error(e.H[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.H.map(r=>r.message).join(", "))}finally{e.H=[]}}function g(e,t){e.C=Math.max(e.C,t)}function Pn(e,t){e.B=new ve,Se(e.B,2,"PassThroughCalculator"),j(e.B,"free_memory"),S(e.B,"free_memory_unused_out"),V(t,"free_memory"),Ne(t,e.B)}function gr(e,t){j(e.B,t),S(e.B,t+"_unused_out")}function Rn(e){e.g.addBoolToStream(!0,"free_memory",e.C)}var Xs=class{constructor(e){this.g=e,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var r,n,s,i,o,c;if(t){const u=e.baseOptions||{};if((r=e.baseOptions)!=null&&r.modelAssetBuffer&&((n=e.baseOptions)!=null&&n.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((s=O(this.baseOptions,Sn,1))!=null&&s.g()||(i=O(this.baseOptions,Sn,1))!=null&&i.l()||(o=e.baseOptions)!=null&&o.modelAssetBuffer||(c=e.baseOptions)!=null&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(f,h){let d=O(f.baseOptions,fa,3);if(!d){var b=d=new fa,A=new qo;Nr(b,4,kn,A)}"delegate"in h&&(h.delegate==="GPU"?(h=d,b=new H1,Nr(h,2,kn,b)):(h=d,b=new qo,Nr(h,4,kn,b))),w(f.baseOptions,0,3,d)}(this,u),u.modelAssetPath)return fetch(u.modelAssetPath.toString()).then(f=>{if(f.ok)return f.arrayBuffer();throw Error(`Failed to fetch model: ${u.modelAssetPath} (${f.status})`)}).then(f=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(f),!0,!1,!1),Ys(this,"/model.dat"),this.m(),this.L()});if(u.modelAssetBuffer instanceof Uint8Array)Ys(this,u.modelAssetBuffer);else if(u.modelAssetBuffer)return async function(f){const h=[];for(var d=0;;){const{done:b,value:A}=await f.read();if(b)break;h.push(A),d+=A.length}if(h.length===0)return new Uint8Array(0);if(h.length===1)return h[0];f=new Uint8Array(d),d=0;for(const b of h)f.set(b,d),d+=b.length;return f}(u.modelAssetBuffer).then(f=>{Ys(this,f),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let e;if(this.g.ca(t=>{e=K1(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,n)=>{this.H.push(Error(n))}),this.g.Ja(),this.g.setGraph(e,t),this.B=void 0,Ka(this)}finishProcessing(){this.g.finishProcessing(),Ka(this)}close(){this.B=void 0,this.g.closeGraph()}};function Et(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Xs.prototype.close=Xs.prototype.close;class _c{constructor(t,r,n,s){this.g=t,this.h=r,this.m=n,this.l=s}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function za(e,t,r){const n=e.g;if(r=Et(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(e.h,r),r}function Ya(e,t){const r=e.g,n=Et(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);const s=Et(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(e.O),r.vertexAttribPointer(e.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);const i=Et(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(e.L),r.vertexAttribPointer(e.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new _c(r,n,s,i)}function qs(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function bc(e,t,r,n){return qs(e,t),e.h||(e.m(),e.D()),r?(e.u||(e.u=Ya(e,!0)),r=e.u):(e.A||(e.A=Ya(e,!1)),r=e.A),t.useProgram(e.h),r.bind(),e.l(),e=n(),r.g.bindVertexArray(null),e}function Xa(e,t,r){return qs(e,t),e=Et(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function qa(e,t,r){qs(e,t),e.B||(e.B=Et(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.B),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function wc(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Ja=class{H(){return`
|
|
2
2
|
precision mediump float;
|
|
3
3
|
varying vec2 vTex;
|
|
4
4
|
uniform sampler2D inputTexture;
|
|
5
5
|
void main() {
|
|
6
6
|
gl_FragColor = texture2D(inputTexture, vTex);
|
|
7
7
|
}
|
|
8
|
-
`}m(){const e=this.g;if(this.h=
|
|
8
|
+
`}m(){const e=this.g;if(this.h=Et(e.createProgram(),"Failed to create WebGL program"),this.X=za(this,`
|
|
9
9
|
attribute vec2 aVertex;
|
|
10
10
|
attribute vec2 aTex;
|
|
11
11
|
varying vec2 vTex;
|
|
12
12
|
void main(void) {
|
|
13
13
|
gl_Position = vec4(aVertex, 0.0, 1.0);
|
|
14
14
|
vTex = aTex;
|
|
15
|
-
}`,e.VERTEX_SHADER),this.W=Ka(this,this.H(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.O=e.getAttribLocation(this.h,"aVertex"),this.L=e.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.X),e.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.u&&this.u.close()}};function ut(e,t){switch(t){case 0:return e.g.find(r=>r instanceof Uint8Array);case 1:return e.g.find(r=>r instanceof Float32Array);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function Hs(e){var t=ut(e,1);if(!t){if(t=ut(e,0))t=new Float32Array(t).map(n=>n/255);else{t=new Float32Array(e.width*e.height);const n=pr(e);var r=Ks(e);if(Xa(r,n,Ja(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,r);for(let s=0,i=0;s<t.length;++s,i+=4)t[s]=r[i]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function Ja(e){let t=ut(e,2);if(!t){const r=pr(e);t=Za(e);const n=Hs(e),s=$a(e);r.texImage2D(r.TEXTURE_2D,0,s,e.width,e.height,0,r.RED,r.FLOAT,n),zs(e)}return t}function pr(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=bt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function $a(e){if(e=pr(e),!Sn)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Sn=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Sn=e.R16F}return Sn}function Ks(e){return e.l||(e.l=new qa),e.l}function Za(e){const t=pr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=ut(e,2);return r||(r=Ya(Ks(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function zs(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Sn,ae=class{constructor(e,t,r,n,s,i,o){this.g=e,this.m=t,this.j=r,this.canvas=n,this.l=s,this.width=i,this.height=o,this.j&&--Qa===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!ut(this,0)}ka(){return!!ut(this,1)}R(){return!!ut(this,2)}ja(){return(t=ut(e=this,0))||(t=Hs(e),t=new Uint8Array(t.map(r=>Math.round(255*r))),e.g.push(t)),t;var e,t}ia(){return Hs(this)}N(){return Ja(this)}clone(){const e=[];for(const t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const n=pr(this),s=Ks(this);n.activeTexture(n.TEXTURE1),r=Ya(s,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,r);const i=$a(this);n.texImage2D(n.TEXTURE_2D,0,i,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),Xa(s,n,r),_c(s,n,!1,()=>{Za(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),zs(this)}),bc(s),zs(this)}}e.push(r)}return new ae(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&pr(this).deleteTexture(ut(this,2)),Qa=-1}};ae.prototype.close=ae.prototype.close,ae.prototype.clone=ae.prototype.clone,ae.prototype.getAsWebGLTexture=ae.prototype.N,ae.prototype.getAsFloat32Array=ae.prototype.ia,ae.prototype.getAsUint8Array=ae.prototype.ja,ae.prototype.hasWebGLTexture=ae.prototype.R,ae.prototype.hasFloat32Array=ae.prototype.ka,ae.prototype.hasUint8Array=ae.prototype.Fa;var Qa=250;function Ge(...e){return e.map(([t,r])=>({start:t,end:r}))}const wc=function(e){return class extends e{Ja(){this.i._registerModelResourcesGraphService()}}}((e2=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Ba()?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"))}async initializeGraph(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const r=e.length,n=this.i._malloc(r);this.i.HEAPU8.set(e,n),t?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(e,t,r,n,s){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),y(this,n||"input_audio",i=>{y(this,s=s||"audio_header",o=>{this.i._configureAudio(i,o,e,t??0,r)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){et(this,"__graph_config__",t=>{e(t)}),y(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,n,s){const i=4*e.length;this.h!==i&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(i),this.h=i),this.i.HEAPF32.set(e,this.g/4),y(this,n,o=>{this.i._addAudioToInputStream(this.g,t,r,o,s)})}addGpuBufferToStream(e,t,r){y(this,t,n=>{const[s,i]=Ga(this,e,n);this.i._addBoundTextureToStream(n,s,i,r)})}addBoolToStream(e,t,r){y(this,t,n=>{this.i._addBoolToInputStream(e,n,r)})}addDoubleToStream(e,t,r){y(this,t,n=>{this.i._addDoubleToInputStream(e,n,r)})}addFloatToStream(e,t,r){y(this,t,n=>{this.i._addFloatToInputStream(e,n,r)})}addIntToStream(e,t,r){y(this,t,n=>{this.i._addIntToInputStream(e,n,r)})}addUintToStream(e,t,r){y(this,t,n=>{this.i._addUintToInputStream(e,n,r)})}addStringToStream(e,t,r){y(this,t,n=>{y(this,e,s=>{this.i._addStringToInputStream(s,n,r)})})}addStringRecordToStream(e,t,r){y(this,t,n=>{Wa(this,Object.keys(e),s=>{Wa(this,Object.values(e),i=>{this.i._addFlatHashMapToInputStream(s,i,Object.keys(e).length,n,r)})})})}addProtoToStream(e,t,r,n){y(this,r,s=>{y(this,t,i=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputStream(o,e.length,i,s,n),this.i._free(o)})})}addEmptyPacketToStream(e,t){y(this,e,r=>{this.i._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateBoolVector(e.length);if(!s)throw Error("Unable to allocate new bool vector on heap.");for(const i of e)this.i._addBoolVectorEntry(s,i);this.i._addBoolVectorToInputStream(s,n,r)})}addDoubleVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateDoubleVector(e.length);if(!s)throw Error("Unable to allocate new double vector on heap.");for(const i of e)this.i._addDoubleVectorEntry(s,i);this.i._addDoubleVectorToInputStream(s,n,r)})}addFloatVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateFloatVector(e.length);if(!s)throw Error("Unable to allocate new float vector on heap.");for(const i of e)this.i._addFloatVectorEntry(s,i);this.i._addFloatVectorToInputStream(s,n,r)})}addIntVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateIntVector(e.length);if(!s)throw Error("Unable to allocate new int vector on heap.");for(const i of e)this.i._addIntVectorEntry(s,i);this.i._addIntVectorToInputStream(s,n,r)})}addUintVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateUintVector(e.length);if(!s)throw Error("Unable to allocate new unsigned int vector on heap.");for(const i of e)this.i._addUintVectorEntry(s,i);this.i._addUintVectorToInputStream(s,n,r)})}addStringVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateStringVector(e.length);if(!s)throw Error("Unable to allocate new string vector on heap.");for(const i of e)y(this,i,o=>{this.i._addStringVectorEntry(s,o)});this.i._addStringVectorToInputStream(s,n,r)})}addBoolToInputSidePacket(e,t){y(this,t,r=>{this.i._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){y(this,t,r=>{this.i._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){y(this,t,r=>{this.i._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){y(this,t,r=>{this.i._addIntToInputSidePacket(e,r)})}addUintToInputSidePacket(e,t){y(this,t,r=>{this.i._addUintToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){y(this,t,r=>{y(this,e,n=>{this.i._addStringToInputSidePacket(n,r)})})}addProtoToInputSidePacket(e,t,r){y(this,r,n=>{y(this,t,s=>{const i=this.i._malloc(e.length);this.i.HEAPU8.set(e,i),this.i._addProtoToInputSidePacket(i,e.length,s,n),this.i._free(i)})})}addBoolVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const s of e)this.i._addBoolVectorEntry(n,s);this.i._addBoolVectorToInputSidePacket(n,r)})}addDoubleVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const s of e)this.i._addDoubleVectorEntry(n,s);this.i._addDoubleVectorToInputSidePacket(n,r)})}addFloatVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const s of e)this.i._addFloatVectorEntry(n,s);this.i._addFloatVectorToInputSidePacket(n,r)})}addIntVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const s of e)this.i._addIntVectorEntry(n,s);this.i._addIntVectorToInputSidePacket(n,r)})}addUintVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of e)this.i._addUintVectorEntry(n,s);this.i._addUintVectorToInputSidePacket(n,r)})}addStringVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const s of e)y(this,s,i=>{this.i._addStringVectorEntry(n,i)});this.i._addStringVectorToInputSidePacket(n,r)})}attachBoolListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachBoolListener(r)})}attachBoolVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachBoolVectorListener(r)})}attachIntListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachIntListener(r)})}attachIntVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachIntVectorListener(r)})}attachUintListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachUintListener(r)})}attachUintVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachUintVectorListener(r)})}attachDoubleListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachDoubleVectorListener(r)})}attachFloatListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachFloatListener(r)})}attachFloatVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachFloatVectorListener(r)})}attachStringListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachStringListener(r)})}attachStringVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachStringVectorListener(r)})}attachProtoListener(e,t,r){et(this,e,t),y(this,e,n=>{this.i._attachProtoListener(n,r||!1)})}attachProtoVectorListener(e,t,r){_t(this,e,t),y(this,e,n=>{this.i._attachProtoVectorListener(n,r||!1)})}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),et(this,e,(n,s)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,s)}),y(this,e,n=>{this.i._attachAudioListener(n,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends e2{get ga(){return this.i}pa(e,t,r){y(this,t,n=>{const[s,i]=Ga(this,e,n);this.ga._addBoundTextureAsImageToStream(n,s,i,r)})}Z(e,t){et(this,e,t),y(this,e,r=>{this.ga._attachImageListener(r)})}aa(e,t){_t(this,e,t),y(this,e,r=>{this.ga._attachImageVectorListener(r)})}}));var e2,We=class extends wc{};async function L(e,t,r){return async function(n,s,i,o){return vc(n,s,i,o)}(e,r.canvas??(Ba()?void 0:document.createElement("canvas")),t,r)}function t2(e,t,r,n){if(e.U){const i=new oa;if(r!=null&&r.regionOfInterest){if(!e.oa)throw Error("This task doesn't support region-of-interest.");var s=r.regionOfInterest;if(s.left>=s.right||s.top>=s.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(s.left<0||s.top<0||s.right>1||s.bottom>1)throw Error("Expected RectF values to be in [0,1].");_(i,1,(s.left+s.right)/2),_(i,2,(s.top+s.bottom)/2),_(i,4,s.right-s.left),_(i,3,s.bottom-s.top)}else _(i,1,.5),_(i,2,.5),_(i,4,1),_(i,3,1);if(r!=null&&r.rotationDegrees){if((r==null?void 0:r.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(_(i,5,-Math.PI*r.rotationDegrees/180),(r==null?void 0:r.rotationDegrees)%180!=0){const[o,c]=Va(t);r=Y(i,3)*c/o,s=Y(i,4)*o/c,_(i,4,r),_(i,3,s)}}e.g.addProtoToStream(i.g(),"mediapipe.NormalizedRect",e.U,n)}e.g.pa(t,e.X,n??performance.now()),e.finishProcessing()}function He(e,t,r){var n;if((n=e.baseOptions)!=null&&n.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");t2(e,t,r,e.C+1)}function tt(e,t,r,n){var s;if(!((s=e.baseOptions)!=null&&s.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");t2(e,t,r,n)}function gr(e,t,r,n){var s=t.data;const i=t.width,o=i*(t=t.height);if((s instanceof Uint8Array||s instanceof Float32Array)&&s.length!==o)throw Error("Unsupported channel count: "+s.length/o);return e=new ae([s],r,!1,e.g.i.canvas,e.P,i,t),n?e.clone():e}var Pe=class extends Gs{constructor(e,t,r,n){super(e),this.g=e,this.X=t,this.U=r,this.oa=n,this.P=new qa}l(e,t=!0){if("runningMode"in e&&F(this.baseOptions,2,Pr(!!e.runningMode&&e.runningMode!=="IMAGE")),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Pe.prototype.close=Pe.prototype.close;var Ne=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},w(e=this.h=new bn,0,1,t=new H),_(this.h,2,.5),_(this.h,3,.3)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&_(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&_(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}F(e,t){return this.j={detections:[]},He(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},tt(this,e,r,t),this.j}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect_in"),P(e,"detections");const t=new Le;Ze(t,rc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect_in"),S(r,"DETECTIONS:detections"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=na(i),this.j.detections.push(Ca(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ne.prototype.detectForVideo=Ne.prototype.G,Ne.prototype.detect=Ne.prototype.F,Ne.prototype.setOptions=Ne.prototype.o,Ne.createFromModelPath=async function(e,t){return L(Ne,e,{baseOptions:{modelAssetPath:t}})},Ne.createFromModelBuffer=function(e,t){return L(Ne,e,{baseOptions:{modelAssetBuffer:t}})},Ne.createFromOptions=function(e,t){return L(Ne,e,t)};var Ys=Ge([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]),Xs=Ge([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]),qs=Ge([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),r2=Ge([474,475],[475,476],[476,477],[477,474]),Js=Ge([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]),$s=Ge([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),n2=Ge([469,470],[470,471],[471,472],[472,469]),Zs=Ge([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]),s2=[...Ys,...Xs,...qs,...Js,...$s,...Zs],i2=Ge([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]);function o2(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var G=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,w(e=this.h=new pa,0,1,t=new H),this.A=new da,w(this.h,0,3,this.A),this.u=new bn,w(this.h,0,2,this.u),at(this.u,4,1),_(this.u,2,.5),_(this.A,2,.5),_(this.h,4,.5)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numFaces"in e&&at(this.u,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&_(this.u,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&_(this.A,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}F(e,t){return o2(this),He(this,e,t),this.j}G(e,t,r){return o2(this),tt(this,e,r,t),this.j}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"face_landmarks");const t=new Le;Ze(t,sc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("face_landmarks",(n,s)=>{for(const i of n)n=Dr(i),this.j.faceLandmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{g(this,n)}),this.outputFaceBlendshapes&&(P(e,"blendshapes"),S(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,s)=>{if(this.outputFaceBlendshapes)for(const i of n)n=vn(i),this.j.faceBlendshapes.push(Us(n.g()??[]));g(this,s)}),this.g.attachEmptyPacketListener("blendshapes",n=>{g(this,n)})),this.outputFacialTransformationMatrixes&&(P(e,"face_geometry"),S(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,s)=>{if(this.outputFacialTransformationMatrixes)for(const i of n)(n=O(n=nc(i),X1,2))&&this.j.facialTransformationMatrixes.push({rows:Me(n,1)??0??0,columns:Me(n,2)??0??0,data:Ft(n,3,Je,Rt()).slice()??[]});g(this,s)}),this.g.attachEmptyPacketListener("face_geometry",n=>{g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};G.prototype.detectForVideo=G.prototype.G,G.prototype.detect=G.prototype.F,G.prototype.setOptions=G.prototype.o,G.createFromModelPath=function(e,t){return L(G,e,{baseOptions:{modelAssetPath:t}})},G.createFromModelBuffer=function(e,t){return L(G,e,{baseOptions:{modelAssetBuffer:t}})},G.createFromOptions=function(e,t){return L(G,e,t)},G.FACE_LANDMARKS_LIPS=Ys,G.FACE_LANDMARKS_LEFT_EYE=Xs,G.FACE_LANDMARKS_LEFT_EYEBROW=qs,G.FACE_LANDMARKS_LEFT_IRIS=r2,G.FACE_LANDMARKS_RIGHT_EYE=Js,G.FACE_LANDMARKS_RIGHT_EYEBROW=$s,G.FACE_LANDMARKS_RIGHT_IRIS=n2,G.FACE_LANDMARKS_FACE_OVAL=Zs,G.FACE_LANDMARKS_CONTOURS=s2,G.FACE_LANDMARKS_TESSELATION=i2;var Qs=Ge([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]);function a2(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function c2(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function u2(e,t=!0){const r=[];for(const s of e){var n=vn(s);e=[];for(const i of n.g())n=t&&Me(i,1)!=null?Me(i,1)??0:-1,e.push({score:Y(i,2)??0,index:n,categoryName:ue(D(i,3))??""??"",displayName:ue(D(i,4))??""??""});r.push(e)}return r}var Re=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.j=new va,0,1,t=new H),this.u=new xs,w(this.j,0,2,this.u),this.D=new Fs,w(this.u,0,3,this.D),this.A=new ma,w(this.u,0,2,this.A),this.h=new ic,w(this.j,0,3,this.h),_(this.A,2,.5),_(this.u,4,.5),_(this.D,2,.5)}get baseOptions(){return O(this.j,H,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){var s,i,o,c;if(at(this.A,3,e.numHands??1),"minHandDetectionConfidence"in e&&_(this.A,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.u,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&_(this.D,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new fr,r=t,n=Bs(e.cannedGesturesClassifierOptions,(s=O(this.h,fr,3))==null?void 0:s.l());w(r,0,2,n),w(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((i=O(this.h,fr,3))==null||i.g());return e.customGesturesClassifierOptions?(w(r=t=new fr,0,2,n=Bs(e.customGesturesClassifierOptions,(o=O(this.h,fr,4))==null?void 0:o.l())),w(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((c=O(this.h,fr,4))==null||c.g()),this.l(e)}Ha(e,t){return a2(this),He(this,e,t),c2(this)}Ia(e,t,r){return a2(this),tt(this,e,r,t),c2(this)}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"hand_gestures"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Le;Ze(t,oc,this.j);const r=new ve;Se(r,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"HAND_GESTURES:hand_gestures"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n){n=Dr(i);const o=[];for(const c of ot(n,ia,1))o.push({x:Y(c,1)??0,y:Y(c,2)??0,z:Y(c,3)??0,visibility:Y(c,4)??0});this.landmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n){n=lr(i);const o=[];for(const c of ot(n,sa,1))o.push({x:Y(c,1)??0,y:Y(c,2)??0,z:Y(c,3)??0,visibility:Y(c,4)??0});this.worldLandmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,s)=>{this.gestures.push(...u2(n,!1)),g(this,s)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{this.handedness.push(...u2(n)),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function h2(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Re.prototype.recognizeForVideo=Re.prototype.Ia,Re.prototype.recognize=Re.prototype.Ha,Re.prototype.setOptions=Re.prototype.o,Re.createFromModelPath=function(e,t){return L(Re,e,{baseOptions:{modelAssetPath:t}})},Re.createFromModelBuffer=function(e,t){return L(Re,e,{baseOptions:{modelAssetBuffer:t}})},Re.createFromOptions=function(e,t){return L(Re,e,t)},Re.HAND_CONNECTIONS=Qs;var ye=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.h=new xs,0,1,t=new H),this.u=new Fs,w(this.h,0,3,this.u),this.j=new ma,w(this.h,0,2,this.j),at(this.j,3,1),_(this.j,2,.5),_(this.u,2,.5),_(this.h,4,.5)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numHands"in e&&at(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&_(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&_(this.u,2,e.minHandPresenceConfidence??.5),this.l(e)}F(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],He(this,e,t),h2(this)}G(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],tt(this,e,r,t),h2(this)}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Le;Ze(t,ac,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n)n=Dr(i),this.landmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n)n=lr(i),this.worldLandmarks.push(jr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{var i=this.handedness,o=i.push;const c=[];for(const u of n){n=vn(u);const f=[];for(const h of n.g())f.push({score:Y(h,2)??0,index:Me(h,1)??0??-1,categoryName:ue(D(h,3))??""??"",displayName:ue(D(h,4))??""??""});c.push(f)}o.call(i,...c),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ye.prototype.detectForVideo=ye.prototype.G,ye.prototype.detect=ye.prototype.F,ye.prototype.setOptions=ye.prototype.o,ye.createFromModelPath=function(e,t){return L(ye,e,{baseOptions:{modelAssetPath:t}})},ye.createFromModelBuffer=function(e,t){return L(ye,e,{baseOptions:{modelAssetBuffer:t}})},ye.createFromOptions=function(e,t){return L(ye,e,t)},ye.HAND_CONNECTIONS=Qs;var l2=Ge([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]);function f2(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function d2(e){try{if(!e.D)return e.h;e.D(e.h)}finally{kn(e)}}function Tn(e,t){e=Dr(e),t.push(wn(e))}var B=class extends Pe{constructor(e,t){super(new We(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,w(e=this.j=new Aa,0,1,t=new H),this.I=new Fs,w(this.j,0,2,this.I),this.W=new cc,w(this.j,0,3,this.W),this.u=new bn,w(this.j,0,4,this.u),this.O=new da,w(this.j,0,5,this.O),this.A=new wa,w(this.j,0,6,this.A),this.M=new Ea,w(this.j,0,7,this.M),_(this.u,2,.5),_(this.u,3,.3),_(this.O,2,.5),_(this.A,2,.5),_(this.A,3,.3),_(this.M,2,.5),_(this.I,2,.5)}get baseOptions(){return O(this.j,H,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&_(this.u,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&_(this.u,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&_(this.O,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&_(this.A,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&_(this.A,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&_(this.M,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&_(this.I,2,e.minHandLandmarksConfidence??.5),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.D=typeof t=="function"?t:r,f2(this),He(this,e,n),d2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.D=typeof r=="function"?r:n,f2(this),tt(this,e,s,t),d2(this)}m(){var e=new Oe;V(e,"input_frames_image"),P(e,"pose_landmarks"),P(e,"pose_world_landmarks"),P(e,"face_landmarks"),P(e,"left_hand_landmarks"),P(e,"left_hand_world_landmarks"),P(e,"right_hand_landmarks"),P(e,"right_hand_world_landmarks");const t=new Le,r=new Uo;Se(r,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),function(s,i){if(i!=null)if(Array.isArray(i))F(s,2,Qr(i,0,xr));else{if(!(typeof i=="string"||i instanceof Xe||Dn(i)))throw Error("invalid value in Any.value field: "+i+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");pt(s,2,Vn(i,!1),kt())}}(r,this.j.g());const n=new ve;Se(n,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),cs(n,8,Uo,r),j(n,"IMAGE:input_frames_image"),S(n,"POSE_LANDMARKS:pose_landmarks"),S(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),S(n,"FACE_LANDMARKS:face_landmarks"),S(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),S(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),S(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),S(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(t),Ce(e,n),An(this,e),this.g.attachProtoListener("pose_landmarks",(s,i)=>{Tn(s,this.h.poseLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("pose_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("pose_world_landmarks",(s,i)=>{var o=this.h.poseWorldLandmarks;s=lr(s),o.push(jr(s)),g(this,i)}),this.g.attachEmptyPacketListener("pose_world_landmarks",s=>{g(this,s)}),this.outputPoseSegmentationMasks&&(S(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),dr(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",(s,i)=>{this.h.poseSegmentationMasks=[gr(this,s,!0,!this.D)],g(this,i)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",s=>{this.h.poseSegmentationMasks=[],g(this,s)})),this.g.attachProtoListener("face_landmarks",(s,i)=>{Tn(s,this.h.faceLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("face_landmarks",s=>{g(this,s)}),this.outputFaceBlendshapes&&(P(e,"extra_blendshapes"),S(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(s,i)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(s=vn(s),o.push(Us(s.g()??[]))),g(this,i)}),this.g.attachEmptyPacketListener("extra_blendshapes",s=>{g(this,s)})),this.g.attachProtoListener("left_hand_landmarks",(s,i)=>{Tn(s,this.h.leftHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("left_hand_world_landmarks",(s,i)=>{var o=this.h.leftHandWorldLandmarks;s=lr(s),o.push(jr(s)),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_landmarks",(s,i)=>{Tn(s,this.h.rightHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_world_landmarks",(s,i)=>{var o=this.h.rightHandWorldLandmarks;s=lr(s),o.push(jr(s)),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",s=>{g(this,s)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};B.prototype.detectForVideo=B.prototype.G,B.prototype.detect=B.prototype.F,B.prototype.setOptions=B.prototype.o,B.createFromModelPath=function(e,t){return L(B,e,{baseOptions:{modelAssetPath:t}})},B.createFromModelBuffer=function(e,t){return L(B,e,{baseOptions:{modelAssetBuffer:t}})},B.createFromOptions=function(e,t){return L(B,e,t)},B.HAND_CONNECTIONS=Qs,B.POSE_CONNECTIONS=l2,B.FACE_LANDMARKS_LIPS=Ys,B.FACE_LANDMARKS_LEFT_EYE=Xs,B.FACE_LANDMARKS_LEFT_EYEBROW=qs,B.FACE_LANDMARKS_LEFT_IRIS=r2,B.FACE_LANDMARKS_RIGHT_EYE=Js,B.FACE_LANDMARKS_RIGHT_EYEBROW=$s,B.FACE_LANDMARKS_RIGHT_IRIS=n2,B.FACE_LANDMARKS_FACE_OVAL=Zs,B.FACE_LANDMARKS_CONTOURS=s2,B.FACE_LANDMARKS_TESSELATION=i2;var De=class extends Pe{constructor(e,t){super(new We(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},w(e=this.h=new ka,0,1,t=new H)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return w(this.h,0,2,Bs(e,O(this.h,Os,2))),this.l(e)}sa(e,t){return this.j={classifications:[]},He(this,e,t),this.j}ta(e,t,r){return this.j={classifications:[]},tt(this,e,r,t),this.j}m(){var e=new Oe;V(e,"input_image"),V(e,"norm_rect"),P(e,"classifications");const t=new Le;Ze(t,uc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),j(r,"IMAGE:input_image"),j(r,"NORM_RECT:norm_rect"),S(r,"CLASSIFICATIONS:classifications"),r.o(t),Ce(e,r),this.g.attachProtoListener("classifications",(n,s)=>{this.j=gc($1(n)),g(this,s)}),this.g.attachEmptyPacketListener("classifications",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};De.prototype.classifyForVideo=De.prototype.ta,De.prototype.classify=De.prototype.sa,De.prototype.setOptions=De.prototype.o,De.createFromModelPath=function(e,t){return L(De,e,{baseOptions:{modelAssetPath:t}})},De.createFromModelBuffer=function(e,t){return L(De,e,{baseOptions:{modelAssetBuffer:t}})},De.createFromOptions=function(e,t){return L(De,e,t)};var Fe=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!0),this.h=new Sa,this.embeddings={embeddings:[]},w(e=this.h,0,1,t=new H)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){var t=this.h,r=O(this.h,ha,2);return r=r?r.clone():new ha,e.l2Normalize!==void 0?F(r,1,Pr(e.l2Normalize)):"l2Normalize"in e&&F(r,1),e.quantize!==void 0?F(r,2,Pr(e.quantize)):"quantize"in e&&F(r,2),w(t,0,2,r),this.l(e)}za(e,t){return He(this,e,t),this.embeddings}Aa(e,t,r){return tt(this,e,r,t),this.embeddings}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"embeddings_out");const t=new Le;Ze(t,hc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"EMBEDDINGS:embeddings_out"),r.o(t),Ce(e,r),this.g.attachProtoListener("embeddings_out",(n,s)=>{n=ec(n),this.embeddings=function(i){return{embeddings:ot(i,Q1,1).map(o=>{var f,h;const c={headIndex:Me(o,3)??0??-1,headName:ue(D(o,4))??""??""};var u=o.v;return no(u,0|u[m],aa,ss(o,1))!==void 0?(o=Ft(o=O(o,aa,ss(o,1),void 0),1,Je,Rt()),c.floatEmbedding=o.slice()):(u=new Uint8Array(0),c.quantizedEmbedding=((h=(f=O(o,Z1,ss(o,2),void 0))==null?void 0:f.na())==null?void 0:h.h())??u),c}),timestampMs:Ia(oo(i))}}(n),g(this,s)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Fe.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Da(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Da(Na(e.quantizedEmbedding),Na(t.quantizedEmbedding))}return e},Fe.prototype.embedForVideo=Fe.prototype.Aa,Fe.prototype.embed=Fe.prototype.za,Fe.prototype.setOptions=Fe.prototype.o,Fe.createFromModelPath=function(e,t){return L(Fe,e,{baseOptions:{modelAssetPath:t}})},Fe.createFromModelBuffer=function(e,t){return L(Fe,e,{baseOptions:{modelAssetBuffer:t}})},Fe.createFromOptions=function(e,t){return L(Fe,e,t)};var ei=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};function Ec(e){var r,n;const t=function(s){return ot(s,ve,1)}(e.ca()).filter(s=>(ue(D(s,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(e.u=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(((n=(r=O(t[0],Le,7))==null?void 0:r.j())==null?void 0:n.g())??new Map).forEach((s,i)=>{e.u[Number(i)]=ue(D(s,1))??""})}function p2(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function g2(e){try{const t=new ei(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{kn(e)}}ei.prototype.close=ei.prototype.close;var _e=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Ns,this.A=new Ta,w(this.h,0,3,this.A),w(e=this.h,0,1,t=new H)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?F(this.h,2,Fr(e.displayNamesLocale)):"displayNamesLocale"in e&&F(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}L(){Ec(this)}segment(e,t,r){const n=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,p2(this),He(this,e,n),g2(this)}La(e,t,r,n){const s=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:n,p2(this),tt(this,e,s,t),g2(this)}Da(){return this.u}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect");const t=new Le;Ze(t,Pa,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),r.o(t),Ce(e,r),An(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),dr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>gr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),dr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=gr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};_e.prototype.getLabels=_e.prototype.Da,_e.prototype.segmentForVideo=_e.prototype.La,_e.prototype.segment=_e.prototype.segment,_e.prototype.setOptions=_e.prototype.o,_e.createFromModelPath=function(e,t){return L(_e,e,{baseOptions:{modelAssetPath:t}})},_e.createFromModelBuffer=function(e,t){return L(_e,e,{baseOptions:{modelAssetBuffer:t}})},_e.createFromOptions=function(e,t){return L(_e,e,t)};var ti=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};ti.prototype.close=ti.prototype.close;var rt=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Ns,this.u=new Ta,w(this.h,0,3,this.u),w(e=this.h,0,1,t=new H)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,r,n){const s=typeof r!="function"?r:{};if(this.j=typeof r=="function"?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.C+1,n=new Fa,t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var i=new Ds;pt(i,3,Pr(!0),!1),pt(i,1,Or(t.keypoint.x),0),pt(i,2,Or(t.keypoint.y),0),Mr(n,1,js,i)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");{const c=new fc;for(i of t.scribble)pt(t=new Ds,3,Pr(!0),!1),pt(t,1,Or(i.x),0),pt(t,2,Or(i.y),0),cs(c,1,Ds,t);Mr(n,2,js,c)}}this.g.addProtoToStream(n.g(),"mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest","roi_in",r),He(this,e,s);e:{try{const c=new ti(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=c;break e}this.j(c)}finally{kn(this)}o=void 0}return o}m(){var e=new Oe;V(e,"image_in"),V(e,"roi_in"),V(e,"norm_rect_in");const t=new Le;Ze(t,Pa,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"),j(r,"IMAGE:image_in"),j(r,"ROI:roi_in"),j(r,"NORM_RECT:norm_rect_in"),r.o(t),Ce(e,r),An(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),dr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>gr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),dr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=gr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};rt.prototype.segment=rt.prototype.segment,rt.prototype.setOptions=rt.prototype.o,rt.createFromModelPath=function(e,t){return L(rt,e,{baseOptions:{modelAssetPath:t}})},rt.createFromModelBuffer=function(e,t){return L(rt,e,{baseOptions:{modelAssetBuffer:t}})},rt.createFromOptions=function(e,t){return L(rt,e,t)};var je=class extends Pe{constructor(e,t){super(new We(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},w(e=this.h=new xa,0,1,t=new H)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?F(this.h,2,Fr(e.displayNamesLocale)):"displayNamesLocale"in e&&F(this.h,2),e.maxResults!==void 0?at(this.h,3,e.maxResults):"maxResults"in e&&F(this.h,3),e.scoreThreshold!==void 0?_(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&F(this.h,4),e.categoryAllowlist!==void 0?en(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&F(this.h,5),e.categoryDenylist!==void 0?en(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&F(this.h,6),this.l(e)}F(e,t){return this.j={detections:[]},He(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},tt(this,e,r,t),this.j}m(){var e=new Oe;V(e,"input_frame_gpu"),V(e,"norm_rect"),P(e,"detections");const t=new Le;Ze(t,dc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),j(r,"IMAGE:input_frame_gpu"),j(r,"NORM_RECT:norm_rect"),S(r,"DETECTIONS:detections"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=na(i),this.j.detections.push(Ca(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};je.prototype.detectForVideo=je.prototype.G,je.prototype.detect=je.prototype.F,je.prototype.setOptions=je.prototype.o,je.createFromModelPath=async function(e,t){return L(je,e,{baseOptions:{modelAssetPath:t}})},je.createFromModelBuffer=function(e,t){return L(je,e,{baseOptions:{modelAssetBuffer:t}})},je.createFromOptions=function(e,t){return L(je,e,t)};var ri=class{constructor(e,t,r){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=r}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function m2(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function v2(e){try{const t=new ri(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.u)return t;e.u(t)}finally{kn(e)}}ri.prototype.close=ri.prototype.close;var xe=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,w(e=this.h=new Ma,0,1,t=new H),this.A=new Ea,w(this.h,0,3,this.A),this.j=new wa,w(this.h,0,2,this.j),at(this.j,4,1),_(this.j,2,.5),_(this.A,2,.5),_(this.h,4,.5)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numPoses"in e&&at(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&_(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&_(this.A,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.u=typeof t=="function"?t:r,m2(this),He(this,e,n),v2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.u=typeof r=="function"?r:n,m2(this),tt(this,e,s,t),v2(this)}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"normalized_landmarks"),P(e,"world_landmarks"),P(e,"segmentation_masks");const t=new Le;Ze(t,pc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:normalized_landmarks"),S(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Ce(e,r),An(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(n,s)=>{this.landmarks=[];for(const i of n)n=Dr(i),this.landmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],g(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,s)=>{this.worldLandmarks=[];for(const i of n)n=lr(i),this.worldLandmarks.push(jr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],g(this,n)}),this.outputSegmentationMasks&&(S(r,"SEGMENTATION_MASK:segmentation_masks"),dr(this,"segmentation_masks"),this.g.aa("segmentation_masks",(n,s)=>{this.segmentationMasks=n.map(i=>gr(this,i,!0,!this.u)),g(this,s)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};xe.prototype.detectForVideo=xe.prototype.G,xe.prototype.detect=xe.prototype.F,xe.prototype.setOptions=xe.prototype.o,xe.createFromModelPath=function(e,t){return L(xe,e,{baseOptions:{modelAssetPath:t}})},xe.createFromModelBuffer=function(e,t){return L(xe,e,{baseOptions:{modelAssetBuffer:t}})},xe.createFromOptions=function(e,t){return L(xe,e,t)},xe.POSE_CONNECTIONS=l2;const Ac=["Smile","Blink","Turn_Head","Thumbs_Up"],y2=({apiUrl:e,duration:t=60,onComplete:r,onError:n})=>{const s=N.useRef(null),i=N.useRef(),o=N.useRef(null),[c,u]=N.useState({face:null,hand:null}),[f,h]=N.useState("loading"),[d,b]=N.useState(""),[A,W]=N.useState([]),[nt,Ke]=N.useState(0),[he,K]=N.useState(t),[ht,Gr]=N.useState(!1),jt=N.useRef(nt),wt=N.useRef(ht);N.useEffect(()=>{jt.current=nt},[nt]),N.useEffect(()=>{wt.current=ht},[ht]);const Ln=()=>{W([...Ac].sort(()=>.5-Math.random()).slice(0,3))};N.useEffect(()=>{(async()=>{try{const z=await Dt.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3/wasm"),le=await G.createFromOptions(z,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO"}),fe=await ye.createFromOptions(z,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task",delegate:"GPU"},runningMode:"VIDEO",numHands:1});u({face:le,hand:fe}),Ln(),h("ready")}catch{b("Failed to load security assets."),h("error")}})()},[]),N.useEffect(()=>(f==="capturing"&&he>0?o.current=setInterval(()=>K(I=>I-1),1e3):he===0&&f==="capturing"&&h("expired"),()=>clearInterval(o.current)),[f,he]);const si=()=>h("capturing"),On=()=>{Ke(0),jt.current=0,K(t),Gr(!1),wt.current=!1,b(""),Ln(),h("ready")},ii=(I,z)=>{const le=document.createElement("canvas"),fe=le.getContext("2d"),be=z.map(Bt=>Bt.x*I.videoWidth),C=z.map(Bt=>Bt.y*I.videoHeight),de=Math.min(...be),ce=Math.max(...be),lt=Math.min(...C),ft=Math.max(...C),vr=ce-de,ai=ft-lt,Et=vr*.25;return le.width=224,le.height=224,fe.drawImage(I,de-Et,lt-Et,vr+Et*2,ai+Et*2,0,0,224,224),le},oi=(I,z,le)=>{var fe,be;if(wt.current)return!1;if(le==="Thumbs_Up"&&((fe=z==null?void 0:z.landmarks)==null?void 0:fe.length)>0){const C=z.landmarks[0];return C[4].y<C[2].y&&[8,12,16,20].every(de=>C[de].y>C[de-2].y)}if(((be=I==null?void 0:I.faceLandmarks)==null?void 0:be.length)>0){const C=I.faceLandmarks[0];switch(le){case"Smile":return C[291].x-C[61].x>.15;case"Blink":return(Math.abs(C[159].y-C[145].y)+Math.abs(C[386].y-C[374].y))/2<.01;case"Turn_Head":const ce=(C[1].x-C[33].x)/(C[263].x-C[33].x);return ce<.25||ce>.75;default:return!1}}return!1},mr=N.useCallback(()=>{var be,C,de;if(f!=="capturing"||!((be=s.current)!=null&&be.video))return;const I=s.current.video,z=performance.now(),le=(C=c.face)==null?void 0:C.detectForVideo(I,z),fe=(de=c.hand)==null?void 0:de.detectForVideo(I,z);oi(le,fe,A[jt.current])&&(wt.current||(Gr(!0),wt.current=!0,setTimeout(()=>{jt.current<A.length-1?(Ke(ce=>(jt.current=ce+1,ce+1)),Gr(!1),wt.current=!1):ze()},1500))),i.current=requestAnimationFrame(mr)},[f,c,A]);N.useEffect(()=>(f==="capturing"&&(i.current=requestAnimationFrame(mr)),()=>cancelAnimationFrame(i.current)),[f,mr]);const ze=async()=>{var I,z;h("verifying");try{const le=s.current.video,fe=[];for(let ce=0;ce<5;ce++){const lt=performance.now(),ft=(I=c.face)==null?void 0:I.detectForVideo(le,lt);(z=ft==null?void 0:ft.faceLandmarks)!=null&&z[0]&&fe.push(ii(le,ft.faceLandmarks[0]).toDataURL("image/jpeg",.95)),await new Promise(vr=>setTimeout(vr,60))}const be=new FormData;for(let ce=0;ce<fe.length;ce++){const lt=await(await fetch(fe[ce])).blob();be.append("files",lt,`frame_${ce}.jpg`)}const de=await(await fetch(`${e}/v1/verify`,{method:"POST",body:be})).json();de.is_live?(h("success"),r==null||r({success:!0,image:fe[fe.length-1],skinConfidence:de.skin_confidence})):(b(de.reason||"Spoof detected."),h("error"),n==null||n({success:!1,reason:de.reason||"Spoof detected."}))}catch{b("Server unreachable."),h("error"),n==null||n({success:!1,reason:"Server error"})}};return{webcamRef:s,status:f,errorMsg:d,sequence:A,currentStep:nt,timeLeft:he,isStepTransitioning:ht,start:si,reset:On,sendFinalProof:ze}};var ni={exports:{}},Ur={};/**
|
|
15
|
+
}`,e.VERTEX_SHADER),this.W=za(this,this.H(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.O=e.getAttribLocation(this.h,"aVertex"),this.L=e.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.X),e.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.u&&this.u.close()}};function ht(e,t){switch(t){case 0:return e.g.find(r=>r instanceof Uint8Array);case 1:return e.g.find(r=>r instanceof Float32Array);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function Js(e){var t=ht(e,1);if(!t){if(t=ht(e,0))t=new Float32Array(t).map(n=>n/255);else{t=new Float32Array(e.width*e.height);const n=mr(e);var r=$s(e);if(qa(r,n,$a(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,r);for(let s=0,i=0;s<t.length;++s,i+=4)t[s]=r[i]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function $a(e){let t=ht(e,2);if(!t){const r=mr(e);t=Qa(e);const n=Js(e),s=Za(e);r.texImage2D(r.TEXTURE_2D,0,s,e.width,e.height,0,r.RED,r.FLOAT,n),Zs(e)}return t}function mr(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=Et(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Za(e){if(e=mr(e),!Fn)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Fn=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Fn=e.R16F}return Fn}function $s(e){return e.l||(e.l=new Ja),e.l}function Qa(e){const t=mr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=ht(e,2);return r||(r=Xa($s(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function Zs(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Fn,ae=class{constructor(e,t,r,n,s,i,o){this.g=e,this.m=t,this.j=r,this.canvas=n,this.l=s,this.width=i,this.height=o,this.j&&--e2===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!ht(this,0)}ka(){return!!ht(this,1)}R(){return!!ht(this,2)}ja(){return(t=ht(e=this,0))||(t=Js(e),t=new Uint8Array(t.map(r=>Math.round(255*r))),e.g.push(t)),t;var e,t}ia(){return Js(this)}N(){return $a(this)}clone(){const e=[];for(const t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const n=mr(this),s=$s(this);n.activeTexture(n.TEXTURE1),r=Xa(s,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,r);const i=Za(this);n.texImage2D(n.TEXTURE_2D,0,i,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),qa(s,n,r),bc(s,n,!1,()=>{Qa(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),Zs(this)}),wc(s),Zs(this)}}e.push(r)}return new ae(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&mr(this).deleteTexture(ht(this,2)),e2=-1}};ae.prototype.close=ae.prototype.close,ae.prototype.clone=ae.prototype.clone,ae.prototype.getAsWebGLTexture=ae.prototype.N,ae.prototype.getAsFloat32Array=ae.prototype.ia,ae.prototype.getAsUint8Array=ae.prototype.ja,ae.prototype.hasWebGLTexture=ae.prototype.R,ae.prototype.hasFloat32Array=ae.prototype.ka,ae.prototype.hasUint8Array=ae.prototype.Fa;var e2=250;function We(...e){return e.map(([t,r])=>({start:t,end:r}))}const Ec=function(e){return class extends e{Ja(){this.i._registerModelResourcesGraphService()}}}((t2=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Ua()?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"))}async initializeGraph(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const r=e.length,n=this.i._malloc(r);this.i.HEAPU8.set(e,n),t?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(e,t,r,n,s){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),y(this,n||"input_audio",i=>{y(this,s=s||"audio_header",o=>{this.i._configureAudio(i,o,e,t??0,r)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){Qe(this,"__graph_config__",t=>{e(t)}),y(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,n,s){const i=4*e.length;this.h!==i&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(i),this.h=i),this.i.HEAPF32.set(e,this.g/4),y(this,n,o=>{this.i._addAudioToInputStream(this.g,t,r,o,s)})}addGpuBufferToStream(e,t,r){y(this,t,n=>{const[s,i]=Wa(this,e,n);this.i._addBoundTextureToStream(n,s,i,r)})}addBoolToStream(e,t,r){y(this,t,n=>{this.i._addBoolToInputStream(e,n,r)})}addDoubleToStream(e,t,r){y(this,t,n=>{this.i._addDoubleToInputStream(e,n,r)})}addFloatToStream(e,t,r){y(this,t,n=>{this.i._addFloatToInputStream(e,n,r)})}addIntToStream(e,t,r){y(this,t,n=>{this.i._addIntToInputStream(e,n,r)})}addUintToStream(e,t,r){y(this,t,n=>{this.i._addUintToInputStream(e,n,r)})}addStringToStream(e,t,r){y(this,t,n=>{y(this,e,s=>{this.i._addStringToInputStream(s,n,r)})})}addStringRecordToStream(e,t,r){y(this,t,n=>{Ha(this,Object.keys(e),s=>{Ha(this,Object.values(e),i=>{this.i._addFlatHashMapToInputStream(s,i,Object.keys(e).length,n,r)})})})}addProtoToStream(e,t,r,n){y(this,r,s=>{y(this,t,i=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputStream(o,e.length,i,s,n),this.i._free(o)})})}addEmptyPacketToStream(e,t){y(this,e,r=>{this.i._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateBoolVector(e.length);if(!s)throw Error("Unable to allocate new bool vector on heap.");for(const i of e)this.i._addBoolVectorEntry(s,i);this.i._addBoolVectorToInputStream(s,n,r)})}addDoubleVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateDoubleVector(e.length);if(!s)throw Error("Unable to allocate new double vector on heap.");for(const i of e)this.i._addDoubleVectorEntry(s,i);this.i._addDoubleVectorToInputStream(s,n,r)})}addFloatVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateFloatVector(e.length);if(!s)throw Error("Unable to allocate new float vector on heap.");for(const i of e)this.i._addFloatVectorEntry(s,i);this.i._addFloatVectorToInputStream(s,n,r)})}addIntVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateIntVector(e.length);if(!s)throw Error("Unable to allocate new int vector on heap.");for(const i of e)this.i._addIntVectorEntry(s,i);this.i._addIntVectorToInputStream(s,n,r)})}addUintVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateUintVector(e.length);if(!s)throw Error("Unable to allocate new unsigned int vector on heap.");for(const i of e)this.i._addUintVectorEntry(s,i);this.i._addUintVectorToInputStream(s,n,r)})}addStringVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateStringVector(e.length);if(!s)throw Error("Unable to allocate new string vector on heap.");for(const i of e)y(this,i,o=>{this.i._addStringVectorEntry(s,o)});this.i._addStringVectorToInputStream(s,n,r)})}addBoolToInputSidePacket(e,t){y(this,t,r=>{this.i._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){y(this,t,r=>{this.i._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){y(this,t,r=>{this.i._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){y(this,t,r=>{this.i._addIntToInputSidePacket(e,r)})}addUintToInputSidePacket(e,t){y(this,t,r=>{this.i._addUintToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){y(this,t,r=>{y(this,e,n=>{this.i._addStringToInputSidePacket(n,r)})})}addProtoToInputSidePacket(e,t,r){y(this,r,n=>{y(this,t,s=>{const i=this.i._malloc(e.length);this.i.HEAPU8.set(e,i),this.i._addProtoToInputSidePacket(i,e.length,s,n),this.i._free(i)})})}addBoolVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const s of e)this.i._addBoolVectorEntry(n,s);this.i._addBoolVectorToInputSidePacket(n,r)})}addDoubleVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const s of e)this.i._addDoubleVectorEntry(n,s);this.i._addDoubleVectorToInputSidePacket(n,r)})}addFloatVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const s of e)this.i._addFloatVectorEntry(n,s);this.i._addFloatVectorToInputSidePacket(n,r)})}addIntVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const s of e)this.i._addIntVectorEntry(n,s);this.i._addIntVectorToInputSidePacket(n,r)})}addUintVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of e)this.i._addUintVectorEntry(n,s);this.i._addUintVectorToInputSidePacket(n,r)})}addStringVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const s of e)y(this,s,i=>{this.i._addStringVectorEntry(n,i)});this.i._addStringVectorToInputSidePacket(n,r)})}attachBoolListener(e,t){Qe(this,e,t),y(this,e,r=>{this.i._attachBoolListener(r)})}attachBoolVectorListener(e,t){wt(this,e,t),y(this,e,r=>{this.i._attachBoolVectorListener(r)})}attachIntListener(e,t){Qe(this,e,t),y(this,e,r=>{this.i._attachIntListener(r)})}attachIntVectorListener(e,t){wt(this,e,t),y(this,e,r=>{this.i._attachIntVectorListener(r)})}attachUintListener(e,t){Qe(this,e,t),y(this,e,r=>{this.i._attachUintListener(r)})}attachUintVectorListener(e,t){wt(this,e,t),y(this,e,r=>{this.i._attachUintVectorListener(r)})}attachDoubleListener(e,t){Qe(this,e,t),y(this,e,r=>{this.i._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){wt(this,e,t),y(this,e,r=>{this.i._attachDoubleVectorListener(r)})}attachFloatListener(e,t){Qe(this,e,t),y(this,e,r=>{this.i._attachFloatListener(r)})}attachFloatVectorListener(e,t){wt(this,e,t),y(this,e,r=>{this.i._attachFloatVectorListener(r)})}attachStringListener(e,t){Qe(this,e,t),y(this,e,r=>{this.i._attachStringListener(r)})}attachStringVectorListener(e,t){wt(this,e,t),y(this,e,r=>{this.i._attachStringVectorListener(r)})}attachProtoListener(e,t,r){Qe(this,e,t),y(this,e,n=>{this.i._attachProtoListener(n,r||!1)})}attachProtoVectorListener(e,t,r){wt(this,e,t),y(this,e,n=>{this.i._attachProtoVectorListener(n,r||!1)})}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Qe(this,e,(n,s)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,s)}),y(this,e,n=>{this.i._attachAudioListener(n,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends t2{get ga(){return this.i}pa(e,t,r){y(this,t,n=>{const[s,i]=Wa(this,e,n);this.ga._addBoundTextureAsImageToStream(n,s,i,r)})}Z(e,t){Qe(this,e,t),y(this,e,r=>{this.ga._attachImageListener(r)})}aa(e,t){wt(this,e,t),y(this,e,r=>{this.ga._attachImageVectorListener(r)})}}));var t2,He=class extends Ec{};async function L(e,t,r){return async function(n,s,i,o){return yc(n,s,i,o)}(e,r.canvas??(Ua()?void 0:document.createElement("canvas")),t,r)}function r2(e,t,r,n){if(e.U){const i=new aa;if(r!=null&&r.regionOfInterest){if(!e.oa)throw Error("This task doesn't support region-of-interest.");var s=r.regionOfInterest;if(s.left>=s.right||s.top>=s.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(s.left<0||s.top<0||s.right>1||s.bottom>1)throw Error("Expected RectF values to be in [0,1].");_(i,1,(s.left+s.right)/2),_(i,2,(s.top+s.bottom)/2),_(i,4,s.right-s.left),_(i,3,s.bottom-s.top)}else _(i,1,.5),_(i,2,.5),_(i,4,1),_(i,3,1);if(r!=null&&r.rotationDegrees){if((r==null?void 0:r.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(_(i,5,-Math.PI*r.rotationDegrees/180),(r==null?void 0:r.rotationDegrees)%180!=0){const[o,c]=Ga(t);r=H(i,3)*c/o,s=H(i,4)*o/c,_(i,4,r),_(i,3,s)}}e.g.addProtoToStream(i.g(),"mediapipe.NormalizedRect",e.U,n)}e.g.pa(t,e.X,n??performance.now()),e.finishProcessing()}function Ke(e,t,r){var n;if((n=e.baseOptions)!=null&&n.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");r2(e,t,r,e.C+1)}function et(e,t,r,n){var s;if(!((s=e.baseOptions)!=null&&s.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");r2(e,t,r,n)}function vr(e,t,r,n){var s=t.data;const i=t.width,o=i*(t=t.height);if((s instanceof Uint8Array||s instanceof Float32Array)&&s.length!==o)throw Error("Unsupported channel count: "+s.length/o);return e=new ae([s],r,!1,e.g.i.canvas,e.P,i,t),n?e.clone():e}var Pe=class extends Xs{constructor(e,t,r,n){super(e),this.g=e,this.X=t,this.U=r,this.oa=n,this.P=new Ja}l(e,t=!0){if("runningMode"in e&&x(this.baseOptions,2,xr(!!e.runningMode&&e.runningMode!=="IMAGE")),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Pe.prototype.close=Pe.prototype.close;var De=class extends Pe{constructor(e,t){super(new He(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},w(e=this.h=new Tn,0,1,t=new W),_(this.h,2,.5),_(this.h,3,.3)}get baseOptions(){return O(this.h,W,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&_(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&_(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}F(e,t){return this.j={detections:[]},Ke(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},et(this,e,r,t),this.j}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect_in"),P(e,"detections");const t=new Le;$e(t,nc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect_in"),S(r,"DETECTIONS:detections"),r.o(t),Ne(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=sa(i),this.j.detections.push(Na(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};De.prototype.detectForVideo=De.prototype.G,De.prototype.detect=De.prototype.F,De.prototype.setOptions=De.prototype.o,De.createFromModelPath=async function(e,t){return L(De,e,{baseOptions:{modelAssetPath:t}})},De.createFromModelBuffer=function(e,t){return L(De,e,{baseOptions:{modelAssetBuffer:t}})},De.createFromOptions=function(e,t){return L(De,e,t)};var Qs=We([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]),ei=We([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]),ti=We([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),n2=We([474,475],[475,476],[476,477],[477,474]),ri=We([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]),ni=We([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),s2=We([469,470],[470,471],[471,472],[472,469]),si=We([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]),i2=[...Qs,...ei,...ti,...ri,...ni,...si],o2=We([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]);function a2(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var G=class extends Pe{constructor(e,t){super(new He(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,w(e=this.h=new ga,0,1,t=new W),this.A=new pa,w(this.h,0,3,this.A),this.u=new Tn,w(this.h,0,2,this.u),ct(this.u,4,1),_(this.u,2,.5),_(this.A,2,.5),_(this.h,4,.5)}get baseOptions(){return O(this.h,W,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numFaces"in e&&ct(this.u,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&_(this.u,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&_(this.A,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}F(e,t){return a2(this),Ke(this,e,t),this.j}G(e,t,r){return a2(this),et(this,e,r,t),this.j}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"face_landmarks");const t=new Le;$e(t,ic,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Ne(e,r),this.g.attachProtoVectorListener("face_landmarks",(n,s)=>{for(const i of n)n=Ur(i),this.j.faceLandmarks.push(Ln(n));g(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{g(this,n)}),this.outputFaceBlendshapes&&(P(e,"blendshapes"),S(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,s)=>{if(this.outputFaceBlendshapes)for(const i of n)n=An(i),this.j.faceBlendshapes.push(zs(n.g()??[]));g(this,s)}),this.g.attachEmptyPacketListener("blendshapes",n=>{g(this,n)})),this.outputFacialTransformationMatrixes&&(P(e,"face_geometry"),S(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,s)=>{if(this.outputFacialTransformationMatrixes)for(const i of n)(n=O(n=sc(i),q1,2))&&this.j.facialTransformationMatrixes.push({rows:Ie(n,1)??0??0,columns:Ie(n,2)??0??0,data:Mt(n,3,qe,xt()).slice()??[]});g(this,s)}),this.g.attachEmptyPacketListener("face_geometry",n=>{g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};G.prototype.detectForVideo=G.prototype.G,G.prototype.detect=G.prototype.F,G.prototype.setOptions=G.prototype.o,G.createFromModelPath=function(e,t){return L(G,e,{baseOptions:{modelAssetPath:t}})},G.createFromModelBuffer=function(e,t){return L(G,e,{baseOptions:{modelAssetBuffer:t}})},G.createFromOptions=function(e,t){return L(G,e,t)},G.FACE_LANDMARKS_LIPS=Qs,G.FACE_LANDMARKS_LEFT_EYE=ei,G.FACE_LANDMARKS_LEFT_EYEBROW=ti,G.FACE_LANDMARKS_LEFT_IRIS=n2,G.FACE_LANDMARKS_RIGHT_EYE=ri,G.FACE_LANDMARKS_RIGHT_EYEBROW=ni,G.FACE_LANDMARKS_RIGHT_IRIS=s2,G.FACE_LANDMARKS_FACE_OVAL=si,G.FACE_LANDMARKS_CONTOURS=i2,G.FACE_LANDMARKS_TESSELATION=o2;var ii=We([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]);function c2(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function u2(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function h2(e,t=!0){const r=[];for(const s of e){var n=An(s);e=[];for(const i of n.g())n=t&&Ie(i,1)!=null?Ie(i,1)??0:-1,e.push({score:H(i,2)??0,index:n,categoryName:ce(D(i,3))??""??"",displayName:ce(D(i,4))??""??""});r.push(e)}return r}var Re=class extends Pe{constructor(e,t){super(new He(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.j=new ya,0,1,t=new W),this.u=new js,w(this.j,0,2,this.u),this.D=new Ds,w(this.u,0,3,this.D),this.A=new va,w(this.u,0,2,this.A),this.h=new oc,w(this.j,0,3,this.h),_(this.A,2,.5),_(this.u,4,.5),_(this.D,2,.5)}get baseOptions(){return O(this.j,W,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){var s,i,o,c;if(ct(this.A,3,e.numHands??1),"minHandDetectionConfidence"in e&&_(this.A,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.u,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&_(this.D,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new pr,r=t,n=Ks(e.cannedGesturesClassifierOptions,(s=O(this.h,pr,3))==null?void 0:s.l());w(r,0,2,n),w(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((i=O(this.h,pr,3))==null||i.g());return e.customGesturesClassifierOptions?(w(r=t=new pr,0,2,n=Ks(e.customGesturesClassifierOptions,(o=O(this.h,pr,4))==null?void 0:o.l())),w(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((c=O(this.h,pr,4))==null||c.g()),this.l(e)}Ha(e,t){return c2(this),Ke(this,e,t),u2(this)}Ia(e,t,r){return c2(this),et(this,e,r,t),u2(this)}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"hand_gestures"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Le;$e(t,ac,this.j);const r=new ve;Se(r,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"HAND_GESTURES:hand_gestures"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ne(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n){n=Ur(i);const o=[];for(const c of at(n,oa,1))o.push({x:H(c,1)??0,y:H(c,2)??0,z:H(c,3)??0,visibility:H(c,4)??0});this.landmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n){n=dr(i);const o=[];for(const c of at(n,ia,1))o.push({x:H(c,1)??0,y:H(c,2)??0,z:H(c,3)??0,visibility:H(c,4)??0});this.worldLandmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,s)=>{this.gestures.push(...h2(n,!1)),g(this,s)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{this.handedness.push(...h2(n)),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function l2(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Re.prototype.recognizeForVideo=Re.prototype.Ia,Re.prototype.recognize=Re.prototype.Ha,Re.prototype.setOptions=Re.prototype.o,Re.createFromModelPath=function(e,t){return L(Re,e,{baseOptions:{modelAssetPath:t}})},Re.createFromModelBuffer=function(e,t){return L(Re,e,{baseOptions:{modelAssetBuffer:t}})},Re.createFromOptions=function(e,t){return L(Re,e,t)},Re.HAND_CONNECTIONS=ii;var ye=class extends Pe{constructor(e,t){super(new He(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.h=new js,0,1,t=new W),this.u=new Ds,w(this.h,0,3,this.u),this.j=new va,w(this.h,0,2,this.j),ct(this.j,3,1),_(this.j,2,.5),_(this.u,2,.5),_(this.h,4,.5)}get baseOptions(){return O(this.h,W,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numHands"in e&&ct(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&_(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&_(this.u,2,e.minHandPresenceConfidence??.5),this.l(e)}F(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ke(this,e,t),l2(this)}G(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],et(this,e,r,t),l2(this)}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Le;$e(t,cc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ne(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n)n=Ur(i),this.landmarks.push(Ln(n));g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n)n=dr(i),this.worldLandmarks.push(Vr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{var i=this.handedness,o=i.push;const c=[];for(const u of n){n=An(u);const f=[];for(const h of n.g())f.push({score:H(h,2)??0,index:Ie(h,1)??0??-1,categoryName:ce(D(h,3))??""??"",displayName:ce(D(h,4))??""??""});c.push(f)}o.call(i,...c),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ye.prototype.detectForVideo=ye.prototype.G,ye.prototype.detect=ye.prototype.F,ye.prototype.setOptions=ye.prototype.o,ye.createFromModelPath=function(e,t){return L(ye,e,{baseOptions:{modelAssetPath:t}})},ye.createFromModelBuffer=function(e,t){return L(ye,e,{baseOptions:{modelAssetBuffer:t}})},ye.createFromOptions=function(e,t){return L(ye,e,t)},ye.HAND_CONNECTIONS=ii;var f2=We([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]);function d2(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function p2(e){try{if(!e.D)return e.h;e.D(e.h)}finally{Rn(e)}}function xn(e,t){e=Ur(e),t.push(Ln(e))}var B=class extends Pe{constructor(e,t){super(new He(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,w(e=this.j=new ka,0,1,t=new W),this.I=new Ds,w(this.j,0,2,this.I),this.W=new uc,w(this.j,0,3,this.W),this.u=new Tn,w(this.j,0,4,this.u),this.O=new pa,w(this.j,0,5,this.O),this.A=new Ea,w(this.j,0,6,this.A),this.M=new Aa,w(this.j,0,7,this.M),_(this.u,2,.5),_(this.u,3,.3),_(this.O,2,.5),_(this.A,2,.5),_(this.A,3,.3),_(this.M,2,.5),_(this.I,2,.5)}get baseOptions(){return O(this.j,W,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&_(this.u,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&_(this.u,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&_(this.O,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&_(this.A,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&_(this.A,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&_(this.M,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&_(this.I,2,e.minHandLandmarksConfidence??.5),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.D=typeof t=="function"?t:r,d2(this),Ke(this,e,n),p2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.D=typeof r=="function"?r:n,d2(this),et(this,e,s,t),p2(this)}m(){var e=new Oe;V(e,"input_frames_image"),P(e,"pose_landmarks"),P(e,"pose_world_landmarks"),P(e,"face_landmarks"),P(e,"left_hand_landmarks"),P(e,"left_hand_world_landmarks"),P(e,"right_hand_landmarks"),P(e,"right_hand_world_landmarks");const t=new Le,r=new Vo;Se(r,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),function(s,i){if(i!=null)if(Array.isArray(i))x(s,2,on(i,0,Cr));else{if(!(typeof i=="string"||i instanceof Ye||Wn(i)))throw Error("invalid value in Any.value field: "+i+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");mt(s,2,Yn(i,!1),Tt())}}(r,this.j.g());const n=new ve;Se(n,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),ps(n,8,Vo,r),j(n,"IMAGE:input_frames_image"),S(n,"POSE_LANDMARKS:pose_landmarks"),S(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),S(n,"FACE_LANDMARKS:face_landmarks"),S(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),S(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),S(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),S(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(t),Ne(e,n),Pn(this,e),this.g.attachProtoListener("pose_landmarks",(s,i)=>{xn(s,this.h.poseLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("pose_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("pose_world_landmarks",(s,i)=>{var o=this.h.poseWorldLandmarks;s=dr(s),o.push(Vr(s)),g(this,i)}),this.g.attachEmptyPacketListener("pose_world_landmarks",s=>{g(this,s)}),this.outputPoseSegmentationMasks&&(S(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),gr(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",(s,i)=>{this.h.poseSegmentationMasks=[vr(this,s,!0,!this.D)],g(this,i)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",s=>{this.h.poseSegmentationMasks=[],g(this,s)})),this.g.attachProtoListener("face_landmarks",(s,i)=>{xn(s,this.h.faceLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("face_landmarks",s=>{g(this,s)}),this.outputFaceBlendshapes&&(P(e,"extra_blendshapes"),S(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(s,i)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(s=An(s),o.push(zs(s.g()??[]))),g(this,i)}),this.g.attachEmptyPacketListener("extra_blendshapes",s=>{g(this,s)})),this.g.attachProtoListener("left_hand_landmarks",(s,i)=>{xn(s,this.h.leftHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("left_hand_world_landmarks",(s,i)=>{var o=this.h.leftHandWorldLandmarks;s=dr(s),o.push(Vr(s)),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_landmarks",(s,i)=>{xn(s,this.h.rightHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_world_landmarks",(s,i)=>{var o=this.h.rightHandWorldLandmarks;s=dr(s),o.push(Vr(s)),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",s=>{g(this,s)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};B.prototype.detectForVideo=B.prototype.G,B.prototype.detect=B.prototype.F,B.prototype.setOptions=B.prototype.o,B.createFromModelPath=function(e,t){return L(B,e,{baseOptions:{modelAssetPath:t}})},B.createFromModelBuffer=function(e,t){return L(B,e,{baseOptions:{modelAssetBuffer:t}})},B.createFromOptions=function(e,t){return L(B,e,t)},B.HAND_CONNECTIONS=ii,B.POSE_CONNECTIONS=f2,B.FACE_LANDMARKS_LIPS=Qs,B.FACE_LANDMARKS_LEFT_EYE=ei,B.FACE_LANDMARKS_LEFT_EYEBROW=ti,B.FACE_LANDMARKS_LEFT_IRIS=n2,B.FACE_LANDMARKS_RIGHT_EYE=ri,B.FACE_LANDMARKS_RIGHT_EYEBROW=ni,B.FACE_LANDMARKS_RIGHT_IRIS=s2,B.FACE_LANDMARKS_FACE_OVAL=si,B.FACE_LANDMARKS_CONTOURS=i2,B.FACE_LANDMARKS_TESSELATION=o2;var je=class extends Pe{constructor(e,t){super(new He(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},w(e=this.h=new Sa,0,1,t=new W)}get baseOptions(){return O(this.h,W,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return w(this.h,0,2,Ks(e,O(this.h,Is,2))),this.l(e)}sa(e,t){return this.j={classifications:[]},Ke(this,e,t),this.j}ta(e,t,r){return this.j={classifications:[]},et(this,e,r,t),this.j}m(){var e=new Oe;V(e,"input_image"),V(e,"norm_rect"),P(e,"classifications");const t=new Le;$e(t,hc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),j(r,"IMAGE:input_image"),j(r,"NORM_RECT:norm_rect"),S(r,"CLASSIFICATIONS:classifications"),r.o(t),Ne(e,r),this.g.attachProtoListener("classifications",(n,s)=>{this.j=mc(Z1(n)),g(this,s)}),this.g.attachEmptyPacketListener("classifications",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};je.prototype.classifyForVideo=je.prototype.ta,je.prototype.classify=je.prototype.sa,je.prototype.setOptions=je.prototype.o,je.createFromModelPath=function(e,t){return L(je,e,{baseOptions:{modelAssetPath:t}})},je.createFromModelBuffer=function(e,t){return L(je,e,{baseOptions:{modelAssetBuffer:t}})},je.createFromOptions=function(e,t){return L(je,e,t)};var Fe=class extends Pe{constructor(e,t){super(new He(e,t),"image_in","norm_rect",!0),this.h=new Ta,this.embeddings={embeddings:[]},w(e=this.h,0,1,t=new W)}get baseOptions(){return O(this.h,W,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){var t=this.h,r=O(this.h,la,2);return r=r?r.clone():new la,e.l2Normalize!==void 0?x(r,1,xr(e.l2Normalize)):"l2Normalize"in e&&x(r,1),e.quantize!==void 0?x(r,2,xr(e.quantize)):"quantize"in e&&x(r,2),w(t,0,2,r),this.l(e)}za(e,t){return Ke(this,e,t),this.embeddings}Aa(e,t,r){return et(this,e,r,t),this.embeddings}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"embeddings_out");const t=new Le;$e(t,lc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"EMBEDDINGS:embeddings_out"),r.o(t),Ne(e,r),this.g.attachProtoListener("embeddings_out",(n,s)=>{n=tc(n),this.embeddings=function(i){return{embeddings:at(i,ec,1).map(o=>{var f,h;const c={headIndex:Ie(o,3)??0??-1,headName:ce(D(o,4))??""??""};var u=o.v;return so(u,0|u[m],ca,hs(o,1))!==void 0?(o=Mt(o=O(o,ca,hs(o,1),void 0),1,qe,xt()),c.floatEmbedding=o.slice()):(u=new Uint8Array(0),c.quantizedEmbedding=((h=(f=O(o,Q1,hs(o,2),void 0))==null?void 0:f.na())==null?void 0:h.h())??u),c}),timestampMs:Ca(ao(i))}}(n),g(this,s)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Fe.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=ja(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=ja(Da(e.quantizedEmbedding),Da(t.quantizedEmbedding))}return e},Fe.prototype.embedForVideo=Fe.prototype.Aa,Fe.prototype.embed=Fe.prototype.za,Fe.prototype.setOptions=Fe.prototype.o,Fe.createFromModelPath=function(e,t){return L(Fe,e,{baseOptions:{modelAssetPath:t}})},Fe.createFromModelBuffer=function(e,t){return L(Fe,e,{baseOptions:{modelAssetBuffer:t}})},Fe.createFromOptions=function(e,t){return L(Fe,e,t)};var oi=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};function Ac(e){var r,n;const t=function(s){return at(s,ve,1)}(e.ca()).filter(s=>(ce(D(s,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(e.u=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(((n=(r=O(t[0],Le,7))==null?void 0:r.j())==null?void 0:n.g())??new Map).forEach((s,i)=>{e.u[Number(i)]=ce(D(s,1))??""})}function g2(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function m2(e){try{const t=new oi(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{Rn(e)}}oi.prototype.close=oi.prototype.close;var _e=class extends Pe{constructor(e,t){super(new He(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Gs,this.A=new La,w(this.h,0,3,this.A),w(e=this.h,0,1,t=new W)}get baseOptions(){return O(this.h,W,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?x(this.h,2,Ir(e.displayNamesLocale)):"displayNamesLocale"in e&&x(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}L(){Ac(this)}segment(e,t,r){const n=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,g2(this),Ke(this,e,n),m2(this)}La(e,t,r,n){const s=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:n,g2(this),et(this,e,s,t),m2(this)}Da(){return this.u}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect");const t=new Le;$e(t,Ra,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),r.o(t),Ne(e,r),Pn(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),gr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>vr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),gr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=vr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};_e.prototype.getLabels=_e.prototype.Da,_e.prototype.segmentForVideo=_e.prototype.La,_e.prototype.segment=_e.prototype.segment,_e.prototype.setOptions=_e.prototype.o,_e.createFromModelPath=function(e,t){return L(_e,e,{baseOptions:{modelAssetPath:t}})},_e.createFromModelBuffer=function(e,t){return L(_e,e,{baseOptions:{modelAssetBuffer:t}})},_e.createFromOptions=function(e,t){return L(_e,e,t)};var ai=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};ai.prototype.close=ai.prototype.close;var tt=class extends Pe{constructor(e,t){super(new He(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Gs,this.u=new La,w(this.h,0,3,this.u),w(e=this.h,0,1,t=new W)}get baseOptions(){return O(this.h,W,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,r,n){const s=typeof r!="function"?r:{};if(this.j=typeof r=="function"?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.C+1,n=new xa,t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var i=new Ws;mt(i,3,xr(!0),!1),mt(i,1,Fr(t.keypoint.x),0),mt(i,2,Fr(t.keypoint.y),0),Nr(n,1,Hs,i)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");{const c=new dc;for(i of t.scribble)mt(t=new Ws,3,xr(!0),!1),mt(t,1,Fr(i.x),0),mt(t,2,Fr(i.y),0),ps(c,1,Ws,t);Nr(n,2,Hs,c)}}this.g.addProtoToStream(n.g(),"mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest","roi_in",r),Ke(this,e,s);e:{try{const c=new ai(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=c;break e}this.j(c)}finally{Rn(this)}o=void 0}return o}m(){var e=new Oe;V(e,"image_in"),V(e,"roi_in"),V(e,"norm_rect_in");const t=new Le;$e(t,Ra,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"),j(r,"IMAGE:image_in"),j(r,"ROI:roi_in"),j(r,"NORM_RECT:norm_rect_in"),r.o(t),Ne(e,r),Pn(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),gr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>vr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),gr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=vr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};tt.prototype.segment=tt.prototype.segment,tt.prototype.setOptions=tt.prototype.o,tt.createFromModelPath=function(e,t){return L(tt,e,{baseOptions:{modelAssetPath:t}})},tt.createFromModelBuffer=function(e,t){return L(tt,e,{baseOptions:{modelAssetBuffer:t}})},tt.createFromOptions=function(e,t){return L(tt,e,t)};var Be=class extends Pe{constructor(e,t){super(new He(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},w(e=this.h=new Ma,0,1,t=new W)}get baseOptions(){return O(this.h,W,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?x(this.h,2,Ir(e.displayNamesLocale)):"displayNamesLocale"in e&&x(this.h,2),e.maxResults!==void 0?ct(this.h,3,e.maxResults):"maxResults"in e&&x(this.h,3),e.scoreThreshold!==void 0?_(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&x(this.h,4),e.categoryAllowlist!==void 0?an(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&x(this.h,5),e.categoryDenylist!==void 0?an(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&x(this.h,6),this.l(e)}F(e,t){return this.j={detections:[]},Ke(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},et(this,e,r,t),this.j}m(){var e=new Oe;V(e,"input_frame_gpu"),V(e,"norm_rect"),P(e,"detections");const t=new Le;$e(t,pc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),j(r,"IMAGE:input_frame_gpu"),j(r,"NORM_RECT:norm_rect"),S(r,"DETECTIONS:detections"),r.o(t),Ne(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=sa(i),this.j.detections.push(Na(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Be.prototype.detectForVideo=Be.prototype.G,Be.prototype.detect=Be.prototype.F,Be.prototype.setOptions=Be.prototype.o,Be.createFromModelPath=async function(e,t){return L(Be,e,{baseOptions:{modelAssetPath:t}})},Be.createFromModelBuffer=function(e,t){return L(Be,e,{baseOptions:{modelAssetBuffer:t}})},Be.createFromOptions=function(e,t){return L(Be,e,t)};var ci=class{constructor(e,t,r){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=r}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function v2(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function y2(e){try{const t=new ci(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.u)return t;e.u(t)}finally{Rn(e)}}ci.prototype.close=ci.prototype.close;var xe=class extends Pe{constructor(e,t){super(new He(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,w(e=this.h=new Ia,0,1,t=new W),this.A=new Aa,w(this.h,0,3,this.A),this.j=new Ea,w(this.h,0,2,this.j),ct(this.j,4,1),_(this.j,2,.5),_(this.A,2,.5),_(this.h,4,.5)}get baseOptions(){return O(this.h,W,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numPoses"in e&&ct(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&_(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&_(this.A,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.u=typeof t=="function"?t:r,v2(this),Ke(this,e,n),y2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.u=typeof r=="function"?r:n,v2(this),et(this,e,s,t),y2(this)}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"normalized_landmarks"),P(e,"world_landmarks"),P(e,"segmentation_masks");const t=new Le;$e(t,gc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:normalized_landmarks"),S(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Ne(e,r),Pn(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(n,s)=>{this.landmarks=[];for(const i of n)n=Ur(i),this.landmarks.push(Ln(n));g(this,s)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],g(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,s)=>{this.worldLandmarks=[];for(const i of n)n=dr(i),this.worldLandmarks.push(Vr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],g(this,n)}),this.outputSegmentationMasks&&(S(r,"SEGMENTATION_MASK:segmentation_masks"),gr(this,"segmentation_masks"),this.g.aa("segmentation_masks",(n,s)=>{this.segmentationMasks=n.map(i=>vr(this,i,!0,!this.u)),g(this,s)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};xe.prototype.detectForVideo=xe.prototype.G,xe.prototype.detect=xe.prototype.F,xe.prototype.setOptions=xe.prototype.o,xe.createFromModelPath=function(e,t){return L(xe,e,{baseOptions:{modelAssetPath:t}})},xe.createFromModelBuffer=function(e,t){return L(xe,e,{baseOptions:{modelAssetBuffer:t}})},xe.createFromOptions=function(e,t){return L(xe,e,t)},xe.POSE_CONNECTIONS=f2;const kc=["Smile","Blink","Turn_Head","Thumbs_Up"],_2=({apiUrl:e,duration:t=60,smileThreshold:r=.2,blinkThreshold:n=.01,minturnHeadThreshold:s=.15,maxturnHeadThreshold:i=.85,onComplete:o,onError:c})=>{const u=N.useRef(null),f=N.useRef(),h=N.useRef(null),[d,b]=N.useState({face:null,hand:null}),[A,R]=N.useState("loading"),[Ut,Me]=N.useState(""),[ue,Y]=N.useState([]),[lt,Mn]=N.useState(0),[yr,In]=N.useState(t),[_r,Kr]=N.useState(!1),At=N.useRef(lt),kt=N.useRef(_r);N.useEffect(()=>{At.current=lt},[lt]),N.useEffect(()=>{kt.current=_r},[_r]);const Cn=()=>{Y([...kc].sort(()=>.5-Math.random()).slice(0,3))};N.useEffect(()=>{(async()=>{try{const ne=await Bt.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3/wasm"),he=await G.createFromOptions(ne,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO"}),le=await ye.createFromOptions(ne,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task",delegate:"GPU"},runningMode:"VIDEO",numHands:1});b({face:he,hand:le}),Cn(),R("ready")}catch{Me("Failed to load security assets."),R("error")}})()},[]),N.useEffect(()=>(A==="capturing"&&yr>0?h.current=setInterval(()=>In(Z=>Z-1),1e3):yr===0&&A==="capturing"&&R("expired"),()=>clearInterval(h.current)),[A,yr]);const Nn=()=>R("capturing"),rt=()=>{Mn(0),At.current=0,In(t),Kr(!1),kt.current=!1,Me(""),Cn(),R("ready")},ft=(Z,ne)=>{const he=document.createElement("canvas"),le=he.getContext("2d"),be=ne.map(Xr=>Xr.x*Z.videoWidth),C=ne.map(Xr=>Xr.y*Z.videoHeight),pe=Math.min(...be),fe=Math.max(...be),nt=Math.min(...C),st=Math.max(...C),dt=fe-pe,Yr=st-nt,pt=dt*.25;return he.width=224,he.height=224,le.drawImage(Z,pe-pt,nt-pt,dt+pt*2,Yr+pt*2,0,0,224,224),he},Vt=(Z,ne,he)=>{var le,be;if(kt.current)return!1;if(he==="Thumbs_Up"&&((le=ne==null?void 0:ne.landmarks)==null?void 0:le.length)>0){const C=ne.landmarks[0];return C[4].y<C[2].y&&[8,12,16,20].every(pe=>C[pe].y>C[pe-2].y)}if(((be=Z==null?void 0:Z.faceLandmarks)==null?void 0:be.length)>0){const C=Z.faceLandmarks[0];switch(he){case"Smile":return C[291].x-C[61].x>r;case"Blink":return(Math.abs(C[159].y-C[145].y)+Math.abs(C[386].y-C[374].y))/2<n;case"Turn_Head":const fe=(C[1].x-C[33].x)/(C[263].x-C[33].x);return fe<s||fe>i;default:return!1}}return!1},br=N.useCallback(()=>{var be,C,pe;if(A!=="capturing"||!((be=u.current)!=null&&be.video))return;const Z=u.current.video,ne=performance.now(),he=(C=d.face)==null?void 0:C.detectForVideo(Z,ne),le=(pe=d.hand)==null?void 0:pe.detectForVideo(Z,ne);Vt(he,le,ue[At.current])&&(kt.current||(Kr(!0),kt.current=!0,setTimeout(()=>{At.current<ue.length-1?(Mn(fe=>(At.current=fe+1,fe+1)),Kr(!1),kt.current=!1):zr()},1500))),f.current=requestAnimationFrame(br)},[A,d,ue]);N.useEffect(()=>(A==="capturing"&&(f.current=requestAnimationFrame(br)),()=>cancelAnimationFrame(f.current)),[A,br]);const zr=async()=>{var Z,ne;R("verifying");try{const he=u.current.video,le=[];for(let fe=0;fe<5;fe++){const nt=performance.now(),st=(Z=d.face)==null?void 0:Z.detectForVideo(he,nt);(ne=st==null?void 0:st.faceLandmarks)!=null&&ne[0]&&le.push(ft(he,st.faceLandmarks[0]).toDataURL("image/jpeg",.95)),await new Promise(dt=>setTimeout(dt,60))}const be=new FormData;for(let fe=0;fe<le.length;fe++){const nt=await(await fetch(le[fe])).blob();be.append("files",nt,`frame_${fe}.jpg`)}const pe=await(await fetch(`${e}/v1/verify`,{method:"POST",body:be})).json();pe.is_live?(R("success"),o==null||o({success:!0,image:le[le.length-1],skinConfidence:pe.skin_confidence})):(Me(pe.reason||"Spoof detected."),R("error"),c==null||c({success:!1,reason:pe.reason||"Spoof detected."}))}catch{Me("Server unreachable."),R("error"),c==null||c({success:!1,reason:"Server error"})}};return{webcamRef:u,status:A,errorMsg:Ut,sequence:ue,currentStep:lt,timeLeft:yr,isStepTransitioning:_r,start:Nn,reset:rt,sendFinalProof:zr}};var ui={exports:{}},Wr={};/**
|
|
16
16
|
* @license React
|
|
17
17
|
* react-jsx-runtime.production.min.js
|
|
18
18
|
*
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the MIT license found in the
|
|
22
22
|
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/var
|
|
23
|
+
*/var b2;function Sc(){if(b2)return Wr;b2=1;var e=N,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(c,u,f){var h,d={},b=null,A=null;f!==void 0&&(b=""+f),u.key!==void 0&&(b=""+u.key),u.ref!==void 0&&(A=u.ref);for(h in u)n.call(u,h)&&!i.hasOwnProperty(h)&&(d[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)d[h]===void 0&&(d[h]=u[h]);return{$$typeof:t,type:c,key:b,ref:A,props:d,_owner:s.current}}return Wr.Fragment=r,Wr.jsx=o,Wr.jsxs=o,Wr}var Hr={};/**
|
|
24
24
|
* @license React
|
|
25
25
|
* react-jsx-runtime.development.js
|
|
26
26
|
*
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the MIT license found in the
|
|
30
30
|
* LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/var
|
|
32
|
-
`+
|
|
31
|
+
*/var w2;function Tc(){return w2||(w2=1,process.env.NODE_ENV!=="production"&&function(){var e=N,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),R=Symbol.iterator,Ut="@@iterator";function Me(a){if(a===null||typeof a!="object")return null;var l=R&&a[R]||a[Ut];return typeof l=="function"?l:null}var ue=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Y(a){{for(var l=arguments.length,p=new Array(l>1?l-1:0),E=1;E<l;E++)p[E-1]=arguments[E];lt("error",a,p)}}function lt(a,l,p){{var E=ue.ReactDebugCurrentFrame,F=E.getStackAddendum();F!==""&&(l+="%s",p=p.concat([F]));var M=p.map(function(T){return String(T)});M.unshift("Warning: "+l),Function.prototype.apply.call(console[a],console,M)}}var Mn=!1,yr=!1,In=!1,_r=!1,Kr=!1,At;At=Symbol.for("react.module.reference");function kt(a){return!!(typeof a=="string"||typeof a=="function"||a===n||a===i||Kr||a===s||a===f||a===h||_r||a===A||Mn||yr||In||typeof a=="object"&&a!==null&&(a.$$typeof===b||a.$$typeof===d||a.$$typeof===o||a.$$typeof===c||a.$$typeof===u||a.$$typeof===At||a.getModuleId!==void 0))}function Cn(a,l,p){var E=a.displayName;if(E)return E;var F=l.displayName||l.name||"";return F!==""?p+"("+F+")":p}function Nn(a){return a.displayName||"Context"}function rt(a){if(a==null)return null;if(typeof a.tag=="number"&&Y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case n:return"Fragment";case r:return"Portal";case i:return"Profiler";case s:return"StrictMode";case f:return"Suspense";case h:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case c:var l=a;return Nn(l)+".Consumer";case o:var p=a;return Nn(p._context)+".Provider";case u:return Cn(a,a.render,"ForwardRef");case d:var E=a.displayName||null;return E!==null?E:rt(a.type)||"Memo";case b:{var F=a,M=F._payload,T=F._init;try{return rt(T(M))}catch{return null}}}return null}var ft=Object.assign,Vt=0,br,zr,Z,ne,he,le,be;function C(){}C.__reactDisabledLog=!0;function pe(){{if(Vt===0){br=console.log,zr=console.info,Z=console.warn,ne=console.error,he=console.group,le=console.groupCollapsed,be=console.groupEnd;var a={configurable:!0,enumerable:!0,value:C,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}Vt++}}function fe(){{if(Vt--,Vt===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ft({},a,{value:br}),info:ft({},a,{value:zr}),warn:ft({},a,{value:Z}),error:ft({},a,{value:ne}),group:ft({},a,{value:he}),groupCollapsed:ft({},a,{value:le}),groupEnd:ft({},a,{value:be})})}Vt<0&&Y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var nt=ue.ReactCurrentDispatcher,st;function dt(a,l,p){{if(st===void 0)try{throw Error()}catch(F){var E=F.stack.trim().match(/\n( *(at )?)/);st=E&&E[1]||""}return`
|
|
32
|
+
`+st+a}}var Yr=!1,pt;{var Xr=typeof WeakMap=="function"?WeakMap:Map;pt=new Xr}function E2(a,l){if(!a||Yr)return"";{var p=pt.get(a);if(p!==void 0)return p}var E;Yr=!0;var F=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var M;M=nt.current,nt.current=null,pe();try{if(l){var T=function(){throw Error()};if(Object.defineProperty(T.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(T,[])}catch(we){E=we}Reflect.construct(a,[],T)}else{try{T.call()}catch(we){E=we}a.call(T.prototype)}}else{try{throw Error()}catch(we){E=we}a()}}catch(we){if(we&&E&&typeof we.stack=="string"){for(var k=we.stack.split(`
|
|
33
33
|
`),me=E.stack.split(`
|
|
34
|
-
`),
|
|
35
|
-
`+k[
|
|
34
|
+
`),X=k.length-1,Q=me.length-1;X>=1&&Q>=0&&k[X]!==me[Q];)Q--;for(;X>=1&&Q>=0;X--,Q--)if(k[X]!==me[Q]){if(X!==1||Q!==1)do if(X--,Q--,Q<0||k[X]!==me[Q]){var Ve=`
|
|
35
|
+
`+k[X].replace(" at new "," at ");return a.displayName&&Ve.includes("<anonymous>")&&(Ve=Ve.replace("<anonymous>",a.displayName)),typeof a=="function"&&pt.set(a,Ve),Ve}while(X>=1&&Q>=0);break}}}finally{Yr=!1,nt.current=M,fe(),Error.prepareStackTrace=F}var Er=a?a.displayName||a.name:"",Gt=Er?dt(Er):"";return typeof a=="function"&&pt.set(a,Gt),Gt}function Pc(a,l,p){return E2(a,!1)}function Rc(a){var l=a.prototype;return!!(l&&l.isReactComponent)}function Dn(a,l,p){if(a==null)return"";if(typeof a=="function")return E2(a,Rc(a));if(typeof a=="string")return dt(a);switch(a){case f:return dt("Suspense");case h:return dt("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case u:return Pc(a.render);case d:return Dn(a.type,l,p);case b:{var E=a,F=E._payload,M=E._init;try{return Dn(M(F),l,p)}catch{}}}return""}var qr=Object.prototype.hasOwnProperty,A2={},k2=ue.ReactDebugCurrentFrame;function jn(a){if(a){var l=a._owner,p=Dn(a.type,a._source,l?l.type:null);k2.setExtraStackFrame(p)}else k2.setExtraStackFrame(null)}function Fc(a,l,p,E,F){{var M=Function.call.bind(qr);for(var T in a)if(M(a,T)){var k=void 0;try{if(typeof a[T]!="function"){var me=Error((E||"React class")+": "+p+" type `"+T+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[T]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw me.name="Invariant Violation",me}k=a[T](l,T,E,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){k=X}k&&!(k instanceof Error)&&(jn(F),Y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",E||"React class",p,T,typeof k),jn(null)),k instanceof Error&&!(k.message in A2)&&(A2[k.message]=!0,jn(F),Y("Failed %s type: %s",p,k.message),jn(null))}}}var xc=Array.isArray;function hi(a){return xc(a)}function Mc(a){{var l=typeof Symbol=="function"&&Symbol.toStringTag,p=l&&a[Symbol.toStringTag]||a.constructor.name||"Object";return p}}function Ic(a){try{return S2(a),!1}catch{return!0}}function S2(a){return""+a}function T2(a){if(Ic(a))return Y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Mc(a)),S2(a)}var L2=ue.ReactCurrentOwner,Cc={key:!0,ref:!0,__self:!0,__source:!0},O2,P2;function Nc(a){if(qr.call(a,"ref")){var l=Object.getOwnPropertyDescriptor(a,"ref").get;if(l&&l.isReactWarning)return!1}return a.ref!==void 0}function Dc(a){if(qr.call(a,"key")){var l=Object.getOwnPropertyDescriptor(a,"key").get;if(l&&l.isReactWarning)return!1}return a.key!==void 0}function jc(a,l){typeof a.ref=="string"&&L2.current}function Bc(a,l){{var p=function(){O2||(O2=!0,Y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};p.isReactWarning=!0,Object.defineProperty(a,"key",{get:p,configurable:!0})}}function Uc(a,l){{var p=function(){P2||(P2=!0,Y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};p.isReactWarning=!0,Object.defineProperty(a,"ref",{get:p,configurable:!0})}}var Vc=function(a,l,p,E,F,M,T){var k={$$typeof:t,type:a,key:l,ref:p,props:T,_owner:M};return k._store={},Object.defineProperty(k._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(k,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(k,"_source",{configurable:!1,enumerable:!1,writable:!1,value:F}),Object.freeze&&(Object.freeze(k.props),Object.freeze(k)),k};function Gc(a,l,p,E,F){{var M,T={},k=null,me=null;p!==void 0&&(T2(p),k=""+p),Dc(l)&&(T2(l.key),k=""+l.key),Nc(l)&&(me=l.ref,jc(l,F));for(M in l)qr.call(l,M)&&!Cc.hasOwnProperty(M)&&(T[M]=l[M]);if(a&&a.defaultProps){var X=a.defaultProps;for(M in X)T[M]===void 0&&(T[M]=X[M])}if(k||me){var Q=typeof a=="function"?a.displayName||a.name||"Unknown":a;k&&Bc(T,Q),me&&Uc(T,Q)}return Vc(a,k,me,F,E,L2.current,T)}}var li=ue.ReactCurrentOwner,R2=ue.ReactDebugCurrentFrame;function wr(a){if(a){var l=a._owner,p=Dn(a.type,a._source,l?l.type:null);R2.setExtraStackFrame(p)}else R2.setExtraStackFrame(null)}var fi;fi=!1;function di(a){return typeof a=="object"&&a!==null&&a.$$typeof===t}function F2(){{if(li.current){var a=rt(li.current.type);if(a)return`
|
|
36
36
|
|
|
37
|
-
Check the render method of \``+a+"`."}return""}}function Wc(a){return""}var
|
|
37
|
+
Check the render method of \``+a+"`."}return""}}function Wc(a){return""}var x2={};function Hc(a){{var l=F2();if(!l){var p=typeof a=="string"?a:a.displayName||a.name;p&&(l=`
|
|
38
38
|
|
|
39
|
-
Check the top-level render call using <`+p+">.")}return l}}function
|
|
39
|
+
Check the top-level render call using <`+p+">.")}return l}}function M2(a,l){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var p=Hc(l);if(x2[p])return;x2[p]=!0;var E="";a&&a._owner&&a._owner!==li.current&&(E=" It was passed a child from "+rt(a._owner.type)+"."),wr(a),Y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,E),wr(null)}}function I2(a,l){{if(typeof a!="object")return;if(hi(a))for(var p=0;p<a.length;p++){var E=a[p];di(E)&&M2(E,l)}else if(di(a))a._store&&(a._store.validated=!0);else if(a){var F=Me(a);if(typeof F=="function"&&F!==a.entries)for(var M=F.call(a),T;!(T=M.next()).done;)di(T.value)&&M2(T.value,l)}}}function Kc(a){{var l=a.type;if(l==null||typeof l=="string")return;var p;if(typeof l=="function")p=l.propTypes;else if(typeof l=="object"&&(l.$$typeof===u||l.$$typeof===d))p=l.propTypes;else return;if(p){var E=rt(l);Fc(p,a.props,"prop",E,a)}else if(l.PropTypes!==void 0&&!fi){fi=!0;var F=rt(l);Y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",F||"Unknown")}typeof l.getDefaultProps=="function"&&!l.getDefaultProps.isReactClassApproved&&Y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function zc(a){{for(var l=Object.keys(a.props),p=0;p<l.length;p++){var E=l[p];if(E!=="children"&&E!=="key"){wr(a),Y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),wr(null);break}}a.ref!==null&&(wr(a),Y("Invalid attribute `ref` supplied to `React.Fragment`."),wr(null))}}var C2={};function N2(a,l,p,E,F,M){{var T=kt(a);if(!T){var k="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(k+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var me=Wc();me?k+=me:k+=F2();var X;a===null?X="null":hi(a)?X="array":a!==void 0&&a.$$typeof===t?(X="<"+(rt(a.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):X=typeof a,Y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,k)}var Q=Gc(a,l,p,F,M);if(Q==null)return Q;if(T){var Ve=l.children;if(Ve!==void 0)if(E)if(hi(Ve)){for(var Er=0;Er<Ve.length;Er++)I2(Ve[Er],a);Object.freeze&&Object.freeze(Ve)}else Y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else I2(Ve,a)}if(qr.call(l,"key")){var Gt=rt(a),we=Object.keys(l).filter(function(Zc){return Zc!=="key"}),pi=we.length>0?"{key: someKey, "+we.join(": ..., ")+": ...}":"{key: someKey}";if(!C2[Gt+pi]){var $c=we.length>0?"{"+we.join(": ..., ")+": ...}":"{}";Y(`A props object containing a "key" prop is being spread into JSX:
|
|
40
40
|
let props = %s;
|
|
41
41
|
<%s {...props} />
|
|
42
42
|
React keys must be passed directly to JSX without using spread:
|
|
43
43
|
let props = %s;
|
|
44
|
-
<%s key={someKey} {...props} />`,
|
|
44
|
+
<%s key={someKey} {...props} />`,pi,Gt,$c,Gt),C2[Gt+pi]=!0}}return a===n?zc(Q):Kc(Q),Q}}function Yc(a,l,p){return N2(a,l,p,!0)}function Xc(a,l,p){return N2(a,l,p,!1)}var qc=Xc,Jc=Yc;Hr.Fragment=n,Hr.jsx=qc,Hr.jsxs=Jc}()),Hr}process.env.NODE_ENV==="production"?ui.exports=Sc():ui.exports=Tc();var Ue=ui.exports;const Lc=({apiUrl:e,duration:t,onComplete:r,onError:n,classNames:s={},render:i,smileThreshold:o,blinkThreshold:c,minturnHeadThreshold:u,maxturnHeadThreshold:f})=>{var d;const h=_2({apiUrl:e,duration:t,smileThreshold:o,blinkThreshold:c,minturnHeadThreshold:u,maxturnHeadThreshold:f,onComplete:r,onError:n});return i?i(h):Ue.jsxs("div",{className:s.container,children:[h.status==="loading"&&Ue.jsx("div",{children:"Initializing..."}),["ready","capturing","verifying"].includes(h.status)&&Ue.jsxs(Ue.Fragment,{children:[Ue.jsx(D2,{ref:h.webcamRef,mirrored:!0,screenshotFormat:"image/jpeg",className:s.webcam}),h.status==="capturing"&&Ue.jsx("div",{className:"liveness-challenge",children:h.isStepTransitioning?"Step verified! Get ready for the next...":`Do this: ${(d=h.sequence[h.currentStep])==null?void 0:d.replace("_"," ")}`}),["capturing","ready"].includes(h.status)&&Ue.jsxs("div",{className:s.timer,children:[h.timeLeft,"s"]}),h.status==="ready"&&Ue.jsx("button",{onClick:h.start,className:s.button,children:"Start Challenge"}),h.status==="verifying"&&Ue.jsx("div",{children:"Analyzing..."})]}),h.status==="error"&&Ue.jsxs("div",{className:s.error,children:[h.errorMsg,Ue.jsx("button",{onClick:h.reset,className:s.button,children:"Retry"})]}),h.status==="success"&&Ue.jsx("div",{className:s.success,children:"Verification Complete"})]})},Oc=async(e,t,r)=>{const n=new FormData;t.forEach((i,o)=>{n.append("files",i,`frame_${o}.jpg`)}),n.append("challenge",r);const s=await fetch(`${e}/v1/verify`,{method:"POST",body:n});if(!s.ok)throw new Error("Network response was not ok");return await s.json()};ze.LivenessSDK=Lc,ze.useLiveness=_2,ze.verifyLiveness=Oc,Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"})});
|