UNPKG

mind-ar

Version:

web augmented reality framework

18 lines (16 loc) 2.08 MB
var h=q.setTimeout;E.prototype.i=function(K){h(K,0)},E.prototype.l=function(){for(;this.g&&this.g.length;){var K=this.g;this.g=[];for(var k=0;k<K.length;++k){var H=K[k];K[k]=null;try{H()}catch(f){this.j(f)}}}this.g=null},E.prototype.j=function(K){this.i(function(){throw K})},Q.prototype.j=function(){function K(f){return function(m){H||(H=!0,f.call(k,m))}}var k=this,H=!1;return{resolve:K(this.C),reject:K(this.l)}},Q.prototype.C=function(K){if(K===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(K instanceof Q)this.F(K);else{A:switch(typeof K){case"object":var k=K!=null;break A;case"function":k=!0;break A;default:k=!1}k?this.u(K):this.m(K)}},Q.prototype.u=function(K){var k=void 0;try{k=K.then}catch(H){this.l(H);return}typeof k=="function"?this.G(k,K):this.m(K)},Q.prototype.l=function(K){this.s(2,K)},Q.prototype.m=function(K){this.s(1,K)},Q.prototype.s=function(K,k){if(this.h!=0)throw Error("Cannot settle("+K+", "+k+"): Promise already settled in state"+this.h);this.h=K,this.i=k,this.h===2&&this.D(),this.A()},Q.prototype.D=function(){var K=this;h(function(){if(K.B()){var k=q.console;typeof k<"u"&&k.error(K.i)}},1)},Q.prototype.B=function(){if(this.o)return!1;var K=q.CustomEvent,k=q.Event,H=q.dispatchEvent;return typeof H>"u"?!0:(typeof K=="function"?K=new K("unhandledrejection",{cancelable:!0}):typeof k=="function"?K=new k("unhandledrejection",{cancelable:!0}):(K=q.document.createEvent("CustomEvent"),K.initCustomEvent("unhandledrejection",!1,!0,K)),K.promise=this,K.reason=this.i,H(K))},Q.prototype.A=function(){if(this.g!=null){for(var K=0;K<this.g.length;++K)M.h(this.g[K]);this.g=null}};var M=new E;return Q.prototype.F=function(K){var k=this.j();K.J(k.resolve,k.reject)},Q.prototype.G=function(K,k){var H=this.j();try{K.call(k,H.resolve,H.reject)}catch(f){H.reject(f)}},Q.prototype.then=function(K,k){function H($,X){return typeof $=="function"?function(Z){try{f($(Z))}catch(p){m(p)}}:X}var f,m,RA=new Q(function($,X){f=$,m=X});return this.J(H(K,f),H(k,m)),RA},Q.prototype.catch=function(K){return this.then(void 0,K)},Q.prototype.J=function(K,k){function H(){switch(f.h){case 1:K(f.i);break;case 2:k(f.i);break;default:throw Error("Unexpected state: "+f.h)}}var f=this;this.g==null?M.h(H):this.g.push(H),this.o=!0},Q.resolve=R,Q.reject=function(K){return new Q(function(k,H){H(K)})},Q.race=function(K){return new Q(function(k,H){for(var f=b(K),m=f.next();!m.done;m=f.next())R(m.value).J(k,H)})},Q.all=function(K){var k=b(K),H=k.next();return H.done?R([]):new Q(function(f,m){function RA(Z){return function(p){$[Z]=p,X--,X==0&&f($)}}var $=[],X=0;do $.push(void 0),X++,R(H.value).J(RA($.length-1),m),H=k.next();while(!H.done)})},Q}),r("Object.is",function(C){return C||function(Q,E){return Q===E?Q!==0||1/Q===1/E:Q!==Q&&E!==E}}),r("Array.prototype.includes",function(C){return C||function(Q,E){var R=this;R instanceof String&&(R=String(R));var h=R.length;for(E=E||0,0>E&&(E=Math.max(E+h,0));E<h;E++){var M=R[E];if(M===Q||Object.is(M,Q))return!0}return!1}}),r("String.prototype.includes",function(C){return C||function(Q,E){if(this==null)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(Q instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return this.indexOf(Q,E||0)!==-1}}),r("Array.prototype.keys",function(C){return C||function(){return MA(this,function(Q){return Q})}});var DI=this||self;function JA(C,Q){C=C.split(".");var E=DI;C[0]in E||typeof E.execScript>"u"||E.execScript("var "+C[0]);for(var R;C.length&&(R=C.shift());)C.length||Q===void 0?E[R]&&E[R]!==Object.prototype[R]?E=E[R]:E=E[R]={}:E[R]=Q}function tI(C,Q){return Q=String.fromCharCode.apply(null,Q),C==null?Q:C+Q}var TI,sg=typeof TextDecoder<"u",qI,hg=typeof TextEncoder<"u";function ag(C){if(hg)C=(qI||(qI=new TextEncoder)).encode(C);else{var Q=void 0;Q=Q===void 0?!1:Q;for(var E=0,R=new Uint8Array(3*C.length),h=0;h<C.length;h++){var M=C.charCodeAt(h);if(128>M)R[E++]=M;else{if(2048>M)R[E++]=M>>6|192;else{if(55296<=M&&57343>=M){if(56319>=M&&h<C.length){var K=C.charCodeAt(++h);if(56320<=K&&57343>=K){M=1024*(M-55296)+K-56320+65536,R[E++]=M>>18|240,R[E++]=M>>12&63|128,R[E++]=M>>6&63|128,R[E++]=M&63|128;continue}else h--}if(Q)throw Error("Found an unpaired surrogate");M=65533}R[E++]=M>>12|224,R[E++]=M>>6&63|128}R[E++]=M&63|128}}C=R.subarray(0,E)}return C}var yg={},rI=null;function vg(C,Q){Q===void 0&&(Q=0),Kg(),Q=yg[Q];for(var E=Array(Math.floor(C.length/3)),R=Q[64]||"",h=0,M=0;h<C.length-2;h+=3){var K=C[h],k=C[h+1],H=C[h+2],f=Q[K>>2];K=Q[(K&3)<<4|k>>4],k=Q[(k&15)<<2|H>>6],H=Q[H&63],E[M++]=f+K+k+H}switch(f=0,H=R,C.length-h){case 2:f=C[h+1],H=Q[(f&15)<<2]||R;case 1:C=C[h],E[M]=Q[C>>2]+Q[(C&3)<<4|f>>4]+H+R}return E.join("")}function _g(C){var Q=C.length,E=3*Q/4;E%3?E=Math.floor(E):"=.".indexOf(C[Q-1])!=-1&&(E="=.".indexOf(C[Q-2])!=-1?E-2:E-1);var R=new Uint8Array(E),h=0;return $g(C,function(M){R[h++]=M}),R.subarray(0,h)}function $g(C,Q){function E(H){for(;R<C.length;){var f=C.charAt(R++),m=rI[f];if(m!=null)return m;if(!/^[\s\xa0]*$/.test(f))throw Error("Unknown base64 encoding at char: "+f)}return H}Kg();for(var R=0;;){var h=E(-1),M=E(0),K=E(64),k=E(64);if(k===64&&h===-1)break;Q(h<<2|M>>4),K!=64&&(Q(M<<4&240|K>>2),k!=64&&Q(K<<6&192|k))}}function Kg(){if(!rI){rI={};for(var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Q=["+/=","+/","-_=","-_.","-_"],E=0;5>E;E++){var R=C.concat(Q[E].split(""));yg[E]=R;for(var h=0;h<R.length;h++){var M=R[h];rI[M]===void 0&&(rI[M]=h)}}}}var AC=typeof Uint8Array.prototype.slice=="function",Ug;function eI(C,Q,E){return Q===E?Ug||(Ug=new Uint8Array(0)):AC?C.slice(Q,E):new Uint8Array(C.subarray(Q,E))}var KA=0,YA=0;function pA(C,Q){Q=Q===void 0?{}:Q,Q=Q.v===void 0?!1:Q.v,this.h=null,this.g=this.j=this.l=0,this.m=!1,this.v=Q,C&&nI(this,C)}function nI(C,Q){Q=Q.constructor===Uint8Array?Q:Q.constructor===ArrayBuffer?new Uint8Array(Q):Q.constructor===Array?new Uint8Array(Q):Q.constructor===String?_g(Q):Q instanceof Uint8Array?new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength):new Uint8Array(0),C.h=Q,C.l=0,C.j=C.h.length,C.g=C.l}pA.prototype.reset=function(){this.g=this.l};function d(C){for(var Q=128,E=0,R=0,h=0;4>h&&128<=Q;h++)Q=C.h[C.g++],E|=(Q&127)<<7*h;if(128<=Q&&(Q=C.h[C.g++],E|=(Q&127)<<28,R|=(Q&127)>>4),128<=Q)for(h=0;5>h&&128<=Q;h++)Q=C.h[C.g++],R|=(Q&127)<<7*h+3;if(128>Q)return C=E>>>0,Q=R>>>0,(R=Q&2147483648)&&(C=~C+1>>>0,Q=~Q>>>0,C==0&&(Q=Q+1>>>0)),C=4294967296*Q+(C>>>0),R?-C:C;C.m=!0}pA.prototype.i=function(){var C=this.h,Q=C[this.g],E=Q&127;return 128>Q?(this.g+=1,E):(Q=C[this.g+1],E|=(Q&127)<<7,128>Q?(this.g+=2,E):(Q=C[this.g+2],E|=(Q&127)<<14,128>Q?(this.g+=3,E):(Q=C[this.g+3],E|=(Q&127)<<21,128>Q?(this.g+=4,E):(Q=C[this.g+4],E|=(Q&15)<<28,128>Q?(this.g+=5,E>>>0):(this.g+=5,128<=C[this.g++]&&128<=C[this.g++]&&128<=C[this.g++]&&128<=C[this.g++]&&this.g++,E)))))},pA.prototype.o=function(){var C=this.h[this.g],Q=this.h[this.g+1],E=this.h[this.g+2],R=this.h[this.g+3];return this.g+=4,E=(C<<0|Q<<8|E<<16|R<<24)>>>0,C=2*(E>>31)+1,Q=E>>>23&255,E&=8388607,Q==255?E?NaN:1/0*C:Q==0?C*Math.pow(2,-149)*E:C*Math.pow(2,Q-150)*(E+Math.pow(2,23))};var OA=[];function lI(){this.g=new Uint8Array(64),this.h=0}lI.prototype.push=function(C){if(!(this.h+1<this.g.length)){var Q=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(Q)}this.g[this.h++]=C},lI.prototype.length=function(){return this.h},lI.prototype.end=function(){var C=this.g,Q=this.h;return this.h=0,eI(C,0,Q)};function $A(C,Q){for(;127<Q;)C.push(Q&127|128),Q>>>=7;C.push(Q)}function KI(C){var Q={},E=Q.N===void 0?!1:Q.N;this.o={v:Q.v===void 0?!1:Q.v},this.N=E,Q=this.o,OA.length?(E=OA.pop(),Q&&(E.v=Q.v),C&&nI(E,C),C=E):C=new pA(C,Q),this.g=C,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}KI.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};function mA(C){var Q=C.g;if((Q=Q.g==Q.j)||(Q=C.j)||(Q=C.g,Q=Q.m||0>Q.g||Q.g>Q.j),Q)return!1;C.m=C.g.g,Q=C.g.i();var E=Q&7;return E!=0&&E!=5&&E!=1&&E!=2&&E!=3&&E!=4?(C.j=!0,!1):(C.i=Q,C.l=Q>>>3,C.h=E,!0)}function oI(C){switch(C.h){case 0:if(C.h!=0)oI(C);else{for(C=C.g;C.h[C.g]&128;)C.g++;C.g++}break;case 1:C.h!=1?oI(C):(C=C.g,C.g+=8);break;case 2:if(C.h!=2)oI(C);else{var Q=C.g.i();C=C.g,C.g+=Q}break;case 5:C.h!=5?oI(C):(C=C.g,C.g+=4);break;case 3:Q=C.l;do{if(!mA(C)){C.j=!0;break}if(C.h==4){C.l!=Q&&(C.j=!0);break}oI(C)}while(1);break;default:C.j=!0}}function dI(C,Q,E){var R=C.g.j,h=C.g.i(),M=C.g.g+h;if(C.g.j=M,E(Q,C),E=M-C.g.g,E!==0)throw Error("Message parsing ended unexpectedly. Expected to read "+h+" bytes, instead read "+(h-E)+" bytes, either the data ended unexpectedly or the message misreported its own length");return C.g.g=M,C.g.j=R,Q}function uA(C){return C.g.o()}function _I(C){var Q=C.g.i();C=C.g;var E=C.g;C.g+=Q,C=C.h;var R;if(sg)(R=TI)||(R=TI=new TextDecoder("utf-8",{fatal:!1})),R=R.decode(C.subarray(E,E+Q));else{Q=E+Q;for(var h=[],M=null,K,k,H;E<Q;)K=C[E++],128>K?h.push(K):224>K?E>=Q?h.push(65533):(k=C[E++],194>K||(k&192)!==128?(E--,h.push(65533)):h.push((K&31)<<6|k&63)):240>K?E>=Q-1?h.push(65533):(k=C[E++],(k&192)!==128||K===224&&160>k||K===237&&160<=k||((R=C[E++])&192)!==128?(E--,h.push(65533)):h.push((K&15)<<12|(k&63)<<6|R&63)):244>=K?E>=Q-2?h.push(65533):(k=C[E++],(k&192)!==128||(K<<28)+(k-144)>>30||((R=C[E++])&192)!==128||((H=C[E++])&192)!==128?(E--,h.push(65533)):(K=(K&7)<<18|(k&63)<<12|(R&63)<<6|H&63,K-=65536,h.push((K>>10&1023)+55296,(K&1023)+56320))):h.push(65533),8192<=h.length&&(M=tI(M,h),h.length=0);R=tI(M,h)}return R}function Mg(C,Q,E){var R=C.g.i();for(R=C.g.g+R;C.g.g<R;)E.push(Q.call(C.g))}function kg(C,Q){C.h==2?Mg(C,pA.prototype.o,Q):Q.push(uA(C))}function $I(){this.h=[],this.i=0,this.g=new lI}function UI(C,Q){Q.length!==0&&(C.h.push(Q),C.i+=Q.length)}function Ag(C){var Q=C.i+C.g.length();if(Q===0)return new Uint8Array(0);Q=new Uint8Array(Q);for(var E=C.h,R=E.length,h=0,M=0;M<R;M++){var K=E[M];K.length!==0&&(Q.set(K,h),h+=K.length)}return E=C.g,R=E.h,R!==0&&(Q.set(E.g.subarray(0,R),h),E.h=0),C.h=[Q],Q}function jA(C,Q,E){if(E!=null){$A(C.g,8*Q+5),C=C.g;var R=E;R=(E=0>R?1:0)?-R:R,R===0?0<1/R?KA=YA=0:(YA=0,KA=2147483648):isNaN(R)?(YA=0,KA=2147483647):34028234663852886e22<R?(YA=0,KA=(E<<31|2139095040)>>>0):11754943508222875e-54>R?(R=Math.round(R/Math.pow(2,-149)),YA=0,KA=(E<<31|R)>>>0):(Q=Math.floor(Math.log(R)/Math.LN2),R*=Math.pow(2,-Q),R=Math.round(8388608*R),16777216<=R&&++Q,YA=0,KA=(E<<31|Q+127<<23|R&8388607)>>>0),E=KA,C.push(E>>>0&255),C.push(E>>>8&255),C.push(E>>>16&255),C.push(E>>>24&255)}}var BI=typeof Uint8Array=="function";function MI(C,Q,E){if(C!=null)return typeof C=="object"?BI&&C instanceof Uint8Array?E(C):IC(C,Q,E):Q(C)}function IC(C,Q,E){if(Array.isArray(C)){for(var R=Array(C.length),h=0;h<C.length;h++)R[h]=MI(C[h],Q,E);return Array.isArray(C)&&C.W&&cA(R),R}R={};for(h in C)R[h]=MI(C[h],Q,E);return R}function mI(C){return typeof C=="number"?isFinite(C)?C:String(C):C}var fI={W:{value:!0,configurable:!0}};function cA(C){return Array.isArray(C)&&!Object.isFrozen(C)&&Object.defineProperties(C,fI),C}var Ig;function eA(C,Q,E){var R=Ig;Ig=null,C||(C=R),R=this.constructor.ca,C||(C=R?[R]:[]),this.j=R?0:-1,this.m=this.g=null,this.h=C;A:{if(R=this.h.length,C=R-1,R&&(R=this.h[C],!(R===null||typeof R!="object"||Array.isArray(R)||BI&&R instanceof Uint8Array))){this.l=C-this.j,this.i=R;break A}Q!==void 0&&-1<Q?(this.l=Math.max(Q,C+1-this.j),this.i=null):this.l=Number.MAX_VALUE}if(E)for(Q=0;Q<E.length;Q++)C=E[Q],C<this.l?(C+=this.j,(R=this.h[C])?cA(R):this.h[C]=kI):(Sg(this),(R=this.i[C])?cA(R):this.i[C]=kI)}var kI=Object.freeze(cA([]));function Sg(C){var Q=C.l+C.j;C.h[Q]||(C.i=C.h[Q]={})}function UA(C,Q,E){return Q===-1?null:E!==void 0&&E||Q>=C.l?C.i?C.i[Q]:void 0:C.h[Q+C.j]}function ZA(C,Q){var E=E===void 0?!1:E,R=UA(C,Q,E);return R==null&&(R=kI),R===kI&&(R=cA([]),T(C,Q,R,E)),R}function gg(C){var Q=ZA(C,3);if(C.m||(C.m={}),!C.m[3]){for(var E=0;E<Q.length;E++)Q[E]=+Q[E];C.m[3]=!0}return Q}function GI(C,Q,E){return C=UA(C,Q),C??E}function PA(C,Q,E){return C=UA(C,Q),C=C==null?C:+C,C??(E===void 0?0:E)}function T(C,Q,E,R){R!==void 0&&R||Q>=C.l?(Sg(C),C.i[Q]=E):C.h[Q+C.j]=E}function zA(C,Q,E){if(E===-1)return null;if(C.g||(C.g={}),!C.g[E]){var R=UA(C,E,!1);R&&(C.g[E]=new Q(R))}return C.g[E]}function SI(C,Q){C.g||(C.g={});var E=C.g[1];if(!E){var R=ZA(C,1);E=[];for(var h=0;h<R.length;h++)E[h]=new Q(R[h]);C.g[1]=E}return E}function wI(C,Q,E){var R=R===void 0?!1:R;C.g||(C.g={});var h=E&&y(E);C.g[Q]=E,T(C,Q,h,R)}function Jg(C,Q,E,R){var h=SI(C,E);Q=Q||new E,C=ZA(C,1),R!=null?(h.splice(R,0,Q),C.splice(R,0,y(Q))):(h.push(Q),C.push(y(Q)))}eA.prototype.toJSON=function(){var C=y(this);return IC(C,mI,vg)};function y(C,Q){if(C.g)for(var E in C.g){var R=C.g[E];if(Array.isArray(R))for(var h=0;h<R.length;h++)R[h]&&y(R[h]);else R&&y(R)}return C.h}eA.prototype.toString=function(){return y(this).toString()};function JI(C,Q){if(C=C.o){UI(Q,Q.g.end());for(var E=0;E<C.length;E++)UI(Q,C[E])}}function kA(C,Q){if(Q.h==4)return!1;var E=Q.m;return oI(Q),Q.N||(Q=eI(Q.g.h,E,Q.g.g),(E=C.o)?E.push(Q):C.o=[Q]),!0}function FI(C){eA.call(this,C,-1,gC)}nA(FI,eA),FI.prototype.getRows=function(){return UA(this,1)},FI.prototype.getCols=function(){return UA(this,2)},FI.prototype.getPackedDataList=function(){return gg(this)},FI.prototype.getLayout=function(){return GI(this,4,0)};function JC(C,Q){for(;mA(Q);)switch(Q.i){case 8:var E=Q.g.i();T(C,1,E);break;case 16:E=Q.g.i(),T(C,2,E);break;case 29:case 26:kg(Q,C.getPackedDataList());break;case 32:E=d(Q.g),T(C,4,E);break;default:if(!kA(C,Q))return C}return C}var gC=[3];function WA(C,Q){var E=void 0;return new(E||(E=Promise))(function(R,h){function M(H){try{k(Q.next(H))}catch(f){h(f)}}function K(H){try{k(Q.throw(H))}catch(f){h(f)}}function k(H){H.done?R(H.value):new E(function(f){f(H.value)}).then(M,K)}k((Q=Q.apply(C,void 0)).next())})}function VI(C){eA.call(this,C)}nA(VI,eA);function Yg(C,Q){for(;mA(Q);)switch(Q.i){case 8:var E=Q.g.i();T(C,1,E);break;case 21:E=uA(Q),T(C,2,E);break;case 26:E=_I(Q),T(C,3,E);break;case 34:E=_I(Q),T(C,4,E);break;default:if(!kA(C,Q))return C}return C}function oA(C){eA.call(this,C,-1,CC)}nA(oA,eA),oA.prototype.addClassification=function(C,Q){return Jg(this,C,VI,Q),this};var CC=[1];function TA(C){eA.call(this,C)}nA(TA,eA);function RI(C,Q){for(;mA(Q);)switch(Q.i){case 13:var E=uA(Q);T(C,1,E);break;case 21:E=uA(Q),T(C,2,E);break;case 29:E=uA(Q),T(C,3,E);break;case 37:E=uA(Q),T(C,4,E);break;case 45:E=uA(Q),T(C,5,E);break;default:if(!kA(C,Q))return C}return C}function cg(C){eA.call(this,C,-1,D)}nA(cg,eA);function O(C){A:{var Q=new cg;for(C=new KI(C);mA(C);)switch(C.i){case 10:var E=dI(C,new TA,RI);Jg(Q,E,TA,void 0);break;default:if(!kA(Q,C))break A}}return Q}var D=[1];function SA(C){eA.call(this,C)}nA(SA,eA);function NI(C){eA.call(this,C,-1,QC)}nA(NI,eA),NI.prototype.getVertexType=function(){return GI(this,1,0)},NI.prototype.getPrimitiveType=function(){return GI(this,2,0)},NI.prototype.getVertexBufferList=function(){return gg(this)},NI.prototype.getIndexBufferList=function(){return ZA(this,4)};function BC(C,Q){for(;mA(Q);)switch(Q.i){case 8:var E=d(Q.g);T(C,1,E);break;case 16:E=d(Q.g),T(C,2,E);break;case 29:case 26:kg(Q,C.getVertexBufferList());break;case 32:case 34:E=Q;var R=C.getIndexBufferList();E.h==2?Mg(E,pA.prototype.i,R):R.push(E.g.i());break;default:if(!kA(C,Q))return C}return C}var QC=[3,4];function sI(C){eA.call(this,C)}nA(sI,eA),sI.prototype.getMesh=function(){return zA(this,NI,1)},sI.prototype.getPoseTransformMatrix=function(){return zA(this,FI,2)};function bI(C){A:{var Q=new sI;for(C=new KI(C);mA(C);)switch(C.i){case 10:var E=dI(C,new NI,BC);wI(Q,1,E);break;case 18:E=dI(C,new FI,JC),wI(Q,2,E);break;default:if(!kA(Q,C))break A}}return Q}function hI(C,Q,E){if(E=C.createShader(E===0?C.VERTEX_SHADER:C.FRAGMENT_SHADER),C.shaderSource(E,Q),C.compileShader(E),!C.getShaderParameter(E,C.COMPILE_STATUS))throw Error(`Could not compile WebGL shader. `+C.getShaderInfoLog(E));return E}function YI(C){return SI(C,VI).map(function(Q){return{index:GI(Q,1,0),Y:PA(Q,2),label:UA(Q,3)!=null?GI(Q,3,""):void 0,displayName:UA(Q,4)!=null?GI(Q,4,""):void 0}})}function QI(C){return{x:PA(C,1),y:PA(C,2),z:PA(C,3),visibility:UA(C,4)!=null?PA(C,4):void 0}}function cI(C,Q){this.h=C,this.g=Q,this.l=0}function Lg(C,Q,E){return EC(C,Q),typeof C.g.canvas.transferToImageBitmap=="function"?Promise.resolve(C.g.canvas.transferToImageBitmap()):E?Promise.resolve(C.g.canvas):typeof createImageBitmap=="function"?createImageBitmap(C.g.canvas):(C.i===void 0&&(C.i=document.createElement("canvas")),new Promise(function(R){C.i.height=C.g.canvas.height,C.i.width=C.g.canvas.width,C.i.getContext("2d",{}).drawImage(C.g.canvas,0,0,C.g.canvas.width,C.g.canvas.height),R(C.i)}))}function EC(C,Q){var E=C.g;if(C.m===void 0){var R=hI(E,` attribute vec2 aVertex; attribute vec2 aTex; varying vec2 vTex; void main(void) { gl_Position = vec4(aVertex, 0.0, 1.0); vTex = aTex; }`,0),h=hI(E,` precision mediump float; varying vec2 vTex; uniform sampler2D sampler0; void main(){ gl_FragColor = texture2D(sampler0, vTex); }`,1),M=E.createProgram();if(E.attachShader(M,R),E.attachShader(M,h),E.linkProgram(M),!E.getProgramParameter(M,E.LINK_STATUS))throw Error(`Could not compile WebGL program. `+E.getProgramInfoLog(M));R=C.m=M,E.useProgram(R),h=E.getUniformLocation(R,"sampler0"),C.j={I:E.getAttribLocation(R,"aVertex"),H:E.getAttribLocation(R,"aTex"),da:h},C.s=E.createBuffer(),E.bindBuffer(E.ARRAY_BUFFER,C.s),E.enableVertexAttribArray(C.j.I),E.vertexAttribPointer(C.j.I,2,E.FLOAT,!1,0,0),E.bufferData(E.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),E.STATIC_DRAW),E.bindBuffer(E.ARRAY_BUFFER,null),C.o=E.createBuffer(),E.bindBuffer(E.ARRAY_BUFFER,C.o),E.enableVertexAttribArray(C.j.H),E.vertexAttribPointer(C.j.H,2,E.FLOAT,!1,0,0),E.bufferData(E.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),E.STATIC_DRAW),E.bindBuffer(E.ARRAY_BUFFER,null),E.uniform1i(h,0)}R=C.j,E.useProgram(C.m),E.canvas.width=Q.width,E.canvas.height=Q.height,E.viewport(0,0,Q.width,Q.height),E.activeTexture(E.TEXTURE0),C.h.bindTexture2d(Q.glName),E.enableVertexAttribArray(R.I),E.bindBuffer(E.ARRAY_BUFFER,C.s),E.vertexAttribPointer(R.I,2,E.FLOAT,!1,0,0),E.enableVertexAttribArray(R.H),E.bindBuffer(E.ARRAY_BUFFER,C.o),E.vertexAttribPointer(R.H,2,E.FLOAT,!1,0,0),E.bindFramebuffer(E.DRAW_FRAMEBUFFER?E.DRAW_FRAMEBUFFER:E.FRAMEBUFFER,null),E.clearColor(0,0,0,0),E.clear(E.COLOR_BUFFER_BIT),E.colorMask(!0,!0,!0,!0),E.drawArrays(E.TRIANGLE_FAN,0,4),E.disableVertexAttribArray(R.I),E.disableVertexAttribArray(R.H),E.bindBuffer(E.ARRAY_BUFFER,null),C.h.bindTexture2d(0)}function XI(C){this.g=C}var Cg=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Bg(C,Q){return Q+C}function Qg(C,Q){window[C]=Q}function pI(C){var Q=document.createElement("script");return Q.setAttribute("src",C),Q.setAttribute("crossorigin","anonymous"),new Promise(function(E){Q.addEventListener("load",function(){E()},!1),Q.addEventListener("error",function(){E()},!1),document.body.appendChild(Q)})}function XA(){return WA(this,function C(){return tA(C,function(Q){switch(Q.g){case 1:return Q.m=2,V(Q,WebAssembly.instantiate(Cg),4);case 4:Q.g=3,Q.m=0;break;case 2:return Q.m=0,Q.j=null,Q.return(!1);case 3:return Q.return(!0)}})})}function Eg(C){if(this.g=C,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=Promise.resolve(),this.P="",this.B={},this.locateFile=C&&C.locateFile||Bg,typeof window=="object")var Q=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if(typeof location<"u")Q=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";else throw Error("solutions can only be loaded on a web page or in a web worker");if(this.S=Q,C.options){Q=b(Object.keys(C.options));for(var E=Q.next();!E.done;E=Q.next()){E=E.value;var R=C.options[E].default;R!==void 0&&(this.j[E]=typeof R=="function"?R():R)}}}c=Eg.prototype,c.close=function(){return this.i&&this.i.delete(),Promise.resolve()};function OI(C,Q){return C.g.files===void 0?[]:typeof C.g.files=="function"?C.g.files(Q):C.g.files}function iC(C){return WA(C,function Q(){var E=this,R,h,M,K,k,H,f,m,RA,$,X;return tA(Q,function(Z){switch(Z.g){case 1:return R=E,E.R?(h=OI(E,E.j),V(Z,XA(),2)):Z.return();case 2:if(M=Z.h,typeof window=="object")return Qg("createMediapipeSolutionsWasm",{locateFile:E.locateFile}),Qg("createMediapipeSolutionsPackedAssets",{locateFile:E.locateFile}),H=h.filter(function(p){return p.data!==void 0}),f=h.filter(function(p){return p.data===void 0}),m=Promise.all(H.map(function(p){var _=uI(R,p.url);if(p.path!==void 0){var IA=p.path;_=_.then(function(dA){return R.overrideFile(IA,dA),Promise.resolve(dA)})}return _})),RA=Promise.all(f.map(function(p){return p.simd===void 0||p.simd&&M||!p.simd&&!M?pI(R.locateFile(p.url,R.S)):Promise.resolve()})).then(function(){return WA(R,function p(){var _,IA,dA=this;return tA(p,function(NA){if(NA.g==1)return _=window.createMediapipeSolutionsWasm,IA=window.createMediapipeSolutionsPackedAssets,V(NA,_(IA),2);dA.h=NA.h,NA.g=0})})}),$=function(){return WA(R,function p(){var _=this;return tA(p,function(IA){return _.g.graph&&_.g.graph.url?IA=V(IA,uI(_,_.g.graph.url),0):(IA.g=0,IA=void 0),IA})})}(),V(Z,Promise.all([RA,m,$]),7);if(typeof importScripts!="function")throw Error("solutions can only be loaded on a web page or in a web worker");return K=h.filter(function(p){return p.simd===void 0||p.simd&&M||!p.simd&&!M}).map(function(p){return R.locateFile(p.url,R.S)}),importScripts.apply(null,DA(K)),V(Z,createMediapipeSolutionsWasm(Module),6);case 6:E.h=Z.h,E.l=new OffscreenCanvas(1,1),E.h.canvas=E.l,k=E.h.GL.createContext(E.l,{antialias:!1,alpha:!1,ba:typeof WebGL2RenderingContext<"u"?2:1}),E.h.GL.makeContextCurrent(k),Z.g=4;break;case 7:if(E.l=document.createElement("canvas"),X=E.l.getContext("webgl2",{}),!X&&(X=E.l.getContext("webgl",{}),!X))return alert("Failed to create WebGL canvas context when passing video frame."),Z.return();E.D=X,E.h.canvas=E.l,E.h.createContext(E.l,!0,!0,{});case 4:E.i=new E.h.SolutionWasm,E.R=!1,Z.g=0}})})}function ig(C){return WA(C,function Q(){var E=this,R,h,M,K,k,H,f,m;return tA(Q,function(RA){if(RA.g==1){if(E.g.graph&&E.g.graph.url&&E.P===E.g.graph.url)return RA.return();if(E.o=!0,!E.g.graph||!E.g.graph.url){RA.g=2;return}return E.P=E.g.graph.url,V(RA,uI(E,E.g.graph.url),3)}for(RA.g!=2&&(R=RA.h,E.i.loadGraph(R)),h=b(Object.keys(E.B)),M=h.next();!M.done;M=h.next())K=M.value,E.i.overrideFile(K,E.B[K]);if(E.B={},E.g.listeners)for(k=b(E.g.listeners),H=k.next();!H.done;H=k.next())f=H.value,AA(E,f);m=E.j,E.j={},E.setOptions(m),RA.g=0})})}c.reset=function(){return WA(this,function C(){var Q=this;return tA(C,function(E){Q.i&&(Q.i.reset(),Q.m={},Q.s={}),E.g=0})})},c.setOptions=function(C,Q){var E=this;if(Q=Q||this.g.options){for(var R=[],h=[],M={},K=b(Object.keys(C)),k=K.next();!k.done;M={K:M.K,L:M.L},k=K.next()){var H=k.value;H in this.j&&this.j[H]===C[H]||(this.j[H]=C[H],k=Q[H],k!==void 0&&(k.onChange&&(M.K=k.onChange,M.L=C[H],R.push(function(f){return function(){return WA(E,function m(){var RA,$=this;return tA(m,function(X){if(X.g==1)return V(X,f.K(f.L),2);RA=X.h,RA===!0&&($.o=!0),X.g=0})})}}(M))),k.graphOptionXref&&(H={valueNumber:k.type===1?C[H]:0,valueBoolean:k.type===0?C[H]:!1,valueString:k.type===2?C[H]:""},k=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),k.graphOptionXref),H),h.push(k))))}(R.length!==0||h.length!==0)&&(this.o=!0,this.A=(this.A===void 0?[]:this.A).concat(h),this.u=(this.u===void 0?[]:this.u).concat(R))}};function DC(C){return WA(C,function Q(){var E=this,R,h,M,K,k,H,f;return tA(Q,function(m){switch(m.g){case 1:if(!E.o)return m.return();if(!E.u){m.g=2;break}R=b(E.u),h=R.next();case 3:if(h.done){m.g=5;break}return M=h.value,V(m,M(),4);case 4:h=R.next(),m.g=3;break;case 5:E.u=void 0;case 2:if(E.A){for(K=new E.h.GraphOptionChangeRequestList,k=b(E.A),H=k.next();!H.done;H=k.next())f=H.value,K.push_back(f);E.i.changeOptions(K),K.delete(),E.A=void 0}E.o=!1,m.g=0}})})}c.initialize=function(){return WA(this,function C(){var Q=this;return tA(C,function(E){return E.g==1?V(E,iC(Q),2):E.g!=3?V(E,ig(Q),3):V(E,DC(Q),0)})})};function uI(C,Q){return WA(C,function E(){var R=this,h,M;return tA(E,function(K){return Q in R.F?K.return(R.F[Q]):(h=R.locateFile(Q,""),M=fetch(h).then(function(k){return k.arrayBuffer()}),R.F[Q]=M,K.return(M))})})}c.overrideFile=function(C,Q){this.i?this.i.overrideFile(C,Q):this.B[C]=Q},c.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},c.send=function(C,Q){return WA(this,function E(){var R=this,h,M,K,k,H,f,m,RA,$;return tA(E,function(X){switch(X.g){case 1:return R.g.inputs?(h=1e3*(Q??performance.now()),V(X,R.C,2)):X.return();case 2:return V(X,R.initialize(),3);case 3:for(M=new R.h.PacketDataList,K=b(Object.keys(C)),k=K.next();!k.done;k=K.next())if(H=k.value,f=R.g.inputs[H]){A:{var Z=R,p=C[H];switch(f.type){case"video":var _=Z.m[f.stream];if(_||(_=new cI(Z.h,Z.D),Z.m[f.stream]=_),Z=_,Z.l===0&&(Z.l=Z.h.createTexture()),typeof HTMLVideoElement<"u"&&p instanceof HTMLVideoElement){var IA=p.videoWidth;_=p.videoHeight}else typeof HTMLImageElement<"u"&&p instanceof HTMLImageElement?(IA=p.naturalWidth,_=p.naturalHeight):(IA=p.width,_=p.height);_={glName:Z.l,width:IA,height:_},IA=Z.g,IA.canvas.width=_.width,IA.canvas.height=_.height,IA.activeTexture(IA.TEXTURE0),Z.h.bindTexture2d(Z.l),IA.texImage2D(IA.TEXTURE_2D,0,IA.RGBA,IA.RGBA,IA.UNSIGNED_BYTE,p),Z.h.bindTexture2d(0),Z=_;break A;case"detections":for(_=Z.m[f.stream],_||(_=new XI(Z.h),Z.m[f.stream]=_),Z=_,Z.data||(Z.data=new Z.g.DetectionListData),Z.data.reset(p.length),_=0;_<p.length;++_){IA=p[_];var dA=Z.data,NA=dA.setBoundingBox,VA=_,LA=IA.T,j=new SA;T(j,1,LA.Z),T(j,2,LA.$),T(j,3,LA.height),T(j,4,LA.width),T(j,5,LA.rotation),T(j,6,LA.X);var BA=LA=new $I;jA(BA,1,UA(j,1)),jA(BA,2,UA(j,2)),jA(BA,3,UA(j,3)),jA(BA,4,UA(j,4)),jA(BA,5,UA(j,5));var GA=UA(j,6);if(GA!=null&&GA!=null){$A(BA.g,48);var u=BA.g,QA=GA;GA=0>QA,QA=Math.abs(QA);var wA=QA>>>0;for(QA=Math.floor((QA-wA)/4294967296),QA>>>=0,GA&&(QA=~QA>>>0,wA=(~wA>>>0)+1,4294967295<wA&&(wA=0,QA++,4294967295<QA&&(QA=0))),KA=wA,YA=QA,GA=KA,wA=YA;0<wA||127<GA;)u.push(GA&127|128),GA=(GA>>>7|wA<<25)>>>0,wA>>>=7;u.push(GA)}if(JI(j,BA),LA=Ag(LA),NA.call(dA,VA,LA),IA.O)for(dA=0;dA<IA.O.length;++dA)j=IA.O[dA],BA=!!j.visibility,NA=Z.data,VA=NA.addNormalizedLandmark,LA=_,j=Object.assign(Object.assign({},j),{visibility:BA?j.visibility:0}),BA=new TA,T(BA,1,j.x),T(BA,2,j.y),T(BA,3,j.z),j.visibility&&T(BA,4,j.visibility),u=j=new $I,jA(u,1,UA(BA,1)),jA(u,2,UA(BA,2)),jA(u,3,UA(BA,3)),jA(u,4,UA(BA,4)),jA(u,5,UA(BA,5)),JI(BA,u),j=Ag(j),VA.call(NA,LA,j);if(IA.M)for(dA=0;dA<IA.M.length;++dA){if(NA=Z.data,VA=NA.addClassification,LA=_,j=IA.M[dA],BA=new VI,T(BA,2,j.Y),j.index&&T(BA,1,j.index),j.label&&T(BA,3,j.label),j.displayName&&T(BA,4,j.displayName),u=j=new $I,wA=UA(BA,1),wA!=null&&wA!=null)if($A(u.g,8),GA=u.g,0<=wA)$A(GA,wA);else{for(QA=0;9>QA;QA++)GA.push(wA&127|128),wA>>=7;GA.push(1)}jA(u,2,UA(BA,2)),GA=UA(BA,3),GA!=null&&(GA=ag(GA),$A(u.g,26),$A(u.g,GA.length),UI(u,u.g.end()),UI(u,GA)),GA=UA(BA,4),GA!=null&&(GA=ag(GA),$A(u.g,34),$A(u.g,GA.length),UI(u,u.g.end()),UI(u,GA)),JI(BA,u),j=Ag(j),VA.call(NA,LA,j)}}Z=Z.data;break A;default:Z={}}}switch(m=Z,RA=f.stream,f.type){case"video":M.pushTexture2d(Object.assign(Object.assign({},m),{stream:RA,timestamp:h}));break;case"detections":$=m,$.stream=RA,$.timestamp=h,M.pushDetectionList($);break;default:throw Error("Unknown input config type: '"+f.type+"'")}}return R.i.send(M),V(X,R.C,4);case 4:M.delete(),X.g=0}})})};function qA(C,Q,E){return WA(C,function R(){var h,M,K,k,H,f,m=this,RA,$,X,Z,p,_,IA,dA;return tA(R,function(NA){switch(NA.g){case 1:if(!E)return NA.return(Q);for(h={},M=0,K=b(Object.keys(E)),k=K.next();!k.done;k=K.next())H=k.value,f=E[H],typeof f!="string"&&f.type==="texture"&&Q[f.stream]!==void 0&&++M;1<M&&(m.G=!1),RA=b(Object.keys(E)),k=RA.next();case 2:if(k.done){NA.g=4;break}if($=k.value,X=E[$],typeof X=="string")return IA=h,dA=$,V(NA,LI(m,$,Q[X]),14);if(Z=Q[X.stream],X.type==="detection_list"){if(Z){for(var VA=Z.getRectList(),LA=Z.getLandmarksList(),j=Z.getClassificationsList(),BA=[],GA=0;GA<VA.size();++GA){var u=VA.get(GA);A:{var QA=new SA;for(u=new KI(u);mA(u);)switch(u.i){case 13:var wA=uA(u);T(QA,1,wA);break;case 21:wA=uA(u),T(QA,2,wA);break;case 29:wA=uA(u),T(QA,3,wA);break;case 37:wA=uA(u),T(QA,4,wA);break;case 45:wA=uA(u),T(QA,5,wA);break;case 48:wA=d(u.g),T(QA,6,wA);break;default:if(!kA(QA,u))break A}}QA={Z:PA(QA,1),$:PA(QA,2),height:PA(QA,3),width:PA(QA,4),rotation:PA(QA,5,0),X:GI(QA,6,0)},u=SI(O(LA.get(GA)),TA).map(QI);var II=j.get(GA);A:for(wA=new oA,II=new KI(II);mA(II);)switch(II.i){case 10:wA.addClassification(dI(II,new VI,Yg));break;default:if(!kA(wA,II))break A}QA={T:QA,O:u,M:YI(wA)},BA.push(QA)}VA=BA}else VA=[];h[$]=VA,NA.g=7;break}if(X.type==="proto_list"){if(Z){for(VA=Array(Z.size()),LA=0;LA<Z.size();LA++)VA[LA]=Z.get(LA);Z.delete()}else VA=[];h[$]=VA,NA.g=7;break}if(Z===void 0){NA.g=3;break}if(X.type==="float_list"){h[$]=Z,NA.g=7;break}if(X.type==="proto"){h[$]=Z,NA.g=7;break}if(X.type!=="texture")throw Error("Unknown output config type: '"+X.type+"'");return p=m.s[$],p||(p=new cI(m.h,m.D),m.s[$]=p),V(NA,Lg(p,Z,m.G),13);case 13:_=NA.h,h[$]=_;case 7:X.transform&&h[$]&&(h[$]=X.transform(h[$])),NA.g=3;break;case 14:IA[dA]=NA.h;case 3:k=RA.next(),NA.g=2;break;case 4:return NA.return(h)}})})}function LI(C,Q,E){return WA(C,function R(){var h=this,M;return tA(R,function(K){return typeof E=="number"||E instanceof Uint8Array||E instanceof h.h.Uint8BlobList?K.return(E):E instanceof h.h.Texture2dDataOut?(M=h.s[Q],M||(M=new cI(h.h,h.D),h.s[Q]=M),K.return(Lg(M,E,h.G))):K.return(void 0)})})}function AA(C,Q){for(var E=Q.name||"$",R=[].concat(DA(Q.wants)),h=new C.h.StringList,M=b(Q.wants),K=M.next();!K.done;K=M.next())h.push_back(K.value);M=C.h.PacketListener.implement({onResults:function(k){for(var H={},f=0;f<Q.wants.length;++f)H[R[f]]=k.get(f);var m=C.listeners[E];m&&(C.C=qA(C,H,Q.outs).then(function(RA){RA=m(RA);for(var $=0;$<Q.wants.length;++$){var X=H[R[$]];typeof X=="object"&&X.hasOwnProperty&&X.hasOwnProperty("delete")&&X.delete()}RA&&(C.C=RA)}))}}),C.i.attachMultiListener(h,M),h.delete()}c.onResults=function(C,Q){this.listeners[Q||"$"]=C},JA("Solution",Eg),JA("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"});function AI(C){C=bI(C);var Q=C.getMesh();if(!Q)return C;var E=new Float32Array(Q.getVertexBufferList());Q.getVertexBufferList=function(){return E};var R=new Uint32Array(Q.getIndexBufferList());return Q.getIndexBufferList=function(){return R},C}var oC={files:[{url:"face_mesh_solution_packed_assets_loader.js"},{simd:!0,url:"face_mesh_solution_simd_wasm_bin.js"},{simd:!1,url:"face_mesh_solution_wasm_bin.js"}],graph:{url:"face_mesh.binarypb"},listeners:[{wants:["multi_face_geometry","image_transformed","multi_face_landmarks"],outs:{image:"image_transformed",multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:function(C){return C.map(AI)}},multiFaceLandmarks:{type:"proto_list",stream:"multi_face_landmarks",transform:function(C){return C.map(function(Q){return SI(O(Q),TA).map(QI)})}}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumFaces:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorNumFaces",fieldName:"int_value"}},refineLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facelandmarkfrontgpu__facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"facelandmarkfrontgpu__facelandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}},Hg=[[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]],tg=[[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]],jI=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],PI=[[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]],Dg=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],qg=[[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]],rg=[].concat(DA(Hg),DA(tg),DA(jI),DA(PI),DA(Dg),DA(qg));function HI(C){C=C||{},C=Object.assign(Object.assign({},oC),C),this.g=new Eg(C)}c=HI.prototype,c.close=function(){return this.g.close(),Promise.resolve()},c.onResults=function(C){this.g.onResults(C)},c.initialize=function(){return WA(this,function C(){var Q=this;return tA(C,function(E){return V(E,Q.g.initialize(),0)})})},c.reset=function(){this.g.reset()},c.send=function(C){return WA(this,function Q(){var E=this;return tA(Q,function(R){return V(R,E.g.send(C),0)})})},c.setOptions=function(C){this.g.setOptions(C)},JA("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),JA("FaceMesh",HI),JA("FACEMESH_LIPS",Hg),JA("FACEMESH_LEFT_EYE",tg),JA("FACEMESH_LEFT_EYEBROW",jI),JA("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),JA("FACEMESH_RIGHT_EYE",PI),JA("FACEMESH_RIGHT_EYEBROW",Dg),JA("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),JA("FACEMESH_FACE_OVAL",qg),JA("FACEMESH_CONTOURS",rg),JA("FACEMESH_TESSELATION",[[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