@mediapipe/tasks-vision 0.10.8 → 0.10.9-rc.20231209

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/vision_bundle.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e,n){t:{for(var r=["CLOSURE_FLAGS"],i=t,s=0;s<r.length;s++)if(null==(i=i[r[s]])){r=null;break t}r=i}return null!=(e=r&&r[e])?e:n}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,s;const o="undefined"!=typeof TextDecoder;let a;const c="undefined"!=typeof TextEncoder;function h(t){if(c)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(128>e)r[n++]=e;else{if(2048>e)r[n++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&i<t.length){const s=t.charCodeAt(++i);if(56320<=s&&57343>=s){e=1024*(e-55296)+s-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var u,l=e(610401301,!1),f=e(572417392,e(1,!0));const d=t.navigator;function p(t){return!!l&&(!!u&&u.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function g(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function m(){return!!l&&(!!u&&0<u.brands.length)}function y(){return m()?p("Chromium"):(g("Chrome")||g("CriOS"))&&!(!m()&&g("Edge"))||g("Silk")}u=d&&d.userAgentData||null;var v=!m()&&(g("Trident")||g("MSIE"));!g("Android")||y(),y(),g("Safari")&&(y()||!m()&&g("Coast")||!m()&&g("Opera")||!m()&&g("Edge")||(m()?p("Microsoft Edge"):g("Edg/"))||m()&&p("Opera"));var _={},w=null;function b(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=w[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}E();for(var r=0;;){var i=n(-1),s=n(0),o=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|s>>4),64!=o&&(e(s<<4&240|o>>2),64!=a&&e(o<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function E(){if(!w){w={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));_[n]=r;for(var i=0;i<r.length;i++){var s=r[i];void 0===w[s]&&(w[s]=i)}}}}var A="undefined"!=typeof Uint8Array,T=!v&&"function"==typeof btoa;function k(t){if(!T){var e;void 0===e&&(e=0),E(),e=_[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let c=0,h=0;for(;c<t.length-2;c+=3){var i=t[c],s=t[c+1],o=t[c+2],a=e[i>>2];i=e[(3&i)<<4|s>>4],s=e[(15&s)<<2|o>>6],o=e[63&o],n[h++]=a+i+s+o}switch(a=0,o=r,t.length-c){case 2:o=e[(15&(a=t[c+1]))<<2]||r;case 1:t=t[c],n[h]=e[t>>2]+e[(3&t)<<4|a>>4]+o+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const x=/[-_.]/g,S={"-":"+",_:"/",".":"="};function F(t){return S[t]||""}function L(t){if(!T)return b(t);x.test(t)&&(t=t.replace(x,F)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function M(t){return A&&null!=t&&t instanceof Uint8Array}let O;function P(){return O||=new Uint8Array(0)}var I={};let C;function R(t){if(t!==I)throw Error("illegal external caller")}function D(){return C||=new U(null,I)}function B(t){R(I);var e=t.T;return null==(e=null==e||M(e)?e:"string"==typeof e?L(e):null)?e:t.T=e}var U=class{constructor(t,e){if(R(e),this.T=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}qa(){const t=B(this);return t?new Uint8Array(t):P()}};function N(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function G(){return Error("Failed to read varint, encoding is invalid.")}function j(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function V(t){return 0==t.length?D():new U(t,I)}function z(t){if("string"==typeof t)return{buffer:L(t),H:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),H:!1};if(t.constructor===Uint8Array)return{buffer:t,H:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),H:!1};if(t.constructor===U)return{buffer:B(t)||P(),H:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),H:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function W(){return"function"==typeof BigInt}var X=!f;let H=!f;const Y="function"==typeof Uint8Array.prototype.slice;let K,$=0,q=0;function J(t){const e=0>t;let n=(t=Math.abs(t))>>>0;if(t=Math.floor((t-n)/4294967296),e){const[e,r]=st(n,t);t=r,n=e}$=n>>>0,q=t>>>0}function Z(t){const e=K||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),q=0,$=e.getUint32(0,!0)}function Q(t,e){return 4294967296*e+(t>>>0)}function tt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Q(t,e),n?-t:t}function et(t,e){if(t>>>=0,2097151>=(e>>>=0))var n=""+(4294967296*e+t);else W()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,1e7<=t&&(n+=Math.floor(t/1e7),t%=1e7),1e7<=n&&(e+=Math.floor(n/1e7),n%=1e7),n=e+nt(n)+nt(t));return n}function nt(t){return t=String(t),"0000000".slice(t.length)+t}function rt(){var t=$,e=q;if(2147483648&e)if(W())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=st(t,e);t="-"+et(n,r)}else t=et(t,e);return t}function it(t){if(16>t.length)J(Number(t));else if(W())t=BigInt(t),$=Number(t&BigInt(4294967295))>>>0,q=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);q=$=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const e=Number(t.slice(r,i));q*=1e6,$=1e6*$+e,4294967296<=$&&(q+=Math.trunc($/4294967296),q>>>=0,$>>>=0)}if(e){const[t,e]=st($,q);$=t,q=e}}}function st(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function ot(t,e,{W:n=!1}={}){t.W=n,e&&(e=z(e),t.h=e.buffer,t.u=e.H,t.v=0,t.l=t.h.length,t.g=t.v)}function at(t,e){if(t.g=e,e>t.l)throw j(t.l,e)}function ct(t,e){let n,r=0,i=0,s=0;const o=t.h;let a=t.g;do{n=o[a++],r|=(127&n)<<s,s+=7}while(32>s&&128&n);for(32<s&&(i|=(127&n)>>4),s=3;32>s&&128&n;s+=7)n=o[a++],i|=(127&n)<<s;if(at(t,a),128>n)return e(r>>>0,i>>>0);throw G()}function ht(t){let e=0,n=t.g;const r=n+10,i=t.h;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return at(t,n),!!(127&e)}throw G()}function ut(t){var e=t.h;const n=t.g,r=e[n],i=e[n+1],s=e[n+2];return e=e[n+3],at(t,t.g+4),(r<<0|i<<8|s<<16|e<<24)>>>0}function lt(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.l)throw j(e,t.l-n);return t.g=r,n}function ft(t,e){if(0==e)return D();var n=lt(t,e);return t.W&&t.u?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?P():Y?t.slice(n,e):new Uint8Array(t.subarray(n,e))),V(n)}var dt=class{constructor(t,e){this.h=null,this.u=!1,this.g=this.l=this.v=0,ot(this,t,e)}clear(){this.h=null,this.u=!1,this.g=this.l=this.v=0,this.W=!1}m(){const t=this.h;let e=this.g,n=t[e++],r=127&n;if(128&n&&(n=t[e++],r|=(127&n)<<7,128&n&&(n=t[e++],r|=(127&n)<<14,128&n&&(n=t[e++],r|=(127&n)<<21,128&n&&(n=t[e++],r|=n<<28,128&n&&128&t[e++]&&128&t[e++]&&128&t[e++]&&128&t[e++]&&128&t[e++])))))throw G();return at(this,e),r}j(){return this.m()>>>0}B(){var t=ut(this);const e=2*(t>>31)+1,n=t>>>23&255;return t&=8388607,255==n?t?NaN:1/0*e:0==n?e*Math.pow(2,-149)*t:e*Math.pow(2,n-150)*(t+Math.pow(2,23))}C(){return this.m()}},pt=[];function gt(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var n=t.g.j();if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw N(n,t.l);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=n,!0}function mt(t){switch(t.h){case 0:0!=t.h?mt(t):ht(t.g);break;case 1:at(t=t.g,t.g+8);break;case 2:if(2!=t.h)mt(t);else{var e=t.g.j();at(t=t.g,t.g+e)}break;case 5:at(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!gt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.m!=e)throw Error("Unmatched end-group tag");break}mt(t)}break;default:throw N(t.h,t.l)}}function yt(t,e,n){const r=t.g.l,i=t.g.j(),s=t.g.g+i;let o=s-r;if(0>=o&&(t.g.l=s,n(e,t,void 0,void 0,void 0),o=s-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=s,t.g.l=r,e}function vt(t){var e=t.g.j(),a=lt(t=t.g,e);if(t=t.h,o){var c,h=t;(c=s)||(c=s=new TextDecoder("utf-8",{fatal:!0})),t=a+e,h=0===a&&t===h.length?h:h.subarray(a,t);try{var u=c.decode(h)}catch(t){if(void 0===i){try{c.decode(new Uint8Array([128]))}catch(t){}try{c.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(s=void 0),t}}else{e=(u=a)+e,a=[];let i,s=null;for(;u<e;){var l=t[u++];128>l?a.push(l):224>l?u>=e?n():(i=t[u++],194>l||128!=(192&i)?(u--,n()):a.push((31&l)<<6|63&i)):240>l?u>=e-1?n():(i=t[u++],128!=(192&i)||224===l&&160>i||237===l&&160<=i||128!=(192&(h=t[u++]))?(u--,n()):a.push((15&l)<<12|(63&i)<<6|63&h)):244>=l?u>=e-2?n():(i=t[u++],128!=(192&i)||0!=i-144+(l<<28)>>30||128!=(192&(h=t[u++]))||128!=(192&(c=t[u++]))?(u--,n()):(l=(7&l)<<18|(63&i)<<12|(63&h)<<6|63&c,l-=65536,a.push(55296+(l>>10&1023),56320+(1023&l)))):n(),8192<=a.length&&(s=r(s,a),a.length=0)}u=r(s,a)}return u}function _t(t){const e=t.g.j();return ft(t.g,e)}function wt(t,e,n){var r=t.g.j();for(r=t.g.g+r;t.g.g<r;)n.push(e.call(t.g))}var bt=[];function Et(t){return t?/^\d+$/.test(t)?(it(t),new At($,q)):null:Tt||=new At(0,0)}var At=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Tt;function kt(t){return t?/^-?\d+$/.test(t)?(it(t),new xt($,q)):null:St||=new xt(0,0)}var xt=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let St;function Ft(t,e,n){for(;0<n||127<e;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Lt(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Mt(t,e){if(0<=e)Lt(t,e);else{for(let n=0;9>n;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Ot(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Pt(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function It(t,e,n){Lt(t.g,8*e+n)}function Ct(t,e){return It(t,e,2),e=t.g.end(),Pt(t,e),e.push(t.h),e}function Rt(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;127<n;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function Dt(t,e,n){It(t,e,2),Lt(t.g,n.length),Pt(t,t.g.end()),Pt(t,n)}function Bt(t,e,n,r){null!=n&&(e=Ct(t,e),r(n,t),Rt(t,e))}class Ut{constructor(t,e,n,r){this.g=t,this.h=e,this.l=n,this.la=r}}function Nt(t){return Array.prototype.slice.call(t)}const Gt="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;var jt=Gt?(t,e)=>{t[Gt]|=e}:(t,e)=>{void 0!==t.D?t.D|=e:Object.defineProperties(t,{D:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Vt(t){const e=Xt(t);1!=(1&e)&&(Object.isFrozen(t)&&(t=Nt(t)),Yt(t,1|e))}var zt=Gt?(t,e)=>{t[Gt]&=~e}:(t,e)=>{void 0!==t.D&&(t.D&=~e)};function Wt(t,e,n){return n?t|e:t&~e}var Xt=Gt?t=>0|t[Gt]:t=>0|t.D,Ht=Gt?t=>t[Gt]:t=>t.D,Yt=Gt?(t,e)=>{t[Gt]=e}:(t,e)=>{void 0!==t.D?t.D=e:Object.defineProperties(t,{D:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Kt(){var t=[];return jt(t,1),t}function $t(t){return jt(t,34),t}function qt(t,e){Yt(e,-14591&(0|t))}function Jt(t,e){Yt(e,-14557&(34|t))}function Zt(t){return 0===(t=t>>14&1023)?536870912:t}var Qt={},te={};function ee(t){return!(!t||"object"!=typeof t||t.Ia!==te)}function ne(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}let re=!f;function ie(t,e,n){if(null!=t)if("string"==typeof t)t=t?new U(t,I):D();else if(t.constructor!==U)if(M(t))t=n?V(t):t.length?new U(new Uint8Array(t),I):D();else{if(!e)throw Error();t=void 0}return t}function se(t,e,n){if(!Array.isArray(t)||t.length)return!1;const r=Xt(t);return!!(1&r)||!(!e||!(Array.isArray(e)?e.includes(n):e.has(n)))&&(Yt(t,1|r),!0)}var oe;const ae=[];function ce(t){if(2&t)throw Error()}Yt(ae,55),oe=Object.freeze(ae);class he{constructor(t,e,n){this.l=0,this.g=t,this.h=e,this.m=n}next(){if(this.l<this.g.length){const t=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,t):t}}return{done:!0,value:void 0}}[Symbol.iterator](){return new he(this.g,this.h,this.m)}}var ue={};let le,fe;function de(t,e){(e=le?e[le]:void 0)&&(t[le]=Nt(e))}function pe(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function ge(t){return pe(t=Error(t),"warning"),t}function me(t){return null==t?t:"number"==typeof t||"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function ye(t){return null==t?t:"boolean"==typeof t||"number"==typeof t?!!t:void 0}const ve=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function _e(t){const e=typeof t;return"number"===e?Number.isFinite(t):"string"===e&&ve.test(t)}function we(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t?t:void 0}function be(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t?t:void 0}function Ee(t){return Math.trunc(t)}function Ae(t,e){var n=Math.trunc(Number(t));return Number.isSafeInteger(n)?String(n):(-1!==(n=t.indexOf("."))&&(t=t.substring(0,n)),e&&(it(t),t=rt()),t)}function Te(t){return null==t?t:_e(t)?"number"==typeof t?Ee(t):Ae(t,!1):void 0}function ke(t){if("string"!=typeof t)throw Error();return t}function xe(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Se(t){return null==t||"string"==typeof t?t:void 0}function Fe(t,e,n,r){if(null!=t&&"object"==typeof t&&t.P===Qt)return t;if(!Array.isArray(t))return n?2&r?(t=e[Le])?e=t:($t((t=new e).s),e=e[Le]=t):e=new e:e=void 0,e;let i=n=Xt(t);return 0===i&&(i|=32&r),i|=2&r,i!==n&&Yt(t,i),new e(t)}const Le="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():"di";function Me(t){return t}function Oe(t,e,n){if(e){var r=!!r;if(!_e(e=t))throw ge("int64");"string"==typeof e?r=Ae(e,r):r?(e=Math.trunc(e),!r||Number.isSafeInteger(e)?r=String(e):(J(e),r=rt())):r=Ee(e)}else r=Te(t);return"string"==typeof(n=null==(t=r)?n?0:void 0:t)&&(r=+n,Number.isSafeInteger(r))?r:n}let Pe,Ie,Ce;function Re(t){switch(typeof t){case"boolean":return Ie||=[0,void 0,!0];case"number":return 0<t?void 0:0===t?Ce||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function De(t,e){return Be(t,e[0],e[1])}function Be(t,e,n){if(null==t&&(t=Pe),Pe=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-16760833&r|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error();if(64&(r=Xt(t)))return fe&&delete t[fe],t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error();t:{if(n=r,r=t.length){const i=r-1;if(ne(t[i])){if(1024<=(e=i-(+!!(512&(n|=256))-1)))throw Error();r=-16760833&n|(1023&e)<<14;break t}}if(e){if(1024<(e=Math.max(e,r-(+!!(512&n)-1))))throw Error();r=-16760833&n|(1023&e)<<14}else r=n}}return Yt(t,r),t}let Ue=function(){try{return new class extends Map{constructor(){super()}},!1}catch{return!0}}();class Ne{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,e){return this.g.set(t,e),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,e){return this.g.forEach(t,e)}[Symbol.iterator](){return this.entries()}}const Ge=Ue?(Object.setPrototypeOf(Ne.prototype,Map.prototype),Object.defineProperties(Ne.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Ne):class extends Map{constructor(){super()}};function je(t){if(2&t.I)throw Error("Cannot mutate an immutable Map")}var Ve=class extends Ge{constructor(t,e,n=Me,r=Me){super();let i=Xt(t);i|=64,Yt(t,i),this.I=i,this.O=e,this.J=n||Me,this.S=this.O?ze:r||Me;for(let s=0;s<t.length;s++){const o=t[s],a=n(o[0],!1,!0);let c=o[1];e?void 0===c&&(c=null):c=r(o[1],!1,!0,void 0,void 0,i),super.set(a,c)}}ka(t=We){return this.R(t)}R(t=We){const e=[],n=super.entries();for(var r;!(r=n.next()).done;)(r=r.value)[0]=t(r[0]),r[1]=t(r[1]),e.push(r);return e}clear(){je(this),super.clear()}delete(t){return je(this),super.delete(this.J(t,!0,!1))}entries(){var t=this.ha();return new he(t,Xe,this)}keys(){return this.Ha()}values(){var t=this.ha();return new he(t,Ve.prototype.get,this)}forEach(t,e){super.forEach(((n,r)=>{t.call(e,this.get(r),r,this)}))}set(t,e){return je(this),null==(t=this.J(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.S(e,!0,!0,this.O,!1,this.I))}Oa(t){const e=this.J(t[0],!1,!0);t=t[1],t=this.O?void 0===t?null:t:this.S(t,!1,!0,void 0,!1,this.I),super.set(e,t)}has(t){return super.has(this.J(t,!1,!1))}get(t){t=this.J(t,!1,!1);const e=super.get(t);if(void 0!==e){var n=this.O;return n?((n=this.S(e,!1,!0,n,this.ra,this.I))!==e&&super.set(t,n),n):e}}ha(){return Array.from(super.keys())}Ha(){return super.keys()}[Symbol.iterator](){return this.entries()}};function ze(t,e,n,r,i,s){return t=Fe(t,r,n,s),i&&(t=Qe(t)),t}function We(t){return t}function Xe(t){return[t,this.get(t)]}function He(t,e,n,r,i,s){if(null!=t){if(Array.isArray(t))t=i&&0==t.length&&1&Xt(t)?void 0:s&&2&Xt(t)?t:Ye(t,e,n,void 0!==r,i,s);else if(ne(t)){const o={};for(let a in t)o[a]=He(t[a],e,n,r,i,s);t=o}else t=e(t,r);return t}}function Ye(t,e,n,r,i,s){const o=r||n?Xt(t):0;r=r?!!(32&o):void 0;const a=Nt(t);for(let t=0;t<a.length;t++)a[t]=He(a[t],e,n,r,i,s);return n&&(de(a,t),n(o,a)),a}function Ke(t){return He(t,$e,void 0,void 0,!1,!1)}function $e(t){return t.P===Qt?t.toJSON():t instanceof Ve?t.ka(Ke):function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t){if(Array.isArray(t))return re||!se(t,void 0,9999)?t:void 0;if(M(t))return k(t);if(t instanceof U){const e=t.T;return null==e?"":"string"==typeof e?e:t.T=k(e)}if(t instanceof Ve)return t=t.ka(),X||0!==t.length?t:void 0}}return t}(t)}function qe(t,e,n=Jt){if(null!=t){if(A&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=Xt(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(Yt(t,-12293&(34|r)),t):Ye(t,qe,4&r?Jt:n,!0,!1,!0))}return t.P===Qt?(n=t.s,t=2&(r=Ht(n))?t:Je(t,n,r,!0)):t instanceof Ve&&(n=$t(t.R(qe)),t=new Ve(n,t.O,t.J,t.S)),t}}function Je(t,e,n,r){return t=t.constructor,Pe=e=Ze(e,n,r),e=new t(e),Pe=void 0,e}function Ze(t,e,n){const r=n||2&e?Jt:qt,i=!!(32&e);return t=function(t,e,n){const r=Nt(t);var i=r.length;const s=256&e?r[i-1]:void 0;for(i+=s?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(s){e=r[e]={};for(const t in s)e[t]=n(s[t])}return de(r,t),r}(t,e,(t=>qe(t,i,r))),jt(t,32|(n?2:0)),t}function Qe(t){const e=t.s,n=Ht(e);return 2&n?Je(t,e,n,!1):t}function tn(t,e){return en(t=t.s,Ht(t),e)}function en(t,e,n,r){if(-1===n)return null;if(n>=Zt(e)){if(256&e)return t[t.length-1][n]}else{var i=t.length;if(r&&256&e&&null!=(r=t[i-1][n]))return r;if((e=n+(+!!(512&e)-1))<i)return t[e]}}function nn(t,e,n,r){const i=t.s;let s=Ht(i);return ce(s),rn(i,s,e,n,r),t}function rn(t,e,n,r,i){var s=Zt(e);if(n>=s||i){if(i=e,256&e)s=t[t.length-1];else{if(null==r)return i;s=t[s+(+!!(512&e)-1)]={},i|=256}return s[n]=r,i!==e&&Yt(t,i),i}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function sn(t,e,n,r,i){var s=2&e;let o=en(t,e,n,i);Array.isArray(o)||(o=oe);const a=!(2&r);r=!(1&r);const c=!!(32&e);let h=Xt(o);return 0!==h||!c||s||a?1&h||(h|=1,Yt(o,h)):(h|=33,Yt(o,h)),s?(t=!1,2&h||($t(o),t=!!(4&h)),(r||t)&&Object.freeze(o)):(s=!!(2&h)||!!(2048&h),r&&s?(o=Nt(o),r=1,c&&!a&&(r|=32),Yt(o,r),rn(t,e,n,o,i)):a&&32&h&&!s&&zt(o,32)),o}function on(t,e){t=t.s;let n=Ht(t);const r=en(t,n,e),i=me(r);return null!=i&&i!==r&&rn(t,n,e,i),i}function an(t){t=t.s;let e=Ht(t);const n=en(t,e,1),r=ie(n,!0,!!(34&e));return null!=r&&r!==n&&rn(t,e,1,r),r}function cn(t,e,n){var r=2;t=t.s;let i=Ht(t);2&i&&(r=1);let s=sn(t,i,e,1);i=Ht(t);var o=Xt(s);let a=o,c=!!(2&o);const h=c&&!!(4&o);if(!(4&o)){Object.isFrozen(s)&&(s=Nt(s),a=0,c=!!(2&(o=Tn(o,i,!1))),i=rn(t,i,e,s)),o=Wt(o,4,!1),o=Wt(o,4096,!1),o=Wt(o,8192,!1);let r=0,h=0;for(;r<s.length;r++){const t=n(s[r]);null!=t&&(s[h++]=t)}h<r&&(s.length=h),o=Wt(o,20,!0)}return h||((n=1===r)&&(o=Wt(o,2,!0)),o!==a&&Yt(s,o),(n||c)&&Object.freeze(s)),2===r&&c&&(s=Nt(s),o=Tn(o,i,!1),Yt(s,o),rn(t,i,e,s)),s}let hn;function un(){return hn??=new Ve($t([]),void 0,void 0,void 0,ue)}function ln(t){t=Nt(t);for(let e=0;e<t.length;e++){const n=t[e]=Nt(t[e]);Array.isArray(n[1])&&(n[1]=$t(n[1]))}return t}function fn(t,e,n){{const o=t.s;let a=Ht(o);if(ce(a),null==n)rn(o,a,e);else{var r=t=Xt(n),i=!!(2&t)||Object.isFrozen(n),s=!i&&!1;if(!(4&t)){t=21,i&&(n=Nt(n),r=0,t=Tn(t,a,!0)),i=!!(4&t)&&!!(4096&t);for(let t=0;t<n.length;t++)n[t]=ke(n[t])}s&&(t=Wt(t,2,!0)),t!==r&&Yt(n,t),s&&Object.freeze(n),rn(o,a,e,n)}}}function dn(t,e,n,r){const i=Ht(t);ce(i),t=sn(t,i,e,2),r=n(r,!!(4&(e=Xt(t)))&&!!(4096&e)),t.push(r)}function pn(t){return t}function gn(t,e){return mn(t=t.s,Ht(t),os)===e?e:-1}function mn(t,e,n){let r=0;for(let i=0;i<n.length;i++){const s=n[i];null!=en(t,e,s)&&(0!==r&&(e=rn(t,e,r)),r=s)}return r}function yn(t,e,n,r){let i=Ht(t);ce(i);const s=en(t,i,n,r);let o;if(null!=s&&s.P===Qt)return(e=Qe(s))!==s&&rn(t,i,n,e,r),e.s;if(Array.isArray(s)){const t=Xt(s);o=2&t?Ze(s,t,!1):s,o=De(o,e)}else o=De(void 0,e);return o!==s&&rn(t,i,n,o,r),o}function vn(t,e,n,r){t=t.s;let i=Ht(t);const s=en(t,i,n,r);return(e=Fe(s,e,!1,i))!==s&&null!=e&&rn(t,i,n,e,r),e}function _n(t,e,n,r=!1){if(null==(e=vn(t,e,n,r)))return e;t=t.s;let i=Ht(t);if(!(2&i)){const s=Qe(e);s!==e&&rn(t,i,n,e=s,r)}return e}function wn(t,e,n,r,i,s,o){const a=1===i;i=2===i,s=!!s;var c=!!(2&e)&&i;let h=sn(t,e,r,3);e=Ht(t);var u=Xt(h),l=!!(2&u);const f=!!(4&u),d=!!(32&u);let p=l&&f||!!(2048&u);if(!f){var g=h,m=e;const t=!!(2&u);t&&(m=Wt(m,2,!0));let r=!t,i=!0,s=0,o=0;for(;s<g.length;s++){const e=Fe(g[s],n,!1,m);if(e instanceof n){if(!t){const t=!!(2&Xt(e.s));r&&=!t,i&&=t}g[o++]=e}}o<s&&(g.length=o),u=Wt(u,4,!0),u=Wt(u,16,i),u=Wt(u,8,r),Yt(g,u),l&&!c&&(Object.freeze(h),p=!0)}if(n=u,c=!!(8&u)||a&&!h.length,o&&!c){for(p&&(h=Nt(h),p=!1,n=0,u=Tn(u,e,s),e=rn(t,e,r,h)),o=h,c=u,l=0;l<o.length;l++)(g=o[l])!==(u=Qe(g))&&(o[l]=u);c=Wt(c,8,!0),u=c=Wt(c,16,!o.length)}return p||(a?u=Wt(u,!h.length||16&u&&(!f||d)?2:2048,!0):s||(u=Wt(u,32,!1)),u!==n&&Yt(h,u),a&&(Object.freeze(h),p=!0)),i&&p&&(h=Nt(h),u=Tn(u,e,s),Yt(h,u),rn(t,e,r,h)),h}function bn(t,e,n){t=t.s;const r=Ht(t),i=!!(2&r);return wn(t,r,e,n,i?1:2,!1,!i)}function En(t,e,n,r,i){return null==r&&(r=void 0),nn(t,n,r,i)}function An(t,e,n,r){null==r&&(r=void 0),t=t.s;let i=Ht(t);ce(i),(n=mn(t,i,n))&&n!==e&&null!=r&&(i=rn(t,i,n)),rn(t,i,e,r)}function Tn(t,e,n){return t=Wt(t,2,!!(2&e)),t=Wt(t,32,!!(32&e)&&n),Wt(t,2048,!1)}function kn(t,e,n){t=t.s;const r=Ht(t);ce(r),t=wn(t,r,e,1,2),e=null!=n?n:new e,t.push(e),2&Xt(e.s)?zt(t,8):zt(t,16)}function xn(t,e){return we(tn(t,e))}function Sn(t,e){return Se(tn(t,e))}function Fn(t){return t??0}function Ln(t,e){return Fn(on(t,e))}function Mn(t,e,n){if(null!=n){if("boolean"!=typeof n)throw t=typeof n,Error(`Expected boolean but got ${"object"!=t?t:n?Array.isArray(n)?"array":t:"null"}: ${n}`);n=!!n}nn(t,e,n)}function On(e,n,r){if(null!=r){if("number"!=typeof r)throw ge("int32");if(!Number.isFinite(r)){const e=Error();pe(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}}nn(e,n,r)}function Pn(t,e,n){if(null!=n&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);nn(t,e,n)}function In(t,e,n){e.g?e.m(t,e.g,e.h,n,!0):e.m(t,e.h,n,!0)}Ve.prototype.toJSON=void 0,Ve.prototype.Ia=te,Object.freeze({});var Cn=class{constructor(t,e){this.s=Be(t,e)}toJSON(){return Rn(this,Ye(this.s,$e,void 0,void 0,!1,!1),!0)}l(){var t=no;return t.g?t.l(this,t.g,t.h,!0,2):t.l(this,t.h,t.defaultValue,!0)}clone(){const t=this.s;return Je(this,t,Ht(t),!1)}H(){return!!(2&Xt(this.s))}};function Rn(t,e,n){const r=t.constructor.A;var i=Ht(n?t.s:e),s=Zt(i),o=!1;if(r&&re){if(!n){var a;if((e=Nt(e)).length&&ne(a=e[e.length-1]))for(o=0;o<r.length;o++)if(r[o]>=s){Object.assign(e[e.length-1]={},a);break}o=!0}var c;s=e,n=!n,t=Zt(a=Ht(t.s)),a=+!!(512&a)-1;for(let e=0;e<r.length;e++){var h=r[e];if(h<t){var u=s[h+=a];null==u?s[h]=n?oe:Kt():n&&u!==oe&&Vt(u)}else{if(!c){var l=void 0;s.length&&ne(l=s[s.length-1])?c=l:s.push(c={})}u=c[h],null==c[h]?c[h]=n?oe:Kt():n&&u!==oe&&Vt(u)}}}if(!(c=e.length))return e;let f,d;if(ne(l=e[c-1])){t:{var p=l;for(var g in s={},n=!1,p)t=p[g],Array.isArray(t)&&(a=t,(!H&&se(t,r,+g)||!X&&ee(t)&&0===t.size)&&(t=null),t!=a&&(n=!0)),null!=t?s[g]=t:n=!0;if(n){for(let t in s){p=s;break t}p=null}}p!=l&&(f=!0),c--}for(i=+!!(512&i)-1;0<c&&(null==(l=e[g=c-1])||!H&&se(l,r,g-i)||!X&&ee(l)&&0===l.size);c--)d=!0;return f||d?(e=o?e:Array.prototype.slice.call(e,0,c),o&&(e.length=c),p&&e.push(p),e):e}function Dn(t){return Array.isArray(t)?t[0]instanceof Ut?t:[Rr,t]:[t,void 0]}function Bn(t,e){if(Array.isArray(e)){var n=Xt(e);if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),Yt(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}Cn.prototype.P=Qt,Cn.prototype.toString=function(){return Rn(this,this.s,!1).toString()};const Un=Symbol();function Nn(t){let e=t[Un];if(!e){const n=Hn(t),r=ir(t),i=r.g;e=i?(t,e)=>i(t,e,r):(t,e)=>{for(;gt(e)&&4!=e.h;){var i=e.m,s=r[i];if(!s){var o=r.fa;o&&(o=o[i])&&(s=r[i]=Gn(o))}s&&s(e,t,i)||(i=(s=e).l,mt(s),s.ea?s=void 0:(o=s.g.g-i,s.g.g=i,s=ft(s.g,o)),i=t,s&&(le||=Symbol(),(o=i[le])?o.push(s):i[le]=[s]))}n===jn||n===Vn||n.Ja||(t[fe||=Symbol()]=n)},t[Un]=e}return e}function Gn(t){const e=(t=Dn(t))[0].g;if(t=t[1]){const n=Nn(t),r=ir(t).K;return(t,i,s)=>e(t,i,s,r,n)}return e}let jn,Vn;const zn=Symbol();function Wn(t,e,n){const r=n[1];let i;if(r){const n=r[zn];i=n?n.K:Re(r[0]),t[e]=n??r}i&&i===Ie?(t.ia||(t.ia=[])).push(e):n[0]&&(t.ja||(t.ja=[])).push(e)}function Xn(t,e){return[t.l,!e||0<e[0]?void 0:e]}function Hn(t){var e=t[zn];if(e)return e;if(!(e=Kn(t,t[zn]={},Xn,Xn,Wn)).ja&&!e.ia){let n=!0;for(let t in e){isNaN(t)||(n=!1);break}n?(e=Re(t[0])===Ie,e=t[zn]=e?Vn||={K:Re(!0)}:jn||={}):e.Ja=!0}return e}function Yn(t,e,n){t[e]=n}function Kn(t,e,n,r,i=Yn){e.K=Re(t[0]);let s=0;var o=t[++s];o&&o.constructor===Object&&(e.fa=o,"function"==typeof(o=t[++s])&&(e.g=o,e.h=t[++s],o=t[++s]));const a={};for(;Array.isArray(o)&&"number"==typeof o[0]&&0<o[0];){for(var c=0;c<o.length;c++)a[o[c]]=o;o=t[++s]}for(c=1;void 0!==o;){let l;"number"==typeof o&&(c+=o,o=t[++s]);var h=void 0;if(o instanceof Ut?l=o:(l=Dr,s--),l.la){o=t[++s],h=t;var u=s;"function"==typeof o&&(o=o(),h[u]=o),h=o}for(u=c+1,"number"==typeof(o=t[++s])&&0>o&&(u-=o,o=t[++s]);c<u;c++){const t=a[c];i(e,c,h?r(l,h,t):n(l,t))}}return e}const $n=Symbol();function qn(t){let e=t[$n];if(!e){const n=tr(t);e=(t,e)=>or(t,e,n),t[$n]=e}return e}const Jn=Symbol();function Zn(t){return t.h}function Qn(t,e){let n,r;const i=t.h;return(t,s,o)=>i(t,s,o,r||=tr(e).K,n||=qn(e))}function tr(t){let e=t[Jn];return e||(e=Kn(t,t[Jn]={},Zn,Qn),er in t&&Jn in t&&(t.length=0),e)}const er=Symbol();function nr(t,e){const n=t.g;return e?(t,r,i)=>n(t,r,i,e):n}function rr(t,e,n){const r=t.g;let i,s;return(t,o,a)=>r(t,o,a,s||=ir(e).K,i||=Nn(e),n)}function ir(t){let e=t[er];return e||(Hn(t),e=Kn(t,t[er]={},nr,rr),er in t&&Jn in t&&(t.length=0),e)}function sr(t,e){var n=t[e];if(n)return n;if((n=t.fa)&&(n=n[e])){var r=(n=Dn(n))[0].h;if(n=n[1]){const e=qn(n),i=tr(n).K;n=(n=t.h)?n(i,e):(t,n,s)=>r(t,n,s,i,e)}else n=r;return t[e]=n}}function or(t,e,n){for(var r=Ht(t),i=+!!(512&r)-1,s=t.length,o=512&r?1:0,a=s+(256&r?-1:0);o<a;o++){const r=t[o];if(null==r)continue;const s=o-i,a=sr(n,s);a&&a(e,r,s)}if(256&r){r=t[s-1];for(let t in r)i=+t,Number.isNaN(i)||null!=(s=r[t])&&(a=sr(n,i))&&a(e,s,i)}if(t=le?t[le]:void 0)for(Pt(e,e.g.end()),n=0;n<t.length;n++)Pt(e,B(t[n])||P())}function ar(t,e){return new Ut(t,e,!1,!1)}function cr(t,e){return new Ut(t,e,!0,!1)}function hr(t,e){return new Ut(t,e,!1,!0)}function ur(t,e,n){rn(t,Ht(t),e,n)}var lr=hr((function(t,e,n,r,i){return 2===t.h&&(t=yt(t,De([void 0,void 0],r),i),ce(r=Ht(e)),(i=en(e,r,n))instanceof Ve?0!=(2&i.I)?((i=i.R()).push(t),rn(e,r,n,i)):i.Oa(t):Array.isArray(i)?(2&Xt(i)&&rn(e,r,n,i=ln(i)),i.push(t)):rn(e,r,n,[t]),!0)}),(function(t,e,n,r,i){if(e instanceof Ve)e.forEach(((e,s)=>{Bt(t,n,De([s,e],r),i)}));else if(Array.isArray(e))for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&Bt(t,n,De(o,r),i)}}));function fr(t,e,n){t:if(null!=e){if(_e(e)){if("string"==typeof e){e=Ae(e,!1);break t}if("number"==typeof e){e=Ee(e);break t}}e=void 0}null!=e&&("string"==typeof e&&kt(e),null!=e&&(It(t,n,0),"number"==typeof e?(t=t.g,J(e),Ft(t,$,q)):(n=kt(e),Ft(t.g,n.h,n.g))))}function dr(t,e,n){null!=(e=we(e))&&null!=e&&(It(t,n,0),Mt(t.g,e))}function pr(t,e,n){null!=(e=ye(e))&&(It(t,n,0),t.g.g.push(e?1:0))}function gr(t,e,n){null!=(e=Se(e))&&Dt(t,n,h(e))}function mr(t,e,n,r,i){Bt(t,n,e instanceof Cn?e.s:Array.isArray(e)?De(e,r):void 0,i)}function yr(t,e,n){null!=(e=null==e||"string"==typeof e||M(e)||e instanceof U?e:void 0)&&Dt(t,n,z(e).buffer)}function vr(t,e,n){return(5===t.h||2===t.h)&&(e=sn(e,Ht(e),n,2,!1),2==t.h?wt(t,dt.prototype.B,e):e.push(t.g.B()),!0)}var _r,wr=ar((function(t,e,n){if(1!==t.h)return!1;var r=t.g;t=ut(r);const i=ut(r);r=2*(i>>31)+1;const s=i>>>20&2047;return t=4294967296*(1048575&i)+t,ur(e,n,2047==s?t?NaN:1/0*r:0==s?r*Math.pow(2,-1074)*t:r*Math.pow(2,s-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=me(e))&&(It(t,n,1),t=t.g,(n=K||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),$=n.getUint32(0,!0),q=n.getUint32(4,!0),Ot(t,$),Ot(t,q))})),br=ar((function(t,e,n){return 5===t.h&&(ur(e,n,t.g.B()),!0)}),(function(t,e,n){null!=(e=me(e))&&(It(t,n,5),t=t.g,Z(e),Ot(t,$))})),Er=cr(vr,(function(t,e,n){if(null!=(e=Bn(me,e)))for(let s=0;s<e.length;s++){var r=t,i=e[s];null!=i&&(It(r,n,5),r=r.g,Z(i),Ot(r,$))}})),Ar=cr(vr,(function(t,e,n){if(null!=(e=Bn(me,e))&&e.length){It(t,n,2),Lt(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Z(e[r]),Ot(n,$)}})),Tr=ar((function(t,e,n){return 0===t.h&&(ur(e,n,ct(t.g,tt)),!0)}),fr),kr=ar((function(t,e,n){return 0===t.h&&(ur(e,n,0===(t=ct(t.g,tt))?void 0:t),!0)}),fr),xr=ar((function(t,e,n){return 0===t.h&&(ur(e,n,ct(t.g,Q)),!0)}),(function(t,e,n){t:if(null!=e){if(_e(e)){if("string"==typeof e){var r=Math.trunc(Number(e));Number.isSafeInteger(r)?e=String(r):(-1!==(r=e.indexOf("."))&&(e=e.substring(0,r)),it(e),e=et($,q));break t}if("number"==typeof e){e=Math.trunc(e);break t}}e=void 0}null!=e&&("string"==typeof e&&Et(e),null!=e&&(It(t,n,0),"number"==typeof e?(t=t.g,J(e),Ft(t,$,q)):(n=Et(e),Ft(t.g,n.h,n.g))))})),Sr=ar((function(t,e,n){return 0===t.h&&(ur(e,n,t.g.m()),!0)}),dr),Fr=cr((function(t,e,n){return(0===t.h||2===t.h)&&(e=sn(e,Ht(e),n,2,!1),2==t.h?wt(t,dt.prototype.m,e):e.push(t.g.m()),!0)}),(function(t,e,n){if(null!=(e=Bn(we,e))&&e.length){n=Ct(t,n);for(let n=0;n<e.length;n++)Mt(t.g,e[n]);Rt(t,n)}})),Lr=ar((function(t,e,n){return 0===t.h&&(ur(e,n,0===(t=t.g.m())?void 0:t),!0)}),dr),Mr=ar((function(t,e,n){return 0===t.h&&(ur(e,n,ht(t.g)),!0)}),pr),Or=ar((function(t,e,n){return 0===t.h&&(ur(e,n,!1===(t=ht(t.g))?void 0:t),!0)}),pr),Pr=cr((function(t,e,n){return 2===t.h&&(dn(e,n,pn,t=vt(t)),!0)}),(function(t,e,n){if(null!=(e=Bn(Se,e)))for(let i=0;i<e.length;i++){var r=e[i];null!=r&&Dt(t,n,h(r))}})),Ir=ar((function(t,e,n){return 2===t.h&&(ur(e,n,""===(t=vt(t))?void 0:t),!0)}),gr),Cr=ar((function(t,e,n){return 2===t.h&&(ur(e,n,vt(t)),!0)}),gr),Rr=hr((function(t,e,n,r,i){return 2===t.h&&(yt(t,yn(e,r,n,!0),i),!0)}),mr),Dr=hr((function(t,e,n,r,i){return 2===t.h&&(yt(t,yn(e,r,n),i),!0)}),mr);_r=new Ut((function(t,e,n,r,i){if(2!==t.h)return!1;r=De(void 0,r);let s=Ht(e);ce(s);let o=sn(e,s,n,3);return s=Ht(e),4&Xt(o)&&(o=Nt(o),Yt(o,-2079&(1|Xt(o))),rn(e,s,n,o)),o.push(r),yt(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let s=0;s<e.length;s++)mr(t,e[s],n,r,i)}),!0,!0);var Br=hr((function(t,e,n,r,i,s){if(2!==t.h)return!1;let o=Ht(e);return ce(o),(s=mn(e,o,s))&&n!==s&&rn(e,o,s),yt(t,e=yn(e,r,n),i),!0}),mr),Ur=ar((function(t,e,n){return 2===t.h&&(ur(e,n,_t(t)),!0)}),yr),Nr=cr((function(t,e,n){return(0===t.h||2===t.h)&&(e=sn(e,Ht(e),n,2,!1),2==t.h?wt(t,dt.prototype.j,e):e.push(t.g.j()),!0)}),(function(t,e,n){if(null!=(e=Bn(be,e)))for(let s=0;s<e.length;s++){var r=t,i=e[s];null!=i&&(It(r,n,0),Lt(r.g,i))}})),Gr=ar((function(t,e,n){return 0===t.h&&(ur(e,n,t.g.m()),!0)}),(function(t,e,n){null!=(e=we(e))&&(e=parseInt(e,10),It(t,n,0),Mt(t.g,e))})),jr=cr((function(t,e,n){return(0===t.h||2===t.h)&&(e=sn(e,Ht(e),n,2,!1),2==t.h?wt(t,dt.prototype.C,e):e.push(t.g.m()),!0)}),(function(t,e,n){if(null!=(e=Bn(we,e))&&e.length){n=Ct(t,n);for(let n=0;n<e.length;n++)Mt(t.g,e[n]);Rt(t,n)}}));class Vr{constructor(t,e){this.h=t,this.g=e,this.l=_n,this.m=En,this.defaultValue=void 0}}function zr(t,e){return new Vr(t,e)}function Wr(t,e){return(n,r)=>{t:{if(bt.length){const t=bt.pop();t.o(r),ot(t.g,n,r),n=t}else n=new class{constructor(t,e){if(pt.length){const n=pt.pop();ot(n,t,e),t=n}else t=new dt(t,e);this.g=t,this.l=this.g.g,this.h=this.m=-1,this.o(e)}o({ea:t=!1}={}){this.ea=t}}(n,r);try{const r=new t,s=r.s;Nn(e)(s,n),fe&&delete s[fe];var i=r;break t}finally{n.g.clear(),n.m=-1,n.h=-1,100>bt.length&&bt.push(n)}i=void 0}return i}}function Xr(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};or(this.s,e,tr(t)),Pt(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,i=r.length;let s=0;for(let t=0;t<i;t++){const e=r[t];n.set(e,s),s+=e.length}return e.l=[n],n}}var Hr=[0,Ir,ar((function(t,e,n){return 2===t.h&&(ur(e,n,(t=_t(t))===D()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof Cn){const r=e.Qa;return void(r&&(e=r(e),null!=e&&Dt(t,n,z(e).buffer)))}if(Array.isArray(e))return}yr(t,e,n)}))],Yr=[0,Cr],Kr=[0,Sr,Gr,Mr,-1,Fr,Gr,-1],$r=[0,Mr,-1],qr=class extends Cn{constructor(){super()}};qr.A=[6];var Jr=[0,Mr,Cr,Mr,Gr,-1,jr,Cr,-1,$r,Gr],Zr=[0,Cr,-2],Qr=class extends Cn{constructor(){super()}},ti=[0],ei=[0,Sr,Mr,-2],ni=class extends Cn{constructor(t){super(t,2)}},ri={},ii=[-2,ri,Mr];ri[336783863]=[0,Cr,Mr,-1,Sr,[0,[1,2,3,4,5],Br,ti,Br,Jr,Br,Zr,Br,ei,Br,Kr],Yr];var si=[0,Ir,Or],oi=[0,kr,-1,Or,-3,kr,Fr,Ir,Lr,kr,-1,Or,Lr,Or,-2,Ir],ai=[-1,{}],ci=[0,Cr,1,ai],hi=[0,Cr,Pr,ai];function ui(t,e){e=xe(e),t=t.s;let n=Ht(t);ce(n),rn(t,n,2,""===e?void 0:e)}function li(t,e){dn(t.s,3,ke,e)}function fi(t,e){dn(t.s,4,ke,e)}var di=class extends Cn{constructor(t){super(t,500)}o(t){return En(this,0,7,t)}};di.A=[3,4,5,6,8,13,17,1005];var pi=[-500,Ir,-1,Pr,-3,ii,_r,Hr,Lr,-1,ci,hi,_r,si,Ir,oi,Lr,Pr,987,Pr],gi=[0,Ir,-1,ai],mi=[-500,Cr,-1,[-1,{}],998,Cr],yi=[-500,Cr,Pr,-1,[-2,{},Mr],997,Pr,-1],vi=[-500,Cr,Pr,ai,998,Pr];function _i(t,e){kn(t,di,e)}function wi(t,e){dn(t.s,10,ke,e)}function bi(t,e){dn(t.s,15,ke,e)}var Ei=class extends Cn{constructor(t){super(t,500)}o(t){return En(this,0,1001,t)}};Ei.A=[1,6,7,9,10,15,16,17,14,1002];var Ai=[-500,_r,pi,4,_r,mi,_r,yi,Lr,_r,vi,Pr,Lr,ci,hi,_r,gi,Pr,-2,oi,Ir,-1,Or,979,ai,_r,Hr],Ti=Wr(Ei,Ai);Ei.prototype.g=Xr(Ai);var ki=[0,_r,[0,Sr,-2]],xi=class extends Cn{constructor(t){super(t)}},Si=[0,Sr,br,Cr,-1],Fi=class extends Cn{constructor(t){super(t)}g(){return bn(this,xi,1)}};Fi.A=[1];var Li=[0,_r,Si],Mi=Wr(Fi,Li),Oi=[0,Sr,br],Pi=[0,Sr,-1,ki],Ii=class extends Cn{constructor(t){super(t)}},Ci=[0,Sr,-3],Ri=[0,br,-3],Di=class extends Cn{constructor(t){super(t)}},Bi=[0,br,-1,Cr,br],Ui=class extends Cn{constructor(t){super(t)}h(){return _n(this,Ii,2)}g(){return bn(this,Di,5)}};Ui.A=[5];var Ni=[0,Gr,Ci,Ri,Pi,_r,Bi],Gi=class extends Cn{constructor(t){super(t)}};Gi.A=[1,2,3,8,9];var ji=Wr(Gi,[0,Pr,Fr,Ar,Ni,Cr,-1,Tr,_r,Oi,Pr,Tr]),Vi=class extends Cn{constructor(t){super(t)}},zi=[0,br,-4],Wi=class extends Cn{constructor(t){super(t)}};Wi.A=[1];var Xi=Wr(Wi,[0,_r,zi]),Hi=class extends Cn{constructor(t){super(t)}},Yi=[0,br,-4],Ki=class extends Cn{constructor(t){super(t)}};Ki.A=[1];var $i=Wr(Ki,[0,_r,Yi]),qi=class extends Cn{constructor(t){super(t)}};qi.A=[3];var Ji=[0,Sr,-1,Ar,Gr],Zi=class extends Cn{constructor(){super()}};Zi.prototype.g=Xr([0,br,-4,Tr]);var Qi=class extends Cn{constructor(t){super(t)}},ts=[0,1,Sr,Cr,Li],es=class extends Cn{constructor(t){super(t)}};es.A=[1];var ns=Wr(es,[0,_r,ts,Tr]),rs=class extends Cn{constructor(t){super(t)}};rs.A=[1];var is=class extends Cn{constructor(t){super(t)}oa(){const t=an(this);return null==t?D():t}},ss=class extends Cn{constructor(t){super(t)}},os=[1,2],as=[0,os,Br,[0,Ar],Br,[0,Ur],Sr,Cr],cs=class extends Cn{constructor(t){super(t)}};cs.A=[1];var hs=Wr(cs,[0,_r,as,Tr]),us=class extends Cn{constructor(t){super(t)}};us.A=[4,5];var ls=[0,Cr,Sr,br,Pr,-1],fs=class extends Cn{constructor(t){super(t)}},ds=[0,Mr,-1],ps=class extends Cn{constructor(t){super(t)}},gs=[1,2,3,4,5],ms=class extends Cn{constructor(t){super(t)}g(){return null!=an(this)}h(){return null!=Sn(this,2)}},ys=[0,Ur,Cr,[0,Sr,Tr,-1],[0,xr,Tr]],vs=class extends Cn{constructor(t){super(t)}g(){return ye(tn(this,2))??!1}},_s=[0,ys,Mr,[0,gs,Br,ei,Br,Jr,Br,Kr,Br,ti,Br,Zr],Gr],ws=class extends Cn{constructor(t){super(t)}},bs=[0,_s,br,-1,Sr],Es=zr(502141897,ws);ri[502141897]=bs;var As=[0,ys];ri[512499200]=As;var Ts=[0,As];ri[515723506]=Ts;var ks=Wr(class extends Cn{constructor(t){super(t)}},[0,[0,Gr,-1,Er,Nr],Ji]),xs=[0,_s];ri[508981768]=xs;var Ss=class extends Cn{constructor(t){super(t)}},Fs=[0,_s,br,xs,Mr],Ls=class extends Cn{constructor(t){super(t)}},Ms=[0,_s,bs,Fs,br,Ts];ri[508968149]=Fs;var Os=zr(508968150,Ls);ri[508968150]=Ms;var Ps=class extends Cn{constructor(t){super(t)}},Is=zr(513916220,Ps);ri[513916220]=[0,_s,Ms,Sr];var Cs=class extends Cn{constructor(t){super(t)}h(){return _n(this,us,2)}g(){nn(this,2)}},Rs=[0,_s,ls];ri[478825465]=Rs;var Ds=[0,_s];ri[478825422]=Ds;var Bs=class extends Cn{constructor(t){super(t)}},Us=[0,_s,Ds,Rs,-1],Ns=class extends Cn{constructor(t){super(t)}},Gs=[0,_s,br,Sr],js=class extends Cn{constructor(t){super(t)}},Vs=[0,_s,br],zs=class extends Cn{constructor(t){super(t)}},Ws=[0,_s,Gs,Vs,br],Xs=class extends Cn{constructor(t){super(t)}},Hs=[0,_s,Ws,Us];ri[463370452]=Us,ri[464864288]=Gs,ri[474472470]=Vs;var Ys=zr(462713202,zs);ri[462713202]=Ws;var Ks=zr(479097054,Xs);ri[479097054]=Hs;var $s=class extends Cn{constructor(t){super(t)}},qs=zr(456383383,$s);ri[456383383]=[0,_s,ls];var Js=class extends Cn{constructor(t){super(t)}},Zs=zr(476348187,Js);ri[476348187]=[0,_s,ds];var Qs=class extends Cn{constructor(t){super(t)}},to=[0,Gr,-1],eo=class extends Cn{constructor(t){super(t)}};eo.A=[3];var no=zr(458105876,class extends Cn{constructor(t){super(t)}g(){var t=this.s;const e=Ht(t);var n=2&e;return t=function(t,e,n){var r=eo;const i=2&e;let s=!1;if(null==n){if(i)return un();n=[]}else if(n.constructor===Ve){if(0==(2&n.I)||i)return n;n=n.R()}else Array.isArray(n)?s=!!(2&Xt(n)):n=[];if(i){if(!n.length)return un();s||(s=!0,$t(n))}else s&&(s=!1,n=ln(n));return s||(64&Xt(n)?zt(n,32):32&e&&jt(n,32)),rn(t,e,2,r=new Ve(n,r,Oe,void 0),!1),r}(t,e,en(t,e,2)),null==t||!n&&eo&&(t.ra=!0),n=t}});ri[458105876]=[0,to,lr,[!0,Tr,[0,Cr,-1,Pr]]];var ro=class extends Cn{constructor(t){super(t)}},io=zr(458105758,ro);ri[458105758]=[0,_s,Cr,to];var so=class extends Cn{constructor(t){super(t)}};so.A=[5,6];var oo=zr(443442058,so);ri[443442058]=[0,_s,Cr,Sr,br,Pr,-1];var ao=class extends Cn{constructor(t){super(t)}},co=[0,_s,br,-1,Sr];ri[514774813]=co;var ho=class extends Cn{constructor(t){super(t)}},uo=[0,_s,br,Mr],lo=class extends Cn{constructor(t){super(t)}},fo=[0,_s,co,uo,br];ri[518928384]=uo;var po=zr(516587230,lo);function go(t,e){return e=e?e.clone():new us,void 0!==t.displayNamesLocale?nn(e,1,xe(t.displayNamesLocale)):void 0===t.displayNamesLocale&&nn(e,1),void 0!==t.maxResults?On(e,2,t.maxResults):"maxResults"in t&&nn(e,2),void 0!==t.scoreThreshold?Pn(e,3,t.scoreThreshold):"scoreThreshold"in t&&nn(e,3),void 0!==t.categoryAllowlist?fn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&nn(e,4),void 0!==t.categoryDenylist?fn(e,5,t.categoryDenylist):"categoryDenylist"in t&&nn(e,5),e}function mo(t,e=-1,n=""){return{categories:t.map((t=>({index:Fn(xn(t,1))??-1,score:Ln(t,2)??0,categoryName:Sn(t,3)??""??"",displayName:Sn(t,4)??""??""}))),headIndex:e,headName:n}}function yo(t){var e=cn(t,3,me),n=cn(t,2,we);const r=cn(t,1,Se),i=cn(t,9,Se),s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:n[t]??-1,categoryName:r[t]??"",displayName:i[t]??""});if((e=_n(t,Ui,4)?.h())&&(s.boundingBox={originX:xn(e,1)??0,originY:xn(e,2)??0,width:xn(e,3)??0,height:xn(e,4)??0,angle:0}),_n(t,Ui,4)?.g().length)for(const e of _n(t,Ui,4).g())s.keypoints.push({x:on(e,1)??0,y:on(e,2)??0,score:on(e,4)??0,label:Sn(e,3)??""});return s}function vo(t){const e=[];for(const n of bn(t,Hi,1))e.push({x:Ln(n,1)??0,y:Ln(n,2)??0,z:Ln(n,3)??0});return e}function _o(t){const e=[];for(const n of bn(t,Vi,1))e.push({x:Ln(n,1)??0,y:Ln(n,2)??0,z:Ln(n,3)??0});return e}function wo(t){return Array.from(t,(t=>127<t?t-256:t))}function bo(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let s=0;s<t.length;s++)n+=t[s]*e[s],r+=t[s]*t[s],i+=e[s]*e[s];if(0>=r||0>=i)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let Eo;ri[516587230]=fo;const Ao=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 To(){if(void 0===Eo)try{await WebAssembly.instantiate(Ao),Eo=!0}catch{Eo=!1}return Eo}async function ko(t,e=""){const n=await To()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var xo=class{};function So(){const t=navigator.userAgent;return t.includes("Safari")&&!t.includes("Chrome")}async function Fo(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}function Lo(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Mo(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");return t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),e.videoWidth?(n=e.videoWidth,e=e.videoHeight):e.naturalWidth?(n=e.naturalWidth,e=e.naturalHeight):(n=e.width,e=e.height),!t.l||n===t.i.canvas.width&&e===t.i.canvas.height||(t.i.canvas.width=n,t.i.canvas.height=e),[n,e]}function Oo(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.i.stringToNewUTF8(e[n]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.i._free(e);t.i._free(e)}function Po(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function Io(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}xo.forVisionTasks=function(t){return ko("vision",t)},xo.forTextTasks=function(t){return ko("text",t)},xo.forAudioTasks=function(t){return ko("audio",t)},xo.isSimdSupported=function(){return To()};async function Co(t,e,n,r){return t=await(async(t,e,n,r,i)=>{if(e&&await Fo(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Fo(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&i&&((e=self.Module).locateFile=i.locateFile,i.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=i.mainScriptUrlOrBlob)),i=await self.ModuleFactory(self.Module||i),self.ModuleFactory=self.Module=void 0,new t(i,r)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&t.endsWith(".data")?n.assetBinaryPath.toString():t}),await t.o(r),t}function Ro(t,e){const n=_n(t.baseOptions,ms,1)||new ms;"string"==typeof e?(nn(n,2,xe(e)),nn(n,1)):e instanceof Uint8Array&&(nn(n,1,ie(e,!1,!1)),nn(n,2)),En(t.baseOptions,0,1,n)}function Do(t){try{const e=t.L.length;if(1===e)throw Error(t.L[0].message);if(1<e)throw Error("Encountered multiple errors: "+t.L.map((t=>t.message)).join(", "))}finally{t.L=[]}}function Bo(t,e){t.N=Math.max(t.N,e)}function Uo(t,e){t.B=new di,ui(t.B,"PassThroughCalculator"),li(t.B,"free_memory"),fi(t.B,"free_memory_unused_out"),wi(e,"free_memory"),_i(e,t.B)}function No(t,e){li(t.B,e),fi(t.B,e+"_unused_out")}function Go(t){t.g.addBoolToStream(!0,"free_memory",t.N)}var jo=class{constructor(t){this.g=t,this.L=[],this.N=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(_n(this.baseOptions,ms,1)?.g()||_n(this.baseOptions,ms,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let n=_n(t.baseOptions,ps,3);if(!n){var r=n=new ps,i=new Qr;An(r,4,gs,i)}"delegate"in e&&("GPU"===e.delegate?(e=n,r=new qr,An(e,2,gs,r)):(e=n,r=new Qr,An(e,4,gs,r))),En(t.baseOptions,0,3,n)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)})).then((t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),!0,!1,!1),Ro(this,"/model.dat"),this.m(),this.V()}));Ro(this,e.modelAssetBuffer)}return this.m(),this.V(),Promise.resolve()}V(){}aa(){let t;if(this.g.aa((e=>{t=Ti(e)})),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.L.push(Error(e))})),this.g.Ma(),this.g.setGraph(t,e),this.B=void 0,Do(this)}finishProcessing(){this.g.finishProcessing(),Do(this)}close(){this.B=void 0,this.g.closeGraph()}};function Vo(t,e){if(null===t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}jo.prototype.close=jo.prototype.close;class zo{constructor(t,e,n,r){this.g=t,this.h=e,this.m=n,this.l=r}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Wo(t,e,n){const r=t.h;if(n=Vo(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(n)}`);return r.attachShader(t.g,n),n}function Xo(t,e){const n=t.h,r=Vo(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);const i=Vo(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(t.u),n.vertexAttribPointer(t.u,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const s=Vo(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,s),n.enableVertexAttribArray(t.B),n.vertexAttribPointer(t.B,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new zo(n,r,i,s)}function Ho(t,e){if(t.h){if(e!==t.h)throw Error("Cannot change GL context once initialized")}else t.h=e}function Yo(t,e,n,r){if(Ho(t,e),!t.g){const e=t.h;if(t.g=Vo(e.createProgram(),"Failed to create WebGL program"),t.C=Wo(t,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",e.VERTEX_SHADER),t.v=Wo(t,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n ",e.FRAGMENT_SHADER),e.linkProgram(t.g),!e.getProgramParameter(t.g,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(t.g)}`);t.u=e.getAttribLocation(t.g,"aVertex"),t.B=e.getAttribLocation(t.g,"aTex")}return n?(t.m||(t.m=Xo(t,!0)),n=t.m):(t.j||(t.j=Xo(t,!1)),n=t.j),e.useProgram(t.g),n.bind(),t=r(),n.g.bindVertexArray(null),t}function Ko(t,e,n){Ho(t,e),t.l||(t.l=Vo(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.l),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)}function $o(t){t.h?.bindFramebuffer(t.h.FRAMEBUFFER,null)}var qo=class{close(){if(this.g){const t=this.h;t.deleteProgram(this.g),t.deleteShader(this.C),t.deleteShader(this.v)}this.l&&this.h.deleteFramebuffer(this.l),this.j&&this.j.close(),this.m&&this.m.close()}};function Jo(t,e){switch(e){case 0:return t.g.find((t=>t instanceof Uint8Array));case 1:return t.g.find((t=>t instanceof Float32Array));case 2:return t.g.find((t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function Zo(t){var e=Jo(t,1);if(!e){if(e=Jo(t,0))e=new Float32Array(e).map((t=>t/255));else{e=new Float32Array(t.width*t.height);const r=ta(t);var n=na(t);if(Ko(n,r,Qo(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in self.document){n=new Float32Array(t.width*t.height*4),r.readPixels(0,0,t.width,t.height,r.RGBA,r.FLOAT,n);for(let t=0,r=0;t<e.length;++t,r+=4)e[t]=n[r]}else r.readPixels(0,0,t.width,t.height,r.RED,r.FLOAT,e)}t.g.push(e)}return e}function Qo(t){let e=Jo(t,2);if(!e){const n=ta(t);e=ia(t);const r=Zo(t),i=ea(t);n.texImage2D(n.TEXTURE_2D,0,i,t.width,t.height,0,n.RED,n.FLOAT,r),sa(t)}return e}function ta(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=Vo(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function ea(t){if(t=ta(t),!oa)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))oa=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");oa=t.R16F}return oa}function na(t){return t.l||(t.l=new qo),t.l}function ra(t){(t=ta(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,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST)}function ia(t){const e=ta(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=Jo(t,2);return n?e.bindTexture(e.TEXTURE_2D,n):(n=Vo(e.createTexture(),"Failed to create texture"),t.g.push(n),t.m=!0,e.bindTexture(e.TEXTURE_2D,n),ra(t)),n}function sa(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var oa,aa=class{constructor(t,e,n,r,i,s){this.g=t,this.m=e,this.canvas=n,this.l=r,this.width=i,this.height=s,this.m&&(0===--ca&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources."))}Ga(){return!!Jo(this,0)}Ea(){return!!Jo(this,1)}M(){return!!Jo(this,2)}Ca(){return(e=Jo(t=this,0))||(e=Zo(t),e=new Uint8Array(e.map((t=>255*t))),t.g.push(e)),e;var t,e}za(){return Zo(this)}Z(){return Qo(this)}clone(){const t=[];for(const e of this.g){let n;if(e instanceof Uint8Array)n=new Uint8Array(e);else if(e instanceof Float32Array)n=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{const t=ta(this),e=na(this);t.activeTexture(t.TEXTURE1),n=Vo(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,n),ra(this);const r=ea(this);t.texImage2D(t.TEXTURE_2D,0,r,this.width,this.height,0,t.RED,t.FLOAT,null),t.bindTexture(t.TEXTURE_2D,null),Ko(e,t,n),Yo(e,t,!1,(()=>{ia(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),sa(this)})),$o(e),sa(this)}}t.push(n)}return new aa(t,this.M(),this.canvas,this.l,this.width,this.height)}close(){this.m&&ta(this).deleteTexture(Jo(this,2)),ca=-1}};aa.prototype.close=aa.prototype.close,aa.prototype.clone=aa.prototype.clone,aa.prototype.getAsWebGLTexture=aa.prototype.Z,aa.prototype.getAsFloat32Array=aa.prototype.za,aa.prototype.getAsUint8Array=aa.prototype.Ca,aa.prototype.hasWebGLTexture=aa.prototype.M,aa.prototype.hasFloat32Array=aa.prototype.Ea,aa.prototype.hasUint8Array=aa.prototype.Ga;var ca=250;const ha={color:"white",lineWidth:4,radius:6};function ua(t){return{...ha,fillColor:(t=t||{}).color,...t}}function la(t,e){return t instanceof Function?t(e):t}function fa(t,e,n){return Math.max(Math.min(e,n),Math.min(Math.max(e,n),t))}function da(t){if(!t.g)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.g}var pa=class{constructor(t){(t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D)&&(this.g=t)}wa(t,e){if(t){var n=da(this);e=ua(e),n.save();var r=n.canvas,i=0;for(const s of t)n.fillStyle=la(e.fillColor,{index:i,from:s}),n.strokeStyle=la(e.color,{index:i,from:s}),n.lineWidth=la(e.lineWidth,{index:i,from:s}),(t=new Path2D).arc(s.x*r.width,s.y*r.height,la(e.radius,{index:i,from:s}),0,2*Math.PI),n.fill(t),n.stroke(t),++i;n.restore()}}va(t,e,n){if(t&&e){var r=da(this);n=ua(n),r.save();var i=r.canvas,s=0;for(const o of e){r.beginPath(),e=t[o.start];const a=t[o.end];e&&a&&(r.strokeStyle=la(n.color,{index:s,from:e,to:a}),r.lineWidth=la(n.lineWidth,{index:s,from:e,to:a}),r.moveTo(e.x*i.width,e.y*i.height),r.lineTo(a.x*i.width,a.y*i.height)),++s,r.stroke()}r.restore()}}ua(t,e){const n=da(this);e=ua(e),n.save(),n.beginPath(),n.lineWidth=la(e.lineWidth,{}),n.strokeStyle=la(e.color,{}),n.fillStyle=la(e.fillColor,{}),n.moveTo(t.originX,t.originY),n.lineTo(t.originX+t.width,t.originY),n.lineTo(t.originX+t.width,t.originY+t.height),n.lineTo(t.originX,t.originY+t.height),n.lineTo(t.originX,t.originY),n.stroke(),n.fill(),n.restore()}close(){this.h?.close(),this.h=void 0,this.l?.close(),this.l=void 0}};function ga(t,e){switch(e){case 0:return t.g.find((t=>t instanceof ImageData));case 1:return t.g.find((t=>"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap));case 2:return t.g.find((t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function ma(t){var e=ga(t,0);if(!e){e=va(t);const n=_a(t),r=new Uint8Array(t.width*t.height*4);Ko(n,e,ya(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,r),$o(n),e=new ImageData(new Uint8ClampedArray(r.buffer),t.width,t.height),t.g.push(e)}return e}function ya(t){let e=ga(t,2);if(!e){const n=va(t);e=ba(t);const r=ga(t,1)||ma(t);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),Ea(t)}return e}function va(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when iniitializing the image.");return t.h||(t.h=Vo(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function _a(t){return t.l||(t.l=new qo),t.l}function wa(t){(t=va(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,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR)}function ba(t){const e=va(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=ga(t,2);return n?e.bindTexture(e.TEXTURE_2D,n):(n=Vo(e.createTexture(),"Failed to create texture"),t.g.push(n),t.m=!0,e.bindTexture(e.TEXTURE_2D,n),wa(t)),n}function Ea(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function Aa(t){const e=va(t);return Yo(_a(t),e,!0,(()=>function(t,e){const n=t.canvas;if(n.width===t.width&&n.height===t.height)return e();const r=n.width,i=n.height;return n.width=t.width,n.height=t.height,t=e(),n.width=r,n.height=i,t}(t,(()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))))}pa.prototype.close=pa.prototype.close,pa.prototype.drawBoundingBox=pa.prototype.ua,pa.prototype.drawConnectors=pa.prototype.va,pa.prototype.drawLandmarks=pa.prototype.wa,pa.lerp=function(t,e,n,r,i){return fa(r*(1-(t-e)/(n-e))+i*(1-(n-t)/(n-e)),r,i)},pa.clamp=fa;var Ta=class{constructor(t,e,n,r,i,s,o){this.g=t,this.j=e,this.m=n,this.canvas=r,this.l=i,this.width=s,this.height=o,(this.j||this.m)&&(0===--ka&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources."))}Fa(){return!!ga(this,0)}ga(){return!!ga(this,1)}M(){return!!ga(this,2)}Ba(){return ma(this)}Aa(){var t=ga(this,1);return t||(ya(this),ba(this),t=Aa(this),Ea(this),this.g.push(t),this.j=!0),t}Z(){return ya(this)}clone(){const t=[];for(const e of this.g){let n;if(e instanceof ImageData)n=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){const t=va(this),e=_a(this);t.activeTexture(t.TEXTURE1),n=Vo(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,n),wa(this),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindTexture(t.TEXTURE_2D,null),Ko(e,t,n),Yo(e,t,!1,(()=>{ba(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Ea(this)})),$o(e),Ea(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);ya(this),ba(this),n=Aa(this),Ea(this)}t.push(n)}return new Ta(t,this.ga(),this.M(),this.canvas,this.l,this.width,this.height)}close(){this.j&&ga(this,1).close(),this.m&&va(this).deleteTexture(ga(this,2)),ka=-1}};Ta.prototype.close=Ta.prototype.close,Ta.prototype.clone=Ta.prototype.clone,Ta.prototype.getAsWebGLTexture=Ta.prototype.Z,Ta.prototype.getAsImageBitmap=Ta.prototype.Aa,Ta.prototype.getAsImageData=Ta.prototype.Ba,Ta.prototype.hasWebGLTexture=Ta.prototype.M,Ta.prototype.hasImageBitmap=Ta.prototype.ga,Ta.prototype.hasImageData=Ta.prototype.Fa;var ka=250;function xa(...t){return t.map((([t,e])=>({start:t,end:e})))}const Sa=function(t){return class extends t{Ma(){this.i._registerModelResourcesGraphService()}}}((Fa=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:"undefined"==typeof OffscreenCanvas||So()?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas")):this.i.canvas=new OffscreenCanvas(1,1)}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const n=t.length,r=this.i._malloc(n);this.i.HEAPU8.set(t,r),e?this.i._changeBinaryGraph(n,r):this.i._changeTextGraph(n,r),this.i._free(r)}configureAudio(t,e,n,r,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Lo(this,r||"input_audio",(r=>{Lo(this,i=i||"audio_header",(i=>{this.i._configureAudio(r,i,t,e,n)}))}))}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}aa(t){Po(this,"__graph_config__",(e=>{t(e)})),Lo(this,"__graph_config__",(t=>{this.i._getGraphConfig(t,void 0)})),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const s=4*t.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(t,this.g/4),Lo(this,r,(t=>{this.i._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Lo(this,e,(e=>{const[r,i]=Mo(this,t,e);this.i._addBoundTextureToStream(e,r,i,n)}))}addBoolToStream(t,e,n){Lo(this,e,(e=>{this.i._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Lo(this,e,(e=>{this.i._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Lo(this,e,(e=>{this.i._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Lo(this,e,(e=>{this.i._addIntToInputStream(t,e,n)}))}addStringToStream(t,e,n){Lo(this,e,(e=>{Lo(this,t,(t=>{this.i._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Lo(this,e,(e=>{Oo(this,Object.keys(t),(r=>{Oo(this,Object.values(t),(i=>{this.i._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Lo(this,n,(n=>{Lo(this,e,(e=>{const i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,n,r),this.i._free(i)}))}))}addEmptyPacketToStream(t,e){Lo(this,t,(t=>{this.i._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){Lo(this,e,(e=>{const r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){Lo(this,e,(e=>{const r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){Lo(this,e,(e=>{const r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){Lo(this,e,(e=>{const r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){Lo(this,e,(e=>{const r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Lo(this,e,(t=>{this.i._addStringVectorEntry(r,t)}));this.i._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){Lo(this,e,(e=>{this.i._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Lo(this,e,(e=>{this.i._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Lo(this,e,(e=>{this.i._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Lo(this,e,(e=>{this.i._addIntToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Lo(this,e,(e=>{Lo(this,t,(t=>{this.i._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Lo(this,n,(n=>{Lo(this,e,(e=>{const r=this.i._malloc(t.length);this.i.HEAPU8.set(t,r),this.i._addProtoToInputSidePacket(r,t.length,e,n),this.i._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){Lo(this,e,(e=>{const n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){Lo(this,e,(e=>{const n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){Lo(this,e,(e=>{const n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){Lo(this,e,(e=>{const n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){Lo(this,e,(e=>{const n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Lo(this,e,(t=>{this.i._addStringVectorEntry(n,t)}));this.i._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){Po(this,t,e),Lo(this,t,(t=>{this.i._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Io(this,t,e),Lo(this,t,(t=>{this.i._attachBoolVectorListener(t)}))}attachIntListener(t,e){Po(this,t,e),Lo(this,t,(t=>{this.i._attachIntListener(t)}))}attachIntVectorListener(t,e){Io(this,t,e),Lo(this,t,(t=>{this.i._attachIntVectorListener(t)}))}attachDoubleListener(t,e){Po(this,t,e),Lo(this,t,(t=>{this.i._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Io(this,t,e),Lo(this,t,(t=>{this.i._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Po(this,t,e),Lo(this,t,(t=>{this.i._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Io(this,t,e),Lo(this,t,(t=>{this.i._attachFloatVectorListener(t)}))}attachStringListener(t,e){Po(this,t,e),Lo(this,t,(t=>{this.i._attachStringListener(t)}))}attachStringVectorListener(t,e){Io(this,t,e),Lo(this,t,(t=>{this.i._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Po(this,t,e),Lo(this,t,(t=>{this.i._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Io(this,t,e),Lo(this,t,(t=>{this.i._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Po(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Lo(this,t,(t=>{this.i._attachAudioListener(t,n||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends Fa{get ca(){return this.i}pa(t,e,n){Lo(this,e,(e=>{const[r,i]=Mo(this,t,e);this.ca._addBoundTextureAsImageToStream(e,r,i,n)}))}X(t,e){Po(this,t,e),Lo(this,t,(t=>{this.ca._attachImageListener(t)}))}Y(t,e){Io(this,t,e),Lo(this,t,(t=>{this.ca._attachImageVectorListener(t)}))}}));var Fa,La=class extends Sa{};async function Ma(t,e,n){return async function(t,e,n,r){return Co(t,e,n,r)}(t,n.canvas??("undefined"==typeof OffscreenCanvas||So()?document.createElement("canvas"):void 0),e,n)}function Oa(t,e,n,r){if(t.da){const s=new Zi;if(n?.regionOfInterest){if(!t.na)throw Error("This task doesn't support region-of-interest.");var i=n.regionOfInterest;if(i.left>=i.right||i.top>=i.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(0>i.left||0>i.top||1<i.right||1<i.bottom)throw Error("Expected RectF values to be in [0,1].");Pn(s,1,(i.left+i.right)/2),Pn(s,2,(i.top+i.bottom)/2),Pn(s,4,i.right-i.left),Pn(s,3,i.bottom-i.top)}else Pn(s,1,.5),Pn(s,2,.5),Pn(s,4,1),Pn(s,3,1);if(n?.rotationDegrees){if(0!=n?.rotationDegrees%90)throw Error("Expected rotation to be a multiple of 90°.");if(Pn(s,5,-Math.PI*n.rotationDegrees/180),0!=n?.rotationDegrees%180){const[t,r]=void 0!==e.videoWidth?[e.videoWidth,e.videoHeight]:void 0!==e.naturalWidth?[e.naturalWidth,e.naturalHeight]:[e.width,e.height];n=Ln(s,3)*r/t,i=Ln(s,4)*t/r,Pn(s,4,n),Pn(s,3,i)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.da,r)}t.g.pa(e,t.ma,r??performance.now()),t.finishProcessing()}function Pa(t,e,n){if(t.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");Oa(t,e,n,t.N+1)}function Ia(t,e,n,r){if(!t.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");Oa(t,e,n,r)}function Ca(t,e,n){var r=e.data;const i=e.width,s=i*(e=e.height);if((r instanceof Uint8Array||r instanceof Float32Array)&&r.length!==s)throw Error("Unsupported channel count: "+r.length/s);return t=new aa([r],!1,t.g.i.canvas,t.U,i,e),n?t.clone():t}var Ra=class extends jo{constructor(t,e,n,r){super(t),this.g=t,this.ma=e,this.da=n,this.na=r,this.U=new qo}l(t,e=!0){if("runningMode"in t&&Mn(this.baseOptions,2,!!t.runningMode&&"IMAGE"!==t.runningMode),void 0!==t.canvas&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.U.close(),super.close()}};Ra.prototype.close=Ra.prototype.close;var Da=class extends Ra{constructor(t,e){super(new La(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},this.h=new ws,t=new vs,En(this.h,0,1,t),Pn(this.h,2,.5),Pn(this.h,3,.3)}get baseOptions(){return _n(this.h,vs,1)}set baseOptions(t){En(this.h,0,1,t)}o(t){return"minDetectionConfidence"in t&&Pn(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&Pn(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}F(t,e){return this.j={detections:[]},Pa(this,t,e),this.j}G(t,e,n){return this.j={detections:[]},Ia(this,t,n,e),this.j}m(){var t=new Ei;wi(t,"image_in"),wi(t,"norm_rect_in"),bi(t,"detections");const e=new ni;In(e,Es,this.h);const n=new di;ui(n,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),li(n,"IMAGE:image_in"),li(n,"NORM_RECT:norm_rect_in"),fi(n,"DETECTIONS:detections"),n.o(e),_i(t,n),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=ji(e),this.j.detections.push(yo(t));Bo(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{Bo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Da.prototype.detectForVideo=Da.prototype.G,Da.prototype.detect=Da.prototype.F,Da.prototype.setOptions=Da.prototype.o,Da.createFromModelPath=async function(t,e){return Ma(Da,t,{baseOptions:{modelAssetPath:e}})},Da.createFromModelBuffer=function(t,e){return Ma(Da,t,{baseOptions:{modelAssetBuffer:e}})},Da.createFromOptions=function(t,e){return Ma(Da,t,e)};var Ba=xa([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]),Ua=xa([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]),Na=xa([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),Ga=xa([474,475],[475,476],[476,477],[477,474]),ja=xa([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]),Va=xa([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),za=xa([469,470],[470,471],[471,472],[472,469]),Wa=xa([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]),Xa=[...Ba,...Ua,...Na,...ja,...Va,...Wa],Ha=xa([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 Ya(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var Ka=class extends Ra{constructor(t,e){super(new La(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,this.h=new Ls,t=new vs,En(this.h,0,1,t),this.v=new Ss,En(this.h,0,3,this.v),this.u=new ws,En(this.h,0,2,this.u),On(this.u,4,1),Pn(this.u,2,.5),Pn(this.v,2,.5),Pn(this.h,4,.5)}get baseOptions(){return _n(this.h,vs,1)}set baseOptions(t){En(this.h,0,1,t)}o(t){return"numFaces"in t&&On(this.u,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&Pn(this.u,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&Pn(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&Pn(this.v,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}F(t,e){return Ya(this),Pa(this,t,e),this.j}G(t,e,n){return Ya(this),Ia(this,t,n,e),this.j}m(){var t=new Ei;wi(t,"image_in"),wi(t,"norm_rect"),bi(t,"face_landmarks");const e=new ni;In(e,Os,this.h);const n=new di;ui(n,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),li(n,"IMAGE:image_in"),li(n,"NORM_RECT:norm_rect"),fi(n,"NORM_LANDMARKS:face_landmarks"),n.o(e),_i(t,n),this.g.attachProtoVectorListener("face_landmarks",((t,e)=>{for(const e of t)t=$i(e),this.j.faceLandmarks.push(vo(t));Bo(this,e)})),this.g.attachEmptyPacketListener("face_landmarks",(t=>{Bo(this,t)})),this.outputFaceBlendshapes&&(bi(t,"blendshapes"),fi(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((t,e)=>{if(this.outputFaceBlendshapes)for(const e of t)t=Mi(e),this.j.faceBlendshapes.push(mo(t.g()??[]));Bo(this,e)})),this.g.attachEmptyPacketListener("blendshapes",(t=>{Bo(this,t)}))),this.outputFacialTransformationMatrixes&&(bi(t,"face_geometry"),fi(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((t,e)=>{if(this.outputFacialTransformationMatrixes)for(const e of t)(t=_n(ks(e),qi,2))&&this.j.facialTransformationMatrixes.push({rows:Fn(xn(t,1))??0,columns:Fn(xn(t,2))??0,data:cn(t,3,me)??[]});Bo(this,e)})),this.g.attachEmptyPacketListener("face_geometry",(t=>{Bo(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ka.prototype.detectForVideo=Ka.prototype.G,Ka.prototype.detect=Ka.prototype.F,Ka.prototype.setOptions=Ka.prototype.o,Ka.createFromModelPath=function(t,e){return Ma(Ka,t,{baseOptions:{modelAssetPath:e}})},Ka.createFromModelBuffer=function(t,e){return Ma(Ka,t,{baseOptions:{modelAssetBuffer:e}})},Ka.createFromOptions=function(t,e){return Ma(Ka,t,e)},Ka.FACE_LANDMARKS_LIPS=Ba,Ka.FACE_LANDMARKS_LEFT_EYE=Ua,Ka.FACE_LANDMARKS_LEFT_EYEBROW=Na,Ka.FACE_LANDMARKS_LEFT_IRIS=Ga,Ka.FACE_LANDMARKS_RIGHT_EYE=ja,Ka.FACE_LANDMARKS_RIGHT_EYEBROW=Va,Ka.FACE_LANDMARKS_RIGHT_IRIS=za,Ka.FACE_LANDMARKS_FACE_OVAL=Wa,Ka.FACE_LANDMARKS_CONTOURS=Xa,Ka.FACE_LANDMARKS_TESSELATION=Ha;var $a=class extends Ra{constructor(t,e){super(new La(t,e),"image_in","norm_rect",!0),this.j=new Ps,t=new vs,En(this.j,0,1,t)}get baseOptions(){return _n(this.j,vs,1)}set baseOptions(t){En(this.j,0,1,t)}o(t){return super.l(t)}Pa(t,e,n){const r="function"!=typeof e?e:{};if(this.h="function"==typeof e?e:n,Pa(this,t,r??{}),!this.h)return this.u}m(){var t=new Ei;wi(t,"image_in"),wi(t,"norm_rect"),bi(t,"stylized_image");const e=new ni;In(e,Is,this.j);const n=new di;ui(n,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),li(n,"IMAGE:image_in"),li(n,"NORM_RECT:norm_rect"),fi(n,"STYLIZED_IMAGE:stylized_image"),n.o(e),_i(t,n),this.g.X("stylized_image",((t,e)=>{var n=!this.h,r=t.data,i=t.width;const s=i*(t=t.height);if(r instanceof Uint8Array)if(r.length===3*s){const e=new Uint8ClampedArray(4*s);for(let t=0;t<s;++t)e[4*t]=r[3*t],e[4*t+1]=r[3*t+1],e[4*t+2]=r[3*t+2],e[4*t+3]=255;r=new ImageData(e,i,t)}else{if(r.length!==4*s)throw Error("Unsupported channel count: "+r.length/s);r=new ImageData(new Uint8ClampedArray(r.buffer,r.byteOffset,r.length),i,t)}else if(!(r instanceof WebGLTexture))throw Error(`Unsupported format: ${r.constructor.name}`);i=new Ta([r],!1,!1,this.g.i.canvas,this.U,i,t),this.u=n=n?i.clone():i,this.h&&this.h(n),Bo(this,e)})),this.g.attachEmptyPacketListener("stylized_image",(t=>{this.u=null,this.h&&this.h(null),Bo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};$a.prototype.stylize=$a.prototype.Pa,$a.prototype.setOptions=$a.prototype.o,$a.createFromModelPath=function(t,e){return Ma($a,t,{baseOptions:{modelAssetPath:e}})},$a.createFromModelBuffer=function(t,e){return Ma($a,t,{baseOptions:{modelAssetBuffer:e}})},$a.createFromOptions=function(t,e){return Ma($a,t,e)};var qa=xa([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 Ja(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function Za(t){return 0===t.gestures.length?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function Qa(t,e=!0){const n=[];for(const i of t){var r=Mi(i);t=[];for(const n of r.g())r=e&&null!=xn(n,1)?Fn(xn(n,1)):-1,t.push({score:Ln(n,2)??0,index:r,categoryName:Sn(n,3)??""??"",displayName:Sn(n,4)??""??""});n.push(t)}return n}var tc=class extends Ra{constructor(t,e){super(new La(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],this.v=new Xs,t=new vs,En(this.v,0,1,t),this.C=new zs,En(this.v,0,2,this.C),this.u=new js,En(this.C,0,3,this.u),this.h=new Ns,En(this.C,0,2,this.h),this.j=new Bs,En(this.v,0,3,this.j),Pn(this.h,2,.5),Pn(this.C,4,.5),Pn(this.u,2,.5)}get baseOptions(){return _n(this.v,vs,1)}set baseOptions(t){En(this.v,0,1,t)}o(t){if(On(this.h,3,t.numHands??1),"minHandDetectionConfidence"in t&&Pn(this.h,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Pn(this.C,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Pn(this.u,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new Cs,n=go(t.cannedGesturesClassifierOptions,_n(this.j,Cs,3)?.h());En(e,0,2,n),En(this.j,0,3,e)}else void 0===t.cannedGesturesClassifierOptions&&_n(this.j,Cs,3)?.g();return t.customGesturesClassifierOptions?(En(e=new Cs,0,2,n=go(t.customGesturesClassifierOptions,_n(this.j,Cs,4)?.h())),En(this.j,0,4,e)):void 0===t.customGesturesClassifierOptions&&_n(this.j,Cs,4)?.g(),this.l(t)}Ka(t,e){return Ja(this),Pa(this,t,e),Za(this)}La(t,e,n){return Ja(this),Ia(this,t,n,e),Za(this)}m(){var t=new Ei;wi(t,"image_in"),wi(t,"norm_rect"),bi(t,"hand_gestures"),bi(t,"hand_landmarks"),bi(t,"world_hand_landmarks"),bi(t,"handedness");const e=new ni;In(e,Ks,this.v);const n=new di;ui(n,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),li(n,"IMAGE:image_in"),li(n,"NORM_RECT:norm_rect"),fi(n,"HAND_GESTURES:hand_gestures"),fi(n,"LANDMARKS:hand_landmarks"),fi(n,"WORLD_LANDMARKS:world_hand_landmarks"),fi(n,"HANDEDNESS:handedness"),n.o(e),_i(t,n),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t){t=$i(e);const n=[];for(const e of bn(t,Hi,1))n.push({x:Ln(e,1)??0,y:Ln(e,2)??0,z:Ln(e,3)??0});this.landmarks.push(n)}Bo(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{Bo(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t){t=Xi(e);const n=[];for(const e of bn(t,Vi,1))n.push({x:Ln(e,1)??0,y:Ln(e,2)??0,z:Ln(e,3)??0});this.worldLandmarks.push(n)}Bo(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{Bo(this,t)})),this.g.attachProtoVectorListener("hand_gestures",((t,e)=>{this.gestures.push(...Qa(t,!1)),Bo(this,e)})),this.g.attachEmptyPacketListener("hand_gestures",(t=>{Bo(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{this.handedness.push(...Qa(t)),Bo(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{Bo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function ec(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}tc.prototype.recognizeForVideo=tc.prototype.La,tc.prototype.recognize=tc.prototype.Ka,tc.prototype.setOptions=tc.prototype.o,tc.createFromModelPath=function(t,e){return Ma(tc,t,{baseOptions:{modelAssetPath:e}})},tc.createFromModelBuffer=function(t,e){return Ma(tc,t,{baseOptions:{modelAssetBuffer:e}})},tc.createFromOptions=function(t,e){return Ma(tc,t,e)},tc.HAND_CONNECTIONS=qa;var nc=class extends Ra{constructor(t,e){super(new La(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],this.j=new zs,t=new vs,En(this.j,0,1,t),this.u=new js,En(this.j,0,3,this.u),this.h=new Ns,En(this.j,0,2,this.h),On(this.h,3,1),Pn(this.h,2,.5),Pn(this.u,2,.5),Pn(this.j,4,.5)}get baseOptions(){return _n(this.j,vs,1)}set baseOptions(t){En(this.j,0,1,t)}o(t){return"numHands"in t&&On(this.h,3,t.numHands??1),"minHandDetectionConfidence"in t&&Pn(this.h,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Pn(this.j,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Pn(this.u,2,t.minHandPresenceConfidence??.5),this.l(t)}F(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Pa(this,t,e),ec(this)}G(t,e,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ia(this,t,n,e),ec(this)}m(){var t=new Ei;wi(t,"image_in"),wi(t,"norm_rect"),bi(t,"hand_landmarks"),bi(t,"world_hand_landmarks"),bi(t,"handedness");const e=new ni;In(e,Ys,this.j);const n=new di;ui(n,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),li(n,"IMAGE:image_in"),li(n,"NORM_RECT:norm_rect"),fi(n,"LANDMARKS:hand_landmarks"),fi(n,"WORLD_LANDMARKS:world_hand_landmarks"),fi(n,"HANDEDNESS:handedness"),n.o(e),_i(t,n),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t)t=$i(e),this.landmarks.push(vo(t));Bo(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{Bo(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t)t=Xi(e),this.worldLandmarks.push(_o(t));Bo(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{Bo(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{var n=this.handedness,r=n.push;const i=[];for(const e of t){t=Mi(e);const n=[];for(const e of t.g())n.push({score:Ln(e,2)??0,index:Fn(xn(e,1))??-1,categoryName:Sn(e,3)??""??"",displayName:Sn(e,4)??""??""});i.push(n)}r.call(n,...i),Bo(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{Bo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};nc.prototype.detectForVideo=nc.prototype.G,nc.prototype.detect=nc.prototype.F,nc.prototype.setOptions=nc.prototype.o,nc.createFromModelPath=function(t,e){return Ma(nc,t,{baseOptions:{modelAssetPath:e}})},nc.createFromModelBuffer=function(t,e){return Ma(nc,t,{baseOptions:{modelAssetBuffer:e}})},nc.createFromOptions=function(t,e){return Ma(nc,t,e)},nc.HAND_CONNECTIONS=qa;var rc=class extends Ra{constructor(t,e){super(new La(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},this.h=new $s,t=new vs,En(this.h,0,1,t)}get baseOptions(){return _n(this.h,vs,1)}set baseOptions(t){En(this.h,0,1,t)}o(t){var e=go(t,_n(this.h,us,2));return En(this.h,0,2,e),this.l(t)}sa(t,e){return this.j={classifications:[]},Pa(this,t,e),this.j}ta(t,e,n){return this.j={classifications:[]},Ia(this,t,n,e),this.j}m(){var t=new Ei;wi(t,"input_image"),wi(t,"norm_rect"),bi(t,"classifications");const e=new ni;In(e,qs,this.h);const n=new di;ui(n,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),li(n,"IMAGE:input_image"),li(n,"NORM_RECT:norm_rect"),fi(n,"CLASSIFICATIONS:classifications"),n.o(e),_i(t,n),this.g.attachProtoListener("classifications",((t,e)=>{this.j=function(t){const e={classifications:bn(t,Qi,1).map((t=>mo(_n(t,Fi,4)?.g()??[],Fn(xn(t,2)),Sn(t,3)??"")))};return null!=Te(tn(t,2))&&(e.timestampMs=Fn(Te(tn(t,2)))),e}(ns(t)),Bo(this,e)})),this.g.attachEmptyPacketListener("classifications",(t=>{Bo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};rc.prototype.classifyForVideo=rc.prototype.ta,rc.prototype.classify=rc.prototype.sa,rc.prototype.setOptions=rc.prototype.o,rc.createFromModelPath=function(t,e){return Ma(rc,t,{baseOptions:{modelAssetPath:e}})},rc.createFromModelBuffer=function(t,e){return Ma(rc,t,{baseOptions:{modelAssetBuffer:e}})},rc.createFromOptions=function(t,e){return Ma(rc,t,e)};var ic=class extends Ra{constructor(t,e){super(new La(t,e),"image_in","norm_rect",!0),this.h=new Js,this.embeddings={embeddings:[]},t=new vs,En(this.h,0,1,t)}get baseOptions(){return _n(this.h,vs,1)}set baseOptions(t){En(this.h,0,1,t)}o(t){var e=this.h,n=_n(this.h,fs,2);return n=n?n.clone():new fs,void 0!==t.l2Normalize?Mn(n,1,t.l2Normalize):"l2Normalize"in t&&nn(n,1),void 0!==t.quantize?Mn(n,2,t.quantize):"quantize"in t&&nn(n,2),En(e,0,2,n),this.l(t)}xa(t,e){return Pa(this,t,e),this.embeddings}ya(t,e,n){return Ia(this,t,n,e),this.embeddings}m(){var t=new Ei;wi(t,"image_in"),wi(t,"norm_rect"),bi(t,"embeddings_out");const e=new ni;In(e,Zs,this.h);const n=new di;ui(n,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),li(n,"IMAGE:image_in"),li(n,"NORM_RECT:norm_rect"),fi(n,"EMBEDDINGS:embeddings_out"),n.o(e),_i(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=hs(t),this.embeddings=function(t){return{embeddings:bn(t,ss,1).map((t=>{const e={headIndex:Fn(xn(t,3))??-1,headName:Sn(t,4)??""??""};if(void 0!==vn(t,rs,gn(t,1)))t=cn(t=_n(t,rs,gn(t,1)),1,me),e.floatEmbedding=t;else{const n=new Uint8Array(0);e.quantizedEmbedding=_n(t,is,gn(t,2))?.oa()?.qa()??n}return e})),timestampMs:Fn(Te(tn(t,2)))}}(t),Bo(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{Bo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ic.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=bo(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=bo(wo(t.quantizedEmbedding),wo(e.quantizedEmbedding))}return t},ic.prototype.embedForVideo=ic.prototype.ya,ic.prototype.embed=ic.prototype.xa,ic.prototype.setOptions=ic.prototype.o,ic.createFromModelPath=function(t,e){return Ma(ic,t,{baseOptions:{modelAssetPath:e}})},ic.createFromModelBuffer=function(t,e){return Ma(ic,t,{baseOptions:{modelAssetBuffer:e}})},ic.createFromOptions=function(t,e){return Ma(ic,t,e)};var sc=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};function oc(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function ac(t){try{const e=new sc(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{Go(t)}}sc.prototype.close=sc.prototype.close;var cc=class extends Ra{constructor(t,e){super(new La(t,e),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new ro,this.v=new Qs,En(this.h,0,3,this.v),t=new vs,En(this.h,0,1,t)}get baseOptions(){return _n(this.h,vs,1)}set baseOptions(t){En(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?nn(this.h,2,xe(t.displayNamesLocale)):"displayNamesLocale"in t&&nn(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}V(){!function(t){const e=bn(t.aa(),di,1).filter((t=>(Sn(t,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(t.u=[],1<e.length)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");1===e.length&&(_n(e[0],ni,7)?.l()?.g()??new Map).forEach(((e,n)=>{t.u[Number(n)]=Sn(e,1)??""}))}(this)}ba(t,e,n){const r="function"!=typeof e?e:{};return this.j="function"==typeof e?e:n,oc(this),Pa(this,t,r),ac(this)}Na(t,e,n,r){const i="function"!=typeof n?n:{};return this.j="function"==typeof n?n:r,oc(this),Ia(this,t,i,e),ac(this)}Da(){return this.u}m(){var t=new Ei;wi(t,"image_in"),wi(t,"norm_rect");const e=new ni;In(e,io,this.h);const n=new di;ui(n,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),li(n,"IMAGE:image_in"),li(n,"NORM_RECT:norm_rect"),n.o(e),_i(t,n),Uo(this,t),this.outputConfidenceMasks&&(bi(t,"confidence_masks"),fi(n,"CONFIDENCE_MASKS:confidence_masks"),No(this,"confidence_masks"),this.g.Y("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>Ca(this,t,!this.j))),Bo(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],Bo(this,t)}))),this.outputCategoryMask&&(bi(t,"category_mask"),fi(n,"CATEGORY_MASK:category_mask"),No(this,"category_mask"),this.g.X("category_mask",((t,e)=>{this.categoryMask=Ca(this,t,!this.j),Bo(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,Bo(this,t)}))),bi(t,"quality_scores"),fi(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,Bo(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,Bo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};cc.prototype.getLabels=cc.prototype.Da,cc.prototype.segmentForVideo=cc.prototype.Na,cc.prototype.segment=cc.prototype.ba,cc.prototype.setOptions=cc.prototype.o,cc.createFromModelPath=function(t,e){return Ma(cc,t,{baseOptions:{modelAssetPath:e}})},cc.createFromModelBuffer=function(t,e){return Ma(cc,t,{baseOptions:{modelAssetBuffer:e}})},cc.createFromOptions=function(t,e){return Ma(cc,t,e)};var hc=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};hc.prototype.close=hc.prototype.close;var uc=class extends Cn{constructor(t){super(t)}},lc=[0,Sr,-2],fc=[0,wr,-3,Mr],dc=[0,wr,-3,Mr,wr,-1],pc=[0,dc],gc=[0,pc,lc],mc=[0,dc,lc],yc=[0,dc,Sr,-1],vc=[0,yc,lc],_c=[0,wr,-3,Mr,lc,-1],wc=[0,wr,-3,Mr,Gr],bc=class extends Cn{constructor(t){super(t)}},Ec=[0,wr,-1,Mr],Ac=class extends Cn{constructor(){super()}};Ac.A=[1];var Tc=class extends Cn{constructor(t){super(t)}},kc=[1,2,3,4,5,6,7,8,9,10,14,15],xc=[0,kc,Br,dc,Br,mc,Br,pc,Br,gc,Br,Ec,Br,wc,Br,fc,Br,[0,Cr,wr,-2,Mr,Sr,Mr,-1,2,wr,lc],Br,yc,Br,vc,wr,lc,Cr,Br,_c,Br,[0,_r,Ec]],Sc=[0,Cr,Sr,-1,Mr],Fc=class extends Cn{constructor(){super()}};Fc.A=[1],Fc.prototype.g=Xr([0,_r,xc,Cr,Sc]);var Lc=class extends Ra{constructor(t,e){super(new La(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new ro,this.v=new Qs,En(this.h,0,3,this.v),t=new vs,En(this.h,0,1,t)}get baseOptions(){return _n(this.h,vs,1)}set baseOptions(t){En(this.h,0,1,t)}o(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}ba(t,e,n,r){const i="function"!=typeof n?n:{};this.j="function"==typeof n?n:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.N+1,r=new Fc;const s=new Tc;var o=new uc;if(On(o,1,255),En(s,0,12,o),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new bc;Mn(a,3,!0),Pn(a,1,e.keypoint.x),Pn(a,2,e.keypoint.y),An(s,5,kc,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new Ac,e.scribble))Mn(e=new bc,3,!0),Pn(e,1,a.x),Pn(e,2,a.y),kn(o,bc,e);An(s,15,kc,o)}kn(r,Tc,s),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",n),Pa(this,t,i);t:{try{const t=new hc(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=t;break t}this.j(t)}finally{Go(this)}c=void 0}return c}m(){var t=new Ei;wi(t,"image_in"),wi(t,"roi_in"),wi(t,"norm_rect_in");const e=new ni;In(e,io,this.h);const n=new di;ui(n,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),li(n,"IMAGE:image_in"),li(n,"ROI:roi_in"),li(n,"NORM_RECT:norm_rect_in"),n.o(e),_i(t,n),Uo(this,t),this.outputConfidenceMasks&&(bi(t,"confidence_masks"),fi(n,"CONFIDENCE_MASKS:confidence_masks"),No(this,"confidence_masks"),this.g.Y("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>Ca(this,t,!this.j))),Bo(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],Bo(this,t)}))),this.outputCategoryMask&&(bi(t,"category_mask"),fi(n,"CATEGORY_MASK:category_mask"),No(this,"category_mask"),this.g.X("category_mask",((t,e)=>{this.categoryMask=Ca(this,t,!this.j),Bo(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,Bo(this,t)}))),bi(t,"quality_scores"),fi(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,Bo(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,Bo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Lc.prototype.segment=Lc.prototype.ba,Lc.prototype.setOptions=Lc.prototype.o,Lc.createFromModelPath=function(t,e){return Ma(Lc,t,{baseOptions:{modelAssetPath:e}})},Lc.createFromModelBuffer=function(t,e){return Ma(Lc,t,{baseOptions:{modelAssetBuffer:e}})},Lc.createFromOptions=function(t,e){return Ma(Lc,t,e)};var Mc=class extends Ra{constructor(t,e){super(new La(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},this.h=new so,t=new vs,En(this.h,0,1,t)}get baseOptions(){return _n(this.h,vs,1)}set baseOptions(t){En(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?nn(this.h,2,xe(t.displayNamesLocale)):"displayNamesLocale"in t&&nn(this.h,2),void 0!==t.maxResults?On(this.h,3,t.maxResults):"maxResults"in t&&nn(this.h,3),void 0!==t.scoreThreshold?Pn(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&nn(this.h,4),void 0!==t.categoryAllowlist?fn(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&nn(this.h,5),void 0!==t.categoryDenylist?fn(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&nn(this.h,6),this.l(t)}F(t,e){return this.j={detections:[]},Pa(this,t,e),this.j}G(t,e,n){return this.j={detections:[]},Ia(this,t,n,e),this.j}m(){var t=new Ei;wi(t,"input_frame_gpu"),wi(t,"norm_rect"),bi(t,"detections");const e=new ni;In(e,oo,this.h);const n=new di;ui(n,"mediapipe.tasks.vision.ObjectDetectorGraph"),li(n,"IMAGE:input_frame_gpu"),li(n,"NORM_RECT:norm_rect"),fi(n,"DETECTIONS:detections"),n.o(e),_i(t,n),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=ji(e),this.j.detections.push(yo(t));Bo(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{Bo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Mc.prototype.detectForVideo=Mc.prototype.G,Mc.prototype.detect=Mc.prototype.F,Mc.prototype.setOptions=Mc.prototype.o,Mc.createFromModelPath=async function(t,e){return Ma(Mc,t,{baseOptions:{modelAssetPath:e}})},Mc.createFromModelBuffer=function(t,e){return Ma(Mc,t,{baseOptions:{modelAssetBuffer:e}})},Mc.createFromOptions=function(t,e){return Ma(Mc,t,e)};function Oc(t){t.landmarks=[],t.worldLandmarks=[],t.v=void 0}function Pc(t){try{const e=new class{constructor(t,e,n){this.landmarks=t,this.worldLandmarks=e,this.g=n}close(){this.g?.forEach((t=>{t.close()}))}}(t.landmarks,t.worldLandmarks,t.v);if(!t.u)return e;t.u(e)}finally{Go(t)}}var Ic=class extends Ra{constructor(t,e){super(new La(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,this.h=new lo,t=new vs,En(this.h,0,1,t),this.C=new ho,En(this.h,0,3,this.C),this.j=new ao,En(this.h,0,2,this.j),On(this.j,4,1),Pn(this.j,2,.5),Pn(this.C,2,.5),Pn(this.h,4,.5)}get baseOptions(){return _n(this.h,vs,1)}set baseOptions(t){En(this.h,0,1,t)}o(t){return"numPoses"in t&&On(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&Pn(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&Pn(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&Pn(this.C,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}F(t,e,n){const r="function"!=typeof e?e:{};return this.u="function"==typeof e?e:n,Oc(this),Pa(this,t,r),Pc(this)}G(t,e,n,r){const i="function"!=typeof n?n:{};return this.u="function"==typeof n?n:r,Oc(this),Ia(this,t,i,e),Pc(this)}m(){var t=new Ei;wi(t,"image_in"),wi(t,"norm_rect"),bi(t,"normalized_landmarks"),bi(t,"world_landmarks"),bi(t,"segmentation_masks");const e=new ni;In(e,po,this.h);const n=new di;ui(n,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),li(n,"IMAGE:image_in"),li(n,"NORM_RECT:norm_rect"),fi(n,"NORM_LANDMARKS:normalized_landmarks"),fi(n,"WORLD_LANDMARKS:world_landmarks"),n.o(e),_i(t,n),Uo(this,t),this.g.attachProtoVectorListener("normalized_landmarks",((t,e)=>{this.landmarks=[];for(const e of t)t=$i(e),this.landmarks.push(vo(t));Bo(this,e)})),this.g.attachEmptyPacketListener("normalized_landmarks",(t=>{this.landmarks=[],Bo(this,t)})),this.g.attachProtoVectorListener("world_landmarks",((t,e)=>{this.worldLandmarks=[];for(const e of t)t=Xi(e),this.worldLandmarks.push(_o(t));Bo(this,e)})),this.g.attachEmptyPacketListener("world_landmarks",(t=>{this.worldLandmarks=[],Bo(this,t)})),this.outputSegmentationMasks&&(fi(n,"SEGMENTATION_MASK:segmentation_masks"),No(this,"segmentation_masks"),this.g.Y("segmentation_masks",((t,e)=>{this.v=t.map((t=>Ca(this,t,!this.u))),Bo(this,e)})),this.g.attachEmptyPacketListener("segmentation_masks",(t=>{this.v=[],Bo(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ic.prototype.detectForVideo=Ic.prototype.G,Ic.prototype.detect=Ic.prototype.F,Ic.prototype.setOptions=Ic.prototype.o,Ic.createFromModelPath=function(t,e){return Ma(Ic,t,{baseOptions:{modelAssetPath:e}})},Ic.createFromModelBuffer=function(t,e){return Ma(Ic,t,{baseOptions:{modelAssetBuffer:e}})},Ic.createFromOptions=function(t,e){return Ma(Ic,t,e)},Ic.POSE_CONNECTIONS=xa([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]),exports.DrawingUtils=pa,exports.FaceDetector=Da,exports.FaceLandmarker=Ka,exports.FaceStylizer=$a,exports.FilesetResolver=xo,exports.GestureRecognizer=tc,exports.HandLandmarker=nc,exports.ImageClassifier=rc,exports.ImageEmbedder=ic,exports.ImageSegmenter=cc,exports.ImageSegmenterResult=sc,exports.InteractiveSegmenter=Lc,exports.InteractiveSegmenterResult=hc,exports.MPImage=Ta,exports.MPMask=aa,exports.ObjectDetector=Mc,exports.PoseLandmarker=Ic,exports.TaskRunner=jo,exports.VisionTaskRunner=Ra;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e,n){t:{for(var r=["CLOSURE_FLAGS"],i=t,s=0;s<r.length;s++)if(null==(i=i[r[s]])){r=null;break t}r=i}return null!=(e=r&&r[e])?e:n}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,s;const o="undefined"!=typeof TextDecoder;let a;const c="undefined"!=typeof TextEncoder;function h(t){if(c)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(128>e)r[n++]=e;else{if(2048>e)r[n++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&i<t.length){const s=t.charCodeAt(++i);if(56320<=s&&57343>=s){e=1024*(e-55296)+s-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var u,l=e(610401301,!1),f=e(572417392,!0);const d=t.navigator;function p(t){return!!l&&(!!u&&u.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function g(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function m(){return!!l&&(!!u&&0<u.brands.length)}function y(){return m()?p("Chromium"):(g("Chrome")||g("CriOS"))&&!(!m()&&g("Edge"))||g("Silk")}u=d&&d.userAgentData||null;var v=!m()&&(g("Trident")||g("MSIE"));!g("Android")||y(),y(),g("Safari")&&(y()||!m()&&g("Coast")||!m()&&g("Opera")||!m()&&g("Edge")||(m()?p("Microsoft Edge"):g("Edg/"))||m()&&p("Opera"));var _={},w=null;function T(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=w[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}E();for(var r=0;;){var i=n(-1),s=n(0),o=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|s>>4),64!=o&&(e(s<<4&240|o>>2),64!=a&&e(o<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function E(){if(!w){w={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));_[n]=r;for(var i=0;i<r.length;i++){var s=r[i];void 0===w[s]&&(w[s]=i)}}}}var b="undefined"!=typeof Uint8Array,A=!v&&"function"==typeof btoa;function x(t){if(!A){var e;void 0===e&&(e=0),E(),e=_[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let c=0,h=0;for(;c<t.length-2;c+=3){var i=t[c],s=t[c+1],o=t[c+2],a=e[i>>2];i=e[(3&i)<<4|s>>4],s=e[(15&s)<<2|o>>6],o=e[63&o],n[h++]=a+i+s+o}switch(a=0,o=r,t.length-c){case 2:o=e[(15&(a=t[c+1]))<<2]||r;case 1:t=t[c],n[h]=e[t>>2]+e[(3&t)<<4|a>>4]+o+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const k=/[-_.]/g,S={"-":"+",_:"/",".":"="};function L(t){return S[t]||""}function R(t){if(!A)return T(t);k.test(t)&&(t=t.replace(k,L)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function F(t){return b&&null!=t&&t instanceof Uint8Array}let M;function O(){return M||=new Uint8Array(0)}var I={};let C;function P(t){if(t!==I)throw Error("illegal external caller")}function U(){return C||=new B(null,I)}function D(t){P(I);var e=t.Z;return null==(e=null==e||F(e)?e:"string"==typeof e?R(e):null)?e:t.Z=e}var B=class{constructor(t,e){if(P(e),this.Z=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}wa(){const t=D(this);return t?new Uint8Array(t):O()}};function N(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function G(){return Error("Failed to read varint, encoding is invalid.")}function j(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function V(t){return 0==t.length?U():new B(t,I)}function X(t){if("string"==typeof t)return{buffer:R(t),L:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),L:!1};if(t.constructor===Uint8Array)return{buffer:t,L:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),L:!1};if(t.constructor===B)return{buffer:D(t)||O(),L:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),L:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function z(){return"function"==typeof BigInt}var W=!f;let H=!f;const Y="function"==typeof Uint8Array.prototype.slice;let K,$=0,q=0;function J(t){const e=0>t;let n=(t=Math.abs(t))>>>0;if(t=Math.floor((t-n)/4294967296),e){const[e,r]=st(n,t);t=r,n=e}$=n>>>0,q=t>>>0}function Z(t){const e=K||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),q=0,$=e.getUint32(0,!0)}function Q(t,e){return 4294967296*e+(t>>>0)}function tt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Q(t,e),n?-t:t}function et(t,e){if(t>>>=0,2097151>=(e>>>=0))var n=""+(4294967296*e+t);else z()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,1e7<=t&&(n+=Math.floor(t/1e7),t%=1e7),1e7<=n&&(e+=Math.floor(n/1e7),n%=1e7),n=e+nt(n)+nt(t));return n}function nt(t){return t=String(t),"0000000".slice(t.length)+t}function rt(){var t=$,e=q;if(2147483648&e)if(z())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=st(t,e);t="-"+et(n,r)}else t=et(t,e);return t}function it(t){if(16>t.length)J(Number(t));else if(z())t=BigInt(t),$=Number(t&BigInt(4294967295))>>>0,q=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);q=$=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const e=Number(t.slice(r,i));q*=1e6,$=1e6*$+e,4294967296<=$&&(q+=Math.trunc($/4294967296),q>>>=0,$>>>=0)}if(e){const[t,e]=st($,q);$=t,q=e}}}function st(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function ot(t,e){let n,r=0,i=0,s=0;const o=t.h;let a=t.g;do{n=o[a++],r|=(127&n)<<s,s+=7}while(32>s&&128&n);for(32<s&&(i|=(127&n)>>4),s=3;32>s&&128&n;s+=7)n=o[a++],i|=(127&n)<<s;if(pt(t,a),128>n)return e(r>>>0,i>>>0);throw G()}function at(t){let e=0,n=t.g;const r=n+10,i=t.h;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return pt(t,n),!!(127&e)}throw G()}function ct(t){const e=t.h;let n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw G();return pt(t,n),i}function ht(t){return ct(t)>>>0}function ut(t){var e=t.h;const n=t.g,r=e[n],i=e[n+1],s=e[n+2];return e=e[n+3],pt(t,t.g+4),(r<<0|i<<8|s<<16|e<<24)>>>0}function lt(t){var e=ut(t);t=2*(e>>31)+1;const n=e>>>23&255;return e&=8388607,255==n?e?NaN:1/0*t:0==n?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))}function ft(t){return ct(t)}function dt(t,e,{aa:n=!1}={}){t.aa=n,e&&(e=X(e),t.h=e.buffer,t.m=e.L,t.j=0,t.l=t.h.length,t.g=t.j)}function pt(t,e){if(t.g=e,e>t.l)throw j(t.l,e)}function gt(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.l)throw j(e,t.l-n);return t.g=r,n}function mt(t,e){if(0==e)return U();var n=gt(t,e);return t.aa&&t.m?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?O():Y?t.slice(n,e):new Uint8Array(t.subarray(n,e))),V(n)}var yt=[];function vt(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var n=ht(t.g);if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw N(n,t.l);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=n,!0}function _t(t){switch(t.h){case 0:0!=t.h?_t(t):at(t.g);break;case 1:pt(t=t.g,t.g+8);break;case 2:if(2!=t.h)_t(t);else{var e=ht(t.g);pt(t=t.g,t.g+e)}break;case 5:pt(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!vt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.m!=e)throw Error("Unmatched end-group tag");break}_t(t)}break;default:throw N(t.h,t.l)}}function wt(t,e,n){const r=t.g.l,i=ht(t.g),s=t.g.g+i;let o=s-r;if(0>=o&&(t.g.l=s,n(e,t,void 0,void 0,void 0),o=s-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=s,t.g.l=r,e}function Tt(t){var e=ht(t.g),a=gt(t=t.g,e);if(t=t.h,o){var c,h=t;(c=s)||(c=s=new TextDecoder("utf-8",{fatal:!0})),e=a+e,h=0===a&&e===h.length?h:h.subarray(a,e);try{var u=c.decode(h)}catch(t){if(void 0===i){try{c.decode(new Uint8Array([128]))}catch(t){}try{c.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(s=void 0),t}}else{e=(u=a)+e,a=[];let i,s=null;for(;u<e;){var l=t[u++];128>l?a.push(l):224>l?u>=e?n():(i=t[u++],194>l||128!=(192&i)?(u--,n()):a.push((31&l)<<6|63&i)):240>l?u>=e-1?n():(i=t[u++],128!=(192&i)||224===l&&160>i||237===l&&160<=i||128!=(192&(c=t[u++]))?(u--,n()):a.push((15&l)<<12|(63&i)<<6|63&c)):244>=l?u>=e-2?n():(i=t[u++],128!=(192&i)||0!=i-144+(l<<28)>>30||128!=(192&(c=t[u++]))||128!=(192&(h=t[u++]))?(u--,n()):(l=(7&l)<<18|(63&i)<<12|(63&c)<<6|63&h,l-=65536,a.push(55296+(l>>10&1023),56320+(1023&l)))):n(),8192<=a.length&&(s=r(s,a),a.length=0)}u=r(s,a)}return u}function Et(t){const e=ht(t.g);return mt(t.g,e)}function bt(t,e,n){var r=ht(t.g);for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var At=[];function xt(t){return t?/^\d+$/.test(t)?(it(t),new kt($,q)):null:St||=new kt(0,0)}var kt=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let St;function Lt(t){return t?/^-?\d+$/.test(t)?(it(t),new Rt($,q)):null:Ft||=new Rt(0,0)}var Rt=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Ft;function Mt(t,e,n){for(;0<n||127<e;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Ot(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function It(t,e){if(0<=e)Ot(t,e);else{for(let n=0;9>n;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Ct(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Pt(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function Ut(t,e,n){Ot(t.g,8*e+n)}function Dt(t,e){return Ut(t,e,2),e=t.g.end(),Pt(t,e),e.push(t.h),e}function Bt(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;127<n;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function Nt(t,e,n){Ut(t,e,2),Ot(t.g,n.length),Pt(t,t.g.end()),Pt(t,n)}function Gt(t,e,n,r){null!=n&&(e=Dt(t,e),r(n,t),Bt(t,e))}class jt{constructor(t,e,n,r){this.g=t,this.h=e,this.l=n,this.qa=r}}function Vt(t){return Array.prototype.slice.call(t)}function Xt(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var zt=Xt(),Wt=Xt("0di"),Ht=zt?(t,e)=>{t[zt]|=e}:(t,e)=>{void 0!==t.D?t.D|=e:Object.defineProperties(t,{D:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Yt(t){const e=qt(t);1!=(1&e)&&(Object.isFrozen(t)&&(t=Vt(t)),Zt(t,1|e))}var Kt=zt?(t,e)=>{t[zt]&=~e}:(t,e)=>{void 0!==t.D&&(t.D&=~e)};function $t(t,e,n){return n?t|e:t&~e}var qt=zt?t=>0|t[zt]:t=>0|t.D,Jt=zt?t=>t[zt]:t=>t.D,Zt=zt?(t,e)=>{t[zt]=e}:(t,e)=>{void 0!==t.D?t.D=e:Object.defineProperties(t,{D:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Qt(){var t=[];return Ht(t,1),t}function te(t){return Ht(t,34),t}function ee(t,e){Zt(e,-14591&(0|t))}function ne(t,e){Zt(e,-14557&(34|t))}function re(t){return 0===(t=t>>14&1023)?536870912:t}var ie={},se={};function oe(t){return!(!t||"object"!=typeof t||t.Na!==se)}function ae(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}let ce=!f;function he(t,e,n){if(null!=t)if("string"==typeof t)t=t?new B(t,I):U();else if(t.constructor!==B)if(F(t))t=n?V(t):t.length?new B(new Uint8Array(t),I):U();else{if(!e)throw Error();t=void 0}return t}function ue(t,e,n){if(!Array.isArray(t)||t.length)return!1;const r=qt(t);return!!(1&r)||!(!e||!(Array.isArray(e)?e.includes(n):e.has(n)))&&(Zt(t,1|r),!0)}var le;const fe=[];function de(t){if(2&t)throw Error()}Zt(fe,55),le=Object.freeze(fe);class pe{constructor(t,e,n){this.l=0,this.g=t,this.h=e,this.m=n}next(){if(this.l<this.g.length){const t=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,t):t}}return{done:!0,value:void 0}}[Symbol.iterator](){return new pe(this.g,this.h,this.m)}}var ge={};let me,ye;function ve(t,e){(e=me?e[me]:void 0)&&(t[me]=Vt(e))}function _e(t){return(t=Error(t)).__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity="warning",t}function we(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Te(t){return null==t||"boolean"==typeof t?t:"number"==typeof t?!!t:void 0}Object.freeze(new class{}),Object.freeze(new class{});const Ee=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function be(t){const e=typeof t;return"number"===e?Number.isFinite(t):"string"===e&&Ee.test(t)}function Ae(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function xe(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?t>>>0:void 0}function ke(t){return"-"!==t[0]&&(20>t.length||20===t.length&&184467>Number(t.substring(0,6)))}function Se(t){return"-"===t[0]?20>t.length||20===t.length&&-922337<Number(t.substring(0,7)):19>t.length||19===t.length&&922337>Number(t.substring(0,6))}function Le(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(J(t),t=tt($,q)),t}function Re(t){var e=Math.trunc(Number(t));return Number.isSafeInteger(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Se(t)||(it(t),t=rt()),t)}function Fe(t){return null==t?t:be(t)?"number"==typeof t?Le(t):Re(t):void 0}function Me(t){if("string"!=typeof t)throw Error();return t}function Oe(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Ie(t){return null==t||"string"==typeof t?t:void 0}function Ce(t,e,n,r){if(null!=t&&"object"==typeof t&&t.W===ie)return t;if(!Array.isArray(t))return n?2&r?(t=e[Wt])?e=t:(te((t=new e).s),e=e[Wt]=t):e=new e:e=void 0,e;let i=n=qt(t);return 0===i&&(i|=32&r),i|=2&r,i!==n&&Zt(t,i),new e(t)}function Pe(t,e,n){if(e){var r=!!r;if(!be(e=t))throw _e("int64");"string"==typeof e?r=Re(e):r?(r=Math.trunc(e),Number.isSafeInteger(r)?r=String(r):Se(e=String(r))?r=e:(J(r),r=rt())):r=Le(e)}else r=Fe(t);return"string"==typeof(n=null==(t=r)?n?0:void 0:t)&&(r=+n,Number.isSafeInteger(r))?r:n}let Ue,De,Be;function Ne(t){switch(typeof t){case"boolean":return De||=[0,void 0,!0];case"number":return 0<t?void 0:0===t?Be||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function Ge(t,e){return je(t,e[0],e[1])}function je(t,e,n){if(null==t&&(t=Ue),Ue=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-16760833&r|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error();if(64&(r=qt(t)))return ye&&delete t[ye],t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error();t:{const i=(n=t).length;if(i){const t=i-1;if(ae(n[t])){if(1024<=(e=t-(+!!(512&(r|=256))-1)))throw Error();r=-16760833&r|(1023&e)<<14;break t}}if(e){if(1024<(e=Math.max(e,i-(+!!(512&r)-1))))throw Error();r=-16760833&r|(1023&e)<<14}}}return Zt(t,r),t}let Ve=function(){try{return new class extends Map{constructor(){super()}},!1}catch{return!0}}();class Xe{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,e){return this.g.set(t,e),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,e){return this.g.forEach(t,e)}[Symbol.iterator](){return this.entries()}}const ze=Ve?(Object.setPrototypeOf(Xe.prototype,Map.prototype),Object.defineProperties(Xe.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Xe):class extends Map{constructor(){super()}};function We(t){return t}function He(t){if(2&t.O)throw Error("Cannot mutate an immutable Map")}var Ye=class extends ze{constructor(t,e,n=We,r=We){super();let i=qt(t);i|=64,Zt(t,i),this.O=i,this.V=e,this.R=n||We,this.Y=this.V?Ke:r||We;for(let s=0;s<t.length;s++){const o=t[s],a=n(o[0],!1,!0);let c=o[1];e?void 0===c&&(c=null):c=r(o[1],!1,!0,void 0,void 0,i),super.set(a,c)}}pa(t=$e){return this.X(t)}X(t=$e){const e=[],n=super.entries();for(var r;!(r=n.next()).done;)(r=r.value)[0]=t(r[0]),r[1]=t(r[1]),e.push(r);return e}clear(){He(this),super.clear()}delete(t){return He(this),super.delete(this.R(t,!0,!1))}entries(){var t=this.ma();return new pe(t,qe,this)}keys(){return this.Ma()}values(){var t=this.ma();return new pe(t,Ye.prototype.get,this)}forEach(t,e){super.forEach(((n,r)=>{t.call(e,this.get(r),r,this)}))}set(t,e){return He(this),null==(t=this.R(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.Y(e,!0,!0,this.V,!1,this.O))}Ta(t){const e=this.R(t[0],!1,!0);t=t[1],t=this.V?void 0===t?null:t:this.Y(t,!1,!0,void 0,!1,this.O),super.set(e,t)}has(t){return super.has(this.R(t,!1,!1))}get(t){t=this.R(t,!1,!1);const e=super.get(t);if(void 0!==e){var n=this.V;return n?((n=this.Y(e,!1,!0,n,this.xa,this.O))!==e&&super.set(t,n),n):e}}ma(){return Array.from(super.keys())}Ma(){return super.keys()}[Symbol.iterator](){return this.entries()}};function Ke(t,e,n,r,i,s){return t=Ce(t,r,n,s),i&&(t=sn(t)),t}function $e(t){return t}function qe(t){return[t,this.get(t)]}function Je(t,e,n,r,i,s){if(null!=t){if(Array.isArray(t))t=i&&0==t.length&&1&qt(t)?void 0:s&&2&qt(t)?t:Ze(t,e,n,void 0!==r,i,s);else if(ae(t)){const o={};for(let a in t)o[a]=Je(t[a],e,n,r,i,s);t=o}else t=e(t,r);return t}}function Ze(t,e,n,r,i,s){const o=r||n?qt(t):0;r=r?!!(32&o):void 0;const a=Vt(t);for(let t=0;t<a.length;t++)a[t]=Je(a[t],e,n,r,i,s);return n&&(ve(a,t),n(o,a)),a}function Qe(t){return Je(t,tn,void 0,void 0,!1,!1)}function tn(t){return t.W===ie?t.toJSON():t instanceof Ye?t.pa(Qe):function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t){if(Array.isArray(t))return ce||!ue(t,void 0,9999)?t:void 0;if(F(t))return x(t);if(t instanceof B){const e=t.Z;return null==e?"":"string"==typeof e?e:t.Z=x(e)}if(t instanceof Ye)return t=t.pa(),W||0!==t.length?t:void 0}}return t}(t)}function en(t,e,n=ne){if(null!=t){if(b&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=qt(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(Zt(t,-12293&(34|r)),t):Ze(t,en,4&r?ne:n,!0,!1,!0))}return t.W===ie?(n=t.s,t=2&(r=Jt(n))?t:nn(t,n,r,!0)):t instanceof Ye&&(n=te(t.X(en)),t=new Ye(n,t.V,t.R,t.Y)),t}}function nn(t,e,n,r){return t=t.constructor,Ue=e=rn(e,n,r),e=new t(e),Ue=void 0,e}function rn(t,e,n){const r=n||2&e?ne:ee,i=!!(32&e);return t=function(t,e,n){const r=Vt(t);var i=r.length;const s=256&e?r[i-1]:void 0;for(i+=s?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(s){e=r[e]={};for(const t in s)e[t]=n(s[t])}return ve(r,t),r}(t,e,(t=>en(t,i,r))),Ht(t,32|(n?2:0)),t}function sn(t){const e=t.s,n=Jt(e);return 2&n?nn(t,e,n,!1):t}function on(t,e){return an(t=t.s,Jt(t),e)}function an(t,e,n,r){if(-1===n)return null;if(n>=re(e)){if(256&e)return t[t.length-1][n]}else{var i=t.length;if(r&&256&e&&null!=(r=t[i-1][n]))return r;if((e=n+(+!!(512&e)-1))<i)return t[e]}}function cn(t,e,n,r){const i=t.s;let s=Jt(i);return de(s),hn(i,s,e,n,r),t}function hn(t,e,n,r,i){var s=re(e);if(n>=s||i){if(i=e,256&e)s=t[t.length-1];else{if(null==r)return i;s=t[s+(+!!(512&e)-1)]={},i|=256}return s[n]=r,i!==e&&Zt(t,i),i}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function un(t,e,n,r,i){var s=2&e;let o=an(t,e,n,i);Array.isArray(o)||(o=le);const a=!(2&r);r=!(1&r);const c=!!(32&e);let h=qt(o);return 0!==h||!c||s||a?1&h||(h|=1,Zt(o,h)):(h|=33,Zt(o,h)),s?(t=!1,2&h||(te(o),t=!!(4&h)),(r||t)&&Object.freeze(o)):(s=!!(2&h)||!!(2048&h),r&&s?(o=Vt(o),r=1,c&&!a&&(r|=32),Zt(o,r),hn(t,e,n,o,i)):a&&32&h&&!s&&Kt(o,32)),o}function ln(t,e){t=t.s;let n=Jt(t);const r=an(t,n,e),i=we(r);return null!=i&&i!==r&&hn(t,n,e,i),i}function fn(t){t=t.s;let e=Jt(t);const n=an(t,e,1),r=he(n,!0,!!(34&e));return null!=r&&r!==n&&hn(t,e,1,r),r}function dn(t,e,n){t=t.s;let r=Jt(t);const i=2&r?1:2;let s=un(t,r,e,1);r=Jt(t);let o=qt(s),a=o,c=!!(2&o);var h=!!(4&o);const u=c&&h;if(!(4&o)){(h||Object.isFrozen(s))&&(s=Vt(s),a=0,o=Rn(o,r,!1),c=!!(2&o),r=hn(t,r,e,s));let i=h=0;for(;h<s.length;h++){const t=n(s[h]);null!=t&&(s[i++]=t)}i<h&&(s.length=i),n=$t(o,4096,!1),o=n=$t(n,8192,!1),o=$t(o,20,!0)}return u||((n=1===i)&&(o=$t(o,2,!0)),o!==a&&Zt(s,o),(n||c)&&Object.freeze(s)),2===i&&c&&(s=Vt(s),o=Rn(o,r,!1),Zt(s,o),hn(t,r,e,s)),s}let pn;function gn(){return pn??=new Ye(te([]),void 0,void 0,void 0,ge)}function mn(t){t=Vt(t);for(let e=0;e<t.length;e++){const n=t[e]=Vt(t[e]);Array.isArray(n[1])&&(n[1]=te(n[1]))}return t}function yn(t,e,n){{const o=t.s;let a=Jt(o);if(de(a),null==n)hn(o,a,e);else{var r,i=t=qt(n),s=!!(2&t)||Object.isFrozen(n);if((r=!s)&&(r=!1),!(4&t))for(t=21,s&&(n=Vt(n),i=0,t=Rn(t,a,!0)),s=0;s<n.length;s++)n[s]=Me(n[s]);r&&(n=Vt(n),i=0,t=Rn(t,a,!0)),t!==i&&Zt(n,t),hn(o,a,e,n)}}}function vn(t,e,n,r){const i=Jt(t);de(i),t=un(t,i,e,2),r=n(r,!!(4&(e=qt(t)))&&!!(4096&e)),t.push(r)}function _n(t){return t}function wn(t,e){return Tn(t=t.s,Jt(t),ls)===e?e:-1}function Tn(t,e,n){let r=0;for(let i=0;i<n.length;i++){const s=n[i];null!=an(t,e,s)&&(0!==r&&(e=hn(t,e,r)),r=s)}return r}function En(t,e,n,r){let i=Jt(t);de(i);const s=an(t,i,n,r);let o;if(null!=s&&s.W===ie)return(e=sn(s))!==s&&hn(t,i,n,e,r),e.s;if(Array.isArray(s)){const t=qt(s);o=2&t?rn(s,t,!1):s,o=Ge(o,e)}else o=Ge(void 0,e);return o!==s&&hn(t,i,n,o,r),o}function bn(t,e,n,r){t=t.s;let i=Jt(t);const s=an(t,i,n,r);return(e=Ce(s,e,!1,i))!==s&&null!=e&&hn(t,i,n,e,r),e}function An(t,e,n,r=!1){if(null==(e=bn(t,e,n,r)))return e;t=t.s;let i=Jt(t);if(!(2&i)){const s=sn(e);s!==e&&hn(t,i,n,e=s,r)}return e}function xn(t,e,n,r,i,s){var o=2&e?1:2;const a=1===o;o=2===o,i=!!i;let c=un(t,e,r,3);e=Jt(t);var h=qt(c),u=!!(2&h);const l=!!(4&h),f=!!(32&h);let d=u&&l||!!(2048&h);if(!l){var p=c,g=e;const t=!!(2&h);t&&(g=$t(g,2,!0));let r=!t,i=!0,s=0,o=0;for(;s<p.length;s++){const e=Ce(p[s],n,!1,g);if(e instanceof n){if(!t){const t=!!(2&qt(e.s));r&&=!t,i&&=t}p[o++]=e}}o<s&&(p.length=o),h=$t(h,4,!0),h=$t(h,16,i),h=$t(h,8,r),Zt(p,h),u&&(Object.freeze(c),d=!0)}if(n=h,u=!!(8&h)||a&&!c.length,s&&!u){for(d&&(c=Vt(c),d=!1,n=0,h=Rn(h,e,i),e=hn(t,e,r,c)),s=c,u=h,p=0;p<s.length;p++)(h=s[p])!==(g=sn(h))&&(s[p]=g);u=$t(u,8,!0),h=u=$t(u,16,!s.length)}return d||(a?h=$t(h,!c.length||16&h&&(!l||f)?2:2048,!0):i||(h=$t(h,32,!1)),h!==n&&Zt(c,h),a&&(Object.freeze(c),d=!0)),o&&d&&(c=Vt(c),h=Rn(h,e,i),Zt(c,h),hn(t,e,r,c)),c}function kn(t,e,n){t=t.s;const r=Jt(t);return xn(t,r,e,n,!1,!(2&r))}function Sn(t,e,n,r,i){return null==r&&(r=void 0),cn(t,n,r,i)}function Ln(t,e,n,r){null==r&&(r=void 0),t=t.s;let i=Jt(t);de(i),(n=Tn(t,i,n))&&n!==e&&null!=r&&(i=hn(t,i,n)),hn(t,i,e,r)}function Rn(t,e,n){return t=$t(t,2,!!(2&e)),t=$t(t,32,!!(32&e)&&n),$t(t,2048,!1)}function Fn(t,e,n){t=t.s;const r=Jt(t);de(r),t=xn(t,r,e,1,!0),e=null!=n?n:new e,t.push(e),2&qt(e.s)?Kt(t,8):Kt(t,16)}function Mn(t,e){return Ae(on(t,e))}function On(t,e){return Ie(on(t,e))}function In(t){return t??0}function Cn(t,e){return In(ln(t,e))}function Pn(t,e,n){if(null!=n&&"boolean"!=typeof n)throw t=typeof n,Error(`Expected boolean but got ${"object"!=t?t:n?Array.isArray(n)?"array":t:"null"}: ${n}`);cn(t,e,n)}function Un(t,e,n){if(null!=n){if("number"!=typeof n)throw _e("int32");if(!Number.isFinite(n))throw _e("int32");n|=0}cn(t,e,n)}function Dn(t,e,n){if(null!=n&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);cn(t,e,n)}function Bn(t,e,n){e.g?e.m(t,e.g,e.h,n,!0):e.m(t,e.h,n,!0)}Ye.prototype.toJSON=void 0,Ye.prototype.Na=se;var Nn=class{constructor(t,e){this.s=je(t,e)}toJSON(){return Gn(this,Ze(this.s,tn,void 0,void 0,!1,!1),!0)}l(){var t=ao;return t.g?t.l(this,t.g,t.h,!0):t.l(this,t.h,t.defaultValue,!0)}clone(){const t=this.s;return nn(this,t,Jt(t),!1)}L(){return!!(2&qt(this.s))}};function Gn(t,e,n){const r=t.constructor.A;var i=Jt(n?t.s:e),s=re(i),o=!1;if(r&&ce){if(!n){var a;if((e=Vt(e)).length&&ae(a=e[e.length-1]))for(o=0;o<r.length;o++)if(r[o]>=s){Object.assign(e[e.length-1]={},a);break}o=!0}var c;s=e,n=!n,t=re(a=Jt(t.s)),a=+!!(512&a)-1;for(let e=0;e<r.length;e++){var h=r[e];if(h<t){var u=s[h+=a];null==u?s[h]=n?le:Qt():n&&u!==le&&Yt(u)}else{if(!c){var l=void 0;s.length&&ae(l=s[s.length-1])?c=l:s.push(c={})}u=c[h],null==c[h]?c[h]=n?le:Qt():n&&u!==le&&Yt(u)}}}if(!(c=e.length))return e;let f,d;if(ae(l=e[c-1])){t:{var p=l;for(var g in s={},n=!1,p)t=p[g],Array.isArray(t)&&(a=t,(!H&&ue(t,r,+g)||!W&&oe(t)&&0===t.size)&&(t=null),t!=a&&(n=!0)),null!=t?s[g]=t:n=!0;if(n){for(let t in s){p=s;break t}p=null}}p!=l&&(f=!0),c--}for(i=+!!(512&i)-1;0<c&&(null==(l=e[g=c-1])||!H&&ue(l,r,g-i)||!W&&oe(l)&&0===l.size);c--)d=!0;return f||d?(e=o?e:Array.prototype.slice.call(e,0,c),o&&(e.length=c),p&&e.push(p),e):e}function jn(t){return Array.isArray(t)?t[0]instanceof jt?t:[Gr,t]:[t,void 0]}function Vn(t,e){if(Array.isArray(e)){var n=qt(e);if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),Zt(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}Nn.prototype.W=ie,Nn.prototype.toString=function(){return Gn(this,this.s,!1).toString()};const Xn=Symbol();function zn(t){let e=t[Xn];if(!e){const n=Jn(t),r=hr(t),i=r.g;e=i?(t,e)=>i(t,e,r):(t,e)=>{for(;vt(e)&&4!=e.h;){var i=e.m,s=r[i];if(!s){var o=r.ha;o&&(o=o[i])&&(s=r[i]=Wn(o))}s&&s(e,t,i)||(i=(s=e).l,_t(s),s.ga?s=void 0:(o=s.g.g-i,s.g.g=i,s=mt(s.g,o)),i=t,s&&(me||=Symbol(),(o=i[me])?o.push(s):i[me]=[s]))}n===Hn||n===Yn||n.Oa||(t[ye||=Symbol()]=n)},t[Xn]=e}return e}function Wn(t){const e=(t=jn(t))[0].g;if(t=t[1]){const n=zn(t),r=hr(t).S;return(t,i,s)=>e(t,i,s,r,n)}return e}let Hn,Yn;const Kn=Symbol();function $n(t,e,n){const r=n[1];let i;if(r){const n=r[Kn];i=n?n.S:Ne(r[0]),t[e]=n??r}i&&i===De?(t.na||(t.na=[])).push(e):n[0]&&(t.oa||(t.oa=[])).push(e)}function qn(t,e){return[t.l,!e||0<e[0]?void 0:e]}function Jn(t){var e=t[Kn];if(e)return e;if(!(e=Qn(t,t[Kn]={},qn,qn,$n)).oa&&!e.na){let n=!0;for(let t in e){isNaN(t)||(n=!1);break}n?(e=Ne(t[0])===De,e=t[Kn]=e?Yn||={S:Ne(!0)}:Hn||={}):e.Oa=!0}return e}function Zn(t,e,n){t[e]=n}function Qn(t,e,n,r,i=Zn){e.S=Ne(t[0]);let s=0;var o=t[++s];o&&o.constructor===Object&&(e.ha=o,"function"==typeof(o=t[++s])&&(e.g=o,e.h=t[++s],o=t[++s]));const a={};for(;Array.isArray(o)&&"number"==typeof o[0]&&0<o[0];){for(var c=0;c<o.length;c++)a[o[c]]=o;o=t[++s]}for(c=1;void 0!==o;){let l;"number"==typeof o&&(c+=o,o=t[++s]);var h=void 0;if(o instanceof jt?l=o:(l=jr,s--),l.qa){o=t[++s],h=t;var u=s;"function"==typeof o&&(o=o(),h[u]=o),h=o}for(u=c+1,"number"==typeof(o=t[++s])&&0>o&&(u-=o,o=t[++s]);c<u;c++){const t=a[c];i(e,c,h?r(l,h,t):n(l,t))}}return e}const tr=Symbol();function er(t){let e=t[tr];if(!e){const n=sr(t);e=(t,e)=>lr(t,e,n),t[tr]=e}return e}const nr=Symbol();function rr(t){return t.h}function ir(t,e){let n,r;const i=t.h;return(t,s,o)=>i(t,s,o,r||=sr(e).S,n||=er(e))}function sr(t){let e=t[nr];return e||(e=Qn(t,t[nr]={},rr,ir),or in t&&nr in t&&(t.length=0),e)}const or=Symbol();function ar(t,e){const n=t.g;return e?(t,r,i)=>n(t,r,i,e):n}function cr(t,e,n){const r=t.g;let i,s;return(t,o,a)=>r(t,o,a,s||=hr(e).S,i||=zn(e),n)}function hr(t){let e=t[or];return e||(Jn(t),e=Qn(t,t[or]={},ar,cr),or in t&&nr in t&&(t.length=0),e)}function ur(t,e){var n=t[e];if(n)return n;if((n=t.ha)&&(n=n[e])){var r=(n=jn(n))[0].h;if(n=n[1]){const e=er(n),i=sr(n).S;n=(n=t.h)?n(i,e):(t,n,s)=>r(t,n,s,i,e)}else n=r;return t[e]=n}}function lr(t,e,n){for(var r=Jt(t),i=+!!(512&r)-1,s=t.length,o=512&r?1:0,a=s+(256&r?-1:0);o<a;o++){const r=t[o];if(null==r)continue;const s=o-i,a=ur(n,s);a&&a(e,r,s)}if(256&r){r=t[s-1];for(let t in r)i=+t,Number.isNaN(i)||null!=(s=r[t])&&(a=ur(n,i))&&a(e,s,i)}if(t=me?t[me]:void 0)for(Pt(e,e.g.end()),n=0;n<t.length;n++)Pt(e,D(t[n])||O())}function fr(t,e){return new jt(t,e,!1,!1)}function dr(t,e){return new jt(t,e,!0,!1)}function pr(t,e){return new jt(t,e,!1,!0)}function gr(t,e,n){hn(t,Jt(t),e,n)}var mr=pr((function(t,e,n,r,i){return 2===t.h&&(t=wt(t,Ge([void 0,void 0],r),i),de(r=Jt(e)),(i=an(e,r,n))instanceof Ye?0!=(2&i.O)?((i=i.X()).push(t),hn(e,r,n,i)):i.Ta(t):Array.isArray(i)?(2&qt(i)&&hn(e,r,n,i=mn(i)),i.push(t)):hn(e,r,n,[t]),!0)}),(function(t,e,n,r,i){if(e instanceof Ye)e.forEach(((e,s)=>{Gt(t,n,Ge([s,e],r),i)}));else if(Array.isArray(e))for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&Gt(t,n,Ge(o,r),i)}}));function yr(t,e,n){t:if(null!=e){if(be(e)){if("string"==typeof e){e=Re(e);break t}if("number"==typeof e){e=Le(e);break t}}e=void 0}null!=e&&("string"==typeof e&&Lt(e),null!=e&&(Ut(t,n,0),"number"==typeof e?(t=t.g,J(e),Mt(t,$,q)):(n=Lt(e),Mt(t.g,n.h,n.g))))}function vr(t,e,n){null!=(e=Ae(e))&&null!=e&&(Ut(t,n,0),It(t.g,e))}function _r(t,e,n){null!=(e=Te(e))&&(Ut(t,n,0),t.g.g.push(e?1:0))}function wr(t,e,n){null!=(e=Ie(e))&&Nt(t,n,h(e))}function Tr(t,e,n,r,i){Gt(t,n,e instanceof Nn?e.s:Array.isArray(e)?Ge(e,r):void 0,i)}function Er(t,e,n){null!=(e=null==e||"string"==typeof e||F(e)||e instanceof B?e:void 0)&&Nt(t,n,X(e).buffer)}function br(t,e,n){return(5===t.h||2===t.h)&&(e=un(e,Jt(e),n,2,!1),2==t.h?bt(t,lt,e):e.push(lt(t.g)),!0)}var Ar,xr=fr((function(t,e,n){if(1!==t.h)return!1;var r=t.g;t=ut(r);const i=ut(r);r=2*(i>>31)+1;const s=i>>>20&2047;return t=4294967296*(1048575&i)+t,gr(e,n,2047==s?t?NaN:1/0*r:0==s?r*Math.pow(2,-1074)*t:r*Math.pow(2,s-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=we(e))&&(Ut(t,n,1),t=t.g,(n=K||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),$=n.getUint32(0,!0),q=n.getUint32(4,!0),Ct(t,$),Ct(t,q))})),kr=fr((function(t,e,n){return 5===t.h&&(gr(e,n,lt(t.g)),!0)}),(function(t,e,n){null!=(e=we(e))&&(Ut(t,n,5),t=t.g,Z(e),Ct(t,$))})),Sr=dr(br,(function(t,e,n){if(null!=(e=Vn(we,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(Ut(r,i,5),r=r.g,Z(s),Ct(r,$))}})),Lr=dr(br,(function(t,e,n){if(null!=(e=Vn(we,e))&&e.length){Ut(t,n,2),Ot(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Z(e[r]),Ct(n,$)}})),Rr=fr((function(t,e,n){return 0===t.h&&(gr(e,n,ot(t.g,tt)),!0)}),yr),Fr=fr((function(t,e,n){return 0===t.h&&(gr(e,n,0===(t=ot(t.g,tt))?void 0:t),!0)}),yr),Mr=fr((function(t,e,n){return 0===t.h&&(gr(e,n,ot(t.g,Q)),!0)}),(function(t,e,n){t:if(null!=e){if(be(e)){if("string"==typeof e){var r=Math.trunc(Number(e));Number.isSafeInteger(r)&&0<=r?e=String(r):(-1!==(r=e.indexOf("."))&&(e=e.substring(0,r)),ke(e)||(it(e),e=et($,q)));break t}if("number"==typeof e){e=0<=(e=Math.trunc(e))&&Number.isSafeInteger(e)?e:function(t){if(0>t){J(t);const e=et($,q);return t=Number(e),Number.isSafeInteger(t)?t:e}return ke(String(t))?t:(J(t),Q($,q))}(e);break t}}e=void 0}null!=e&&("string"==typeof e&&xt(e),null!=e&&(Ut(t,n,0),"number"==typeof e?(t=t.g,J(e),Mt(t,$,q)):(n=xt(e),Mt(t.g,n.h,n.g))))})),Or=fr((function(t,e,n){return 0===t.h&&(gr(e,n,ct(t.g)),!0)}),vr),Ir=dr((function(t,e,n){return(0===t.h||2===t.h)&&(e=un(e,Jt(e),n,2,!1),2==t.h?bt(t,ct,e):e.push(ct(t.g)),!0)}),(function(t,e,n){if(null!=(e=Vn(Ae,e))&&e.length){n=Dt(t,n);for(let n=0;n<e.length;n++)It(t.g,e[n]);Bt(t,n)}})),Cr=fr((function(t,e,n){return 0===t.h&&(gr(e,n,0===(t=ct(t.g))?void 0:t),!0)}),vr),Pr=fr((function(t,e,n){return 0===t.h&&(gr(e,n,at(t.g)),!0)}),_r),Ur=fr((function(t,e,n){return 0===t.h&&(gr(e,n,!1===(t=at(t.g))?void 0:t),!0)}),_r),Dr=dr((function(t,e,n){return 2===t.h&&(vn(e,n,_n,t=Tt(t)),!0)}),(function(t,e,n){if(null!=(e=Vn(Ie,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&Nt(r,i,h(s))}})),Br=fr((function(t,e,n){return 2===t.h&&(gr(e,n,""===(t=Tt(t))?void 0:t),!0)}),wr),Nr=fr((function(t,e,n){return 2===t.h&&(gr(e,n,Tt(t)),!0)}),wr),Gr=pr((function(t,e,n,r,i){return 2===t.h&&(wt(t,En(e,r,n,!0),i),!0)}),Tr),jr=pr((function(t,e,n,r,i){return 2===t.h&&(wt(t,En(e,r,n),i),!0)}),Tr);Ar=new jt((function(t,e,n,r,i){if(2!==t.h)return!1;r=Ge(void 0,r);let s=Jt(e);de(s);let o=un(e,s,n,3);return s=Jt(e),4&qt(o)&&(o=Vt(o),Zt(o,-2079&(1|qt(o))),hn(e,s,n,o)),o.push(r),wt(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let s=0;s<e.length;s++)Tr(t,e[s],n,r,i)}),!0,!0);var Vr=pr((function(t,e,n,r,i,s){if(2!==t.h)return!1;let o=Jt(e);return de(o),(s=Tn(e,o,s))&&n!==s&&hn(e,o,s),wt(t,e=En(e,r,n),i),!0}),Tr),Xr=fr((function(t,e,n){return 2===t.h&&(gr(e,n,Et(t)),!0)}),Er),zr=dr((function(t,e,n){return(0===t.h||2===t.h)&&(e=un(e,Jt(e),n,2,!1),2==t.h?bt(t,ht,e):e.push(ht(t.g)),!0)}),(function(t,e,n){if(null!=(e=Vn(xe,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(Ut(r,i,0),Ot(r.g,s))}})),Wr=fr((function(t,e,n){return 0===t.h&&(gr(e,n,ct(t.g)),!0)}),(function(t,e,n){null!=(e=Ae(e))&&(e=parseInt(e,10),Ut(t,n,0),It(t.g,e))})),Hr=dr((function(t,e,n){return(0===t.h||2===t.h)&&(e=un(e,Jt(e),n,2,!1),2==t.h?bt(t,ft,e):e.push(ct(t.g)),!0)}),(function(t,e,n){if(null!=(e=Vn(Ae,e))&&e.length){n=Dt(t,n);for(let n=0;n<e.length;n++)It(t.g,e[n]);Bt(t,n)}}));class Yr{constructor(t,e){this.h=t,this.g=e,this.l=An,this.m=Sn,this.defaultValue=void 0}}function Kr(t,e){return new Yr(t,e)}function $r(t,e){return(n,r)=>{t:{if(At.length){const t=At.pop();t.o(r),dt(t.g,n,r),n=t}else n=new class{constructor(t,e){if(yt.length){const n=yt.pop();dt(n,t,e),t=n}else t=new class{constructor(t,e){this.h=null,this.m=!1,this.g=this.l=this.j=0,dt(this,t,e)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(t,e);this.g=t,this.l=this.g.g,this.h=this.m=-1,this.o(e)}o({ga:t=!1}={}){this.ga=t}}(n,r);try{const r=new t,s=r.s;zn(e)(s,n),ye&&delete s[ye];var i=r;break t}finally{n.g.clear(),n.m=-1,n.h=-1,100>At.length&&At.push(n)}i=void 0}return i}}function qr(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};lr(this.s,e,sr(t)),Pt(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,i=r.length;let s=0;for(let t=0;t<i;t++){const e=r[t];n.set(e,s),s+=e.length}return e.l=[n],n}}var Jr=[0,Br,fr((function(t,e,n){return 2===t.h&&(gr(e,n,(t=Et(t))===U()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof Nn){const r=e.Va;return void(r&&(e=r(e),null!=e&&Nt(t,n,X(e).buffer)))}if(Array.isArray(e))return}Er(t,e,n)}))],Zr=[0,Nr],Qr=[0,Or,Wr,Pr,-1,Ir,Wr,-1],ti=[0,Pr,-1],ei=class extends Nn{constructor(){super()}};ei.A=[6];var ni=[0,Pr,Nr,Pr,Wr,-1,Hr,Nr,-1,ti,Wr],ri=[0,Nr,-2],ii=class extends Nn{constructor(){super()}},si=[0],oi=[0,Or,Pr,-2],ai=class extends Nn{constructor(t){super(t,2)}},ci={},hi=[-2,ci,Pr];ci[336783863]=[0,Nr,Pr,-1,Or,[0,[1,2,3,4,5],Vr,si,Vr,ni,Vr,ri,Vr,oi,Vr,Qr],Zr];var ui=[0,Br,Ur],li=[0,Fr,-1,Ur,-3,Fr,Ir,Br,Cr,Fr,-1,Ur,Cr,Ur,-2,Br],fi=[-1,{}],di=[0,Nr,1,fi],pi=[0,Nr,Dr,fi];function gi(t,e){e=Oe(e),t=t.s;let n=Jt(t);de(n),hn(t,n,2,""===e?void 0:e)}function mi(t,e){vn(t.s,3,Me,e)}function yi(t,e){vn(t.s,4,Me,e)}var vi=class extends Nn{constructor(t){super(t,500)}o(t){return Sn(this,0,7,t)}};vi.A=[3,4,5,6,8,13,17,1005];var _i=[-500,Br,-1,Dr,-3,hi,Ar,Jr,Cr,-1,di,pi,Ar,ui,Br,li,Cr,Dr,987,Dr],wi=[0,Br,-1,fi],Ti=[-500,Nr,-1,[-1,{}],998,Nr],Ei=[-500,Nr,Dr,-1,[-2,{},Pr],997,Dr,-1],bi=[-500,Nr,Dr,fi,998,Dr];function Ai(t,e){Fn(t,vi,e)}function xi(t,e){vn(t.s,10,Me,e)}function ki(t,e){vn(t.s,15,Me,e)}var Si=class extends Nn{constructor(t){super(t,500)}o(t){return Sn(this,0,1001,t)}};Si.A=[1,6,7,9,10,15,16,17,14,1002];var Li=[-500,Ar,_i,4,Ar,Ti,Ar,Ei,Cr,Ar,bi,Dr,Cr,di,pi,Ar,wi,Dr,-2,li,Br,-1,Ur,979,fi,Ar,Jr],Ri=$r(Si,Li);Si.prototype.g=qr(Li);var Fi=[0,Ar,[0,Or,-2]],Mi=class extends Nn{constructor(t){super(t)}},Oi=[0,Or,kr,Nr,-1],Ii=class extends Nn{constructor(t){super(t)}g(){return kn(this,Mi,1)}};Ii.A=[1];var Ci=[0,Ar,Oi],Pi=$r(Ii,Ci),Ui=[0,Or,kr],Di=[0,Or,-1,Fi],Bi=class extends Nn{constructor(t){super(t)}},Ni=[0,Or,-3],Gi=[0,kr,-3],ji=class extends Nn{constructor(t){super(t)}},Vi=[0,kr,-1,Nr,kr],Xi=class extends Nn{constructor(t){super(t)}h(){return An(this,Bi,2)}g(){return kn(this,ji,5)}};Xi.A=[5];var zi=[0,Wr,Ni,Gi,Di,Ar,Vi],Wi=class extends Nn{constructor(t){super(t)}};Wi.A=[1,2,3,8,9];var Hi=$r(Wi,[0,Dr,Ir,Lr,zi,Nr,-1,Rr,Ar,Ui,Dr,Rr]),Yi=class extends Nn{constructor(t){super(t)}},Ki=[0,kr,-4],$i=class extends Nn{constructor(t){super(t)}};$i.A=[1];var qi=$r($i,[0,Ar,Ki]),Ji=class extends Nn{constructor(t){super(t)}},Zi=[0,kr,-4],Qi=class extends Nn{constructor(t){super(t)}};Qi.A=[1];var ts=$r(Qi,[0,Ar,Zi]),es=class extends Nn{constructor(t){super(t)}};es.A=[3];var ns=[0,Or,-1,Lr,Wr],rs=class extends Nn{constructor(){super()}};rs.prototype.g=qr([0,kr,-4,Rr]);var is=class extends Nn{constructor(t){super(t)}},ss=[0,1,Or,Nr,Ci],os=class extends Nn{constructor(t){super(t)}};os.A=[1];var as=$r(os,[0,Ar,ss,Rr]),cs=class extends Nn{constructor(t){super(t)}};cs.A=[1];var hs=class extends Nn{constructor(t){super(t)}ua(){const t=fn(this);return null==t?U():t}},us=class extends Nn{constructor(t){super(t)}},ls=[1,2],fs=[0,ls,Vr,[0,Lr],Vr,[0,Xr],Or,Nr],ds=class extends Nn{constructor(t){super(t)}};ds.A=[1];var ps=$r(ds,[0,Ar,fs,Rr]),gs=class extends Nn{constructor(t){super(t)}};gs.A=[4,5];var ms=[0,Nr,Or,kr,Dr,-1],ys=class extends Nn{constructor(t){super(t)}},vs=[0,Pr,-1],_s=class extends Nn{constructor(t){super(t)}},ws=[1,2,3,4,5],Ts=class extends Nn{constructor(t){super(t)}g(){return null!=fn(this)}h(){return null!=On(this,2)}},Es=[0,Xr,Nr,[0,Or,Rr,-1],[0,Mr,Rr]],bs=class extends Nn{constructor(t){super(t)}g(){return Te(on(this,2))??!1}},As=[0,Es,Pr,[0,ws,Vr,oi,Vr,ni,Vr,Qr,Vr,si,Vr,ri],Wr],xs=class extends Nn{constructor(t){super(t)}},ks=[0,As,kr,-1,Or],Ss=Kr(502141897,xs);ci[502141897]=ks;var Ls=[0,Es];ci[512499200]=Ls;var Rs=[0,Ls];ci[515723506]=Rs;var Fs=$r(class extends Nn{constructor(t){super(t)}},[0,[0,Wr,-1,Sr,zr],ns]),Ms=[0,As];ci[508981768]=Ms;var Os=class extends Nn{constructor(t){super(t)}},Is=[0,As,kr,Ms,Pr],Cs=class extends Nn{constructor(t){super(t)}},Ps=[0,As,ks,Is,kr,Rs];ci[508968149]=Is;var Us=Kr(508968150,Cs);ci[508968150]=Ps;var Ds=class extends Nn{constructor(t){super(t)}},Bs=Kr(513916220,Ds);ci[513916220]=[0,As,Ps,Or];var Ns=class extends Nn{constructor(t){super(t)}h(){return An(this,gs,2)}g(){cn(this,2)}},Gs=[0,As,ms];ci[478825465]=Gs;var js=[0,As];ci[478825422]=js;var Vs=class extends Nn{constructor(t){super(t)}},Xs=[0,As,js,Gs,-1],zs=class extends Nn{constructor(t){super(t)}},Ws=[0,As,kr,Or],Hs=class extends Nn{constructor(t){super(t)}},Ys=[0,As,kr],Ks=class extends Nn{constructor(t){super(t)}},$s=[0,As,Ws,Ys,kr],qs=class extends Nn{constructor(t){super(t)}},Js=[0,As,$s,Xs];ci[463370452]=Xs,ci[464864288]=Ws,ci[474472470]=Ys;var Zs=Kr(462713202,Ks);ci[462713202]=$s;var Qs=Kr(479097054,qs);ci[479097054]=Js;var to=class extends Nn{constructor(t){super(t)}},eo=Kr(456383383,to);ci[456383383]=[0,As,ms];var no=class extends Nn{constructor(t){super(t)}},ro=Kr(476348187,no);ci[476348187]=[0,As,vs];var io=class extends Nn{constructor(t){super(t)}},so=[0,Wr,-1],oo=class extends Nn{constructor(t){super(t)}};oo.A=[3];var ao=Kr(458105876,class extends Nn{constructor(t){super(t)}g(){var t=this.s;const e=Jt(t);var n=2&e;return t=function(t,e,n){var r=oo;const i=2&e;let s=!1;if(null==n){if(i)return gn();n=[]}else if(n.constructor===Ye){if(0==(2&n.O)||i)return n;n=n.X()}else Array.isArray(n)?s=!!(2&qt(n)):n=[];if(i){if(!n.length)return gn();s||(s=!0,te(n))}else s&&(s=!1,n=mn(n));return s||(64&qt(n)?Kt(n,32):32&e&&Ht(n,32)),hn(t,e,2,r=new Ye(n,r,Pe,void 0),!1),r}(t,e,an(t,e,2)),null==t||!n&&oo&&(t.xa=!0),n=t}});ci[458105876]=[0,so,mr,[!0,Rr,[0,Nr,-1,Dr]]];var co=class extends Nn{constructor(t){super(t)}},ho=Kr(458105758,co);ci[458105758]=[0,As,Nr,so];var uo=class extends Nn{constructor(t){super(t)}};uo.A=[5,6];var lo=Kr(443442058,uo);ci[443442058]=[0,As,Nr,Or,kr,Dr,-1];var fo=class extends Nn{constructor(t){super(t)}},po=[0,As,kr,-1,Or];ci[514774813]=po;var go=class extends Nn{constructor(t){super(t)}},mo=[0,As,kr,Pr],yo=class extends Nn{constructor(t){super(t)}},vo=[0,As,po,mo,kr];ci[518928384]=mo;var _o=Kr(516587230,yo);function wo(t,e){return e=e?e.clone():new gs,void 0!==t.displayNamesLocale?cn(e,1,Oe(t.displayNamesLocale)):void 0===t.displayNamesLocale&&cn(e,1),void 0!==t.maxResults?Un(e,2,t.maxResults):"maxResults"in t&&cn(e,2),void 0!==t.scoreThreshold?Dn(e,3,t.scoreThreshold):"scoreThreshold"in t&&cn(e,3),void 0!==t.categoryAllowlist?yn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&cn(e,4),void 0!==t.categoryDenylist?yn(e,5,t.categoryDenylist):"categoryDenylist"in t&&cn(e,5),e}function To(t,e=-1,n=""){return{categories:t.map((t=>({index:In(Mn(t,1))??-1,score:Cn(t,2)??0,categoryName:On(t,3)??""??"",displayName:On(t,4)??""??""}))),headIndex:e,headName:n}}function Eo(t){var e=dn(t,3,we),n=dn(t,2,Ae),r=dn(t,1,Ie),i=dn(t,9,Ie);const s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:n[t]??-1,categoryName:r[t]??"",displayName:i[t]??""});if((e=An(t,Xi,4)?.h())&&(s.boundingBox={originX:Mn(e,1)??0,originY:Mn(e,2)??0,width:Mn(e,3)??0,height:Mn(e,4)??0,angle:0}),An(t,Xi,4)?.g().length)for(const e of An(t,Xi,4).g())s.keypoints.push({x:ln(e,1)??0,y:ln(e,2)??0,score:ln(e,4)??0,label:On(e,3)??""});return s}function bo(t){const e=[];for(const n of kn(t,Ji,1))e.push({x:Cn(n,1)??0,y:Cn(n,2)??0,z:Cn(n,3)??0});return e}function Ao(t){const e=[];for(const n of kn(t,Yi,1))e.push({x:Cn(n,1)??0,y:Cn(n,2)??0,z:Cn(n,3)??0});return e}function xo(t){return Array.from(t,(t=>127<t?t-256:t))}function ko(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let s=0;s<t.length;s++)n+=t[s]*e[s],r+=t[s]*t[s],i+=e[s]*e[s];if(0>=r||0>=i)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let So;ci[516587230]=vo;const Lo=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 Ro(){if(void 0===So)try{await WebAssembly.instantiate(Lo),So=!0}catch{So=!1}return So}async function Fo(t,e=""){const n=await Ro()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Mo=class{};function Oo(){const t=navigator.userAgent;return t.includes("Safari")&&!t.includes("Chrome")}async function Io(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}function Co(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Po(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");return t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),e.videoWidth?(n=e.videoWidth,e=e.videoHeight):e.naturalWidth?(n=e.naturalWidth,e=e.naturalHeight):(n=e.width,e=e.height),!t.l||n===t.i.canvas.width&&e===t.i.canvas.height||(t.i.canvas.width=n,t.i.canvas.height=e),[n,e]}function Uo(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.i.stringToNewUTF8(e[n]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.i._free(e);t.i._free(e)}function Do(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function Bo(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}Mo.forVisionTasks=function(t){return Fo("vision",t)},Mo.forTextTasks=function(t){return Fo("text",t)},Mo.forAudioTasks=function(t){return Fo("audio",t)},Mo.isSimdSupported=function(){return Ro()};async function No(t,e,n,r){return t=await(async(t,e,n,r,i)=>{if(e&&await Io(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Io(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&i&&((e=self.Module).locateFile=i.locateFile,i.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=i.mainScriptUrlOrBlob)),i=await self.ModuleFactory(self.Module||i),self.ModuleFactory=self.Module=void 0,new t(i,r)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&t.endsWith(".data")?n.assetBinaryPath.toString():t}),await t.o(r),t}function Go(t,e){const n=An(t.baseOptions,Ts,1)||new Ts;"string"==typeof e?(cn(n,2,Oe(e)),cn(n,1)):e instanceof Uint8Array&&(cn(n,1,he(e,!1,!1)),cn(n,2)),Sn(t.baseOptions,0,1,n)}function jo(t){try{const e=t.F.length;if(1===e)throw Error(t.F[0].message);if(1<e)throw Error("Encountered multiple errors: "+t.F.map((t=>t.message)).join(", "))}finally{t.F=[]}}function Vo(t,e){t.I=Math.max(t.I,e)}function Xo(t,e){t.C=new vi,gi(t.C,"PassThroughCalculator"),mi(t.C,"free_memory"),yi(t.C,"free_memory_unused_out"),xi(e,"free_memory"),Ai(e,t.C)}function zo(t,e){mi(t.C,e),yi(t.C,e+"_unused_out")}function Wo(t){t.g.addBoolToStream(!0,"free_memory",t.I)}var Ho=class{constructor(t){this.g=t,this.F=[],this.I=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(An(this.baseOptions,Ts,1)?.g()||An(this.baseOptions,Ts,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let n=An(t.baseOptions,_s,3);if(!n){var r=n=new _s,i=new ii;Ln(r,4,ws,i)}"delegate"in e&&("GPU"===e.delegate?(e=n,r=new ei,Ln(e,2,ws,r)):(e=n,r=new ii,Ln(e,4,ws,r))),Sn(t.baseOptions,0,3,n)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)})).then((t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),!0,!1,!1),Go(this,"/model.dat"),this.m(),this.N()}));Go(this,e.modelAssetBuffer)}return this.m(),this.N(),Promise.resolve()}N(){}da(){let t;if(this.g.da((e=>{t=Ri(e)})),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.F.push(Error(e))})),this.g.Ra(),this.g.setGraph(t,e),this.C=void 0,jo(this)}finishProcessing(){this.g.finishProcessing(),jo(this)}close(){this.C=void 0,this.g.closeGraph()}};function Yo(t,e){if(null===t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}Ho.prototype.close=Ho.prototype.close;class Ko{constructor(t,e,n,r){this.g=t,this.h=e,this.m=n,this.l=r}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function $o(t,e,n){const r=t.g;if(n=Yo(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(n)}`);return r.attachShader(t.h,n),n}function qo(t,e){const n=t.g,r=Yo(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);const i=Yo(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(t.N),n.vertexAttribPointer(t.N,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const s=Yo(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,s),n.enableVertexAttribArray(t.M),n.vertexAttribPointer(t.M,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new Ko(n,r,i,s)}function Jo(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function Zo(t,e,n,r){return Jo(t,e),t.h||(t.m(),t.F()),n?(t.u||(t.u=qo(t,!0)),n=t.u):(t.v||(t.v=qo(t,!1)),n=t.v),e.useProgram(t.h),n.bind(),t.l(),t=r(),n.g.bindVertexArray(null),t}function Qo(t,e,n){return Jo(t,e),t=Yo(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function ta(t,e,n){Jo(t,e),t.C||(t.C=Yo(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.C),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)}function ea(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var na=class{I(){return"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n "}m(){const t=this.g;if(this.h=Yo(t.createProgram(),"Failed to create WebGL program"),this.ta=$o(this,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",t.VERTEX_SHADER),this.sa=$o(this,this.I(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.N=t.getAttribLocation(this.h,"aVertex"),this.M=t.getAttribLocation(this.h,"aTex")}F(){}l(){}close(){if(this.h){const t=this.g;t.deleteProgram(this.h),t.deleteShader(this.ta),t.deleteShader(this.sa)}this.C&&this.g.deleteFramebuffer(this.C),this.v&&this.v.close(),this.u&&this.u.close()}};var ra=class extends na{I(){return"\n precision mediump float;\n uniform sampler2D backgroundTexture;\n uniform sampler2D maskTexture;\n uniform sampler2D colorMappingTexture;\n varying vec2 vTex;\n void main() {\n vec4 backgroundColor = texture2D(backgroundTexture, vTex);\n float category = texture2D(maskTexture, vTex).r;\n vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));\n gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);\n }\n "}F(){const t=this.g;t.activeTexture(t.TEXTURE1),this.B=Qo(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=Qo(this,t,t.NEAREST)}m(){super.m();const t=this.g;this.U=Yo(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.ra=Yo(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.T=Yo(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.T,0),t.uniform1i(this.U,1),t.uniform1i(this.ra,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},ia=class extends na{I(){return"\n precision mediump float;\n uniform sampler2D maskTexture;\n uniform sampler2D defaultTexture;\n uniform sampler2D overlayTexture;\n varying vec2 vTex;\n void main() {\n float confidence = texture2D(maskTexture, vTex).r;\n vec4 defaultColor = texture2D(defaultTexture, vTex);\n vec4 overlayColor = texture2D(overlayTexture, vTex);\n // Apply the alpha from the overlay and merge in the default color\n overlayColor = mix(defaultColor, overlayColor, overlayColor.a);\n gl_FragColor = mix(defaultColor, overlayColor, confidence);\n }\n "}F(){const t=this.g;t.activeTexture(t.TEXTURE1),this.j=Qo(this,t),t.activeTexture(t.TEXTURE2),this.B=Qo(this,t)}m(){super.m();const t=this.g;this.T=Yo(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.U=Yo(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.J=Yo(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.J,0),t.uniform1i(this.T,1),t.uniform1i(this.U,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function sa(t,e){switch(e){case 0:return t.g.find((t=>t instanceof Uint8Array));case 1:return t.g.find((t=>t instanceof Float32Array));case 2:return t.g.find((t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function oa(t){var e=sa(t,1);if(!e){if(e=sa(t,0))e=new Float32Array(e).map((t=>t/255));else{e=new Float32Array(t.width*t.height);const r=ca(t);var n=ua(t);if(ta(n,r,aa(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in self.document){n=new Float32Array(t.width*t.height*4),r.readPixels(0,0,t.width,t.height,r.RGBA,r.FLOAT,n);for(let t=0,r=0;t<e.length;++t,r+=4)e[t]=n[r]}else r.readPixels(0,0,t.width,t.height,r.RED,r.FLOAT,e)}t.g.push(e)}return e}function aa(t){let e=sa(t,2);if(!e){const n=ca(t);e=la(t);const r=oa(t),i=ha(t);n.texImage2D(n.TEXTURE_2D,0,i,t.width,t.height,0,n.RED,n.FLOAT,r),fa(t)}return e}function ca(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=Yo(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function ha(t){if(t=ca(t),!da)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))da=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");da=t.R16F}return da}function ua(t){return t.l||(t.l=new na),t.l}function la(t){const e=ca(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=sa(t,2);return n||(n=Qo(ua(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(n),t.j=!0),e.bindTexture(e.TEXTURE_2D,n),n}function fa(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var da,pa=class{constructor(t,e,n,r,i,s,o){this.g=t,this.m=e,this.j=n,this.canvas=r,this.l=i,this.width=s,this.height=o,this.j&&(0===--ga&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources."))}La(){return!!sa(this,0)}ka(){return!!sa(this,1)}P(){return!!sa(this,2)}ja(){return(e=sa(t=this,0))||(e=oa(t),e=new Uint8Array(e.map((t=>255*t))),t.g.push(e)),e;var t,e}ia(){return oa(this)}K(){return aa(this)}clone(){const t=[];for(const e of this.g){let n;if(e instanceof Uint8Array)n=new Uint8Array(e);else if(e instanceof Float32Array)n=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{const t=ca(this),e=ua(this);t.activeTexture(t.TEXTURE1),n=Qo(e,t,this.m?t.LINEAR:t.NEAREST),t.bindTexture(t.TEXTURE_2D,n);const r=ha(this);t.texImage2D(t.TEXTURE_2D,0,r,this.width,this.height,0,t.RED,t.FLOAT,null),t.bindTexture(t.TEXTURE_2D,null),ta(e,t,n),Zo(e,t,!1,(()=>{la(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),fa(this)})),ea(e),fa(this)}}t.push(n)}return new pa(t,this.m,this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&ca(this).deleteTexture(sa(this,2)),ga=-1}};pa.prototype.close=pa.prototype.close,pa.prototype.clone=pa.prototype.clone,pa.prototype.getAsWebGLTexture=pa.prototype.K,pa.prototype.getAsFloat32Array=pa.prototype.ia,pa.prototype.getAsUint8Array=pa.prototype.ja,pa.prototype.hasWebGLTexture=pa.prototype.P,pa.prototype.hasFloat32Array=pa.prototype.ka,pa.prototype.hasUint8Array=pa.prototype.La;var ga=250;const ma={color:"white",lineWidth:4,radius:6};function ya(t){return{...ma,fillColor:(t=t||{}).color,...t}}function va(t,e){return t instanceof Function?t(e):t}function _a(t,e,n){return Math.max(Math.min(e,n),Math.min(Math.max(e,n),t))}function wa(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function Ta(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function Ea(t,e,n){if(e.P())n(e.K());else{const r=e.ka()?e.ia():e.ja();t.m=t.m??new na;const i=Ta(t);n((t=new pa([r],e.m,!1,i.canvas,t.m,e.width,e.height)).K()),t.close()}}function ba(t,e,n,r){const i=function(t){return t.g||(t.g=new ra),t.g}(t),s=Ta(t),o=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;Zo(i,s,!0,(()=>{!function(t,e,n,r){const i=t.g;if(i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,e),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.B),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),t.J&&function(t,e){if(t!==e)return!1;t=t.entries(),e=e.entries();for(const[r,i]of t){t=r;const s=i;var n=e.next();if(n.done)return!1;const[o,a]=n.value;if(n=a,t!==o||s[0]!==n[0]||s[1]!==n[1]||s[2]!==n[2]||s[3]!==n[3])return!1}return!!e.next().done}(t.J,r))i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j);else{t.J=r;const e=Array(1024).fill(0);r.forEach(((t,n)=>{if(4!==t.length)throw Error(`Color at index ${n} is not a four-channel value.`);e[4*n]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+3]=t[3]})),i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,256,1,0,i.RGBA,i.UNSIGNED_BYTE,new Uint8Array(e))}}(i,e,o,r),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);const t=i.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)}))}function Aa(t,e,n,r){const i=Ta(t),s=function(t){return t.h||(t.h=new ia),t.h}(t),o=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n,a=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;Zo(s,i,!0,(()=>{var t=s.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s.j),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,s.B),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),i.bindTexture(i.TEXTURE_2D,null),(t=s.g).activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)}))}var xa=class{constructor(t,e){t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}Ea(t,e){if(t){var n=wa(this);e=ya(e),n.save();var r=n.canvas,i=0;for(const s of t)n.fillStyle=va(e.fillColor,{index:i,from:s}),n.strokeStyle=va(e.color,{index:i,from:s}),n.lineWidth=va(e.lineWidth,{index:i,from:s}),(t=new Path2D).arc(s.x*r.width,s.y*r.height,va(e.radius,{index:i,from:s}),0,2*Math.PI),n.fill(t),n.stroke(t),++i;n.restore()}}Da(t,e,n){if(t&&e){var r=wa(this);n=ya(n),r.save();var i=r.canvas,s=0;for(const o of e){r.beginPath(),e=t[o.start];const a=t[o.end];e&&a&&(r.strokeStyle=va(n.color,{index:s,from:e,to:a}),r.lineWidth=va(n.lineWidth,{index:s,from:e,to:a}),r.moveTo(e.x*i.width,e.y*i.height),r.lineTo(a.x*i.width,a.y*i.height)),++s,r.stroke()}r.restore()}}Aa(t,e){const n=wa(this);e=ya(e),n.save(),n.beginPath(),n.lineWidth=va(e.lineWidth,{}),n.strokeStyle=va(e.color,{}),n.fillStyle=va(e.fillColor,{}),n.moveTo(t.originX,t.originY),n.lineTo(t.originX+t.width,t.originY),n.lineTo(t.originX+t.width,t.originY+t.height),n.lineTo(t.originX,t.originY+t.height),n.lineTo(t.originX,t.originY),n.stroke(),n.fill(),n.restore()}Ba(t,e,n=[0,0,0,255]){this.l?function(t,e,n,r){const i=Ta(t);Ea(t,e,(e=>{ba(t,e,n,r),(e=wa(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)}))}(this,t,n,e):ba(this,t.K(),n,e)}Ca(t,e,n){this.l?function(t,e,n,r){const i=Ta(t);Ea(t,e,(e=>{Aa(t,e,n,r),(e=wa(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)}))}(this,t,e,n):Aa(this,t.K(),e,n)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function ka(t,e){switch(e){case 0:return t.g.find((t=>t instanceof ImageData));case 1:return t.g.find((t=>"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap));case 2:return t.g.find((t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function Sa(t){var e=ka(t,0);if(!e){e=Ra(t);const n=Fa(t),r=new Uint8Array(t.width*t.height*4);ta(n,e,La(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,r),ea(n),e=new ImageData(new Uint8ClampedArray(r.buffer),t.width,t.height),t.g.push(e)}return e}function La(t){let e=ka(t,2);if(!e){const n=Ra(t);e=Ma(t);const r=ka(t,1)||Sa(t);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),Oa(t)}return e}function Ra(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when iniitializing the image.");return t.h||(t.h=Yo(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Fa(t){return t.l||(t.l=new na),t.l}function Ma(t){const e=Ra(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=ka(t,2);return n||(n=Qo(Fa(t),e),t.g.push(n),t.m=!0),e.bindTexture(e.TEXTURE_2D,n),n}function Oa(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function Ia(t){const e=Ra(t);return Zo(Fa(t),e,!0,(()=>function(t,e){const n=t.canvas;if(n.width===t.width&&n.height===t.height)return e();const r=n.width,i=n.height;return n.width=t.width,n.height=t.height,t=e(),n.width=r,n.height=i,t}(t,(()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))))}xa.prototype.close=xa.prototype.close,xa.prototype.drawConfidenceMask=xa.prototype.Ca,xa.prototype.drawCategoryMask=xa.prototype.Ba,xa.prototype.drawBoundingBox=xa.prototype.Aa,xa.prototype.drawConnectors=xa.prototype.Da,xa.prototype.drawLandmarks=xa.prototype.Ea,xa.lerp=function(t,e,n,r,i){return _a(r*(1-(t-e)/(n-e))+i*(1-(n-t)/(n-e)),r,i)},xa.clamp=_a;var Ca=class{constructor(t,e,n,r,i,s,o){this.g=t,this.j=e,this.m=n,this.canvas=r,this.l=i,this.width=s,this.height=o,(this.j||this.m)&&(0===--Pa&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources."))}Ka(){return!!ka(this,0)}la(){return!!ka(this,1)}P(){return!!ka(this,2)}Ia(){return Sa(this)}Ha(){var t=ka(this,1);return t||(La(this),Ma(this),t=Ia(this),Oa(this),this.g.push(t),this.j=!0),t}K(){return La(this)}clone(){const t=[];for(const e of this.g){let n;if(e instanceof ImageData)n=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){const t=Ra(this),e=Fa(this);t.activeTexture(t.TEXTURE1),n=Qo(e,t),t.bindTexture(t.TEXTURE_2D,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindTexture(t.TEXTURE_2D,null),ta(e,t,n),Zo(e,t,!1,(()=>{Ma(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Oa(this)})),ea(e),Oa(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);La(this),Ma(this),n=Ia(this),Oa(this)}t.push(n)}return new Ca(t,this.la(),this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&ka(this,1).close(),this.m&&Ra(this).deleteTexture(ka(this,2)),Pa=-1}};Ca.prototype.close=Ca.prototype.close,Ca.prototype.clone=Ca.prototype.clone,Ca.prototype.getAsWebGLTexture=Ca.prototype.K,Ca.prototype.getAsImageBitmap=Ca.prototype.Ha,Ca.prototype.getAsImageData=Ca.prototype.Ia,Ca.prototype.hasWebGLTexture=Ca.prototype.P,Ca.prototype.hasImageBitmap=Ca.prototype.la,Ca.prototype.hasImageData=Ca.prototype.Ka;var Pa=250;function Ua(...t){return t.map((([t,e])=>({start:t,end:e})))}const Da=function(t){return class extends t{Ra(){this.i._registerModelResourcesGraphService()}}}((Ba=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:"undefined"==typeof OffscreenCanvas||Oo()?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas")):this.i.canvas=new OffscreenCanvas(1,1)}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const n=t.length,r=this.i._malloc(n);this.i.HEAPU8.set(t,r),e?this.i._changeBinaryGraph(n,r):this.i._changeTextGraph(n,r),this.i._free(r)}configureAudio(t,e,n,r,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Co(this,r||"input_audio",(r=>{Co(this,i=i||"audio_header",(i=>{this.i._configureAudio(r,i,t,e,n)}))}))}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}da(t){Do(this,"__graph_config__",(e=>{t(e)})),Co(this,"__graph_config__",(t=>{this.i._getGraphConfig(t,void 0)})),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const s=4*t.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(t,this.g/4),Co(this,r,(t=>{this.i._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Co(this,e,(e=>{const[r,i]=Po(this,t,e);this.i._addBoundTextureToStream(e,r,i,n)}))}addBoolToStream(t,e,n){Co(this,e,(e=>{this.i._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Co(this,e,(e=>{this.i._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Co(this,e,(e=>{this.i._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Co(this,e,(e=>{this.i._addIntToInputStream(t,e,n)}))}addStringToStream(t,e,n){Co(this,e,(e=>{Co(this,t,(t=>{this.i._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Co(this,e,(e=>{Uo(this,Object.keys(t),(r=>{Uo(this,Object.values(t),(i=>{this.i._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Co(this,n,(n=>{Co(this,e,(e=>{const i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,n,r),this.i._free(i)}))}))}addEmptyPacketToStream(t,e){Co(this,t,(t=>{this.i._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){Co(this,e,(e=>{const r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){Co(this,e,(e=>{const r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){Co(this,e,(e=>{const r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){Co(this,e,(e=>{const r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){Co(this,e,(e=>{const r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Co(this,e,(t=>{this.i._addStringVectorEntry(r,t)}));this.i._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){Co(this,e,(e=>{this.i._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Co(this,e,(e=>{this.i._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Co(this,e,(e=>{this.i._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Co(this,e,(e=>{this.i._addIntToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Co(this,e,(e=>{Co(this,t,(t=>{this.i._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Co(this,n,(n=>{Co(this,e,(e=>{const r=this.i._malloc(t.length);this.i.HEAPU8.set(t,r),this.i._addProtoToInputSidePacket(r,t.length,e,n),this.i._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){Co(this,e,(e=>{const n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){Co(this,e,(e=>{const n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){Co(this,e,(e=>{const n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){Co(this,e,(e=>{const n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){Co(this,e,(e=>{const n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Co(this,e,(t=>{this.i._addStringVectorEntry(n,t)}));this.i._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){Do(this,t,e),Co(this,t,(t=>{this.i._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Bo(this,t,e),Co(this,t,(t=>{this.i._attachBoolVectorListener(t)}))}attachIntListener(t,e){Do(this,t,e),Co(this,t,(t=>{this.i._attachIntListener(t)}))}attachIntVectorListener(t,e){Bo(this,t,e),Co(this,t,(t=>{this.i._attachIntVectorListener(t)}))}attachDoubleListener(t,e){Do(this,t,e),Co(this,t,(t=>{this.i._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Bo(this,t,e),Co(this,t,(t=>{this.i._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Do(this,t,e),Co(this,t,(t=>{this.i._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Bo(this,t,e),Co(this,t,(t=>{this.i._attachFloatVectorListener(t)}))}attachStringListener(t,e){Do(this,t,e),Co(this,t,(t=>{this.i._attachStringListener(t)}))}attachStringVectorListener(t,e){Bo(this,t,e),Co(this,t,(t=>{this.i._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Do(this,t,e),Co(this,t,(t=>{this.i._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Bo(this,t,e),Co(this,t,(t=>{this.i._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Do(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Co(this,t,(t=>{this.i._attachAudioListener(t,n||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends Ba{get fa(){return this.i}va(t,e,n){Co(this,e,(e=>{const[r,i]=Po(this,t,e);this.fa._addBoundTextureAsImageToStream(e,r,i,n)}))}ba(t,e){Do(this,t,e),Co(this,t,(t=>{this.fa._attachImageListener(t)}))}ca(t,e){Bo(this,t,e),Co(this,t,(t=>{this.fa._attachImageVectorListener(t)}))}}));var Ba,Na=class extends Da{};async function Ga(t,e,n){return async function(t,e,n,r){return No(t,e,n,r)}(t,n.canvas??("undefined"==typeof OffscreenCanvas||Oo()?document.createElement("canvas"):void 0),e,n)}function ja(t,e,n,r){if(t.J){const s=new rs;if(n?.regionOfInterest){if(!t.U)throw Error("This task doesn't support region-of-interest.");var i=n.regionOfInterest;if(i.left>=i.right||i.top>=i.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(0>i.left||0>i.top||1<i.right||1<i.bottom)throw Error("Expected RectF values to be in [0,1].");Dn(s,1,(i.left+i.right)/2),Dn(s,2,(i.top+i.bottom)/2),Dn(s,4,i.right-i.left),Dn(s,3,i.bottom-i.top)}else Dn(s,1,.5),Dn(s,2,.5),Dn(s,4,1),Dn(s,3,1);if(n?.rotationDegrees){if(0!=n?.rotationDegrees%90)throw Error("Expected rotation to be a multiple of 90°.");if(Dn(s,5,-Math.PI*n.rotationDegrees/180),0!=n?.rotationDegrees%180){const[t,r]=void 0!==e.videoWidth?[e.videoWidth,e.videoHeight]:void 0!==e.naturalWidth?[e.naturalWidth,e.naturalHeight]:[e.width,e.height];n=Cn(s,3)*r/t,i=Cn(s,4)*t/r,Dn(s,4,n),Dn(s,3,i)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.J,r)}t.g.va(e,t.T,r??performance.now()),t.finishProcessing()}function Va(t,e,n){if(t.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");ja(t,e,n,t.I+1)}function Xa(t,e,n,r){if(!t.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");ja(t,e,n,r)}function za(t,e,n,r){var i=e.data;const s=e.width,o=s*(e=e.height);if((i instanceof Uint8Array||i instanceof Float32Array)&&i.length!==o)throw Error("Unsupported channel count: "+i.length/o);return t=new pa([i],n,!1,t.g.i.canvas,t.M,s,e),r?t.clone():t}var Wa=class extends Ho{constructor(t,e,n,r){super(t),this.g=t,this.T=e,this.J=n,this.U=r,this.M=new na}l(t,e=!0){if("runningMode"in t&&Pn(this.baseOptions,2,!!t.runningMode&&"IMAGE"!==t.runningMode),void 0!==t.canvas&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.M.close(),super.close()}};Wa.prototype.close=Wa.prototype.close;var Ha=class extends Wa{constructor(t,e){super(new Na(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},Sn(t=this.h=new xs,0,1,e=new bs),Dn(this.h,2,.5),Dn(this.h,3,.3)}get baseOptions(){return An(this.h,bs,1)}set baseOptions(t){Sn(this.h,0,1,t)}o(t){return"minDetectionConfidence"in t&&Dn(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&Dn(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}G(t,e){return this.j={detections:[]},Va(this,t,e),this.j}H(t,e,n){return this.j={detections:[]},Xa(this,t,n,e),this.j}m(){var t=new Si;xi(t,"image_in"),xi(t,"norm_rect_in"),ki(t,"detections");const e=new ai;Bn(e,Ss,this.h);const n=new vi;gi(n,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),mi(n,"IMAGE:image_in"),mi(n,"NORM_RECT:norm_rect_in"),yi(n,"DETECTIONS:detections"),n.o(e),Ai(t,n),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=Hi(e),this.j.detections.push(Eo(t));Vo(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{Vo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ha.prototype.detectForVideo=Ha.prototype.H,Ha.prototype.detect=Ha.prototype.G,Ha.prototype.setOptions=Ha.prototype.o,Ha.createFromModelPath=async function(t,e){return Ga(Ha,t,{baseOptions:{modelAssetPath:e}})},Ha.createFromModelBuffer=function(t,e){return Ga(Ha,t,{baseOptions:{modelAssetBuffer:e}})},Ha.createFromOptions=function(t,e){return Ga(Ha,t,e)};var Ya=Ua([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]),Ka=Ua([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]),$a=Ua([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),qa=Ua([474,475],[475,476],[476,477],[477,474]),Ja=Ua([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]),Za=Ua([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),Qa=Ua([469,470],[470,471],[471,472],[472,469]),tc=Ua([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]),ec=[...Ya,...Ka,...$a,...Ja,...Za,...tc],nc=Ua([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 rc(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var ic=class extends Wa{constructor(t,e){super(new Na(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,Sn(t=this.h=new Cs,0,1,e=new bs),this.v=new Os,Sn(this.h,0,3,this.v),this.u=new xs,Sn(this.h,0,2,this.u),Un(this.u,4,1),Dn(this.u,2,.5),Dn(this.v,2,.5),Dn(this.h,4,.5)}get baseOptions(){return An(this.h,bs,1)}set baseOptions(t){Sn(this.h,0,1,t)}o(t){return"numFaces"in t&&Un(this.u,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&Dn(this.u,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&Dn(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&Dn(this.v,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}G(t,e){return rc(this),Va(this,t,e),this.j}H(t,e,n){return rc(this),Xa(this,t,n,e),this.j}m(){var t=new Si;xi(t,"image_in"),xi(t,"norm_rect"),ki(t,"face_landmarks");const e=new ai;Bn(e,Us,this.h);const n=new vi;gi(n,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),mi(n,"IMAGE:image_in"),mi(n,"NORM_RECT:norm_rect"),yi(n,"NORM_LANDMARKS:face_landmarks"),n.o(e),Ai(t,n),this.g.attachProtoVectorListener("face_landmarks",((t,e)=>{for(const e of t)t=ts(e),this.j.faceLandmarks.push(bo(t));Vo(this,e)})),this.g.attachEmptyPacketListener("face_landmarks",(t=>{Vo(this,t)})),this.outputFaceBlendshapes&&(ki(t,"blendshapes"),yi(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((t,e)=>{if(this.outputFaceBlendshapes)for(const e of t)t=Pi(e),this.j.faceBlendshapes.push(To(t.g()??[]));Vo(this,e)})),this.g.attachEmptyPacketListener("blendshapes",(t=>{Vo(this,t)}))),this.outputFacialTransformationMatrixes&&(ki(t,"face_geometry"),yi(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((t,e)=>{if(this.outputFacialTransformationMatrixes)for(const e of t)(t=An(Fs(e),es,2))&&this.j.facialTransformationMatrixes.push({rows:In(Mn(t,1))??0,columns:In(Mn(t,2))??0,data:dn(t,3,we)??[]});Vo(this,e)})),this.g.attachEmptyPacketListener("face_geometry",(t=>{Vo(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ic.prototype.detectForVideo=ic.prototype.H,ic.prototype.detect=ic.prototype.G,ic.prototype.setOptions=ic.prototype.o,ic.createFromModelPath=function(t,e){return Ga(ic,t,{baseOptions:{modelAssetPath:e}})},ic.createFromModelBuffer=function(t,e){return Ga(ic,t,{baseOptions:{modelAssetBuffer:e}})},ic.createFromOptions=function(t,e){return Ga(ic,t,e)},ic.FACE_LANDMARKS_LIPS=Ya,ic.FACE_LANDMARKS_LEFT_EYE=Ka,ic.FACE_LANDMARKS_LEFT_EYEBROW=$a,ic.FACE_LANDMARKS_LEFT_IRIS=qa,ic.FACE_LANDMARKS_RIGHT_EYE=Ja,ic.FACE_LANDMARKS_RIGHT_EYEBROW=Za,ic.FACE_LANDMARKS_RIGHT_IRIS=Qa,ic.FACE_LANDMARKS_FACE_OVAL=tc,ic.FACE_LANDMARKS_CONTOURS=ec,ic.FACE_LANDMARKS_TESSELATION=nc;var sc=class extends Wa{constructor(t,e){super(new Na(t,e),"image_in","norm_rect",!0),Sn(t=this.j=new Ds,0,1,e=new bs)}get baseOptions(){return An(this.j,bs,1)}set baseOptions(t){Sn(this.j,0,1,t)}o(t){return super.l(t)}Ua(t,e,n){const r="function"!=typeof e?e:{};if(this.h="function"==typeof e?e:n,Va(this,t,r??{}),!this.h)return this.u}m(){var t=new Si;xi(t,"image_in"),xi(t,"norm_rect"),ki(t,"stylized_image");const e=new ai;Bn(e,Bs,this.j);const n=new vi;gi(n,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),mi(n,"IMAGE:image_in"),mi(n,"NORM_RECT:norm_rect"),yi(n,"STYLIZED_IMAGE:stylized_image"),n.o(e),Ai(t,n),this.g.ba("stylized_image",((t,e)=>{var n=!this.h,r=t.data,i=t.width;const s=i*(t=t.height);if(r instanceof Uint8Array)if(r.length===3*s){const e=new Uint8ClampedArray(4*s);for(let t=0;t<s;++t)e[4*t]=r[3*t],e[4*t+1]=r[3*t+1],e[4*t+2]=r[3*t+2],e[4*t+3]=255;r=new ImageData(e,i,t)}else{if(r.length!==4*s)throw Error("Unsupported channel count: "+r.length/s);r=new ImageData(new Uint8ClampedArray(r.buffer,r.byteOffset,r.length),i,t)}else if(!(r instanceof WebGLTexture))throw Error(`Unsupported format: ${r.constructor.name}`);i=new Ca([r],!1,!1,this.g.i.canvas,this.M,i,t),this.u=n=n?i.clone():i,this.h&&this.h(n),Vo(this,e)})),this.g.attachEmptyPacketListener("stylized_image",(t=>{this.u=null,this.h&&this.h(null),Vo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};sc.prototype.stylize=sc.prototype.Ua,sc.prototype.setOptions=sc.prototype.o,sc.createFromModelPath=function(t,e){return Ga(sc,t,{baseOptions:{modelAssetPath:e}})},sc.createFromModelBuffer=function(t,e){return Ga(sc,t,{baseOptions:{modelAssetBuffer:e}})},sc.createFromOptions=function(t,e){return Ga(sc,t,e)};var oc=Ua([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 ac(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function cc(t){return 0===t.gestures.length?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function hc(t,e=!0){const n=[];for(const i of t){var r=Pi(i);t=[];for(const n of r.g())r=e&&null!=Mn(n,1)?In(Mn(n,1)):-1,t.push({score:Cn(n,2)??0,index:r,categoryName:On(n,3)??""??"",displayName:On(n,4)??""??""});n.push(t)}return n}var uc=class extends Wa{constructor(t,e){super(new Na(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Sn(t=this.v=new qs,0,1,e=new bs),this.B=new Ks,Sn(this.v,0,2,this.B),this.u=new Hs,Sn(this.B,0,3,this.u),this.h=new zs,Sn(this.B,0,2,this.h),this.j=new Vs,Sn(this.v,0,3,this.j),Dn(this.h,2,.5),Dn(this.B,4,.5),Dn(this.u,2,.5)}get baseOptions(){return An(this.v,bs,1)}set baseOptions(t){Sn(this.v,0,1,t)}o(t){if(Un(this.h,3,t.numHands??1),"minHandDetectionConfidence"in t&&Dn(this.h,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Dn(this.B,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Dn(this.u,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new Ns,n=e,r=wo(t.cannedGesturesClassifierOptions,An(this.j,Ns,3)?.h());Sn(n,0,2,r),Sn(this.j,0,3,e)}else void 0===t.cannedGesturesClassifierOptions&&An(this.j,Ns,3)?.g();return t.customGesturesClassifierOptions?(Sn(n=e=new Ns,0,2,r=wo(t.customGesturesClassifierOptions,An(this.j,Ns,4)?.h())),Sn(this.j,0,4,e)):void 0===t.customGesturesClassifierOptions&&An(this.j,Ns,4)?.g(),this.l(t)}Pa(t,e){return ac(this),Va(this,t,e),cc(this)}Qa(t,e,n){return ac(this),Xa(this,t,n,e),cc(this)}m(){var t=new Si;xi(t,"image_in"),xi(t,"norm_rect"),ki(t,"hand_gestures"),ki(t,"hand_landmarks"),ki(t,"world_hand_landmarks"),ki(t,"handedness");const e=new ai;Bn(e,Qs,this.v);const n=new vi;gi(n,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),mi(n,"IMAGE:image_in"),mi(n,"NORM_RECT:norm_rect"),yi(n,"HAND_GESTURES:hand_gestures"),yi(n,"LANDMARKS:hand_landmarks"),yi(n,"WORLD_LANDMARKS:world_hand_landmarks"),yi(n,"HANDEDNESS:handedness"),n.o(e),Ai(t,n),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t){t=ts(e);const n=[];for(const e of kn(t,Ji,1))n.push({x:Cn(e,1)??0,y:Cn(e,2)??0,z:Cn(e,3)??0});this.landmarks.push(n)}Vo(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{Vo(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t){t=qi(e);const n=[];for(const e of kn(t,Yi,1))n.push({x:Cn(e,1)??0,y:Cn(e,2)??0,z:Cn(e,3)??0});this.worldLandmarks.push(n)}Vo(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{Vo(this,t)})),this.g.attachProtoVectorListener("hand_gestures",((t,e)=>{this.gestures.push(...hc(t,!1)),Vo(this,e)})),this.g.attachEmptyPacketListener("hand_gestures",(t=>{Vo(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{this.handedness.push(...hc(t)),Vo(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{Vo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function lc(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}uc.prototype.recognizeForVideo=uc.prototype.Qa,uc.prototype.recognize=uc.prototype.Pa,uc.prototype.setOptions=uc.prototype.o,uc.createFromModelPath=function(t,e){return Ga(uc,t,{baseOptions:{modelAssetPath:e}})},uc.createFromModelBuffer=function(t,e){return Ga(uc,t,{baseOptions:{modelAssetBuffer:e}})},uc.createFromOptions=function(t,e){return Ga(uc,t,e)},uc.HAND_CONNECTIONS=oc;var fc=class extends Wa{constructor(t,e){super(new Na(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Sn(t=this.j=new Ks,0,1,e=new bs),this.u=new Hs,Sn(this.j,0,3,this.u),this.h=new zs,Sn(this.j,0,2,this.h),Un(this.h,3,1),Dn(this.h,2,.5),Dn(this.u,2,.5),Dn(this.j,4,.5)}get baseOptions(){return An(this.j,bs,1)}set baseOptions(t){Sn(this.j,0,1,t)}o(t){return"numHands"in t&&Un(this.h,3,t.numHands??1),"minHandDetectionConfidence"in t&&Dn(this.h,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Dn(this.j,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Dn(this.u,2,t.minHandPresenceConfidence??.5),this.l(t)}G(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Va(this,t,e),lc(this)}H(t,e,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Xa(this,t,n,e),lc(this)}m(){var t=new Si;xi(t,"image_in"),xi(t,"norm_rect"),ki(t,"hand_landmarks"),ki(t,"world_hand_landmarks"),ki(t,"handedness");const e=new ai;Bn(e,Zs,this.j);const n=new vi;gi(n,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),mi(n,"IMAGE:image_in"),mi(n,"NORM_RECT:norm_rect"),yi(n,"LANDMARKS:hand_landmarks"),yi(n,"WORLD_LANDMARKS:world_hand_landmarks"),yi(n,"HANDEDNESS:handedness"),n.o(e),Ai(t,n),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t)t=ts(e),this.landmarks.push(bo(t));Vo(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{Vo(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t)t=qi(e),this.worldLandmarks.push(Ao(t));Vo(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{Vo(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{var n=this.handedness,r=n.push;const i=[];for(const e of t){t=Pi(e);const n=[];for(const e of t.g())n.push({score:Cn(e,2)??0,index:In(Mn(e,1))??-1,categoryName:On(e,3)??""??"",displayName:On(e,4)??""??""});i.push(n)}r.call(n,...i),Vo(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{Vo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};fc.prototype.detectForVideo=fc.prototype.H,fc.prototype.detect=fc.prototype.G,fc.prototype.setOptions=fc.prototype.o,fc.createFromModelPath=function(t,e){return Ga(fc,t,{baseOptions:{modelAssetPath:e}})},fc.createFromModelBuffer=function(t,e){return Ga(fc,t,{baseOptions:{modelAssetBuffer:e}})},fc.createFromOptions=function(t,e){return Ga(fc,t,e)},fc.HAND_CONNECTIONS=oc;var dc=class extends Wa{constructor(t,e){super(new Na(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},Sn(t=this.h=new to,0,1,e=new bs)}get baseOptions(){return An(this.h,bs,1)}set baseOptions(t){Sn(this.h,0,1,t)}o(t){return Sn(this.h,0,2,wo(t,An(this.h,gs,2))),this.l(t)}ya(t,e){return this.j={classifications:[]},Va(this,t,e),this.j}za(t,e,n){return this.j={classifications:[]},Xa(this,t,n,e),this.j}m(){var t=new Si;xi(t,"input_image"),xi(t,"norm_rect"),ki(t,"classifications");const e=new ai;Bn(e,eo,this.h);const n=new vi;gi(n,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),mi(n,"IMAGE:input_image"),mi(n,"NORM_RECT:norm_rect"),yi(n,"CLASSIFICATIONS:classifications"),n.o(e),Ai(t,n),this.g.attachProtoListener("classifications",((t,e)=>{this.j=function(t){const e={classifications:kn(t,is,1).map((t=>To(An(t,Ii,4)?.g()??[],In(Mn(t,2)),On(t,3)??"")))};return null!=Fe(on(t,2))&&(e.timestampMs=In(Fe(on(t,2)))),e}(as(t)),Vo(this,e)})),this.g.attachEmptyPacketListener("classifications",(t=>{Vo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};dc.prototype.classifyForVideo=dc.prototype.za,dc.prototype.classify=dc.prototype.ya,dc.prototype.setOptions=dc.prototype.o,dc.createFromModelPath=function(t,e){return Ga(dc,t,{baseOptions:{modelAssetPath:e}})},dc.createFromModelBuffer=function(t,e){return Ga(dc,t,{baseOptions:{modelAssetBuffer:e}})},dc.createFromOptions=function(t,e){return Ga(dc,t,e)};var pc=class extends Wa{constructor(t,e){super(new Na(t,e),"image_in","norm_rect",!0),this.h=new no,this.embeddings={embeddings:[]},Sn(t=this.h,0,1,e=new bs)}get baseOptions(){return An(this.h,bs,1)}set baseOptions(t){Sn(this.h,0,1,t)}o(t){var e=this.h,n=An(this.h,ys,2);return n=n?n.clone():new ys,void 0!==t.l2Normalize?Pn(n,1,t.l2Normalize):"l2Normalize"in t&&cn(n,1),void 0!==t.quantize?Pn(n,2,t.quantize):"quantize"in t&&cn(n,2),Sn(e,0,2,n),this.l(t)}Fa(t,e){return Va(this,t,e),this.embeddings}Ga(t,e,n){return Xa(this,t,n,e),this.embeddings}m(){var t=new Si;xi(t,"image_in"),xi(t,"norm_rect"),ki(t,"embeddings_out");const e=new ai;Bn(e,ro,this.h);const n=new vi;gi(n,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),mi(n,"IMAGE:image_in"),mi(n,"NORM_RECT:norm_rect"),yi(n,"EMBEDDINGS:embeddings_out"),n.o(e),Ai(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=ps(t),this.embeddings=function(t){return{embeddings:kn(t,us,1).map((t=>{const e={headIndex:In(Mn(t,3))??-1,headName:On(t,4)??""??""};if(void 0!==bn(t,cs,wn(t,1)))t=dn(t=An(t,cs,wn(t,1)),1,we),e.floatEmbedding=t;else{const n=new Uint8Array(0);e.quantizedEmbedding=An(t,hs,wn(t,2))?.ua()?.wa()??n}return e})),timestampMs:In(Fe(on(t,2)))}}(t),Vo(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{Vo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};pc.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=ko(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=ko(xo(t.quantizedEmbedding),xo(e.quantizedEmbedding))}return t},pc.prototype.embedForVideo=pc.prototype.Ga,pc.prototype.embed=pc.prototype.Fa,pc.prototype.setOptions=pc.prototype.o,pc.createFromModelPath=function(t,e){return Ga(pc,t,{baseOptions:{modelAssetPath:e}})},pc.createFromModelBuffer=function(t,e){return Ga(pc,t,{baseOptions:{modelAssetBuffer:e}})},pc.createFromOptions=function(t,e){return Ga(pc,t,e)};var gc=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};function mc(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function yc(t){try{const e=new gc(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{Wo(t)}}gc.prototype.close=gc.prototype.close;var vc=class extends Wa{constructor(t,e){super(new Na(t,e),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new co,this.v=new io,Sn(this.h,0,3,this.v),Sn(t=this.h,0,1,e=new bs)}get baseOptions(){return An(this.h,bs,1)}set baseOptions(t){Sn(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?cn(this.h,2,Oe(t.displayNamesLocale)):"displayNamesLocale"in t&&cn(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}N(){!function(t){const e=kn(t.da(),vi,1).filter((t=>(On(t,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(t.u=[],1<e.length)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");1===e.length&&(An(e[0],ai,7)?.l()?.g()??new Map).forEach(((e,n)=>{t.u[Number(n)]=On(e,1)??""}))}(this)}ea(t,e,n){const r="function"!=typeof e?e:{};return this.j="function"==typeof e?e:n,mc(this),Va(this,t,r),yc(this)}Sa(t,e,n,r){const i="function"!=typeof n?n:{};return this.j="function"==typeof n?n:r,mc(this),Xa(this,t,i,e),yc(this)}Ja(){return this.u}m(){var t=new Si;xi(t,"image_in"),xi(t,"norm_rect");const e=new ai;Bn(e,ho,this.h);const n=new vi;gi(n,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),mi(n,"IMAGE:image_in"),mi(n,"NORM_RECT:norm_rect"),n.o(e),Ai(t,n),Xo(this,t),this.outputConfidenceMasks&&(ki(t,"confidence_masks"),yi(n,"CONFIDENCE_MASKS:confidence_masks"),zo(this,"confidence_masks"),this.g.ca("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>za(this,t,!0,!this.j))),Vo(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],Vo(this,t)}))),this.outputCategoryMask&&(ki(t,"category_mask"),yi(n,"CATEGORY_MASK:category_mask"),zo(this,"category_mask"),this.g.ba("category_mask",((t,e)=>{this.categoryMask=za(this,t,!1,!this.j),Vo(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,Vo(this,t)}))),ki(t,"quality_scores"),yi(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,Vo(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,Vo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};vc.prototype.getLabels=vc.prototype.Ja,vc.prototype.segmentForVideo=vc.prototype.Sa,vc.prototype.segment=vc.prototype.ea,vc.prototype.setOptions=vc.prototype.o,vc.createFromModelPath=function(t,e){return Ga(vc,t,{baseOptions:{modelAssetPath:e}})},vc.createFromModelBuffer=function(t,e){return Ga(vc,t,{baseOptions:{modelAssetBuffer:e}})},vc.createFromOptions=function(t,e){return Ga(vc,t,e)};var _c=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};_c.prototype.close=_c.prototype.close;var wc=class extends Nn{constructor(t){super(t)}},Tc=[0,Or,-2],Ec=[0,xr,-3,Pr],bc=[0,xr,-3,Pr,xr,-1],Ac=[0,bc],xc=[0,Ac,Tc],kc=[0,bc,Tc],Sc=[0,bc,Or,-1],Lc=[0,Sc,Tc],Rc=[0,xr,-3,Pr,Tc,-1],Fc=[0,xr,-3,Pr,Wr],Mc=class extends Nn{constructor(t){super(t)}},Oc=[0,xr,-1,Pr],Ic=class extends Nn{constructor(){super()}};Ic.A=[1];var Cc=class extends Nn{constructor(t){super(t)}},Pc=[1,2,3,4,5,6,7,8,9,10,14,15],Uc=[0,Pc,Vr,bc,Vr,kc,Vr,Ac,Vr,xc,Vr,Oc,Vr,Fc,Vr,Ec,Vr,[0,Nr,xr,-2,Pr,Or,Pr,-1,2,xr,Tc],Vr,Sc,Vr,Lc,xr,Tc,Nr,Vr,Rc,Vr,[0,Ar,Oc]],Dc=[0,Nr,Or,-1,Pr],Bc=class extends Nn{constructor(){super()}};Bc.A=[1],Bc.prototype.g=qr([0,Ar,Uc,Nr,Dc]);var Nc=class extends Wa{constructor(t,e){super(new Na(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new co,this.v=new io,Sn(this.h,0,3,this.v),Sn(t=this.h,0,1,e=new bs)}get baseOptions(){return An(this.h,bs,1)}set baseOptions(t){Sn(this.h,0,1,t)}o(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}ea(t,e,n,r){const i="function"!=typeof n?n:{};this.j="function"==typeof n?n:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.I+1,r=new Bc;const s=new Cc;var o=new wc;if(Un(o,1,255),Sn(s,0,12,o),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new Mc;Pn(a,3,!0),Dn(a,1,e.keypoint.x),Dn(a,2,e.keypoint.y),Ln(s,5,Pc,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new Ic,e.scribble))Pn(e=new Mc,3,!0),Dn(e,1,a.x),Dn(e,2,a.y),Fn(o,Mc,e);Ln(s,15,Pc,o)}Fn(r,Cc,s),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",n),Va(this,t,i);t:{try{const t=new _c(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=t;break t}this.j(t)}finally{Wo(this)}c=void 0}return c}m(){var t=new Si;xi(t,"image_in"),xi(t,"roi_in"),xi(t,"norm_rect_in");const e=new ai;Bn(e,ho,this.h);const n=new vi;gi(n,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),mi(n,"IMAGE:image_in"),mi(n,"ROI:roi_in"),mi(n,"NORM_RECT:norm_rect_in"),n.o(e),Ai(t,n),Xo(this,t),this.outputConfidenceMasks&&(ki(t,"confidence_masks"),yi(n,"CONFIDENCE_MASKS:confidence_masks"),zo(this,"confidence_masks"),this.g.ca("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>za(this,t,!0,!this.j))),Vo(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],Vo(this,t)}))),this.outputCategoryMask&&(ki(t,"category_mask"),yi(n,"CATEGORY_MASK:category_mask"),zo(this,"category_mask"),this.g.ba("category_mask",((t,e)=>{this.categoryMask=za(this,t,!1,!this.j),Vo(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,Vo(this,t)}))),ki(t,"quality_scores"),yi(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,Vo(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,Vo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Nc.prototype.segment=Nc.prototype.ea,Nc.prototype.setOptions=Nc.prototype.o,Nc.createFromModelPath=function(t,e){return Ga(Nc,t,{baseOptions:{modelAssetPath:e}})},Nc.createFromModelBuffer=function(t,e){return Ga(Nc,t,{baseOptions:{modelAssetBuffer:e}})},Nc.createFromOptions=function(t,e){return Ga(Nc,t,e)};var Gc=class extends Wa{constructor(t,e){super(new Na(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},Sn(t=this.h=new uo,0,1,e=new bs)}get baseOptions(){return An(this.h,bs,1)}set baseOptions(t){Sn(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?cn(this.h,2,Oe(t.displayNamesLocale)):"displayNamesLocale"in t&&cn(this.h,2),void 0!==t.maxResults?Un(this.h,3,t.maxResults):"maxResults"in t&&cn(this.h,3),void 0!==t.scoreThreshold?Dn(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&cn(this.h,4),void 0!==t.categoryAllowlist?yn(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&cn(this.h,5),void 0!==t.categoryDenylist?yn(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&cn(this.h,6),this.l(t)}G(t,e){return this.j={detections:[]},Va(this,t,e),this.j}H(t,e,n){return this.j={detections:[]},Xa(this,t,n,e),this.j}m(){var t=new Si;xi(t,"input_frame_gpu"),xi(t,"norm_rect"),ki(t,"detections");const e=new ai;Bn(e,lo,this.h);const n=new vi;gi(n,"mediapipe.tasks.vision.ObjectDetectorGraph"),mi(n,"IMAGE:input_frame_gpu"),mi(n,"NORM_RECT:norm_rect"),yi(n,"DETECTIONS:detections"),n.o(e),Ai(t,n),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=Hi(e),this.j.detections.push(Eo(t));Vo(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{Vo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Gc.prototype.detectForVideo=Gc.prototype.H,Gc.prototype.detect=Gc.prototype.G,Gc.prototype.setOptions=Gc.prototype.o,Gc.createFromModelPath=async function(t,e){return Ga(Gc,t,{baseOptions:{modelAssetPath:e}})},Gc.createFromModelBuffer=function(t,e){return Ga(Gc,t,{baseOptions:{modelAssetBuffer:e}})},Gc.createFromOptions=function(t,e){return Ga(Gc,t,e)};function jc(t){t.landmarks=[],t.worldLandmarks=[],t.v=void 0}function Vc(t){try{const e=new class{constructor(t,e,n){this.landmarks=t,this.worldLandmarks=e,this.g=n}close(){this.g?.forEach((t=>{t.close()}))}}(t.landmarks,t.worldLandmarks,t.v);if(!t.u)return e;t.u(e)}finally{Wo(t)}}var Xc=class extends Wa{constructor(t,e){super(new Na(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,Sn(t=this.h=new yo,0,1,e=new bs),this.B=new go,Sn(this.h,0,3,this.B),this.j=new fo,Sn(this.h,0,2,this.j),Un(this.j,4,1),Dn(this.j,2,.5),Dn(this.B,2,.5),Dn(this.h,4,.5)}get baseOptions(){return An(this.h,bs,1)}set baseOptions(t){Sn(this.h,0,1,t)}o(t){return"numPoses"in t&&Un(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&Dn(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&Dn(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&Dn(this.B,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}G(t,e,n){const r="function"!=typeof e?e:{};return this.u="function"==typeof e?e:n,jc(this),Va(this,t,r),Vc(this)}H(t,e,n,r){const i="function"!=typeof n?n:{};return this.u="function"==typeof n?n:r,jc(this),Xa(this,t,i,e),Vc(this)}m(){var t=new Si;xi(t,"image_in"),xi(t,"norm_rect"),ki(t,"normalized_landmarks"),ki(t,"world_landmarks"),ki(t,"segmentation_masks");const e=new ai;Bn(e,_o,this.h);const n=new vi;gi(n,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),mi(n,"IMAGE:image_in"),mi(n,"NORM_RECT:norm_rect"),yi(n,"NORM_LANDMARKS:normalized_landmarks"),yi(n,"WORLD_LANDMARKS:world_landmarks"),n.o(e),Ai(t,n),Xo(this,t),this.g.attachProtoVectorListener("normalized_landmarks",((t,e)=>{this.landmarks=[];for(const e of t)t=ts(e),this.landmarks.push(bo(t));Vo(this,e)})),this.g.attachEmptyPacketListener("normalized_landmarks",(t=>{this.landmarks=[],Vo(this,t)})),this.g.attachProtoVectorListener("world_landmarks",((t,e)=>{this.worldLandmarks=[];for(const e of t)t=qi(e),this.worldLandmarks.push(Ao(t));Vo(this,e)})),this.g.attachEmptyPacketListener("world_landmarks",(t=>{this.worldLandmarks=[],Vo(this,t)})),this.outputSegmentationMasks&&(yi(n,"SEGMENTATION_MASK:segmentation_masks"),zo(this,"segmentation_masks"),this.g.ca("segmentation_masks",((t,e)=>{this.v=t.map((t=>za(this,t,!0,!this.u))),Vo(this,e)})),this.g.attachEmptyPacketListener("segmentation_masks",(t=>{this.v=[],Vo(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Xc.prototype.detectForVideo=Xc.prototype.H,Xc.prototype.detect=Xc.prototype.G,Xc.prototype.setOptions=Xc.prototype.o,Xc.createFromModelPath=function(t,e){return Ga(Xc,t,{baseOptions:{modelAssetPath:e}})},Xc.createFromModelBuffer=function(t,e){return Ga(Xc,t,{baseOptions:{modelAssetBuffer:e}})},Xc.createFromOptions=function(t,e){return Ga(Xc,t,e)},Xc.POSE_CONNECTIONS=Ua([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]),exports.DrawingUtils=xa,exports.FaceDetector=Ha,exports.FaceLandmarker=ic,exports.FaceStylizer=sc,exports.FilesetResolver=Mo,exports.GestureRecognizer=uc,exports.HandLandmarker=fc,exports.ImageClassifier=dc,exports.ImageEmbedder=pc,exports.ImageSegmenter=vc,exports.ImageSegmenterResult=gc,exports.InteractiveSegmenter=Nc,exports.InteractiveSegmenterResult=_c,exports.MPImage=Ca,exports.MPMask=pa,exports.ObjectDetector=Gc,exports.PoseLandmarker=Xc,exports.TaskRunner=Ho,exports.VisionTaskRunner=Wa;
2
2
  //# sourceMappingURL=vision_bundle_cjs.js.map