trtc-sdk-v5 5.12.0-beta.9 → 5.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
- "use strict";var Vision=(()=>{var Nu=Object.create;var gr=Object.defineProperty,Cu=Object.defineProperties,Uu=Object.getOwnPropertyDescriptor,Du=Object.getOwnPropertyDescriptors,ku=Object.getOwnPropertyNames,as=Object.getOwnPropertySymbols,Mu=Object.getPrototypeOf,cs=Object.prototype.hasOwnProperty,Pu=Object.prototype.propertyIsEnumerable;var us=Math.pow,Jn=(t,e,r)=>e in t?gr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Zn=(t,e)=>{for(var r in e||(e={}))cs.call(e,r)&&Jn(t,r,e[r]);if(as)for(var r of as(e))Pu.call(e,r)&&Jn(t,r,e[r]);return t},hs=(t,e)=>Cu(t,Du(e));var Fu=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Bu=(t,e)=>{for(var r in e)gr(t,r,{get:e[r],enumerable:!0})},ls=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ku(e))!cs.call(t,i)&&i!==r&&gr(t,i,{get:()=>e[i],enumerable:!(n=Uu(e,i))||n.enumerable});return t};var Vu=(t,e,r)=>(r=t!=null?Nu(Mu(t)):{},ls(e||!t||!t.__esModule?gr(r,"default",{value:t,enumerable:!0}):r,t)),Gu=t=>ls(gr({},"__esModule",{value:!0}),t);var j=(t,e,r)=>Jn(t,typeof e!="symbol"?e+"":e,r);var C=(t,e,r)=>new Promise((n,i)=>{var o=c=>{try{a(r.next(c))}catch(u){i(u)}},s=c=>{try{a(r.throw(c))}catch(u){i(u)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,s);a((r=r.apply(t,e)).next())});var Au=Fu((U3,$o)=>{"use strict";var ul=Object.prototype.hasOwnProperty,lt="~";function Br(){}Object.create&&(Br.prototype=Object.create(null),new Br().__proto__||(lt=!1));function hl(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Tu(t,e,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new hl(r,n||t,i),s=lt?lt+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],o]:t._events[s].push(o):(t._events[s]=o,t._eventsCount++),t}function zn(t,e){--t._eventsCount===0?t._events=new Br:delete t._events[e]}function ot(){this._events=new Br,this._eventsCount=0}ot.prototype.eventNames=function(){var e=[],r,n;if(this._eventsCount===0)return e;for(n in r=this._events)ul.call(r,n)&&e.push(lt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};ot.prototype.listeners=function(e){var r=lt?lt+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s};ot.prototype.listenerCount=function(e){var r=lt?lt+e:e,n=this._events[r];return n?n.fn?1:n.length:0};ot.prototype.emit=function(e,r,n,i,o,s){var a=lt?lt+e:e;if(!this._events[a])return!1;var c=this._events[a],u=arguments.length,l,h;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,i),!0;case 5:return c.fn.call(c.context,r,n,i,o),!0;case 6:return c.fn.call(c.context,r,n,i,o,s),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var f=c.length,v;for(h=0;h<f;h++)switch(c[h].once&&this.removeListener(e,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,r);break;case 3:c[h].fn.call(c[h].context,r,n);break;case 4:c[h].fn.call(c[h].context,r,n,i);break;default:if(!l)for(v=1,l=new Array(u-1);v<u;v++)l[v-1]=arguments[v];c[h].fn.apply(c[h].context,l)}}return!0};ot.prototype.on=function(e,r,n){return Tu(this,e,r,n,!1)};ot.prototype.once=function(e,r,n){return Tu(this,e,r,n,!0)};ot.prototype.removeListener=function(e,r,n,i){var o=lt?lt+e:e;if(!this._events[o])return this;if(!r)return zn(this,o),this;var s=this._events[o];if(s.fn)s.fn===r&&(!i||s.once)&&(!n||s.context===n)&&zn(this,o);else{for(var a=0,c=[],u=s.length;a<u;a++)(s[a].fn!==r||i&&!s[a].once||n&&s[a].context!==n)&&c.push(s[a]);c.length?this._events[o]=c.length===1?c[0]:c:zn(this,o)}return this};ot.prototype.removeAllListeners=function(e){var r;return e?(r=lt?lt+e:e,this._events[r]&&zn(this,r)):(this._events=new Br,this._eventsCount=0),this};ot.prototype.off=ot.prototype.removeListener;ot.prototype.addListener=ot.prototype.on;ot.prefixed=lt;ot.EventEmitter=ot;typeof $o!="undefined"&&($o.exports=ot)});var gl={};Bu(gl,{VisionTaskRegistry:()=>Yo,VisionTaskType:()=>wu});var Ve=typeof self!="undefined"?self:{};function Ae(){throw Error("Invalid UTF8")}function fs(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}var Gr,ti,ju=typeof TextDecoder!="undefined",Hu,zu=typeof TextEncoder!="undefined";function Sa(t){if(zu)t=(Hu||(Hu=new TextEncoder)).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){e=1024*(e-55296)+o-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}var Mi,rn;t:{for(ei=["CLOSURE_FLAGS"],jr=Ve,Hr=0;Hr<ei.length;Hr++)if((jr=jr[ei[Hr]])==null){rn=null;break t}rn=jr}var ei,jr,Hr,wr,ps=rn&&rn[610401301];Mi=ps!=null&&ps;var ds=Ve.navigator;function pi(t){return!!Mi&&!!wr&&wr.brands.some(({brand:e})=>e&&e.indexOf(t)!=-1)}function Lt(t){var e;return(e=Ve.navigator)&&(e=e.userAgent)||(e=""),e.indexOf(t)!=-1}function he(){return!!Mi&&!!wr&&wr.brands.length>0}function ri(){return he()?pi("Chromium"):(Lt("Chrome")||Lt("CriOS"))&&!(!he()&&Lt("Edge"))||Lt("Silk")}function hn(t){return hn[" "](t),t}wr=ds&&ds.userAgentData||null,hn[" "]=function(){};var Wu=!he()&&(Lt("Trident")||Lt("MSIE"));!Lt("Android")||ri(),ri(),Lt("Safari")&&(ri()||!he()&&Lt("Coast")||!he()&&Lt("Opera")||!he()&&Lt("Edge")||(he()?pi("Microsoft Edge"):Lt("Edg/"))||he()&&pi("Opera"));var Ia={},Er=null;function $u(t){let e=t.length,r=3*e/4;r%3?r=Math.floor(r):"=.".indexOf(t[e-1])!=-1&&(r="=.".indexOf(t[e-2])!=-1?r-2:r-1);let n=new Uint8Array(r),i=0;return function(o,s){function a(u){for(;c<o.length;){let l=o.charAt(c++),h=Er[l];if(h!=null)return h;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l)}return u}wa();let c=0;for(;;){let u=a(-1),l=a(0),h=a(64),f=a(64);if(f===64&&u===-1)break;s(u<<2|l>>4),h!=64&&(s(l<<4&240|h>>2),f!=64&&s(h<<6&192|f))}}(t,function(o){n[i++]=o}),i!==r?n.subarray(0,i):n}function wa(){if(!Er){Er={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));Ia[r]=n;for(let i=0;i<n.length;i++){let o=n[i];Er[o]===void 0&&(Er[o]=i)}}}}var Ra=typeof Uint8Array!="undefined",xa=!Wu&&typeof btoa=="function";function gs(t){if(!xa){var e;e===void 0&&(e=0),wa(),e=Ia[e];var r=Array(Math.floor(t.length/3)),n=e[64]||"";let c=0,u=0;for(;c<t.length-2;c+=3){var i=t[c],o=t[c+1],s=t[c+2],a=e[i>>2];i=e[(3&i)<<4|o>>4],o=e[(15&o)<<2|s>>6],s=e[63&s],r[u++]=a+i+o+s}switch(a=0,s=n,t.length-c){case 2:s=e[(15&(a=t[c+1]))<<2]||n;case 1:t=t[c],r[u]=e[t>>2]+e[(3&t)<<4|a>>4]+s+n}return r.join("")}for(e="",r=0,n=t.length-10240;r<n;)e+=String.fromCharCode.apply(null,t.subarray(r,r+=10240));return e+=String.fromCharCode.apply(null,r?t.subarray(r):t),btoa(e)}var ms=/[-_.]/g,Ku={"-":"+",_:"/",".":"="};function Xu(t){return Ku[t]||""}function Oa(t){if(!xa)return $u(t);ms.test(t)&&(t=t.replace(ms,Xu)),t=atob(t);let e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}function Re(t){return Ra&&t!=null&&t instanceof Uint8Array}var Ge={};function xe(){return Yu||(Yu=new te(null,Ge))}function Pi(t){ba(Ge);var e=t.g;return(e=e==null||Re(e)?e:typeof e=="string"?Oa(e):null)==null?e:t.g=e}var te=class{h(){return new Uint8Array(Pi(this)||0)}constructor(t,e){if(ba(e),this.g=t,t!=null&&t.length===0)throw Error("ByteString should be constructed with non-empty values")}},Yu,ni;function ba(t){if(t!==Ge)throw Error("illegal external caller")}function La(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function di(t){return La(t=Error(t),"warning"),t}function Fi(t){if(t!=null){var e=ni!=null?ni:ni={},r=e[t]||0;r>=5||(e[t]=r+1,La(t=Error(),"incident"),function(n){Ve.setTimeout(()=>{throw n},0)}(t))}}var ln=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Qe(t,e,r=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?r&&Symbol.for&&t?Symbol.for(t):t!=null?Symbol(t):Symbol():e}var qu=Qe("jas",void 0,!0),_s=Qe(void 0,"0di"),mr=Qe(void 0,"1oa"),je=Qe(void 0,Symbol()),Qu=Qe(void 0,"0actk"),Na=Qe(void 0,"8utk"),_=ln?qu:"Ea",Ca={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},Ua=Object.defineProperties;function fn(t,e){ln||_ in t||Ua(t,Ca),t[_]|=e}function Y(t,e){ln||_ in t||Ua(t,Ca),t[_]=e}function Je(t){return fn(t,34),t}function Ju(t,e){Y(e,-15615&(0|t))}function gi(t,e){Y(e,-15581&(34|t))}function pn(){return typeof BigInt=="function"}function dt(t){return Array.prototype.slice.call(t)}var Bi,Cr={};function dn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&t.constructor===Object}function Vi(t,e){if(t!=null){if(typeof t=="string")t=t?new te(t,Ge):xe();else if(t.constructor!==te)if(Re(t))t=t.length?new te(new Uint8Array(t),Ge):xe();else{if(!e)throw Error();t=void 0}}return t}var ys=[];function Ee(t){if(2&t)throw Error()}Y(ys,55),Bi=Object.freeze(ys);var nn=class{constructor(e,r,n){this.g=e,this.h=r,this.l=n}next(){let e=this.g.next();return e.done||(e.value=this.h.call(this.l,e.value)),e}[Symbol.iterator](){return this}};function Gi(t){return je?t[je]:void 0}var Zu=Object.freeze({});function gn(t){return t.Na=!0,t}var t2=gn(t=>typeof t=="number"),Es=gn(t=>typeof t=="string"),e2=gn(t=>typeof t=="boolean"),mn=typeof Ve.BigInt=="function"&&typeof Ve.BigInt(0)=="bigint";function fe(t){var e=t;if(Es(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(t2(e)&&!Number.isSafeInteger(e))throw Error(String(e));return mn?BigInt(t):t=e2(t)?t?"1":"0":Es(t)?t.trim()||"0":String(t)}var mi=gn(t=>mn?t>=n2&&t<=o2:t[0]==="-"?vs(t,r2):vs(t,i2)),r2=Number.MIN_SAFE_INTEGER.toString(),n2=mn?BigInt(Number.MIN_SAFE_INTEGER):void 0,i2=Number.MAX_SAFE_INTEGER.toString(),o2=mn?BigInt(Number.MAX_SAFE_INTEGER):void 0;function vs(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var s2=typeof Uint8Array.prototype.slice=="function",Da,U=0,W=0;function Ts(t){let e=t>>>0;U=e,W=(t-e)/4294967296>>>0}function Oe(t){if(t<0){Ts(-t);let[e,r]=Wi(U,W);U=e>>>0,W=r>>>0}else Ts(t)}function ji(t){let e=Da||(Da=new DataView(new ArrayBuffer(8)));e.setFloat32(0,+t,!0),W=0,U=e.getUint32(0,!0)}function Hi(t,e){let r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:Rr(t,e)}function zi(t,e){let r=2147483648&e;return r&&(e=~e>>>0,(t=1+~t>>>0)==0&&(e=e+1>>>0)),typeof(t=Hi(t,e))=="number"?r?-t:t:r?"-"+t:t}function Rr(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else pn()?r=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(r=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),r+=8147497*e,e*=2,t>=1e7&&(r+=t/1e7>>>0,t%=1e7),r>=1e7&&(e+=r/1e7>>>0,r%=1e7),r=e+As(r)+As(t));return r}function As(t){return t=String(t),"0000000".slice(t.length)+t}function ka(){var t=U,e=W;if(2147483648&e)if(pn())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=Wi(t,e);t="-"+Rr(r,n)}else t=Rr(t,e);return t}function _n(t){if(t.length<16)Oe(Number(t));else if(pn())t=BigInt(t),U=Number(t&BigInt(4294967295))>>>0,W=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+(t[0]==="-");W=U=0;let r=t.length;for(let n=e,i=(r-e)%6+e;i<=r;n=i,i+=6){let o=Number(t.slice(n,i));W*=1e6,U=1e6*U+o,U>=4294967296&&(W+=Math.trunc(U/4294967296),W>>>=0,U>>>=0)}if(e){let[n,i]=Wi(U,W);U=n,W=i}}}function Wi(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}var xr=typeof BigInt=="function"?BigInt.asIntN:void 0,a2=typeof BigInt=="function"?BigInt.asUintN:void 0,pe=Number.isSafeInteger,yn=Number.isFinite,He=Math.trunc,c2=fe(0);function ve(t){return t==null||typeof t=="number"?t:t==="NaN"||t==="Infinity"||t==="-Infinity"?Number(t):void 0}function Ma(t){return t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0}var u2=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Or(t){switch(typeof t){case"bigint":return!0;case"number":return yn(t);case"string":return u2.test(t);default:return!1}}function Ze(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return yn(t)?0|t:void 0}function Pa(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return yn(t)?t>>>0:void 0}function Ss(t){if(t[0]==="-")return!1;let e=t.length;return e<20||e===20&&Number(t.substring(0,6))<184467}function Fa(t){let e=t.length;return t[0]==="-"?e<20||e===20&&Number(t.substring(0,7))>-922337:e<19||e===19&&Number(t.substring(0,6))<922337}function Ba(t){return Fa(t)?t:(_n(t),ka())}function $i(t){return t=He(t),pe(t)||(Oe(t),t=zi(U,W)),t}function Va(t){var e=He(Number(t));return pe(e)?String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),Ba(t))}function Is(t){var e=He(Number(t));return pe(e)?fe(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),pn()?fe(xr(64,BigInt(t))):fe(Ba(t)))}function ws(t){if(pe(t))t=fe($i(t));else{if(t=He(t),pe(t))t=String(t);else{let e=String(t);Fa(e)?t=e:(Oe(t),t=ka())}t=fe(t)}return t}function _i(t){return t==null?t:typeof t=="bigint"?(mi(t)?t=Number(t):(t=xr(64,t),t=mi(t)?Number(t):String(t)),t):Or(t)?typeof t=="number"?$i(t):Va(t):void 0}function h2(t){if(t==null)return t;var e=typeof t;if(e==="bigint")return String(a2(64,t));if(Or(t)){if(e==="string")return e=He(Number(t)),pe(e)&&e>=0?t=String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),Ss(t)||(_n(t),t=Rr(U,W))),t;if(e==="number")return(t=He(t))>=0&&pe(t)?t:function(r){if(r<0){Oe(r);var n=Rr(U,W);return r=Number(n),pe(r)?r:n}return Ss(n=String(r))?n:(Oe(r),Hi(U,W))}(t)}}function Ga(t){if(typeof t!="string")throw Error();return t}function tr(t){if(t!=null&&typeof t!="string")throw Error();return t}function ze(t){return t==null||typeof t=="string"?t:void 0}function Ki(t,e,r,n){if(t!=null&&typeof t=="object"&&t.W===Cr)return t;if(!Array.isArray(t))return r?2&n?((t=e[_s])||(Je((t=new e).u),t=e[_s]=t),e=t):e=new e:e=void 0,e;let i=r=0|t[_];return i===0&&(i|=32&n),i|=2&n,i!==r&&Y(t,i),new e(t)}function l2(t,e,r){if(e)t:{if(!Or(e=t))throw di("int64");switch(typeof e){case"string":e=Is(e);break t;case"bigint":e=fe(xr(64,e));break t;default:e=ws(e)}}else t=typeof(e=t),e=e==null?e:t==="bigint"?fe(xr(64,e)):Or(e)?t==="string"?Is(e):ws(e):void 0;return(t=e)==null?r?c2:void 0:t}function f2(t){return t}var p2={},d2=function(){try{return hn(new class extends Map{constructor(){super()}}),!1}catch(t){return!0}}(),Tr=class{constructor(){this.g=new Map}get(e){return this.g.get(e)}set(e,r){return this.g.set(e,r),this.size=this.g.size,this}delete(e){return e=this.g.delete(e),this.size=this.g.size,e}clear(){this.g.clear(),this.size=this.g.size}has(e){return this.g.has(e)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(e,r){return this.g.forEach(e,r)}[Symbol.iterator](){return this.entries()}},g2=d2?(Object.setPrototypeOf(Tr.prototype,Map.prototype),Object.defineProperties(Tr.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Tr):class extends Map{constructor(){super()}};function Rs(t){return t}function ii(t){if(2&t.M)throw Error("Cannot mutate an immutable Map")}var zt=class extends g2{constructor(t,e,r=Rs,n=Rs){super();let i=0|t[_];i|=64,Y(t,i),this.M=i,this.I=e,this.S=r,this.X=this.I?m2:n;for(let o=0;o<t.length;o++){let s=t[o],a=r(s[0],!1,!0),c=s[1];e?c===void 0&&(c=null):c=n(s[1],!1,!0,void 0,void 0,i),super.set(a,c)}}La(){var t=T2;if(this.size!==0)return Array.from(super.entries(),e=>(e[0]=t(e[0]),e[1]=t(e[1]),e))}da(t=_2){let e=[],r=super.entries();for(var n;!(n=r.next()).done;)(n=n.value)[0]=t(n[0]),n[1]=t(n[1]),e.push(n);return e}clear(){ii(this),super.clear()}delete(t){return ii(this),super.delete(this.S(t,!0,!1))}entries(){if(this.I){var t=super.keys();t=new nn(t,y2,this)}else t=super.entries();return t}values(){if(this.I){var t=super.keys();t=new nn(t,zt.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.I?super.forEach((r,n,i)=>{t.call(e,i.get(n),n,i)}):super.forEach(t,e)}set(t,e){return ii(this),(t=this.S(t,!0,!1))==null?this:e==null?(super.delete(t),this):super.set(t,this.X(e,!0,!0,this.I,!1,this.M))}Ja(t){let e=this.S(t[0],!1,!0);t=t[1],t=this.I?t===void 0?null:t:this.X(t,!1,!0,void 0,!1,this.M),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);let e=super.get(t);if(e!==void 0){var r=this.I;return r?((r=this.X(e,!1,!0,r,this.pa,this.M))!==e&&super.set(t,r),r):e}}[Symbol.iterator](){return this.entries()}};function m2(t,e,r,n,i,o){return t=Ki(t,n,r,o),i&&(t=Tn(t)),t}function _2(t){return t}function y2(t){return[t,this.get(t)]}var E2,Xr,ja,v2;function xs(){return E2||(E2=new zt(Je([]),void 0,void 0,void 0,p2))}function yi(t,e,r,n,i){if(t!=null){if(Array.isArray(t)){let o=0|t[_];return t.length===0&&1&o?void 0:i&&2&o?t:En(t,e,r,n!==void 0,i)}return e(t,n)}}function En(t,e,r,n,i){let o=n||r?0|t[_]:0,s=n?!!(32&o):void 0,a=0,c=(n=dt(t)).length;for(let A=0;A<c;A++){var u=n[A];if(A===c-1&&dn(u)){var l=e,h=r,f=s,v=i;let S;for(let F in u){let D=yi(u[F],l,h,f,v);D!=null&&((S!=null?S:S={})[F]=D)}u=S}else u=yi(n[A],e,r,s,i);n[A]=u,u!=null&&(a=A+1)}return a<c&&(n.length=a),r&&((t=Gi(t))&&(n[je]=dt(t)),r(o,n)),n}function T2(t){return yi(t,Xi,void 0,void 0,!1)}function Xi(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return mi(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Re(t))return Re(t)&&Fi(Na),gs(t);if(t.W===Cr)return Ha(t);if(t instanceof te){let e=t.g;return e==null?"":typeof e=="string"?e:t.g=gs(e)}return t instanceof zt?t.La():void 0}return t}function Ha(t){var e=t.u;t=En(e,Xi,void 0,void 0,!1);var r=0|e[_];if((e=t.length)&&!(512&r)){var n=t[e-1],i=!1;dn(n)?(e--,i=!0):n=void 0;var o=e-(r=512&r?0:-1),s=(Xr!=null?Xr:f2)(o,r,t,n);if(n&&(t[e]=void 0),o<s&&n){for(var a in o=!0,n){let c=+a;c<=s?(t[i=c+r]=n[a],e=Math.max(i+1,e),i=!1,delete n[a]):o=!1}o&&(n=void 0)}for(o=e-1;e>0;o=e-1)if((a=t[o])==null)e--,i=!0;else{if(!((o-=r)>=s))break;(n!=null?n:n={})[o]=a,e--,i=!0}i&&(t.length=e),n&&t.push(n)}return t}function de(t,e,r){return t=za(t,e[0],e[1],r?1:2),e!==ja&&r&&fn(t,8192),t}function za(t,e,r,n){if(t==null){var i=96;r?(t=[r],i|=512):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(8192&(i=0|t[_])||!(64&i)||2&i||Fi(Qu),1024&i)throw Error("farr");if(64&i)return t;if(n===1||n===2||(i|=64),r&&(i|=512,r!==t[0]))throw Error("mid");t:{var o=(r=t).length;if(o){var s=o-1;if(dn(n=r[s])){if((s-=e=512&(i|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var a in n)(o=+a)<s&&(r[o+e]=n[a],delete n[a]);i=-16760833&i|(1023&s)<<14;break t}}if(e){if((a=Math.max(e,o-(512&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return Y(t,i),t}function Ei(t,e,r=gi){if(t!=null){if(Ra&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var n=0|t[_];return 2&n?t:(e&&(e=n===0||!!(32&n)&&!(64&n||!(16&n))),e?(Y(t,34|n),4&n&&Object.freeze(t),t):En(t,Ei,4&n?gi:r,!0,!0))}return t.W===Cr?t=2&(n=0|(r=t.u)[_])?t:new t.constructor(vn(r,n,!0)):t instanceof zt&&!(2&t.M)&&(r=Je(t.da(Ei)),t=new zt(r,t.I,t.S,t.X)),t}}function vn(t,e,r){let n=r||2&e?gi:Ju,i=!!(32&e);return t=function(o,s,a){let c=dt(o);var u=c.length;let l=256&s?c[u-1]:void 0;for(u+=l?-1:0,s=512&s?1:0;s<u;s++)c[s]=a(c[s]);if(l){s=c[s]={};for(let h in l)s[h]=a(l[h])}return(o=Gi(o))&&(c[je]=dt(o)),c}(t,e,o=>Ei(o,i,n)),fn(t,32|(r?2:0)),t}function Tn(t){let e=t.u,r=0|e[_];return 2&r?new t.constructor(vn(e,r,!1)):t}function We(t,e){return ie(t=t.u,0|t[_],e)}function ie(t,e,r){if(r===-1)return null;let n=r+(512&e?0:-1),i=t.length-1;return n>=i&&256&e?t[i][r]:n<=i?t[n]:void 0}function k(t,e,r){let n=t.u,i=0|n[_];return Ee(i),H(n,i,e,r),t}function H(t,e,r,n){let i=512&e?0:-1,o=r+i;var s=t.length-1;return o>=s&&256&e?(t[s][r]=n,e):o<=s?(t[o]=n,e):(n!==void 0&&(r>=(s=e>>14&1023||536870912)?n!=null&&(t[s+i]={[r]:n},Y(t,e|=256)):t[o]=n),e)}function Yr(t,e){let r=0|(t=t.u)[_],n=ie(t,r,e),i=ve(n);return i!=null&&i!==n&&H(t,r,e,i),i}function Wa(t){let e=0|(t=t.u)[_],r=ie(t,e,1),n=Vi(r,!0);return n!=null&&n!==r&&H(t,e,1,n),n}function Se(){return Zu===void 0?2:4}function Ie(t,e,r,n,i){let o=t.u,s=2&(t=0|o[_])?1:n;i=!!i;let a=0|(n=Yi(o,t,e))[_];if(!(4&a)){4&a&&(n=dt(n),a=ee(a,t),t=H(o,t,e,n));let c=0,u=0;for(;c<n.length;c++){let l=r(n[c]);l!=null&&(n[u++]=l)}u<c&&(n.length=u),a=qi(a,t),r=-2049&(20|a),a=r&=-4097,Y(n,a),2&a&&Object.freeze(n)}return s===1||s===4&&32&a?Zt(a)||(i=a,a|=2,a!==i&&Y(n,a),Object.freeze(n)):(s===2&&Zt(a)&&(n=dt(n),a=ee(a,t),a=ge(a,t,i),Y(n,a),t=H(o,t,e,n)),Zt(a)||(e=a,a=ge(a,t,i),a!==e&&Y(n,a))),n}function Yi(t,e,r){return t=ie(t,e,r),Array.isArray(t)?t:Bi}function qi(t,e){return t===0&&(t=ee(t,e)),1|t}function Zt(t){return!!(2&t)&&!!(4&t)||!!(1024&t)}function $a(t){t=dt(t);for(let e=0;e<t.length;e++){let r=t[e]=dt(t[e]);Array.isArray(r[1])&&(r[1]=Je(r[1]))}return t}function vi(t,e,r,n){let i=0|(t=t.u)[_];Ee(i),H(t,i,e,(n==="0"?Number(r)===0:r===n)?void 0:r)}function er(t,e,r,n){Ee(e);let i=Yi(t,e,r),o=i!==Bi;if(64&e||!(8192&e)||!o){let s=o?0|i[_]:0,a=s;(!o||2&a||Zt(a)||4&a&&!(32&a))&&(i=dt(i),a=ee(a,e),e=H(t,e,r,i)),a=-13&qi(a,e),a=ge(n?-17&a:16|a,e,!0),a!==s&&Y(i,a)}return i}function oi(t,e){var r=Cc;return Ji(Qi(t=t.u),t,0|t[_],r)===e?e:-1}function Qi(t){var r;if(ln)return(r=t[mr])!=null?r:t[mr]=new Map;if(mr in t)return t[mr];let e=new Map;return Object.defineProperty(t,mr,{value:e}),e}function Ka(t,e,r,n){let i=Qi(t),o=Ji(i,t,e,r);return o!==n&&(o&&(e=H(t,e,o)),i.set(r,n)),e}function Ji(t,e,r,n){let i=t.get(n);if(i!=null)return i;i=0;for(let o=0;o<n.length;o++){let s=n[o];ie(e,r,s)!=null&&(i!==0&&(r=H(e,r,i)),i=s)}return t.set(n,i),i}function Zi(t,e,r){let n=0|t[_],i=ie(t,n,r),o;if(i!=null&&i.W===Cr)return(e=Tn(i))!==i&&H(t,n,r,e),e.u;if(Array.isArray(i)){let s=0|i[_];o=2&s?de(vn(i,s,!1),e,!0):64&s?i:de(o,e,!0)}else o=de(void 0,e,!0);return o!==i&&H(t,n,r,o),o}function Xa(t,e,r){let n=0|(t=t.u)[_],i=ie(t,n,r);return(e=Ki(i,e,!1,n))!==i&&e!=null&&H(t,n,r,e),e}function R(t,e,r){if((e=Xa(t,e,r))==null)return e;let n=0|(t=t.u)[_];if(!(2&n)){let i=Tn(e);i!==e&&H(t,n,r,e=i)}return e}function Ya(t,e,r,n,i,o,s){t=t.u;var a=!!(2&e);let c=a?1:i;o=!!o,s&&(s=!a);var u=0|(i=Yi(t,e,n))[_];if(!(a=!!(4&u))){var l=i,h=e;let f=!!(2&(u=qi(u,e)));f&&(h|=2);let v=!f,A=!0,S=0,F=0;for(;S<l.length;S++){let D=Ki(l[S],r,!1,h);if(D instanceof r){if(!f){let rt=!!(2&(0|D.u[_]));v&&(v=!rt),A&&(A=rt)}l[F++]=D}}F<S&&(l.length=F),u|=4,u=A?16|u:-17&u,Y(l,u=v?8|u:-9&u),f&&Object.freeze(l)}if(s&&!(8&u||!i.length&&(c===1||c===4&&32&u))){for(Zt(u)&&(i=dt(i),u=ee(u,e),e=H(t,e,n,i)),r=i,s=u,l=0;l<r.length;l++)(u=r[l])!==(h=Tn(u))&&(r[l]=h);s|=8,Y(r,s=r.length?-17&s:16|s),u=s}return c===1||c===4&&32&u?Zt(u)||(e=u,(u|=!i.length||16&u&&(!a||32&u)?2:1024)!==e&&Y(i,u),Object.freeze(i)):(c===2&&Zt(u)&&(Y(i=dt(i),u=ge(u=ee(u,e),e,o)),e=H(t,e,n,i)),Zt(u)||(n=u,(u=ge(u,e,o))!==n&&Y(i,u))),i}function re(t,e,r){let n=0|t.u[_];return Ya(t,n,e,r,Se(),!1,!(2&n))}function E(t,e,r,n){return n==null&&(n=void 0),k(t,r,n)}function Ar(t,e,r,n){n==null&&(n=void 0);t:{let i=0|(t=t.u)[_];if(Ee(i),n==null){let o=Qi(t);if(Ji(o,t,i,r)!==e)break t;o.set(r,0)}else i=Ka(t,i,r,e);H(t,i,e,n)}}function ee(t,e){return-1025&(t=32|(2&e?2|t:-3&t))}function ge(t,e,r){return 32&e&&r||(t&=-33),t}function An(t,e,r){Ee(0|t.u[_]),Ie(t,e,ze,2,!0).push(Ga(r))}function on(t,e,r,n){let i=0|t.u[_];Ee(i),t=Ya(t,i,r,e,2,!0),n=n!=null?n:new r,t.push(n),t[_]=2&(0|n.u[_])?-9&t[_]:-17&t[_]}function Nt(t,e){return Ze(We(t,e))}function Ct(t,e){return ze(We(t,e))}function K(t,e){var r;return(r=Yr(t,e))!=null?r:0}function br(t,e,r){if(r!=null&&typeof r!="boolean")throw t=typeof r,Error(`Expected boolean but got ${t!="object"?t:r?Array.isArray(r)?"array":t:"null"}: ${r}`);k(t,e,r)}function Wt(t,e,r){if(r!=null){if(typeof r!="number"||!yn(r))throw di("int32");r|=0}k(t,e,r)}function g(t,e,r){if(r!=null&&typeof r!="number")throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);k(t,e,r)}function sn(t,e,r){{let s=t.u,a=0|s[_];if(Ee(a),r==null)H(s,a,e);else{var n=t=0|r[_],i=Zt(t),o=i||Object.isFrozen(r);for(i||(t=0),o||(r=dt(r),n=0,t=ge(t=ee(t,a),a,!0),o=!1),t|=21,i=0;i<r.length;i++){let c=r[i],u=Ga(c);Object.is(c,u)||(o&&(r=dt(r),n=0,t=ge(t=ee(t,a),a,!0),o=!1),r[i]=u)}t!==n&&(o&&(r=dt(r),t=ge(t=ee(t,a),a,!0)),Y(r,t)),H(s,a,e,r)}}}function qa(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function to(){return Error("Failed to read varint, encoding is invalid.")}function Qa(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function eo(t){if(typeof t=="string")return{buffer:Oa(t),O:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),O:!1};if(t.constructor===Uint8Array)return{buffer:t,O:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),O:!1};if(t.constructor===te)return{buffer:Pi(t)||new Uint8Array(0),O:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function ro(t,e){let r,n=0,i=0,o=0,s=t.h,a=t.g;do r=s[a++],n|=(127&r)<<o,o+=7;while(o<32&&128&r);for(o>32&&(i|=(127&r)>>4),o=3;o<32&&128&r;o+=7)r=s[a++],i|=(127&r)<<o;if(we(t,a),r<128)return e(n>>>0,i>>>0);throw to()}function no(t){let e=0,r=t.g,n=r+10,i=t.h;for(;r<n;){let o=i[r++];if(e|=o,(128&o)==0)return we(t,r),!!(127&e)}throw to()}function me(t){let e=t.h,r=t.g,n=e[r++],i=127&n;if(128&n&&(n=e[r++],i|=(127&n)<<7,128&n&&(n=e[r++],i|=(127&n)<<14,128&n&&(n=e[r++],i|=(127&n)<<21,128&n&&(n=e[r++],i|=n<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw to();return we(t,r),i}function ne(t){return me(t)>>>0}function Ti(t){var e=t.h;let r=t.g,n=e[r],i=e[r+1],o=e[r+2];return e=e[r+3],we(t,t.g+4),(n<<0|i<<8|o<<16|e<<24)>>>0}function Ai(t){var e=Ti(t);t=2*(e>>31)+1;let r=e>>>23&255;return e&=8388607,r==255?e?NaN:t*(1/0):r==0?1401298464324817e-60*t*e:t*Math.pow(2,r-150)*(e+8388608)}function A2(t){return me(t)}function si(t,e,{aa:r=!1}={}){t.aa=r,e&&(e=eo(e),t.h=e.buffer,t.m=e.O,t.j=0,t.l=t.h.length,t.g=t.j)}function we(t,e){if(t.g=e,e>t.l)throw Qa(t.l,e)}function Ja(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);let r=t.g,n=r+e;if(n>t.l)throw Qa(e,t.l-r);return t.g=n,r}function Za(t,e){if(e==0)return xe();var r=Ja(t,e);return t.aa&&t.m?r=t.h.subarray(r,r+e):(t=t.h,r=r===(e=r+e)?new Uint8Array(0):s2?t.slice(r,e):new Uint8Array(t.subarray(r,e))),r.length==0?xe():new te(r,Ge)}zt.prototype.toJSON=void 0;var Os=[];function tc(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var r=ne(t.g);if(e=r>>>3,!((r&=7)>=0&&r<=5))throw qa(r,t.l);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=r,!0}function qr(t){switch(t.h){case 0:t.h!=0?qr(t):no(t.g);break;case 1:we(t=t.g,t.g+8);break;case 2:if(t.h!=2)qr(t);else{var e=ne(t.g);we(t=t.g,t.g+e)}break;case 5:we(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!tc(t))throw Error("Unmatched start-group tag: stream EOF");if(t.h==4){if(t.m!=e)throw Error("Unmatched end-group tag");break}qr(t)}break;default:throw qa(t.h,t.l)}}function Ur(t,e,r){let n=t.g.l,i=ne(t.g),o=t.g.g+i,s=o-n;if(s<=0&&(t.g.l=o,r(e,t,void 0,void 0,void 0),s=o-t.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-s} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=o,t.g.l=n,e}function io(t){var e=ne(t.g),r=Ja(t=t.g,e);if(t=t.h,ju){var n,i=t;(n=ti)||(n=ti=new TextDecoder("utf-8",{fatal:!0})),e=r+e,i=r===0&&e===i.length?i:i.subarray(r,e);try{var o=n.decode(i)}catch(a){if(Gr===void 0){try{n.decode(new Uint8Array([128]))}catch(c){}try{n.decode(new Uint8Array([97])),Gr=!0}catch(c){Gr=!1}}throw!Gr&&(ti=void 0),a}}else{e=(o=r)+e,r=[];let a,c=null;for(;o<e;){var s=t[o++];s<128?r.push(s):s<224?o>=e?Ae():(a=t[o++],s<194||(192&a)!=128?(o--,Ae()):r.push((31&s)<<6|63&a)):s<240?o>=e-1?Ae():(a=t[o++],(192&a)!=128||s===224&&a<160||s===237&&a>=160||(192&(n=t[o++]))!=128?(o--,Ae()):r.push((15&s)<<12|(63&a)<<6|63&n)):s<=244?o>=e-2?Ae():(a=t[o++],(192&a)!=128||a-144+(s<<28)>>30!=0||(192&(n=t[o++]))!=128||(192&(i=t[o++]))!=128?(o--,Ae()):(s=(7&s)<<18|(63&a)<<12|(63&n)<<6|63&i,s-=65536,r.push(55296+(s>>10&1023),56320+(1023&s)))):Ae(),r.length>=8192&&(c=fs(c,r),r.length=0)}o=fs(c,r)}return o}function ec(t){let e=ne(t.g);return Za(t.g,e)}function Sn(t,e,r){var n=ne(t.g);for(n=t.g.g+n;t.g.g<n;)r.push(e(t.g))}var zr=[];function Mt(t,e,r){e.g?e.m(t,e.g,e.h,r):e.m(t,e.h,r)}var d=class{constructor(t,e){this.u=za(t,e)}toJSON(){try{var t=Ha(this)}finally{Xr=void 0}return t}l(){var t=nh;return t.g?t.l(this,t.g,t.h):t.l(this,t.h,t.defaultValue)}clone(){let t=this.u;return new this.constructor(vn(t,0|t[_],!1))}O(){return!!(2&(0|this.u[_]))}};function bs(t){return t?/^\d+$/.test(t)?(_n(t),new Si(U,W)):null:S2||(S2=new Si(0,0))}d.prototype.W=Cr,d.prototype.toString=function(){return this.u.toString()};var Si=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}},S2;function Ls(t){return t?/^-?\d+$/.test(t)?(_n(t),new Ii(U,W)):null:I2||(I2=new Ii(0,0))}var Ii=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}},I2;function Pe(t,e,r){for(;r>0||e>127;)t.g.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.g.push(e)}function rr(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function In(t,e){if(e>=0)rr(t,e);else{for(let r=0;r<9;r++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Lr(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function $e(t,e){e.length!==0&&(t.l.push(e),t.h+=e.length)}function St(t,e,r){rr(t.g,8*e+r)}function oo(t,e){return St(t,e,2),e=t.g.end(),$e(t,e),e.push(t.h),e}function so(t,e){var r=e.pop();for(r=t.h+t.g.length()-r;r>127;)e.push(127&r|128),r>>>=7,t.h++;e.push(r),t.h++}function wn(t,e,r){St(t,e,2),rr(t.g,r.length),$e(t,t.g.end()),$e(t,r)}function an(t,e,r,n){r!=null&&(e=oo(t,e),n(r,t),so(t,e))}function Pt(){let t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var ao=Pt(),rc=Pt(),co=Pt(),uo=Pt(),nc=Pt(),ic=Pt(),ho=Pt(),oc=Pt(),sc=Pt(),nr=class{constructor(t,e,r){this.g=t,this.h=e,t=ao,this.l=!!t&&r===t||!1}};function Rn(t,e){return new nr(t,e,ao)}function ac(t,e,r,n,i){an(t,r,uc(e,n),i)}var w2=Rn(function(t,e,r,n,i){return t.h===2&&(Ur(t,Zi(e,n,r),i),!0)},ac),R2=Rn(function(t,e,r,n,i){return t.h===2&&(Ur(t,Zi(e,n,r),i),!0)},ac),xn=Symbol(),lo=Symbol(),Ns=Symbol(),Cs=Symbol(),Qr,Jr;function be(t,e,r,n){var i=n[t];if(i)return i;(i={}).Ma=n,i.T=function(h){switch(typeof h){case"boolean":return ja||(ja=[0,void 0,!0]);case"number":return h>0?void 0:h===0?v2||(v2=[0,void 0]):[-h,void 0];case"string":return[0,h];case"object":return h}}(n[0]);var o=n[1];let s=1;o&&o.constructor===Object&&(i.ga=o,typeof(o=n[++s])=="function"&&(i.la=!0,Qr!=null||(Qr=o),Jr!=null||(Jr=n[s+1]),o=n[s+=2]));let a={};for(;o&&Array.isArray(o)&&o.length&&typeof o[0]=="number"&&o[0]>0;){for(var c=0;c<o.length;c++)a[o[c]]=o;o=n[++s]}for(c=1;o!==void 0;){let h;typeof o=="number"&&(c+=o,o=n[++s]);var u=void 0;if(o instanceof nr?h=o:(h=w2,s--),h==null?void 0:h.l){o=n[++s],u=n;var l=s;typeof o=="function"&&(o=o(),u[l]=o),u=o}for(l=c+1,typeof(o=n[++s])=="number"&&o<0&&(l-=o,o=n[++s]);c<l;c++){let f=a[c];u?r(i,c,h,u,f):e(i,c,h,f)}}return n[t]=i}function cc(t){return Array.isArray(t)?t[0]instanceof nr?t:[R2,t]:[t,void 0]}function uc(t,e){return t instanceof d?t.u:Array.isArray(t)?de(t,e,!1):void 0}function fo(t,e,r,n){let i=r.g;t[e]=n?(o,s,a)=>i(o,s,a,n):i}function po(t,e,r,n,i){let o=r.g,s,a;t[e]=(c,u,l)=>o(c,u,l,a||(a=be(lo,fo,po,n).T),s||(s=go(n)),i)}function go(t){let e=t[Ns];if(e!=null)return e;let r=be(lo,fo,po,t);return e=r.la?(n,i)=>Qr(n,i,r):(n,i)=>{let o=0|n[_];for(;tc(i)&&i.h!=4;){var s=i.m,a=r[s];if(a==null){var c=r.ga;c&&(c=c[s])&&(c=x2(c))!=null&&(a=r[s]=c)}a!=null&&a(i,n,s)||(s=(a=i).l,qr(a),a.fa?a=void 0:(c=a.g.g-s,a.g.g=s,a=Za(a.g,c)),s=n,a&&((c=s[je])?c.push(a):s[je]=[a]))}return 8192&o&&Je(n),!0},t[Ns]=e}function x2(t){let e=(t=cc(t))[0].g;if(t=t[1]){let r=go(t),n=be(lo,fo,po,t).T;return(i,o,s)=>e(i,o,s,n,r)}return e}function On(t,e,r){t[e]=r.h}function bn(t,e,r,n){let i,o,s=r.h;t[e]=(a,c,u)=>s(a,c,u,o||(o=be(xn,On,bn,n).T),i||(i=hc(n)))}function hc(t){let e=t[Cs];if(!e){let r=be(xn,On,bn,t);e=(n,i)=>lc(n,i,r),t[Cs]=e}return e}function lc(t,e,r){(function(n,i,o){let s=512&i?0:-1,a=n.length,c=a+((i=64&i?256&i:!!a&&dn(n[a-1]))?-1:0);for(let u=0;u<c;u++)o(u-s,n[u]);if(i){n=n[a-1];for(let u in n)!isNaN(u)&&o(+u,n[u])}})(t,0|t[_]|(r.T[1]?512:0),(n,i)=>{if(i!=null){var o=function(s,a){var c=s[a];if(c)return c;if((c=s.ga)&&(c=c[a])){var u=(c=cc(c))[0].h;if(c=c[1]){let l=hc(c),h=be(xn,On,bn,c).T;c=s.la?Jr(h,l):(f,v,A)=>u(f,v,A,h,l)}else c=u;return s[a]=c}}(r,n);o&&o(e,i,n)}}),(t=Gi(t))&&function(n,i){$e(n,n.g.end());for(let o=0;o<i.length;o++)$e(n,Pi(i[o])||new Uint8Array(0))}(e,t)}function ir(t,e){if(Array.isArray(e)){var r=0|e[_];if(4&r)return e;for(var n=0,i=0;n<e.length;n++){let o=t(e[n]);o!=null&&(e[i++]=o)}return i<n&&(e.length=i),Y(e,-6145&(5|r)),2&r&&Object.freeze(e),e}}function ct(t,e,r){return new nr(t,e,r)}function or(t,e,r){return new nr(t,e,r)}function ut(t,e,r){H(t,0|t[_],e,r)}var O2=Rn(function(t,e,r,n,i){return t.h===2&&(t=Ur(t,de([void 0,void 0],n,!0),i),Ee(n=0|e[_]),(i=ie(e,n,r))instanceof zt?(2&i.M)!=0?((i=i.da()).push(t),H(e,n,r,i)):i.Ja(t):Array.isArray(i)?(2&(0|i[_])&&H(e,n,r,i=$a(i)),i.push(t)):H(e,n,r,[t]),!0)},function(t,e,r,n,i){if(e instanceof zt)e.forEach((o,s)=>{an(t,r,de([s,o],n,!1),i)});else if(Array.isArray(e))for(let o=0;o<e.length;o++){let s=e[o];Array.isArray(s)&&an(t,r,de(s,n,!1),i)}});function fc(t,e,r){if(e=function(n){if(n==null)return n;let i=typeof n;if(i==="bigint")return String(xr(64,n));if(Or(n)){if(i==="string")return Va(n);if(i==="number")return $i(n)}}(e),e!=null&&(typeof e=="string"&&Ls(e),e!=null))switch(St(t,r,0),typeof e){case"number":t=t.g,Oe(e),Pe(t,U,W);break;case"bigint":r=BigInt.asUintN(64,e),r=new Ii(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),Pe(t.g,r.h,r.g);break;default:r=Ls(e),Pe(t.g,r.h,r.g)}}function pc(t,e,r){(e=Ze(e))!=null&&e!=null&&(St(t,r,0),In(t.g,e))}function dc(t,e,r){(e=Ma(e))!=null&&(St(t,r,0),t.g.g.push(e?1:0))}function gc(t,e,r){(e=ze(e))!=null&&wn(t,r,Sa(e))}function mc(t,e,r,n,i){an(t,r,uc(e,n),i)}function _c(t,e,r){e==null||typeof e=="string"||e instanceof te||(Re(e)?Re(e)&&Fi(Na):e=void 0),e!=null&&wn(t,r,eo(e).buffer)}function yc(t,e,r){return(t.h===5||t.h===2)&&(e=er(e,0|e[_],r,!1),t.h==2?Sn(t,Ai,e):e.push(Ai(t.g)),!0)}var qt=ct(function(t,e,r){if(t.h!==1)return!1;var n=t.g;t=Ti(n);let i=Ti(n);n=2*(i>>31)+1;let o=i>>>20&2047;return t=4294967296*(1048575&i)+t,ut(e,r,o==2047?t?NaN:n*(1/0):o==0?5e-324*n*t:n*Math.pow(2,o-1075)*(t+4503599627370496)),!0},function(t,e,r){(e=ve(e))!=null&&(St(t,r,1),t=t.g,(r=Da||(Da=new DataView(new ArrayBuffer(8)))).setFloat64(0,+e,!0),U=r.getUint32(0,!0),W=r.getUint32(4,!0),Lr(t,U),Lr(t,W))},Pt()),q=ct(function(t,e,r){return t.h===5&&(ut(e,r,Ai(t.g)),!0)},function(t,e,r){(e=ve(e))!=null&&(St(t,r,5),t=t.g,ji(e),Lr(t,U))},ho),b2=or(yc,function(t,e,r){if((e=ir(ve,e))!=null)for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];o!=null&&(St(n,i,5),n=n.g,ji(o),Lr(n,U))}},ho),mo=or(yc,function(t,e,r){if((e=ir(ve,e))!=null&&e.length){St(t,r,2),rr(t.g,4*e.length);for(let n=0;n<e.length;n++)r=t.g,ji(e[n]),Lr(r,U)}},ho),_e=ct(function(t,e,r){return t.h===0&&(ut(e,r,ro(t.g,zi)),!0)},fc,ic),ai=ct(function(t,e,r){return t.h===0&&(ut(e,r,(t=ro(t.g,zi))===0?void 0:t),!0)},fc,ic),L2=ct(function(t,e,r){return t.h===0&&(ut(e,r,ro(t.g,Hi)),!0)},function(t,e,r){if((e=h2(e))!=null&&(typeof e=="string"&&bs(e),e!=null))switch(St(t,r,0),typeof e){case"number":t=t.g,Oe(e),Pe(t,U,W);break;case"bigint":r=BigInt.asUintN(64,e),r=new Si(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),Pe(t.g,r.h,r.g);break;default:r=bs(e),Pe(t.g,r.h,r.g)}},Pt()),$=ct(function(t,e,r){return t.h===0&&(ut(e,r,me(t.g)),!0)},pc,uo),Ln=or(function(t,e,r){return(t.h===0||t.h===2)&&(e=er(e,0|e[_],r,!1),t.h==2?Sn(t,me,e):e.push(me(t.g)),!0)},function(t,e,r){if((e=ir(Ze,e))!=null&&e.length){r=oo(t,r);for(let n=0;n<e.length;n++)In(t.g,e[n]);so(t,r)}},uo),Me=ct(function(t,e,r){return t.h===0&&(ut(e,r,(t=me(t.g))===0?void 0:t),!0)},pc,uo),V=ct(function(t,e,r){return t.h===0&&(ut(e,r,no(t.g)),!0)},dc,rc),Fe=ct(function(t,e,r){return t.h===0&&(ut(e,r,(t=no(t.g))===!1?void 0:t),!0)},dc,rc),it=or(function(t,e,r){return t.h===2&&(t=io(t),er(e,0|e[_],r,!1).push(t),!0)},function(t,e,r){if((e=ir(ze,e))!=null)for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];o!=null&&wn(n,i,Sa(o))}},co),le=ct(function(t,e,r){return t.h===2&&(ut(e,r,(t=io(t))===""?void 0:t),!0)},gc,co),L=ct(function(t,e,r){return t.h===2&&(ut(e,r,io(t)),!0)},gc,co),tt=function(t,e,r=ao){return new nr(t,e,r)}(function(t,e,r,n,i){return t.h===2&&(n=de(void 0,n,!0),er(e,0|e[_],r,!0).push(n),Ur(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)mc(t,e[o],r,n,i)}),b=Rn(function(t,e,r,n,i,o){return t.h===2&&(Ka(e,0|e[_],o,r),Ur(t,e=Zi(e,n,r),i),!0)},mc),Ec=ct(function(t,e,r){return t.h===2&&(ut(e,r,ec(t)),!0)},_c,oc),N2=or(function(t,e,r){return(t.h===0||t.h===2)&&(e=er(e,0|e[_],r,!1),t.h==2?Sn(t,ne,e):e.push(ne(t.g)),!0)},function(t,e,r){if((e=ir(Pa,e))!=null)for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];o!=null&&(St(n,i,0),rr(n.g,o))}},nc),C2=ct(function(t,e,r){return t.h===0&&(ut(e,r,(t=ne(t.g))===0?void 0:t),!0)},function(t,e,r){(e=Pa(e))!=null&&e!=null&&(St(t,r,0),rr(t.g,e))},nc),Tt=ct(function(t,e,r){return t.h===0&&(ut(e,r,me(t.g)),!0)},function(t,e,r){(e=Ze(e))!=null&&(e=parseInt(e,10),St(t,r,0),In(t.g,e))},sc),wi=class{constructor(e,r){this.h=e,this.g=r,this.l=R,this.m=E,this.defaultValue=void 0}register(){hn(this)}};function Ft(t,e){return new wi(t,e)}function Te(t,e){return(r,n)=>{if(zr.length){let o=zr.pop();o.o(n),si(o.g,r,n),r=o}else r=new class{constructor(o,s){if(Os.length){let a=Os.pop();si(a,o,s),o=a}else o=new class{constructor(a,c){this.h=null,this.m=!1,this.g=this.l=this.j=0,si(this,a,c)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(o,s);this.g=o,this.l=this.g.g,this.h=this.m=-1,this.o(s)}o({fa:o=!1}={}){this.fa=o}}(r,n);try{let o=new t,s=o.u;go(e)(s,r);var i=o}finally{r.g.clear(),r.m=-1,r.h=-1,zr.length<100&&zr.push(r)}return i}}function Nn(t){return function(){let e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){let s=this.g;return this.g=[],s}}}};lc(this.u,e,be(xn,On,bn,t)),$e(e,e.g.end());let r=new Uint8Array(e.h),n=e.l,i=n.length,o=0;for(let s=0;s<i;s++){let a=n[s];r.set(a,o),o+=a.length}return e.l=[r],r}}var Us=class extends d{constructor(t){super(t)}},Ds=[0,le,ct(function(t,e,r){return t.h===2&&(ut(e,r,(t=ec(t))===xe()?void 0:t),!0)},function(t,e,r){if(e!=null){if(e instanceof d){let n=e.Oa;return void(n&&(e=n(e),e!=null&&wn(t,r,eo(e).buffer)))}if(Array.isArray(e))return}_c(t,e,r)},oc)],ci,ks=globalThis.trustedTypes;function Ms(t){ci===void 0&&(ci=function(){let r=null;if(!ks)return r;try{let n=i=>i;r=ks.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch(n){}return r}());var e=ci;return new class{constructor(r){this.g=r}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function U2(t,...e){if(e.length===0)return Ms(t[0]);let r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return Ms(r)}var vc=[0,$,Tt,V,-1,Ln,Tt,-1],D2=class extends d{constructor(t){super(t)}},Tc=[0,V,L,V,Tt,-1,or(function(t,e,r){return(t.h===0||t.h===2)&&(e=er(e,0|e[_],r,!1),t.h==2?Sn(t,A2,e):e.push(me(t.g)),!0)},function(t,e,r){if((e=ir(Ze,e))!=null&&e.length){r=oo(t,r);for(let n=0;n<e.length;n++)In(t.g,e[n]);so(t,r)}},sc),L,-1,[0,V,-1],Tt,V,-1],Ac=[0,L,-2],Ps=class extends d{constructor(t){super(t)}},Sc=[0],Ic=[0,$,V,1,V,-3],At=class extends d{constructor(t){super(t,2)}},Q={};Q[336783863]=[0,L,V,-1,$,[0,[1,2,3,4,5,6,7,8,9],b,Sc,b,Tc,b,Ac,b,Ic,b,vc,b,[0,L,-2],b,[0,L,Tt],b,[0,Tt,L,-1],b,[0,Tt,-1]],[0,L],V,[0,[1,3],[2,4],b,[0,Ln],-1,b,[0,it],-1,tt,[0,L,-1]],L];var Fs=[0,ai,-1,Fe,-3,ai,Ln,le,Me,ai,-1,Fe,Me,Fe,-2,le];function It(t,e){vi(t,2,tr(e),"")}function M(t,e){An(t,3,e)}function w(t,e){An(t,4,e)}var at=class extends d{constructor(t){super(t,500)}o(t){return E(this,0,7,t)}},Sr=[-1,{}],Bs=[0,L,1,Sr],Vs=[0,L,it,Sr];function wt(t,e){on(t,1,at,e)}function P(t,e){An(t,10,e)}function x(t,e){An(t,15,e)}var mt=class extends d{constructor(t){super(t,500)}o(t){return E(this,0,1001,t)}},wc=[-500,tt,[-500,le,-1,it,-3,[-2,Q,V],tt,Ds,Me,-1,Bs,Vs,tt,[0,le,Fe],le,Fs,Me,it,987,it],4,tt,[-500,L,-1,[-1,{}],998,L],tt,[-500,L,it,-1,[-2,{},V],997,it,-1],Me,tt,[-500,L,it,Sr,998,it],it,Me,Bs,Vs,tt,[0,le,-1,Sr],it,-2,Fs,le,-1,Fe,[0,Fe,C2],978,Sr,tt,Ds];mt.prototype.g=Nn(wc);var k2=Te(mt,wc),M2=class extends d{constructor(t){super(t)}},Rc=class extends d{constructor(t){super(t)}g(){return re(this,M2,1)}},xc=[0,tt,[0,$,q,L,-1]],Cn=Te(Rc,xc),P2=class extends d{constructor(t){super(t)}},F2=class extends d{constructor(t){super(t)}},ui=class extends d{constructor(t){super(t)}h(){return R(this,P2,2)}g(){return re(this,F2,5)}},Oc=Te(class extends d{constructor(t){super(t)}},[0,it,Ln,mo,[0,Tt,[0,$,-3],[0,q,-3],[0,$,-1,[0,tt,[0,$,-2]]],tt,[0,q,-1,L,q]],L,-1,_e,tt,[0,$,q],it,_e]),bc=class extends d{constructor(t){super(t)}},Be=Te(class extends d{constructor(t){super(t)}},[0,tt,[0,q,-4]]),Lc=class extends d{constructor(t){super(t)}},Dr=Te(class extends d{constructor(t){super(t)}},[0,tt,[0,q,-4]]),B2=class extends d{constructor(t){super(t)}},V2=[0,$,-1,mo,Tt],Nc=class extends d{constructor(t){super(t)}};Nc.prototype.g=Nn([0,q,-4,_e]);var G2=class extends d{constructor(t){super(t)}},j2=Te(class extends d{constructor(t){super(t)}},[0,tt,[0,1,$,L,xc],_e]),Gs=class extends d{constructor(t){super(t)}},H2=class extends d{constructor(t){super(t)}ma(){let t=Wa(this);return t==null?xe():t}},z2=class extends d{constructor(t){super(t)}},Cc=[1,2],W2=Te(class extends d{constructor(t){super(t)}},[0,tt,[0,Cc,b,[0,mo],b,[0,Ec],$,L],_e]),_o=class extends d{constructor(t){super(t)}},Uc=[0,L,$,q,it,-1],js=class extends d{constructor(t){super(t)}},$2=[0,V,-1],Hs=class extends d{constructor(t){super(t)}},Zr=[1,2,3,4,5],cn=class extends d{constructor(t){super(t)}g(){return Wa(this)!=null}h(){return Ct(this,2)!=null}},G=class extends d{constructor(t){super(t)}g(){var t;return(t=Ma(We(this,2)))!=null?t:!1}},Dc=[0,Ec,L,[0,$,_e,-1],[0,L2,_e]],X=[0,Dc,V,[0,Zr,b,Ic,b,Tc,b,vc,b,Sc,b,Ac],Tt],Un=class extends d{constructor(t){super(t)}},yo=[0,X,q,-1,$],K2=Ft(502141897,Un);Q[502141897]=yo;var X2=Te(class extends d{constructor(t){super(t)}},[0,[0,Tt,-1,b2,N2],V2]),kc=class extends d{constructor(t){super(t)}},Mc=class extends d{constructor(t){super(t)}},Eo=[0,X,q,[0,X],V],Pc=[0,X,yo,Eo,q,[0,[0,Dc]]],Y2=Ft(508968150,Mc);Q[508968150]=Pc,Q[508968149]=Eo;var Fc=class extends d{constructor(t){super(t)}},q2=Ft(513916220,Fc);Q[513916220]=[0,X,Pc,$];var De=class extends d{constructor(t){super(t)}h(){return R(this,_o,2)}g(){k(this,2)}},Bc=[0,X,Uc];Q[478825465]=Bc;var Q2=class extends d{constructor(t){super(t)}},Vc=class extends d{constructor(t){super(t)}},vo=class extends d{constructor(t){super(t)}},To=class extends d{constructor(t){super(t)}},Gc=class extends d{constructor(t){super(t)}},zs=[0,X,[0,X],Bc,-1],jc=[0,X,q,$],Ao=[0,X,q],Hc=[0,X,jc,Ao,q],J2=Ft(479097054,Gc);Q[479097054]=[0,X,Hc,zs],Q[463370452]=zs,Q[464864288]=jc;var Z2=Ft(462713202,To);Q[462713202]=Hc,Q[474472470]=Ao;var th=class extends d{constructor(t){super(t)}},zc=class extends d{constructor(t){super(t)}},Wc=class extends d{constructor(t){super(t)}},$c=class extends d{constructor(t){super(t)}},So=[0,X,q,-1,$],Ri=[0,X,q,V];$c.prototype.g=Nn([0,X,Ao,[0,X],yo,Eo,So,Ri]);var Kc=class extends d{constructor(t){super(t)}},eh=Ft(456383383,Kc);Q[456383383]=[0,X,Uc];var Xc=class extends d{constructor(t){super(t)}},rh=Ft(476348187,Xc);Q[476348187]=[0,X,$2];var Yc=class extends d{constructor(t){super(t)}},Ws=class extends d{constructor(t){super(t)}},qc=[0,Tt,-1],nh=Ft(458105876,class extends d{constructor(t){super(t)}g(){var t=this.u;let e=0|t[_],r=2&e;return t=function(n,i,o){var s=Ws;let a=2&i,c=!1;if(o==null){if(a)return xs();o=[]}else if(o.constructor===zt){if((2&o.M)==0||a)return o;o=o.da()}else Array.isArray(o)?c=!!(2&(0|o[_])):o=[];if(a){if(!o.length)return xs();c||(c=!0,Je(o))}else c&&(c=!1,o=$a(o));return c||(64&(0|o[_])?o[_]&=-33:32&i&&fn(o,32)),H(n,i,2,s=new zt(o,s,l2,void 0)),s}(t,e,ie(t,e,2)),!r&&Ws&&(t.pa=!0),t}});Q[458105876]=[0,qc,O2,[!0,_e,[0,L,-1,it]]];var Io=class extends d{constructor(t){super(t)}},Qc=Ft(458105758,Io);Q[458105758]=[0,X,L,qc];var Jc=class extends d{constructor(t){super(t)}},ih=Ft(443442058,Jc);Q[443442058]=[0,X,L,$,q,it,-1,V,q],Q[514774813]=So;var Zc=class extends d{constructor(t){super(t)}},oh=Ft(516587230,Zc);function xi(t,e){return e=e?e.clone():new _o,t.displayNamesLocale!==void 0?k(e,1,tr(t.displayNamesLocale)):t.displayNamesLocale===void 0&&k(e,1),t.maxResults!==void 0?Wt(e,2,t.maxResults):"maxResults"in t&&k(e,2),t.scoreThreshold!==void 0?g(e,3,t.scoreThreshold):"scoreThreshold"in t&&k(e,3),t.categoryAllowlist!==void 0?sn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&k(e,4),t.categoryDenylist!==void 0?sn(e,5,t.categoryDenylist):"categoryDenylist"in t&&k(e,5),e}function wo(t,e=-1,r=""){return{categories:t.map(n=>{var i,o,s,a,c,u,l;return{index:(o=(i=Nt(n,1))!=null?i:0)!=null?o:-1,score:(s=K(n,2))!=null?s:0,categoryName:(c=(a=Ct(n,3))!=null?a:"")!=null?c:"",displayName:(l=(u=Ct(n,4))!=null?u:"")!=null?l:""}}),headIndex:e,headName:r}}function t1(t){var s,a,c,u,l,h,f,v,A,S,F,D,rt;var e=Ie(t,3,ve,Se()),r=Ie(t,2,Ze,Se()),n=Ie(t,1,ze,Se()),i=Ie(t,9,ze,Se());let o={categories:[],keypoints:[]};for(let N=0;N<e.length;N++)o.categories.push({score:e[N],index:(s=r[N])!=null?s:-1,categoryName:(a=n[N])!=null?a:"",displayName:(c=i[N])!=null?c:""});if((e=(u=R(t,ui,4))==null?void 0:u.h())&&(o.boundingBox={originX:(l=Nt(e,1))!=null?l:0,originY:(h=Nt(e,2))!=null?h:0,width:(f=Nt(e,3))!=null?f:0,height:(v=Nt(e,4))!=null?v:0,angle:0}),(A=R(t,ui,4))==null?void 0:A.g().length)for(let N of R(t,ui,4).g())o.keypoints.push({x:(S=Yr(N,1))!=null?S:0,y:(F=Yr(N,2))!=null?F:0,score:(D=Yr(N,4))!=null?D:0,label:(rt=Ct(N,3))!=null?rt:""});return o}function Dn(t){var r,n,i,o;let e=[];for(let s of re(t,Lc,1))e.push({x:(r=K(s,1))!=null?r:0,y:(n=K(s,2))!=null?n:0,z:(i=K(s,3))!=null?i:0,visibility:(o=K(s,4))!=null?o:0});return e}function Ir(t){var r,n,i,o;let e=[];for(let s of re(t,bc,1))e.push({x:(r=K(s,1))!=null?r:0,y:(n=K(s,2))!=null?n:0,z:(i=K(s,3))!=null?i:0,visibility:(o=K(s,4))!=null?o:0});return e}function $s(t){return Array.from(t,e=>e>127?e-256:e)}function Ks(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let r=0,n=0,i=0;for(let o=0;o<t.length;o++)r+=t[o]*e[o],n+=t[o]*t[o],i+=e[o]*e[o];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}var Wr;Q[516587230]=[0,X,So,Ri,q],Q[518928384]=Ri;var sh=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]);function e1(){return C(this,null,function*(){if(Wr===void 0)try{yield WebAssembly.instantiate(sh),Wr=!0}catch(t){Wr=!1}return Wr})}function _r(r){return C(this,arguments,function*(t,e=U2``){let n=(yield e1())?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}})}var Qt=class{};function r1(){var t=navigator;return typeof OffscreenCanvas!="undefined"&&(!function(e=navigator){return(e=e.userAgent).includes("Safari")&&!e.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}function Xs(t){return C(this,null,function*(){if(typeof importScripts!="function"){let e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((r,n)=>{e.addEventListener("load",()=>{r()},!1),e.addEventListener("error",i=>{n(i)},!1),document.body.appendChild(e)})}importScripts(t.toString())})}function n1(t){return t.videoWidth!==void 0?[t.videoWidth,t.videoHeight]:t.naturalWidth!==void 0?[t.naturalWidth,t.naturalHeight]:t.displayWidth!==void 0?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function m(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Ys(t,e,r){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(r?t.i._bindTextureToStream(r):t.i._bindTextureToCanvas(),!(r=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);let[n,i]=n1(e);return!t.l||n===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=n,t.i.canvas.height=i),[n,i]}function qs(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");let n=new Uint32Array(e.length);for(let i=0;i<e.length;i++)n[i]=t.i.stringToNewUTF8(e[i]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),r(e);for(let i of n)t.i._free(i);t.i._free(e)}function Vt(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function ue(t,e,r){let n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(i,o,s)=>{o?(r(n,s),n=[]):n.push(i)}}Qt.forVisionTasks=function(t){return _r("vision",t)},Qt.forTextTasks=function(t){return _r("text",t)},Qt.forGenAiExperimentalTasks=function(t){return _r("genai_experimental",t)},Qt.forGenAiTasks=function(t){return _r("genai",t)},Qt.forAudioTasks=function(t){return _r("audio",t)},Qt.isSimdSupported=function(){return e1()};function ah(t,e,r,n){return C(this,null,function*(){return t=yield((i,o,s,a,c)=>C(this,null,function*(){if(o&&(yield Xs(o)),!self.ModuleFactory||s&&(yield Xs(s),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((o=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(o.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=yield self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new i(c,a)}))(t,r.wasmLoaderPath,r.assetLoaderPath,e,{locateFile:i=>i.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&i.endsWith(".data")?r.assetBinaryPath.toString():i}),yield t.o(n),t})}function hi(t,e){let r=R(t.baseOptions,cn,1)||new cn;typeof e=="string"?(k(r,2,tr(e)),k(r,1)):e instanceof Uint8Array&&(k(r,1,Vi(e,!1)),k(r,2)),E(t.baseOptions,0,1,r)}function Qs(t){try{let e=t.G.length;if(e===1)throw Error(t.G[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.G.map(r=>r.message).join(", "))}finally{t.G=[]}}function p(t,e){t.B=Math.max(t.B,e)}function kn(t,e){t.A=new at,It(t.A,"PassThroughCalculator"),M(t.A,"free_memory"),w(t.A,"free_memory_unused_out"),P(e,"free_memory"),wt(e,t.A)}function Ke(t,e){M(t.A,e),w(t.A,e+"_unused_out")}function Mn(t){t.g.addBoolToStream(!0,"free_memory",t.B)}var Oi=class{constructor(t){this.g=t,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){var r,n,i,o,s,a;if(e){let c=t.baseOptions||{};if((r=t.baseOptions)!=null&&r.modelAssetBuffer&&((n=t.baseOptions)!=null&&n.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((i=R(this.baseOptions,cn,1))!=null&&i.g()||(o=R(this.baseOptions,cn,1))!=null&&o.h()||(s=t.baseOptions)!=null&&s.modelAssetBuffer||(a=t.baseOptions)!=null&&a.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(u,l){let h=R(u.baseOptions,Hs,3);if(!h){var f=h=new Hs,v=new Ps;Ar(f,4,Zr,v)}"delegate"in l&&(l.delegate==="GPU"?(l=h,f=new D2,Ar(l,2,Zr,f)):(l=h,f=new Ps,Ar(l,4,Zr,f))),E(u.baseOptions,0,3,h)}(this,c),c.modelAssetPath)return fetch(c.modelAssetPath.toString()).then(u=>{if(u.ok)return u.arrayBuffer();throw Error(`Failed to fetch model: ${c.modelAssetPath} (${u.status})`)}).then(u=>{try{this.g.i.FS_unlink("/model.dat")}catch(l){}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(u),!0,!1,!1),hi(this,"/model.dat"),this.m(),this.J()});if(c.modelAssetBuffer instanceof Uint8Array)hi(this,c.modelAssetBuffer);else if(c.modelAssetBuffer)return function(u){return C(this,null,function*(){let l=[];for(var h=0;;){let{done:f,value:v}=yield u.read();if(f)break;l.push(v),h+=v.length}if(l.length===0)return new Uint8Array(0);if(l.length===1)return l[0];u=new Uint8Array(h),h=0;for(let f of l)u.set(f,h),h+=f.length;return u})}(c.modelAssetBuffer).then(u=>{hi(this,u),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let t;if(this.g.ca(e=>{t=k2(e)}),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener((r,n)=>{this.G.push(Error(n))}),this.g.Ha(),this.g.setGraph(t,e),this.A=void 0,Qs(this)}finishProcessing(){this.g.finishProcessing(),Qs(this)}close(){this.A=void 0,this.g.closeGraph()}};function st(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}Oi.prototype.close=Oi.prototype.close;var bi=class{constructor(e,r,n,i){this.g=e,this.h=r,this.m=n,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 Js(t,e,r){let n=t.g;if(r=st(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,e),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(t.h,r),r}function Zs(t,e){let r=t.g,n=st(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);let i=st(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(t.P),r.vertexAttribPointer(t.P,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);let o=st(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,o),r.enableVertexAttribArray(t.J),r.vertexAttribPointer(t.J,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new bi(r,n,i,o)}function Ro(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function kr(t,e,r,n){return Ro(t,e),t.h||(t.m(),t.C()),r?(t.s||(t.s=Zs(t,!0)),r=t.s):(t.v||(t.v=Zs(t,!1)),r=t.v),e.useProgram(t.h),r.bind(),t.l(),t=n(),r.g.bindVertexArray(null),t}function ye(t,e,r){return Ro(t,e),t=st(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r!=null?r:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r!=null?r:e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function Pn(t,e,r){Ro(t,e),t.A||(t.A=st(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.A),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0)}function xo(t){var e;(e=t.g)==null||e.bindFramebuffer(t.g.FRAMEBUFFER,null)}var sr=class{G(){return`
1
+ "use strict";var Vision=(()=>{var xn=Object.defineProperty,l2=Object.defineProperties,f2=Object.getOwnPropertyDescriptor,d2=Object.getOwnPropertyDescriptors,p2=Object.getOwnPropertyNames,Is=Object.getOwnPropertySymbols;var Us=Object.prototype.hasOwnProperty,g2=Object.prototype.propertyIsEnumerable;var Ur=(t,e,n)=>e in t?xn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Cr=(t,e)=>{for(var n in e||(e={}))Us.call(e,n)&&Ur(t,n,e[n]);if(Is)for(var n of Is(e))g2.call(e,n)&&Ur(t,n,e[n]);return t},Cs=(t,e)=>l2(t,d2(e));var m2=(t,e)=>{for(var n in e)xn(t,n,{get:e[n],enumerable:!0})},v2=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of p2(e))!Us.call(t,i)&&i!==n&&xn(t,i,{get:()=>e[i],enumerable:!(r=f2(e,i))||r.enumerable});return t};var y2=t=>v2(xn({},"__esModule",{value:!0}),t);var de=(t,e,n)=>Ur(t,typeof e!="symbol"?e+"":e,n);var X=(t,e,n)=>new Promise((r,i)=>{var s=h=>{try{a(n.next(h))}catch(c){i(c)}},o=h=>{try{a(n.throw(h))}catch(c){i(c)}},a=h=>h.done?r(h.value):Promise.resolve(h.value).then(s,o);a((n=n.apply(t,e)).next())});var ic={};m2(ic,{VisionTaskRegistry:()=>_s,VisionTaskType:()=>s2});var Re=typeof self!="undefined"?self:{};function pe(){throw Error("Invalid UTF8")}function Ps(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}var kn,Pr,w2=typeof TextDecoder!="undefined",_2,E2=typeof TextEncoder!="undefined";function $o(t){if(E2)t=(_2||(_2=new TextEncoder)).encode(t);else{let n=0,r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)r[n++]=e;else{if(e<2048)r[n++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let s=t.charCodeAt(++i);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var vi,zn;t:{for(Dr=["CLOSURE_FLAGS"],Sn=Re,Ln=0;Ln<Dr.length;Ln++)if((Sn=Sn[Dr[Ln]])==null){zn=null;break t}zn=Sn}var Dr,Sn,Ln,fn,Ds=zn&&zn[610401301];vi=Ds!=null&&Ds;var Os=Re.navigator;function Kr(t){return!!vi&&!!fn&&fn.brands.some(({brand:e})=>e&&e.indexOf(t)!=-1)}function bt(t){var e;return(e=Re.navigator)&&(e=e.userAgent)||(e=""),e.indexOf(t)!=-1}function ee(){return!!vi&&!!fn&&fn.brands.length>0}function Or(){return ee()?Kr("Chromium"):(bt("Chrome")||bt("CriOS"))&&!(!ee()&&bt("Edge"))||bt("Silk")}function Kn(t){return Kn[" "](t),t}fn=Os&&Os.userAgentData||null,Kn[" "]=function(){};var T2=!ee()&&(bt("Trident")||bt("MSIE"));!bt("Android")||Or(),Or(),bt("Safari")&&(Or()||!ee()&&bt("Coast")||!ee()&&bt("Opera")||!ee()&&bt("Edge")||(ee()?Kr("Microsoft Edge"):bt("Edg/"))||ee()&&Kr("Opera"));var Ko={},on=null;function A2(t){let e=t.length,n=3*e/4;n%3?n=Math.floor(n):"=.".indexOf(t[e-1])!=-1&&(n="=.".indexOf(t[e-2])!=-1?n-2:n-1);let r=new Uint8Array(n),i=0;return function(s,o){function a(c){for(;h<s.length;){let l=s.charAt(h++),u=on[l];if(u!=null)return u;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l)}return c}Yo();let h=0;for(;;){let c=a(-1),l=a(0),u=a(64),f=a(64);if(f===64&&c===-1)break;o(c<<2|l>>4),u!=64&&(o(l<<4&240|u>>2),f!=64&&o(u<<6&192|f))}}(t,function(s){r[i++]=s}),i!==n?r.subarray(0,i):r}function Yo(){if(!on){on={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){let r=t.concat(e[n].split(""));Ko[n]=r;for(let i=0;i<r.length;i++){let s=r[i];on[s]===void 0&&(on[s]=i)}}}}var qo=typeof Uint8Array!="undefined",Zo=!T2&&typeof btoa=="function";function Bs(t){if(!Zo){var e;e===void 0&&(e=0),Yo(),e=Ko[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let h=0,c=0;for(;h<t.length-2;h+=3){var i=t[h],s=t[h+1],o=t[h+2],a=e[i>>2];i=e[(3&i)<<4|s>>4],s=e[(15&s)<<2|o>>6],o=e[63&o],n[c++]=a+i+s+o}switch(a=0,o=r,t.length-h){case 2:o=e[(15&(a=t[h+1]))<<2]||r;case 1:t=t[h],n[c]=e[t>>2]+e[(3&t)<<4|a>>4]+o+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}var Ns=/[-_.]/g,b2={"-":"+",_:"/",".":"="};function x2(t){return b2[t]||""}function Jo(t){if(!Zo)return A2(t);Ns.test(t)&&(t=t.replace(Ns,x2)),t=atob(t);let e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function ye(t){return qo&&t!=null&&t instanceof Uint8Array}var Ie={};function we(){return k2||(k2=new $t(null,Ie))}function yi(t){Qo(Ie);var e=t.g;return(e=e==null||ye(e)?e:typeof e=="string"?Jo(e):null)==null?e:t.g=e}var $t=class{h(){return new Uint8Array(yi(this)||0)}constructor(t,e){if(Qo(e),this.g=t,t!=null&&t.length===0)throw Error("ByteString should be constructed with non-empty values")}},k2,Br;function Qo(t){if(t!==Ie)throw Error("illegal external caller")}function ta(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function Yr(t){return ta(t=Error(t),"warning"),t}function wi(t){if(t!=null){var e=Br!=null?Br:Br={},n=e[t]||0;n>=5||(e[t]=n+1,ta(t=Error(),"incident"),function(r){Re.setTimeout(()=>{throw r},0)}(t))}}var Yn=typeof Symbol=="function"&&typeof Symbol()=="symbol";function je(t,e,n=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&t?Symbol.for(t):t!=null?Symbol(t):Symbol():e}var S2=je("jas",void 0,!0),Gs=je(void 0,"0di"),nn=je(void 0,"1oa"),Ue=je(void 0,Symbol()),L2=je(void 0,"0actk"),ea=je(void 0,"8utk"),v=Yn?S2:"Ea",na={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},ra=Object.defineProperties;function qn(t,e){Yn||v in t||ra(t,na),t[v]|=e}function W(t,e){Yn||v in t||ra(t,na),t[v]=e}function Ve(t){return qn(t,34),t}function F2(t,e){W(e,-15615&(0|t))}function qr(t,e){W(e,-15581&(34|t))}function Zn(){return typeof BigInt=="function"}function ht(t){return Array.prototype.slice.call(t)}var _i,wn={};function Jn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&t.constructor===Object}function Ei(t,e){if(t!=null){if(typeof t=="string")t=t?new $t(t,Ie):we();else if(t.constructor!==$t)if(ye(t))t=t.length?new $t(new Uint8Array(t),Ie):we();else{if(!e)throw Error();t=void 0}}return t}var zs=[];function ue(t){if(2&t)throw Error()}W(zs,55),_i=Object.freeze(zs);var jn=class{constructor(e,n,r){this.g=e,this.h=n,this.l=r}next(){let e=this.g.next();return e.done||(e.value=this.h.call(this.l,e.value)),e}[Symbol.iterator](){return this}};function Ti(t){return Ue?t[Ue]:void 0}var M2=Object.freeze({});function Qn(t){return t.Na=!0,t}var R2=Qn(t=>typeof t=="number"),js=Qn(t=>typeof t=="string"),I2=Qn(t=>typeof t=="boolean"),tr=typeof Re.BigInt=="function"&&typeof Re.BigInt(0)=="bigint";function re(t){var e=t;if(js(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(R2(e)&&!Number.isSafeInteger(e))throw Error(String(e));return tr?BigInt(t):t=I2(t)?t?"1":"0":js(t)?t.trim()||"0":String(t)}var Zr=Qn(t=>tr?t>=C2&&t<=D2:t[0]==="-"?Vs(t,U2):Vs(t,P2)),U2=Number.MIN_SAFE_INTEGER.toString(),C2=tr?BigInt(Number.MIN_SAFE_INTEGER):void 0,P2=Number.MAX_SAFE_INTEGER.toString(),D2=tr?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Vs(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r>i)return!1;if(r<i)return!0}}var O2=typeof Uint8Array.prototype.slice=="function",ia,F=0,G=0;function Hs(t){let e=t>>>0;F=e,G=(t-e)/4294967296>>>0}function _e(t){if(t<0){Hs(-t);let[e,n]=ki(F,G);F=e>>>0,G=n>>>0}else Hs(t)}function Ai(t){let e=ia||(ia=new DataView(new ArrayBuffer(8)));e.setFloat32(0,+t,!0),G=0,F=e.getUint32(0,!0)}function bi(t,e){let n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:dn(t,e)}function xi(t,e){let n=2147483648&e;return n&&(e=~e>>>0,(t=1+~t>>>0)==0&&(e=e+1>>>0)),typeof(t=bi(t,e))=="number"?n?-t:t:n?"-"+t:t}function dn(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else Zn()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,t>=1e7&&(n+=t/1e7>>>0,t%=1e7),n>=1e7&&(e+=n/1e7>>>0,n%=1e7),n=e+Xs(n)+Xs(t));return n}function Xs(t){return t=String(t),"0000000".slice(t.length)+t}function sa(){var t=F,e=G;if(2147483648&e)if(Zn())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[n,r]=ki(t,e);t="-"+dn(n,r)}else t=dn(t,e);return t}function er(t){if(t.length<16)_e(Number(t));else if(Zn())t=BigInt(t),F=Number(t&BigInt(4294967295))>>>0,G=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+(t[0]==="-");G=F=0;let n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){let s=Number(t.slice(r,i));G*=1e6,F=1e6*F+s,F>=4294967296&&(G+=Math.trunc(F/4294967296),G>>>=0,F>>>=0)}if(e){let[r,i]=ki(F,G);F=r,G=i}}}function ki(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}var pn=typeof BigInt=="function"?BigInt.asIntN:void 0,B2=typeof BigInt=="function"?BigInt.asUintN:void 0,ie=Number.isSafeInteger,nr=Number.isFinite,Ce=Math.trunc,N2=re(0);function le(t){return t==null||typeof t=="number"?t:t==="NaN"||t==="Infinity"||t==="-Infinity"?Number(t):void 0}function oa(t){return t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0}var G2=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function gn(t){switch(typeof t){case"bigint":return!0;case"number":return nr(t);case"string":return G2.test(t);default:return!1}}function He(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return nr(t)?0|t:void 0}function aa(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return nr(t)?t>>>0:void 0}function Ws(t){if(t[0]==="-")return!1;let e=t.length;return e<20||e===20&&Number(t.substring(0,6))<184467}function ha(t){let e=t.length;return t[0]==="-"?e<20||e===20&&Number(t.substring(0,7))>-922337:e<19||e===19&&Number(t.substring(0,6))<922337}function ca(t){return ha(t)?t:(er(t),sa())}function Si(t){return t=Ce(t),ie(t)||(_e(t),t=xi(F,G)),t}function ua(t){var e=Ce(Number(t));return ie(e)?String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),ca(t))}function $s(t){var e=Ce(Number(t));return ie(e)?re(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),Zn()?re(pn(64,BigInt(t))):re(ca(t)))}function Ks(t){if(ie(t))t=re(Si(t));else{if(t=Ce(t),ie(t))t=String(t);else{let e=String(t);ha(e)?t=e:(_e(t),t=sa())}t=re(t)}return t}function Jr(t){return t==null?t:typeof t=="bigint"?(Zr(t)?t=Number(t):(t=pn(64,t),t=Zr(t)?Number(t):String(t)),t):gn(t)?typeof t=="number"?Si(t):ua(t):void 0}function z2(t){if(t==null)return t;var e=typeof t;if(e==="bigint")return String(B2(64,t));if(gn(t)){if(e==="string")return e=Ce(Number(t)),ie(e)&&e>=0?t=String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),Ws(t)||(er(t),t=dn(F,G))),t;if(e==="number")return(t=Ce(t))>=0&&ie(t)?t:function(n){if(n<0){_e(n);var r=dn(F,G);return n=Number(r),ie(n)?n:r}return Ws(r=String(n))?r:(_e(n),bi(F,G))}(t)}}function la(t){if(typeof t!="string")throw Error();return t}function Xe(t){if(t!=null&&typeof t!="string")throw Error();return t}function Pe(t){return t==null||typeof t=="string"?t:void 0}function Li(t,e,n,r){if(t!=null&&typeof t=="object"&&t.W===wn)return t;if(!Array.isArray(t))return n?2&r?((t=e[Gs])||(Ve((t=new e).u),t=e[Gs]=t),e=t):e=new e:e=void 0,e;let i=n=0|t[v];return i===0&&(i|=32&r),i|=2&r,i!==n&&W(t,i),new e(t)}function j2(t,e,n){if(e)t:{if(!gn(e=t))throw Yr("int64");switch(typeof e){case"string":e=$s(e);break t;case"bigint":e=re(pn(64,e));break t;default:e=Ks(e)}}else t=typeof(e=t),e=e==null?e:t==="bigint"?re(pn(64,e)):gn(e)?t==="string"?$s(e):Ks(e):void 0;return(t=e)==null?n?N2:void 0:t}function V2(t){return t}var H2={},X2=function(){try{return Kn(new class extends Map{constructor(){super()}}),!1}catch(t){return!0}}(),hn=class{constructor(){this.g=new Map}get(e){return this.g.get(e)}set(e,n){return this.g.set(e,n),this.size=this.g.size,this}delete(e){return e=this.g.delete(e),this.size=this.g.size,e}clear(){this.g.clear(),this.size=this.g.size}has(e){return this.g.has(e)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(e,n){return this.g.forEach(e,n)}[Symbol.iterator](){return this.entries()}},W2=X2?(Object.setPrototypeOf(hn.prototype,Map.prototype),Object.defineProperties(hn.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),hn):class extends Map{constructor(){super()}};function Ys(t){return t}function Nr(t){if(2&t.M)throw Error("Cannot mutate an immutable Map")}var Bt=class extends W2{constructor(t,e,n=Ys,r=Ys){super();let i=0|t[v];i|=64,W(t,i),this.M=i,this.I=e,this.S=n,this.X=this.I?$2:r;for(let s=0;s<t.length;s++){let o=t[s],a=n(o[0],!1,!0),h=o[1];e?h===void 0&&(h=null):h=r(o[1],!1,!0,void 0,void 0,i),super.set(a,h)}}La(){var t=J2;if(this.size!==0)return Array.from(super.entries(),e=>(e[0]=t(e[0]),e[1]=t(e[1]),e))}da(t=K2){let e=[],n=super.entries();for(var r;!(r=n.next()).done;)(r=r.value)[0]=t(r[0]),r[1]=t(r[1]),e.push(r);return e}clear(){Nr(this),super.clear()}delete(t){return Nr(this),super.delete(this.S(t,!0,!1))}entries(){if(this.I){var t=super.keys();t=new jn(t,Y2,this)}else t=super.entries();return t}values(){if(this.I){var t=super.keys();t=new jn(t,Bt.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.I?super.forEach((n,r,i)=>{t.call(e,i.get(r),r,i)}):super.forEach(t,e)}set(t,e){return Nr(this),(t=this.S(t,!0,!1))==null?this:e==null?(super.delete(t),this):super.set(t,this.X(e,!0,!0,this.I,!1,this.M))}Ja(t){let e=this.S(t[0],!1,!0);t=t[1],t=this.I?t===void 0?null:t:this.X(t,!1,!0,void 0,!1,this.M),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);let e=super.get(t);if(e!==void 0){var n=this.I;return n?((n=this.X(e,!1,!0,n,this.pa,this.M))!==e&&super.set(t,n),n):e}}[Symbol.iterator](){return this.entries()}};function $2(t,e,n,r,i,s){return t=Li(t,r,n,s),i&&(t=sr(t)),t}function K2(t){return t}function Y2(t){return[t,this.get(t)]}var q2,Un,fa,Z2;function qs(){return q2||(q2=new Bt(Ve([]),void 0,void 0,void 0,H2))}function Qr(t,e,n,r,i){if(t!=null){if(Array.isArray(t)){let s=0|t[v];return t.length===0&&1&s?void 0:i&&2&s?t:rr(t,e,n,r!==void 0,i)}return e(t,r)}}function rr(t,e,n,r,i){let s=r||n?0|t[v]:0,o=r?!!(32&s):void 0,a=0,h=(r=ht(t)).length;for(let _=0;_<h;_++){var c=r[_];if(_===h-1&&Jn(c)){var l=e,u=n,f=o,w=i;let E;for(let B in c){let H=Qr(c[B],l,u,f,w);H!=null&&((E!=null?E:E={})[B]=H)}c=E}else c=Qr(r[_],e,n,o,i);r[_]=c,c!=null&&(a=_+1)}return a<h&&(r.length=a),n&&((t=Ti(t))&&(r[Ue]=ht(t)),n(s,r)),r}function J2(t){return Qr(t,Fi,void 0,void 0,!1)}function Fi(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return Zr(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(ye(t))return ye(t)&&wi(ea),Bs(t);if(t.W===wn)return da(t);if(t instanceof $t){let e=t.g;return e==null?"":typeof e=="string"?e:t.g=Bs(e)}return t instanceof Bt?t.La():void 0}return t}function da(t){var e=t.u;t=rr(e,Fi,void 0,void 0,!1);var n=0|e[v];if((e=t.length)&&!(512&n)){var r=t[e-1],i=!1;Jn(r)?(e--,i=!0):r=void 0;var s=e-(n=512&n?0:-1),o=(Un!=null?Un:V2)(s,n,t,r);if(r&&(t[e]=void 0),s<o&&r){for(var a in s=!0,r){let h=+a;h<=o?(t[i=h+n]=r[a],e=Math.max(i+1,e),i=!1,delete r[a]):s=!1}s&&(r=void 0)}for(s=e-1;e>0;s=e-1)if((a=t[s])==null)e--,i=!0;else{if(!((s-=n)>=o))break;(r!=null?r:r={})[s]=a,e--,i=!0}i&&(t.length=e),r&&t.push(r)}return t}function se(t,e,n){return t=pa(t,e[0],e[1],n?1:2),e!==fa&&n&&qn(t,8192),t}function pa(t,e,n,r){if(t==null){var i=96;n?(t=[n],i|=512):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(8192&(i=0|t[v])||!(64&i)||2&i||wi(L2),1024&i)throw Error("farr");if(64&i)return t;if(r===1||r===2||(i|=64),n&&(i|=512,n!==t[0]))throw Error("mid");t:{var s=(n=t).length;if(s){var o=s-1;if(Jn(r=n[o])){if((o-=e=512&(i|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var a in r)(s=+a)<o&&(n[s+e]=r[a],delete r[a]);i=-16760833&i|(1023&o)<<14;break t}}if(e){if((a=Math.max(e,s-(512&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return W(t,i),t}function ti(t,e,n=qr){if(t!=null){if(qo&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=0|t[v];return 2&r?t:(e&&(e=r===0||!!(32&r)&&!(64&r||!(16&r))),e?(W(t,34|r),4&r&&Object.freeze(t),t):rr(t,ti,4&r?qr:n,!0,!0))}return t.W===wn?t=2&(r=0|(n=t.u)[v])?t:new t.constructor(ir(n,r,!0)):t instanceof Bt&&!(2&t.M)&&(n=Ve(t.da(ti)),t=new Bt(n,t.I,t.S,t.X)),t}}function ir(t,e,n){let r=n||2&e?qr:F2,i=!!(32&e);return t=function(s,o,a){let h=ht(s);var c=h.length;let l=256&o?h[c-1]:void 0;for(c+=l?-1:0,o=512&o?1:0;o<c;o++)h[o]=a(h[o]);if(l){o=h[o]={};for(let u in l)o[u]=a(l[u])}return(s=Ti(s))&&(h[Ue]=ht(s)),h}(t,e,s=>ti(s,i,r)),qn(t,32|(n?2:0)),t}function sr(t){let e=t.u,n=0|e[v];return 2&n?new t.constructor(ir(e,n,!1)):t}function De(t,e){return Zt(t=t.u,0|t[v],e)}function Zt(t,e,n){if(n===-1)return null;let r=n+(512&e?0:-1),i=t.length-1;return r>=i&&256&e?t[i][n]:r<=i?t[r]:void 0}function M(t,e,n){let r=t.u,i=0|r[v];return ue(i),O(r,i,e,n),t}function O(t,e,n,r){let i=512&e?0:-1,s=n+i;var o=t.length-1;return s>=o&&256&e?(t[o][n]=r,e):s<=o?(t[s]=r,e):(r!==void 0&&(n>=(o=e>>14&1023||536870912)?r!=null&&(t[o+i]={[n]:r},W(t,e|=256)):t[s]=r),e)}function Cn(t,e){let n=0|(t=t.u)[v],r=Zt(t,n,e),i=le(r);return i!=null&&i!==r&&O(t,n,e,i),i}function ga(t){let e=0|(t=t.u)[v],n=Zt(t,e,1),r=Ei(n,!0);return r!=null&&r!==n&&O(t,e,1,r),r}function ge(){return M2===void 0?2:4}function me(t,e,n,r,i){let s=t.u,o=2&(t=0|s[v])?1:r;i=!!i;let a=0|(r=Mi(s,t,e))[v];if(!(4&a)){4&a&&(r=ht(r),a=Kt(a,t),t=O(s,t,e,r));let h=0,c=0;for(;h<r.length;h++){let l=n(r[h]);l!=null&&(r[c++]=l)}c<h&&(r.length=c),a=Ri(a,t),n=-2049&(20|a),a=n&=-4097,W(r,a),2&a&&Object.freeze(r)}return o===1||o===4&&32&a?Wt(a)||(i=a,a|=2,a!==i&&W(r,a),Object.freeze(r)):(o===2&&Wt(a)&&(r=ht(r),a=Kt(a,t),a=oe(a,t,i),W(r,a),t=O(s,t,e,r)),Wt(a)||(e=a,a=oe(a,t,i),a!==e&&W(r,a))),r}function Mi(t,e,n){return t=Zt(t,e,n),Array.isArray(t)?t:_i}function Ri(t,e){return t===0&&(t=Kt(t,e)),1|t}function Wt(t){return!!(2&t)&&!!(4&t)||!!(1024&t)}function ma(t){t=ht(t);for(let e=0;e<t.length;e++){let n=t[e]=ht(t[e]);Array.isArray(n[1])&&(n[1]=Ve(n[1]))}return t}function ei(t,e,n,r){let i=0|(t=t.u)[v];ue(i),O(t,i,e,(r==="0"?Number(n)===0:n===r)?void 0:n)}function We(t,e,n,r){ue(e);let i=Mi(t,e,n),s=i!==_i;if(64&e||!(8192&e)||!s){let o=s?0|i[v]:0,a=o;(!s||2&a||Wt(a)||4&a&&!(32&a))&&(i=ht(i),a=Kt(a,e),e=O(t,e,n,i)),a=-13&Ri(a,e),a=oe(r?-17&a:16|a,e,!0),a!==o&&W(i,a)}return i}function Gr(t,e){var n=n1;return Ui(Ii(t=t.u),t,0|t[v],n)===e?e:-1}function Ii(t){var n;if(Yn)return(n=t[nn])!=null?n:t[nn]=new Map;if(nn in t)return t[nn];let e=new Map;return Object.defineProperty(t,nn,{value:e}),e}function va(t,e,n,r){let i=Ii(t),s=Ui(i,t,e,n);return s!==r&&(s&&(e=O(t,e,s)),i.set(n,r)),e}function Ui(t,e,n,r){let i=t.get(r);if(i!=null)return i;i=0;for(let s=0;s<r.length;s++){let o=r[s];Zt(e,n,o)!=null&&(i!==0&&(n=O(e,n,i)),i=o)}return t.set(r,i),i}function Ci(t,e,n){let r=0|t[v],i=Zt(t,r,n),s;if(i!=null&&i.W===wn)return(e=sr(i))!==i&&O(t,r,n,e),e.u;if(Array.isArray(i)){let o=0|i[v];s=2&o?se(ir(i,o,!1),e,!0):64&o?i:se(s,e,!0)}else s=se(void 0,e,!0);return s!==i&&O(t,r,n,s),s}function ya(t,e,n){let r=0|(t=t.u)[v],i=Zt(t,r,n);return(e=Li(i,e,!1,r))!==i&&e!=null&&O(t,r,n,e),e}function b(t,e,n){if((e=ya(t,e,n))==null)return e;let r=0|(t=t.u)[v];if(!(2&r)){let i=sr(e);i!==e&&O(t,r,n,e=i)}return e}function wa(t,e,n,r,i,s,o){t=t.u;var a=!!(2&e);let h=a?1:i;s=!!s,o&&(o=!a);var c=0|(i=Mi(t,e,r))[v];if(!(a=!!(4&c))){var l=i,u=e;let f=!!(2&(c=Ri(c,e)));f&&(u|=2);let w=!f,_=!0,E=0,B=0;for(;E<l.length;E++){let H=Li(l[E],n,!1,u);if(H instanceof n){if(!f){let st=!!(2&(0|H.u[v]));w&&(w=!st),_&&(_=st)}l[B++]=H}}B<E&&(l.length=B),c|=4,c=_?16|c:-17&c,W(l,c=w?8|c:-9&c),f&&Object.freeze(l)}if(o&&!(8&c||!i.length&&(h===1||h===4&&32&c))){for(Wt(c)&&(i=ht(i),c=Kt(c,e),e=O(t,e,r,i)),n=i,o=c,l=0;l<n.length;l++)(c=n[l])!==(u=sr(c))&&(n[l]=u);o|=8,W(n,o=n.length?-17&o:16|o),c=o}return h===1||h===4&&32&c?Wt(c)||(e=c,(c|=!i.length||16&c&&(!a||32&c)?2:1024)!==e&&W(i,c),Object.freeze(i)):(h===2&&Wt(c)&&(W(i=ht(i),c=oe(c=Kt(c,e),e,s)),e=O(t,e,r,i)),Wt(c)||(r=c,(c=oe(c,e,s))!==r&&W(i,c))),i}function Yt(t,e,n){let r=0|t.u[v];return wa(t,r,e,n,ge(),!1,!(2&r))}function y(t,e,n,r){return r==null&&(r=void 0),M(t,n,r)}function cn(t,e,n,r){r==null&&(r=void 0);t:{let i=0|(t=t.u)[v];if(ue(i),r==null){let s=Ii(t);if(Ui(s,t,i,n)!==e)break t;s.set(n,0)}else i=va(t,i,n,e);O(t,i,e,r)}}function Kt(t,e){return-1025&(t=32|(2&e?2|t:-3&t))}function oe(t,e,n){return 32&e&&n||(t&=-33),t}function or(t,e,n){ue(0|t.u[v]),me(t,e,Pe,2,!0).push(la(n))}function Vn(t,e,n,r){let i=0|t.u[v];ue(i),t=wa(t,i,n,e,2,!0),r=r!=null?r:new n,t.push(r),t[v]=2&(0|r.u[v])?-9&t[v]:-17&t[v]}function xt(t,e){return He(De(t,e))}function kt(t,e){return Pe(De(t,e))}function j(t,e){var n;return(n=Cn(t,e))!=null?n:0}function mn(t,e,n){if(n!=null&&typeof n!="boolean")throw t=typeof n,Error(`Expected boolean but got ${t!="object"?t:n?Array.isArray(n)?"array":t:"null"}: ${n}`);M(t,e,n)}function Nt(t,e,n){if(n!=null){if(typeof n!="number"||!nr(n))throw Yr("int32");n|=0}M(t,e,n)}function g(t,e,n){if(n!=null&&typeof n!="number")throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);M(t,e,n)}function Hn(t,e,n){{let o=t.u,a=0|o[v];if(ue(a),n==null)O(o,a,e);else{var r=t=0|n[v],i=Wt(t),s=i||Object.isFrozen(n);for(i||(t=0),s||(n=ht(n),r=0,t=oe(t=Kt(t,a),a,!0),s=!1),t|=21,i=0;i<n.length;i++){let h=n[i],c=la(h);Object.is(h,c)||(s&&(n=ht(n),r=0,t=oe(t=Kt(t,a),a,!0),s=!1),n[i]=c)}t!==r&&(s&&(n=ht(n),t=oe(t=Kt(t,a),a,!0)),W(n,t)),O(o,a,e,n)}}}function _a(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function Pi(){return Error("Failed to read varint, encoding is invalid.")}function Ea(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function Di(t){if(typeof t=="string")return{buffer:Jo(t),O:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),O:!1};if(t.constructor===Uint8Array)return{buffer:t,O:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),O:!1};if(t.constructor===$t)return{buffer:yi(t)||new Uint8Array(0),O:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function Oi(t,e){let n,r=0,i=0,s=0,o=t.h,a=t.g;do n=o[a++],r|=(127&n)<<s,s+=7;while(s<32&&128&n);for(s>32&&(i|=(127&n)>>4),s=3;s<32&&128&n;s+=7)n=o[a++],i|=(127&n)<<s;if(ve(t,a),n<128)return e(r>>>0,i>>>0);throw Pi()}function Bi(t){let e=0,n=t.g,r=n+10,i=t.h;for(;n<r;){let s=i[n++];if(e|=s,(128&s)==0)return ve(t,n),!!(127&e)}throw Pi()}function ae(t){let e=t.h,n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw Pi();return ve(t,n),i}function qt(t){return ae(t)>>>0}function ni(t){var e=t.h;let n=t.g,r=e[n],i=e[n+1],s=e[n+2];return e=e[n+3],ve(t,t.g+4),(r<<0|i<<8|s<<16|e<<24)>>>0}function ri(t){var e=ni(t);t=2*(e>>31)+1;let n=e>>>23&255;return e&=8388607,n==255?e?NaN:t*(1/0):n==0?1401298464324817e-60*t*e:t*Math.pow(2,n-150)*(e+8388608)}function Q2(t){return ae(t)}function zr(t,e,{aa:n=!1}={}){t.aa=n,e&&(e=Di(e),t.h=e.buffer,t.m=e.O,t.j=0,t.l=t.h.length,t.g=t.j)}function ve(t,e){if(t.g=e,e>t.l)throw Ea(t.l,e)}function Ta(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);let n=t.g,r=n+e;if(r>t.l)throw Ea(e,t.l-n);return t.g=r,n}function Aa(t,e){if(e==0)return we();var n=Ta(t,e);return t.aa&&t.m?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?new Uint8Array(0):O2?t.slice(n,e):new Uint8Array(t.subarray(n,e))),n.length==0?we():new $t(n,Ie)}Bt.prototype.toJSON=void 0;var Zs=[];function ba(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var n=qt(t.g);if(e=n>>>3,!((n&=7)>=0&&n<=5))throw _a(n,t.l);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=n,!0}function Pn(t){switch(t.h){case 0:t.h!=0?Pn(t):Bi(t.g);break;case 1:ve(t=t.g,t.g+8);break;case 2:if(t.h!=2)Pn(t);else{var e=qt(t.g);ve(t=t.g,t.g+e)}break;case 5:ve(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!ba(t))throw Error("Unmatched start-group tag: stream EOF");if(t.h==4){if(t.m!=e)throw Error("Unmatched end-group tag");break}Pn(t)}break;default:throw _a(t.h,t.l)}}function _n(t,e,n){let r=t.g.l,i=qt(t.g),s=t.g.g+i,o=s-r;if(o<=0&&(t.g.l=s,n(e,t,void 0,void 0,void 0),o=s-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=s,t.g.l=r,e}function Ni(t){var e=qt(t.g),n=Ta(t=t.g,e);if(t=t.h,w2){var r,i=t;(r=Pr)||(r=Pr=new TextDecoder("utf-8",{fatal:!0})),e=n+e,i=n===0&&e===i.length?i:i.subarray(n,e);try{var s=r.decode(i)}catch(a){if(kn===void 0){try{r.decode(new Uint8Array([128]))}catch(h){}try{r.decode(new Uint8Array([97])),kn=!0}catch(h){kn=!1}}throw!kn&&(Pr=void 0),a}}else{e=(s=n)+e,n=[];let a,h=null;for(;s<e;){var o=t[s++];o<128?n.push(o):o<224?s>=e?pe():(a=t[s++],o<194||(192&a)!=128?(s--,pe()):n.push((31&o)<<6|63&a)):o<240?s>=e-1?pe():(a=t[s++],(192&a)!=128||o===224&&a<160||o===237&&a>=160||(192&(r=t[s++]))!=128?(s--,pe()):n.push((15&o)<<12|(63&a)<<6|63&r)):o<=244?s>=e-2?pe():(a=t[s++],(192&a)!=128||a-144+(o<<28)>>30!=0||(192&(r=t[s++]))!=128||(192&(i=t[s++]))!=128?(s--,pe()):(o=(7&o)<<18|(63&a)<<12|(63&r)<<6|63&i,o-=65536,n.push(55296+(o>>10&1023),56320+(1023&o)))):pe(),n.length>=8192&&(h=Ps(h,n),n.length=0)}s=Ps(h,n)}return s}function xa(t){let e=qt(t.g);return Aa(t.g,e)}function ar(t,e,n){var r=qt(t.g);for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var Fn=[];function Mt(t,e,n){e.g?e.m(t,e.g,e.h,n):e.m(t,e.h,n)}var p=class{constructor(t,e){this.u=pa(t,e)}toJSON(){try{var t=da(this)}finally{Un=void 0}return t}l(){var t=Ch;return t.g?t.l(this,t.g,t.h):t.l(this,t.h,t.defaultValue)}clone(){let t=this.u;return new this.constructor(ir(t,0|t[v],!1))}O(){return!!(2&(0|this.u[v]))}};function Js(t){return t?/^\d+$/.test(t)?(er(t),new ii(F,G)):null:th||(th=new ii(0,0))}p.prototype.W=wn,p.prototype.toString=function(){return this.u.toString()};var ii=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}},th;function Qs(t){return t?/^-?\d+$/.test(t)?(er(t),new si(F,G)):null:eh||(eh=new si(0,0))}var si=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}},eh;function Le(t,e,n){for(;n>0||e>127;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function $e(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function hr(t,e){if(e>=0)$e(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function vn(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Oe(t,e){e.length!==0&&(t.l.push(e),t.h+=e.length)}function vt(t,e,n){$e(t.g,8*e+n)}function Gi(t,e){return vt(t,e,2),e=t.g.end(),Oe(t,e),e.push(t.h),e}function zi(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function cr(t,e,n){vt(t,e,2),$e(t.g,n.length),Oe(t,t.g.end()),Oe(t,n)}function Xn(t,e,n,r){n!=null&&(e=Gi(t,e),r(n,t),zi(t,e))}function Rt(){let t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var ji=Rt(),ka=Rt(),Vi=Rt(),Hi=Rt(),Sa=Rt(),La=Rt(),Xi=Rt(),Fa=Rt(),Ma=Rt(),Ke=class{constructor(t,e,n){this.g=t,this.h=e,t=ji,this.l=!!t&&n===t||!1}};function ur(t,e){return new Ke(t,e,ji)}function Ra(t,e,n,r,i){Xn(t,n,Ua(e,r),i)}var nh=ur(function(t,e,n,r,i){return t.h===2&&(_n(t,Ci(e,r,n),i),!0)},Ra),rh=ur(function(t,e,n,r,i){return t.h===2&&(_n(t,Ci(e,r,n),i),!0)},Ra),lr=Symbol(),Wi=Symbol(),to=Symbol(),eo=Symbol(),Dn,On;function Ee(t,e,n,r){var i=r[t];if(i)return i;(i={}).Ma=r,i.T=function(u){switch(typeof u){case"boolean":return fa||(fa=[0,void 0,!0]);case"number":return u>0?void 0:u===0?Z2||(Z2=[0,void 0]):[-u,void 0];case"string":return[0,u];case"object":return u}}(r[0]);var s=r[1];let o=1;s&&s.constructor===Object&&(i.ga=s,typeof(s=r[++o])=="function"&&(i.la=!0,Dn!=null||(Dn=s),On!=null||(On=r[o+1]),s=r[o+=2]));let a={};for(;s&&Array.isArray(s)&&s.length&&typeof s[0]=="number"&&s[0]>0;){for(var h=0;h<s.length;h++)a[s[h]]=s;s=r[++o]}for(h=1;s!==void 0;){let u;typeof s=="number"&&(h+=s,s=r[++o]);var c=void 0;if(s instanceof Ke?u=s:(u=nh,o--),u==null?void 0:u.l){s=r[++o],c=r;var l=o;typeof s=="function"&&(s=s(),c[l]=s),c=s}for(l=h+1,typeof(s=r[++o])=="number"&&s<0&&(l-=s,s=r[++o]);h<l;h++){let f=a[h];c?n(i,h,u,c,f):e(i,h,u,f)}}return r[t]=i}function Ia(t){return Array.isArray(t)?t[0]instanceof Ke?t:[rh,t]:[t,void 0]}function Ua(t,e){return t instanceof p?t.u:Array.isArray(t)?se(t,e,!1):void 0}function $i(t,e,n,r){let i=n.g;t[e]=r?(s,o,a)=>i(s,o,a,r):i}function Ki(t,e,n,r,i){let s=n.g,o,a;t[e]=(h,c,l)=>s(h,c,l,a||(a=Ee(Wi,$i,Ki,r).T),o||(o=Yi(r)),i)}function Yi(t){let e=t[to];if(e!=null)return e;let n=Ee(Wi,$i,Ki,t);return e=n.la?(r,i)=>Dn(r,i,n):(r,i)=>{let s=0|r[v];for(;ba(i)&&i.h!=4;){var o=i.m,a=n[o];if(a==null){var h=n.ga;h&&(h=h[o])&&(h=ih(h))!=null&&(a=n[o]=h)}a!=null&&a(i,r,o)||(o=(a=i).l,Pn(a),a.fa?a=void 0:(h=a.g.g-o,a.g.g=o,a=Aa(a.g,h)),o=r,a&&((h=o[Ue])?h.push(a):o[Ue]=[a]))}return 8192&s&&Ve(r),!0},t[to]=e}function ih(t){let e=(t=Ia(t))[0].g;if(t=t[1]){let n=Yi(t),r=Ee(Wi,$i,Ki,t).T;return(i,s,o)=>e(i,s,o,r,n)}return e}function fr(t,e,n){t[e]=n.h}function dr(t,e,n,r){let i,s,o=n.h;t[e]=(a,h,c)=>o(a,h,c,s||(s=Ee(lr,fr,dr,r).T),i||(i=Ca(r)))}function Ca(t){let e=t[eo];if(!e){let n=Ee(lr,fr,dr,t);e=(r,i)=>Pa(r,i,n),t[eo]=e}return e}function Pa(t,e,n){(function(r,i,s){let o=512&i?0:-1,a=r.length,h=a+((i=64&i?256&i:!!a&&Jn(r[a-1]))?-1:0);for(let c=0;c<h;c++)s(c-o,r[c]);if(i){r=r[a-1];for(let c in r)!isNaN(c)&&s(+c,r[c])}})(t,0|t[v]|(n.T[1]?512:0),(r,i)=>{if(i!=null){var s=function(o,a){var h=o[a];if(h)return h;if((h=o.ga)&&(h=h[a])){var c=(h=Ia(h))[0].h;if(h=h[1]){let l=Ca(h),u=Ee(lr,fr,dr,h).T;h=o.la?On(u,l):(f,w,_)=>c(f,w,_,u,l)}else h=c;return o[a]=h}}(n,r);s&&s(e,i,r)}}),(t=Ti(t))&&function(r,i){Oe(r,r.g.end());for(let s=0;s<i.length;s++)Oe(r,yi(i[s])||new Uint8Array(0))}(e,t)}function Ye(t,e){if(Array.isArray(e)){var n=0|e[v];if(4&n)return e;for(var r=0,i=0;r<e.length;r++){let s=t(e[r]);s!=null&&(e[i++]=s)}return i<r&&(e.length=i),W(e,-6145&(5|n)),2&n&&Object.freeze(e),e}}function nt(t,e,n){return new Ke(t,e,n)}function qe(t,e,n){return new Ke(t,e,n)}function rt(t,e,n){O(t,0|t[v],e,n)}var sh=ur(function(t,e,n,r,i){return t.h===2&&(t=_n(t,se([void 0,void 0],r,!0),i),ue(r=0|e[v]),(i=Zt(e,r,n))instanceof Bt?(2&i.M)!=0?((i=i.da()).push(t),O(e,r,n,i)):i.Ja(t):Array.isArray(i)?(2&(0|i[v])&&O(e,r,n,i=ma(i)),i.push(t)):O(e,r,n,[t]),!0)},function(t,e,n,r,i){if(e instanceof Bt)e.forEach((s,o)=>{Xn(t,n,se([o,s],r,!1),i)});else if(Array.isArray(e))for(let s=0;s<e.length;s++){let o=e[s];Array.isArray(o)&&Xn(t,n,se(o,r,!1),i)}});function Da(t,e,n){if(e=function(r){if(r==null)return r;let i=typeof r;if(i==="bigint")return String(pn(64,r));if(gn(r)){if(i==="string")return ua(r);if(i==="number")return Si(r)}}(e),e!=null&&(typeof e=="string"&&Qs(e),e!=null))switch(vt(t,n,0),typeof e){case"number":t=t.g,_e(e),Le(t,F,G);break;case"bigint":n=BigInt.asUintN(64,e),n=new si(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Le(t.g,n.h,n.g);break;default:n=Qs(e),Le(t.g,n.h,n.g)}}function Oa(t,e,n){(e=He(e))!=null&&e!=null&&(vt(t,n,0),hr(t.g,e))}function Ba(t,e,n){(e=oa(e))!=null&&(vt(t,n,0),t.g.g.push(e?1:0))}function Na(t,e,n){(e=Pe(e))!=null&&cr(t,n,$o(e))}function Ga(t,e,n,r,i){Xn(t,n,Ua(e,r),i)}function za(t,e,n){e==null||typeof e=="string"||e instanceof $t||(ye(e)?ye(e)&&wi(ea):e=void 0),e!=null&&cr(t,n,Di(e).buffer)}function ja(t,e,n){return(t.h===5||t.h===2)&&(e=We(e,0|e[v],n,!1),t.h==2?ar(t,ri,e):e.push(ri(t.g)),!0)}var Vt=nt(function(t,e,n){if(t.h!==1)return!1;var r=t.g;t=ni(r);let i=ni(r);r=2*(i>>31)+1;let s=i>>>20&2047;return t=4294967296*(1048575&i)+t,rt(e,n,s==2047?t?NaN:r*(1/0):s==0?5e-324*r*t:r*Math.pow(2,s-1075)*(t+4503599627370496)),!0},function(t,e,n){(e=le(e))!=null&&(vt(t,n,1),t=t.g,(n=ia||(ia=new DataView(new ArrayBuffer(8)))).setFloat64(0,+e,!0),F=n.getUint32(0,!0),G=n.getUint32(4,!0),vn(t,F),vn(t,G))},Rt()),$=nt(function(t,e,n){return t.h===5&&(rt(e,n,ri(t.g)),!0)},function(t,e,n){(e=le(e))!=null&&(vt(t,n,5),t=t.g,Ai(e),vn(t,F))},Xi),oh=qe(ja,function(t,e,n){if((e=Ye(le,e))!=null)for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];s!=null&&(vt(r,i,5),r=r.g,Ai(s),vn(r,F))}},Xi),qi=qe(ja,function(t,e,n){if((e=Ye(le,e))!=null&&e.length){vt(t,n,2),$e(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Ai(e[r]),vn(n,F)}},Xi),he=nt(function(t,e,n){return t.h===0&&(rt(e,n,Oi(t.g,xi)),!0)},Da,La),jr=nt(function(t,e,n){return t.h===0&&(rt(e,n,(t=Oi(t.g,xi))===0?void 0:t),!0)},Da,La),ah=nt(function(t,e,n){return t.h===0&&(rt(e,n,Oi(t.g,bi)),!0)},function(t,e,n){if((e=z2(e))!=null&&(typeof e=="string"&&Js(e),e!=null))switch(vt(t,n,0),typeof e){case"number":t=t.g,_e(e),Le(t,F,G);break;case"bigint":n=BigInt.asUintN(64,e),n=new ii(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Le(t.g,n.h,n.g);break;default:n=Js(e),Le(t.g,n.h,n.g)}},Rt()),z=nt(function(t,e,n){return t.h===0&&(rt(e,n,ae(t.g)),!0)},Oa,Hi),pr=qe(function(t,e,n){return(t.h===0||t.h===2)&&(e=We(e,0|e[v],n,!1),t.h==2?ar(t,ae,e):e.push(ae(t.g)),!0)},function(t,e,n){if((e=Ye(He,e))!=null&&e.length){n=Gi(t,n);for(let r=0;r<e.length;r++)hr(t.g,e[r]);zi(t,n)}},Hi),Se=nt(function(t,e,n){return t.h===0&&(rt(e,n,(t=ae(t.g))===0?void 0:t),!0)},Oa,Hi),P=nt(function(t,e,n){return t.h===0&&(rt(e,n,Bi(t.g)),!0)},Ba,ka),Fe=nt(function(t,e,n){return t.h===0&&(rt(e,n,(t=Bi(t.g))===!1?void 0:t),!0)},Ba,ka),Q=qe(function(t,e,n){return t.h===2&&(t=Ni(t),We(e,0|e[v],n,!1).push(t),!0)},function(t,e,n){if((e=Ye(Pe,e))!=null)for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];s!=null&&cr(r,i,$o(s))}},Vi),ne=nt(function(t,e,n){return t.h===2&&(rt(e,n,(t=Ni(t))===""?void 0:t),!0)},Na,Vi),L=nt(function(t,e,n){return t.h===2&&(rt(e,n,Ni(t)),!0)},Na,Vi),q=function(t,e,n=ji){return new Ke(t,e,n)}(function(t,e,n,r,i){return t.h===2&&(r=se(void 0,r,!0),We(e,0|e[v],n,!0).push(r),_n(t,r,i),!0)},function(t,e,n,r,i){if(Array.isArray(e))for(let s=0;s<e.length;s++)Ga(t,e[s],n,r,i)}),S=ur(function(t,e,n,r,i,s){return t.h===2&&(va(e,0|e[v],s,n),_n(t,e=Ci(e,r,n),i),!0)},Ga),Va=nt(function(t,e,n){return t.h===2&&(rt(e,n,xa(t)),!0)},za,Fa),hh=qe(function(t,e,n){return(t.h===0||t.h===2)&&(e=We(e,0|e[v],n,!1),t.h==2?ar(t,qt,e):e.push(qt(t.g)),!0)},function(t,e,n){if((e=Ye(aa,e))!=null)for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];s!=null&&(vt(r,i,0),$e(r.g,s))}},Sa),ch=nt(function(t,e,n){return t.h===0&&(rt(e,n,(t=qt(t.g))===0?void 0:t),!0)},function(t,e,n){(e=aa(e))!=null&&e!=null&&(vt(t,n,0),$e(t.g,e))},Sa),gt=nt(function(t,e,n){return t.h===0&&(rt(e,n,ae(t.g)),!0)},function(t,e,n){(e=He(e))!=null&&(e=parseInt(e,10),vt(t,n,0),hr(t.g,e))},Ma),oi=class{constructor(e,n){this.h=e,this.g=n,this.l=b,this.m=y,this.defaultValue=void 0}register(){Kn(this)}};function It(t,e){return new oi(t,e)}function fe(t,e){return(n,r)=>{if(Fn.length){let s=Fn.pop();s.o(r),zr(s.g,n,r),n=s}else n=new class{constructor(s,o){if(Zs.length){let a=Zs.pop();zr(a,s,o),s=a}else s=new class{constructor(a,h){this.h=null,this.m=!1,this.g=this.l=this.j=0,zr(this,a,h)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(s,o);this.g=s,this.l=this.g.g,this.h=this.m=-1,this.o(o)}o({fa:s=!1}={}){this.fa=s}}(n,r);try{let s=new t,o=s.u;Yi(e)(o,n);var i=s}finally{n.g.clear(),n.m=-1,n.h=-1,Fn.length<100&&Fn.push(n)}return i}}function gr(t){return function(){let e=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}}}};Pa(this.u,e,Ee(lr,fr,dr,t)),Oe(e,e.g.end());let n=new Uint8Array(e.h),r=e.l,i=r.length,s=0;for(let o=0;o<i;o++){let a=r[o];n.set(a,s),s+=a.length}return e.l=[n],n}}var no=class extends p{constructor(t){super(t)}},ro=[0,ne,nt(function(t,e,n){return t.h===2&&(rt(e,n,(t=xa(t))===we()?void 0:t),!0)},function(t,e,n){if(e!=null){if(e instanceof p){let r=e.Oa;return void(r&&(e=r(e),e!=null&&cr(t,n,Di(e).buffer)))}if(Array.isArray(e))return}za(t,e,n)},Fa)],Vr,io=globalThis.trustedTypes;function so(t){Vr===void 0&&(Vr=function(){let n=null;if(!io)return n;try{let r=i=>i;n=io.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch(r){}return n}());var e=Vr;return new class{constructor(n){this.g=n}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function uh(t,...e){if(e.length===0)return so(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return so(n)}var Ha=[0,z,gt,P,-1,pr,gt,-1],lh=class extends p{constructor(t){super(t)}},Xa=[0,P,L,P,gt,-1,qe(function(t,e,n){return(t.h===0||t.h===2)&&(e=We(e,0|e[v],n,!1),t.h==2?ar(t,Q2,e):e.push(ae(t.g)),!0)},function(t,e,n){if((e=Ye(He,e))!=null&&e.length){n=Gi(t,n);for(let r=0;r<e.length;r++)hr(t.g,e[r]);zi(t,n)}},Ma),L,-1,[0,P,-1],gt,P,-1],Wa=[0,L,-2],oo=class extends p{constructor(t){super(t)}},$a=[0],Ka=[0,z,P,1,P,-3],mt=class extends p{constructor(t){super(t,2)}},K={};K[336783863]=[0,L,P,-1,z,[0,[1,2,3,4,5,6,7,8,9],S,$a,S,Xa,S,Wa,S,Ka,S,Ha,S,[0,L,-2],S,[0,L,gt],S,[0,gt,L,-1],S,[0,gt,-1]],[0,L],P,[0,[1,3],[2,4],S,[0,pr],-1,S,[0,Q],-1,q,[0,L,-1]],L];var ao=[0,jr,-1,Fe,-3,jr,pr,ne,Se,jr,-1,Fe,Se,Fe,-2,ne];function yt(t,e){ei(t,2,Xe(e),"")}function R(t,e){or(t,3,e)}function A(t,e){or(t,4,e)}var et=class extends p{constructor(t){super(t,500)}o(t){return y(this,0,7,t)}},un=[-1,{}],ho=[0,L,1,un],co=[0,L,Q,un];function wt(t,e){Vn(t,1,et,e)}function I(t,e){or(t,10,e)}function x(t,e){or(t,15,e)}var ut=class extends p{constructor(t){super(t,500)}o(t){return y(this,0,1001,t)}},Ya=[-500,q,[-500,ne,-1,Q,-3,[-2,K,P],q,ro,Se,-1,ho,co,q,[0,ne,Fe],ne,ao,Se,Q,987,Q],4,q,[-500,L,-1,[-1,{}],998,L],q,[-500,L,Q,-1,[-2,{},P],997,Q,-1],Se,q,[-500,L,Q,un,998,Q],Q,Se,ho,co,q,[0,ne,-1,un],Q,-2,ao,ne,-1,Fe,[0,Fe,ch],978,un,q,ro];ut.prototype.g=gr(Ya);var fh=fe(ut,Ya),dh=class extends p{constructor(t){super(t)}},qa=class extends p{constructor(t){super(t)}g(){return Yt(this,dh,1)}},Za=[0,q,[0,z,$,L,-1]],mr=fe(qa,Za),ph=class extends p{constructor(t){super(t)}},gh=class extends p{constructor(t){super(t)}},Hr=class extends p{constructor(t){super(t)}h(){return b(this,ph,2)}g(){return Yt(this,gh,5)}},Ja=fe(class extends p{constructor(t){super(t)}},[0,Q,pr,qi,[0,gt,[0,z,-3],[0,$,-3],[0,z,-1,[0,q,[0,z,-2]]],q,[0,$,-1,L,$]],L,-1,he,q,[0,z,$],Q,he]),Qa=class extends p{constructor(t){super(t)}},Me=fe(class extends p{constructor(t){super(t)}},[0,q,[0,$,-4]]),t1=class extends p{constructor(t){super(t)}},En=fe(class extends p{constructor(t){super(t)}},[0,q,[0,$,-4]]),mh=class extends p{constructor(t){super(t)}},vh=[0,z,-1,qi,gt],e1=class extends p{constructor(t){super(t)}};e1.prototype.g=gr([0,$,-4,he]);var yh=class extends p{constructor(t){super(t)}},wh=fe(class extends p{constructor(t){super(t)}},[0,q,[0,1,z,L,Za],he]),uo=class extends p{constructor(t){super(t)}},_h=class extends p{constructor(t){super(t)}ma(){let t=ga(this);return t==null?we():t}},Eh=class extends p{constructor(t){super(t)}},n1=[1,2],Th=fe(class extends p{constructor(t){super(t)}},[0,q,[0,n1,S,[0,qi],S,[0,Va],z,L],he]),Zi=class extends p{constructor(t){super(t)}},r1=[0,L,z,$,Q,-1],lo=class extends p{constructor(t){super(t)}},Ah=[0,P,-1],fo=class extends p{constructor(t){super(t)}},Bn=[1,2,3,4,5],Wn=class extends p{constructor(t){super(t)}g(){return ga(this)!=null}h(){return kt(this,2)!=null}},D=class extends p{constructor(t){super(t)}g(){var t;return(t=oa(De(this,2)))!=null?t:!1}},i1=[0,Va,L,[0,z,he,-1],[0,ah,he]],V=[0,i1,P,[0,Bn,S,Ka,S,Xa,S,Ha,S,$a,S,Wa],gt],vr=class extends p{constructor(t){super(t)}},Ji=[0,V,$,-1,z],bh=It(502141897,vr);K[502141897]=Ji;var xh=fe(class extends p{constructor(t){super(t)}},[0,[0,gt,-1,oh,hh],vh]),s1=class extends p{constructor(t){super(t)}},o1=class extends p{constructor(t){super(t)}},Qi=[0,V,$,[0,V],P],a1=[0,V,Ji,Qi,$,[0,[0,i1]]],kh=It(508968150,o1);K[508968150]=a1,K[508968149]=Qi;var h1=class extends p{constructor(t){super(t)}},Sh=It(513916220,h1);K[513916220]=[0,V,a1,z];var xe=class extends p{constructor(t){super(t)}h(){return b(this,Zi,2)}g(){M(this,2)}},c1=[0,V,r1];K[478825465]=c1;var Lh=class extends p{constructor(t){super(t)}},u1=class extends p{constructor(t){super(t)}},ts=class extends p{constructor(t){super(t)}},es=class extends p{constructor(t){super(t)}},l1=class extends p{constructor(t){super(t)}},po=[0,V,[0,V],c1,-1],f1=[0,V,$,z],ns=[0,V,$],d1=[0,V,f1,ns,$],Fh=It(479097054,l1);K[479097054]=[0,V,d1,po],K[463370452]=po,K[464864288]=f1;var Mh=It(462713202,es);K[462713202]=d1,K[474472470]=ns;var Rh=class extends p{constructor(t){super(t)}},p1=class extends p{constructor(t){super(t)}},g1=class extends p{constructor(t){super(t)}},m1=class extends p{constructor(t){super(t)}},rs=[0,V,$,-1,z],ai=[0,V,$,P];m1.prototype.g=gr([0,V,ns,[0,V],Ji,Qi,rs,ai]);var v1=class extends p{constructor(t){super(t)}},Ih=It(456383383,v1);K[456383383]=[0,V,r1];var y1=class extends p{constructor(t){super(t)}},Uh=It(476348187,y1);K[476348187]=[0,V,Ah];var w1=class extends p{constructor(t){super(t)}},go=class extends p{constructor(t){super(t)}},_1=[0,gt,-1],Ch=It(458105876,class extends p{constructor(t){super(t)}g(){var t=this.u;let e=0|t[v],n=2&e;return t=function(r,i,s){var o=go;let a=2&i,h=!1;if(s==null){if(a)return qs();s=[]}else if(s.constructor===Bt){if((2&s.M)==0||a)return s;s=s.da()}else Array.isArray(s)?h=!!(2&(0|s[v])):s=[];if(a){if(!s.length)return qs();h||(h=!0,Ve(s))}else h&&(h=!1,s=ma(s));return h||(64&(0|s[v])?s[v]&=-33:32&i&&qn(s,32)),O(r,i,2,o=new Bt(s,o,j2,void 0)),o}(t,e,Zt(t,e,2)),!n&&go&&(t.pa=!0),t}});K[458105876]=[0,_1,sh,[!0,he,[0,L,-1,Q]]];var is=class extends p{constructor(t){super(t)}},E1=It(458105758,is);K[458105758]=[0,V,L,_1];var T1=class extends p{constructor(t){super(t)}},Ph=It(443442058,T1);K[443442058]=[0,V,L,z,$,Q,-1,P,$],K[514774813]=rs;var A1=class extends p{constructor(t){super(t)}},Dh=It(516587230,A1);function hi(t,e){return e=e?e.clone():new Zi,t.displayNamesLocale!==void 0?M(e,1,Xe(t.displayNamesLocale)):t.displayNamesLocale===void 0&&M(e,1),t.maxResults!==void 0?Nt(e,2,t.maxResults):"maxResults"in t&&M(e,2),t.scoreThreshold!==void 0?g(e,3,t.scoreThreshold):"scoreThreshold"in t&&M(e,3),t.categoryAllowlist!==void 0?Hn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&M(e,4),t.categoryDenylist!==void 0?Hn(e,5,t.categoryDenylist):"categoryDenylist"in t&&M(e,5),e}function ss(t,e=-1,n=""){return{categories:t.map(r=>{var i,s,o,a,h,c,l;return{index:(s=(i=xt(r,1))!=null?i:0)!=null?s:-1,score:(o=j(r,2))!=null?o:0,categoryName:(h=(a=kt(r,3))!=null?a:"")!=null?h:"",displayName:(l=(c=kt(r,4))!=null?c:"")!=null?l:""}}),headIndex:e,headName:n}}function b1(t){var o,a,h,c,l,u,f,w,_,E,B,H,st;var e=me(t,3,le,ge()),n=me(t,2,He,ge()),r=me(t,1,Pe,ge()),i=me(t,9,Pe,ge());let s={categories:[],keypoints:[]};for(let U=0;U<e.length;U++)s.categories.push({score:e[U],index:(o=n[U])!=null?o:-1,categoryName:(a=r[U])!=null?a:"",displayName:(h=i[U])!=null?h:""});if((e=(c=b(t,Hr,4))==null?void 0:c.h())&&(s.boundingBox={originX:(l=xt(e,1))!=null?l:0,originY:(u=xt(e,2))!=null?u:0,width:(f=xt(e,3))!=null?f:0,height:(w=xt(e,4))!=null?w:0,angle:0}),(_=b(t,Hr,4))==null?void 0:_.g().length)for(let U of b(t,Hr,4).g())s.keypoints.push({x:(E=Cn(U,1))!=null?E:0,y:(B=Cn(U,2))!=null?B:0,score:(H=Cn(U,4))!=null?H:0,label:(st=kt(U,3))!=null?st:""});return s}function yr(t){var n,r,i,s;let e=[];for(let o of Yt(t,t1,1))e.push({x:(n=j(o,1))!=null?n:0,y:(r=j(o,2))!=null?r:0,z:(i=j(o,3))!=null?i:0,visibility:(s=j(o,4))!=null?s:0});return e}function ln(t){var n,r,i,s;let e=[];for(let o of Yt(t,Qa,1))e.push({x:(n=j(o,1))!=null?n:0,y:(r=j(o,2))!=null?r:0,z:(i=j(o,3))!=null?i:0,visibility:(s=j(o,4))!=null?s:0});return e}function mo(t){return Array.from(t,e=>e>127?e-256:e)}function vo(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let s=0;s<t.length;s++)n+=t[s]*e[s],r+=t[s]*t[s],i+=e[s]*e[s];if(r<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}var Mn;K[516587230]=[0,V,rs,ai,$],K[518928384]=ai;var Oh=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]);function x1(){return X(this,null,function*(){if(Mn===void 0)try{yield WebAssembly.instantiate(Oh),Mn=!0}catch(t){Mn=!1}return Mn})}function rn(n){return X(this,arguments,function*(t,e=uh``){let r=(yield x1())?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${r}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`}})}var Ht=class{};function k1(){var t=navigator;return typeof OffscreenCanvas!="undefined"&&(!function(e=navigator){return(e=e.userAgent).includes("Safari")&&!e.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}function yo(t){return X(this,null,function*(){if(typeof importScripts!="function"){let e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((n,r)=>{e.addEventListener("load",()=>{n()},!1),e.addEventListener("error",i=>{r(i)},!1),document.body.appendChild(e)})}importScripts(t.toString())})}function S1(t){return t.videoWidth!==void 0?[t.videoWidth,t.videoHeight]:t.naturalWidth!==void 0?[t.naturalWidth,t.naturalHeight]:t.displayWidth!==void 0?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function m(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function wo(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);let[r,i]=S1(e);return!t.l||r===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=r,t.i.canvas.height=i),[r,i]}function _o(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");let r=new Uint32Array(e.length);for(let i=0;i<e.length;i++)r[i]=t.i.stringToNewUTF8(e[i]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(let i of r)t.i._free(i);t.i._free(e)}function Ct(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function te(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(i,s,o)=>{s?(n(r,o),r=[]):r.push(i)}}Ht.forVisionTasks=function(t){return rn("vision",t)},Ht.forTextTasks=function(t){return rn("text",t)},Ht.forGenAiExperimentalTasks=function(t){return rn("genai_experimental",t)},Ht.forGenAiTasks=function(t){return rn("genai",t)},Ht.forAudioTasks=function(t){return rn("audio",t)},Ht.isSimdSupported=function(){return x1()};function Bh(t,e,n,r){return X(this,null,function*(){return t=yield((i,s,o,a,h)=>X(this,null,function*(){if(s&&(yield yo(s)),!self.ModuleFactory||o&&(yield yo(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&h&&((s=self.Module).locateFile=h.locateFile,h.mainScriptUrlOrBlob&&(s.mainScriptUrlOrBlob=h.mainScriptUrlOrBlob)),h=yield self.ModuleFactory(self.Module||h),self.ModuleFactory=self.Module=void 0,new i(h,a)}))(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:i=>i.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&i.endsWith(".data")?n.assetBinaryPath.toString():i}),yield t.o(r),t})}function Xr(t,e){let n=b(t.baseOptions,Wn,1)||new Wn;typeof e=="string"?(M(n,2,Xe(e)),M(n,1)):e instanceof Uint8Array&&(M(n,1,Ei(e,!1)),M(n,2)),y(t.baseOptions,0,1,n)}function Eo(t){try{let e=t.G.length;if(e===1)throw Error(t.G[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.G.map(n=>n.message).join(", "))}finally{t.G=[]}}function d(t,e){t.B=Math.max(t.B,e)}function wr(t,e){t.A=new et,yt(t.A,"PassThroughCalculator"),R(t.A,"free_memory"),A(t.A,"free_memory_unused_out"),I(e,"free_memory"),wt(e,t.A)}function Be(t,e){R(t.A,e),A(t.A,e+"_unused_out")}function _r(t){t.g.addBoolToStream(!0,"free_memory",t.B)}var ci=class{constructor(t){this.g=t,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){var n,r,i,s,o,a;if(e){let h=t.baseOptions||{};if((n=t.baseOptions)!=null&&n.modelAssetBuffer&&((r=t.baseOptions)!=null&&r.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((i=b(this.baseOptions,Wn,1))!=null&&i.g()||(s=b(this.baseOptions,Wn,1))!=null&&s.h()||(o=t.baseOptions)!=null&&o.modelAssetBuffer||(a=t.baseOptions)!=null&&a.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(c,l){let u=b(c.baseOptions,fo,3);if(!u){var f=u=new fo,w=new oo;cn(f,4,Bn,w)}"delegate"in l&&(l.delegate==="GPU"?(l=u,f=new lh,cn(l,2,Bn,f)):(l=u,f=new oo,cn(l,4,Bn,f))),y(c.baseOptions,0,3,u)}(this,h),h.modelAssetPath)return fetch(h.modelAssetPath.toString()).then(c=>{if(c.ok)return c.arrayBuffer();throw Error(`Failed to fetch model: ${h.modelAssetPath} (${c.status})`)}).then(c=>{try{this.g.i.FS_unlink("/model.dat")}catch(l){}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(c),!0,!1,!1),Xr(this,"/model.dat"),this.m(),this.J()});if(h.modelAssetBuffer instanceof Uint8Array)Xr(this,h.modelAssetBuffer);else if(h.modelAssetBuffer)return function(c){return X(this,null,function*(){let l=[];for(var u=0;;){let{done:f,value:w}=yield c.read();if(f)break;l.push(w),u+=w.length}if(l.length===0)return new Uint8Array(0);if(l.length===1)return l[0];c=new Uint8Array(u),u=0;for(let f of l)c.set(f,u),u+=f.length;return c})}(h.modelAssetBuffer).then(c=>{Xr(this,c),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let t;if(this.g.ca(e=>{t=fh(e)}),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener((n,r)=>{this.G.push(Error(r))}),this.g.Ha(),this.g.setGraph(t,e),this.A=void 0,Eo(this)}finishProcessing(){this.g.finishProcessing(),Eo(this)}close(){this.A=void 0,this.g.closeGraph()}};function tt(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}ci.prototype.close=ci.prototype.close;var ui=class{constructor(e,n,r,i){this.g=e,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 To(t,e,n){let r=t.g;if(n=tt(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(n)}`);return r.attachShader(t.h,n),n}function Ao(t,e){let n=t.g,r=tt(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);let i=tt(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(t.P),n.vertexAttribPointer(t.P,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=tt(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,s),n.enableVertexAttribArray(t.J),n.vertexAttribPointer(t.J,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new ui(n,r,i,s)}function os(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function Tn(t,e,n,r){return os(t,e),t.h||(t.m(),t.C()),n?(t.s||(t.s=Ao(t,!0)),n=t.s):(t.v||(t.v=Ao(t,!1)),n=t.v),e.useProgram(t.h),n.bind(),t.l(),t=r(),n.g.bindVertexArray(null),t}function ce(t,e,n){return os(t,e),t=tt(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n!=null?n:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n!=null?n:e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function Er(t,e,n){os(t,e),t.A||(t.A=tt(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.A),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)}function as(t){var e;(e=t.g)==null||e.bindFramebuffer(t.g.FRAMEBUFFER,null)}var Ze=class{G(){return`
2
2
  precision mediump float;
3
3
  varying vec2 vTex;
4
4
  uniform sampler2D inputTexture;
5
5
  void main() {
6
6
  gl_FragColor = texture2D(inputTexture, vTex);
7
7
  }
8
- `}m(){let t=this.g;if(this.h=st(t.createProgram(),"Failed to create WebGL program"),this.Z=Js(this,`
8
+ `}m(){let t=this.g;if(this.h=tt(t.createProgram(),"Failed to create WebGL program"),this.Z=To(this,`
9
9
  attribute vec2 aVertex;
10
10
  attribute vec2 aTex;
11
11
  varying vec2 vTex;
12
12
  void main(void) {
13
13
  gl_Position = vec4(aVertex, 0.0, 1.0);
14
14
  vTex = aTex;
15
- }`,t.VERTEX_SHADER),this.Y=Js(this,this.G(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.P=t.getAttribLocation(this.h,"aVertex"),this.J=t.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){let t=this.g;t.deleteProgram(this.h),t.deleteShader(this.Z),t.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}},ch=class extends sr{G(){return`
15
+ }`,t.VERTEX_SHADER),this.Y=To(this,this.G(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.P=t.getAttribLocation(this.h,"aVertex"),this.J=t.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){let t=this.g;t.deleteProgram(this.h),t.deleteShader(this.Z),t.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}},Nh=class extends Ze{G(){return`
16
16
  precision mediump float;
17
17
  uniform sampler2D backgroundTexture;
18
18
  uniform sampler2D maskTexture;
@@ -24,7 +24,7 @@
24
24
  vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));
25
25
  gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);
26
26
  }
27
- `}C(){let t=this.g;t.activeTexture(t.TEXTURE1),this.B=ye(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=ye(this,t,t.NEAREST)}m(){super.m();let t=this.g;this.L=st(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=st(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.K=st(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let t=this.g;t.uniform1i(this.K,0),t.uniform1i(this.L,1),t.uniform1i(this.U,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},uh=class extends sr{G(){return`
27
+ `}C(){let t=this.g;t.activeTexture(t.TEXTURE1),this.B=ce(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=ce(this,t,t.NEAREST)}m(){super.m();let t=this.g;this.L=tt(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=tt(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.K=tt(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let t=this.g;t.uniform1i(this.K,0),t.uniform1i(this.L,1),t.uniform1i(this.U,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},Gh=class extends Ze{G(){return`
28
28
  precision mediump float;
29
29
  uniform sampler2D maskTexture;
30
30
  uniform sampler2D defaultTexture;
@@ -38,8 +38,7 @@
38
38
  overlayColor = mix(defaultColor, overlayColor, overlayColor.a);
39
39
  gl_FragColor = mix(defaultColor, overlayColor, confidence);
40
40
  }
41
- `}C(){let t=this.g;t.activeTexture(t.TEXTURE1),this.j=ye(this,t),t.activeTexture(t.TEXTURE2),this.B=ye(this,t)}m(){super.m();let t=this.g;this.K=st(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=st(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=st(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let t=this.g;t.uniform1i(this.H,0),t.uniform1i(this.K,1),t.uniform1i(this.L,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function Jt(t,e){switch(e){case 0:return t.g.find(r=>r instanceof Uint8Array);case 1:return t.g.find(r=>r instanceof Float32Array);case 2:return t.g.find(r=>typeof WebGLTexture!="undefined"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function Li(t){var e=Jt(t,1);if(!e){if(e=Jt(t,0))e=new Float32Array(e).map(n=>n/255);else{e=new Float32Array(t.width*t.height);let n=Xe(t);var r=Oo(t);if(Pn(r,n,i1(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(t.width*t.height*4),n.readPixels(0,0,t.width,t.height,n.RGBA,n.FLOAT,r);for(let i=0,o=0;i<e.length;++i,o+=4)e[i]=r[o]}else n.readPixels(0,0,t.width,t.height,n.RED,n.FLOAT,e)}t.g.push(e)}return e}function i1(t){let e=Jt(t,2);if(!e){let r=Xe(t);e=s1(t);let n=Li(t),i=o1(t);r.texImage2D(r.TEXTURE_2D,0,i,t.width,t.height,0,r.RED,r.FLOAT,n),Ni(t)}return e}function Xe(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=st(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function o1(t){if(t=Xe(t),!$r)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))$r=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");$r=t.R16F}return $r}function Oo(t){return t.l||(t.l=new sr),t.l}function s1(t){let e=Xe(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let r=Jt(t,2);return r||(r=ye(Oo(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(r),t.j=!0),e.bindTexture(e.TEXTURE_2D,r),r}function Ni(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var $r,Z=class{constructor(t,e,r,n,i,o,s){this.g=t,this.m=e,this.j=r,this.canvas=n,this.l=i,this.width=o,this.height=s,this.j&&--ta===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!Jt(this,0)}ja(){return!!Jt(this,1)}R(){return!!Jt(this,2)}ia(){return(e=Jt(t=this,0))||(e=Li(t),e=new Uint8Array(e.map(r=>255*r)),t.g.push(e)),e;var t,e}ha(){return Li(this)}N(){return i1(this)}clone(){let t=[];for(let e of this.g){let r;if(e instanceof Uint8Array)r=new Uint8Array(e);else if(e instanceof Float32Array)r=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{let n=Xe(this),i=Oo(this);n.activeTexture(n.TEXTURE1),r=ye(i,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,r);let o=o1(this);n.texImage2D(n.TEXTURE_2D,0,o,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),Pn(i,n,r),kr(i,n,!1,()=>{s1(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),Ni(this)}),xo(i),Ni(this)}}t.push(r)}return new Z(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Xe(this).deleteTexture(Jt(this,2)),ta=-1}};Z.prototype.close=Z.prototype.close,Z.prototype.clone=Z.prototype.clone,Z.prototype.getAsWebGLTexture=Z.prototype.N,Z.prototype.getAsFloat32Array=Z.prototype.ha,Z.prototype.getAsUint8Array=Z.prototype.ia,Z.prototype.hasWebGLTexture=Z.prototype.R,Z.prototype.hasFloat32Array=Z.prototype.ja,Z.prototype.hasUint8Array=Z.prototype.Da;var ta=250,hh={color:"white",lineWidth:4,radius:6};function li(t){return Zn(hs(Zn({},hh),{fillColor:(t=t||{}).color}),t)}function Yt(t,e){return t instanceof Function?t(e):t}function ea(t,e,r){return Math.max(Math.min(e,r),Math.min(Math.max(e,r),t))}function yr(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function Nr(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function ra(t,e,r){var n;if(e.R())r(e.N());else{let i=e.ja()?e.ha():e.ia();t.m=(n=t.m)!=null?n:new sr;let o=Nr(t);r((t=new Z([i],e.m,!1,o.canvas,t.m,e.width,e.height)).N()),t.close()}}function na(t,e,r,n){let i=function(a){return a.g||(a.g=new ch),a.g}(t),o=Nr(t),s=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;kr(i,o,!0,()=>{(function(c,u,l,h){let f=c.g;if(f.activeTexture(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,u),f.activeTexture(f.TEXTURE1),f.bindTexture(f.TEXTURE_2D,c.B),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,l),c.H&&function(v,A){if(v!==A)return!1;v=v.entries(),A=A.entries();for(let[F,D]of v){v=F;let rt=D;var S=A.next();if(S.done)return!1;let[N,fr]=S.value;if(S=fr,v!==N||rt[0]!==S[0]||rt[1]!==S[1]||rt[2]!==S[2]||rt[3]!==S[3])return!1}return!!A.next().done}(c.H,h))f.activeTexture(f.TEXTURE2),f.bindTexture(f.TEXTURE_2D,c.j);else{c.H=h;let v=Array(1024).fill(0);h.forEach((A,S)=>{if(A.length!==4)throw Error(`Color at index ${S} is not a four-channel value.`);v[4*S]=A[0],v[4*S+1]=A[1],v[4*S+2]=A[2],v[4*S+3]=A[3]}),f.activeTexture(f.TEXTURE2),f.bindTexture(f.TEXTURE_2D,c.j),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,256,1,0,f.RGBA,f.UNSIGNED_BYTE,new Uint8Array(v))}})(i,e,s,n),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLE_FAN,0,4);let a=i.g;a.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)})}function ia(t,e,r,n){let i=Nr(t),o=function(c){return c.h||(c.h=new uh),c.h}(t),s=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;kr(o,i,!0,()=>{var c=o.g;c.activeTexture(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,e),c.activeTexture(c.TEXTURE1),c.bindTexture(c.TEXTURE_2D,o.j),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,s),c.activeTexture(c.TEXTURE2),c.bindTexture(c.TEXTURE_2D,o.B),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),i.bindTexture(i.TEXTURE_2D,null),(c=o.g).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)})}var ft=class{constructor(t,e){typeof CanvasRenderingContext2D!="undefined"&&t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}wa(t,e){if(t){var r=yr(this);e=li(e),r.save();var n=r.canvas,i=0;for(let o of t)r.fillStyle=Yt(e.fillColor,{index:i,from:o}),r.strokeStyle=Yt(e.color,{index:i,from:o}),r.lineWidth=Yt(e.lineWidth,{index:i,from:o}),(t=new Path2D).arc(o.x*n.width,o.y*n.height,Yt(e.radius,{index:i,from:o}),0,2*Math.PI),r.fill(t),r.stroke(t),++i;r.restore()}}va(t,e,r){if(t&&e){var n=yr(this);r=li(r),n.save();var i=n.canvas,o=0;for(let s of e){n.beginPath(),e=t[s.start];let a=t[s.end];e&&a&&(n.strokeStyle=Yt(r.color,{index:o,from:e,to:a}),n.lineWidth=Yt(r.lineWidth,{index:o,from:e,to:a}),n.moveTo(e.x*i.width,e.y*i.height),n.lineTo(a.x*i.width,a.y*i.height)),++o,n.stroke()}n.restore()}}sa(t,e){let r=yr(this);e=li(e),r.save(),r.beginPath(),r.lineWidth=Yt(e.lineWidth,{}),r.strokeStyle=Yt(e.color,{}),r.fillStyle=Yt(e.fillColor,{}),r.moveTo(t.originX,t.originY),r.lineTo(t.originX+t.width,t.originY),r.lineTo(t.originX+t.width,t.originY+t.height),r.lineTo(t.originX,t.originY+t.height),r.lineTo(t.originX,t.originY),r.stroke(),r.fill(),r.restore()}ta(t,e,r=[0,0,0,255]){this.l?function(n,i,o,s){let a=Nr(n);ra(n,i,c=>{na(n,c,o,s),(c=yr(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,t,r,e):na(this,t.N(),r,e)}ua(t,e,r){this.l?function(n,i,o,s){let a=Nr(n);ra(n,i,c=>{ia(n,c,o,s),(c=yr(n)).drawImage(a.canvas,0,0,c.canvas.width,c.canvas.height)})}(this,t,e,r):ia(this,t.N(),e,r)}close(){var t,e,r;(t=this.g)==null||t.close(),this.g=void 0,(e=this.h)==null||e.close(),this.h=void 0,(r=this.m)==null||r.close(),this.m=void 0}};function Ht(t,e){switch(e){case 0:return t.g.find(r=>r instanceof ImageData);case 1:return t.g.find(r=>typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap);case 2:return t.g.find(r=>typeof WebGLTexture!="undefined"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function a1(t){var e=Ht(t,0);if(!e){e=Ye(t);let r=Fn(t),n=new Uint8Array(t.width*t.height*4);Pn(r,e,tn(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,n),xo(r),e=new ImageData(new Uint8ClampedArray(n.buffer),t.width,t.height),t.g.push(e)}return e}function tn(t){let e=Ht(t,2);if(!e){let r=Ye(t);e=en(t);let n=Ht(t,1)||a1(t);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),vr(t)}return e}function Ye(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=st(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Fn(t){return t.l||(t.l=new sr),t.l}function en(t){let e=Ye(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let r=Ht(t,2);return r||(r=ye(Fn(t),e),t.g.push(r),t.m=!0),e.bindTexture(e.TEXTURE_2D,r),r}function vr(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function oa(t){let e=Ye(t);return kr(Fn(t),e,!0,()=>function(r,n){let i=r.canvas;if(i.width===r.width&&i.height===r.height)return n();let o=i.width,s=i.height;return i.width=r.width,i.height=r.height,r=n(),i.width=o,i.height=s,r}(t,()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))}ft.prototype.close=ft.prototype.close,ft.prototype.drawConfidenceMask=ft.prototype.ua,ft.prototype.drawCategoryMask=ft.prototype.ta,ft.prototype.drawBoundingBox=ft.prototype.sa,ft.prototype.drawConnectors=ft.prototype.va,ft.prototype.drawLandmarks=ft.prototype.wa,ft.lerp=function(t,e,r,n,i){return ea(n*(1-(t-e)/(r-e))+i*(1-(r-t)/(r-e)),n,i)},ft.clamp=ea;var et=class{constructor(t,e,r,n,i,o,s){this.g=t,this.j=e,this.m=r,this.canvas=n,this.l=i,this.width=o,this.height=s,(this.j||this.m)&&--sa===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!Ht(this,0)}ka(){return!!Ht(this,1)}R(){return!!Ht(this,2)}Aa(){return a1(this)}za(){var t=Ht(this,1);return t||(tn(this),en(this),t=oa(this),vr(this),this.g.push(t),this.j=!0),t}N(){return tn(this)}clone(){let t=[];for(let e of this.g){let r;if(e instanceof ImageData)r=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){let n=Ye(this),i=Fn(this);n.activeTexture(n.TEXTURE1),r=ye(i,n),n.bindTexture(n.TEXTURE_2D,r),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,this.width,this.height,0,n.RGBA,n.UNSIGNED_BYTE,null),n.bindTexture(n.TEXTURE_2D,null),Pn(i,n,r),kr(i,n,!1,()=>{en(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),vr(this)}),xo(i),vr(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);tn(this),en(this),r=oa(this),vr(this)}t.push(r)}return new et(t,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Ht(this,1).close(),this.m&&Ye(this).deleteTexture(Ht(this,2)),sa=-1}};et.prototype.close=et.prototype.close,et.prototype.clone=et.prototype.clone,et.prototype.getAsWebGLTexture=et.prototype.N,et.prototype.getAsImageBitmap=et.prototype.za,et.prototype.getAsImageData=et.prototype.Aa,et.prototype.hasWebGLTexture=et.prototype.R,et.prototype.hasImageBitmap=et.prototype.ka,et.prototype.hasImageData=et.prototype.Ca;var sa=250;function Bt(...t){return t.map(([e,r])=>({start:e,end:r}))}var lh=function(t){return class extends t{Ha(){this.i._registerModelResourcesGraphService()}}}((aa=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",e!==void 0?this.i.canvas=e:r1()?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"))}initializeGraph(t){return C(this,null,function*(){let e=yield(yield fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)})}setGraphFromString(t){this.setGraph(new TextEncoder().encode(t),!1)}setGraph(t,e){let r=t.length,n=this.i._malloc(r);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(t,e,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),m(this,n||"input_audio",o=>{m(this,i=i||"audio_header",s=>{this.i._configureAudio(o,s,t,e!=null?e:0,r)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){Vt(this,"__graph_config__",e=>{t(e)}),m(this,"__graph_config__",e=>{this.i._getGraphConfig(e,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,r){this.addAudioToStreamWithShape(t,0,0,e,r)}addAudioToStreamWithShape(t,e,r,n,i){let o=4*t.length;this.h!==o&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(o),this.h=o),this.i.HEAPF32.set(t,this.g/4),m(this,n,s=>{this.i._addAudioToInputStream(this.g,e,r,s,i)})}addGpuBufferToStream(t,e,r){m(this,e,n=>{let[i,o]=Ys(this,t,n);this.i._addBoundTextureToStream(n,i,o,r)})}addBoolToStream(t,e,r){m(this,e,n=>{this.i._addBoolToInputStream(t,n,r)})}addDoubleToStream(t,e,r){m(this,e,n=>{this.i._addDoubleToInputStream(t,n,r)})}addFloatToStream(t,e,r){m(this,e,n=>{this.i._addFloatToInputStream(t,n,r)})}addIntToStream(t,e,r){m(this,e,n=>{this.i._addIntToInputStream(t,n,r)})}addUintToStream(t,e,r){m(this,e,n=>{this.i._addUintToInputStream(t,n,r)})}addStringToStream(t,e,r){m(this,e,n=>{m(this,t,i=>{this.i._addStringToInputStream(i,n,r)})})}addStringRecordToStream(t,e,r){m(this,e,n=>{qs(this,Object.keys(t),i=>{qs(this,Object.values(t),o=>{this.i._addFlatHashMapToInputStream(i,o,Object.keys(t).length,n,r)})})})}addProtoToStream(t,e,r,n){m(this,r,i=>{m(this,e,o=>{let s=this.i._malloc(t.length);this.i.HEAPU8.set(t,s),this.i._addProtoToInputStream(s,t.length,o,i,n),this.i._free(s)})})}addEmptyPacketToStream(t,e){m(this,t,r=>{this.i._addEmptyPacketToInputStream(r,e)})}addBoolVectorToStream(t,e,r){m(this,e,n=>{let i=this.i._allocateBoolVector(t.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(let o of t)this.i._addBoolVectorEntry(i,o);this.i._addBoolVectorToInputStream(i,n,r)})}addDoubleVectorToStream(t,e,r){m(this,e,n=>{let i=this.i._allocateDoubleVector(t.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(let o of t)this.i._addDoubleVectorEntry(i,o);this.i._addDoubleVectorToInputStream(i,n,r)})}addFloatVectorToStream(t,e,r){m(this,e,n=>{let i=this.i._allocateFloatVector(t.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(let o of t)this.i._addFloatVectorEntry(i,o);this.i._addFloatVectorToInputStream(i,n,r)})}addIntVectorToStream(t,e,r){m(this,e,n=>{let i=this.i._allocateIntVector(t.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(let o of t)this.i._addIntVectorEntry(i,o);this.i._addIntVectorToInputStream(i,n,r)})}addUintVectorToStream(t,e,r){m(this,e,n=>{let i=this.i._allocateUintVector(t.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(let o of t)this.i._addUintVectorEntry(i,o);this.i._addUintVectorToInputStream(i,n,r)})}addStringVectorToStream(t,e,r){m(this,e,n=>{let i=this.i._allocateStringVector(t.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(let o of t)m(this,o,s=>{this.i._addStringVectorEntry(i,s)});this.i._addStringVectorToInputStream(i,n,r)})}addBoolToInputSidePacket(t,e){m(this,e,r=>{this.i._addBoolToInputSidePacket(t,r)})}addDoubleToInputSidePacket(t,e){m(this,e,r=>{this.i._addDoubleToInputSidePacket(t,r)})}addFloatToInputSidePacket(t,e){m(this,e,r=>{this.i._addFloatToInputSidePacket(t,r)})}addIntToInputSidePacket(t,e){m(this,e,r=>{this.i._addIntToInputSidePacket(t,r)})}addUintToInputSidePacket(t,e){m(this,e,r=>{this.i._addUintToInputSidePacket(t,r)})}addStringToInputSidePacket(t,e){m(this,e,r=>{m(this,t,n=>{this.i._addStringToInputSidePacket(n,r)})})}addProtoToInputSidePacket(t,e,r){m(this,r,n=>{m(this,e,i=>{let o=this.i._malloc(t.length);this.i.HEAPU8.set(t,o),this.i._addProtoToInputSidePacket(o,t.length,i,n),this.i._free(o)})})}addBoolVectorToInputSidePacket(t,e){m(this,e,r=>{let n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let i of t)this.i._addBoolVectorEntry(n,i);this.i._addBoolVectorToInputSidePacket(n,r)})}addDoubleVectorToInputSidePacket(t,e){m(this,e,r=>{let n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let i of t)this.i._addDoubleVectorEntry(n,i);this.i._addDoubleVectorToInputSidePacket(n,r)})}addFloatVectorToInputSidePacket(t,e){m(this,e,r=>{let n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let i of t)this.i._addFloatVectorEntry(n,i);this.i._addFloatVectorToInputSidePacket(n,r)})}addIntVectorToInputSidePacket(t,e){m(this,e,r=>{let n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let i of t)this.i._addIntVectorEntry(n,i);this.i._addIntVectorToInputSidePacket(n,r)})}addUintVectorToInputSidePacket(t,e){m(this,e,r=>{let n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let i of t)this.i._addUintVectorEntry(n,i);this.i._addUintVectorToInputSidePacket(n,r)})}addStringVectorToInputSidePacket(t,e){m(this,e,r=>{let n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let i of t)m(this,i,o=>{this.i._addStringVectorEntry(n,o)});this.i._addStringVectorToInputSidePacket(n,r)})}attachBoolListener(t,e){Vt(this,t,e),m(this,t,r=>{this.i._attachBoolListener(r)})}attachBoolVectorListener(t,e){ue(this,t,e),m(this,t,r=>{this.i._attachBoolVectorListener(r)})}attachIntListener(t,e){Vt(this,t,e),m(this,t,r=>{this.i._attachIntListener(r)})}attachIntVectorListener(t,e){ue(this,t,e),m(this,t,r=>{this.i._attachIntVectorListener(r)})}attachUintListener(t,e){Vt(this,t,e),m(this,t,r=>{this.i._attachUintListener(r)})}attachUintVectorListener(t,e){ue(this,t,e),m(this,t,r=>{this.i._attachUintVectorListener(r)})}attachDoubleListener(t,e){Vt(this,t,e),m(this,t,r=>{this.i._attachDoubleListener(r)})}attachDoubleVectorListener(t,e){ue(this,t,e),m(this,t,r=>{this.i._attachDoubleVectorListener(r)})}attachFloatListener(t,e){Vt(this,t,e),m(this,t,r=>{this.i._attachFloatListener(r)})}attachFloatVectorListener(t,e){ue(this,t,e),m(this,t,r=>{this.i._attachFloatVectorListener(r)})}attachStringListener(t,e){Vt(this,t,e),m(this,t,r=>{this.i._attachStringListener(r)})}attachStringVectorListener(t,e){ue(this,t,e),m(this,t,r=>{this.i._attachStringVectorListener(r)})}attachProtoListener(t,e,r){Vt(this,t,e),m(this,t,n=>{this.i._attachProtoListener(n,r||!1)})}attachProtoVectorListener(t,e,r){ue(this,t,e),m(this,t,n=>{this.i._attachProtoVectorListener(n,r||!1)})}attachAudioListener(t,e,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Vt(this,t,(n,i)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),e(n,i)}),m(this,t,n=>{this.i._attachAudioListener(n,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends aa{get ea(){return this.i}oa(t,e,r){m(this,e,n=>{let[i,o]=Ys(this,t,n);this.ea._addBoundTextureAsImageToStream(n,i,o,r)})}V(t,e){Vt(this,t,e),m(this,t,r=>{this.ea._attachImageListener(r)})}ba(t,e){ue(this,t,e),m(this,t,r=>{this.ea._attachImageVectorListener(r)})}})),aa,Ut=class extends lh{};function I(t,e,r){return C(this,null,function*(){var n;return function(i,o,s,a){return C(this,null,function*(){return ah(i,o,s,a)})}(t,(n=r.canvas)!=null?n:r1()?void 0:document.createElement("canvas"),e,r)})}function c1(t,e,r,n){if(t.U){let o=new Nc;if(r!=null&&r.regionOfInterest){if(!t.na)throw Error("This task doesn't support region-of-interest.");var i=r.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].");g(o,1,(i.left+i.right)/2),g(o,2,(i.top+i.bottom)/2),g(o,4,i.right-i.left),g(o,3,i.bottom-i.top)}else g(o,1,.5),g(o,2,.5),g(o,4,1),g(o,3,1);if(r!=null&&r.rotationDegrees){if((r==null?void 0:r.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90\xB0.");if(g(o,5,-Math.PI*r.rotationDegrees/180),(r==null?void 0:r.rotationDegrees)%180!=0){let[s,a]=n1(e);r=K(o,3)*a/s,i=K(o,4)*s/a,g(o,4,r),g(o,3,i)}}t.g.addProtoToStream(o.g(),"mediapipe.NormalizedRect",t.U,n)}t.g.oa(e,t.Z,n!=null?n:performance.now()),t.finishProcessing()}function Dt(t,e,r){var n;if((n=t.baseOptions)!=null&&n.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");c1(t,e,r,t.B+1)}function $t(t,e,r,n){var i;if(!((i=t.baseOptions)!=null&&i.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");c1(t,e,r,n)}function qe(t,e,r,n){var i=e.data;let o=e.width,s=o*(e=e.height);if((i instanceof Uint8Array||i instanceof Float32Array)&&i.length!==s)throw Error("Unsupported channel count: "+i.length/s);return t=new Z([i],r,!1,t.g.i.canvas,t.P,o,e),n?t.clone():t}var gt=class extends Oi{constructor(t,e,r,n){super(t),this.g=t,this.Z=e,this.U=r,this.na=n,this.P=new sr}l(t,e=!0){if("runningMode"in t&&br(this.baseOptions,2,!!t.runningMode&&t.runningMode!=="IMAGE"),t.canvas!==void 0&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.P.close(),super.close()}};gt.prototype.close=gt.prototype.close;var pt=class extends gt{constructor(t,e){super(new Ut(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},E(t=this.h=new Un,0,1,e=new G),g(this.h,2,.5),g(this.h,3,.3)}get baseOptions(){return R(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){var e,r;return"minDetectionConfidence"in t&&g(this.h,2,(e=t.minDetectionConfidence)!=null?e:.5),"minSuppressionThreshold"in t&&g(this.h,3,(r=t.minSuppressionThreshold)!=null?r:.3),this.l(t)}D(t,e){return this.j={detections:[]},Dt(this,t,e),this.j}F(t,e,r){return this.j={detections:[]},$t(this,t,r,e),this.j}m(){var t=new mt;P(t,"image_in"),P(t,"norm_rect_in"),x(t,"detections");let e=new At;Mt(e,K2,this.h);let r=new at;It(r,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),M(r,"IMAGE:image_in"),M(r,"NORM_RECT:norm_rect_in"),w(r,"DETECTIONS:detections"),r.o(e),wt(t,r),this.g.attachProtoVectorListener("detections",(n,i)=>{for(let o of n)n=Oc(o),this.j.detections.push(t1(n));p(this,i)}),this.g.attachEmptyPacketListener("detections",n=>{p(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};pt.prototype.detectForVideo=pt.prototype.F,pt.prototype.detect=pt.prototype.D,pt.prototype.setOptions=pt.prototype.o,pt.createFromModelPath=function(t,e){return C(this,null,function*(){return I(pt,t,{baseOptions:{modelAssetPath:e}})})},pt.createFromModelBuffer=function(t,e){return I(pt,t,{baseOptions:{modelAssetBuffer:e}})},pt.createFromOptions=function(t,e){return I(pt,t,e)};var bo=Bt([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]),Lo=Bt([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]),No=Bt([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),u1=Bt([474,475],[475,476],[476,477],[477,474]),Co=Bt([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]),Uo=Bt([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),h1=Bt([469,470],[470,471],[471,472],[472,469]),Do=Bt([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]),l1=[...bo,...Lo,...No,...Co,...Uo,...Do],f1=Bt([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 ca(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var z=class extends gt{constructor(t,e){super(new Ut(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,E(t=this.h=new Mc,0,1,e=new G),this.v=new kc,E(this.h,0,3,this.v),this.s=new Un,E(this.h,0,2,this.s),Wt(this.s,4,1),g(this.s,2,.5),g(this.v,2,.5),g(this.h,4,.5)}get baseOptions(){return R(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){var e,r,n,i;return"numFaces"in t&&Wt(this.s,4,(e=t.numFaces)!=null?e:1),"minFaceDetectionConfidence"in t&&g(this.s,2,(r=t.minFaceDetectionConfidence)!=null?r:.5),"minTrackingConfidence"in t&&g(this.h,4,(n=t.minTrackingConfidence)!=null?n:.5),"minFacePresenceConfidence"in t&&g(this.v,2,(i=t.minFacePresenceConfidence)!=null?i:.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}D(t,e){return ca(this),Dt(this,t,e),this.j}F(t,e,r){return ca(this),$t(this,t,r,e),this.j}m(){var t=new mt;P(t,"image_in"),P(t,"norm_rect"),x(t,"face_landmarks");let e=new At;Mt(e,Y2,this.h);let r=new at;It(r,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),M(r,"IMAGE:image_in"),M(r,"NORM_RECT:norm_rect"),w(r,"NORM_LANDMARKS:face_landmarks"),r.o(e),wt(t,r),this.g.attachProtoVectorListener("face_landmarks",(n,i)=>{for(let o of n)n=Dr(o),this.j.faceLandmarks.push(Dn(n));p(this,i)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{p(this,n)}),this.outputFaceBlendshapes&&(x(t,"blendshapes"),w(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,i)=>{var o;if(this.outputFaceBlendshapes)for(let s of n)n=Cn(s),this.j.faceBlendshapes.push(wo((o=n.g())!=null?o:[]));p(this,i)}),this.g.attachEmptyPacketListener("blendshapes",n=>{p(this,n)})),this.outputFacialTransformationMatrixes&&(x(t,"face_geometry"),w(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,i)=>{var o,s,a,c,u;if(this.outputFacialTransformationMatrixes)for(let l of n)(n=R(X2(l),B2,2))&&this.j.facialTransformationMatrixes.push({rows:(s=(o=Nt(n,1))!=null?o:0)!=null?s:0,columns:(c=(a=Nt(n,2))!=null?a:0)!=null?c:0,data:(u=Ie(n,3,ve,Se()).slice())!=null?u:[]});p(this,i)}),this.g.attachEmptyPacketListener("face_geometry",n=>{p(this,n)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};z.prototype.detectForVideo=z.prototype.F,z.prototype.detect=z.prototype.D,z.prototype.setOptions=z.prototype.o,z.createFromModelPath=function(t,e){return I(z,t,{baseOptions:{modelAssetPath:e}})},z.createFromModelBuffer=function(t,e){return I(z,t,{baseOptions:{modelAssetBuffer:e}})},z.createFromOptions=function(t,e){return I(z,t,e)},z.FACE_LANDMARKS_LIPS=bo,z.FACE_LANDMARKS_LEFT_EYE=Lo,z.FACE_LANDMARKS_LEFT_EYEBROW=No,z.FACE_LANDMARKS_LEFT_IRIS=u1,z.FACE_LANDMARKS_RIGHT_EYE=Co,z.FACE_LANDMARKS_RIGHT_EYEBROW=Uo,z.FACE_LANDMARKS_RIGHT_IRIS=h1,z.FACE_LANDMARKS_FACE_OVAL=Do,z.FACE_LANDMARKS_CONTOURS=l1,z.FACE_LANDMARKS_TESSELATION=f1;var Gt=class extends gt{constructor(t,e){super(new Ut(t,e),"image_in","norm_rect",!0),E(t=this.j=new Fc,0,1,e=new G)}get baseOptions(){return R(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){return super.l(t)}Ka(t,e,r){let n=typeof e!="function"?e:{};if(this.h=typeof e=="function"?e:r,Dt(this,t,n!=null?n:{}),!this.h)return this.s}m(){var t=new mt;P(t,"image_in"),P(t,"norm_rect"),x(t,"stylized_image");let e=new At;Mt(e,q2,this.j);let r=new at;It(r,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),M(r,"IMAGE:image_in"),M(r,"NORM_RECT:norm_rect"),w(r,"STYLIZED_IMAGE:stylized_image"),r.o(e),wt(t,r),this.g.V("stylized_image",(n,i)=>{var o=!this.h,s=n.data,a=n.width;let c=a*(n=n.height);if(s instanceof Uint8Array)if(s.length===3*c){let u=new Uint8ClampedArray(4*c);for(let l=0;l<c;++l)u[4*l]=s[3*l],u[4*l+1]=s[3*l+1],u[4*l+2]=s[3*l+2],u[4*l+3]=255;s=new ImageData(u,a,n)}else{if(s.length!==4*c)throw Error("Unsupported channel count: "+s.length/c);s=new ImageData(new Uint8ClampedArray(s.buffer,s.byteOffset,s.length),a,n)}else if(!(s instanceof WebGLTexture))throw Error(`Unsupported format: ${s.constructor.name}`);a=new et([s],!1,!1,this.g.i.canvas,this.P,a,n),this.s=o=o?a.clone():a,this.h&&this.h(o),p(this,i)}),this.g.attachEmptyPacketListener("stylized_image",n=>{this.s=null,this.h&&this.h(null),p(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Gt.prototype.stylize=Gt.prototype.Ka,Gt.prototype.setOptions=Gt.prototype.o,Gt.createFromModelPath=function(t,e){return I(Gt,t,{baseOptions:{modelAssetPath:e}})},Gt.createFromModelBuffer=function(t,e){return I(Gt,t,{baseOptions:{modelAssetBuffer:e}})},Gt.createFromOptions=function(t,e){return I(Gt,t,e)};var ko=Bt([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 ua(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function ha(t){return t.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function la(t,e=!0){var i,o,s,a,c,u;let r=[];for(let l of t){var n=Cn(l);t=[];for(let h of n.g())n=e&&Nt(h,1)!=null?(i=Nt(h,1))!=null?i:0:-1,t.push({score:(o=K(h,2))!=null?o:0,index:n,categoryName:(a=(s=Ct(h,3))!=null?s:"")!=null?a:"",displayName:(u=(c=Ct(h,4))!=null?c:"")!=null?u:""});r.push(t)}return r}var _t=class extends gt{constructor(t,e){super(new Ut(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],E(t=this.j=new Gc,0,1,e=new G),this.s=new To,E(this.j,0,2,this.s),this.C=new vo,E(this.s,0,3,this.C),this.v=new Vc,E(this.s,0,2,this.v),this.h=new Q2,E(this.j,0,3,this.h),g(this.v,2,.5),g(this.s,4,.5),g(this.C,2,.5)}get baseOptions(){return R(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){var i,o,s,a,c,u,l,h;if(Wt(this.v,3,(i=t.numHands)!=null?i:1),"minHandDetectionConfidence"in t&&g(this.v,2,(o=t.minHandDetectionConfidence)!=null?o:.5),"minTrackingConfidence"in t&&g(this.s,4,(s=t.minTrackingConfidence)!=null?s:.5),"minHandPresenceConfidence"in t&&g(this.C,2,(a=t.minHandPresenceConfidence)!=null?a:.5),t.cannedGesturesClassifierOptions){var e=new De,r=e,n=xi(t.cannedGesturesClassifierOptions,(c=R(this.h,De,3))==null?void 0:c.h());E(r,0,2,n),E(this.h,0,3,e)}else t.cannedGesturesClassifierOptions===void 0&&((u=R(this.h,De,3))==null||u.g());return t.customGesturesClassifierOptions?(E(r=e=new De,0,2,n=xi(t.customGesturesClassifierOptions,(l=R(this.h,De,4))==null?void 0:l.h())),E(this.h,0,4,e)):t.customGesturesClassifierOptions===void 0&&((h=R(this.h,De,4))==null||h.g()),this.l(t)}Fa(t,e){return ua(this),Dt(this,t,e),ha(this)}Ga(t,e,r){return ua(this),$t(this,t,r,e),ha(this)}m(){var t=new mt;P(t,"image_in"),P(t,"norm_rect"),x(t,"hand_gestures"),x(t,"hand_landmarks"),x(t,"world_hand_landmarks"),x(t,"handedness");let e=new At;Mt(e,J2,this.j);let r=new at;It(r,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),M(r,"IMAGE:image_in"),M(r,"NORM_RECT:norm_rect"),w(r,"HAND_GESTURES:hand_gestures"),w(r,"LANDMARKS:hand_landmarks"),w(r,"WORLD_LANDMARKS:world_hand_landmarks"),w(r,"HANDEDNESS:handedness"),r.o(e),wt(t,r),this.g.attachProtoVectorListener("hand_landmarks",(n,i)=>{var o,s,a,c;for(let u of n){n=Dr(u);let l=[];for(let h of re(n,Lc,1))l.push({x:(o=K(h,1))!=null?o:0,y:(s=K(h,2))!=null?s:0,z:(a=K(h,3))!=null?a:0,visibility:(c=K(h,4))!=null?c:0});this.landmarks.push(l)}p(this,i)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{p(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,i)=>{var o,s,a,c;for(let u of n){n=Be(u);let l=[];for(let h of re(n,bc,1))l.push({x:(o=K(h,1))!=null?o:0,y:(s=K(h,2))!=null?s:0,z:(a=K(h,3))!=null?a:0,visibility:(c=K(h,4))!=null?c:0});this.worldLandmarks.push(l)}p(this,i)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{p(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,i)=>{this.gestures.push(...la(n,!1)),p(this,i)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{p(this,n)}),this.g.attachProtoVectorListener("handedness",(n,i)=>{this.handedness.push(...la(n)),p(this,i)}),this.g.attachEmptyPacketListener("handedness",n=>{p(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function fa(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}_t.prototype.recognizeForVideo=_t.prototype.Ga,_t.prototype.recognize=_t.prototype.Fa,_t.prototype.setOptions=_t.prototype.o,_t.createFromModelPath=function(t,e){return I(_t,t,{baseOptions:{modelAssetPath:e}})},_t.createFromModelBuffer=function(t,e){return I(_t,t,{baseOptions:{modelAssetBuffer:e}})},_t.createFromOptions=function(t,e){return I(_t,t,e)},_t.HAND_CONNECTIONS=ko;var yt=class extends gt{constructor(t,e){super(new Ut(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],E(t=this.h=new To,0,1,e=new G),this.s=new vo,E(this.h,0,3,this.s),this.j=new Vc,E(this.h,0,2,this.j),Wt(this.j,3,1),g(this.j,2,.5),g(this.s,2,.5),g(this.h,4,.5)}get baseOptions(){return R(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){var e,r,n,i;return"numHands"in t&&Wt(this.j,3,(e=t.numHands)!=null?e:1),"minHandDetectionConfidence"in t&&g(this.j,2,(r=t.minHandDetectionConfidence)!=null?r:.5),"minTrackingConfidence"in t&&g(this.h,4,(n=t.minTrackingConfidence)!=null?n:.5),"minHandPresenceConfidence"in t&&g(this.s,2,(i=t.minHandPresenceConfidence)!=null?i:.5),this.l(t)}D(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Dt(this,t,e),fa(this)}F(t,e,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],$t(this,t,r,e),fa(this)}m(){var t=new mt;P(t,"image_in"),P(t,"norm_rect"),x(t,"hand_landmarks"),x(t,"world_hand_landmarks"),x(t,"handedness");let e=new At;Mt(e,Z2,this.h);let r=new at;It(r,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),M(r,"IMAGE:image_in"),M(r,"NORM_RECT:norm_rect"),w(r,"LANDMARKS:hand_landmarks"),w(r,"WORLD_LANDMARKS:world_hand_landmarks"),w(r,"HANDEDNESS:handedness"),r.o(e),wt(t,r),this.g.attachProtoVectorListener("hand_landmarks",(n,i)=>{for(let o of n)n=Dr(o),this.landmarks.push(Dn(n));p(this,i)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{p(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,i)=>{for(let o of n)n=Be(o),this.worldLandmarks.push(Ir(n));p(this,i)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{p(this,n)}),this.g.attachProtoVectorListener("handedness",(n,i)=>{var c,u,l,h,f,v,A;var o=this.handedness,s=o.push;let a=[];for(let S of n){n=Cn(S);let F=[];for(let D of n.g())F.push({score:(c=K(D,2))!=null?c:0,index:(l=(u=Nt(D,1))!=null?u:0)!=null?l:-1,categoryName:(f=(h=Ct(D,3))!=null?h:"")!=null?f:"",displayName:(A=(v=Ct(D,4))!=null?v:"")!=null?A:""});a.push(F)}s.call(o,...a),p(this,i)}),this.g.attachEmptyPacketListener("handedness",n=>{p(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};yt.prototype.detectForVideo=yt.prototype.F,yt.prototype.detect=yt.prototype.D,yt.prototype.setOptions=yt.prototype.o,yt.createFromModelPath=function(t,e){return I(yt,t,{baseOptions:{modelAssetPath:e}})},yt.createFromModelBuffer=function(t,e){return I(yt,t,{baseOptions:{modelAssetBuffer:e}})},yt.createFromOptions=function(t,e){return I(yt,t,e)},yt.HAND_CONNECTIONS=ko;var p1=Bt([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 pa(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function da(t){try{if(!t.C)return t.h;t.C(t.h)}finally{Mn(t)}}function Kr(t,e){t=Dr(t),e.push(Dn(t))}var B=class extends gt{constructor(t,e){super(new Ut(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,E(t=this.j=new $c,0,1,e=new G),this.K=new vo,E(this.j,0,2,this.K),this.Y=new th,E(this.j,0,3,this.Y),this.s=new Un,E(this.j,0,4,this.s),this.H=new kc,E(this.j,0,5,this.H),this.v=new zc,E(this.j,0,6,this.v),this.L=new Wc,E(this.j,0,7,this.L),g(this.s,2,.5),g(this.s,3,.3),g(this.H,2,.5),g(this.v,2,.5),g(this.v,3,.3),g(this.L,2,.5),g(this.K,2,.5)}get baseOptions(){return R(this.j,G,1)}set baseOptions(t){E(this.j,0,1,t)}o(t){var e,r,n,i,o,s,a;return"minFaceDetectionConfidence"in t&&g(this.s,2,(e=t.minFaceDetectionConfidence)!=null?e:.5),"minFaceSuppressionThreshold"in t&&g(this.s,3,(r=t.minFaceSuppressionThreshold)!=null?r:.3),"minFacePresenceConfidence"in t&&g(this.H,2,(n=t.minFacePresenceConfidence)!=null?n:.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&g(this.v,2,(i=t.minPoseDetectionConfidence)!=null?i:.5),"minPoseSuppressionThreshold"in t&&g(this.v,3,(o=t.minPoseSuppressionThreshold)!=null?o:.3),"minPosePresenceConfidence"in t&&g(this.L,2,(s=t.minPosePresenceConfidence)!=null?s:.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&g(this.K,2,(a=t.minHandLandmarksConfidence)!=null?a:.5),this.l(t)}D(t,e,r){let n=typeof e!="function"?e:{};return this.C=typeof e=="function"?e:r,pa(this),Dt(this,t,n),da(this)}F(t,e,r,n){let i=typeof r!="function"?r:{};return this.C=typeof r=="function"?r:n,pa(this),$t(this,t,i,e),da(this)}m(){var t=new mt;P(t,"input_frames_image"),x(t,"pose_landmarks"),x(t,"pose_world_landmarks"),x(t,"face_landmarks"),x(t,"left_hand_landmarks"),x(t,"left_hand_world_landmarks"),x(t,"right_hand_landmarks"),x(t,"right_hand_world_landmarks");let e=new At,r=new Us;vi(r,1,tr("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(i,o){if(o!=null)if(Array.isArray(o))k(i,2,En(o,Xi,void 0,void 0,!1));else{if(!(typeof o=="string"||o instanceof te||Re(o)))throw Error("invalid value in Any.value field: "+o+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");vi(i,2,Vi(o,!1),xe())}}(r,this.j.g());let n=new at;It(n,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),on(n,8,Us,r),M(n,"IMAGE:input_frames_image"),w(n,"POSE_LANDMARKS:pose_landmarks"),w(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),w(n,"FACE_LANDMARKS:face_landmarks"),w(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),w(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),w(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),w(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(e),wt(t,n),kn(this,t),this.g.attachProtoListener("pose_landmarks",(i,o)=>{Kr(i,this.h.poseLandmarks),p(this,o)}),this.g.attachEmptyPacketListener("pose_landmarks",i=>{p(this,i)}),this.g.attachProtoListener("pose_world_landmarks",(i,o)=>{var s=this.h.poseWorldLandmarks;i=Be(i),s.push(Ir(i)),p(this,o)}),this.g.attachEmptyPacketListener("pose_world_landmarks",i=>{p(this,i)}),this.outputPoseSegmentationMasks&&(w(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Ke(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(i,o)=>{this.h.poseSegmentationMasks=[qe(this,i,!0,!this.C)],p(this,o)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",i=>{this.h.poseSegmentationMasks=[],p(this,i)})),this.g.attachProtoListener("face_landmarks",(i,o)=>{Kr(i,this.h.faceLandmarks),p(this,o)}),this.g.attachEmptyPacketListener("face_landmarks",i=>{p(this,i)}),this.outputFaceBlendshapes&&(x(t,"extra_blendshapes"),w(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(i,o)=>{var a;var s=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(i=Cn(i),s.push(wo((a=i.g())!=null?a:[]))),p(this,o)}),this.g.attachEmptyPacketListener("extra_blendshapes",i=>{p(this,i)})),this.g.attachProtoListener("left_hand_landmarks",(i,o)=>{Kr(i,this.h.leftHandLandmarks),p(this,o)}),this.g.attachEmptyPacketListener("left_hand_landmarks",i=>{p(this,i)}),this.g.attachProtoListener("left_hand_world_landmarks",(i,o)=>{var s=this.h.leftHandWorldLandmarks;i=Be(i),s.push(Ir(i)),p(this,o)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",i=>{p(this,i)}),this.g.attachProtoListener("right_hand_landmarks",(i,o)=>{Kr(i,this.h.rightHandLandmarks),p(this,o)}),this.g.attachEmptyPacketListener("right_hand_landmarks",i=>{p(this,i)}),this.g.attachProtoListener("right_hand_world_landmarks",(i,o)=>{var s=this.h.rightHandWorldLandmarks;i=Be(i),s.push(Ir(i)),p(this,o)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",i=>{p(this,i)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};B.prototype.detectForVideo=B.prototype.F,B.prototype.detect=B.prototype.D,B.prototype.setOptions=B.prototype.o,B.createFromModelPath=function(t,e){return I(B,t,{baseOptions:{modelAssetPath:e}})},B.createFromModelBuffer=function(t,e){return I(B,t,{baseOptions:{modelAssetBuffer:e}})},B.createFromOptions=function(t,e){return I(B,t,e)},B.HAND_CONNECTIONS=ko,B.POSE_CONNECTIONS=p1,B.FACE_LANDMARKS_LIPS=bo,B.FACE_LANDMARKS_LEFT_EYE=Lo,B.FACE_LANDMARKS_LEFT_EYEBROW=No,B.FACE_LANDMARKS_LEFT_IRIS=u1,B.FACE_LANDMARKS_RIGHT_EYE=Co,B.FACE_LANDMARKS_RIGHT_EYEBROW=Uo,B.FACE_LANDMARKS_RIGHT_IRIS=h1,B.FACE_LANDMARKS_FACE_OVAL=Do,B.FACE_LANDMARKS_CONTOURS=l1,B.FACE_LANDMARKS_TESSELATION=f1;var Ot=class extends gt{constructor(t,e){super(new Ut(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},E(t=this.h=new Kc,0,1,e=new G)}get baseOptions(){return R(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return E(this.h,0,2,xi(t,R(this.h,_o,2))),this.l(t)}qa(t,e){return this.j={classifications:[]},Dt(this,t,e),this.j}ra(t,e,r){return this.j={classifications:[]},$t(this,t,r,e),this.j}m(){var t=new mt;P(t,"input_image"),P(t,"norm_rect"),x(t,"classifications");let e=new At;Mt(e,eh,this.h);let r=new at;It(r,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),M(r,"IMAGE:input_image"),M(r,"NORM_RECT:norm_rect"),w(r,"CLASSIFICATIONS:classifications"),r.o(e),wt(t,r),this.g.attachProtoListener("classifications",(n,i)=>{this.j=function(o){var a;let s={classifications:re(o,G2,1).map(c=>{var u,l,h,f;return wo((l=(u=R(c,Rc,4))==null?void 0:u.g())!=null?l:[],(h=Nt(c,2))!=null?h:0,(f=Ct(c,3))!=null?f:"")})};return _i(We(o,2))!=null&&(s.timestampMs=(a=_i(We(o,2)))!=null?a:0),s}(j2(n)),p(this,i)}),this.g.attachEmptyPacketListener("classifications",n=>{p(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ot.prototype.classifyForVideo=Ot.prototype.ra,Ot.prototype.classify=Ot.prototype.qa,Ot.prototype.setOptions=Ot.prototype.o,Ot.createFromModelPath=function(t,e){return I(Ot,t,{baseOptions:{modelAssetPath:e}})},Ot.createFromModelBuffer=function(t,e){return I(Ot,t,{baseOptions:{modelAssetBuffer:e}})},Ot.createFromOptions=function(t,e){return I(Ot,t,e)};var Et=class extends gt{constructor(t,e){super(new Ut(t,e),"image_in","norm_rect",!0),this.h=new Xc,this.embeddings={embeddings:[]},E(t=this.h,0,1,e=new G)}get baseOptions(){return R(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){var e=this.h,r=R(this.h,js,2);return r=r?r.clone():new js,t.l2Normalize!==void 0?br(r,1,t.l2Normalize):"l2Normalize"in t&&k(r,1),t.quantize!==void 0?br(r,2,t.quantize):"quantize"in t&&k(r,2),E(e,0,2,r),this.l(t)}xa(t,e){return Dt(this,t,e),this.embeddings}ya(t,e,r){return $t(this,t,r,e),this.embeddings}m(){var t=new mt;P(t,"image_in"),P(t,"norm_rect"),x(t,"embeddings_out");let e=new At;Mt(e,rh,this.h);let r=new at;It(r,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),M(r,"IMAGE:image_in"),M(r,"NORM_RECT:norm_rect"),w(r,"EMBEDDINGS:embeddings_out"),r.o(e),wt(t,r),this.g.attachProtoListener("embeddings_out",(n,i)=>{n=W2(n),this.embeddings=function(o){var s;return{embeddings:re(o,z2,1).map(a=>{var u,l,h,f,v,A,S;let c={headIndex:(l=(u=Nt(a,3))!=null?u:0)!=null?l:-1,headName:(f=(h=Ct(a,4))!=null?h:"")!=null?f:""};if(Xa(a,Gs,oi(a,1))!==void 0)a=Ie(a=R(a,Gs,oi(a,1)),1,ve,Se()),c.floatEmbedding=a.slice();else{let F=new Uint8Array(0);c.quantizedEmbedding=(S=(A=(v=R(a,H2,oi(a,2)))==null?void 0:v.ma())==null?void 0:A.h())!=null?S:F}return c}),timestampMs:(s=_i(We(o,2)))!=null?s:0}}(n),p(this,i)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{p(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Et.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Ks(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Ks($s(t.quantizedEmbedding),$s(e.quantizedEmbedding))}return t},Et.prototype.embedForVideo=Et.prototype.ya,Et.prototype.embed=Et.prototype.xa,Et.prototype.setOptions=Et.prototype.o,Et.createFromModelPath=function(t,e){return I(Et,t,{baseOptions:{modelAssetPath:e}})},Et.createFromModelBuffer=function(t,e){return I(Et,t,{baseOptions:{modelAssetBuffer:e}})},Et.createFromOptions=function(t,e){return I(Et,t,e)};var Ci=class{constructor(t,e,r){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=r}close(){var t,e;(t=this.confidenceMasks)==null||t.forEach(r=>{r.close()}),(e=this.categoryMask)==null||e.close()}};function ga(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function ma(t){try{let e=new Ci(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{Mn(t)}}Ci.prototype.close=Ci.prototype.close;var nt=class extends gt{constructor(t,e){super(new Ut(t,e),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Io,this.v=new Yc,E(this.h,0,3,this.v),E(t=this.h,0,1,e=new G)}get baseOptions(){return R(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){var e,r;return t.displayNamesLocale!==void 0?k(this.h,2,tr(t.displayNamesLocale)):"displayNamesLocale"in t&&k(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=(e=t.outputCategoryMask)!=null?e:!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=(r=t.outputConfidenceMasks)!=null?r:!0),super.l(t)}J(){(function(t){var r,n,i;let e=re(t.ca(),at,1).filter(o=>{var s;return((s=Ct(o,1))!=null?s:"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")});if(t.s=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");e.length===1&&((i=(n=(r=R(e[0],At,7))==null?void 0:r.l())==null?void 0:n.g())!=null?i:new Map).forEach((o,s)=>{var a;t.s[Number(s)]=(a=Ct(o,1))!=null?a:""})})(this)}segment(t,e,r){let n=typeof e!="function"?e:{};return this.j=typeof e=="function"?e:r,ga(this),Dt(this,t,n),ma(this)}Ia(t,e,r,n){let i=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:n,ga(this),$t(this,t,i,e),ma(this)}Ba(){return this.s}m(){var t=new mt;P(t,"image_in"),P(t,"norm_rect");let e=new At;Mt(e,Qc,this.h);let r=new at;It(r,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),M(r,"IMAGE:image_in"),M(r,"NORM_RECT:norm_rect"),r.o(e),wt(t,r),kn(this,t),this.outputConfidenceMasks&&(x(t,"confidence_masks"),w(r,"CONFIDENCE_MASKS:confidence_masks"),Ke(this,"confidence_masks"),this.g.ba("confidence_masks",(n,i)=>{this.confidenceMasks=n.map(o=>qe(this,o,!0,!this.j)),p(this,i)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],p(this,n)})),this.outputCategoryMask&&(x(t,"category_mask"),w(r,"CATEGORY_MASK:category_mask"),Ke(this,"category_mask"),this.g.V("category_mask",(n,i)=>{this.categoryMask=qe(this,n,!1,!this.j),p(this,i)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,p(this,n)})),x(t,"quality_scores"),w(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,i)=>{this.qualityScores=n,p(this,i)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,p(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};nt.prototype.getLabels=nt.prototype.Ba,nt.prototype.segmentForVideo=nt.prototype.Ia,nt.prototype.segment=nt.prototype.segment,nt.prototype.setOptions=nt.prototype.o,nt.createFromModelPath=function(t,e){return I(nt,t,{baseOptions:{modelAssetPath:e}})},nt.createFromModelBuffer=function(t,e){return I(nt,t,{baseOptions:{modelAssetBuffer:e}})},nt.createFromOptions=function(t,e){return I(nt,t,e)};var Ui=class{constructor(t,e,r){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=r}close(){var t,e;(t=this.confidenceMasks)==null||t.forEach(r=>{r.close()}),(e=this.categoryMask)==null||e.close()}};Ui.prototype.close=Ui.prototype.close;var fh=class extends d{constructor(t){super(t)}},ke=[0,$,-2],un=[0,qt,-3,V,qt,-1],_a=[0,un],ya=[0,un,$,-1],fi=class extends d{constructor(t){super(t)}},Ea=[0,qt,-1,V],ph=class extends d{constructor(t){super(t)}},va=class extends d{constructor(t){super(t)}},Di=[1,2,3,4,5,6,7,8,9,10,14,15],d1=class extends d{constructor(t){super(t)}};d1.prototype.g=Nn([0,tt,[0,Di,b,un,b,[0,un,ke],b,_a,b,[0,_a,ke],b,Ea,b,[0,qt,-3,V,Tt],b,[0,qt,-3,V],b,[0,L,qt,-2,V,$,V,-1,2,qt,ke],b,ya,b,[0,ya,ke],qt,ke,L,b,[0,qt,-3,V,ke,-1],b,[0,tt,Ea]],L,[0,L,$,-1,V]]);var jt=class extends gt{constructor(t,e){super(new Ut(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Io,this.s=new Yc,E(this.h,0,3,this.s),E(t=this.h,0,1,e=new G)}get baseOptions(){return R(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){var e,r;return"outputCategoryMask"in t&&(this.outputCategoryMask=(e=t.outputCategoryMask)!=null?e:!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=(r=t.outputConfidenceMasks)!=null?r:!0),super.l(t)}segment(t,e,r,n){let i=typeof r!="function"?r:{};this.j=typeof r=="function"?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.B+1,n=new d1;let o=new va;var s=new fh;if(Wt(s,1,255),E(o,0,12,s),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new fi;br(a,3,!0),g(a,1,e.keypoint.x),g(a,2,e.keypoint.y),Ar(o,5,Di,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(s=new ph,e.scribble))br(e=new fi,3,!0),g(e,1,a.x),g(e,2,a.y),on(s,1,fi,e);Ar(o,15,Di,s)}on(n,1,va,o),this.g.addProtoToStream(n.g(),"drishti.RenderData","roi_in",r),Dt(this,t,i);t:{try{let u=new Ui(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var c=u;break t}this.j(u)}finally{Mn(this)}c=void 0}return c}m(){var t=new mt;P(t,"image_in"),P(t,"roi_in"),P(t,"norm_rect_in");let e=new At;Mt(e,Qc,this.h);let r=new at;It(r,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),M(r,"IMAGE:image_in"),M(r,"ROI:roi_in"),M(r,"NORM_RECT:norm_rect_in"),r.o(e),wt(t,r),kn(this,t),this.outputConfidenceMasks&&(x(t,"confidence_masks"),w(r,"CONFIDENCE_MASKS:confidence_masks"),Ke(this,"confidence_masks"),this.g.ba("confidence_masks",(n,i)=>{this.confidenceMasks=n.map(o=>qe(this,o,!0,!this.j)),p(this,i)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],p(this,n)})),this.outputCategoryMask&&(x(t,"category_mask"),w(r,"CATEGORY_MASK:category_mask"),Ke(this,"category_mask"),this.g.V("category_mask",(n,i)=>{this.categoryMask=qe(this,n,!1,!this.j),p(this,i)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,p(this,n)})),x(t,"quality_scores"),w(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,i)=>{this.qualityScores=n,p(this,i)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,p(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};jt.prototype.segment=jt.prototype.segment,jt.prototype.setOptions=jt.prototype.o,jt.createFromModelPath=function(t,e){return I(jt,t,{baseOptions:{modelAssetPath:e}})},jt.createFromModelBuffer=function(t,e){return I(jt,t,{baseOptions:{modelAssetBuffer:e}})},jt.createFromOptions=function(t,e){return I(jt,t,e)};var bt=class extends gt{constructor(t,e){super(new Ut(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},E(t=this.h=new Jc,0,1,e=new G)}get baseOptions(){return R(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?k(this.h,2,tr(t.displayNamesLocale)):"displayNamesLocale"in t&&k(this.h,2),t.maxResults!==void 0?Wt(this.h,3,t.maxResults):"maxResults"in t&&k(this.h,3),t.scoreThreshold!==void 0?g(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&k(this.h,4),t.categoryAllowlist!==void 0?sn(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&k(this.h,5),t.categoryDenylist!==void 0?sn(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&k(this.h,6),this.l(t)}D(t,e){return this.j={detections:[]},Dt(this,t,e),this.j}F(t,e,r){return this.j={detections:[]},$t(this,t,r,e),this.j}m(){var t=new mt;P(t,"input_frame_gpu"),P(t,"norm_rect"),x(t,"detections");let e=new At;Mt(e,ih,this.h);let r=new at;It(r,"mediapipe.tasks.vision.ObjectDetectorGraph"),M(r,"IMAGE:input_frame_gpu"),M(r,"NORM_RECT:norm_rect"),w(r,"DETECTIONS:detections"),r.o(e),wt(t,r),this.g.attachProtoVectorListener("detections",(n,i)=>{for(let o of n)n=Oc(o),this.j.detections.push(t1(n));p(this,i)}),this.g.attachEmptyPacketListener("detections",n=>{p(this,n)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};bt.prototype.detectForVideo=bt.prototype.F,bt.prototype.detect=bt.prototype.D,bt.prototype.setOptions=bt.prototype.o,bt.createFromModelPath=function(t,e){return C(this,null,function*(){return I(bt,t,{baseOptions:{modelAssetPath:e}})})},bt.createFromModelBuffer=function(t,e){return I(bt,t,{baseOptions:{modelAssetBuffer:e}})},bt.createFromOptions=function(t,e){return I(bt,t,e)};var ki=class{constructor(t,e,r){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=r}close(){var t;(t=this.segmentationMasks)==null||t.forEach(e=>{e.close()})}};function Ta(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function Aa(t){try{let e=new ki(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.s)return e;t.s(e)}finally{Mn(t)}}ki.prototype.close=ki.prototype.close;var vt=class extends gt{constructor(t,e){super(new Ut(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,E(t=this.h=new Zc,0,1,e=new G),this.v=new Wc,E(this.h,0,3,this.v),this.j=new zc,E(this.h,0,2,this.j),Wt(this.j,4,1),g(this.j,2,.5),g(this.v,2,.5),g(this.h,4,.5)}get baseOptions(){return R(this.h,G,1)}set baseOptions(t){E(this.h,0,1,t)}o(t){var e,r,n,i,o;return"numPoses"in t&&Wt(this.j,4,(e=t.numPoses)!=null?e:1),"minPoseDetectionConfidence"in t&&g(this.j,2,(r=t.minPoseDetectionConfidence)!=null?r:.5),"minTrackingConfidence"in t&&g(this.h,4,(n=t.minTrackingConfidence)!=null?n:.5),"minPosePresenceConfidence"in t&&g(this.v,2,(i=t.minPosePresenceConfidence)!=null?i:.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=(o=t.outputSegmentationMasks)!=null?o:!1),this.l(t)}D(t,e,r){let n=typeof e!="function"?e:{};return this.s=typeof e=="function"?e:r,Ta(this),Dt(this,t,n),Aa(this)}F(t,e,r,n){let i=typeof r!="function"?r:{};return this.s=typeof r=="function"?r:n,Ta(this),$t(this,t,i,e),Aa(this)}m(){var t=new mt;P(t,"image_in"),P(t,"norm_rect"),x(t,"normalized_landmarks"),x(t,"world_landmarks"),x(t,"segmentation_masks");let e=new At;Mt(e,oh,this.h);let r=new at;It(r,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),M(r,"IMAGE:image_in"),M(r,"NORM_RECT:norm_rect"),w(r,"NORM_LANDMARKS:normalized_landmarks"),w(r,"WORLD_LANDMARKS:world_landmarks"),r.o(e),wt(t,r),kn(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(n,i)=>{this.landmarks=[];for(let o of n)n=Dr(o),this.landmarks.push(Dn(n));p(this,i)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],p(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,i)=>{this.worldLandmarks=[];for(let o of n)n=Be(o),this.worldLandmarks.push(Ir(n));p(this,i)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],p(this,n)}),this.outputSegmentationMasks&&(w(r,"SEGMENTATION_MASK:segmentation_masks"),Ke(this,"segmentation_masks"),this.g.ba("segmentation_masks",(n,i)=>{this.segmentationMasks=n.map(o=>qe(this,o,!0,!this.s)),p(this,i)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],p(this,n)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};vt.prototype.detectForVideo=vt.prototype.F,vt.prototype.detect=vt.prototype.D,vt.prototype.setOptions=vt.prototype.o,vt.createFromModelPath=function(t,e){return I(vt,t,{baseOptions:{modelAssetPath:e}})},vt.createFromModelBuffer=function(t,e){return I(vt,t,{baseOptions:{modelAssetBuffer:e}})},vt.createFromOptions=function(t,e){return I(vt,t,e)},vt.POSE_CONNECTIONS=p1;var g1={},dh=function(t,e,r,n,i){var o=new Worker(g1[e]||(g1[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(s){var a=s.data,c=a.$e$;if(c){var u=new Error(c[0]);u.code=c[1],u.stack=c[2],i(u,null)}else i(null,a)},o.postMessage(r,n),o},ht=Uint8Array,Le=Uint16Array,y1=Int32Array,Mo=new ht([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Po=new ht([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),E1=new ht([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),v1=function(t,e){for(var r=new Le(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new y1(r[30]),n=1;n<30;++n)for(var o=r[n];o<r[n+1];++o)i[o]=o-r[n]<<5|n;return{b:r,r:i}},T1=v1(Mo,2),Fo=T1.b,gh=T1.r;Fo[28]=258,gh[258]=28;var A1=v1(Po,0),S1=A1.b,lf=A1.r,jn=new Le(32768);for(O=0;O<32768;++O)oe=(O&43690)>>1|(O&21845)<<1,oe=(oe&52428)>>2|(oe&13107)<<2,oe=(oe&61680)>>4|(oe&3855)<<4,jn[O]=((oe&65280)>>8|(oe&255)<<8)>>1;var oe,O,ar=function(t,e,r){for(var n=t.length,i=0,o=new Le(e);i<n;++i)t[i]&&++o[t[i]-1];var s=new Le(e);for(i=1;i<e;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(r){a=new Le(1<<e);var c=15-e;for(i=0;i<n;++i)if(t[i])for(var u=i<<4|t[i],l=e-t[i],h=s[t[i]-1]++<<l,f=h|(1<<l)-1;h<=f;++h)a[jn[h]>>c]=u}else for(a=new Le(n),i=0;i<n;++i)t[i]&&(a[i]=jn[s[t[i]-1]++]>>15-t[i]);return a},Mr=new ht(288);for(O=0;O<144;++O)Mr[O]=8;var O;for(O=144;O<256;++O)Mr[O]=9;var O;for(O=256;O<280;++O)Mr[O]=7;var O;for(O=280;O<288;++O)Mr[O]=8;var O,I1=new ht(32);for(O=0;O<32;++O)I1[O]=5;var O;var w1=ar(Mr,9,1);var R1=ar(I1,5,1),Vn=function(t){for(var e=t[0],r=1;r<t.length;++r)t[r]>e&&(e=t[r]);return e},kt=function(t,e,r){var n=e/8|0;return(t[n]|t[n+1]<<8)>>(e&7)&r},Gn=function(t,e){var r=e/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(e&7)},x1=function(t){return(t+7)/8|0},O1=function(t,e,r){return(e==null||e<0)&&(e=0),(r==null||r>t.length)&&(r=t.length),new ht(t.subarray(e,r))};var b1=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Rt=function(t,e,r){var n=new Error(e||b1[t]);if(n.code=t,Error.captureStackTrace&&Error.captureStackTrace(n,Rt),!r)throw n;return n},Bo=function(t,e,r,n){var i=t.length,o=n?n.length:0;if(!i||e.f&&!e.l)return r||new ht(0);var s=!r,a=s||e.i!=2,c=e.i;s&&(r=new ht(i*3));var u=function(is){var os=r.length;if(is>os){var ss=new ht(Math.max(os*2,is));ss.set(r),r=ss}},l=e.f||0,h=e.p||0,f=e.b||0,v=e.l,A=e.d,S=e.m,F=e.n,D=i*8;do{if(!v){l=kt(t,h,1);var rt=kt(t,h+1,3);if(h+=3,rt)if(rt==1)v=w1,A=R1,S=9,F=5;else if(rt==2){var Kn=kt(t,h,31)+257,qo=kt(t,h+10,15)+4,Qo=Kn+kt(t,h+5,31)+1;h+=14;for(var pr=new ht(Qo),Xn=new ht(19),xt=0;xt<qo;++xt)Xn[E1[xt]]=kt(t,h+xt*3,7);h+=qo*3;for(var Jo=Vn(Xn),Ru=(1<<Jo)-1,xu=ar(Xn,Jo,1),xt=0;xt<Qo;){var Zo=xu[kt(t,h,Ru)];h+=Zo&15;var N=Zo>>4;if(N<16)pr[xt++]=N;else{var Ce=0,Vr=0;for(N==16?(Vr=3+kt(t,h,3),h+=2,Ce=pr[xt-1]):N==17?(Vr=3+kt(t,h,7),h+=3):N==18&&(Vr=11+kt(t,h,127),h+=7);Vr--;)pr[xt++]=Ce}}var ts=pr.subarray(0,Kn),ce=pr.subarray(Kn);S=Vn(ts),F=Vn(ce),v=ar(ts,S,1),A=ar(ce,F,1)}else Rt(1);else{var N=x1(h)+4,fr=t[N-4]|t[N-3]<<8,$n=N+fr;if($n>i){c&&Rt(0);break}a&&u(f+fr),r.set(t.subarray(N,$n),f),e.b=f+=fr,e.p=h=$n*8,e.f=l;continue}if(h>D){c&&Rt(0);break}}a&&u(f+131072);for(var Ou=(1<<S)-1,bu=(1<<F)-1,Yn=h;;Yn=h){var Ce=v[Gn(t,h)&Ou],Ue=Ce>>4;if(h+=Ce&15,h>D){c&&Rt(0);break}if(Ce||Rt(2),Ue<256)r[f++]=Ue;else if(Ue==256){Yn=h,v=null;break}else{var es=Ue-254;if(Ue>264){var xt=Ue-257,dr=Mo[xt];es=kt(t,h,(1<<dr)-1)+Fo[xt],h+=dr}var qn=A[Gn(t,h)&bu],Qn=qn>>4;qn||Rt(3),h+=qn&15;var ce=S1[Qn];if(Qn>3){var dr=Po[Qn];ce+=Gn(t,h)&(1<<dr)-1,h+=dr}if(h>D){c&&Rt(0);break}a&&u(f+131072);var rs=f+es;if(f<ce){var ns=o-ce,Lu=Math.min(ce,rs);for(ns+f<0&&Rt(3);f<Lu;++f)r[f]=n[ns+f]}for(;f<rs;++f)r[f]=r[f-ce]}}e.l=v,e.p=Yn,e.b=f,e.f=l,v&&(l=1,e.m=S,e.d=A,e.n=F)}while(!l);return f!=r.length&&s?O1(r,0,f):r.subarray(0,f)};var mh=new ht(0);var _h=function(t,e){var r={};for(var n in t)r[n]=t[n];for(var n in e)r[n]=e[n];return r},m1=function(t,e,r){for(var n=t(),i=t.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<n.length;++s){var a=n[s],c=o[s];if(typeof a=="function"){e+=";"+c+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var l=u.indexOf(" ",8)+1;e+=u.slice(l,u.indexOf("(",l))}else{e+=u;for(var h in a.prototype)e+=";"+c+".prototype."+h+"="+a.prototype[h].toString()}else e+=u}else r[c]=a}return e},Bn=[],yh=function(t){var e=[];for(var r in t)t[r].buffer&&e.push((t[r]=new t[r].constructor(t[r])).buffer);return e},Eh=function(t,e,r,n){if(!Bn[r]){for(var i="",o={},s=t.length-1,a=0;a<s;++a)i=m1(t[a],i,o);Bn[r]={c:m1(t[s],i,o),e:o}}var c=_h({},Bn[r].e);return dh(Bn[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",r,c,yh(c),n)},vh=function(){return[ht,Le,y1,Mo,Po,E1,Fo,S1,w1,R1,jn,b1,ar,Vn,kt,Gn,x1,O1,Rt,Bo,Ih,L1,Ah]};var Th=function(){return[N1,C1]};var L1=function(t){return postMessage(t,[t.buffer])},Ah=function(t){return t&&{out:t.size&&new ht(t.size),dictionary:t.dictionary}},Sh=function(t,e,r,n,i,o){var s=Eh(r,n,i,function(a,c){s.terminate(),o(a,c)});return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}};var N1=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&Rt(6,"invalid gzip data");var e=t[3],r=10;e&4&&(r+=(t[10]|t[11]<<8)+2);for(var n=(e>>3&1)+(e>>4&1);n>0;n-=!t[r++]);return r+(e&2)},C1=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0};function Ih(t,e){return Bo(t,{i:2},e&&e.out,e&&e.dictionary)}function U1(t,e,r){return r||(r=e,e={}),typeof r!="function"&&Rt(7),Sh(t,e,[vh,Th,function(){return[_1]}],function(n){return L1(_1(n.data[0],n.data[1]))},3,r)}function _1(t,e){var r=N1(t);return r+8>t.length&&Rt(6,"invalid gzip data"),Bo(t.subarray(r,-8),{i:2},e&&e.out||new ht(C1(t)),e&&e.dictionary)}var wh=typeof TextDecoder!="undefined"&&new TextDecoder,Rh=0;try{wh.decode(mh,{stream:!0}),Rh=1}catch(t){}var df=new Date().getTime(),xh=0;var Vo=function(){return new Date().getTime()+xh},D1=function(){let t=new Date;return t.setTime(Vo()),t.toLocaleString()},k1=function(t){let e=String(t.getMilliseconds());return"padStart"in String.prototype&&(e=e.toString().padStart(3,"0")),`${t.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")}:${e}`};var M1="5.0.0";var P1=typeof importScripts!="undefined",F1=typeof registerProcessor!="undefined";var Go="";var Oh="web.sdk.qcloud.com";var bh=`https://${Oh}/trtc/webrtc/v5/doc`,mf=`${bh}/zh-cn/`,B1="https://yun.tim.qq.com",V1="https://apisgp.my-imcloud.com";var G1={LOG:"jssdk_log",EVENT:"jssdk_event",KEY_POINT:"jssdk_new_endreport",KV_STAT:"jssdk_key_metrics_report"};var ae=(s=>(s[s.TRACE=0]="TRACE",s[s.DEBUG=1]="DEBUG",s[s.INFO=2]="INFO",s[s.WARN=3]="WARN",s[s.ERROR=4]="ERROR",s[s.NONE=5]="NONE",s))(ae||{});var _f=7*24*3600*1e3;var j1={"120p":{width:160,height:120,frameRate:15,bitrate:200},"120p_2":{width:160,height:120,frameRate:15,bitrate:100},"180p":{width:320,height:180,frameRate:15,bitrate:350},"180p_2":{width:320,height:180,frameRate:15,bitrate:150},"240p":{width:320,height:240,frameRate:15,bitrate:400},"240p_2":{width:320,height:240,frameRate:15,bitrate:200},"360p":{width:640,height:360,frameRate:15,bitrate:800},"360p_2":{width:640,height:360,frameRate:15,bitrate:400},"480p":{width:640,height:480,frameRate:15,bitrate:900},"480p_2":{width:640,height:480,frameRate:15,bitrate:500},"720p":{width:1280,height:720,frameRate:15,bitrate:1500},"1080p":{width:1920,height:1080,frameRate:15,bitrate:2e3},"1440p":{width:2560,height:1440,frameRate:30,bitrate:4860},"4K":{width:3840,height:2160,frameRate:30,bitrate:9e3}},yf=j1["480p_2"],Ef=j1["120p_2"];var Pr={CANVAS:"canvas",AUDIO:"audio",VIDEO:"video",SCREEN:"screen",SMALL:"small",BIG:"big",AUXILIARY:"auxiliary",SMALL_VIDEO:"smallVideo",FACING_MODE_USER:"user",FACING_MODE_ENVIRONMENT:"environment",MUTE:"mute",UNMUTE:"unmute",ENDED:"ended",PLAYING:"playing",PAUSE:"pause",ERROR:"error",LOADEDDATA:"loadeddata",LOADEDMETADATA:"loadedmetadata",AUDIO_INPUT:"audioinput",VIDEO_INPUT:"videoinput",DETAIL:"detail",TEXT:"text",MAIN:"main",BACKUP:"backup",BANNED:"banned",KICK:"kick",USER_TIME_OUT:"user_time_out",ROOM_DISBAND:"room_disband",SEI_MESSAGE:"sei-message",ADD:"add",REMOVE:"remove",REPLACE:"replace",TRACK:"track",SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe",TRANSCEIVER_DIRECTION_SENDONLY:"sendonly",TRANSCEIVER_DIRECTION_RECVONLY:"recvonly",ENTER_PICTURE_IN_PICTURE:"enterpictureinpicture",LEAVE_PICTURE_IN_PICTURE:"leavepictureinpicture"};var vf=Pr.MAIN,Tf=Pr.AUXILIARY;var Af=Pr.BIG,Sf=Pr.SMALL,If=10*1e3;var wf=Object.keys(ae);var Rf=10*1e3;var Nh=t=>Number(t)<14e8,H1=function(t,e){let r;Go?r=Go:r=Nh(t)?V1:B1;let n=Math.floor(Math.random()*us(2,31));return`${r}/v5/AVQualityReportSvc/C2S?random=${n}&sdkappid=${t}&cmdtype=${e}`};var Hf=typeof window!="undefined"&&typeof window.glog=="function"?window.glog:()=>{};var z1=t=>typeof t=="undefined",jo=t=>typeof t=="string",W1=t=>typeof t=="number";var{toString:zf}=Object.prototype;function $1({url:t,body:e,method:r="POST",timeout:n,priority:i}){return new Promise((o,s)=>{if("fetch"in window)return fetch(t,{method:r,body:e,priority:i}).then(c=>c.text()).then(c=>{try{o({data:JSON.parse(c)})}catch(u){o({data:c})}},s);let a=new XMLHttpRequest;a.onreadystatechange=()=>{if(a.readyState===4)if(a.status>=200&&a.status<300)try{let c=JSON.parse(a.response);o({data:c})}catch(c){o({data:a.response})}else s({status:a.status,statusText:a.statusText||"request failed!"})},a.timeout=n||5e3,a.open(r,t,!0),a.send(e)})}var Ch=Object.prototype.hasOwnProperty;var cr=t=>typeof t=="function",K1=t=>typeof t=="undefined";var X1=t=>typeof t=="boolean";var Uh=function(t){if(!t||typeof t!="object"||Object.prototype.toString.call(t)!="[object Object]")return!1;let e=Object.getPrototypeOf(t);if(e===null)return!0;let r=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.toString.call(r)===Function.prototype.toString.call(Object)};function Y1(t){if(t==null)return!0;if(typeof t=="boolean")return!1;if(typeof t=="number")return t===0;if(typeof t=="string"||typeof t=="function"||Array.isArray(t))return t.length===0;if(t instanceof Error)return t.message==="";if(Uh(t))switch(Object.prototype.toString.call(t)){case"[object File]":case"[object Map]":case"[object Set]":return t.size===0;case"[object Object]":{for(let e in t)if(Ch.call(t,e))return!1;return!0}}return!1}var Dh=0,kh=1,q1=2;function Mh({retryFunction:t,settings:e,onError:r,onRetrying:n,onRetryFailed:i,onRetrySuccess:o,context:s}){return function(...a){let{retries:c=5,timeout:u=1e3}=e,l=0,h=-1,f=Dh,v=(A,S)=>C(this,null,function*(){let F=s||this;try{let D=yield t.apply(F,a);l>0&&o&&o.call(this,l),l=0,A(D)}catch(D){let rt=()=>{clearTimeout(h),l=0,f=q1,S(D)},N=()=>{f!==q1&&l<(cr(c)?c():c)?(l++,f=kh,cr(n)&&n.call(this,l,rt),h=window.setTimeout(()=>{h=-1,v(A,S)},cr(u)?u(l):u)):(rt(),cr(i)&&i.call(this,D))};cr(r)?r.call(this,{error:D,retry:N,reject:S,retryFuncArgs:a,retriedCount:l}):N()}});return new Promise(v)}}var Q1=Mh;var Fr=class{constructor(e){j(this,"userId");j(this,"remoteUserId");j(this,"id");j(this,"sdkAppId");j(this,"type");j(this,"isLocal");this.id=e.id,this.userId=e.userId,this.sdkAppId=e.sdkAppId,this.remoteUserId=e.remoteUserId,this.isLocal=X1(e.isLocal)?e.isLocal:!0,this.type=this.isLocal?"":e.type}createChild(e){return Object.setPrototypeOf(e,this)}setUserId(e){this.userId=e}setSdkAppId(e){this.sdkAppId=e}log(e,r){let n=this.isLocal?this.userId:this.remoteUserId;r.unshift(`[${this.isLocal?"\u2191":"\u2193"}${this.type&&this.type!=="main"?"*":""}${this.id}${n?`|${n}`:""}]`),se.log(e,r,K1(this.userId)||Y1(this.userId),this.userId,this.sdkAppId)}info(...e){this.log(2,e)}debug(...e){this.log(1,e)}warn(...e){this.log(3,e)}error(...e){this.log(4,e)}};var Kt=typeof navigator=="undefined"?"":navigator.userAgent,T=t=>new RegExp(t,"i").test(Kt),J=t=>{if(T(t)){let e=new RegExp(`${t}\\/([\\d.]+)`),r=Kt.match(e);if(r&&r[1])return r[1]}return""},Ho=t=>{if(T(t)){let e=new RegExp(`${t}\\/(\\d+)`),r=Kt.match(e);if(r&&r[1])return parseFloat(r[1])}return NaN},J1=/AppleWebKit\/([\d.]+)/i.exec(Kt),Ph=J1?parseFloat(J1[1]):NaN,tu=T("iPad"),eu=typeof navigator!="undefined"&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&T("Macintosh"),ru=T("iPhone")&&!tu,Fh=T("iPod"),Hn=ru||tu||Fh||eu,ur=T("Android"),nu=function(){if(ur){let t=Kt.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(t){let e=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);if(e&&r)return parseFloat(`${t[1]}.${t[2]}`);if(e)return e}}return NaN}(),a3=ur&&T("webkit")&&nu<2.3,c3=ur&&nu<5&&Ph<537,Bh=T("Firefox"),Vh=J("Firefox"),u3=Ho("Firefox"),iu=T("Edge"),Gh=J("Edge"),ou=T("Edg"),jh=J("Edg"),h3=Ho("Edg"),su=T("SogouMobileBrowser"),Hh=J("SogouMobileBrowser"),au=T("MetaSr\\s"),zh=J("MetaSr\\s"),Ne=T("TBS"),Wh=J("TBS"),cu=T("XWEB"),$h=J("XWEB"),l3=T("MSIE\\s8\\.0"),Kh=T("MSIE\\/\\d+"),f3=function(){if(Kh){let t=/MSIE\s(\d+)\.\d/.exec(Kt),e=t&&parseFloat(t[1]);return!e&&/Trident\/7.0/i.test(Kt)&&/rv:11.0/.test(Kt)&&(e=11),e}return NaN}(),Xh=T("(micromessenger|webbrowser)"),Yh=J("MicroMessenger"),zo=!Ne&&T("MQQBrowser")&&T("COVC"),Wo=!Ne&&T("MQQBrowser")&&!T("COVC"),Z1=Wo||zo?J("MQQBrowser"):"",uu=!Ne&&T(" QQBrowser"),qh=J(" QQBrowser"),hu=!Ne&&T("QQBrowserLite"),Qh=J("QQBrowserLite"),lu=!Ne&&T("MQBHD"),Jh=J("MQBHD"),p3=T("Windows"),d3=!Hn&&T("MAC OS X"),g3=!ur&&T("Linux"),m3=T("CrOS"),_3=T("MicroMessenger"),y3=T("UCBrowser"),E3=T("Electron"),fu=T("MiuiBrowser"),Zh=J("MiuiBrowser"),pu=T("HuaweiBrowser"),v3=T("Huawei")||T("HUAWEI"),T3=T("Honor")||T("HONOR"),tl=J("HuaweiBrowser"),du=T("SamsungBrowser"),el=J("SamsungBrowser"),gu=T("HeyTapBrowser"),rl=J("HeyTapBrowser"),mu=T("VivoBrowser"),nl=J("VivoBrowser"),A3=T("OpenHarmony"),S3=J("OpenHarmony"),il=()=>Ho("Chrome"),_u=T("Chrome"),ol=!iu&&!au&&!su&&!Ne&&!cu&&!ou&&!uu&&!fu&&!pu&&!du&&!gu&&!mu&&_u,yu=T("HeadlessChrome"),I3=il(),sl=J("Chrome"),al=!_u&&!Wo&&!zo&&!hu&&!lu&&T("Safari");var Eu=J("Version"),w3=/Android.*(wv|.0.0.0)/.test(Kt),vu=(()=>{if(eu)return Eu;if(Hn){let t=Kt.match(/OS (\d+)_(\d+)/i);if(t&&t[1]){let e=t[1];return t[2]&&(e+=`.${t[2]}`),e}}return""})();var R3=Number(vu.split(".")[0]);var x3=(()=>{let t=Number(vu.split(".")[0]);return t===14||t===13})(),O3=T("CriOS");var b3=typeof location=="undefined"?!1:location.protocol==="file:"||location.hostname==="localhost"||location.hostname==="127.0.0.1";var L3=cl();function cl(){let t=new Map([[Bh,["Firefox",Vh]],[ou,["Edg",jh]],[ol,["Chrome",sl]],[al,["Safari",Eu]],[Ne,["TBS",Wh]],[cu,["XWEB",$h]],[Xh&&ru,["WeChat",Yh]],[uu,["QQ(Win)",qh]],[Wo,["QQ(Mobile)",Z1]],[zo,["QQ(Mobile X5)",Z1]],[hu,["QQ(Mac)",Qh]],[lu,["QQ(iPad)",Jh]],[fu,["MI",Zh]],[pu,["HW",tl]],[du,["Samsung",el]],[gu,["OPPO",rl]],[mu,["VIVO",nl]],[iu,["EDGE",Gh]],[su,["SogouMobile",Hh]],[au,["Sogou",zh]]]),e="unknown",r="unknown";return t.has(!0)&&([e,r]=t.get(!0)),{name:e,version:r}}var Su=Vu(Au(),1),ll=new Su.default,hr=ll;var Ko=(y=>(y.ROOM_DESTROY="1",y.JOIN_START="21",y.JOIN_SCHEDULE_SUCCESS="22",y.JOIN_SIGNAL_CONNECTION_START="23",y.JOIN_SIGNAL_CONNECTION_END="24",y.JOIN_SEND_CMD="25",y.JOIN_RECEIVED_CMD_RES="26",y.JOIN_SUCCESS="27",y.JOIN_FAILED="28",y.LEAVE_START="51",y.LEAVE_SEND_CMD="52",y.LEAVE_SUCCESS="53",y.PUBLISH_START="61",y.SEND_FIRST_VIDEO_FRAME="62",y.PUBLISH_FAILED="63",y.SUBSCRIBE_START="81",y.SUBSCRIBE_SUCCESS="82",y.SUBSCRIBE_FAILED="84",y.UNSUBSCRIBE_SUCCESS="83",y.LOCAL_TRACK_CAPTURE_START="101",y.LOCAL_TRACK_CAPTURE_SUCCESS="102",y.LOCAL_TRACK_CAPTURE_FAILED="103",y.LOCAL_TRACK_PUBLISHED="104",y.LOCAL_TRACK_UNPUBLISHED="105",y.LOCAL_TRACK_REPLACED="106",y.SWITCH_DEVICE_SUCCESS="107",y.TRACK_MUTED="108",y.TRACK_UNMUTED="109",y.REMOTE_TRACK_SUBSCRIBED="110",y.REMOTE_TRACK_UNSUBSCRIBED="111",y.LOCAL_TRACK_RECAPTURE="112",y.LOCAL_AUDIO_STARTED="113",y.LOCAL_AUDIO_STOPPED="114",y.REMOTE_AUDIO_STARTED="115",y.REMOTE_AUDIO_STOPPED="116",y.PLAY_TRACK_START="151",y.PLAYER_STATE_CHANGED="152",y.VIDEO_LOADED_DATA="153",y.AUTOPLAY_DIALOG_CLICK_CONFIRM="154",y.SIGNAL_CONNECTION_STATE_CHANGED="201",y.PEER_CONNECTION_STATE_CHANGED="202",y.SINGLE_CONNECTION_STAT="203",y.SPC_RECONNECTED="204",y.HEARTBEAT_REPORT="251",y.RECEIVED_PUBLISHED_USER_LIST="252",y.REMOTE_PUBLISH_STATE_CHANGED="253",y.AUDIO_LEVEL_INTERVAL="260",y.NETWORK_QUALITY="261",y.VIDEO_CODEC_IMPLEMENTATION_CHANGED="262",y.QUALITY_LIMITATION_CHANGED="263",y.LOG="264",y.AUDIO_PROCESSOR_DEBUG="265",y.SWITCH_ROOM_START="401",y.SWITCH_ROOM_SUCCESS="407",y.SWITCH_ROOM_FAILED="408",y))(Ko||{});var lr=Ko;var fl="%cTRTC%c%s",pl="padding: 1px 4px;border-radius: 3px;color: #fff;background: #1E88E5;",dl="display: inline",Wn=class Wn{constructor(){j(this,"_isEnableUploadLog",!0);j(this,"_localJoinedUser",new Map);j(this,"_queue",[]);j(this,"_timeoutId",-1);j(this,"_logLevel",1);j(this,"_logLevelToUpload",2);!P1&&!F1&&(this.checkURLParam(),this.installEvents())}get isAbleToUpload(){return this._isEnableUploadLog&&this._timeoutId!==-1}installEvents(){hr.on(lr.JOIN_SCHEDULE_SUCCESS,({schedule:e})=>{var r;(r=e==null?void 0:e.config)!=null&&r.logLevelToUpload&&ae[e.config.logLevelToUpload]&&(this._logLevelToUpload=e.config.logLevelToUpload)}),hr.on(lr.JOIN_SUCCESS,({room:e})=>{this.addJoinedUser({userId:e.userId,sdkAppId:e.sdkAppId}),this.startUpload()}),hr.once(lr.JOIN_FAILED,()=>{this.startUpload()}),hr.on(lr.LEAVE_SUCCESS,({room:e})=>{this.deleteJoinedUser(e.userId)})}startUpload(){this._timeoutId===-1&&this.uploadInterval()}addJoinedUser(e){this._localJoinedUser.set(e.userId,e),this.startUpload()}deleteJoinedUser(e){this._localJoinedUser.delete(e)}uploadInterval(){this.upload().catch(()=>{}),this._timeoutId=window.setTimeout(()=>this.uploadInterval(),5e3)}getLogsToUpload(){let e={map:new Map,splicedQueue:[]};if(this._queue[0].forAllJoinedClients&&this._localJoinedUser.size===0)return e;let r=0;for(;r<this._queue.length&&r!==50;r++){let n=this._queue[r];if(n.forAllJoinedClients)this._localJoinedUser.forEach(({userId:i,sdkAppId:o})=>{e.map.has(i)?e.map.get(i).logs.push(n):e.map.set(i,{userId:i,sdkAppId:o,logs:[n]})});else if(jo(n.userId)&&W1(n.sdkAppId)){let{userId:i,sdkAppId:o}=n;e.map.has(i)?e.map.get(i).logs.push(n):e.map.set(i,{userId:i,sdkAppId:o,logs:[n]})}}return e.map.size>0&&(e.splicedQueue=this._queue.splice(0,r)),e}upload(){return C(this,null,function*(){if(this._queue.length===0||!this._isEnableUploadLog)return;let{map:e,splicedQueue:r}=this.getLogsToUpload();if(e.size===0)return;try{let i=[...e.values()];for(let o=0;o<i.length;o++){let{userId:s,sdkAppId:a,logs:c}=i[o];yield this.uploadLogWithRetry(JSON.stringify({timestamp:D1(),sdkAppId:String(a),userId:s,version:M1,log:c.map(u=>u.log).join(`
42
- `)}),a),c.forEach(u=>u.uploaded=!0)}}catch(i){}let n=r.filter(i=>!i.uploaded);n.length>0&&(this._queue=n.concat(this._queue))})}uploadLogWithRetry(e,r){return Q1({retryFunction:()=>$1({url:H1(r,G1.LOG),body:e,timeout:5e3,priority:"low"}),settings:{retries:3,timeout:2e3},onError:({retry:n})=>{n()}})()}getPrefix(e){let r=new Date;return r.setTime(Vo()),`[${k1(r)}] <${ae[e]}>`}getLogLevel(){return this._logLevel}setLogLevel(e){z1(ae[e])||(this._logLevel!==e&&this.info("setLogLevel",e),this._logLevel=e)}enableUploadLog(){this._isEnableUploadLog=!0}disableUploadLog(){this.warn("disableUploadLog"),this._isEnableUploadLog=!1}logChunkToString(e){if(jo(e))return e;try{return e instanceof Error?e.toString():JSON.stringify(e)}catch(r){return""}}log(e,r,n=!0,i,o){var c;r.unshift(this.getPrefix(e));let s={log:r.reduce((u,l)=>`${u} ${this.logChunkToString(l)}`.trim(),""),level:e,userId:i,sdkAppId:o,forAllJoinedClients:n};if(hr.emit(lr.LOG,{log:s}),this._isEnableUploadLog&&e>=this._logLevelToUpload&&this._queue.push(s),e<this._logLevel)return;let a=((c=ae[e])==null?void 0:c.toLowerCase())||"info";Wn.PRINT_LOG_TAG?console[a](fl,pl,dl,...r):console[a](...r)}debug(...e){this.log(1,e)}info(...e){this.log(2,e)}warn(...e){this.log(3,e)}error(...e){this.log(4,e)}createLogger(e){return new Fr(e)}checkURLParam(){let r=new URLSearchParams(location.search).get("logLevelToUpload"),n=r?Number(r):-1;ae[n]&&(this._logLevelToUpload=n)}getQueue(){return this._queue}};j(Wn,"PRINT_LOG_TAG",!(Hn||ur||yu));var Xo=Wn,se=new Xo;var wu=(r=>(r.FaceDetector="FaceDetector",r.ImageSegmenter="ImageSegmenter",r))(wu||{}),Iu={FaceDetector:[pt,t=>t.detectForVideo.bind(t),"blaze_face_short_range.tflite"],ImageSegmenter:[nt,t=>t.segmentForVideo.bind(t),"selfie_segmenter_landscape.tflite"]},Xt=class Xt{constructor(e){this.path=e;j(this,"hashTasks");j(this,"hashResults");j(this,"taskModels");j(this,"vision");j(this,"video");this.hashTasks=new Map,this.hashResults=new Map,this.taskModels=new Map}get basePath(){return this.path}get models(){return this.taskModels}get visionWasm(){return this.vision}static getInstance(e){return C(this,null,function*(){if(e){if(Xt.instance&&Xt.instance.path===e)return Xt.instance;Xt.instance=new Xt(e),yield Xt.instance.initVision()}return Xt.instance})}preloadModels(e){return C(this,null,function*(){return yield Promise.all(e.map(r=>C(this,null,function*(){let n=this.getFinalUrl(`/mediapipe/${Iu[r][2]}`),i=yield this.getBlobUrl(n,!1);this.taskModels.set(r,i)}))).catch(r=>se.error(`preloadModels error: ${r}`))})}generateHash(e,r){return C(this,null,function*(){try{let n=this.normalizeOptions(r),i=JSON.stringify({taskType:e,options:n});return yield crypto.subtle.digest("SHA-256",new TextEncoder().encode(i)).then(o=>this.bufferToHex(o))}catch(n){throw new Error(`GenerateHash error: ${n}`)}})}normalizeOptions(e){let r={};for(let n of Object.keys(e).sort()){let i=e[n];i instanceof HTMLCanvasElement?r[n]={id:i.id}:typeof i=="object"&&i!==null?r[n]=this.normalizeOptions(i):r[n]=i}return r}bufferToHex(e){return Array.from(new Uint8Array(e)).map(r=>r.toString(16).padStart(2,"0")).join("")}register(e,r){return C(this,null,function*(){try{let n={baseOptions:{modelAssetPath:this.getModelUrl(e),delegate:"GPU"},runningMode:"VIDEO"};r!=null&&r.path&&n.baseOptions&&(n.baseOptions.modelAssetPath=r.path),r!=null&&r.canvas&&(n.canvas=r.canvas);let i=yield this.generateHash(e,n);if(!this.hashTasks.has(i)){let[o,s]=Iu[e],a=yield o.createFromOptions(this.vision,n),c=s(a);this.hashTasks.set(i,[a,c])}return i}catch(n){se.error(`Register error: ${n}`)}})}getResult(e){try{if(!this.hashResults.has(e)){if(!this.hashTasks.get(e))throw new Error("Unregistered hash");this.hashResults.set(e,this.reasoning(e))}return this.hashResults.get(e)}catch(r){se.error(`GetResult error: ${r}`)}}reasoning(e){let r=this.hashTasks.get(e)[1];return r(this.video,performance.now())}getModelUrl(e){return this.taskModels.get(e)}getFinalUrl(e){return`${this.path}/${e}`.replace(/([^:]\/)\/+/g,"$1")}initVision(){return C(this,null,function*(){try{let e=(yield Qt.isSimdSupported())?"vision_wasm_internal":"vision_wasm_nosimd_internal",r=this.getFinalUrl(`/mediapipe/${e}`),[n,i]=[`${r}.wasm.gz`,`${r}.js.gz`],[o,s]=yield Promise.all([this.getBlobUrl(n),this.getBlobUrl(i)]);this.vision=yield Qt.forVisionTasks(""),this.vision.wasmBinaryPath=o,this.vision.wasmLoaderPath=s}catch(e){se.error(`initVision error: ${e}`)}})}getBlobUrl(e,r=!0){return C(this,null,function*(){let n=yield fetch(e);if(!n.ok)throw new Error(`Failed to fetch ${e}: ${n.status} ${n.statusText};`);let i;if(r){let o=yield n.arrayBuffer();i=yield new Promise((s,a)=>{U1(new Uint8Array(o),(c,u)=>{c&&a(c),s(new Blob([u],{type:this.isWasmFile(u)?"application/wasm":"application/javascript"}))})})}else i=yield n.blob();if(!(i instanceof Blob))throw new Error("Decompressed data is not a valid Blob");return URL.createObjectURL(i)})}isWasmFile(e){return e.length>=4&&e[0]===0&&e[1]===97&&e[2]===115&&e[3]===109}resetHashResults(){this.hashResults=new Map}};j(Xt,"instance");var Yo=Xt;return Gu(gl);})();
41
+ `}C(){let t=this.g;t.activeTexture(t.TEXTURE1),this.j=ce(this,t),t.activeTexture(t.TEXTURE2),this.B=ce(this,t)}m(){super.m();let t=this.g;this.K=tt(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.L=tt(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.H=tt(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();let t=this.g;t.uniform1i(this.H,0),t.uniform1i(this.K,1),t.uniform1i(this.L,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function Xt(t,e){switch(e){case 0:return t.g.find(n=>n instanceof Uint8Array);case 1:return t.g.find(n=>n instanceof Float32Array);case 2:return t.g.find(n=>typeof WebGLTexture!="undefined"&&n instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function li(t){var e=Xt(t,1);if(!e){if(e=Xt(t,0))e=new Float32Array(e).map(r=>r/255);else{e=new Float32Array(t.width*t.height);let r=Ne(t);var n=hs(t);if(Er(n,r,L1(t)),"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(t.width*t.height*4),r.readPixels(0,0,t.width,t.height,r.RGBA,r.FLOAT,n);for(let i=0,s=0;i<e.length;++i,s+=4)e[i]=n[s]}else r.readPixels(0,0,t.width,t.height,r.RED,r.FLOAT,e)}t.g.push(e)}return e}function L1(t){let e=Xt(t,2);if(!e){let n=Ne(t);e=M1(t);let r=li(t),i=F1(t);n.texImage2D(n.TEXTURE_2D,0,i,t.width,t.height,0,n.RED,n.FLOAT,r),fi(t)}return e}function Ne(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=tt(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function F1(t){if(t=Ne(t),!Rn)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))Rn=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Rn=t.R16F}return Rn}function hs(t){return t.l||(t.l=new Ze),t.l}function M1(t){let e=Ne(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=Xt(t,2);return n||(n=ce(hs(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(n),t.j=!0),e.bindTexture(e.TEXTURE_2D,n),n}function fi(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var Rn,Y=class{constructor(t,e,n,r,i,s,o){this.g=t,this.m=e,this.j=n,this.canvas=r,this.l=i,this.width=s,this.height=o,this.j&&--bo===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!Xt(this,0)}ja(){return!!Xt(this,1)}R(){return!!Xt(this,2)}ia(){return(e=Xt(t=this,0))||(e=li(t),e=new Uint8Array(e.map(n=>255*n)),t.g.push(e)),e;var t,e}ha(){return li(this)}N(){return L1(this)}clone(){let t=[];for(let e of this.g){let n;if(e instanceof Uint8Array)n=new Uint8Array(e);else if(e instanceof Float32Array)n=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{let r=Ne(this),i=hs(this);r.activeTexture(r.TEXTURE1),n=ce(i,r,this.m?r.LINEAR:r.NEAREST),r.bindTexture(r.TEXTURE_2D,n);let s=F1(this);r.texImage2D(r.TEXTURE_2D,0,s,this.width,this.height,0,r.RED,r.FLOAT,null),r.bindTexture(r.TEXTURE_2D,null),Er(i,r,n),Tn(i,r,!1,()=>{M1(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),fi(this)}),as(i),fi(this)}}t.push(n)}return new Y(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Ne(this).deleteTexture(Xt(this,2)),bo=-1}};Y.prototype.close=Y.prototype.close,Y.prototype.clone=Y.prototype.clone,Y.prototype.getAsWebGLTexture=Y.prototype.N,Y.prototype.getAsFloat32Array=Y.prototype.ha,Y.prototype.getAsUint8Array=Y.prototype.ia,Y.prototype.hasWebGLTexture=Y.prototype.R,Y.prototype.hasFloat32Array=Y.prototype.ja,Y.prototype.hasUint8Array=Y.prototype.Da;var bo=250,zh={color:"white",lineWidth:4,radius:6};function Wr(t){return Cr(Cs(Cr({},zh),{fillColor:(t=t||{}).color}),t)}function jt(t,e){return t instanceof Function?t(e):t}function xo(t,e,n){return Math.max(Math.min(e,n),Math.min(Math.max(e,n),t))}function sn(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function yn(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function ko(t,e,n){var r;if(e.R())n(e.N());else{let i=e.ja()?e.ha():e.ia();t.m=(r=t.m)!=null?r:new Ze;let s=yn(t);n((t=new Y([i],e.m,!1,s.canvas,t.m,e.width,e.height)).N()),t.close()}}function So(t,e,n,r){let i=function(a){return a.g||(a.g=new Nh),a.g}(t),s=yn(t),o=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;Tn(i,s,!0,()=>{(function(h,c,l,u){let f=h.g;if(f.activeTexture(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,c),f.activeTexture(f.TEXTURE1),f.bindTexture(f.TEXTURE_2D,h.B),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,l),h.H&&function(w,_){if(w!==_)return!1;w=w.entries(),_=_.entries();for(let[B,H]of w){w=B;let st=H;var E=_.next();if(E.done)return!1;let[U,Qe]=E.value;if(E=Qe,w!==U||st[0]!==E[0]||st[1]!==E[1]||st[2]!==E[2]||st[3]!==E[3])return!1}return!!_.next().done}(h.H,u))f.activeTexture(f.TEXTURE2),f.bindTexture(f.TEXTURE_2D,h.j);else{h.H=u;let w=Array(1024).fill(0);u.forEach((_,E)=>{if(_.length!==4)throw Error(`Color at index ${E} is not a four-channel value.`);w[4*E]=_[0],w[4*E+1]=_[1],w[4*E+2]=_[2],w[4*E+3]=_[3]}),f.activeTexture(f.TEXTURE2),f.bindTexture(f.TEXTURE_2D,h.j),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,256,1,0,f.RGBA,f.UNSIGNED_BYTE,new Uint8Array(w))}})(i,e,o,r),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);let a=i.g;a.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)})}function Lo(t,e,n,r){let i=yn(t),s=function(h){return h.h||(h.h=new Gh),h.h}(t),o=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n,a=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;Tn(s,i,!0,()=>{var h=s.g;h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e),h.activeTexture(h.TEXTURE1),h.bindTexture(h.TEXTURE_2D,s.j),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,o),h.activeTexture(h.TEXTURE2),h.bindTexture(h.TEXTURE_2D,s.B),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,a),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),i.bindTexture(i.TEXTURE_2D,null),(h=s.g).activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,null),h.activeTexture(h.TEXTURE1),h.bindTexture(h.TEXTURE_2D,null),h.activeTexture(h.TEXTURE2),h.bindTexture(h.TEXTURE_2D,null)})}var ot=class{constructor(t,e){typeof CanvasRenderingContext2D!="undefined"&&t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}wa(t,e){if(t){var n=sn(this);e=Wr(e),n.save();var r=n.canvas,i=0;for(let s of t)n.fillStyle=jt(e.fillColor,{index:i,from:s}),n.strokeStyle=jt(e.color,{index:i,from:s}),n.lineWidth=jt(e.lineWidth,{index:i,from:s}),(t=new Path2D).arc(s.x*r.width,s.y*r.height,jt(e.radius,{index:i,from:s}),0,2*Math.PI),n.fill(t),n.stroke(t),++i;n.restore()}}va(t,e,n){if(t&&e){var r=sn(this);n=Wr(n),r.save();var i=r.canvas,s=0;for(let o of e){r.beginPath(),e=t[o.start];let a=t[o.end];e&&a&&(r.strokeStyle=jt(n.color,{index:s,from:e,to:a}),r.lineWidth=jt(n.lineWidth,{index:s,from:e,to:a}),r.moveTo(e.x*i.width,e.y*i.height),r.lineTo(a.x*i.width,a.y*i.height)),++s,r.stroke()}r.restore()}}sa(t,e){let n=sn(this);e=Wr(e),n.save(),n.beginPath(),n.lineWidth=jt(e.lineWidth,{}),n.strokeStyle=jt(e.color,{}),n.fillStyle=jt(e.fillColor,{}),n.moveTo(t.originX,t.originY),n.lineTo(t.originX+t.width,t.originY),n.lineTo(t.originX+t.width,t.originY+t.height),n.lineTo(t.originX,t.originY+t.height),n.lineTo(t.originX,t.originY),n.stroke(),n.fill(),n.restore()}ta(t,e,n=[0,0,0,255]){this.l?function(r,i,s,o){let a=yn(r);ko(r,i,h=>{So(r,h,s,o),(h=sn(r)).drawImage(a.canvas,0,0,h.canvas.width,h.canvas.height)})}(this,t,n,e):So(this,t.N(),n,e)}ua(t,e,n){this.l?function(r,i,s,o){let a=yn(r);ko(r,i,h=>{Lo(r,h,s,o),(h=sn(r)).drawImage(a.canvas,0,0,h.canvas.width,h.canvas.height)})}(this,t,e,n):Lo(this,t.N(),e,n)}close(){var t,e,n;(t=this.g)==null||t.close(),this.g=void 0,(e=this.h)==null||e.close(),this.h=void 0,(n=this.m)==null||n.close(),this.m=void 0}};function Ot(t,e){switch(e){case 0:return t.g.find(n=>n instanceof ImageData);case 1:return t.g.find(n=>typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap);case 2:return t.g.find(n=>typeof WebGLTexture!="undefined"&&n instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function R1(t){var e=Ot(t,0);if(!e){e=Ge(t);let n=Tr(t),r=new Uint8Array(t.width*t.height*4);Er(n,e,Nn(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,r),as(n),e=new ImageData(new Uint8ClampedArray(r.buffer),t.width,t.height),t.g.push(e)}return e}function Nn(t){let e=Ot(t,2);if(!e){let n=Ge(t);e=Gn(t);let r=Ot(t,1)||R1(t);n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,r),an(t)}return e}function Ge(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=tt(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Tr(t){return t.l||(t.l=new Ze),t.l}function Gn(t){let e=Ge(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=Ot(t,2);return n||(n=ce(Tr(t),e),t.g.push(n),t.m=!0),e.bindTexture(e.TEXTURE_2D,n),n}function an(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function Fo(t){let e=Ge(t);return Tn(Tr(t),e,!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}(t,()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))}ot.prototype.close=ot.prototype.close,ot.prototype.drawConfidenceMask=ot.prototype.ua,ot.prototype.drawCategoryMask=ot.prototype.ta,ot.prototype.drawBoundingBox=ot.prototype.sa,ot.prototype.drawConnectors=ot.prototype.va,ot.prototype.drawLandmarks=ot.prototype.wa,ot.lerp=function(t,e,n,r,i){return xo(r*(1-(t-e)/(n-e))+i*(1-(n-t)/(n-e)),r,i)},ot.clamp=xo;var Z=class{constructor(t,e,n,r,i,s,o){this.g=t,this.j=e,this.m=n,this.canvas=r,this.l=i,this.width=s,this.height=o,(this.j||this.m)&&--Mo===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!Ot(this,0)}ka(){return!!Ot(this,1)}R(){return!!Ot(this,2)}Aa(){return R1(this)}za(){var t=Ot(this,1);return t||(Nn(this),Gn(this),t=Fo(this),an(this),this.g.push(t),this.j=!0),t}N(){return Nn(this)}clone(){let t=[];for(let e of this.g){let n;if(e instanceof ImageData)n=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){let r=Ge(this),i=Tr(this);r.activeTexture(r.TEXTURE1),n=ce(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),Er(i,r,n),Tn(i,r,!1,()=>{Gn(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),an(this)}),as(i),an(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);Nn(this),Gn(this),n=Fo(this),an(this)}t.push(n)}return new Z(t,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Ot(this,1).close(),this.m&&Ge(this).deleteTexture(Ot(this,2)),Mo=-1}};Z.prototype.close=Z.prototype.close,Z.prototype.clone=Z.prototype.clone,Z.prototype.getAsWebGLTexture=Z.prototype.N,Z.prototype.getAsImageBitmap=Z.prototype.za,Z.prototype.getAsImageData=Z.prototype.Aa,Z.prototype.hasWebGLTexture=Z.prototype.R,Z.prototype.hasImageBitmap=Z.prototype.ka,Z.prototype.hasImageData=Z.prototype.Ca;var Mo=250;function Ut(...t){return t.map(([e,n])=>({start:e,end:n}))}var jh=function(t){return class extends t{Ha(){this.i._registerModelResourcesGraphService()}}}((Ro=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",e!==void 0?this.i.canvas=e:k1()?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"))}initializeGraph(t){return X(this,null,function*(){let e=yield(yield fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)})}setGraphFromString(t){this.setGraph(new TextEncoder().encode(t),!1)}setGraph(t,e){let n=t.length,r=this.i._malloc(n);this.i.HEAPU8.set(t,r),e?this.i._changeBinaryGraph(n,r):this.i._changeTextGraph(n,r),this.i._free(r)}configureAudio(t,e,n,r,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),m(this,r||"input_audio",s=>{m(this,i=i||"audio_header",o=>{this.i._configureAudio(s,o,t,e!=null?e:0,n)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){Ct(this,"__graph_config__",e=>{t(e)}),m(this,"__graph_config__",e=>{this.i._getGraphConfig(e,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){let s=4*t.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(t,this.g/4),m(this,r,o=>{this.i._addAudioToInputStream(this.g,e,n,o,i)})}addGpuBufferToStream(t,e,n){m(this,e,r=>{let[i,s]=wo(this,t,r);this.i._addBoundTextureToStream(r,i,s,n)})}addBoolToStream(t,e,n){m(this,e,r=>{this.i._addBoolToInputStream(t,r,n)})}addDoubleToStream(t,e,n){m(this,e,r=>{this.i._addDoubleToInputStream(t,r,n)})}addFloatToStream(t,e,n){m(this,e,r=>{this.i._addFloatToInputStream(t,r,n)})}addIntToStream(t,e,n){m(this,e,r=>{this.i._addIntToInputStream(t,r,n)})}addUintToStream(t,e,n){m(this,e,r=>{this.i._addUintToInputStream(t,r,n)})}addStringToStream(t,e,n){m(this,e,r=>{m(this,t,i=>{this.i._addStringToInputStream(i,r,n)})})}addStringRecordToStream(t,e,n){m(this,e,r=>{_o(this,Object.keys(t),i=>{_o(this,Object.values(t),s=>{this.i._addFlatHashMapToInputStream(i,s,Object.keys(t).length,r,n)})})})}addProtoToStream(t,e,n,r){m(this,n,i=>{m(this,e,s=>{let o=this.i._malloc(t.length);this.i.HEAPU8.set(t,o),this.i._addProtoToInputStream(o,t.length,s,i,r),this.i._free(o)})})}addEmptyPacketToStream(t,e){m(this,t,n=>{this.i._addEmptyPacketToInputStream(n,e)})}addBoolVectorToStream(t,e,n){m(this,e,r=>{let i=this.i._allocateBoolVector(t.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(let s of t)this.i._addBoolVectorEntry(i,s);this.i._addBoolVectorToInputStream(i,r,n)})}addDoubleVectorToStream(t,e,n){m(this,e,r=>{let i=this.i._allocateDoubleVector(t.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(let s of t)this.i._addDoubleVectorEntry(i,s);this.i._addDoubleVectorToInputStream(i,r,n)})}addFloatVectorToStream(t,e,n){m(this,e,r=>{let i=this.i._allocateFloatVector(t.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(let s of t)this.i._addFloatVectorEntry(i,s);this.i._addFloatVectorToInputStream(i,r,n)})}addIntVectorToStream(t,e,n){m(this,e,r=>{let i=this.i._allocateIntVector(t.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(let s of t)this.i._addIntVectorEntry(i,s);this.i._addIntVectorToInputStream(i,r,n)})}addUintVectorToStream(t,e,n){m(this,e,r=>{let i=this.i._allocateUintVector(t.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(let s of t)this.i._addUintVectorEntry(i,s);this.i._addUintVectorToInputStream(i,r,n)})}addStringVectorToStream(t,e,n){m(this,e,r=>{let i=this.i._allocateStringVector(t.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(let s of t)m(this,s,o=>{this.i._addStringVectorEntry(i,o)});this.i._addStringVectorToInputStream(i,r,n)})}addBoolToInputSidePacket(t,e){m(this,e,n=>{this.i._addBoolToInputSidePacket(t,n)})}addDoubleToInputSidePacket(t,e){m(this,e,n=>{this.i._addDoubleToInputSidePacket(t,n)})}addFloatToInputSidePacket(t,e){m(this,e,n=>{this.i._addFloatToInputSidePacket(t,n)})}addIntToInputSidePacket(t,e){m(this,e,n=>{this.i._addIntToInputSidePacket(t,n)})}addUintToInputSidePacket(t,e){m(this,e,n=>{this.i._addUintToInputSidePacket(t,n)})}addStringToInputSidePacket(t,e){m(this,e,n=>{m(this,t,r=>{this.i._addStringToInputSidePacket(r,n)})})}addProtoToInputSidePacket(t,e,n){m(this,n,r=>{m(this,e,i=>{let s=this.i._malloc(t.length);this.i.HEAPU8.set(t,s),this.i._addProtoToInputSidePacket(s,t.length,i,r),this.i._free(s)})})}addBoolVectorToInputSidePacket(t,e){m(this,e,n=>{let r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let i of t)this.i._addBoolVectorEntry(r,i);this.i._addBoolVectorToInputSidePacket(r,n)})}addDoubleVectorToInputSidePacket(t,e){m(this,e,n=>{let r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let i of t)this.i._addDoubleVectorEntry(r,i);this.i._addDoubleVectorToInputSidePacket(r,n)})}addFloatVectorToInputSidePacket(t,e){m(this,e,n=>{let r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let i of t)this.i._addFloatVectorEntry(r,i);this.i._addFloatVectorToInputSidePacket(r,n)})}addIntVectorToInputSidePacket(t,e){m(this,e,n=>{let r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let i of t)this.i._addIntVectorEntry(r,i);this.i._addIntVectorToInputSidePacket(r,n)})}addUintVectorToInputSidePacket(t,e){m(this,e,n=>{let r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let i of t)this.i._addUintVectorEntry(r,i);this.i._addUintVectorToInputSidePacket(r,n)})}addStringVectorToInputSidePacket(t,e){m(this,e,n=>{let r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let i of t)m(this,i,s=>{this.i._addStringVectorEntry(r,s)});this.i._addStringVectorToInputSidePacket(r,n)})}attachBoolListener(t,e){Ct(this,t,e),m(this,t,n=>{this.i._attachBoolListener(n)})}attachBoolVectorListener(t,e){te(this,t,e),m(this,t,n=>{this.i._attachBoolVectorListener(n)})}attachIntListener(t,e){Ct(this,t,e),m(this,t,n=>{this.i._attachIntListener(n)})}attachIntVectorListener(t,e){te(this,t,e),m(this,t,n=>{this.i._attachIntVectorListener(n)})}attachUintListener(t,e){Ct(this,t,e),m(this,t,n=>{this.i._attachUintListener(n)})}attachUintVectorListener(t,e){te(this,t,e),m(this,t,n=>{this.i._attachUintVectorListener(n)})}attachDoubleListener(t,e){Ct(this,t,e),m(this,t,n=>{this.i._attachDoubleListener(n)})}attachDoubleVectorListener(t,e){te(this,t,e),m(this,t,n=>{this.i._attachDoubleVectorListener(n)})}attachFloatListener(t,e){Ct(this,t,e),m(this,t,n=>{this.i._attachFloatListener(n)})}attachFloatVectorListener(t,e){te(this,t,e),m(this,t,n=>{this.i._attachFloatVectorListener(n)})}attachStringListener(t,e){Ct(this,t,e),m(this,t,n=>{this.i._attachStringListener(n)})}attachStringVectorListener(t,e){te(this,t,e),m(this,t,n=>{this.i._attachStringVectorListener(n)})}attachProtoListener(t,e,n){Ct(this,t,e),m(this,t,r=>{this.i._attachProtoListener(r,n||!1)})}attachProtoVectorListener(t,e,n){te(this,t,e),m(this,t,r=>{this.i._attachProtoVectorListener(r,n||!1)})}attachAudioListener(t,e,n){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Ct(this,t,(r,i)=>{r=new Float32Array(r.buffer,r.byteOffset,r.length/4),e(r,i)}),m(this,t,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 Ro{get ea(){return this.i}oa(t,e,n){m(this,e,r=>{let[i,s]=wo(this,t,r);this.ea._addBoundTextureAsImageToStream(r,i,s,n)})}V(t,e){Ct(this,t,e),m(this,t,n=>{this.ea._attachImageListener(n)})}ba(t,e){te(this,t,e),m(this,t,n=>{this.ea._attachImageVectorListener(n)})}})),Ro,St=class extends jh{};function T(t,e,n){return X(this,null,function*(){var r;return function(i,s,o,a){return X(this,null,function*(){return Bh(i,s,o,a)})}(t,(r=n.canvas)!=null?r:k1()?void 0:document.createElement("canvas"),e,n)})}function I1(t,e,n,r){if(t.U){let s=new e1;if(n!=null&&n.regionOfInterest){if(!t.na)throw Error("This task doesn't support region-of-interest.");var i=n.regionOfInterest;if(i.left>=i.right||i.top>=i.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(i.left<0||i.top<0||i.right>1||i.bottom>1)throw Error("Expected RectF values to be in [0,1].");g(s,1,(i.left+i.right)/2),g(s,2,(i.top+i.bottom)/2),g(s,4,i.right-i.left),g(s,3,i.bottom-i.top)}else g(s,1,.5),g(s,2,.5),g(s,4,1),g(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(g(s,5,-Math.PI*n.rotationDegrees/180),(n==null?void 0:n.rotationDegrees)%180!=0){let[o,a]=S1(e);n=j(s,3)*a/o,i=j(s,4)*o/a,g(s,4,n),g(s,3,i)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.U,r)}t.g.oa(e,t.Z,r!=null?r:performance.now()),t.finishProcessing()}function Lt(t,e,n){var r;if((r=t.baseOptions)!=null&&r.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");I1(t,e,n,t.B+1)}function Gt(t,e,n,r){var i;if(!((i=t.baseOptions)!=null&&i.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");I1(t,e,n,r)}function ze(t,e,n,r){var i=e.data;let s=e.width,o=s*(e=e.height);if((i instanceof Uint8Array||i instanceof Float32Array)&&i.length!==o)throw Error("Unsupported channel count: "+i.length/o);return t=new Y([i],n,!1,t.g.i.canvas,t.P,s,e),r?t.clone():t}var ct=class extends ci{constructor(t,e,n,r){super(t),this.g=t,this.Z=e,this.U=n,this.na=r,this.P=new Ze}l(t,e=!0){if("runningMode"in t&&mn(this.baseOptions,2,!!t.runningMode&&t.runningMode!=="IMAGE"),t.canvas!==void 0&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.P.close(),super.close()}};ct.prototype.close=ct.prototype.close;var at=class extends ct{constructor(t,e){super(new St(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},y(t=this.h=new vr,0,1,e=new D),g(this.h,2,.5),g(this.h,3,.3)}get baseOptions(){return b(this.h,D,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){var e,n;return"minDetectionConfidence"in t&&g(this.h,2,(e=t.minDetectionConfidence)!=null?e:.5),"minSuppressionThreshold"in t&&g(this.h,3,(n=t.minSuppressionThreshold)!=null?n:.3),this.l(t)}D(t,e){return this.j={detections:[]},Lt(this,t,e),this.j}F(t,e,n){return this.j={detections:[]},Gt(this,t,n,e),this.j}m(){var t=new ut;I(t,"image_in"),I(t,"norm_rect_in"),x(t,"detections");let e=new mt;Mt(e,bh,this.h);let n=new et;yt(n,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),R(n,"IMAGE:image_in"),R(n,"NORM_RECT:norm_rect_in"),A(n,"DETECTIONS:detections"),n.o(e),wt(t,n),this.g.attachProtoVectorListener("detections",(r,i)=>{for(let s of r)r=Ja(s),this.j.detections.push(b1(r));d(this,i)}),this.g.attachEmptyPacketListener("detections",r=>{d(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};at.prototype.detectForVideo=at.prototype.F,at.prototype.detect=at.prototype.D,at.prototype.setOptions=at.prototype.o,at.createFromModelPath=function(t,e){return X(this,null,function*(){return T(at,t,{baseOptions:{modelAssetPath:e}})})},at.createFromModelBuffer=function(t,e){return T(at,t,{baseOptions:{modelAssetBuffer:e}})},at.createFromOptions=function(t,e){return T(at,t,e)};var cs=Ut([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]),us=Ut([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]),ls=Ut([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),U1=Ut([474,475],[475,476],[476,477],[477,474]),fs=Ut([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]),ds=Ut([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),C1=Ut([469,470],[470,471],[471,472],[472,469]),ps=Ut([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]),P1=[...cs,...us,...ls,...fs,...ds,...ps],D1=Ut([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 Io(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var N=class extends ct{constructor(t,e){super(new St(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,y(t=this.h=new o1,0,1,e=new D),this.v=new s1,y(this.h,0,3,this.v),this.s=new vr,y(this.h,0,2,this.s),Nt(this.s,4,1),g(this.s,2,.5),g(this.v,2,.5),g(this.h,4,.5)}get baseOptions(){return b(this.h,D,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){var e,n,r,i;return"numFaces"in t&&Nt(this.s,4,(e=t.numFaces)!=null?e:1),"minFaceDetectionConfidence"in t&&g(this.s,2,(n=t.minFaceDetectionConfidence)!=null?n:.5),"minTrackingConfidence"in t&&g(this.h,4,(r=t.minTrackingConfidence)!=null?r:.5),"minFacePresenceConfidence"in t&&g(this.v,2,(i=t.minFacePresenceConfidence)!=null?i:.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}D(t,e){return Io(this),Lt(this,t,e),this.j}F(t,e,n){return Io(this),Gt(this,t,n,e),this.j}m(){var t=new ut;I(t,"image_in"),I(t,"norm_rect"),x(t,"face_landmarks");let e=new mt;Mt(e,kh,this.h);let n=new et;yt(n,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),R(n,"IMAGE:image_in"),R(n,"NORM_RECT:norm_rect"),A(n,"NORM_LANDMARKS:face_landmarks"),n.o(e),wt(t,n),this.g.attachProtoVectorListener("face_landmarks",(r,i)=>{for(let s of r)r=En(s),this.j.faceLandmarks.push(yr(r));d(this,i)}),this.g.attachEmptyPacketListener("face_landmarks",r=>{d(this,r)}),this.outputFaceBlendshapes&&(x(t,"blendshapes"),A(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(r,i)=>{var s;if(this.outputFaceBlendshapes)for(let o of r)r=mr(o),this.j.faceBlendshapes.push(ss((s=r.g())!=null?s:[]));d(this,i)}),this.g.attachEmptyPacketListener("blendshapes",r=>{d(this,r)})),this.outputFacialTransformationMatrixes&&(x(t,"face_geometry"),A(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(r,i)=>{var s,o,a,h,c;if(this.outputFacialTransformationMatrixes)for(let l of r)(r=b(xh(l),mh,2))&&this.j.facialTransformationMatrixes.push({rows:(o=(s=xt(r,1))!=null?s:0)!=null?o:0,columns:(h=(a=xt(r,2))!=null?a:0)!=null?h:0,data:(c=me(r,3,le,ge()).slice())!=null?c:[]});d(this,i)}),this.g.attachEmptyPacketListener("face_geometry",r=>{d(this,r)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};N.prototype.detectForVideo=N.prototype.F,N.prototype.detect=N.prototype.D,N.prototype.setOptions=N.prototype.o,N.createFromModelPath=function(t,e){return T(N,t,{baseOptions:{modelAssetPath:e}})},N.createFromModelBuffer=function(t,e){return T(N,t,{baseOptions:{modelAssetBuffer:e}})},N.createFromOptions=function(t,e){return T(N,t,e)},N.FACE_LANDMARKS_LIPS=cs,N.FACE_LANDMARKS_LEFT_EYE=us,N.FACE_LANDMARKS_LEFT_EYEBROW=ls,N.FACE_LANDMARKS_LEFT_IRIS=U1,N.FACE_LANDMARKS_RIGHT_EYE=fs,N.FACE_LANDMARKS_RIGHT_EYEBROW=ds,N.FACE_LANDMARKS_RIGHT_IRIS=C1,N.FACE_LANDMARKS_FACE_OVAL=ps,N.FACE_LANDMARKS_CONTOURS=P1,N.FACE_LANDMARKS_TESSELATION=D1;var Pt=class extends ct{constructor(t,e){super(new St(t,e),"image_in","norm_rect",!0),y(t=this.j=new h1,0,1,e=new D)}get baseOptions(){return b(this.j,D,1)}set baseOptions(t){y(this.j,0,1,t)}o(t){return super.l(t)}Ka(t,e,n){let r=typeof e!="function"?e:{};if(this.h=typeof e=="function"?e:n,Lt(this,t,r!=null?r:{}),!this.h)return this.s}m(){var t=new ut;I(t,"image_in"),I(t,"norm_rect"),x(t,"stylized_image");let e=new mt;Mt(e,Sh,this.j);let n=new et;yt(n,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),R(n,"IMAGE:image_in"),R(n,"NORM_RECT:norm_rect"),A(n,"STYLIZED_IMAGE:stylized_image"),n.o(e),wt(t,n),this.g.V("stylized_image",(r,i)=>{var s=!this.h,o=r.data,a=r.width;let h=a*(r=r.height);if(o instanceof Uint8Array)if(o.length===3*h){let c=new Uint8ClampedArray(4*h);for(let l=0;l<h;++l)c[4*l]=o[3*l],c[4*l+1]=o[3*l+1],c[4*l+2]=o[3*l+2],c[4*l+3]=255;o=new ImageData(c,a,r)}else{if(o.length!==4*h)throw Error("Unsupported channel count: "+o.length/h);o=new ImageData(new Uint8ClampedArray(o.buffer,o.byteOffset,o.length),a,r)}else if(!(o instanceof WebGLTexture))throw Error(`Unsupported format: ${o.constructor.name}`);a=new Z([o],!1,!1,this.g.i.canvas,this.P,a,r),this.s=s=s?a.clone():a,this.h&&this.h(s),d(this,i)}),this.g.attachEmptyPacketListener("stylized_image",r=>{this.s=null,this.h&&this.h(null),d(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Pt.prototype.stylize=Pt.prototype.Ka,Pt.prototype.setOptions=Pt.prototype.o,Pt.createFromModelPath=function(t,e){return T(Pt,t,{baseOptions:{modelAssetPath:e}})},Pt.createFromModelBuffer=function(t,e){return T(Pt,t,{baseOptions:{modelAssetBuffer:e}})},Pt.createFromOptions=function(t,e){return T(Pt,t,e)};var gs=Ut([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 Uo(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function Co(t){return t.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function Po(t,e=!0){var i,s,o,a,h,c;let n=[];for(let l of t){var r=mr(l);t=[];for(let u of r.g())r=e&&xt(u,1)!=null?(i=xt(u,1))!=null?i:0:-1,t.push({score:(s=j(u,2))!=null?s:0,index:r,categoryName:(a=(o=kt(u,3))!=null?o:"")!=null?a:"",displayName:(c=(h=kt(u,4))!=null?h:"")!=null?c:""});n.push(t)}return n}var lt=class extends ct{constructor(t,e){super(new St(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],y(t=this.j=new l1,0,1,e=new D),this.s=new es,y(this.j,0,2,this.s),this.C=new ts,y(this.s,0,3,this.C),this.v=new u1,y(this.s,0,2,this.v),this.h=new Lh,y(this.j,0,3,this.h),g(this.v,2,.5),g(this.s,4,.5),g(this.C,2,.5)}get baseOptions(){return b(this.j,D,1)}set baseOptions(t){y(this.j,0,1,t)}o(t){var i,s,o,a,h,c,l,u;if(Nt(this.v,3,(i=t.numHands)!=null?i:1),"minHandDetectionConfidence"in t&&g(this.v,2,(s=t.minHandDetectionConfidence)!=null?s:.5),"minTrackingConfidence"in t&&g(this.s,4,(o=t.minTrackingConfidence)!=null?o:.5),"minHandPresenceConfidence"in t&&g(this.C,2,(a=t.minHandPresenceConfidence)!=null?a:.5),t.cannedGesturesClassifierOptions){var e=new xe,n=e,r=hi(t.cannedGesturesClassifierOptions,(h=b(this.h,xe,3))==null?void 0:h.h());y(n,0,2,r),y(this.h,0,3,e)}else t.cannedGesturesClassifierOptions===void 0&&((c=b(this.h,xe,3))==null||c.g());return t.customGesturesClassifierOptions?(y(n=e=new xe,0,2,r=hi(t.customGesturesClassifierOptions,(l=b(this.h,xe,4))==null?void 0:l.h())),y(this.h,0,4,e)):t.customGesturesClassifierOptions===void 0&&((u=b(this.h,xe,4))==null||u.g()),this.l(t)}Fa(t,e){return Uo(this),Lt(this,t,e),Co(this)}Ga(t,e,n){return Uo(this),Gt(this,t,n,e),Co(this)}m(){var t=new ut;I(t,"image_in"),I(t,"norm_rect"),x(t,"hand_gestures"),x(t,"hand_landmarks"),x(t,"world_hand_landmarks"),x(t,"handedness");let e=new mt;Mt(e,Fh,this.j);let n=new et;yt(n,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),R(n,"IMAGE:image_in"),R(n,"NORM_RECT:norm_rect"),A(n,"HAND_GESTURES:hand_gestures"),A(n,"LANDMARKS:hand_landmarks"),A(n,"WORLD_LANDMARKS:world_hand_landmarks"),A(n,"HANDEDNESS:handedness"),n.o(e),wt(t,n),this.g.attachProtoVectorListener("hand_landmarks",(r,i)=>{var s,o,a,h;for(let c of r){r=En(c);let l=[];for(let u of Yt(r,t1,1))l.push({x:(s=j(u,1))!=null?s:0,y:(o=j(u,2))!=null?o:0,z:(a=j(u,3))!=null?a:0,visibility:(h=j(u,4))!=null?h:0});this.landmarks.push(l)}d(this,i)}),this.g.attachEmptyPacketListener("hand_landmarks",r=>{d(this,r)}),this.g.attachProtoVectorListener("world_hand_landmarks",(r,i)=>{var s,o,a,h;for(let c of r){r=Me(c);let l=[];for(let u of Yt(r,Qa,1))l.push({x:(s=j(u,1))!=null?s:0,y:(o=j(u,2))!=null?o:0,z:(a=j(u,3))!=null?a:0,visibility:(h=j(u,4))!=null?h:0});this.worldLandmarks.push(l)}d(this,i)}),this.g.attachEmptyPacketListener("world_hand_landmarks",r=>{d(this,r)}),this.g.attachProtoVectorListener("hand_gestures",(r,i)=>{this.gestures.push(...Po(r,!1)),d(this,i)}),this.g.attachEmptyPacketListener("hand_gestures",r=>{d(this,r)}),this.g.attachProtoVectorListener("handedness",(r,i)=>{this.handedness.push(...Po(r)),d(this,i)}),this.g.attachEmptyPacketListener("handedness",r=>{d(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Do(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}lt.prototype.recognizeForVideo=lt.prototype.Ga,lt.prototype.recognize=lt.prototype.Fa,lt.prototype.setOptions=lt.prototype.o,lt.createFromModelPath=function(t,e){return T(lt,t,{baseOptions:{modelAssetPath:e}})},lt.createFromModelBuffer=function(t,e){return T(lt,t,{baseOptions:{modelAssetBuffer:e}})},lt.createFromOptions=function(t,e){return T(lt,t,e)},lt.HAND_CONNECTIONS=gs;var ft=class extends ct{constructor(t,e){super(new St(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],y(t=this.h=new es,0,1,e=new D),this.s=new ts,y(this.h,0,3,this.s),this.j=new u1,y(this.h,0,2,this.j),Nt(this.j,3,1),g(this.j,2,.5),g(this.s,2,.5),g(this.h,4,.5)}get baseOptions(){return b(this.h,D,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){var e,n,r,i;return"numHands"in t&&Nt(this.j,3,(e=t.numHands)!=null?e:1),"minHandDetectionConfidence"in t&&g(this.j,2,(n=t.minHandDetectionConfidence)!=null?n:.5),"minTrackingConfidence"in t&&g(this.h,4,(r=t.minTrackingConfidence)!=null?r:.5),"minHandPresenceConfidence"in t&&g(this.s,2,(i=t.minHandPresenceConfidence)!=null?i:.5),this.l(t)}D(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Lt(this,t,e),Do(this)}F(t,e,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Gt(this,t,n,e),Do(this)}m(){var t=new ut;I(t,"image_in"),I(t,"norm_rect"),x(t,"hand_landmarks"),x(t,"world_hand_landmarks"),x(t,"handedness");let e=new mt;Mt(e,Mh,this.h);let n=new et;yt(n,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),R(n,"IMAGE:image_in"),R(n,"NORM_RECT:norm_rect"),A(n,"LANDMARKS:hand_landmarks"),A(n,"WORLD_LANDMARKS:world_hand_landmarks"),A(n,"HANDEDNESS:handedness"),n.o(e),wt(t,n),this.g.attachProtoVectorListener("hand_landmarks",(r,i)=>{for(let s of r)r=En(s),this.landmarks.push(yr(r));d(this,i)}),this.g.attachEmptyPacketListener("hand_landmarks",r=>{d(this,r)}),this.g.attachProtoVectorListener("world_hand_landmarks",(r,i)=>{for(let s of r)r=Me(s),this.worldLandmarks.push(ln(r));d(this,i)}),this.g.attachEmptyPacketListener("world_hand_landmarks",r=>{d(this,r)}),this.g.attachProtoVectorListener("handedness",(r,i)=>{var h,c,l,u,f,w,_;var s=this.handedness,o=s.push;let a=[];for(let E of r){r=mr(E);let B=[];for(let H of r.g())B.push({score:(h=j(H,2))!=null?h:0,index:(l=(c=xt(H,1))!=null?c:0)!=null?l:-1,categoryName:(f=(u=kt(H,3))!=null?u:"")!=null?f:"",displayName:(_=(w=kt(H,4))!=null?w:"")!=null?_:""});a.push(B)}o.call(s,...a),d(this,i)}),this.g.attachEmptyPacketListener("handedness",r=>{d(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ft.prototype.detectForVideo=ft.prototype.F,ft.prototype.detect=ft.prototype.D,ft.prototype.setOptions=ft.prototype.o,ft.createFromModelPath=function(t,e){return T(ft,t,{baseOptions:{modelAssetPath:e}})},ft.createFromModelBuffer=function(t,e){return T(ft,t,{baseOptions:{modelAssetBuffer:e}})},ft.createFromOptions=function(t,e){return T(ft,t,e)},ft.HAND_CONNECTIONS=gs;var O1=Ut([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 Oo(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function Bo(t){try{if(!t.C)return t.h;t.C(t.h)}finally{_r(t)}}function In(t,e){t=En(t),e.push(yr(t))}var C=class extends ct{constructor(t,e){super(new St(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,y(t=this.j=new m1,0,1,e=new D),this.K=new ts,y(this.j,0,2,this.K),this.Y=new Rh,y(this.j,0,3,this.Y),this.s=new vr,y(this.j,0,4,this.s),this.H=new s1,y(this.j,0,5,this.H),this.v=new p1,y(this.j,0,6,this.v),this.L=new g1,y(this.j,0,7,this.L),g(this.s,2,.5),g(this.s,3,.3),g(this.H,2,.5),g(this.v,2,.5),g(this.v,3,.3),g(this.L,2,.5),g(this.K,2,.5)}get baseOptions(){return b(this.j,D,1)}set baseOptions(t){y(this.j,0,1,t)}o(t){var e,n,r,i,s,o,a;return"minFaceDetectionConfidence"in t&&g(this.s,2,(e=t.minFaceDetectionConfidence)!=null?e:.5),"minFaceSuppressionThreshold"in t&&g(this.s,3,(n=t.minFaceSuppressionThreshold)!=null?n:.3),"minFacePresenceConfidence"in t&&g(this.H,2,(r=t.minFacePresenceConfidence)!=null?r:.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&g(this.v,2,(i=t.minPoseDetectionConfidence)!=null?i:.5),"minPoseSuppressionThreshold"in t&&g(this.v,3,(s=t.minPoseSuppressionThreshold)!=null?s:.3),"minPosePresenceConfidence"in t&&g(this.L,2,(o=t.minPosePresenceConfidence)!=null?o:.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&g(this.K,2,(a=t.minHandLandmarksConfidence)!=null?a:.5),this.l(t)}D(t,e,n){let r=typeof e!="function"?e:{};return this.C=typeof e=="function"?e:n,Oo(this),Lt(this,t,r),Bo(this)}F(t,e,n,r){let i=typeof n!="function"?n:{};return this.C=typeof n=="function"?n:r,Oo(this),Gt(this,t,i,e),Bo(this)}m(){var t=new ut;I(t,"input_frames_image"),x(t,"pose_landmarks"),x(t,"pose_world_landmarks"),x(t,"face_landmarks"),x(t,"left_hand_landmarks"),x(t,"left_hand_world_landmarks"),x(t,"right_hand_landmarks"),x(t,"right_hand_world_landmarks");let e=new mt,n=new no;ei(n,1,Xe("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(i,s){if(s!=null)if(Array.isArray(s))M(i,2,rr(s,Fi,void 0,void 0,!1));else{if(!(typeof s=="string"||s instanceof $t||ye(s)))throw Error("invalid value in Any.value field: "+s+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");ei(i,2,Ei(s,!1),we())}}(n,this.j.g());let r=new et;yt(r,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Vn(r,8,no,n),R(r,"IMAGE:input_frames_image"),A(r,"POSE_LANDMARKS:pose_landmarks"),A(r,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),A(r,"FACE_LANDMARKS:face_landmarks"),A(r,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),A(r,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),A(r,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),A(r,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),r.o(e),wt(t,r),wr(this,t),this.g.attachProtoListener("pose_landmarks",(i,s)=>{In(i,this.h.poseLandmarks),d(this,s)}),this.g.attachEmptyPacketListener("pose_landmarks",i=>{d(this,i)}),this.g.attachProtoListener("pose_world_landmarks",(i,s)=>{var o=this.h.poseWorldLandmarks;i=Me(i),o.push(ln(i)),d(this,s)}),this.g.attachEmptyPacketListener("pose_world_landmarks",i=>{d(this,i)}),this.outputPoseSegmentationMasks&&(A(r,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Be(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(i,s)=>{this.h.poseSegmentationMasks=[ze(this,i,!0,!this.C)],d(this,s)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",i=>{this.h.poseSegmentationMasks=[],d(this,i)})),this.g.attachProtoListener("face_landmarks",(i,s)=>{In(i,this.h.faceLandmarks),d(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",i=>{d(this,i)}),this.outputFaceBlendshapes&&(x(t,"extra_blendshapes"),A(r,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(i,s)=>{var a;var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(i=mr(i),o.push(ss((a=i.g())!=null?a:[]))),d(this,s)}),this.g.attachEmptyPacketListener("extra_blendshapes",i=>{d(this,i)})),this.g.attachProtoListener("left_hand_landmarks",(i,s)=>{In(i,this.h.leftHandLandmarks),d(this,s)}),this.g.attachEmptyPacketListener("left_hand_landmarks",i=>{d(this,i)}),this.g.attachProtoListener("left_hand_world_landmarks",(i,s)=>{var o=this.h.leftHandWorldLandmarks;i=Me(i),o.push(ln(i)),d(this,s)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",i=>{d(this,i)}),this.g.attachProtoListener("right_hand_landmarks",(i,s)=>{In(i,this.h.rightHandLandmarks),d(this,s)}),this.g.attachEmptyPacketListener("right_hand_landmarks",i=>{d(this,i)}),this.g.attachProtoListener("right_hand_world_landmarks",(i,s)=>{var o=this.h.rightHandWorldLandmarks;i=Me(i),o.push(ln(i)),d(this,s)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",i=>{d(this,i)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};C.prototype.detectForVideo=C.prototype.F,C.prototype.detect=C.prototype.D,C.prototype.setOptions=C.prototype.o,C.createFromModelPath=function(t,e){return T(C,t,{baseOptions:{modelAssetPath:e}})},C.createFromModelBuffer=function(t,e){return T(C,t,{baseOptions:{modelAssetBuffer:e}})},C.createFromOptions=function(t,e){return T(C,t,e)},C.HAND_CONNECTIONS=gs,C.POSE_CONNECTIONS=O1,C.FACE_LANDMARKS_LIPS=cs,C.FACE_LANDMARKS_LEFT_EYE=us,C.FACE_LANDMARKS_LEFT_EYEBROW=ls,C.FACE_LANDMARKS_LEFT_IRIS=U1,C.FACE_LANDMARKS_RIGHT_EYE=fs,C.FACE_LANDMARKS_RIGHT_EYEBROW=ds,C.FACE_LANDMARKS_RIGHT_IRIS=C1,C.FACE_LANDMARKS_FACE_OVAL=ps,C.FACE_LANDMARKS_CONTOURS=P1,C.FACE_LANDMARKS_TESSELATION=D1;var Tt=class extends ct{constructor(t,e){super(new St(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},y(t=this.h=new v1,0,1,e=new D)}get baseOptions(){return b(this.h,D,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){return y(this.h,0,2,hi(t,b(this.h,Zi,2))),this.l(t)}qa(t,e){return this.j={classifications:[]},Lt(this,t,e),this.j}ra(t,e,n){return this.j={classifications:[]},Gt(this,t,n,e),this.j}m(){var t=new ut;I(t,"input_image"),I(t,"norm_rect"),x(t,"classifications");let e=new mt;Mt(e,Ih,this.h);let n=new et;yt(n,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),R(n,"IMAGE:input_image"),R(n,"NORM_RECT:norm_rect"),A(n,"CLASSIFICATIONS:classifications"),n.o(e),wt(t,n),this.g.attachProtoListener("classifications",(r,i)=>{this.j=function(s){var a;let o={classifications:Yt(s,yh,1).map(h=>{var c,l,u,f;return ss((l=(c=b(h,qa,4))==null?void 0:c.g())!=null?l:[],(u=xt(h,2))!=null?u:0,(f=kt(h,3))!=null?f:"")})};return Jr(De(s,2))!=null&&(o.timestampMs=(a=Jr(De(s,2)))!=null?a:0),o}(wh(r)),d(this,i)}),this.g.attachEmptyPacketListener("classifications",r=>{d(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Tt.prototype.classifyForVideo=Tt.prototype.ra,Tt.prototype.classify=Tt.prototype.qa,Tt.prototype.setOptions=Tt.prototype.o,Tt.createFromModelPath=function(t,e){return T(Tt,t,{baseOptions:{modelAssetPath:e}})},Tt.createFromModelBuffer=function(t,e){return T(Tt,t,{baseOptions:{modelAssetBuffer:e}})},Tt.createFromOptions=function(t,e){return T(Tt,t,e)};var dt=class extends ct{constructor(t,e){super(new St(t,e),"image_in","norm_rect",!0),this.h=new y1,this.embeddings={embeddings:[]},y(t=this.h,0,1,e=new D)}get baseOptions(){return b(this.h,D,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){var e=this.h,n=b(this.h,lo,2);return n=n?n.clone():new lo,t.l2Normalize!==void 0?mn(n,1,t.l2Normalize):"l2Normalize"in t&&M(n,1),t.quantize!==void 0?mn(n,2,t.quantize):"quantize"in t&&M(n,2),y(e,0,2,n),this.l(t)}xa(t,e){return Lt(this,t,e),this.embeddings}ya(t,e,n){return Gt(this,t,n,e),this.embeddings}m(){var t=new ut;I(t,"image_in"),I(t,"norm_rect"),x(t,"embeddings_out");let e=new mt;Mt(e,Uh,this.h);let n=new et;yt(n,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),R(n,"IMAGE:image_in"),R(n,"NORM_RECT:norm_rect"),A(n,"EMBEDDINGS:embeddings_out"),n.o(e),wt(t,n),this.g.attachProtoListener("embeddings_out",(r,i)=>{r=Th(r),this.embeddings=function(s){var o;return{embeddings:Yt(s,Eh,1).map(a=>{var c,l,u,f,w,_,E;let h={headIndex:(l=(c=xt(a,3))!=null?c:0)!=null?l:-1,headName:(f=(u=kt(a,4))!=null?u:"")!=null?f:""};if(ya(a,uo,Gr(a,1))!==void 0)a=me(a=b(a,uo,Gr(a,1)),1,le,ge()),h.floatEmbedding=a.slice();else{let B=new Uint8Array(0);h.quantizedEmbedding=(E=(_=(w=b(a,_h,Gr(a,2)))==null?void 0:w.ma())==null?void 0:_.h())!=null?E:B}return h}),timestampMs:(o=Jr(De(s,2)))!=null?o:0}}(r),d(this,i)}),this.g.attachEmptyPacketListener("embeddings_out",r=>{d(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};dt.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=vo(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=vo(mo(t.quantizedEmbedding),mo(e.quantizedEmbedding))}return t},dt.prototype.embedForVideo=dt.prototype.ya,dt.prototype.embed=dt.prototype.xa,dt.prototype.setOptions=dt.prototype.o,dt.createFromModelPath=function(t,e){return T(dt,t,{baseOptions:{modelAssetPath:e}})},dt.createFromModelBuffer=function(t,e){return T(dt,t,{baseOptions:{modelAssetBuffer:e}})},dt.createFromOptions=function(t,e){return T(dt,t,e)};var di=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){var t,e;(t=this.confidenceMasks)==null||t.forEach(n=>{n.close()}),(e=this.categoryMask)==null||e.close()}};function No(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function Go(t){try{let e=new di(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{_r(t)}}di.prototype.close=di.prototype.close;var J=class extends ct{constructor(t,e){super(new St(t,e),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new is,this.v=new w1,y(this.h,0,3,this.v),y(t=this.h,0,1,e=new D)}get baseOptions(){return b(this.h,D,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){var e,n;return t.displayNamesLocale!==void 0?M(this.h,2,Xe(t.displayNamesLocale)):"displayNamesLocale"in t&&M(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=(e=t.outputCategoryMask)!=null?e:!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=(n=t.outputConfidenceMasks)!=null?n:!0),super.l(t)}J(){(function(t){var n,r,i;let e=Yt(t.ca(),et,1).filter(s=>{var o;return((o=kt(s,1))!=null?o:"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")});if(t.s=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");e.length===1&&((i=(r=(n=b(e[0],mt,7))==null?void 0:n.l())==null?void 0:r.g())!=null?i:new Map).forEach((s,o)=>{var a;t.s[Number(o)]=(a=kt(s,1))!=null?a:""})})(this)}segment(t,e,n){let r=typeof e!="function"?e:{};return this.j=typeof e=="function"?e:n,No(this),Lt(this,t,r),Go(this)}Ia(t,e,n,r){let i=typeof n!="function"?n:{};return this.j=typeof n=="function"?n:r,No(this),Gt(this,t,i,e),Go(this)}Ba(){return this.s}m(){var t=new ut;I(t,"image_in"),I(t,"norm_rect");let e=new mt;Mt(e,E1,this.h);let n=new et;yt(n,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),R(n,"IMAGE:image_in"),R(n,"NORM_RECT:norm_rect"),n.o(e),wt(t,n),wr(this,t),this.outputConfidenceMasks&&(x(t,"confidence_masks"),A(n,"CONFIDENCE_MASKS:confidence_masks"),Be(this,"confidence_masks"),this.g.ba("confidence_masks",(r,i)=>{this.confidenceMasks=r.map(s=>ze(this,s,!0,!this.j)),d(this,i)}),this.g.attachEmptyPacketListener("confidence_masks",r=>{this.confidenceMasks=[],d(this,r)})),this.outputCategoryMask&&(x(t,"category_mask"),A(n,"CATEGORY_MASK:category_mask"),Be(this,"category_mask"),this.g.V("category_mask",(r,i)=>{this.categoryMask=ze(this,r,!1,!this.j),d(this,i)}),this.g.attachEmptyPacketListener("category_mask",r=>{this.categoryMask=void 0,d(this,r)})),x(t,"quality_scores"),A(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(r,i)=>{this.qualityScores=r,d(this,i)}),this.g.attachEmptyPacketListener("quality_scores",r=>{this.categoryMask=void 0,d(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};J.prototype.getLabels=J.prototype.Ba,J.prototype.segmentForVideo=J.prototype.Ia,J.prototype.segment=J.prototype.segment,J.prototype.setOptions=J.prototype.o,J.createFromModelPath=function(t,e){return T(J,t,{baseOptions:{modelAssetPath:e}})},J.createFromModelBuffer=function(t,e){return T(J,t,{baseOptions:{modelAssetBuffer:e}})},J.createFromOptions=function(t,e){return T(J,t,e)};var pi=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){var t,e;(t=this.confidenceMasks)==null||t.forEach(n=>{n.close()}),(e=this.categoryMask)==null||e.close()}};pi.prototype.close=pi.prototype.close;var Vh=class extends p{constructor(t){super(t)}},ke=[0,z,-2],$n=[0,Vt,-3,P,Vt,-1],zo=[0,$n],jo=[0,$n,z,-1],$r=class extends p{constructor(t){super(t)}},Vo=[0,Vt,-1,P],Hh=class extends p{constructor(t){super(t)}},Ho=class extends p{constructor(t){super(t)}},gi=[1,2,3,4,5,6,7,8,9,10,14,15],B1=class extends p{constructor(t){super(t)}};B1.prototype.g=gr([0,q,[0,gi,S,$n,S,[0,$n,ke],S,zo,S,[0,zo,ke],S,Vo,S,[0,Vt,-3,P,gt],S,[0,Vt,-3,P],S,[0,L,Vt,-2,P,z,P,-1,2,Vt,ke],S,jo,S,[0,jo,ke],Vt,ke,L,S,[0,Vt,-3,P,ke,-1],S,[0,q,Vo]],L,[0,L,z,-1,P]]);var Dt=class extends ct{constructor(t,e){super(new St(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new is,this.s=new w1,y(this.h,0,3,this.s),y(t=this.h,0,1,e=new D)}get baseOptions(){return b(this.h,D,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){var e,n;return"outputCategoryMask"in t&&(this.outputCategoryMask=(e=t.outputCategoryMask)!=null?e:!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=(n=t.outputConfidenceMasks)!=null?n:!0),super.l(t)}segment(t,e,n,r){let i=typeof n!="function"?n:{};this.j=typeof n=="function"?n:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.B+1,r=new B1;let s=new Ho;var o=new Vh;if(Nt(o,1,255),y(s,0,12,o),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new $r;mn(a,3,!0),g(a,1,e.keypoint.x),g(a,2,e.keypoint.y),cn(s,5,gi,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new Hh,e.scribble))mn(e=new $r,3,!0),g(e,1,a.x),g(e,2,a.y),Vn(o,1,$r,e);cn(s,15,gi,o)}Vn(r,1,Ho,s),this.g.addProtoToStream(r.g(),"drishti.RenderData","roi_in",n),Lt(this,t,i);t:{try{let c=new pi(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var h=c;break t}this.j(c)}finally{_r(this)}h=void 0}return h}m(){var t=new ut;I(t,"image_in"),I(t,"roi_in"),I(t,"norm_rect_in");let e=new mt;Mt(e,E1,this.h);let n=new et;yt(n,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),R(n,"IMAGE:image_in"),R(n,"ROI:roi_in"),R(n,"NORM_RECT:norm_rect_in"),n.o(e),wt(t,n),wr(this,t),this.outputConfidenceMasks&&(x(t,"confidence_masks"),A(n,"CONFIDENCE_MASKS:confidence_masks"),Be(this,"confidence_masks"),this.g.ba("confidence_masks",(r,i)=>{this.confidenceMasks=r.map(s=>ze(this,s,!0,!this.j)),d(this,i)}),this.g.attachEmptyPacketListener("confidence_masks",r=>{this.confidenceMasks=[],d(this,r)})),this.outputCategoryMask&&(x(t,"category_mask"),A(n,"CATEGORY_MASK:category_mask"),Be(this,"category_mask"),this.g.V("category_mask",(r,i)=>{this.categoryMask=ze(this,r,!1,!this.j),d(this,i)}),this.g.attachEmptyPacketListener("category_mask",r=>{this.categoryMask=void 0,d(this,r)})),x(t,"quality_scores"),A(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(r,i)=>{this.qualityScores=r,d(this,i)}),this.g.attachEmptyPacketListener("quality_scores",r=>{this.categoryMask=void 0,d(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Dt.prototype.segment=Dt.prototype.segment,Dt.prototype.setOptions=Dt.prototype.o,Dt.createFromModelPath=function(t,e){return T(Dt,t,{baseOptions:{modelAssetPath:e}})},Dt.createFromModelBuffer=function(t,e){return T(Dt,t,{baseOptions:{modelAssetBuffer:e}})},Dt.createFromOptions=function(t,e){return T(Dt,t,e)};var At=class extends ct{constructor(t,e){super(new St(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},y(t=this.h=new T1,0,1,e=new D)}get baseOptions(){return b(this.h,D,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?M(this.h,2,Xe(t.displayNamesLocale)):"displayNamesLocale"in t&&M(this.h,2),t.maxResults!==void 0?Nt(this.h,3,t.maxResults):"maxResults"in t&&M(this.h,3),t.scoreThreshold!==void 0?g(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&M(this.h,4),t.categoryAllowlist!==void 0?Hn(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&M(this.h,5),t.categoryDenylist!==void 0?Hn(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&M(this.h,6),this.l(t)}D(t,e){return this.j={detections:[]},Lt(this,t,e),this.j}F(t,e,n){return this.j={detections:[]},Gt(this,t,n,e),this.j}m(){var t=new ut;I(t,"input_frame_gpu"),I(t,"norm_rect"),x(t,"detections");let e=new mt;Mt(e,Ph,this.h);let n=new et;yt(n,"mediapipe.tasks.vision.ObjectDetectorGraph"),R(n,"IMAGE:input_frame_gpu"),R(n,"NORM_RECT:norm_rect"),A(n,"DETECTIONS:detections"),n.o(e),wt(t,n),this.g.attachProtoVectorListener("detections",(r,i)=>{for(let s of r)r=Ja(s),this.j.detections.push(b1(r));d(this,i)}),this.g.attachEmptyPacketListener("detections",r=>{d(this,r)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};At.prototype.detectForVideo=At.prototype.F,At.prototype.detect=At.prototype.D,At.prototype.setOptions=At.prototype.o,At.createFromModelPath=function(t,e){return X(this,null,function*(){return T(At,t,{baseOptions:{modelAssetPath:e}})})},At.createFromModelBuffer=function(t,e){return T(At,t,{baseOptions:{modelAssetBuffer:e}})},At.createFromOptions=function(t,e){return T(At,t,e)};var mi=class{constructor(t,e,n){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=n}close(){var t;(t=this.segmentationMasks)==null||t.forEach(e=>{e.close()})}};function Xo(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function Wo(t){try{let e=new mi(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.s)return e;t.s(e)}finally{_r(t)}}mi.prototype.close=mi.prototype.close;var pt=class extends ct{constructor(t,e){super(new St(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,y(t=this.h=new A1,0,1,e=new D),this.v=new g1,y(this.h,0,3,this.v),this.j=new p1,y(this.h,0,2,this.j),Nt(this.j,4,1),g(this.j,2,.5),g(this.v,2,.5),g(this.h,4,.5)}get baseOptions(){return b(this.h,D,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){var e,n,r,i,s;return"numPoses"in t&&Nt(this.j,4,(e=t.numPoses)!=null?e:1),"minPoseDetectionConfidence"in t&&g(this.j,2,(n=t.minPoseDetectionConfidence)!=null?n:.5),"minTrackingConfidence"in t&&g(this.h,4,(r=t.minTrackingConfidence)!=null?r:.5),"minPosePresenceConfidence"in t&&g(this.v,2,(i=t.minPosePresenceConfidence)!=null?i:.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=(s=t.outputSegmentationMasks)!=null?s:!1),this.l(t)}D(t,e,n){let r=typeof e!="function"?e:{};return this.s=typeof e=="function"?e:n,Xo(this),Lt(this,t,r),Wo(this)}F(t,e,n,r){let i=typeof n!="function"?n:{};return this.s=typeof n=="function"?n:r,Xo(this),Gt(this,t,i,e),Wo(this)}m(){var t=new ut;I(t,"image_in"),I(t,"norm_rect"),x(t,"normalized_landmarks"),x(t,"world_landmarks"),x(t,"segmentation_masks");let e=new mt;Mt(e,Dh,this.h);let n=new et;yt(n,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),R(n,"IMAGE:image_in"),R(n,"NORM_RECT:norm_rect"),A(n,"NORM_LANDMARKS:normalized_landmarks"),A(n,"WORLD_LANDMARKS:world_landmarks"),n.o(e),wt(t,n),wr(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(r,i)=>{this.landmarks=[];for(let s of r)r=En(s),this.landmarks.push(yr(r));d(this,i)}),this.g.attachEmptyPacketListener("normalized_landmarks",r=>{this.landmarks=[],d(this,r)}),this.g.attachProtoVectorListener("world_landmarks",(r,i)=>{this.worldLandmarks=[];for(let s of r)r=Me(s),this.worldLandmarks.push(ln(r));d(this,i)}),this.g.attachEmptyPacketListener("world_landmarks",r=>{this.worldLandmarks=[],d(this,r)}),this.outputSegmentationMasks&&(A(n,"SEGMENTATION_MASK:segmentation_masks"),Be(this,"segmentation_masks"),this.g.ba("segmentation_masks",(r,i)=>{this.segmentationMasks=r.map(s=>ze(this,s,!0,!this.s)),d(this,i)}),this.g.attachEmptyPacketListener("segmentation_masks",r=>{this.segmentationMasks=[],d(this,r)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};pt.prototype.detectForVideo=pt.prototype.F,pt.prototype.detect=pt.prototype.D,pt.prototype.setOptions=pt.prototype.o,pt.createFromModelPath=function(t,e){return T(pt,t,{baseOptions:{modelAssetPath:e}})},pt.createFromModelBuffer=function(t,e){return T(pt,t,{baseOptions:{modelAssetBuffer:e}})},pt.createFromOptions=function(t,e){return T(pt,t,e)},pt.POSE_CONNECTIONS=O1;var N1={},Xh=function(t,e,n,r,i){var s=new Worker(N1[e]||(N1[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return s.onmessage=function(o){var a=o.data,h=a.$e$;if(h){var c=new Error(h[0]);c.code=h[1],c.stack=h[2],i(c,null)}else i(null,a)},s.postMessage(n,r),s},it=Uint8Array,Te=Uint16Array,j1=Int32Array,ms=new it([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),vs=new it([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),V1=new it([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),H1=function(t,e){for(var n=new Te(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var i=new j1(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return{b:n,r:i}},X1=H1(ms,2),ys=X1.b,Wh=X1.r;ys[28]=258,Wh[258]=28;var W1=H1(vs,0),$1=W1.b,Qu=W1.r,kr=new Te(32768);for(k=0;k<32768;++k)Jt=(k&43690)>>1|(k&21845)<<1,Jt=(Jt&52428)>>2|(Jt&13107)<<2,Jt=(Jt&61680)>>4|(Jt&3855)<<4,kr[k]=((Jt&65280)>>8|(Jt&255)<<8)>>1;var Jt,k,Je=function(t,e,n){for(var r=t.length,i=0,s=new Te(e);i<r;++i)t[i]&&++s[t[i]-1];var o=new Te(e);for(i=1;i<e;++i)o[i]=o[i-1]+s[i-1]<<1;var a;if(n){a=new Te(1<<e);var h=15-e;for(i=0;i<r;++i)if(t[i])for(var c=i<<4|t[i],l=e-t[i],u=o[t[i]-1]++<<l,f=u|(1<<l)-1;u<=f;++u)a[kr[u]>>h]=c}else for(a=new Te(r),i=0;i<r;++i)t[i]&&(a[i]=kr[o[t[i]-1]++]>>15-t[i]);return a},An=new it(288);for(k=0;k<144;++k)An[k]=8;var k;for(k=144;k<256;++k)An[k]=9;var k;for(k=256;k<280;++k)An[k]=7;var k;for(k=280;k<288;++k)An[k]=8;var k,K1=new it(32);for(k=0;k<32;++k)K1[k]=5;var k;var Y1=Je(An,9,1);var q1=Je(K1,5,1),br=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Ft=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},xr=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},Z1=function(t){return(t+7)/8|0},J1=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new it(t.subarray(e,n))};var Q1=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],_t=function(t,e,n){var r=new Error(e||Q1[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,_t),!n)throw r;return r},ws=function(t,e,n,r){var i=t.length,s=r?r.length:0;if(!i||e.f&&!e.l)return n||new it(0);var o=!n,a=o||e.i!=2,h=e.i;o&&(n=new it(i*3));var c=function(Fs){var Ms=n.length;if(Fs>Ms){var Rs=new it(Math.max(Ms*2,Fs));Rs.set(n),n=Rs}},l=e.f||0,u=e.p||0,f=e.b||0,w=e.l,_=e.d,E=e.m,B=e.n,H=i*8;do{if(!w){l=Ft(t,u,1);var st=Ft(t,u+1,3);if(u+=3,st)if(st==1)w=Y1,_=q1,E=9,B=5;else if(st==2){var Lr=Ft(t,u,31)+257,Es=Ft(t,u+10,15)+4,Ts=Lr+Ft(t,u+5,31)+1;u+=14;for(var tn=new it(Ts),Fr=new it(19),Et=0;Et<Es;++Et)Fr[V1[Et]]=Ft(t,u+Et*3,7);u+=Es*3;for(var As=br(Fr),o2=(1<<As)-1,a2=Je(Fr,As,1),Et=0;Et<Ts;){var bs=a2[Ft(t,u,o2)];u+=bs&15;var U=bs>>4;if(U<16)tn[Et++]=U;else{var Ae=0,bn=0;for(U==16?(bn=3+Ft(t,u,3),u+=2,Ae=tn[Et-1]):U==17?(bn=3+Ft(t,u,7),u+=3):U==18&&(bn=11+Ft(t,u,127),u+=7);bn--;)tn[Et++]=Ae}}var xs=tn.subarray(0,Lr),Qt=tn.subarray(Lr);E=br(xs),B=br(Qt),w=Je(xs,E,1),_=Je(Qt,B,1)}else _t(1);else{var U=Z1(u)+4,Qe=t[U-4]|t[U-3]<<8,Sr=U+Qe;if(Sr>i){h&&_t(0);break}a&&c(f+Qe),n.set(t.subarray(U,Sr),f),e.b=f+=Qe,e.p=u=Sr*8,e.f=l;continue}if(u>H){h&&_t(0);break}}a&&c(f+131072);for(var h2=(1<<E)-1,c2=(1<<B)-1,Mr=u;;Mr=u){var Ae=w[xr(t,u)&h2],be=Ae>>4;if(u+=Ae&15,u>H){h&&_t(0);break}if(Ae||_t(2),be<256)n[f++]=be;else if(be==256){Mr=u,w=null;break}else{var ks=be-254;if(be>264){var Et=be-257,en=ms[Et];ks=Ft(t,u,(1<<en)-1)+ys[Et],u+=en}var Rr=_[xr(t,u)&c2],Ir=Rr>>4;Rr||_t(3),u+=Rr&15;var Qt=$1[Ir];if(Ir>3){var en=vs[Ir];Qt+=xr(t,u)&(1<<en)-1,u+=en}if(u>H){h&&_t(0);break}a&&c(f+131072);var Ss=f+ks;if(f<Qt){var Ls=s-Qt,u2=Math.min(Qt,Ss);for(Ls+f<0&&_t(3);f<u2;++f)n[f]=r[Ls+f]}for(;f<Ss;++f)n[f]=n[f-Qt]}}e.l=w,e.p=Mr,e.b=f,e.f=l,w&&(l=1,e.m=E,e.d=_,e.n=B)}while(!l);return f!=n.length&&o?J1(n,0,f):n.subarray(0,f)};var $h=new it(0);var Kh=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},G1=function(t,e,n){for(var r=t(),i=t.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<r.length;++o){var a=r[o],h=s[o];if(typeof a=="function"){e+=";"+h+"=";var c=a.toString();if(a.prototype)if(c.indexOf("[native code]")!=-1){var l=c.indexOf(" ",8)+1;e+=c.slice(l,c.indexOf("(",l))}else{e+=c;for(var u in a.prototype)e+=";"+h+".prototype."+u+"="+a.prototype[u].toString()}else e+=c}else n[h]=a}return e},Ar=[],Yh=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},qh=function(t,e,n,r){if(!Ar[n]){for(var i="",s={},o=t.length-1,a=0;a<o;++a)i=G1(t[a],i,s);Ar[n]={c:G1(t[o],i,s),e:s}}var h=Kh({},Ar[n].e);return Xh(Ar[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,h,Yh(h),r)},Zh=function(){return[it,Te,j1,ms,vs,V1,ys,$1,Y1,q1,kr,Q1,Je,br,Ft,xr,Z1,J1,_t,ws,ec,t2,Qh]};var Jh=function(){return[e2,n2]};var t2=function(t){return postMessage(t,[t.buffer])},Qh=function(t){return t&&{out:t.size&&new it(t.size),dictionary:t.dictionary}},tc=function(t,e,n,r,i,s){var o=qh(n,r,i,function(a,h){o.terminate(),s(a,h)});return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}};var e2=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&_t(6,"invalid gzip data");var e=t[3],n=10;e&4&&(n+=(t[10]|t[11]<<8)+2);for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},n2=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0};function ec(t,e){return ws(t,{i:2},e&&e.out,e&&e.dictionary)}function r2(t,e,n){return n||(n=e,e={}),typeof n!="function"&&_t(7),tc(t,e,[Zh,Jh,function(){return[z1]}],function(r){return t2(z1(r.data[0],r.data[1]))},3,n)}function z1(t,e){var n=e2(t);return n+8>t.length&&_t(6,"invalid gzip data"),ws(t.subarray(n,-8),{i:2},e&&e.out||new it(n2(t)),e&&e.dictionary)}var nc=typeof TextDecoder!="undefined"&&new TextDecoder,rc=0;try{nc.decode($h,{stream:!0}),rc=1}catch(t){}var s2=(n=>(n.FaceDetector="FaceDetector",n.ImageSegmenter="ImageSegmenter",n))(s2||{}),i2={FaceDetector:[at,t=>t.detectForVideo.bind(t),"blaze_face_short_range.tflite"],ImageSegmenter:[J,t=>t.segmentForVideo.bind(t),"selfie_segmenter_landscape.tflite"]},zt=class zt{constructor(e){this.path=e;de(this,"hashTasks");de(this,"hashResults");de(this,"taskModels");de(this,"vision");de(this,"video");this.hashTasks=new Map,this.hashResults=new Map,this.taskModels=new Map}get basePath(){return this.path}get models(){return this.taskModels}get visionWasm(){return this.vision}static getInstance(e){return X(this,null,function*(){if(e){if(zt.instance&&zt.instance.path===e)return zt.instance;zt.instance=new zt(e),yield zt.instance.initVision()}return zt.instance})}preloadModels(e){return X(this,null,function*(){return yield Promise.all(e.map(n=>X(this,null,function*(){let r=this.getFinalUrl(`/mediapipe/${i2[n][2]}`),i=yield this.getBlobUrl(r,!1);this.taskModels.set(n,i)}))).catch(n=>{throw new Error(`models: ${e}. preloadModels error: ${n}`)})})}generateHash(e,n){return X(this,null,function*(){try{let r=this.normalizeOptions(n),i=JSON.stringify({taskType:e,options:r});return yield crypto.subtle.digest("SHA-256",new TextEncoder().encode(i)).then(s=>this.bufferToHex(s))}catch(r){throw new Error(`GenerateHash error: ${r}`)}})}normalizeOptions(e){let n={};for(let r of Object.keys(e).sort()){let i=e[r];i instanceof HTMLCanvasElement?n[r]={id:i.id}:typeof i=="object"&&i!==null?n[r]=this.normalizeOptions(i):n[r]=i}return n}bufferToHex(e){return Array.from(new Uint8Array(e)).map(n=>n.toString(16).padStart(2,"0")).join("")}register(e,n){return X(this,null,function*(){try{let r={baseOptions:{modelAssetPath:this.getModelUrl(e),delegate:"GPU"},runningMode:"VIDEO"};n!=null&&n.path&&r.baseOptions&&(r.baseOptions.modelAssetPath=n.path),n!=null&&n.canvas&&(r.canvas=n.canvas);let i=yield this.generateHash(e,r);if(!this.hashTasks.has(i)){let[s,o]=i2[e],a=yield s.createFromOptions(this.vision,r),h=o(a);this.hashTasks.set(i,[a,h])}return i}catch(r){throw new Error(`Register error: ${r}`)}})}getResult(e){try{if(!this.hashResults.has(e)){if(!this.hashTasks.get(e))throw new Error("Unregistered hash");this.hashResults.set(e,this.reasoning(e))}return this.hashResults.get(e)}catch(n){throw new Error(`GetResult error: ${n}`)}}reasoning(e){let n=this.hashTasks.get(e)[1];return n(this.video,performance.now())}getModelUrl(e){return this.taskModels.get(e)}getFinalUrl(e){return`${this.path}/${e}`.replace(/([^:]\/)\/+/g,"$1")}initVision(){return X(this,null,function*(){try{let e=(yield Ht.isSimdSupported())?"vision_wasm_internal":"vision_wasm_nosimd_internal",n=this.getFinalUrl(`/mediapipe/${e}`),[r,i]=[`${n}.wasm.gz`,`${n}.js.gz`],[s,o]=yield Promise.all([this.getBlobUrl(r),this.getBlobUrl(i)]);this.vision=yield Ht.forVisionTasks(""),this.vision.wasmBinaryPath=s,this.vision.wasmLoaderPath=o}catch(e){throw new Error(`initVision error: ${e}`)}})}getBlobUrl(e,n=!0){return X(this,null,function*(){let r=yield fetch(e);if(!r.ok)throw new Error(`Failed to fetch ${e}: ${r.status} ${r.statusText};`);let i;if(n){let s=yield r.arrayBuffer();i=yield new Promise((o,a)=>{r2(new Uint8Array(s),(h,c)=>{h&&a(h),o(new Blob([c],{type:this.isWasmFile(c)?"application/wasm":"application/javascript"}))})})}else i=yield r.blob();if(!(i instanceof Blob))throw new Error("Decompressed data is not a valid Blob");return URL.createObjectURL(i)})}isWasmFile(e){return e.length>=4&&e[0]===0&&e[1]===97&&e[2]===115&&e[3]===109}resetHashResults(){this.hashResults=new Map}};de(zt,"instance");var _s=zt;return y2(ic);})();
43
42
 
44
43
  (() => {
45
44
  if (typeof Vision !== 'undefined') {