UNPKG

careplix-web-algo

Version:

CarePlix Web NPM Package to process Raw-Data from Camera Input

2 lines 147 kB
var ps=Object.freeze,A2=Object.defineProperty;var gs=(e,t)=>ps(A2(e,"raw",{value:ps(t||e.slice())}));var Bt=typeof self<"u"?self:{};function kn(e,t){e:{for(var n=["CLOSURE_FLAGS"],r=Bt,i=0;i<n.length;i++)if((r=r[n[i]])==null){n=null;break e}n=r}return(e=n&&n[e])!=null?e:t}function yt(){throw Error("Invalid UTF8")}function ms(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}var Vn,Nr,k2=typeof TextDecoder<"u",x2,S2=typeof TextEncoder<"u";function xo(e){if(S2)e=(x2||(x2=new TextEncoder)).encode(e);else{let n=0,r=new Uint8Array(3*e.length);for(let i=0;i<e.length;i++){var t=e.charCodeAt(i);if(t<128)r[n++]=t;else{if(t<2048)r[n++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&i<e.length){let s=e.charCodeAt(++i);if(s>=56320&&s<=57343){t=1024*(t-55296)+s-56320+65536,r[n++]=t>>18|240,r[n++]=t>>12&63|128,r[n++]=t>>6&63|128,r[n++]=63&t|128;continue}i--}t=65533}r[n++]=t>>12|224,r[n++]=t>>6&63|128}r[n++]=63&t|128}}e=n===r.length?r:r.subarray(0,n)}return e}function So(e){Bt.setTimeout((()=>{throw e}),0)}var Wr,L2=kn(610401301,!1),ys=kn(748402147,!0),fi=kn(824648567,!0),pi=kn(824656860,kn(1,!0));function vs(){var e=Bt.navigator;return e&&(e=e.userAgent)?e:""}var _s=Bt.navigator;function or(e){return or[" "](e),e}Wr=_s&&_s.userAgentData||null,or[" "]=function(){};var Lo={},vn=null;function F2(e){let t=e.length,n=3*t/4;n%3?n=Math.floor(n):"=.".indexOf(e[t-1])!=-1&&(n="=.".indexOf(e[t-2])!=-1?n-2:n-1);let r=new Uint8Array(n),i=0;return(function(s,o){function c(u){for(;a<s.length;){let h=s.charAt(a++),l=vn[h];if(l!=null)return l;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return u}Fo();let a=0;for(;;){let u=c(-1),h=c(0),l=c(64),d=c(64);if(d===64&&u===-1)break;o(u<<2|h>>4),l!=64&&(o(h<<4&240|l>>2),d!=64&&o(l<<6&192|d))}})(e,(function(s){r[i++]=s})),i!==n?r.subarray(0,i):r}function Fo(){if(!vn){vn={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){let r=e.concat(t[n].split(""));Lo[n]=r;for(let i=0;i<r.length;i++){let s=r[i];vn[s]===void 0&&(vn[s]=i)}}}}var M2=typeof Uint8Array<"u",Mo=!(!(L2&&Wr&&Wr.brands.length>0)&&(vs().indexOf("Trident")!=-1||vs().indexOf("MSIE")!=-1))&&typeof btoa=="function",ws=/[-_.]/g,I2={"-":"+",_:"/",".":"="};function R2(e){return I2[e]||""}function Io(e){if(!Mo)return F2(e);e=ws.test(e)?e.replace(ws,R2):e,e=atob(e);let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function gi(e){return M2&&e!=null&&e instanceof Uint8Array}var Gt={};function kt(){return P2||(P2=new He(null,Gt))}function mi(e){Ro(Gt);var t=e.g;return(t=t==null||gi(t)?t:typeof t=="string"?Io(t):null)==null?t:e.g=t}var He=class{h(){return new Uint8Array(mi(this)||0)}constructor(e,t){if(Ro(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}},P2,Dr;function Ro(e){if(e!==Gt)throw Error("illegal external caller")}function Po(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function zr(e){return Po(e=Error(e),"warning"),e}function jt(e,t){if(e!=null){var n=Dr!=null?Dr:Dr={},r=n[e]||0;r>=t||(n[e]=r+1,Po(e=Error(),"incident"),So(e))}}function Zt(){return typeof BigInt=="function"}var Qt=typeof Symbol=="function"&&typeof Symbol()=="symbol";function We(e,t,n=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var C2=We("jas",void 0,!0),Es=We(void 0,"0di"),gn=We(void 0,"1oa"),be=We(void 0,Symbol()),O2=We(void 0,"0ub"),N2=We(void 0,"0ubs"),Kr=We(void 0,"0ubsb"),D2=We(void 0,"0actk"),Vt=We("m_m","Pa",!0),bs=We(),Co={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},Oo=Object.defineProperties,p=Qt?C2:"Ga",Lt,Ts=[];function In(e,t){Qt||p in e||Oo(e,Co),e[p]|=t}function re(e,t){Qt||p in e||Oo(e,Co),e[p]=t}function Rn(e){return In(e,34),e}function xn(e){return In(e,8192),e}re(Ts,7),Lt=Object.freeze(Ts);var Xt={};function Ae(e,t){return t===void 0?e.h!==xt&&!!(2&(0|e.v[p])):!!(2&t)&&e.h!==xt}var xt={};function yi(e,t){if(e!=null){if(typeof e=="string")e=e?new He(e,Gt):kt();else if(e.constructor!==He)if(gi(e))e=e.length?new He(new Uint8Array(e),Gt):kt();else{if(!t)throw Error();e=void 0}}return e}var Zn=class{constructor(t,n,r){this.g=t,this.h=n,this.l=r}next(){let t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}},U2=Object.freeze({});function No(e,t,n){let r=128&t?0:-1,i=e.length;var s;(s=!!i)&&(s=(s=e[i-1])!=null&&typeof s=="object"&&s.constructor===Object);let o=i+(s?-1:0);for(t=128&t?1:0;t<o;t++)n(t-r,e[t]);if(s){e=e[i-1];for(let c in e)!isNaN(c)&&n(+c,e[c])}}var Do={};function en(e){return 128&e?Do:void 0}function ar(e){return e.Na=!0,e}var B2=ar((e=>typeof e=="number")),As=ar((e=>typeof e=="string")),G2=ar((e=>typeof e=="boolean")),cr=typeof Bt.BigInt=="function"&&typeof Bt.BigInt(0)=="bigint";function Te(e){var t=e;if(As(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(B2(t)&&!Number.isSafeInteger(t))throw Error(String(t));return cr?BigInt(e):e=G2(e)?e?"1":"0":As(e)?e.trim()||"0":String(e)}var qr=ar((e=>cr?e>=V2&&e<=Y2:e[0]==="-"?ks(e,j2):ks(e,X2))),j2=Number.MIN_SAFE_INTEGER.toString(),V2=cr?BigInt(Number.MIN_SAFE_INTEGER):void 0,X2=Number.MAX_SAFE_INTEGER.toString(),Y2=cr?BigInt(Number.MAX_SAFE_INTEGER):void 0;function ks(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r>i)return!1;if(r<i)return!0}}var H2=typeof Uint8Array.prototype.slice=="function",W2,j=0,$=0;function xs(e){let t=e>>>0;j=t,$=(e-t)/4294967296>>>0}function Yt(e){if(e<0){xs(-e);let[t,n]=Ei(j,$);j=t>>>0,$=n>>>0}else xs(e)}function vi(e){let t=W2||(W2=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),$=0,j=t.getUint32(0,!0)}function $r(e,t){let n=4294967296*t+(e>>>0);return Number.isSafeInteger(n)?n:Sn(e,t)}function z2(e,t){return Te(Zt()?BigInt.asUintN(64,(BigInt(t>>>0)<<BigInt(32))+BigInt(e>>>0)):Sn(e,t))}function _i(e,t){let n=2147483648&t;return n&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=$r(e,t))=="number"?n?-e:e:n?"-"+e:e}function Uo(e,t){return Zt()?Te(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(t))<<BigInt(32))+BigInt.asUintN(32,BigInt(e)))):Te(wi(e,t))}function Sn(e,t){if(e>>>=0,(t>>>=0)<=2097151)var n=""+(4294967296*t+e);else Zt()?n=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(n=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),n+=8147497*t,t*=2,e>=1e7&&(n+=e/1e7>>>0,e%=1e7),n>=1e7&&(t+=n/1e7>>>0,n%=1e7),n=t+Ss(n)+Ss(e));return n}function Ss(e){return e=String(e),"0000000".slice(e.length)+e}function wi(e,t){if(2147483648&t)if(Zt())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{let[n,r]=Ei(e,t);e="-"+Sn(n,r)}else e=Sn(e,t);return e}function hr(e){if(e.length<16)Yt(Number(e));else if(Zt())e=BigInt(e),j=Number(e&BigInt(4294967295))>>>0,$=Number(e>>BigInt(32)&BigInt(4294967295));else{let t=+(e[0]==="-");$=j=0;let n=e.length;for(let r=t,i=(n-t)%6+t;i<=n;r=i,i+=6){let s=Number(e.slice(r,i));$*=1e6,j=1e6*j+s,j>=4294967296&&($+=Math.trunc(j/4294967296),$>>>=0,j>>>=0)}if(t){let[r,i]=Ei(j,$);j=r,$=i}}}function Ei(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function De(e){return Array.prototype.slice.call(e)}var Pn=typeof BigInt=="function"?BigInt.asIntN:void 0,K2=typeof BigInt=="function"?BigInt.asUintN:void 0,St=Number.isSafeInteger,ur=Number.isFinite,Ht=Math.trunc,q2=Te(0);function _n(e){if(e!=null&&typeof e!="number")throw Error("Value of float/double field must be a number, found ".concat(typeof e,": ").concat(e));return e}function Ye(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Ln(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error("Expected boolean but got ".concat(t!="object"?t:e?Array.isArray(e)?"array":t:"null",": ").concat(e))}return e}function Bo(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}var $2=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Cn(e){switch(typeof e){case"bigint":return!0;case"number":return ur(e);case"string":return $2.test(e);default:return!1}}function tn(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return ur(e)?0|e:void 0}function Go(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return ur(e)?e>>>0:void 0}function jo(e){let t=e.length;return(e[0]==="-"?t<20||t===20&&e<="-9223372036854775808":t<19||t===19&&e<="9223372036854775807")?e:(hr(e),wi(j,$))}function bi(e){return e=Ht(e),St(e)||(Yt(e),e=_i(j,$)),e}function Vo(e){var t=Ht(Number(e));return St(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),jo(e))}function Xo(e){var t=Ht(Number(e));return St(t)?Te(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Zt()?Te(Pn(64,BigInt(e))):Te(jo(e)))}function Yo(e){return St(e)?e=Te(bi(e)):(e=Ht(e),St(e)?e=String(e):(Yt(e),e=wi(j,$)),e=Te(e)),e}function J2(e){return e==null?e:typeof e=="bigint"?(qr(e)?e=Number(e):(e=Pn(64,e),e=qr(e)?Number(e):String(e)),e):Cn(e)?typeof e=="number"?bi(e):Vo(e):void 0}function Qn(e){let t=typeof e;return e==null?e:t==="bigint"?Te(Pn(64,e)):Cn(e)?t==="string"?Xo(e):Yo(e):void 0}function Ho(e){if(typeof e!="string")throw Error();return e}function On(e){if(e!=null&&typeof e!="string")throw Error();return e}function he(e){return e==null||typeof e=="string"?e:void 0}function Ti(e,t,n,r){return e!=null&&e[Vt]===Xt?e:Array.isArray(e)?((r=(n=0|e[p])|32&r|2&r)!==n&&re(e,r),new t(e)):(n?2&r?((e=t[Es])||(Rn((e=new t).v),e=t[Es]=e),t=e):t=new t:t=void 0,t)}function Z2(e,t,n){if(t)e:{if(!Cn(t=e))throw zr("int64");switch(typeof t){case"string":t=Xo(t);break e;case"bigint":t=Te(Pn(64,t));break e;default:t=Yo(t)}}else t=Qn(e);return(e=t)==null?n?q2:void 0:e}var Q2={},e1=(function(){try{return or(new class extends Map{constructor(){super()}}),!1}catch{return!0}})(),En=class{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,n){return this.g.set(t,n),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,n){return this.g.forEach(t,n)}[Symbol.iterator](){return this.entries()}},t1=e1?(Object.setPrototypeOf(En.prototype,Map.prototype),Object.defineProperties(En.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),En):class extends Map{constructor(){super()}};function Ls(e){return e}function Ur(e){if(2&e.J)throw Error("Cannot mutate an immutable Map")}var et=class extends t1{constructor(e,t,n=Ls,r=Ls){super(),this.J=0|e[p],this.K=t,this.S=n,this.fa=this.K?n1:r;for(let i=0;i<e.length;i++){let s=e[i],o=n(s[0],!1,!0),c=s[1];t?c===void 0&&(c=null):c=r(s[1],!1,!0,void 0,void 0,this.J),super.set(o,c)}}V(e){return xn(Array.from(super.entries(),e))}clear(){Ur(this),super.clear()}delete(e){return Ur(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new Zn(e,r1,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new Zn(e,et.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.K?super.forEach(((n,r,i)=>{e.call(t,i.get(r),r,i)})):super.forEach(e,t)}set(e,t){return Ur(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.fa(t,!0,!0,this.K,!1,this.J))}Ma(e){let t=this.S(e[0],!1,!0);e=e[1],e=this.K?e===void 0?null:e:this.fa(e,!1,!0,void 0,!1,this.J),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);let t=super.get(e);if(t!==void 0){var n=this.K;return n?((n=this.fa(t,!1,!0,n,this.ra,this.J))!==t&&super.set(e,n),n):t}}[Symbol.iterator](){return this.entries()}};function n1(e,t,n,r,i,s){return e=Ti(e,r,n,s),i&&(e=ki(e)),e}function r1(e){return[e,this.get(e)]}var i1;function Fs(){return i1||(i1=new et(Rn([]),void 0,void 0,void 0,Q2))}function lr(e){return be?e[be]:void 0}function er(e,t){for(let n in e)!isNaN(n)&&t(e,+n,e[n])}et.prototype.toJSON=void 0;var Jr=class{},s1={Ka:!0};function o1(e,t){t<100||jt(N2,1)}function dr(e,t,n,r){let i=r!==void 0;r=!!r;var s,o=be;!i&&Qt&&o&&(s=e[o])&&er(s,o1),o=[];var c=e.length;let a;s=4294967295;let u=!1,h=!!(64&t),l=h?128&t?0:-1:void 0;1&t||(a=c&&e[c-1],a!=null&&typeof a=="object"&&a.constructor===Object?s=--c:a=void 0,!h||128&t||i||(u=!0,s=s-l+l)),t=void 0;for(var d=0;d<c;d++){let m=e[d];if(m!=null&&(m=n(m,r))!=null)if(h&&d>=s){let b=d-l;(t!=null?t:t={})[b]=m}else o[d]=m}if(a)for(let m in a){if((c=a[m])==null||(c=n(c,r))==null)continue;let b;d=+m,h&&!Number.isNaN(d)&&(b=d+l)<s?o[b]=c:(t!=null?t:t={})[m]=c}return t&&(u?o.push(t):o[s]=t),i&&be&&(e=lr(e))&&e instanceof Jr&&(o[be]=(function(m){let b=new Jr;return er(m,((k,X,K)=>{b[X]=De(K)})),b.da=m.da,b})(e)),o}function a1(e){return e[0]=Fn(e[0]),e[1]=Fn(e[1]),e}function Fn(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return qr(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Array.isArray(e)){var t=0|e[p];return e.length===0&&1&t?void 0:dr(e,t,Fn)}if(e!=null&&e[Vt]===Xt)return Wo(e);if(e instanceof He){if((t=e.g)==null)e="";else if(typeof t=="string")e=t;else{if(Mo){for(var n="",r=0,i=t.length-10240;r<i;)n+=String.fromCharCode.apply(null,t.subarray(r,r+=10240));n+=String.fromCharCode.apply(null,r?t.subarray(r):t),t=btoa(n)}else{n===void 0&&(n=0),Fo(),n=Lo[n],r=Array(Math.floor(t.length/3)),i=n[64]||"";let u=0,h=0;for(;u<t.length-2;u+=3){var s=t[u],o=t[u+1],c=t[u+2],a=n[s>>2];s=n[(3&s)<<4|o>>4],o=n[(15&o)<<2|c>>6],c=n[63&c],r[h++]=a+s+o+c}switch(a=0,c=i,t.length-u){case 2:c=n[(15&(a=t[u+1]))<<2]||i;case 1:t=t[u],r[h]=n[t>>2]+n[(3&t)<<4|a>>4]+c+i}t=r.join("")}e=e.g=t}return e}return e instanceof et?e=e.size!==0?e.V(a1):void 0:void 0}return e}function Wo(e){return dr(e=e.v,0|e[p],Fn)}var c1,h1;function wt(e,t){return zo(e,t[0],t[1])}function zo(e,t,n,r=0){if(e==null){var i=32;n?(e=[n],i|=128):e=[],t&&(i=-16760833&i|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(i=0|e[p],ys&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&(function(){if(ys)throw Error("carr");jt(D2,5)})(),256&i)throw Error("farr");if(64&i)return(i|r)!==i&&re(e,i|r),e;if(n&&(i|=128,n!==e[0]))throw Error("mid");e:{i|=64;var s=(n=e).length;if(s){var o=s-1;let a=n[o];if(a!=null&&typeof a=="object"&&a.constructor===Object){if((o-=t=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var c in a)(s=+c)<o&&(n[s+t]=a[c],delete a[c]);i=-16760833&i|(1023&o)<<14;break e}}if(t){if((c=Math.max(t,s-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&c)<<14}}}return re(e,64|i|r),e}function u1(e,t){if(typeof e!="object")return e;if(Array.isArray(e)){var n=0|e[p];return e.length===0&&1&n?void 0:Ms(e,n,t)}if(e!=null&&e[Vt]===Xt)return Is(e);if(e instanceof et){if(2&(t=e.J))return e;if(!e.size)return;if(n=Rn(e.V()),e.K)for(e=0;e<n.length;e++){let r=n[e],i=r[1];i=i==null||typeof i!="object"?void 0:i!=null&&i[Vt]===Xt?Is(i):Array.isArray(i)?Ms(i,0|i[p],!!(32&t)):void 0,r[1]=i}return n}return e instanceof He?e:void 0}function Ms(e,t,n){return 2&t||(!n||4096&t||16&t?e=nn(e,t,!1,n&&!(16&t)):(In(e,34),4&t&&Object.freeze(e))),e}function Ai(e,t,n){return e=new e.constructor(t),n&&(e.h=xt),e.m=xt,e}function Is(e){let t=e.v,n=0|t[p];return Ae(e,n)?e:xi(e,t,n)?Ai(e,t):nn(t,n)}function nn(e,t,n,r){return r!=null||(r=!!(34&t)),e=dr(e,t,u1,r),r=32,n&&(r|=2),re(e,t=16769217&t|r),e}function ki(e){let t=e.v,n=0|t[p];return Ae(e,n)?xi(e,t,n)?Ai(e,t,!0):new e.constructor(nn(t,n,!1)):e}function rn(e){if(e.h!==xt)return!1;var t=e.v;return In(t=nn(t,0|t[p]),2048),e.v=t,e.h=void 0,e.m=void 0,!0}function sn(e){if(!rn(e)&&Ae(e,0|e.v[p]))throw Error()}function Ft(e,t){t===void 0&&(t=0|e[p]),32&t&&!(4096&t)&&re(e,4096|t)}function xi(e,t,n){return!!(2&n)||!(!(32&n)||4096&n)&&(re(t,2|n),e.h=xt,!0)}var l1=Te(0),ot={};function B(e,t,n,r,i){if((t=tt(e.v,t,n,i))!==null||r&&e.m!==xt)return t}function tt(e,t,n,r){if(t===-1)return null;let i=t+(n?0:-1),s=e.length-1,o,c;if(!(s<1+(n?0:-1))){if(i>=s)if(o=e[s],o!=null&&typeof o=="object"&&o.constructor===Object)n=o[t],c=!0;else{if(i!==s)return;n=o}else n=e[i];if(r&&n!=null){if((r=r(n))==null)return r;if(!Object.is(r,n))return c?o[t]=r:e[i]=r,r}return n}}function C(e,t,n,r){sn(e),te(e=e.v,0|e[p],t,n,r)}function te(e,t,n,r,i){let s=n+(i?0:-1);var o=e.length-1;if(o>=1+(i?0:-1)&&s>=o){let c=e[o];if(c!=null&&typeof c=="object"&&c.constructor===Object)return c[n]=r,t}return s<=o?(e[s]=r,t):(r!==void 0&&(n>=(o=(t!=null?t:t=0|e[p])>>14&1023||536870912)?r!=null&&(e[o+(i?0:-1)]={[n]:r}):e[s]=r),t)}function vt(){return U2===void 0?2:4}function _t(e,t,n,r,i){let s=e.v,o=0|s[p];r=Ae(e,o)?1:r,i=!!i||r===3,r===2&&rn(e)&&(s=e.v,o=0|s[p]);let c=(e=Si(s,t))===Lt?7:0|e[p],a=Li(c,o);var u=!(4&a);if(u){4&a&&(e=De(e),c=0,a=bt(a,o),o=te(s,o,t,e));let h=0,l=0;for(;h<e.length;h++){let d=n(e[h]);d!=null&&(e[l++]=d)}l<h&&(e.length=l),n=-513&(4|a),a=n&=-1025,a&=-4097}return a!==c&&(re(e,a),2&a&&Object.freeze(e)),Ko(e,a,s,o,t,r,u,i)}function Ko(e,t,n,r,i,s,o,c){let a=t;return s===1||s===4&&(2&t||!(16&t)&&32&r)?Et(t)||((t|=!e.length||o&&!(4096&t)||32&r&&!(4096&t||16&t)?2:256)!==a&&re(e,t),Object.freeze(e)):(s===2&&Et(t)&&(e=De(e),a=0,t=bt(t,r),r=te(n,r,i,e)),Et(t)||(c||(t|=16),t!==a&&re(e,t))),2&t||!(4096&t||16&t)||Ft(n,r),e}function Si(e,t,n){return e=tt(e,t,n),Array.isArray(e)?e:Lt}function Li(e,t){return 2&t&&(e|=2),1|e}function Et(e){return!!(2&e)&&!!(4&e)||!!(256&e)}function qo(e){return yi(e,!0)}function $o(e){e=De(e);for(let t=0;t<e.length;t++){let n=e[t]=De(e[t]);Array.isArray(n[1])&&(n[1]=Rn(n[1]))}return xn(e)}function ct(e,t,n,r){sn(e),te(e=e.v,0|e[p],t,(r==="0"?Number(n)===0:n===r)?void 0:n)}function on(e,t,n){if(2&t)throw Error();let r=en(t),i=Si(e,n,r),s=i===Lt?7:0|i[p],o=Li(s,t);return(2&o||Et(o)||16&o)&&(o===s||Et(o)||re(i,o),i=De(i),s=0,o=bt(o,t),te(e,t,n,i,r)),o&=-13,o!==s&&re(i,o),i}function Br(e,t){var n=Ga;return Mi(Fi(e=e.v),e,void 0,n)===t?t:-1}function Fi(e){var n;if(Qt)return(n=e[gn])!=null?n:e[gn]=new Map;if(gn in e)return e[gn];let t=new Map;return Object.defineProperty(e,gn,{value:t}),t}function Jo(e,t,n,r,i){let s=Fi(e),o=Mi(s,e,t,n,i);return o!==r&&(o&&(t=te(e,t,o,void 0,i)),s.set(n,r)),t}function Mi(e,t,n,r,i){let s=e.get(r);if(s!=null)return s;s=0;for(let o=0;o<r.length;o++){let c=r[o];tt(t,c,i)!=null&&(s!==0&&(n=te(t,n,s,void 0,i)),s=c)}return e.set(r,s),s}function Ii(e,t,n){let r=0|e[p],i=en(r),s=tt(e,n,i),o;if(s!=null&&s[Vt]===Xt){if(!Ae(s))return rn(s),s.v;o=s.v}else Array.isArray(s)&&(o=s);if(o){let c=0|o[p];2&c&&(o=nn(o,c))}return o=wt(o,t),o!==s&&te(e,r,n,o,i),o}function Zo(e,t,n,r,i){let s=!1;if((r=tt(e,r,i,(o=>{let c=Ti(o,n,!1,t);return s=c!==o&&c!=null,c})))!=null)return s&&!Ae(r)&&Ft(e,t),r}function M(e,t,n,r){let i=e.v,s=0|i[p];if((t=Zo(i,s,t,n,r))==null)return t;if(s=0|i[p],!Ae(e,s)){let o=ki(t);o!==t&&(rn(e)&&(i=e.v,s=0|i[p]),s=te(i,s,n,t=o,r),Ft(i,s))}return t}function Qo(e,t,n,r,i,s,o,c){var a=Ae(e,n);s=a?1:s,o=!!o||s===3,a=c&&!a,(s===2||a)&&rn(e)&&(n=0|(t=e.v)[p]);var u=(e=Si(t,i))===Lt?7:0|e[p],h=Li(u,n);if(c=!(4&h)){var l=e,d=n;let m=!!(2&h);m&&(d|=2);let b=!m,k=!0,X=0,K=0;for(;X<l.length;X++){let x=Ti(l[X],r,!1,d);if(x instanceof r){if(!m){let O=Ae(x);b&&(b=!O),k&&(k=O)}l[K++]=x}}K<X&&(l.length=K),h|=4,h=k?-4097&h:4096|h,h=b?8|h:-9&h}if(h!==u&&(re(e,h),2&h&&Object.freeze(e)),a&&!(8&h||!e.length&&(s===1||s===4&&(2&h||!(16&h)&&32&n)))){for(Et(h)&&(e=De(e),h=bt(h,n),n=te(t,n,i,e)),r=e,a=h,u=0;u<r.length;u++)(l=r[u])!==(h=ki(l))&&(r[u]=h);a|=8,re(e,h=a=r.length?4096|a:-4097&a)}return Ko(e,h,t,n,i,s,c,o)}function nt(e,t,n){let r=e.v;return Qo(e,r,0|r[p],t,n,vt(),!1,!0)}function ea(e){return e==null&&(e=void 0),e}function E(e,t,n,r,i){return C(e,n,r=ea(r),i),r&&!Ae(r)&&Ft(e.v),e}function bn(e,t,n,r){e:{var i=r=ea(r);sn(e);let s=e.v,o=0|s[p];if(i==null){let c=Fi(s);if(Mi(c,s,o,n)!==t)break e;c.set(n,0)}else o=Jo(s,o,n,t);te(s,o,t,i)}r&&!Ae(r)&&Ft(e.v)}function bt(e,t){return-273&(2&t?2|e:-3&e)}function Ri(e,t,n,r){var i=r;sn(e),e=Qo(e,r=e.v,0|r[p],n,t,2,!0),i=i!=null?i:new n,e.push(i),t=n=e===Lt?7:0|e[p],(i=Ae(i))?(n&=-9,e.length===1&&(n&=-4097)):n|=4096,n!==t&&re(e,n),i||Ft(r)}function Pe(e,t,n){return tn(B(e,t,void 0,n))}function ta(e){var t;return(t=pi?B(e,2,void 0,void 0,Qn):Qn(B(e,2)))!=null?t:l1}function W(e,t){var n;return(n=B(e,t,void 0,void 0,Ye))!=null?n:0}function rt(e,t,n){if(n!=null){if(typeof n!="number"||!ur(n))throw zr("int32");n|=0}C(e,t,n)}function v(e,t,n){C(e,t,_n(n))}function ke(e,t,n){ct(e,t,On(n),"")}function tr(e,t,n){var o;{sn(e);let c=e.v,a=0|c[p];if(n==null)te(c,a,t);else{var r=e=n===Lt?7:0|n[p],i=Et(e),s=i||Object.isFrozen(n);for(i||(e=0),s||(n=De(n),r=0,e=bt(e,a),s=!1),e|=5,e|=(o=4&e?512&e?512:1024&e?1024:0:void 0)!=null?o:pi?1024:0,i=0;i<n.length;i++){let u=n[i],h=Ho(u);Object.is(u,h)||(s&&(n=De(n),r=0,e=bt(e,a),s=!1),n[i]=h)}e!==r&&(s&&(n=De(n),e=bt(e,a)),re(n,e)),te(c,a,t,n)}}}function fr(e,t,n){sn(e),_t(e,t,he,2,!0).push(Ho(n))}var Ct=class{constructor(e,t,n){if(this.buffer=e,n&&!t)throw Error();this.g=t}};function Pi(e,t){if(typeof e=="string")return new Ct(Io(e),t);if(Array.isArray(e))return new Ct(new Uint8Array(e),t);if(e.constructor===Uint8Array)return new Ct(e,!1);if(e.constructor===ArrayBuffer)return e=new Uint8Array(e),new Ct(e,!1);if(e.constructor===He)return t=mi(e)||new Uint8Array(0),new Ct(t,!0,e);if(e instanceof Uint8Array)return e=e.constructor===Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Ct(e,!1);throw Error()}function Wt(e,t){let n,r=0,i=0,s=0,o=e.h,c=e.g;do n=o[c++],r|=(127&n)<<s,s+=7;while(s<32&&128&n);if(s>32)for(i|=(127&n)>>4,s=3;s<32&&128&n;s+=7)n=o[c++],i|=(127&n)<<s;if(Tt(e,c),!(128&n))return t(r>>>0,i>>>0);throw Error()}function Ci(e){let t=0,n=e.g,r=n+10,i=e.h;for(;n<r;){let s=i[n++];if(t|=s,(128&s)==0)return Tt(e,n),!!(127&t)}throw Error()}function lt(e){let t=e.h,n=e.g,r=t[n++],i=127&r;if(128&r&&(r=t[n++],i|=(127&r)<<7,128&r&&(r=t[n++],i|=(127&r)<<14,128&r&&(r=t[n++],i|=(127&r)<<21,128&r&&(r=t[n++],i|=r<<28,128&r&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++])))))throw Error();return Tt(e,n),i}function it(e){return lt(e)>>>0}function nr(e){var t=e.h;let n=e.g;var r=t[n],i=t[n+1];let s=t[n+2];return t=t[n+3],Tt(e,e.g+4),e=2*((i=(r<<0|i<<8|s<<16|t<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,r==255?i?NaN:e*(1/0):r==0?1401298464324817e-60*e*i:e*Math.pow(2,r-150)*(i+8388608)}function d1(e){return lt(e)}function Tt(e,t){if(e.g=t,t>e.l)throw Error()}function na(e,t){if(t<0)throw Error();let n=e.g;if((t=n+t)>e.l)throw Error();return e.g=t,n}function ra(e,t){if(t==0)return kt();var n=na(e,t);return e.Y&&e.j?n=e.h.subarray(n,n+t):(e=e.h,n=n===(t=n+t)?new Uint8Array(0):H2?e.slice(n,t):new Uint8Array(e.subarray(n,t))),n.length==0?kt():new He(n,Gt)}var Rs=[];function ia(e,t,n,r){if(rr.length){let i=rr.pop();return i.o(r),i.g.init(e,t,n,r),i}return new f1(e,t,n,r)}function sa(e){e.g.clear(),e.l=-1,e.h=-1,rr.length<100&&rr.push(e)}function oa(e){var t=e.g;if(t.g==t.l)return!1;e.m=e.g.g;var n=it(e.g);if(t=n>>>3,!((n&=7)>=0&&n<=5)||t<1)throw Error();return e.l=t,e.h=n,!0}function Wn(e){switch(e.h){case 0:e.h!=0?Wn(e):Ci(e.g);break;case 1:Tt(e=e.g,e.g+8);break;case 2:if(e.h!=2)Wn(e);else{var t=it(e.g);Tt(e=e.g,e.g+t)}break;case 5:Tt(e=e.g,e.g+4);break;case 3:for(t=e.l;;){if(!oa(e))throw Error();if(e.h==4){if(e.l!=t)throw Error();break}Wn(e)}break;default:throw Error()}}function Nn(e,t,n){let r=e.g.l;var i=it(e.g);let s=(i=e.g.g+i)-r;if(s<=0&&(e.g.l=i,n(t,e,void 0,void 0,void 0),s=i-e.g.g),s)throw Error();return e.g.g=i,e.g.l=r,t}function Oi(e){var t=it(e.g),n=na(e=e.g,t);if(e=e.h,k2){var r,i=e;(r=Nr)||(r=Nr=new TextDecoder("utf-8",{fatal:!0})),t=n+t,i=n===0&&t===i.length?i:i.subarray(n,t);try{var s=r.decode(i)}catch(c){if(Vn===void 0){try{r.decode(new Uint8Array([128]))}catch{}try{r.decode(new Uint8Array([97])),Vn=!0}catch{Vn=!1}}throw!Vn&&(Nr=void 0),c}}else{t=(s=n)+t,n=[];let c,a=null;for(;s<t;){var o=e[s++];o<128?n.push(o):o<224?s>=t?yt():(c=e[s++],o<194||(192&c)!=128?(s--,yt()):n.push((31&o)<<6|63&c)):o<240?s>=t-1?yt():(c=e[s++],(192&c)!=128||o===224&&c<160||o===237&&c>=160||(192&(r=e[s++]))!=128?(s--,yt()):n.push((15&o)<<12|(63&c)<<6|63&r)):o<=244?s>=t-2?yt():(c=e[s++],(192&c)!=128||c-144+(o<<28)>>30!=0||(192&(r=e[s++]))!=128||(192&(i=e[s++]))!=128?(s--,yt()):(o=(7&o)<<18|(63&c)<<12|(63&r)<<6|63&i,o-=65536,n.push(55296+(o>>10&1023),56320+(1023&o)))):yt(),n.length>=8192&&(a=ms(a,n),n.length=0)}s=ms(a,n)}return s}function aa(e){let t=it(e.g);return ra(e.g,t)}function pr(e,t,n){var r=it(e.g);for(r=e.g.g+r;e.g.g<r;)n.push(t(e.g))}var f1=class{constructor(e,t,n,r){if(Rs.length){let i=Rs.pop();i.init(e,t,n,r),e=i}else e=new class{constructor(i,s,o,c){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(i,s,o,c)}init(i,s,o,{Y:c=!1,ea:a=!1}={}){this.Y=c,this.ea=a,i&&(i=Pi(i,this.ea),this.h=i.buffer,this.j=i.g,this.m=s||0,this.l=o!==void 0?this.m+o:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(e,t,n,r);this.g=e,this.m=this.g.g,this.h=this.l=-1,this.o(r)}o({ha:e=!1}={}){this.ha=e}},rr=[];function Ps(e){return e?/^\d+$/.test(e)?(hr(e),new Zr(j,$)):null:p1||(p1=new Zr(0,0))}var Zr=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}},p1;function Cs(e){return e?/^-?\d+$/.test(e)?(hr(e),new Qr(j,$)):null:g1||(g1=new Qr(0,0))}var Qr=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}},g1;function Dt(e,t,n){for(;n>0||t>127;)e.g.push(127&t|128),t=(t>>>7|n<<25)>>>0,n>>>=7;e.g.push(t)}function an(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function gr(e,t){if(t>=0)an(e,t);else{for(let n=0;n<9;n++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function Ni(e){var t=j;e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function zt(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function Ce(e,t,n){an(e.g,8*t+n)}function Di(e,t){return Ce(e,t,2),t=e.g.end(),zt(e,t),t.push(e.h),t}function Ui(e,t){var n=t.pop();for(n=e.h+e.g.length()-n;n>127;)t.push(127&n|128),n>>>=7,e.h++;t.push(n),e.h++}function mr(e,t,n){Ce(e,t,2),an(e.g,n.length),zt(e,e.g.end()),zt(e,n)}function ir(e,t,n,r){n!=null&&(t=Di(e,t),r(n,e),Ui(e,t))}function ze(){let e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var Bi=ze(),ca=ze(),Gi=ze(),ji=ze(),ha=ze(),ua=ze(),m1=ze(),yr=ze(),la=ze(),da=ze();function Ke(e,t,n){var r=e.v;be&&be in r&&(r=r[be])&&delete r[t.g],t.h?t.j(e,t.h,t.g,n,t.l):t.j(e,t.g,n,t.l)}var g=class{constructor(e,t){this.v=zo(e,t,void 0,2048)}toJSON(){return Wo(this)}j(){var i;var e=J1,t=this.v,n=e.g,r=be;if(Qt&&r&&((i=t[r])==null?void 0:i[n])!=null&&jt(O2,3),t=e.g,bs&&be&&bs===void 0&&(r=(n=this.v)[be])&&(r=r.da))try{r(n,t,s1)}catch(s){So(s)}return e.h?e.m(this,e.h,e.g,e.l):e.m(this,e.g,e.defaultValue,e.l)}clone(){let e=this.v,t=0|e[p];return xi(this,e,t)?Ai(this,e,!0):new this.constructor(nn(e,t,!1))}};g.prototype[Vt]=Xt,g.prototype.toString=function(){return this.v.toString()};var cn=class{constructor(e,t,n){this.g=e,this.h=t,e=Bi,this.l=!!e&&n===e||!1}};function vr(e,t){return new cn(e,t,Bi)}function fa(e,t,n,r,i){ir(e,n,ga(t,r),i)}var y1=vr((function(e,t,n,r,i){return e.h===2&&(Nn(e,Ii(t,r,n),i),!0)}),fa),v1=vr((function(e,t,n,r,i){return e.h===2&&(Nn(e,Ii(t,r,n),i),!0)}),fa),_r=Symbol(),wr=Symbol(),ei=Symbol(),Os=Symbol(),Ns=Symbol(),zn,Kn;function Mt(e,t,n,r){var i=r[e];if(i)return i;(i={}).qa=r,i.T=(function(l){switch(typeof l){case"boolean":return c1||(c1=[0,void 0,!0]);case"number":return l>0?void 0:l===0?h1||(h1=[0,void 0]):[-l,void 0];case"string":return[0,l];case"object":return l}})(r[0]);var s=r[1];let o=1;s&&s.constructor===Object&&(i.ba=s,typeof(s=r[++o])=="function"&&(i.ma=!0,zn!=null||(zn=s),Kn!=null||(Kn=r[o+1]),s=r[o+=2]));let c={};for(;s&&Array.isArray(s)&&s.length&&typeof s[0]=="number"&&s[0]>0;){for(var a=0;a<s.length;a++)c[s[a]]=s;s=r[++o]}for(a=1;s!==void 0;){let l;typeof s=="number"&&(a+=s,s=r[++o]);var u=void 0;if(s instanceof cn?l=s:(l=y1,o--),l==null?void 0:l.l){s=r[++o],u=r;var h=o;typeof s=="function"&&(s=s(),u[h]=s),u=s}for(h=a+1,typeof(s=r[++o])=="number"&&s<0&&(h-=s,s=r[++o]);a<h;a++){let d=c[a];u?n(i,a,l,u,d):t(i,a,l,d)}}return r[e]=i}function pa(e){return Array.isArray(e)?e[0]instanceof cn?e:[v1,e]:[e,void 0]}function ga(e,t){return e instanceof g?e.v:Array.isArray(e)?wt(e,t):void 0}function Vi(e,t,n,r){let i=n.g;e[t]=r?(s,o,c)=>i(s,o,c,r):i}function Xi(e,t,n,r,i){let s=n.g,o,c;e[t]=(a,u,h)=>s(a,u,h,c||(c=Mt(wr,Vi,Xi,r).T),o||(o=Yi(r)),i)}function Yi(e){let t=e[ei];if(t!=null)return t;let n=Mt(wr,Vi,Xi,e);return t=n.ma?(r,i)=>zn(r,i,n):(r,i)=>{var u,h;for(;oa(i)&&i.h!=4;){var s=i.l,o=n[s];if(o==null){var c=n.ba;c&&(c=c[s])&&(c=w1(c))!=null&&(o=n[s]=c)}if(o==null||!o(i,r,s)){if(o=(c=i).m,Wn(c),c.ha)var a=void 0;else a=c.g.g-o,c.g.g=o,a=ra(c.g,a);o=void 0,c=r,a&&((h=(o=(u=c[be])!=null?u:c[be]=new Jr)[s])!=null?h:o[s]=[]).push(a)}}return(r=lr(r))&&(r.da=n.qa[Ns]),!0},e[ei]=t,e[Ns]=_1.bind(e),t}function _1(e,t,n,r){var i=this[wr];let s=this[ei],o=wt(void 0,i.T),c=lr(e);if(c){var a=!1,u=i.ba;if(u){if(i=(h,l,d)=>{if(d.length!==0)if(u[l])for(let m of d){h=ia(m);try{a=!0,s(o,h)}finally{sa(h)}}else r==null||r(e,l,d)},t==null)er(c,i);else if(c!=null){let h=c[t];h&&i(c,t,h)}if(a){let h=0|e[p];if(2&h&&2048&h&&!(n!=null&&n.Ka))throw Error();let l=en(h),d=(m,b)=>{if(tt(e,m,l)!=null){if((n==null?void 0:n.Qa)===1)return;throw Error()}b!=null&&(h=te(e,h,m,b,l)),delete c[m]};t==null?No(o,0|o[p],((m,b)=>{d(m,b)})):d(t,tt(o,t,l))}}}}function w1(e){let t=(e=pa(e))[0].g;if(e=e[1]){let n=Yi(e),r=Mt(wr,Vi,Xi,e).T;return(i,s,o)=>t(i,s,o,r,n)}return t}function Er(e,t,n){e[t]=n.h}function br(e,t,n,r){let i,s,o=n.h;e[t]=(c,a,u)=>o(c,a,u,s||(s=Mt(_r,Er,br,r).T),i||(i=ma(r)))}function ma(e){let t=e[Os];if(!t){let n=Mt(_r,Er,br,e);t=(r,i)=>ya(r,i,n),e[Os]=t}return t}function ya(e,t,n){No(e,0|e[p],((r,i)=>{if(i!=null){var s=(function(o,c){var a=o[c];if(a)return a;if((a=o.ba)&&(a=a[c])){var u=(a=pa(a))[0].h;if(a=a[1]){let h=ma(a),l=Mt(_r,Er,br,a).T;a=o.ma?Kn(l,h):(d,m,b)=>u(d,m,b,l,h)}else a=u;return o[c]=a}})(n,r);s?s(t,i,r):r<500||jt(Kr,3)}})),(e=lr(e))&&er(e,((r,i,s)=>{for(zt(t,t.g.end()),r=0;r<s.length;r++)zt(t,mi(s[r])||new Uint8Array(0))}))}var E1=Te(0);function hn(e,t){if(Array.isArray(t)){var n=0|t[p];if(4&n)return t;for(var r=0,i=0;r<t.length;r++){let s=e(t[r]);s!=null&&(t[i++]=s)}return i<r&&(t.length=i),(e=-1537&(5|n))!==n&&re(t,e),2&e&&Object.freeze(t),t}}function pe(e,t,n){return new cn(e,t,n)}function un(e,t,n){return new cn(e,t,n)}function ae(e,t,n){te(e,0|e[p],t,n,en(0|e[p]))}var b1=vr((function(e,t,n,r,i){if(e.h!==2)return!1;if(e=De(e=Nn(e,wt([void 0,void 0],r),i)),i=en(r=0|t[p]),2&r)throw Error();let s=tt(t,n,i);if(s instanceof et)(2&s.J)!=0?(s=s.V(),s.push(e),te(t,r,n,s,i)):s.Ma(e);else if(Array.isArray(s)){var o=0|s[p];8192&o||re(s,o|=8192),2&o&&(s=$o(s),te(t,r,n,s,i)),s.push(e)}else te(t,r,n,xn([e]),i);return!0}),(function(e,t,n,r,i){if(t instanceof et)t.forEach(((s,o)=>{ir(e,n,wt([o,s],r),i)}));else if(Array.isArray(t)){for(let s=0;s<t.length;s++){let o=t[s];Array.isArray(o)&&ir(e,n,wt(o,r),i)}xn(t)}}));function va(e,t,n){(t=Ye(t))!=null&&(Ce(e,n,5),e=e.g,vi(t),Ni(e))}function _a(e,t,n){if(t=(function(r){if(r==null)return r;let i=typeof r;if(i==="bigint")return String(Pn(64,r));if(Cn(r)){if(i==="string")return Vo(r);if(i==="number")return bi(r)}})(t),t!=null&&(typeof t=="string"&&Cs(t),t!=null))switch(Ce(e,n,0),typeof t){case"number":e=e.g,Yt(t),Dt(e,j,$);break;case"bigint":n=BigInt.asUintN(64,t),n=new Qr(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Dt(e.g,n.h,n.g);break;default:n=Cs(t),Dt(e.g,n.h,n.g)}}function wa(e,t,n){(t=tn(t))!=null&&t!=null&&(Ce(e,n,0),gr(e.g,t))}function Ea(e,t,n){(t=Bo(t))!=null&&(Ce(e,n,0),e.g.g.push(t?1:0))}function ba(e,t,n){(t=he(t))!=null&&mr(e,n,xo(t))}function Ta(e,t,n,r,i){ir(e,n,ga(t,r),i)}function Aa(e,t,n){(t=t==null||typeof t=="string"||t instanceof He?t:void 0)!=null&&mr(e,n,Pi(t,!0).buffer)}function ka(e,t,n){return(e.h===5||e.h===2)&&(t=on(t,0|t[p],n),e.h==2?pr(e,nr,t):t.push(nr(e.g)),!0)}var J=pe((function(e,t,n){return e.h===5&&(ae(t,n,nr(e.g)),!0)}),va,yr),T1=un(ka,(function(e,t,n){if((t=hn(Ye,t))!=null)for(let o=0;o<t.length;o++){var r=e,i=n,s=t[o];s!=null&&(Ce(r,i,5),r=r.g,vi(s),Ni(r))}}),yr),Hi=un(ka,(function(e,t,n){if((t=hn(Ye,t))!=null&&t.length){Ce(e,n,2),an(e.g,4*t.length);for(let r=0;r<t.length;r++)n=e.g,vi(t[r]),Ni(n)}}),yr),A1=pe((function(e,t,n){return e.h===5&&(ae(t,n,(e=nr(e.g))===0?void 0:e),!0)}),va,yr),dt=pe((function(e,t,n){return fi?(e.h!==0?e=!1:(ae(t,n,Wt(e.g,Uo)),e=!0),e):e.h===0&&(ae(t,n,Wt(e.g,_i)),!0)}),_a,ua),Gr=pe((function(e,t,n){return fi?(e.h!==0?t=!1:(ae(t,n,(e=Wt(e.g,Uo))===E1?void 0:e),t=!0),t):e.h===0&&(ae(t,n,(e=Wt(e.g,_i))===0?void 0:e),!0)}),_a,ua),k1=pe((function(e,t,n){return fi?(e.h!==0?e=!1:(ae(t,n,Wt(e.g,z2)),e=!0),e):e.h===0&&(ae(t,n,Wt(e.g,$r)),!0)}),(function(e,t,n){if(t=(function(r){if(r==null)return r;var i=typeof r;if(i==="bigint")return String(K2(64,r));if(Cn(r)){if(i==="string")return i=Ht(Number(r)),St(i)&&i>=0?r=String(i):((i=r.indexOf("."))!==-1&&(r=r.substring(0,i)),(i=r[0]!=="-"&&((i=r.length)<20||i===20&&r<="18446744073709551615"))||(hr(r),r=Sn(j,$))),r;if(i==="number")return(r=Ht(r))>=0&&St(r)||(Yt(r),r=$r(j,$)),r}})(t),t!=null&&(typeof t=="string"&&Ps(t),t!=null))switch(Ce(e,n,0),typeof t){case"number":e=e.g,Yt(t),Dt(e,j,$);break;case"bigint":n=BigInt.asUintN(64,t),n=new Zr(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Dt(e.g,n.h,n.g);break;default:n=Ps(t),Dt(e.g,n.h,n.g)}}),m1),oe=pe((function(e,t,n){return e.h===0&&(ae(t,n,lt(e.g)),!0)}),wa,ji),Dn=un((function(e,t,n){return(e.h===0||e.h===2)&&(t=on(t,0|t[p],n),e.h==2?pr(e,lt,t):t.push(lt(e.g)),!0)}),(function(e,t,n){if((t=hn(tn,t))!=null&&t.length){n=Di(e,n);for(let r=0;r<t.length;r++)gr(e.g,t[r]);Ui(e,n)}}),ji),Nt=pe((function(e,t,n){return e.h===0&&(ae(t,n,(e=lt(e.g))===0?void 0:e),!0)}),wa,ji),z=pe((function(e,t,n){return e.h===0&&(ae(t,n,Ci(e.g)),!0)}),Ea,ca),At=pe((function(e,t,n){return e.h===0&&(ae(t,n,(e=Ci(e.g))===!1?void 0:e),!0)}),Ea,ca),le=un((function(e,t,n){return e.h===2&&(e=Oi(e),on(t,0|t[p],n).push(e),!0)}),(function(e,t,n){if((t=hn(he,t))!=null)for(let o=0;o<t.length;o++){var r=e,i=n,s=t[o];s!=null&&mr(r,i,xo(s))}}),Gi),ut=pe((function(e,t,n){return e.h===2&&(ae(t,n,(e=Oi(e))===""?void 0:e),!0)}),ba,Gi),N=pe((function(e,t,n){return e.h===2&&(ae(t,n,Oi(e)),!0)}),ba,Gi),se=(function(e,t,n=Bi){return new cn(e,t,n)})((function(e,t,n,r,i){return e.h===2&&(r=wt(void 0,r),on(t,0|t[p],n).push(r),Nn(e,r,i),!0)}),(function(e,t,n,r,i){if(Array.isArray(t)){for(let s=0;s<t.length;s++)Ta(e,t[s],n,r,i);1&(e=0|t[p])||re(t,1|e)}})),H=vr((function(e,t,n,r,i,s){if(e.h!==2)return!1;let o=0|t[p];return Jo(t,o,s,n,en(o)),Nn(e,t=Ii(t,r,n),i),!0}),Ta),xa=pe((function(e,t,n){return e.h===2&&(ae(t,n,aa(e)),!0)}),Aa,la),x1=un((function(e,t,n){return(e.h===0||e.h===2)&&(t=on(t,0|t[p],n),e.h==2?pr(e,it,t):t.push(it(e.g)),!0)}),(function(e,t,n){if((t=hn(Go,t))!=null)for(let o=0;o<t.length;o++){var r=e,i=n,s=t[o];s!=null&&(Ce(r,i,0),an(r.g,s))}}),ha),S1=pe((function(e,t,n){return e.h===0&&(ae(t,n,(e=it(e.g))===0?void 0:e),!0)}),(function(e,t,n){(t=Go(t))!=null&&t!=null&&(Ce(e,n,0),an(e.g,t))}),ha),xe=pe((function(e,t,n){return e.h===0&&(ae(t,n,lt(e.g)),!0)}),(function(e,t,n){(t=tn(t))!=null&&(t=parseInt(t,10),Ce(e,n,0),gr(e.g,t))}),da),ti=class{constructor(t,n){var r=Le;this.g=t,this.h=n,this.m=M,this.j=E,this.defaultValue=void 0,this.l=r.Oa!=null?Do:void 0}register(){or(this)}};function qe(e,t){return new ti(e,t)}function pt(e,t){return(n,r)=>{{let s={ea:!0};r&&Object.assign(s,r),n=ia(n,void 0,void 0,s);try{let o=new e,c=o.v;Yi(t)(c,n);var i=o}finally{sa(n)}}return i}}function Tr(e){return function(){let t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){let o=this.g;return this.g=[],o}}}};ya(this.v,t,Mt(_r,Er,br,e)),zt(t,t.g.end());let n=new Uint8Array(t.h),r=t.l,i=r.length,s=0;for(let o=0;o<i;o++){let c=r[o];n.set(c,s),s+=c.length}return t.l=[n],n}}var Ds=class extends g{constructor(e){super(e)}},Us=[0,ut,pe((function(e,t,n){return e.h===2&&(ae(t,n,(e=aa(e))===kt()?void 0:e),!0)}),(function(e,t,n){if(t!=null){if(t instanceof g){let r=t.Ra;return void(r?(t=r(t),t!=null&&mr(e,n,Pi(t,!0).buffer)):jt(Kr,3))}if(Array.isArray(t))return void jt(Kr,3)}Aa(e,t,n)}),la)],jr,Bs=globalThis.trustedTypes;function Gs(e){var t;return jr===void 0&&(jr=(function(){let n=null;if(!Bs)return n;try{let r=i=>i;n=Bs.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch{}return n})()),e=(t=jr)?t.createScriptURL(e):e,new class{constructor(n){this.g=n}toString(){return this.g+""}}(e)}function L1(e,...t){if(t.length===0)return Gs(e[0]);let n=e[0];for(let r=0;r<t.length;r++)n+=encodeURIComponent(t[r])+e[r+1];return Gs(n)}var Sa=[0,oe,xe,z,-1,Dn,xe,-1,z],F1=class extends g{constructor(e){super(e)}},La=[0,z,N,z,xe,-1,un((function(e,t,n){return(e.h===0||e.h===2)&&(t=on(t,0|t[p],n),e.h==2?pr(e,d1,t):t.push(lt(e.g)),!0)}),(function(e,t,n){if((t=hn(tn,t))!=null&&t.length){n=Di(e,n);for(let r=0;r<t.length;r++)gr(e.g,t[r]);Ui(e,n)}}),da),N,-1,[0,z,-1],xe,z,-1],Fa=[0,3,z,-1,2,[0,oe],[0,xe,z],[0,N,-1],[0]],Ma=[0,N,-2],js=class extends g{constructor(e){super(e)}},Ia=[0],Ra=[0,oe,z,1,z,-4],Le=class extends g{constructor(e){super(e,2)}},ne={};ne[336783863]=[0,N,z,-1,oe,[0,[1,2,3,4,5,6,7,8,9],H,Ia,H,La,H,Ma,H,Ra,H,Sa,H,[0,N,-2],H,[0,N,xe],H,Fa,H,[0,xe,-1,z]],[0,N],z,[0,[1,3],[2,4],H,[0,Dn],-1,H,[0,le],-1,se,[0,N,-1]],N];var Vs=[0,Gr,-1,At,-3,Gr,Dn,ut,Nt,Gr,-1,At,Nt,At,-2,ut];function G(e,t){fr(e,3,t)}function L(e,t){fr(e,4,t)}var ye=class extends g{constructor(e){super(e,500)}o(e){return E(this,0,7,e)}},Tn=[-1,{}],Xs=[0,N,1,Tn],Ys=[0,N,le,Tn];function Oe(e,t){Ri(e,1,ye,t)}function V(e,t){fr(e,10,t)}function I(e,t){fr(e,15,t)}var Fe=class extends g{constructor(e){super(e,500)}o(e){return E(this,0,1001,e)}},Pa=[-500,se,[-500,ut,-1,le,-3,[-2,ne,z],se,Us,Nt,-1,Xs,Ys,se,[0,ut,At],ut,Vs,Nt,le,987,le],4,se,[-500,N,-1,[-1,{}],998,N],se,[-500,N,le,-1,[-2,{},z],997,le,-1],Nt,se,[-500,N,le,Tn,998,le],le,Nt,Xs,Ys,se,[0,ut,-1,Tn],le,-2,Vs,ut,-1,At,[0,At,S1],978,Tn,se,Us];Fe.prototype.g=Tr(Pa);var M1=pt(Fe,Pa),I1=class extends g{constructor(e){super(e)}},Ca=class extends g{constructor(e){super(e)}g(){return nt(this,I1,1)}},Oa=[0,se,[0,oe,J,N,-1]],Ar=pt(Ca,Oa),R1=class extends g{constructor(e){super(e)}},P1=class extends g{constructor(e){super(e)}},Vr=class extends g{constructor(e){super(e)}l(){return M(this,R1,2)}g(){return nt(this,P1,5)}},Na=pt(class extends g{constructor(e){super(e)}},[0,le,Dn,Hi,[0,xe,[0,oe,-3],[0,J,-3],[0,oe,-1,[0,se,[0,oe,-2]]],se,[0,J,-1,N,J]],N,-1,dt,se,[0,oe,J],le,dt]),Da=class extends g{constructor(e){super(e)}},Ut=pt(class extends g{constructor(e){super(e)}},[0,se,[0,J,-4]]),Ua=class extends g{constructor(e){super(e)}},Un=pt(class extends g{constructor(e){super(e)}},[0,se,[0,J,-4]]),C1=class extends g{constructor(e){super(e)}},O1=[0,oe,-1,Hi,xe],Ba=class extends g{constructor(e){super(e)}};Ba.prototype.g=Tr([0,J,-4,dt]);var N1=class extends g{constructor(e){super(e)}},D1=pt(class extends g{constructor(e){super(e)}},[0,se,[0,1,oe,N,Oa],dt]),Hs=class extends g{constructor(e){super(e)}},U1=class extends g{constructor(e){super(e)}na(){let e=B(this,1,void 0,void 0,qo);return e==null?kt():e}},B1=class extends g{constructor(e){super(e)}},Ga=[1,2],G1=pt(class extends g{constructor(e){super(e)}},[0,se,[0,Ga,H,[0,Hi],H,[0,xa],oe,N],dt]),Wi=class extends g{constructor(e){super(e)}},ja=[0,N,oe,J,le,-1],Ws=class extends g{constructor(e){super(e)}},j1=[0,z,-1],zs=class extends g{constructor(e){super(e)}},qn=[1,2,3,4,5,6],sr=class extends g{constructor(e){super(e)}g(){return B(this,1,void 0,void 0,qo)!=null}l(){return he(B(this,2))!=null}},Y=class extends g{constructor(e){super(e)}g(){var e;return(e=Bo(B(this,2)))!=null?e:!1}},Va=[0,xa,N,[0,oe,dt,-1],[0,k1,dt]],Z=[0,Va,z,[0,qn,H,Ra,H,La,H,Sa,H,Ia,H,Ma,H,Fa],xe],kr=class extends g{constructor(e){super(e)}},zi=[0,Z,J,-1,oe],V1=qe(502141897,kr);ne[502141897]=zi;var X1=pt(class extends g{constructor(e){super(e)}},[0,[0,xe,-1,T1,x1],O1]),Xa=class extends g{constructor(e){super(e)}},Ya=class extends g{constructor(e){super(e)}},ni=[0,Z,J,[0,Z],z],Y1=qe(508968150,Ya);ne[508968150]=[0,Z,zi,ni,J,[0,[0,Va]]],ne[508968149]=ni;var Ot=class extends g{constructor(e){super(e)}l(){return M(this,Wi,2)}g(){C(this,2)}},Ha=[0,Z,ja];ne[478825465]=Ha;var H1=class extends g{constructor(e){super(e)}},Wa=class extends g{constructor(e){super(e)}},Ki=class extends g{constructor(e){super(e)}},qi=class extends g{constructor(e){super(e)}},za=class extends g{constructor(e){super(e)}},Ks=[0,Z,[0,Z],Ha,-1],Ka=[0,Z,J,oe],$i=[0,Z,J],qa=[0,Z,Ka,$i,J],W1=qe(479097054,za);ne[479097054]=[0,Z,qa,Ks],ne[463370452]=Ks,ne[464864288]=Ka;var z1=qe(462713202,qi);ne[462713202]=qa,ne[474472470]=$i;var K1=class extends g{constructor(e){super(e)}},$a=class extends g{constructor(e){super(e)}},Ja=class extends g{constructor(e){super(e)}},Za=class extends g{constructor(e){super(e)}},Ji=[0,Z,J,-1,oe],ri=[0,Z,J,z];Za.prototype.g=Tr([0,Z,$i,[0,Z],zi,ni,Ji,ri]);var Qa=class extends g{constructor(e){super(e)}},q1=qe(456383383,Qa);ne[456383383]=[0,Z,ja];var e2=class extends g{constructor(e){super(e)}},$1=qe(476348187,e2);ne[476348187]=[0,Z,j1];var t2=class extends g{constructor(e){super(e)}},qs=class extends g{constructor(e){super(e)}},n2=[0,xe,-1],J1=qe(458105876,class extends g{constructor(e){super(e)}g(){let e;var t=this.v;let n=0|t[p];return e=Ae(this,n),t=(function(r,i,s,o){var c=qs;!o&&rn(r)&&(s=0|(i=r.v)[p]);var a=tt(i,2);if(r=!1,a==null){if(o)return Fs();a=[]}else if(a.constructor===et){if(!(2&a.J)||o)return a;a=a.V()}else Array.isArray(a)?r=!!(2&(0|a[p])):a=[];if(o){if(!a.length)return Fs();r||(r=!0,Rn(a))}else r&&(r=!1,xn(a),a=$o(a));return!r&&32&s&&In(a,32),s=te(i,s,2,o=new et(a,c,Z2,void 0)),r||Ft(i,s),o})(this,t,n,e),!e&&qs&&(t.ra=!0),t}});ne[458105876]=[0,n2,b1,[!0,dt,[0,N,-1,le]],[0,Dn,z,xe]];var Zi=class extends g{constructor(e){super(e)}},r2=qe(458105758,Zi);ne[458105758]=[0,Z,N,n2];var Xr=class extends g{constructor(e){super(e)}},$s=[0,A1,-1,At],Z1=class extends g{constructor(e){super(e)}},i2=class extends g{constructor(e){super(e)}},ii=[1,2];i2.prototype.g=Tr([0,ii,H,$s,H,[0,se,$s]]);var s2=class extends g{constructor(e){super(e)}},Q1=qe(443442058,s2);ne[443442058]=[0,Z,N,oe,J,le,-1,z,J],ne[514774813]=Ji;var o2=class extends g{constructor(e){super(e)}},ec=qe(516587230,o2);function si(e,t){return t=t?t.clone():new Wi,e.displayNamesLocale!==void 0?C(t,1,On(e.displayNamesLocale)):e.displayNamesLocale===void 0&&C(t,1),e.maxResults!==void 0?rt(t,2,e.maxResults):"maxResults"in e&&C(t,2),e.scoreThreshold!==void 0?v(t,3,e.scoreThreshold):"scoreThreshold"in e&&C(t,3),e.categoryAllowlist!==void 0?tr(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&C(t,4),e.categoryDenylist!==void 0?tr(t,5,e.categoryDenylist):"categoryDenylist"in e&&C(t,5),t}function a2(e){let t=Number(e);return Number.isSafeInteger(t)?t:String(e)}function Qi(e,t=-1,n=""){return{categories:e.map((r=>{var i,s,o,c,a,u,h;return{index:(s=(i=Pe(r,1))!=null?i:0)!=null?s:-1,score:(o=W(r,2))!=null?o:0,categoryName:(a=(c=he(B(r,3)))!=null?c:"")!=null?a:"",displayName:(h=(u=he(B(r,4)))!=null?u:"")!=null?h:""}})),headIndex:t,headName:n}}function tc(e){let t={classifications:nt(e,N1,1).map((n=>{var r,i,s,o;return Qi((i=(r=M(n,Ca,4))==null?void 0:r.g())!=null?i:[],(s=Pe(n,2))!=null?s:0,(o=he(B(n,3)))!=null?o:"")}))};return(function(n){return J2(pi?B(n,2,void 0,void 0,Qn):B(n,2))})(e)!=null&&(t.timestampMs=a2(ta(e))),t}function c2(e){var o,c,a,u,h,l,d,m,b,k,X,K,x;var t=_t(e,3,Ye,vt()),n=_t(e,2,tn,vt()),r=_t(e,1,he,vt()),i=_t(e,9,he,vt());let s={categories:[],keypoints:[]};for(let O=0;O<t.length;O++)s.categories.push({score:t[O],index:(o=n[O])!=null?o:-1,categoryName:(c=r[O])!=null?c:"",displayName:(a=i[O])!=null?a:""});if((t=(u=M(e,Vr,4))==null?void 0:u.l())&&(s.boundingBox={originX:(h=Pe(t,1,ot))!=null?h:0,originY:(l=Pe(t,2,ot))!=null?l:0,width:(d=Pe(t,3,ot))!=null?d:0,height:(m=Pe(t,4,ot))!=null?m:0,angle:0}),(b=M(e,Vr,4))==null?void 0:b.g().length)for(let O of M(e,Vr,4).g())s.keypoints.push({x:(k=B(O,1,void 0,ot,Ye))!=null?k:0,y:(X=B(O,2,void 0,ot,Ye))!=null?X:0,score:(K=B(O,4,void 0,ot,Ye))!=null?K:0,label:(x=he(B(O,3,void 0,ot)))!=null?x:""});return s}function xr(e){var n,r,i,s;let t=[];for(let o of nt(e,Ua,1))t.push({x:(n=W(o,1))!=null?n:0,y:(r=W(o,2))!=null?r:0,z:(i=W(o,3))!=null?i:0,visibility:(s=W(o,4))!=null?s:0});return t}function An(e){var n,r,i,s;let t=[];for(let o of nt(e,Da,1))t.push({x:(n=W(o,1))!=null?n:0,y:(r=W(o,2))!=null?r:0,z:(i=W(o,3))!=null?i:0,visibility:(s=W(o,4))!=null?s:0});return t}function Js(e){return Array.from(e,(t=>t>127?t-256:t))}function Zs(e,t){if(e.length!==t.length)throw Error("Cannot compute cosine similarity between embeddings of different sizes (".concat(e.length," vs. ").concat(t.length,")."));let n=0,r=0,i=0;for(let s=0;s<e.length;s++)n+=e[s]*t[s],r+=e[s]*e[s],i+=t[s]*t[s];if(r<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}var Xn;ne[516587230]=[0,Z,Ji,ri,J],ne[518928384]=ri;var nc=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 h2(){if(Xn===void 0)try{await WebAssembly.instantiate(nc),Xn=!0}catch{Xn=!1}return Xn}var ko;async function mn(e,t=L1(ko||(ko=gs([""])))){let n=await h2()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:"".concat(t,"/").concat(e,"_").concat(n,".js"),wasmBinaryPath:"".concat(t,"/").concat(e,"_").concat(n,".wasm")}}var ht=class{};function u2(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!(function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")})(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Qs(e){if(typeof importScripts!="function"){let t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise(((n,r)=>{t.addEventListener("load",(()=>{n()}),!1),t.addEventListener("error",(i=>{r(i)}),!1),document.body.appendChild(t)}))}try{importScripts(e.toString())}catch(t){if(!(t instanceof TypeError))throw t;await self.import(e.toString())}}function l2(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function y(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function eo(e,t,n){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(n?e.i._bindTextureToStream(n):e.i._bindTextureToCanvas(),!(n=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);let[r,i]=l2(t);return!e.l||r===e.i.canvas.width&&i===e.i.canvas.height||(e.i.canvas.width=r,e.i.canvas.height=i),[r,i]}function to(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");let r=new Uint32Array(t.length);for(let i=0;i<t.length;i++)r[i]=e.i.stringToNewUTF8(t[i]);t=e.i._malloc(4*r.length),e.i.HEAPU32.set(r,t>>2),n(t);for(let i of r)e.i._free(i);e.i._free(t)}function je(e,t,n){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=n}function at(e,t,n){let r=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(i,s,o)=>{s?(n(r,o),r=[]):r.push(i)}}ht.forVisionTasks=function(e){return mn("vision",e)},ht.forTextTasks=function(e){return mn("text",e)},ht.forGenAiExperimentalTasks=function(e){return mn("genai_experimental",e)},ht.forGenAiTasks=function(e){return mn("genai",e)},ht.forAudioTasks=function(e){return mn("audio",e)},ht.isSimdSupported=function(){return h2()};async function rc(e,t,n,r){return e=await(async(i,s,o,c,a)=>{if(s&&await Qs(s),!self.ModuleFactory||o&&(await Qs(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&a&&((s=self.Module).locateFile=a.locateFile,a.mainScriptUrlOrBlob&&(s.mainScriptUrlOrBlob=a.mainScriptUrlOrBlob)),a=await self.ModuleFactory(self.Module||a),self.ModuleFactory=self.Module=void 0,new i(a,c)})(e,n.wasmLoaderPath,n.assetLoaderPath,t,{locateFile:i=>i.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&i.endsWith(".data")?n.assetBinaryPath.toString():i}),await e.o(r),e}function Yr(e,t){let n=M(e.baseOptions,sr,1)||new sr;typeof t=="string"?(C(n,2,On(t)),C(n,1)):t instanceof Uint8Array&&(C(n,1,yi(t,!1)),C(n,2)),E(e.baseOptions,0,1,n)}function no(e){try{let t=e.H.length;if(t===1)throw Error(e.H[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.H.map((n=>n.message)).join(", "))}finally{e.H=[]}}function f(e,t){e.C=Math.max(e.C,t)}function Sr(e,t){e.B=new ye,ke(e.B,2,"PassThroughCalculator"),G(e.B,"free_memory"),L(e.B,"free_memory_unused_out"),V(t,"free_memory"),Oe(t,e.B)}function Kt(e,t){G(e.B,t),L(e.B,t+"_unused_out")}function Lr(e){e.g.addBoolToStream(!0,"free_memory",e.C)}var oi=class{constructor(e){this.g=e,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var n,r,i,s,o,c;if(t){let a=e.baseOptions||{};if((n=e.baseOptions)!=null&&n.modelAssetBuffer&&((r=e.baseOptions)!=null&&r.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((i=M(this.baseOptions,sr,1))!=null&&i.g()||(s=M(this.baseOptions,sr,1))!=null&&s.l()||(o=e.baseOptions)!=null&&o.modelAssetBuffer||(c=e.baseOptions)!=null&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if((function(u,h){let l=M(u.baseOptions,zs,3);if(!l){var d=l=new zs,m=new js;bn(d,4,qn,m)}"delegate"in h&&(h.delegate==="GPU"?(h=l,d=new F1,bn(h,2,qn,d)):(h=l,d=new js,bn(h,4,qn,d))),E(u.baseOptions,0,3,l)})(this,a),a.modelAssetPath)return fetch(a.modelAssetPath.toString()).then((u=>{if(u.ok)return u.arrayBuffer();throw Error("Failed to fetch model: ".concat(a.modelAssetPath," (").concat(u.status,")"))})).then((u=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(u),!0,!1,!1),Yr(this,"/model.dat"),this.m(),this.L()}));if(a.modelAssetBuffer instanceof Uint8Array)Yr(this,a.modelAssetBuffer);else if(a.modelAssetBuffer)return(async function(u){let h=[];for(var l=0;;){let{done:d,value:m}=await u.read();if(d)break;h.push(m),l+=m.length}if(h.length===0)return new Uint8Array(0);if(h.length===1)return h[0];u=new Uint8Array(l),l=0;for(let d of h)u.set(d,l),l+=d.length;return u})(a.modelAssetBuffer).then((u=>{Yr(this,u),this.m(),this.L()}))}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let e;if(this.g.ca((t=>{e=M1(t)})),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener(((n,r)=>{this.H.push(Error(r))})),this.g.Ja(),this.g.setGraph(e,t),this.B=void 0,no(this)}finishProcessing(){this.g.finishProcessing(),no(this)}close(){this.B=void 0,this.g.closeGraph()}};function fe(e,t){if(!e)throw Error("Unable to obtain required WebGL resource: ".concat(t));return e}oi.prototype.close=oi.prototype.close;var ai=class{constructor(t,n,r,i){this.g=t,this.h=n,this.m=r,this.l=i}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}};function ro(e,t,n){let r=e.g;if(n=fe(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error("Could not compile WebGL shader: ".concat(r.getShaderInfoLog(n)));return r.attachShader(e.h,n),n}function io(e,t){let n=e.g,r=fe(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);let i=fe(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(e.O),n.vertexAttribPointer(e.O,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);let s=fe(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,s),n.enableVertexAttribArray(e.L),n.vertexAttribPointer(e.L,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t?[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 ai(n,r,i,s)}function es(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function Bn(e,t,n,r){return es(e,t),e.h||(e.m(),e.D()),n?(e.u||(e.u=io(e,!0)),n=e.u):(e.A||(e.A=io(e,!1)),n=e.A),t.useProgram(e.h),n.bind(),e.l(),e=r(),n.g.bindVertexArray(null),e}function ft(e,t,n){return es(e,t),e=fe(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n!=null?n:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n!=null?n:t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Fr(e,t,n){es(e,t),e.B||(e.B=fe(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.B),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0)}function ts(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var ln=class{H(){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(){let e=this.g;if(this.h=fe(e.createProgram(),"Failed to create WebGL program"),this.X=ro(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  }",e.VERTEX_SHADER),this.W=ro(this,this.H(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error("Error during program linking: ".concat(e.getProgramInfoLog(this.h)));this.O=e.getAttribLocation(this.h,"aVertex"),this.L=e.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){let e=this.g;e.deleteProgram(this.h),e.deleteShader(this.X),e.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.u&&this.u.close()}},ic=class extends ln{H(){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 "}D(){let e=this.g;e.activeTexture(e.TEXTURE1),this.C=ft(this,e,e.LINEAR),e.activeTexture(e.TEXTURE2),this.j=ft(this,e,e.NEAREST)}m(){super.m();let e=this.g;this.P=fe(e.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=fe(e.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.M=fe(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let e=this.g;e.uniform1i(this.M,0),e.uniform1i(this.P,1),e.uniform1i(this.U,2)}close(){this.C&&this.g.deleteTexture(this.C),this.j&&this.g.deleteTexture(this.j),super.close()}},sc=class extends ln{H(){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 "}D(){let e=this.g;e.activeTexture(e.TEXTURE1),this.j=ft(this,e),e.activeTexture(e.TEXTURE2),this.C=ft(this,e)}m(){super.m();let e=this.g;this.M=fe(e.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.P=fe(e.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.I=fe(e.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let e=this.g;e.uniform1i(this.I,0),e.uniform1i(this.M,1),e.uniform1i(this.P,2)}close(){this.j&&this.g.deleteTexture(this.j),this.C&&this.g.deleteTexture(this.C),super.close()}};function Qe(e,t){switch(t){case 0:return e.g.find((n=>n instanceof Uint8Array));case 1:return e.g.find((n=>n instanceof Float32Array));case 2:return e.g.find((n=>typeof WebGLTexture<"u"&&n instanceof WebGLTexture));default:throw Error("Type is not supported: ".concat(t))}}function ci(e){var t=Qe(e,1);if(!t){if(t=Qe(e,0))t=new Float32Array(t).map((r=>r/255));else{t=new Float32Array(e.width*e.height);let r=qt(e);var n=ns(e);if(Fr(n,r,d2(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){n=new Float32Array(e.width*e.height*4),r.readPixels(0,0,e.width,e.height,r.RGBA,r.FLOAT,n);for(let i=0,s=0;i<t.length;++i,s+=4)t[i]=n[s]}else r.readPixels(0,0,e.width,e.height,r.RED,r.FLOAT,t)}e.g.push(t)}return t}function d2(e){let t=Qe(e,2);if(!t){let n=qt(e);t=p2(e);let r=ci(e),i=f2(e);n.texImage2D(n.TEXTURE_2D,0,i,e.width,e.height,0,n.RED,n.FLOAT,r),hi(e)}return t}function qt(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=fe(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function f2(e){if(e=qt(e),!Yn)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Yn=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Yn=e.R16F}return Yn}function ns(e){return e.l||(e.l=new ln),e.l}function p2(e){let t=qt(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let n=Qe(e,2);return n||(n=ft(ns(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(n),e.j=!0),t.bindTexture(t.TEXTURE_2D,n),n}function hi(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Yn,ee=class{constructor(e,t,n,r,i,s,o){this.g=e,this.m=t,this.j=n,this.canvas=r,this.l=i,this.width=s,this.height=o,this.j&&--so===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!Qe(this,0)}ka(){return!!Qe(this,1)}R(){return!!Qe(this,2)}ja(){return(t=Qe(e=this,0))||(t=ci(e),t=new Uint8Array(t.map((n=>Math.round(255*n)))),e.g.push(t)),t;var e,t}ia(){return ci(this)}N(){return d2(this)}clone(){let e=[];for(let t of this.g){let n;if(t instanceof Uint8Array)n=new Uint8Array(t);else if(t instanceof Float32Array)n=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error("Type is not supported: ".concat(t));{let r=qt(this),i=ns(this);r.activeTexture(r.TEXTURE1),n=ft(i,r,this.m?r.LINEAR:r.NEAREST),r.bindTexture(r.TEXTURE_2D,n);let s=f2(this);r.texImage2D(r.TEXTURE_2D,0,s,this.width,this.height,0,r.RED,r.FLOAT,null),r.bindTexture(r.TEXTURE_2D,null),Fr(i,r,n),Bn(i,r,!1,(()=>{p2(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),hi(this)})),ts(i),hi(this)}}e.push(n)}return new ee(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&qt(this).deleteTexture(Qe(this,2)),so=-1}};ee.prototype.close=ee.prototype.close,ee.prototype.clone=ee.prototype.clone,ee.prototype.getAsWebGLTexture=ee.prototype.N,ee.prototype.getAsFloat32Array=ee.prototype.ia,ee.prototype.getAsUint8Array=ee.prototype.ja,ee.prototype.hasWebGLTexture=ee.prototype.R,ee.prototype.hasFloat32Array=ee.prototype.ka,ee.prototype.hasUint8Array=ee.prototype.Fa;var so=250,oc={color:"white",lineWidth:4,radius:6};function Hr(e){return{...oc,fillColor:(e=e||{}).color,...e}}function Ze(e,t){return e instanceof Function?e(t):e}function oo(e,t,n){return Math.max(Math.min(t,n),Math.min(Math.max(t,n),e))}function yn(e){if(!e.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return e.l}function Mn(e){if(!e.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return e.j}function ao(e,t,n){var r;if(t.R())n(t.N());else{let i=t.ka()?t.ia():t.ja();e.m=(r=e.m)!=null?r:new ln;let s=Mn(e);n((e=new ee([i],t.m,!1,s.canvas,e.m,t.width,t.height)).N()),e.close()}}function co(e,t,n,r){let i=(function(c){return c.g||(c.g=new ic),c.g})(e),s=Mn(e),o=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;Bn(i,s,!0,(()=>{(function(a,u,h,l){let d=a.g;if(d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,u),d.activeTexture(d.TEXTURE1),d.bindTexture(d.TEXTURE_2D,a.C),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,h),a.I&&(function(m,b){if(m!==b)return!1;m=m.entries(),b=b.entries();for(let[X,K]of m){m=X;let x=K;var k=b.next();if(k.done)return!1;let[O,ue]=k.value;if(k=ue,m!==O||x[0]!==k[0]||x[1]!==k[1]||x[2]!==k[2]||x[3]!==k[3])return!1}return!!b.next().done})(a.I,l))d.activeTexture(d.TEXTURE2),d.bindTexture(d.TEXTURE_2D,a.j);else{a.I=l;let m=Array(1024).fill(0);l.forEach(((b,k)=>{if(b.length!==4)throw Error("Color at index ".concat(k," is not a four-channel value."));m[4*k]=b[0],m[4*k+1]=b[1],m[4*k+2]=b[2],m[4*k+3]=b[3]})),d.activeTexture(d.TEXTURE2),d.bindTexture(d.TEXTURE_2D,a.j),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,256,1,0,d.RGBA,d.UNSIGNED_BYTE,new Uint8Array(m))}})(i,t,o,r),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);let c=i.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,null),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,null)}))}function ho(e,t,n,r){let i=Mn(e),s=(function(a){return a.h||(a.h=new sc),a.h})(e),o=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n,c=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;Bn(s,i,!0,(()=>{var a=s.g;a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,s.j),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,o),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,s.C),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,c),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),(a=s.g).activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,null),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,null)}))}var ge=class{constructor(e,t){typeof CanvasRenderingContext2D<"u"&&e instanceof CanvasRenderingContext2D||e instanceof OffscreenCanvasRenderingContext2D?(this.l=e,this.j=t):this.j=e}ya(e,t){if(e){var n=yn(this);t=Hr(t),n.save();var r=n.canvas,i=0;for(let s of e)n.fillStyle=Ze(t.fillColor,{index:i,from:s}),n.strokeStyle=Ze(t.color,{index:i,from:s}),n.lineWidth=Ze(t.lineWidth,{index:i,from:s}),(e=new Path2D).arc(s.x*r.width,s.y*r.height,Ze(t.radius,{index:i,from:s}),0,2*Math.PI),n.fill(e),n.stroke(e),++i;n.restore()}}xa(e,t,n){if(e&&t){var r=yn(this);n=Hr(n),r.save();var i=r.canvas,s=0;for(let o of t){r.beginPath(),t=e[o.start];let c=e[o.end];t&&c&&(r.strokeStyle=Ze(n.color,{index:s,from:t,to:c}),r.lineWidth=Ze(n.lineWidth,{index:s,from:t,to:c}),r.moveTo(t.x*i.width,t.y*i.height),r.lineTo(c.x*i.width,c.y*i.height)),++s,r.stroke()}r.restore()}}ua(e,t){let n=yn(this);t=Hr(t),n.save(),n.beginPath(),n.lineWidth=Ze(t.lineWidth,{}),n.strokeStyle=Ze(t.color,{}),n.fillStyle=Ze(t.fillColor,{}),n.moveTo(e.originX,e.originY),n.lineTo(e.originX+e.width,e.originY),n.lineTo(e.originX+e.width,e.originY+e.height),n.lineTo(e.originX,e.originY+e.height),n.lineTo(e.originX,e.originY),n.stroke(),n.fill(),n.restore()}va(e,t,n=[0,0,0,255]){this.l?(function(r,i,s,o){let c=Mn(r);ao(r,i,(a=>{co(r,a,s,o),(a=yn(r)).drawImage(c.canvas,0,0,a.canvas.width,a.canvas.height)}))})(this,e,n,t):co(this,e.N(),n,t)}wa(e,t,n){this.l?(function(r,i,s,o){let c=Mn(r);ao(r,i,(a=>{ho(r,a,s,o),(a=yn(r)).drawImage(c.canvas,0,0,a.canvas.width,a.canvas.height)}))})(this,e,t,n):ho(this,e.N(),t,n)}close(){var e,t,n;(e=this.g)==null||e.close(),this.g=void 0,(t=this.h)==null||t.close(),this.h=void 0,(n=this.m)==null||n.close(),this.m=void 0}};function Xe(e,t){switch(t){case 0:return e.g.find((n=>n instanceof ImageData));case 1:return e.g.find((n=>typeof ImageBitmap<"u"&&n instanceof ImageBitmap));case 2:return e.g.find((n=>typeof WebGLTexture<"u"&&n instanceof WebGLTexture));default:throw Error("Type is not supported: ".concat(t))}}function g2(e){var t=Xe(e,0);if(!t){t=$t(e);let n=Mr(e),r=new Uint8Array(e.width*e.height*4);Fr(n,t,$n(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,r),ts(n),t=new ImageData(new Uint8ClampedArray(r.buffer),e.width,e.height),e.g.push(t)}return t}function $n(e){let t=Xe(e,2);if(!t){let n=$t(e);t=Jn(e);let r=Xe(e,1)||g2(e);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),wn(e)}return t}function $t(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=fe(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Mr(e){return e.l||(e.l=new ln),e.l}function Jn(e){let t=$t(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let n=Xe(e,2);return n||(n=ft(Mr(e),t),e.g.push(n),e.m=!0),t.bindTexture(t.TEXTURE_2D,n),n}function wn(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function uo(e){let t=$t(e);return Bn(Mr(e),t,!0,(()=>(function(n,r){let i=n.canvas;if(i.width===n.width&&i.height===n.height)return r();let s=i.width,o=i.height;return i.width=n.width,i.height=n.height,n=r(),i.width=s,i.height=o,n})(e,(()=>{if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))))}ge.prototype.close=ge.prototype.close,ge.prototype.drawConfidenceMask=ge.prototype.wa,ge.prototype.drawCategoryMask=ge.prototype.va,ge.prototype.drawBoundingBox=ge.prototype.ua,ge.prototype.drawConnectors=ge.prototype.xa,ge.prototype.drawLandmarks=ge.prototype.ya,ge.lerp=function(e,t,n,r,i){return oo(r*(1-(e-t)/(n-t))+i*(1-(n-e)/(n-t)),r,i)},ge.clamp=oo;var ce=class{constructor(e,t,n,r,i,s,o){this.g=e,this.j=t,this.m=n,this.canvas=r,this.l=i,this.width=s,this.height=o,(this.j||this.m)&&--lo===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ea(){return!!Xe(this,0)}la(){return!!Xe(this,1)}R(){return!!Xe(this,2)}Ca(){return g2(this)}Ba(){var e=Xe(this,1);return e||($n(this),Jn(this),e=uo(this),wn(this),this.g.push(e),this.j=!0),e}N(){return $n(this)}clone(){let e=[];for(let t of this.g){let n;if(t instanceof ImageData)n=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){let r=$t(this),i=Mr(this);r.activeTexture(r.TEXTURE1),n=ft(i,r),r.bindTexture(r.TEXTURE_2D,n),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,this.width,this.height,0,r.RGBA,r.UNSIGNED_BYTE,null),r.bindTexture(r.TEXTURE_2D,null),Fr(i,r,n),Bn(i,r,!1,(()=>{Jn(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),wn(this)})),ts(i),wn(this)}else{if(!(t instanceof ImageBitmap))throw Error("Type is not supported: ".concat(t));$n(this),Jn(this),n=uo(this),wn(this)}e.push(n)}return new ce(e,this.la(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Xe(this,1).close(),this.m&&$t(this).deleteTexture(Xe(this,2)),lo=-1}};ce.prototype.close=ce.prototype.close,ce.prototype.clone=ce.prototype.clone,ce.prototype.getAsWebGLTexture=ce.prototype.N,ce.prototype.getAsImageBitmap=ce.prototype.Ba,ce.prototype.getAsImageData=ce.prototype.Ca,ce.prototype.hasWebGLTexture=ce.prototype.R,ce.prototype.hasImageBitmap=ce.prototype.la,ce.prototype.hasImageData=ce.prototype.Ea;var lo=250;function Ue(...e){return e.map((([t,n])=>({start:t,end:n})))}var ac=(function(e){return class extends e{Ja(){this.i._registerModelResourcesGraphService()}}})((fo=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:u2()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(e){let t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){let n=e.length,r=this.i._malloc(n);this.i.HEAPU8.set(e,r),t?this.i._changeBinaryGraph(n,r):this.i._changeTextGraph(n,r),this.i._free(r)}configureAudio(e,t,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?'),y(this,r||"input_audio",(s=>{y(this,i=i||"audio_header",(o=>{this.i._configureAudio(s,o,e,t!=null?t:0,n)}))}))}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){je(this,"__graph_config__",(t=>{e(t)})),y(this,"__graph_config__",(t=>{this.i._getGraphConfig(t,void 0)})),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,n){this.addAudioToStreamWithShape(e,0,0,t,n)}addAudioToStreamWithShape(e,t,n,r,i){let s=4*e.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(e,this.g/4),y(this,r,(o=>{this.i._addAudioToInputStream(this.g,t,n,o,i)}))}addGpuBufferToStream(e,t,n){y(this,t,(r=>{let[i,s]=eo(this,e,r);this.i._addBoundTextureToStream(r,i,s,n)}))}addBoolToStream(e,t,n){y(this,t,(r=>{this.i._addBoolToInputStream(e,r,n)}))}addDoubleToStream(e,t,n){y(this,t,(r=>{this.i._addDoubleToInputStream(e,r,n)}))}addFloatToStream(e,t,n){y(this,t,(r=>{this.i._addFloatToInputStream(e,r,n)}))}addIntToStream(e,t,n){y(this,t,(r=>{this.i._addIntToInputStream(e,r,n)}))}addUintToStream(e,t,n){y(this,t,(r=>{this.i._addUintToInputStream(e,r,n)}))}addStringToStream(e,t,n){y(this,t,(r=>{y(this,e,(i=>{this.i._addStringToInputStream(i,r,n)}))}))}addStringRecordToStream(e,t,n){y(this,t,(r=>{to(this,Object.keys(e),(i=>{to(this,Object.values(e),(s=>{this.i._addFlatHashMapToInputStream(i,s,Object.keys(e).length,r,n)}))}))}))}addProtoToStream(e,t,n,r){y(this,n,(i=>{y(this,t,(s=>{let o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputStream(o,e.length,s,i,r),this.i._free(o)}))}))}addEmptyPacketToStream(e,t){y(this,e,(n=>{this.i._addEmptyPacketToInputStream(n,t)}))}addBoolVectorToStream(e,t,n){y(this,t,(r=>{let i=this.i._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(let s of e)this.i._addBoolVectorEntry(i,s);this.i._addBoolVectorToInputStream(i,r,n)}))}addDoubleVectorToStream(e,t,n){y(this,t,(r=>{let i=this.i._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(let s of e)this.i._addDoubleVectorEntry(i,s);this.i._addDoubleVectorToInputStream(i,r,n)}))}addFloatVectorToStream(e,t,n){y(this,t,(r=>{let i=this.i._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(let s of e)this.i._addFloatVectorEntry(i,s);this.i._addFloatVectorToInputStream(i,r,n)}))}addIntVectorToStream(e,t,n){y(this,t,(r=>{let i=this.i._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(let s of e)this.i._addIntVectorEntry(i,s);this.i._addIntVectorToInputStream(i,r,n)}))}addUintVectorToStream(e,t,n){y(this,t,(r=>{let i=this.i._allocateUintVector(e.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(let s of e)this.i._addUintVectorEntry(i,s);this.i._addUintVectorToInputStream(i,r,n)}))}addStringVectorToStream(e,t,n){y(this,t,(r=>{let i=this.i._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(let s of e)y(this,s,(o=>{this.i._addStringVectorEntry(i,o)}));this.i._addStringVectorToInputStream(i,r,n)}))}addBoolToInputSidePacket(e,t){y(this,t,(n=>{this.i._addBoolToInputSidePacket(e,n)}))}addDoubleToInputSidePacket(e,t){y(this,t,(n=>{this.i._addDoubleToInputSidePacket(e,n)}))}addFloatToInputSidePacket(e,t){y(this,t,(n=>{this.i._addFloatToInputSidePacket(e,n)}))}addIntToInputSidePacket(e,t){y(this,t,(n=>{this.i._addIntToInputSidePacket(e,n)}))}addUintToInputSidePacket(e,t){y(this,t,(n=>{this.i._addUintToInputSidePacket(e,n)}))}addStringToInputSidePacket(e,t){y(this,t,(n=>{y(this,e,(r=>{this.i._addStringToInputSidePacket(r,n)}))}))}addProtoToInputSidePacket(e,t,n){y(this,n,(r=>{y(this,t,(i=>{let s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputSidePacket(s,e.length,i,r),this.i._free(s)}))}))}addBoolVectorToInputSidePacket(e,t){y(this,t,(n=>{let r=this.i._allocateBoolVector(e.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let i of e)this.i._addBoolVectorEntry(r,i);this.i._addBoolVectorToInputSidePacket(r,n)}))}addDoubleVectorToInputSidePacket(e,t){y(this,t,(n=>{let r=this.i._allocateDoubleVector(e.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let i of e)this.i._addDoubleVectorEntry(r,i);this.i._addDoubleVectorToInputSidePacket(r,n)}))}addFloatVectorToInputSidePacket(e,t){y(this,t,(n=>{let r=this.i._allocateFloatVector(e.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let i of e)this.i._addFloatVectorEntry(r,i);this.i._addFloatVectorToInputSidePacket(r,n)}))}addIntVectorToInputSidePacket(e,t){y(this,t,(n=>{let r=this.i._allocateIntVector(e.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let i of e)this.i._addIntVectorEntry(r,i);this.i._addIntVectorToInputSidePacket(r,n)}))}addUintVectorToInputSidePacket(e,t){y(this,t,(n=>{let r=this.i._allocateUintVector(e.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let i of e)this.i._addUintVectorEntry(r,i);this.i._addUintVectorToInputSidePacket(r,n)}))}addStringVectorToInputSidePacket(e,t){y(this,t,(n=>{let r=this.i._allocateStringVector(e.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let i of e)y(this,i,(s=>{this.i._addStringVectorEntry(r,s)}));this.i._addStringVectorToInputSidePacket(r,n)}))}attachBoolListener(e,t){je(this,e,t),y(this,e,(n=>{this.i._attachBoolListener(n)}))}attachBoolVectorListener(e,t){at(this,e,t),y(this,e,(n=>{this.i._attachBoolVectorListener(n)}))}attachIntListener(e,t){je(this,e,t),y(this,e,(n=>{this.i._attachIntListener(n)}))}attachIntVectorListener(e,t){at(this,e,t),y(this,e,(n=>{this.i._attachIntVectorListener(n)}))}attachUintListener(e,t){je(this,e,t),y(this,e,(n=>{this.i._attachUintListener(n)}))}attachUintVectorListener(e,t){at(this,e,t),y(this,e,(n=>{this.i._attachUintVectorListener(n)}))}attachDoubleListener(e,t){je(this,e,t),y(this,e,(n=>{this.i._attachDoubleListener(n)}))}attachDoubleVectorListener(e,t){at(this,e,t),y(this,e,(n=>{this.i._attachDoubleVectorListener(n)}))}attachFloatListener(e,t){je(this,e,t),y(this,e,(n=>{this.i._attachFloatListener(n)}))}attachFloatVectorListener(e,t){at(this,e,t),y(this,e,(n=>{this.i._attachFloatVectorListener(n)}))}attachStringListener(e,t){je(this,e,t),y(this,e,(n=>{this.i._attachStringListener(n)}))}attachStringVectorListener(e,t){at(this,e,t),y(this,e,(n=>{this.i._attachStringVectorListener(n)}))}attachProtoListener(e,t,n){je(this,e,t),y(this,e,(r=>{this.i._attachProtoListener(r,n||!1)}))}attachProtoVectorListener(e,t,n){at(this,e,t),y(this,e,(r=>{this.i._attachProtoVectorListener(r,n||!1)}))}attachAudioListener(e,t,n){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),je(this,e,((r,i)=>{r=new Float32Array(r.buffer,r.byteOffset,r.length/4),t(r,i)})),y(this,e,(r=>{this.i._attachAudioListener(r,n||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends fo{get ga(){return this.i}pa(e,t,n){y(this,t,(r=>{let[i,s]=eo(this,e,r);this.ga._addBoundTextureAsImageToStream(r,i,s,n)}))}Z(e,t){je(this,e,t),y(this,e,(n=>{this.ga._attachImageListener(n)}))}aa(e,t){at(this,e,t),y(this,e,(n=>{this.ga._attachImageVectorListener(n)}))}})),fo,Be=class extends ac{};async function F(e,t,n){var r;return(async function(i,s,o,c){return rc(i,s,o,c)})(e,(r=n.canvas)!=null?r:u2()?void 0:document.createElement("canvas"),t,n)}function m2(e,t,n,r){if(e.U){let s=new Ba;if(n!=null&&n.regionOfInterest){if(!e.oa)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(i.left<0||i.top<0||i.right>1||i.bottom>1)throw Error("Expected RectF values to be in [0,1].");v(s,1,(i.left+i.right)/2),v(s,2,(i.top+i.bottom)/2),v(s,4,i.right-i.left),v(s,3,i.bottom-i.top)}else v(s,1,.5),v(s,2,.5),v(s,4,1),v(s,3,1);if(n!=null&&n.rotationDegrees){if((n==null?void 0:n.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90\xB0.");if(v(s,5,-Math.PI*n.rotationDegrees/180),(n==null?void 0:n.rotationDegrees)%180!=0){let[o,c]=l2(t);n=W(s,3)*c/o,i=W(s,4)*o/c,v(s,4,n),v(s,3,i)}}e.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",e.U,r)}e.g.pa(t,e.X,r!=null?r:performance.now()),e.finishProcessing()}function Ge(e,t,n){var r;if((r=e.baseOptions)!=null&&r.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");m2(e,t,n,e.C+1)}function $e(e,t,n,r){var i;if(!((i=e.baseOptions)!=null&&i.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");m2(e,t,n,r)}function Jt(e,t,n,r){var i=t.data;let s=t.width,o=s*(t=t.height);if((i instanceof Uint8Array||i instanceof Float32Array)&&i.length!==o)throw Error("Unsupported channel count: "+i.length/o);return e=new ee([i],n,!1,e.g.i.canvas,e.P,s,t),r?e.clone():e}var Se=class extends oi{constructor(e,t,n,r){super(e),this.g=e,this.X=t,this.U=n,this.oa=r,this.P=new ln}l(e,t=!0){if("runningMode"in e&&C(this.baseOptions,2,Ln(!!e.runningMode&&e.runningMode!=="IMAGE")),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Se.prototype.close=Se.prototype.close;var Me=class extends Se{constructor(e,t){super(new Be(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},E(e=this.h=new kr,0,1,t=new Y),v(this.h,2,.5),v(this.h,3,.3)}get baseOptions(){return M(this.h,Y,1)}set baseOptions(e){E(this.h,0,1,e)}o(e){var t,n;return"minDetectionConfidence"in e&&v(this.h,2,(t=e.minDetectionConfidence)!=null?t:.5),"minSuppressionThreshold"in e&&v(this.h,3,(n=e.minSuppressionThreshold)!=null?n:.3),this.l(e)}F(e,t){return this.j={detections:[]},Ge(this,e,t),this.j}G(e,t,n){return this.j={detections:[]},$e(this,e,n,t),this.j}m(){var e=new Fe;V(e,"image_in"),V(e,"norm_rect_in"),I(e,"detections");let t=new Le;Ke(t,V1,this.h);let n=new ye;ke(n,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),G(n,"IMAGE:image_in"),G(n,"NORM_RECT:norm_rect_in"),L(n,"DETECTIONS:detections"),n.o(t),Oe(e,n),this.g.attachProtoVectorListener("detections",((r,i)=>{for(let s of r)r=Na(s),this.j.detections.push(c2(r));f(this,i)})),this.g.attachEmptyPacketListener("detections",(r=>{f(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Me.prototype.detectForVideo=Me.prototype.G,Me.prototype.detect=Me.prototype.F,Me.prototype.setOptions=Me.prototype.o,Me.createFromModelPath=async function(e,t){return F(Me,e,{baseOptions:{modelAssetPath:t}})},Me.createFromModelBuffer=function(e,t){return F(Me,e,{baseOptions:{modelAssetBuffer:t}})},Me.createFromOptions=function(e,t){return F(Me,e,t)};var rs=Ue([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]),is=Ue([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]),ss=Ue([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),y2=Ue([474,475],[475,476],[476,477],[477,474]),os=Ue([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]),as=Ue([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),v2=Ue([469,470],[470,471],[471,472],[472,469]),cs=Ue([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]),_2=[...rs,...is,...ss,...os,...as,...cs],w2=Ue([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 po(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var U=class extends Se{constructor(e,t){super(new Be(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,E(e=this.h=new Ya,0,1,t=new Y),this.A=new Xa,E(this.h,0,3,this.A),this.u=new kr,E(this.h,0,2,this.u),rt(this.u,4,1),v(this.u,2,.5),v(this.A,2,.5),v(this.h,4,.5)}get baseOptions(){return M(this.h,Y,1)}set baseOptions(e){E(this.h,0,1,e)}o(e){var t,n,r,i;return"numFaces"in e&&rt(this.u,4,(t=e.numFaces)!=null?t:1),"minFaceDetectionConfidence"in e&&v(this.u,2,(n=e.minFaceDetectionConfidence)!=null?n:.5),"minTrackingConfidence"in e&&v(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minFacePresenceConfidence"in e&&v(this.A,2,(i=e.minFacePresenceConfidence)!=null?i:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}F(e,t){return po(this),Ge(this,e,t),this.j}G(e,t,n){return po(this),$e(this,e,n,t),this.j}m(){var e=new Fe;V(e,"image_in"),V(e,"norm_rect"),I(e,"face_landmarks");let t=new Le;Ke(t,Y1,this.h);let n=new ye;ke(n,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),G(n,"IMAGE:image_in"),G(n,"NORM_RECT:norm_rect"),L(n,"NORM_LANDMARKS:face_landmarks"),n.o(t),Oe(e,n),this.g.attachProtoVectorListener("face_landmarks",((r,i)=>{for(let s of r)r=Un(s),this.j.faceLandmarks.push(xr(r));f(this,i)})),this.g.attachEmptyPacketListener("face_landmarks",(r=>{f(this,r)})),this.outputFaceBlendshapes&&(I(e,"blendshapes"),L(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((r,i)=>{var s;if(this.outputFaceBlendshapes)for(let o of r)r=Ar(o),this.j.faceBlendshapes.push(Qi((s=r.g())!=null?s:[]));f(this,i)})),this.g.attachEmptyPacketListener("blendshapes",(r=>{f(this,r)}))),this.outputFacialTransformationMatrixes&&(I(e,"face_geometry"),L(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((r,i)=>{var s,o,c,a,u;if(this.outputFacialTransformationMatrixes)for(let h of r)(r=M(r=X1(h),C1,2))&&this.j.facialTransformationMatrixes.push({rows:(o=(s=Pe(r,1))!=null?s:0)!=null?o:0,columns:(a=(c=Pe(r,2))!=null?c:0)!=null?a:0,data:(u=_t(r,3,Ye,vt()).slice())!=null?u:[]});f(this,i)})),this.g.attachEmptyPacketListener("face_geometry",(r=>{f(this,r)}))),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};U.prototype.detectForVideo=U.prototype.G,U.prototype.detect=U.prototype.F,U.prototype.setOptions=U.prototype.o,U.createFromModelPath=function(e,t){return F(U,e,{baseOptions:{modelAssetPath:t}})},U.createFromModelBuffer=function(e,t){return F(U,e,{baseOptions:{modelAssetBuffer:t}})},U.createFromOptions=function(e,t){return F(U,e,t)},U.FACE_LANDMARKS_LIPS=rs,U.FACE_LANDMARKS_LEFT_EYE=is,U.FACE_LANDMARKS_LEFT_EYEBROW=ss,U.FACE_LANDMARKS_LEFT_IRIS=y2,U.FACE_LANDMARKS_RIGHT_EYE=os,U.FACE_LANDMARKS_RIGHT_EYEBROW=as,U.FACE_LANDMARKS_RIGHT_IRIS=v2,U.FACE_LANDMARKS_FACE_OVAL=cs,U.FACE_LANDMARKS_CONTOURS=_2,U.FACE_LANDMARKS_TESSELATION=w2;var hs=Ue([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 go(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function mo(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function yo(e,t=!0){var i,s,o,c,a,u;let n=[];for(let h of e){var r=Ar(h);e=[];for(let l of r.g())r=t&&Pe(l,1)!=null?(i=Pe(l,1))!=null?i:0:-1,e.push({score:(s=W(l,2))!=null?s:0,index:r,categoryName:(c=(o=he(B(l,3)))!=null?o:"")!=null?c:"",displayName:(u=(a=he(B(l,4)))!=null?a:"")!=null?u:""});n.push(e)}return n}var ve=class extends Se{constructor(e,t){super(new Be(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],E(e=this.j=new za,0,1,t=new Y),this.u=new qi,E(this.j,0,2,this.u),this.D=new Ki,E(this.u,0,3,this.D),this.A=new Wa,E(this.u,0,2,this.A),this.h=new H1,E(this.j,0,3,this.h),v(this.A,2,.5),v(this.u,4,.5),v(this.D,2,.5)}get baseOptions(){return M(this.j,Y,1)}set baseOptions(e){E(this.j,0,1,e)}o(e){var i,s,o,c,a,u,h,l;if(rt(this.A,3,(i=e.numHands)!=null?i:1),"minHandDetectionConfidence"in e&&v(this.A,2,(s=e.minHandDetectionConfidence)!=null?s:.5),"minTrackingConfidence"in e&&v(this.u,4,(o=e.minTrackingConfidence)!=null?o:.5),"minHandPresenceConfidence"in e&&v(this.D,2,(c=e.minHandPresenceConfidence)!=null?c:.5),e.cannedGesturesClassifierOptions){var t=new Ot,n=t,r=si(e.cannedGesturesClassifierOptions,(a=M(this.h,Ot,3))==null?void 0:a.l());E(n,0,2,r),E(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((u=M(this.h,Ot,3))==null||u.g());return e.customGesturesClassifierOptions?(E(n=t=new Ot,0,2,r=si(e.customGesturesClassifierOptions,(h=M(this.h,Ot,4))==null?void 0:h.l())),E(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((l=M(this.h,Ot,4))==null||l.g()),this.l(e)}Ha(e,t){return go(this),Ge(this,e,t),mo(this)}Ia(e,t,n){return go(this),$e(this,e,n,t),mo(this)}m(){var e=new Fe;V(e,"image_in"),V(e,"norm_rect"),I(e,"hand_gestures"),I(e,"hand_landmarks"),I(e,"world_hand_landmarks"),I(e,"handedness");let t=new Le;Ke(t,W1,this.j);let n=new ye;ke(n,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),G(n,"IMAGE:image_in"),G(n,"NORM_RECT:norm_rect"),L(n,"HAND_GESTURES:hand_gestures"),L(n,"LANDMARKS:hand_landmarks"),L(n,"WORLD_LANDMARKS:world_hand_landmarks"),L(n,"HANDEDNESS:handedness"),n.o(t),Oe(e,n),this.g.attachProtoVectorListener("hand_landmarks",((r,i)=>{var s,o,c,a;for(let u of r){r=Un(u);let h=[];for(let l of nt(r,Ua,1))h.push({x:(s=W(l,1))!=null?s:0,y:(o=W(l,2))!=null?o:0,z:(c=W(l,3))!=null?c:0,visibility:(a=W(l,4))!=null?a:0});this.landmarks.push(h)}f(this,i)})),this.g.attachEmptyPacketListener("hand_landmarks",(r=>{f(this,r)})),this.g.attachProtoVectorListener("world_hand_landmarks",((r,i)=>{var s,o,c,a;for(let u of r){r=Ut(u);let h=[];for(let l of nt(r,Da,1))h.push({x:(s=W(l,1))!=null?s:0,y:(o=W(l,2))!=null?o:0,z:(c=W(l,3))!=null?c:0,visibility:(a=W(l,4))!=null?a:0});this.worldLandmarks.push(h)}f(this,i)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(r=>{f(this,r)})),this.g.attachProtoVectorListener("hand_gestures",((r,i)=>{this.gestures.push(...yo(r,!1)),f(this,i)})),this.g.attachEmptyPacketListener("hand_gestures",(r=>{f(this,r)})),this.g.attachProtoVectorListener("handedness",((r,i)=>{this.handedness.push(...yo(r)),f(this,i)})),this.g.attachEmptyPacketListener("handedness",(r=>{f(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function vo(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}ve.prototype.recognizeForVideo=ve.prototype.Ia,ve.prototype.recognize=ve.prototype.Ha,ve.prototype.setOptions=ve.prototype.o,ve.createFromModelPath=function(e,t){return F(ve,e,{baseOptions:{modelAssetPath:t}})},ve.createFromModelBuffer=function(e,t){return F(ve,e,{baseOptions:{modelAssetBuffer:t}})},ve.createFromOptions=function(e,t){return F(ve,e,t)},ve.HAND_CONNECTIONS=hs;var _e=class extends Se{constructor(e,t){super(new Be(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],E(e=this.h=new qi,0,1,t=new Y),this.u=new Ki,E(this.h,0,3,this.u),this.j=new Wa,E(this.h,0,2,this.j),rt(this.j,3,1),v(this.j,2,.5),v(this.u,2,.5),v(this.h,4,.5)}get baseOptions(){return M(this.h,Y,1)}set baseOptions(e){E(this.h,0,1,e)}o(e){var t,n,r,i;return"numHands"in e&&rt(this.j,3,(t=e.numHands)!=null?t:1),"minHandDetectionConfidence"in e&&v(this.j,2,(n=e.minHandDetectionConfidence)!=null?n:.5),"minTrackingConfidence"in e&&v(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minHandPresenceConfidence"in e&&v(this.u,2,(i=e.minHandPresenceConfidence)!=null?i:.5),this.l(e)}F(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ge(this,e,t),vo(this)}G(e,t,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],$e(this,e,n,t),vo(this)}m(){var e=new Fe;V(e,"image_in"),V(e,"norm_rect"),I(e,"hand_landmarks"),I(e,"world_hand_landmarks"),I(e,"handedness");let t=new Le;Ke(t,z1,this.h);let n=new ye;ke(n,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),G(n,"IMAGE:image_in"),G(n,"NORM_RECT:norm_rect"),L(n,"LANDMARKS:hand_landmarks"),L(n,"WORLD_LANDMARKS:world_hand_landmarks"),L(n,"HANDEDNESS:handedness"),n.o(t),Oe(e,n),this.g.attachProtoVectorListener("hand_landmarks",((r,i)=>{for(let s of r)r=Un(s),this.landmarks.push(xr(r));f(this,i)})),this.g.attachEmptyPacketListener("hand_landmarks",(r=>{f(this,r)})),this.g.attachProtoVectorListener("world_hand_landmarks",((r,i)=>{for(let s of r)r=Ut(s),this.worldLandmarks.push(An(r));f(this,i)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(r=>{f(this,r)})),this.g.attachProtoVectorListener("handedness",((r,i)=>{var a,u,h,l,d,m,b;var s=this.handedness,o=s.push;let c=[];for(let k of r){r=Ar(k);let X=[];for(let K of r.g())X.push({score:(a=W(K,2))!=null?a:0,index:(h=(u=Pe(K,1))!=null?u:0)!=null?h:-1,categoryName:(d=(l=he(B(K,3)))!=null?l:"")!=null?d:"",displayName:(b=(m=he(B(K,4)))!=null?m:"")!=null?b:""});c.push(X)}o.call(s,...c),f(this,i)})),this.g.attachEmptyPacketListener("handedness",(r=>{f(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};_e.prototype.detectForVideo=_e.prototype.G,_e.prototype.detect=_e.prototype.F,_e.prototype.setOptions=_e.prototype.o,_e.createFromModelPath=function(e,t){return F(_e,e,{baseOptions:{modelAssetPath:t}})},_e.createFromModelBuffer=function(e,t){return F(_e,e,{baseOptions:{modelAssetBuffer:t}})},_e.createFromOptions=function(e,t){return F(_e,e,t)},_e.HAND_CONNECTIONS=hs;var E2=Ue([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function _o(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function wo(e){try{if(!e.D)return e.h;e.D(e.h)}finally{Lr(e)}}function Hn(e,t){e=Un(e),t.push(xr(e))}var D=class extends Se{constructor(e,t){super(new Be(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,E(e=this.j=new Za,0,1,t=new Y),this.I=new Ki,E(this.j,0,2,this.I),this.W=new K1,E(this.j,0,3,this.W),this.u=new kr,E(this.j,0,4,this.u),this.O=new Xa,E(this.j,0,5,this.O),this.A=new $a,E(this.j,0,6,this.A),this.M=new Ja,E(this.j,0,7,this.M),v(this.u,2,.5),v(this.u,3,.3),v(this.O,2,.5),v(this.A,2,.5),v(this.A,3,.3),v(this.M,2,.5),v(this.I,2,.5)}get baseOptions(){return M(this.j,Y,1)}set baseOptions(e){E(this.j,0,1,e)}o(e){var t,n,r,i,s,o,c;return"minFaceDetectionConfidence"in e&&v(this.u,2,(t=e.minFaceDetectionConfidence)!=null?t:.5),"minFaceSuppressionThreshold"in e&&v(this.u,3,(n=e.minFaceSuppressionThreshold)!=null?n:.3),"minFacePresenceConfidence"in e&&v(this.O,2,(r=e.minFacePresenceConfidence)!=null?r:.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&v(this.A,2,(i=e.minPoseDetectionConfidence)!=null?i:.5),"minPoseSuppressionThreshold"in e&&v(this.A,3,(s=e.minPoseSuppressionThreshold)!=null?s:.3),"minPosePresenceConfidence"in e&&v(this.M,2,(o=e.minPosePresenceConfidence)!=null?o:.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&v(this.I,2,(c=e.minHandLandmarksConfidence)!=null?c:.5),this.l(e)}F(e,t,n){let r=typeof t!="function"?t:{};return this.D=typeof t=="function"?t:n,_o(this),Ge(this,e,r),wo(this)}G(e,t,n,r){let i=typeof n!="function"?n:{};return this.D=typeof n=="function"?n:r,_o(this),$e(this,e,i,t),wo(this)}m(){var e=new Fe;V(e,"input_frames_image"),I(e,"pose_landmarks"),I(e,"pose_world_landmarks"),I(e,"face_landmarks"),I(e,"left_hand_landmarks"),I(e,"left_hand_world_landmarks"),I(e,"right_hand_landmarks"),I(e,"right_hand_world_landmarks");let t=new Le,n=new Ds;ke(n,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),(function(i,s){if(s!=null)if(Array.isArray(s))C(i,2,dr(s,0,Fn));else{if(!(typeof s=="string"||s instanceof He||gi(s)))throw Error("invalid value in Any.value field: "+s+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");ct(i,2,yi(s,!1),kt())}})(n,this.j.g());let r=new ye;ke(r,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Ri(r,8,Ds,n),G(r,"IMAGE:input_frames_image"),L(r,"POSE_LANDMARKS:pose_landmarks"),L(r,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),L(r,"FACE_LANDMARKS:face_landmarks"),L(r,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),L(r,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),L(r,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),L(r,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),r.o(t),Oe(e,r),Sr(this,e),this.g.attachProtoListener("pose_landmarks",((i,s)=>{Hn(i,this.h.poseLandmarks),f(this,s)})),this.g.attachEmptyPacketListener("pose_landmarks",(i=>{f(this,i)})),this.g.attachProtoListener("pose_world_landmarks",((i,s)=>{var o=this.h.poseWorldLandmarks;i=Ut(i),o.push(An(i)),f(this,s)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(i=>{f(this,i)})),this.outputPoseSegmentationMasks&&(L(r,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Kt(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",((i,s)=>{this.h.poseSegmentationMasks=[Jt(this,i,!0,!this.D)],f(this,s)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(i=>{this.h.poseSegmentationMasks=[],f(this,i)}))),this.g.attachProtoListener("face_landmarks",((i,s)=>{Hn(i,this.h.faceLandmarks),f(this,s)})),this.g.attachEmptyPacketListener("face_landmarks",(i=>{f(this,i)})),this.outputFaceBlendshapes&&(I(e,"extra_blendshapes"),L(r,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",((i,s)=>{var c;var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(i=Ar(i),o.push(Qi((c=i.g())!=null?c:[]))),f(this,s)})),this.g.attachEmptyPacketListener("extra_blendshapes",(i=>{f(this,i)}))),this.g.attachProtoListener("left_hand_landmarks",((i,s)=>{Hn(i,this.h.leftHandLandmarks),f(this,s)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(i=>{f(this,i)})),this.g.attachProtoListener("left_hand_world_landmarks",((i,s)=>{var o=this.h.leftHandWorldLandmarks;i=Ut(i),o.push(An(i)),f(this,s)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(i=>{f(this,i)})),this.g.attachProtoListener("right_hand_landmarks",((i,s)=>{Hn(i,this.h.rightHandLandmarks),f(this,s)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(i=>{f(this,i)})),this.g.attachProtoListener("right_hand_world_landmarks",((i,s)=>{var o=this.h.rightHandWorldLandmarks;i=Ut(i),o.push(An(i)),f(this,s)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(i=>{f(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};D.prototype.detectForVideo=D.prototype.G,D.prototype.detect=D.prototype.F,D.prototype.setOptions=D.prototype.o,D.createFromModelPath=function(e,t){return F(D,e,{baseOptions:{modelAssetPath:t}})},D.createFromModelBuffer=function(e,t){return F(D,e,{baseOptions:{modelAssetBuffer:t}})},D.createFromOptions=function(e,t){return F(D,e,t)},D.HAND_CONNECTIONS=hs,D.POSE_CONNECTIONS=E2,D.FACE_LANDMARKS_LIPS=rs,D.FACE_LANDMARKS_LEFT_EYE=is,D.FACE_LANDMARKS_LEFT_EYEBROW=ss,D.FACE_LANDMARKS_LEFT_IRIS=y2,D.FACE_LANDMARKS_RIGHT_EYE=os,D.FACE_LANDMARKS_RIGHT_EYEBROW=as,D.FACE_LANDMARKS_RIGHT_IRIS=v2,D.FACE_LANDMARKS_FACE_OVAL=cs,D.FACE_LANDMARKS_CONTOURS=_2,D.FACE_LANDMARKS_TESSELATION=w2;var Ie=class extends Se{constructor(e,t){super(new Be(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},E(e=this.h=new Qa,0,1,t=new Y)}get baseOptions(){return M(this.h,Y,1)}set baseOptions(e){E(this.h,0,1,e)}o(e){return E(this.h,0,2,si(e,M(this.h,Wi,2))),this.l(e)}sa(e,t){return this.j={classifications:[]},Ge(this,e,t),this.j}ta(e,t,n){return this.j={classifications:[]},$e(this,e,n,t),this.j}m(){var e=new Fe;V(e,"input_image"),V(e,"norm_rect"),I(e,"classifications");let t=new Le;Ke(t,q1,this.h);let n=new ye;ke(n,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),G(n,"IMAGE:input_image"),G(n,"NORM_RECT:norm_rect"),L(n,"CLASSIFICATIONS:classifications"),n.o(t),Oe(e,n),this.g.attachProtoListener("classifications",((r,i)=>{this.j=tc(D1(r)),f(this,i)})),this.g.attachEmptyPacketListener("classifications",(r=>{f(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ie.prototype.classifyForVideo=Ie.prototype.ta,Ie.prototype.classify=Ie.prototype.sa,Ie.prototype.setOptions=Ie.prototype.o,Ie.createFromModelPath=function(e,t){return F(Ie,e,{baseOptions:{modelAssetPath:t}})},Ie.createFromModelBuffer=function(e,t){return F(Ie,e,{baseOptions:{modelAssetBuffer:t}})},Ie.createFromOptions=function(e,t){return F(Ie,e,t)};var we=class extends Se{constructor(e,t){super(new Be(e,t),"image_in","norm_rect",!0),this.h=new e2,this.embeddings={embeddings:[]},E(e=this.h,0,1,t=new Y)}get baseOptions(){return M(this.h,Y,1)}set baseOptions(e){E(this.h,0,1,e)}o(e){var t=this.h,n=M(this.h,Ws,2);return n=n?n.clone():new Ws,e.l2Normalize!==void 0?C(n,1,Ln(e.l2Normalize)):"l2Normalize"in e&&C(n,1),e.quantize!==void 0?C(n,2,Ln(e.quantize)):"quantize"in e&&C(n,2),E(t,0,2,n),this.l(e)}za(e,t){return Ge(this,e,t),this.embeddings}Aa(e,t,n){return $e(this,e,n,t),this.embeddings}m(){var e=new Fe;V(e,"image_in"),V(e,"norm_rect"),I(e,"embeddings_out");let t=new Le;Ke(t,$1,this.h);let n=new ye;ke(n,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),G(n,"IMAGE:image_in"),G(n,"NORM_RECT:norm_rect"),L(n,"EMBEDDINGS:embeddings_out"),n.o(t),Oe(e,n),this.g.attachProtoListener("embeddings_out",((r,i)=>{r=G1(r),this.embeddings=(function(s){return{embeddings:nt(s,B1,1).map((o=>{var u,h,l,d,m,b,k;let c={headIndex:(h=(u=Pe(o,3))!=null?u:0)!=null?h:-1,headName:(d=(l=he(B(o,4)))!=null?l:"")!=null?d:""};var a=o.v;return Zo(a,0|a[p],Hs,Br(o,1))!==void 0?(o=_t(o=M(o,Hs,Br(o,1),void 0),1,Ye,vt()),c.floatEmbedding=o.slice()):(a=new Uint8Array(0),c.quantizedEmbedding=(k=(b=(m=M(o,U1,Br(o,2),void 0))==null?void 0:m.na())==null?void 0:b.h())!=null?k:a),c})),timestampMs:a2(ta(s))}})(r),f(this,i)})),this.g.attachEmptyPacketListener("embeddings_out",(r=>{f(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};we.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Zs(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Zs(Js(e.quantizedEmbedding),Js(t.quantizedEmbedding))}return e},we.prototype.embedForVideo=we.prototype.Aa,we.prototype.embed=we.prototype.za,we.prototype.setOptions=we.prototype.o,we.createFromModelPath=function(e,t){return F(we,e,{baseOptions:{modelAssetPath:t}})},we.createFromModelBuffer=function(e,t){return F(we,e,{baseOptions:{modelAssetBuffer:t}})},we.createFromOptions=function(e,t){return F(we,e,t)};var ui=class{constructor(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach((n=>{n.close()})),(t=this.categoryMask)==null||t.close()}};function cc(e){var n,r,i;let t=(function(s){return nt(s,ye,1)})(e.ca()).filter((s=>{var o;return((o=he(B(s,1)))!=null?o:"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")}));if(e.u=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&((i=(r=(n=M(t[0],Le,7))==null?void 0:n.j())==null?void 0:r.g())!=null?i:new Map).forEach(((s,o)=>{var c;e.u[Number(o)]=(c=he(B(s,1)))!=null?c:""}))}function Eo(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function bo(e){try{let t=new ui(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{Lr(e)}}ui.prototype.close=ui.prototype.close;var me=class extends Se{constructor(e,t){super(new Be(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Zi,this.A=new t2,E(this.h,0,3,this.A),E(e=this.h,0,1,t=new Y)}get baseOptions(){return M(this.h,Y,1)}set baseOptions(e){E(this.h,0,1,e)}o(e){var t,n;return e.displayNamesLocale!==void 0?C(this.h,2,On(e.displayNamesLocale)):"displayNamesLocale"in e&&C(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=(t=e.outputCategoryMask)!=null?t:!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=(n=e.outputConfidenceMasks)!=null?n:!0),super.l(e)}L(){cc(this)}segment(e,t,n){let r=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:n,Eo(this),Ge(this,e,r),bo(this)}La(e,t,n,r){let i=typeof n!="function"?n:{};return this.j=typeof n=="function"?n:r,Eo(this),$e(this,e,i,t),bo(this)}Da(){return this.u}m(){var e=new Fe;V(e,"image_in"),V(e,"norm_rect");let t=new Le;Ke(t,r2,this.h);let n=new ye;ke(n,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),G(n,"IMAGE:image_in"),G(n,"NORM_RECT:norm_rect"),n.o(t),Oe(e,n),Sr(this,e),this.outputConfidenceMasks&&(I(e,"confidence_masks"),L(n,"CONFIDENCE_MASKS:confidence_masks"),Kt(this,"confidence_masks"),this.g.aa("confidence_masks",((r,i)=>{this.confidenceMasks=r.map((s=>Jt(this,s,!0,!this.j))),f(this,i)})),this.g.attachEmptyPacketListener("confidence_masks",(r=>{this.confidenceMasks=[],f(this,r)}))),this.outputCategoryMask&&(I(e,"category_mask"),L(n,"CATEGORY_MASK:category_mask"),Kt(this,"category_mask"),this.g.Z("category_mask",((r,i)=>{this.categoryMask=Jt(this,r,!1,!this.j),f(this,i)})),this.g.attachEmptyPacketListener("category_mask",(r=>{this.categoryMask=void 0,f(this,r)}))),I(e,"quality_scores"),L(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((r,i)=>{this.qualityScores=r,f(this,i)})),this.g.attachEmptyPacketListener("quality_scores",(r=>{this.categoryMask=void 0,f(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};me.prototype.getLabels=me.prototype.Da,me.prototype.segmentForVideo=me.prototype.La,me.prototype.segment=me.prototype.segment,me.prototype.setOptions=me.prototype.o,me.createFromModelPath=function(e,t){return F(me,e,{baseOptions:{modelAssetPath:t}})},me.createFromModelBuffer=function(e,t){return F(me,e,{baseOptions:{modelAssetBuffer:t}})},me.createFromOptions=function(e,t){return F(me,e,t)};var li=class{constructor(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach((n=>{n.close()})),(t=this.categoryMask)==null||t.close()}};li.prototype.close=li.prototype.close;var Ve=class extends Se{constructor(e,t){super(new Be(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Zi,this.u=new t2,E(this.h,0,3,this.u),E(e=this.h,0,1,t=new Y)}get baseOptions(){return M(this.h,Y,1)}set baseOptions(e){E(this.h,0,1,e)}o(e){var t,n;return"outputCategoryMask"in e&&(this.outputCategoryMask=(t=e.outputCategoryMask)!=null?t:!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=(n=e.outputConfidenceMasks)!=null?n:!0),super.l(e)}segment(e,t,n,r){let i=typeof n!="function"?n:{};if(this.j=typeof n=="function"?n:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.C+1,r=new i2,t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var s=new Xr;ct(s,3,Ln(!0),!1),ct(s,1,_n(t.keypoint.x),0),ct(s,2,_n(t.keypoint.y),0),bn(r,1,ii,s)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");{let c=new Z1;for(s of t.scribble)ct(t=new Xr,3,Ln(!0),!1),ct(t,1,_n(s.x),0),ct(t,2,_n(s.y),0),Ri(c,1,Xr,t);bn(r,2,ii,c)}}this.g.addProtoToStream(r.g(),"mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest","roi_in",n),Ge(this,e,i);e:{try{let c=new li(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=c;break e}this.j(c)}finally{Lr(this)}o=void 0}return o}m(){var e=new Fe;V(e,"image_in"),V(e,"roi_in"),V(e,"norm_rect_in");let t=new Le;Ke(t,r2,this.h);let n=new ye;ke(n,2,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"),G(n,"IMAGE:image_in"),G(n,"ROI:roi_in"),G(n,"NORM_RECT:norm_rect_in"),n.o(t),Oe(e,n),Sr(this,e),this.outputConfidenceMasks&&(I(e,"confidence_masks"),L(n,"CONFIDENCE_MASKS:confidence_masks"),Kt(this,"confidence_masks"),this.g.aa("confidence_masks",((r,i)=>{this.confidenceMasks=r.map((s=>Jt(this,s,!0,!this.j))),f(this,i)})),this.g.attachEmptyPacketListener("confidence_masks",(r=>{this.confidenceMasks=[],f(this,r)}))),this.outputCategoryMask&&(I(e,"category_mask"),L(n,"CATEGORY_MASK:category_mask"),Kt(this,"category_mask"),this.g.Z("category_mask",((r,i)=>{this.categoryMask=Jt(this,r,!1,!this.j),f(this,i)})),this.g.attachEmptyPacketListener("category_mask",(r=>{this.categoryMask=void 0,f(this,r)}))),I(e,"quality_scores"),L(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((r,i)=>{this.qualityScores=r,f(this,i)})),this.g.attachEmptyPacketListener("quality_scores",(r=>{this.categoryMask=void 0,f(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ve.prototype.segment=Ve.prototype.segment,Ve.prototype.setOptions=Ve.prototype.o,Ve.createFromModelPath=function(e,t){return F(Ve,e,{baseOptions:{modelAssetPath:t}})},Ve.createFromModelBuffer=function(e,t){return F(Ve,e,{baseOptions:{modelAssetBuffer:t}})},Ve.createFromOptions=function(e,t){return F(Ve,e,t)};var Re=class extends Se{constructor(e,t){super(new Be(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},E(e=this.h=new s2,0,1,t=new Y)}get baseOptions(){return M(this.h,Y,1)}set baseOptions(e){E(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?C(this.h,2,On(e.displayNamesLocale)):"displayNamesLocale"in e&&C(this.h,2),e.maxResults!==void 0?rt(this.h,3,e.maxResults):"maxResults"in e&&C(this.h,3),e.scoreThreshold!==void 0?v(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&C(this.h,4),e.categoryAllowlist!==void 0?tr(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&C(this.h,5),e.categoryDenylist!==void 0?tr(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&C(this.h,6),this.l(e)}F(e,t){return this.j={detections:[]},Ge(this,e,t),this.j}G(e,t,n){return this.j={detections:[]},$e(this,e,n,t),this.j}m(){var e=new Fe;V(e,"input_frame_gpu"),V(e,"norm_rect"),I(e,"detections");let t=new Le;Ke(t,Q1,this.h);let n=new ye;ke(n,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),G(n,"IMAGE:input_frame_gpu"),G(n,"NORM_RECT:norm_rect"),L(n,"DETECTIONS:detections"),n.o(t),Oe(e,n),this.g.attachProtoVectorListener("detections",((r,i)=>{for(let s of r)r=Na(s),this.j.detections.push(c2(r));f(this,i)})),this.g.attachEmptyPacketListener("detections",(r=>{f(this,r)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Re.prototype.detectForVideo=Re.prototype.G,Re.prototype.detect=Re.prototype.F,Re.prototype.setOptions=Re.prototype.o,Re.createFromModelPath=async function(e,t){return F(Re,e,{baseOptions:{modelAssetPath:t}})},Re.createFromModelBuffer=function(e,t){return F(Re,e,{baseOptions:{modelAssetBuffer:t}})},Re.createFromOptions=function(e,t){return F(Re,e,t)};var di=class{constructor(e,t,n){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=n}close(){var e;(e=this.segmentationMasks)==null||e.forEach((t=>{t.close()}))}};function To(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function Ao(e){try{let t=new di(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.u)return t;e.u(t)}finally{Lr(e)}}di.prototype.close=di.prototype.close;var Ee=class extends Se{constructor(e,t){super(new Be(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,E(e=this.h=new o2,0,1,t=new Y),this.A=new Ja,E(this.h,0,3,this.A),this.j=new $a,E(this.h,0,2,this.j),rt(this.j,4,1),v(this.j,2,.5),v(this.A,2,.5),v(this.h,4,.5)}get baseOptions(){return M(this.h,Y,1)}set baseOptions(e){E(this.h,0,1,e)}o(e){var t,n,r,i,s;return"numPoses"in e&&rt(this.j,4,(t=e.numPoses)!=null?t:1),"minPoseDetectionConfidence"in e&&v(this.j,2,(n=e.minPoseDetectionConfidence)!=null?n:.5),"minTrackingConfidence"in e&&v(this.h,4,(r=e.minTrackingConfidence)!=null?r:.5),"minPosePresenceConfidence"in e&&v(this.A,2,(i=e.minPosePresenceConfidence)!=null?i:.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=(s=e.outputSegmentationMasks)!=null?s:!1),this.l(e)}F(e,t,n){let r=typeof t!="function"?t:{};return this.u=typeof t=="function"?t:n,To(this),Ge(this,e,r),Ao(this)}G(e,t,n,r){let i=typeof n!="function"?n:{};return this.u=typeof n=="function"?n:r,To(this),$e(this,e,i,t),Ao(this)}m(){var e=new Fe;V(e,"image_in"),V(e,"norm_rect"),I(e,"normalized_landmarks"),I(e,"world_landmarks"),I(e,"segmentation_masks");let t=new Le;Ke(t,ec,this.h);let n=new ye;ke(n,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),G(n,"IMAGE:image_in"),G(n,"NORM_RECT:norm_rect"),L(n,"NORM_LANDMARKS:normalized_landmarks"),L(n,"WORLD_LANDMARKS:world_landmarks"),n.o(t),Oe(e,n),Sr(this,e),this.g.attachProtoVectorListener("normalized_landmarks",((r,i)=>{this.landmarks=[];for(let s of r)r=Un(s),this.landmarks.push(xr(r));f(this,i)})),this.g.attachEmptyPacketListener("normalized_landmarks",(r=>{this.landmarks=[],f(this,r)})),this.g.attachProtoVectorListener("world_landmarks",((r,i)=>{this.worldLandmarks=[];for(let s of r)r=Ut(s),this.worldLandmarks.push(An(r));f(this,i)})),this.g.attachEmptyPacketListener("world_landmarks",(r=>{this.worldLandmarks=[],f(this,r)})),this.outputSegmentationMasks&&(L(n,"SEGMENTATION_MASK:segmentation_masks"),Kt(this,"segmentation_masks"),this.g.aa("segmentation_masks",((r,i)=>{this.segmentationMasks=r.map((s=>Jt(this,s,!0,!this.u))),f(this,i)})),this.g.attachEmptyPacketListener("segmentation_masks",(r=>{this.segmentationMasks=[],f(this,r)}))),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ee.prototype.detectForVideo=Ee.prototype.G,Ee.prototype.detect=Ee.prototype.F,Ee.prototype.setOptions=Ee.prototype.o,Ee.createFromModelPath=function(e,t){return F(Ee,e,{baseOptions:{modelAssetPath:t}})},Ee.createFromModelBuffer=function(e,t){return F(Ee,e,{baseOptions:{modelAssetBuffer:t}})},Ee.createFromOptions=function(e,t){return F(Ee,e,t)},Ee.POSE_CONNECTIONS=E2;async function hc(){var e,t;try{if((e=window==null?void 0:window.navigator)!=null&&e.userAgentData){let n=await window.navigator.userAgentData.getHighEntropyValues(["model"]);if(typeof(n==null?void 0:n.model)=="string"&&n.model.length>0)return n.model;throw new Error("userAgentData model is invalid.")}else throw new Error("userAgentData not available.")}catch{let n=(t=window==null?void 0:window.navigator)==null?void 0:t.userAgent;return typeof n=="string"&&n.length>0?n:"UNKNOWN"}}var uc=(()=>{let e=1e4,t=6e4,n=3,r="UNKNOWN",i="circle",s="#fff",o=!1,c=!1,a=0,u=0,h=0,l=-1,d=-1,m=0,b=0,k={},X,K,x,O,ue,Gn=[],Ir=[],Rr=({timeElapsed:A=0,type:w="",percentage:T=0,isFaceInView:S=!1,isLiteMode:R=!1})=>{},us=({raw_intensity:A=[],ppg_time:w=[],average_fps:T=0})=>{},It=(A=new Error("Facescan Error."))=>{},b2=()=>new Promise(async(A,w)=>{try{let T=/iPhone|iPad|iPod|Macintosh|Mac/i.test(navigator.userAgent),S=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:"user",aspectRatio:16/9,frameRate:{ideal:60},height:T?{exact:720}:void 0}});x.srcObject=S,x.onloadedmetadata=async()=>{var Q;await((Q=x.play)==null?void 0:Q.call(x));let R=()=>{x.readyState>=2&&x.videoWidth>0&&x.videoHeight>0?A():a=requestAnimationFrame(R)};a=requestAnimationFrame(R)}}catch(T){w(new Error("We are not able to access the Camera. Please try again.",{cause:T}))}}),gt=(A=!1)=>{var w,T,S,R,Q;cancelAnimationFrame(a),(w=X==null?void 0:X.close)==null||w.call(X),(Q=(R=(S=(T=x==null?void 0:x.srcObject)==null?void 0:T.getTracks)==null?void 0:S.call(T))==null?void 0:R.forEach)==null||Q.call(R,ie=>{var st;(st=ie==null?void 0:ie.stop)==null||st.call(ie)}),c=!1,window.onblur=void 0,K==null||K.release().then(()=>{console.log("WakeLock Released.")}).catch(ie=>{console.log("WakeLock Error."),console.error(ie)}),A||us({raw_intensity:Gn,ppg_time:Ir,average_fps:Math.round(Gn.length*1e3/t)})},Pr=A=>{let w=new Path2D;if((A==null?void 0:A.length)>1){let T=A.shift();w.moveTo(T[0],T[1]);for(let S of A)w.lineTo(S[0],S[1]);w.closePath()}return w},Cr=(A=0)=>{var st,dn,fn,pn,Ne,Je,Rt,mt,jn;let w=x.videoWidth,T=x.videoHeight,S=X.detectForVideo(x,A),R=(dn=(st=S==null?void 0:S.faceLandmarks)==null?void 0:st[0])!=null?dn:[],Q=Object.fromEntries((Rt=(Je=(Ne=(pn=(fn=S==null?void 0:S.faceBlendshapes)==null?void 0:fn[0])==null?void 0:pn.categories)==null?void 0:Ne.map)==null?void 0:Je.call(Ne,q=>[q.categoryName,q.score]))!=null?Rt:[]),ie=(((mt=Q.eyeBlinkLeft)!=null?mt:0)+((jn=Q.eyeBlinkRight)!=null?jn:0))/2;if(R.length>0){let q=new Path2D;if(i!=="circle"){let _={minX:w,minY:T,maxX:0,maxY:0};if(R.forEach(de=>{let Pt=Math.round(de.x*w),fs=Math.round(de.y*T);_.minX=Math.min(_.minX,Pt),_.minY=Math.min(_.minY,fs),_.maxX=Math.max(_.maxX,Pt),_.maxY=Math.max(_.maxY,fs)}),i==="corners"){let de=Math.sqrt(Math.pow(_.maxX-_.minX,2)+Math.pow(_.maxY-_.minY,2))*.1;q.moveTo(_.minX,Math.round(_.minY+de)),q.lineTo(_.minX,_.minY),q.lineTo(Math.round(_.minX+de),_.minY),q.moveTo(Math.round(_.maxX-de),_.minY),q.lineTo(_.maxX,_.minY),q.lineTo(_.maxX,Math.round(_.minY+de)),q.moveTo(_.maxX,Math.round(_.maxY-de)),q.lineTo(_.maxX,_.maxY),q.lineTo(Math.round(_.maxX-de),_.maxY),q.moveTo(Math.round(_.minX+de),_.maxY),q.lineTo(_.minX,_.maxY),q.lineTo(_.minX,Math.round(_.maxY-de))}else q.rect(_.minX,_.minY,Math.round(_.maxX-_.minX),Math.round(_.maxY-_.minY))}else q.addPath(Pr([10,338,297,332,284,251,389,356,454,323,361,288,397,365,379,378,400,377,152,148,176,149,150,136,172,58,132,93,234,127,162,21,54,103,67,109].map(_=>[Math.round(R[_].x*w),Math.round(R[_].y*T)])));let P={minX:w,minY:T,maxX:0,maxY:0},ds=[114,121,120,119,118,117,111,116,123,147,187,207,206,203,142,126,217,343,350,349,348,347,346,340,345,352,376,411,427,426,423,371,355,437].map(_=>{let de=Math.round(R[_].x*w),Pt=Math.round(R[_].y*T);return P.minX=Math.min(P.minX,de),P.minY=Math.min(P.minY,Pt),P.maxX=Math.max(P.maxX,de),P.maxY=Math.max(P.maxY,Pt),[de,Pt]});if(Number.isFinite(P.minX)&&P.minX>=0&&Number.isFinite(P.minY)&&P.minY>=0&&Number.isFinite(P.maxX)&&P.maxX<=O.width&&Number.isFinite(P.maxY)&&P.maxY<=O.height&&P.maxX-P.minX>0&&P.maxY-P.minY>0){let _=new Path2D;return _.addPath(Pr(ds.slice(0,17))),_.addPath(Pr(ds.slice(17))),{isFaceInView:!0,eyeBlinkConfidence:ie,drawPath:q,roiPath:_,roiBox:{x:P.minX,y:P.minY,w:P.maxX-P.minX,h:P.maxY-P.minY}}}else return{isFaceInView:!1,eyeBlinkConfidence:ie}}else return{isFaceInView:!1,eyeBlinkConfidence:ie}},T2=A=>{let w=0,T={r:0,g:0,b:0};for(let S=0;S<A.data.length;S+=4){let R=A.data[S],Q=A.data[S+1],ie=A.data[S+2];R===0&&Q===0&&ie===0||(w++,T.r+=R,T.g+=Q,T.b+=ie)}return{r:T.r/w,g:T.g/w,b:T.b/w}},ls=({drawPath:A,roiPath:w,roiBox:T})=>{let S=x.videoWidth,R=x.videoHeight,Q={r:0,g:0,b:0};return ue.save(),ue.clearRect(0,0,S,R),typeof w<"u"&&ue.clip(w),ue.drawImage(x,0,0,S,R),typeof T<"u"&&(Q=T2(ue.getImageData(Math.round(T.x||0),Math.round(T.y||0),Math.max(Math.round(T.w||0),1),Math.max(Math.round(T.h||0),1)))),typeof w<"u"&&(ue.restore(),ue.clearRect(0,0,S,R),ue.drawImage(x,0,0,S,R)),typeof A<"u"&&(ue.lineWidth=3,ue.strokeStyle=s,ue.stroke(A)),ue.restore(),Q},Or=(A=0)=>{let w=A-u;try{if(w<=e)ls({}),k=Cr(w),b=(b*m+1e3/(performance.now()-A))/++m,k.eyeBlinkConfidence>.4?l=w:d=w,Rr({timeElapsed:w,type:"calibration",percentage:Math.round(w/e*100),isFaceInView:k.isFaceInView,isLiteMode:!1}),a=requestAnimationFrame(Or);else if(w<=e+t){let T=b<(o?10:15);if(T)k.isFaceInView=!0,Math.round((w-e)/1e3)%n===0&&(k=Cr(w));else if(k=Cr(w),k.eyeBlinkConfidence>.4?l=w:d=w,Math.abs(l-d)/1e3>(o?20:30)){gt(!0),It(new Error("No suitable subject detected. If the issue persists, consider adjusting the framing or removing any obstructions from the view."));return}let{isFaceInView:S=!0,eyeBlinkConfidence:R=0,...Q}=k,ie=ls(Q);if(S?(Gn.push(ie),Ir.push(performance.now()-u),h=0):o?h=101:h++,h>100){gt(!0),It(new Error("Face not detected."));return}Rr({timeElapsed:w,type:"scan",percentage:Math.round((w-e)/t*100),isFaceInView:S,isLiteMode:T}),a=requestAnimationFrame(Or)}else gt()}catch(T){gt(!0),It(new Error("Sorry we're unable to compute the signal. Please try again.",{cause:T}))}};return{startScan:async({calibrationTime_inSec:A=10,scanTime_inSec:w=60,liteModeRedetectionInterval_inSec:T=3,models_path:S="https://content.careplix.com/careplix-web-algo-models/3.2.1",deviceModel:R,draw_type:Q="face-circle",draw_color:ie="#fff",strict_mode:st=!1,videoElement:dn,canvasElement:fn})=>{var pn;Gn=[],Ir=[],c=!1,l=d=-1,m=b=h=0,k={};try{if(typeof A!="number"||A<3||A>20)throw new Error("Calibration duration can be between 3-20 seconds.");if(typeof w!="number"||w<30||w>120||w%5!==0)throw new Error("Scan duration can be between 30-120 seconds (multiple of 5).");if(A>w)throw new Error("Scan duration cannot be smaller than Calibration duration.");if(e=A*1e3,t=w*1e3,typeof T!="number"||T<2||T>5)throw new Error("Lite mode Re-Detection Interval can be between 2-5 seconds.");switch(n=Math.round(T),typeof R=="string"&&R.length>0?r=R:r=await hc(),Q){case"bounding-box":i="box";break;case"corner-box":i="corners";break;default:console.error("Provided Draw-Type is Invalid!\nSwitching to default...");case void 0:case"face-circle":i="circle"}let Ne=new Option().style;Ne.color=ie,Ne.color.length===0?(console.error("Provided Draw-Color is Invalid!\nSwitching to default..."),s="#fff"):s=Ne.color,typeof st!="boolean"?(console.error("Provided Strict Mode value is Invalid!\nSwitching to default..."),o=!1):o=st,(pn=navigator.wakeLock)==null||pn.request("screen").then(Je=>{K=Je,console.log("WakeLock Active.")}).catch(Je=>{console.log("WakeLock Error."),console.error(Je)});try{let Rt=await(await fetch("".concat(S,"/devicecompat.json"))).json(),mt=Rt==null?void 0:Rt.archFallback;if((mt==null?void 0:mt.length)>0){let jn=mt.some(P=>new RegExp(P,"i").test(r))?"CPU":"GPU",q=await ht.forVisionTasks(S);X=await U.createFromOptions(q,{baseOptions:{modelAssetPath:S+"/face_landmarker.task",delegate:jn},runningMode:"VIDEO",numFaces:1,minFaceDetectionConfidence:.9,minFacePresenceConfidence:.9,minTrackingConfidence:.9,outputFaceBlendshapes:!0,outputFacialTransformationMatrixes:!1})}else throw new Error("Failed to fetch Devicecompat List.")}catch(Je){throw new Error("Please check your internet connection & try again.",{cause:Je})}if(x=typeof dn>"u"?document.getElementById("videoInput"):dn,x)await b2();else throw new Error("Cannot get the video element.");if(O=typeof fn>"u"?document.getElementById("canvasOutput"):fn,O)O.width=x.videoWidth,O.height=x.videoHeight,ue=O.getContext("2d",{alpha:!1,willReadFrequently:!0}),ue.drawImage(x,0,0,O.width,O.height);else throw new Error("Cannot get the canvas element.");u=performance.now(),a=requestAnimationFrame(Or),c=!0,window.onblur=()=>{gt(!0),It(new Error("App functionality disabled in the Background. Keep it in the Foreground for proper operation."))}}catch(Ne){throw gt(!0),It(Ne),new Error("Facescan Initialization Error.",{cause:Ne})}},stopScan:gt,onFrame:(A=({timeElapsed:w=0,type:T="",percentage:S=0,isFaceInView:R=!1,isLiteMode:Q=!1})=>{})=>{typeof A=="function"&&(Rr=A)},onScanFinish:(A=({raw_intensity:w=[],ppg_time:T=[],average_fps:S=0})=>{})=>{typeof A=="function"&&(us=A)},onError:(A=(w=new Error("Facescan Error."))=>{})=>{typeof A=="function"&&(It=A)},get isInitializing(){return()=>!c},get isScanning(){return()=>!!c}}})(),sh=uc;export{sh as default};